Commit 25bb353
Feat/date value datepicker (#1190)
* feat(datepicker): accepts dateValue as value
This issue was found in a scenario where I needed to update the selectedDate without clicking into
the component, just by passing a value to the Datepicker, and actually it just accepts changes by
clicking which I don't believe covers the use cases.
* chore(lint/prettier): cleaning code
Cleaning code
* removed unecessary debug
* test(fixing tests): finding why tests are not running
Tests stopped running locally, running it on the pipe
* chore: fixed testing for the use case scenario
* fix: removing commments
Comments removal
* chore(reducing complexity for datevalue): assertive state/context management according view/date
* chore: linting
* feat: added necessary documentation
* Update Datepicker.spec.tsx
chore: removing screen.debug
* chore: pipeline build fixes
* fix(clear button): fixed datepicker clear button to not displaying any selected date by using null"
Attributed null as a acceptable value to the selectedDate, also removed default args for weekstart
which was crashing the app due to an overlap with the component props
1039
* Update Datepicker.spec.tsx
* test(datepicker): clear
Clear should affect dateValue
* docs(datepicker): it should have right type for the new empty date case scenario texting property
Updated datepicker component storybook file controls, added the new property and its type so the dev
can simulate scenarios on storybook
* chore: removing unecessary console
* docs(datepicker): label naming
Changed the name from labelempty to label
* feat(datepicker): datevalue expects null to clear date
Now datevalue expects null to clear date, also a diff mechanism was added on the dateValue useffect
to prevent mass re-renders.
g
* feat(datepicker): datepicker should expect value and defaultValue
Now datepicker component accepts value and defaultValue as props comes from this is the most
intuitive pattern.
BREAKING CHANGE: A breaking change which affects the old property defaultDate being named now
defaultValue.
* feat(datepicker): datepicker default value and sideeffects
Setting defaultvalue to empty when the component loads, therefore updating its sideffects on
mounting considering dateview initialization | Added test cases to these scenarios | Added propper
naming and default values according flowbite patterns
BREAKING CHANGE: New defaultValue initialization value | Migrating from defaultDate to defaultValue
* feat: adding datevalue property
* feat: handling date value with propper test cases
* feat: handling date value with propper test cases
* feat: removed default value and renamed onchange prop
* feat: solved comments | updated tests and parameters
* feat: ts compiling
* feat: added null as a type reference for selectedDate
* feat: prettier
* feat: added value as a modifier
* feat: updated storybook to reflect controlled and uncontrolled model
* feat: removed debugger and renamed defaultDate to defaultValue
* feat: removed debugger and renamed defaultDate to defaultValue
* feat: format check
* feat: addressing hook dependencies
* feat: controlled component setup | clearn functionality
* feat: remove debugger statement
* feat: defaultDate empty and side-effects addressed
* feat: added changeset
* feat - changset to patch
---------
Co-authored-by: Dias, Diego <diasd@ae.com>1 parent 38913e5 commit 25bb353
File tree
10 files changed
+179
-46
lines changed- .changeset
- apps/web/content/docs/components
- packages/ui/src/components/Datepicker
- Views
10 files changed
+179
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
| |||
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
Lines changed: 92 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
31 | 65 | | |
32 | 66 | | |
33 | 67 | | |
| |||
37 | 71 | | |
38 | 72 | | |
39 | 73 | | |
40 | | - | |
| 74 | + | |
41 | 75 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 76 | + | |
| 77 | + | |
45 | 78 | | |
46 | 79 | | |
47 | 80 | | |
48 | 81 | | |
49 | 82 | | |
50 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
51 | 98 | | |
52 | 99 | | |
53 | 100 | | |
54 | 101 | | |
55 | 102 | | |
56 | 103 | | |
57 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
58 | 144 | | |
59 | 145 | | |
60 | 146 | | |
61 | 147 | | |
62 | 148 | | |
| 149 | + | |
63 | 150 | | |
0 commit comments