@jasperoosthoek/react-toolbox 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/change-log.md +330 -312
- package/dist/components/buttons/ConfirmButton.d.ts +2 -2
- package/dist/components/buttons/DeleteConfirmButton.d.ts +2 -2
- package/dist/components/buttons/IconButtons.d.ts +40 -41
- package/dist/components/errors/Errors.d.ts +1 -2
- package/dist/components/forms/FormField.d.ts +22 -0
- package/dist/components/forms/FormFields.d.ts +1 -56
- package/dist/components/forms/FormModal.d.ts +7 -34
- package/dist/components/forms/FormModalProvider.d.ts +19 -26
- package/dist/components/forms/FormProvider.d.ts +66 -0
- package/dist/components/forms/fields/FormBadgesSelection.d.ts +26 -0
- package/dist/components/forms/fields/FormCheckbox.d.ts +7 -0
- package/dist/components/forms/fields/FormDropdown.d.ts +19 -0
- package/dist/components/forms/fields/FormInput.d.ts +17 -0
- package/dist/components/forms/fields/FormSelect.d.ts +12 -0
- package/dist/components/forms/fields/index.d.ts +5 -0
- package/dist/components/indicators/CheckIndicator.d.ts +1 -2
- package/dist/components/indicators/LoadingIndicator.d.ts +4 -4
- package/dist/components/login/LoginPage.d.ts +1 -1
- package/dist/components/tables/DataTable.d.ts +2 -2
- package/dist/components/tables/DragAndDropList.d.ts +2 -2
- package/dist/components/tables/SearchBox.d.ts +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -2
- package/dist/index.js.LICENSE.txt +0 -4
- package/dist/localization/LocalizationContext.d.ts +1 -1
- package/dist/utils/hooks.d.ts +1 -1
- package/dist/utils/timeAndDate.d.ts +5 -2
- package/dist/utils/utils.d.ts +3 -3
- package/package.json +10 -11
- package/src/__tests__/buttons.test.tsx +545 -0
- package/src/__tests__/errors.test.tsx +339 -0
- package/src/__tests__/forms.test.tsx +3021 -0
- package/src/__tests__/hooks.test.tsx +413 -0
- package/src/__tests__/indicators.test.tsx +284 -0
- package/src/__tests__/localization.test.tsx +462 -0
- package/src/__tests__/login.test.tsx +417 -0
- package/src/__tests__/setupTests.ts +328 -0
- package/src/__tests__/tables.test.tsx +609 -0
- package/src/__tests__/timeAndDate.test.tsx +308 -0
- package/src/__tests__/utils.test.tsx +422 -0
- package/src/components/forms/FormField.tsx +92 -0
- package/src/components/forms/FormFields.tsx +3 -423
- package/src/components/forms/FormModal.tsx +168 -243
- package/src/components/forms/FormModalProvider.tsx +141 -95
- package/src/components/forms/FormProvider.tsx +218 -0
- package/src/components/forms/fields/FormBadgesSelection.tsx +108 -0
- package/src/components/forms/fields/FormCheckbox.tsx +76 -0
- package/src/components/forms/fields/FormDropdown.tsx +123 -0
- package/src/components/forms/fields/FormInput.tsx +114 -0
- package/src/components/forms/fields/FormSelect.tsx +47 -0
- package/src/components/forms/fields/index.ts +6 -0
- package/src/index.ts +32 -29
- package/src/localization/LocalizationContext.tsx +156 -131
- package/src/localization/localization.ts +131 -131
- package/src/utils/hooks.ts +108 -94
- package/src/utils/timeAndDate.ts +33 -4
- package/src/utils/utils.ts +74 -66
- package/dist/components/forms/CreateEditModal.d.ts +0 -41
- package/dist/components/forms/CreateEditModalProvider.d.ts +0 -41
- package/dist/components/forms/FormFields.test.d.ts +0 -4
- package/dist/login/Login.d.ts +0 -70
- package/src/components/forms/FormFields.test.tsx +0 -107
package/change-log.md
CHANGED
|
@@ -1,312 +1,330 @@
|
|
|
1
|
-
##### Version 0.2.1
|
|
2
|
-
- Fix not updating state correctly in `CreateEditModal` component .
|
|
3
|
-
- Install packages for development
|
|
4
|
-
|
|
5
|
-
##### Version 0.2.2
|
|
6
|
-
- New `style` prop for `DataTable` component
|
|
7
|
-
- Fix `FormInput` has `type="input"`
|
|
8
|
-
- `FormSelect` correctly handles "no data" by selecting hidden option
|
|
9
|
-
- Refactor `IconButtons` & be able to pass `children` prop
|
|
10
|
-
- Language strings for `DeleteConfirmButton`
|
|
11
|
-
|
|
12
|
-
##### Version 0.2.3
|
|
13
|
-
- New `dialogClassName` prop in `CreateEditModal` component
|
|
14
|
-
|
|
15
|
-
##### Version 0.2.4
|
|
16
|
-
- New `useSetState` hook that mimics the `setState` behavior of class based components
|
|
17
|
-
- New `useWithDispatch` hook that turns a redux action or object with redux actions to dispatchable hooks
|
|
18
|
-
|
|
19
|
-
##### Version 0.2.5
|
|
20
|
-
- Optional `width` prop in `CreateEditModal` component
|
|
21
|
-
- Improved `FormCheckbox` and `FormSelectControl` component
|
|
22
|
-
- `LoadingIndicator` component uses jumbotron component from Bootstrap 4
|
|
23
|
-
- New `loginFactory` that creates `Login` component & redux actions and reducer
|
|
24
|
-
|
|
25
|
-
##### Version 0.2.6
|
|
26
|
-
- New `useLocalization` hook
|
|
27
|
-
- New `required` property in `CreateEditModal` component
|
|
28
|
-
- Make initial state of `auth.user` `null` instead of `{}`
|
|
29
|
-
|
|
30
|
-
##### Version 0.2.7
|
|
31
|
-
- New `FormDate` and `FormDateTime` component
|
|
32
|
-
##### Version 0.2.8
|
|
33
|
-
- New `setState` prop given to custom component in `CreateEditModal` component
|
|
34
|
-
|
|
35
|
-
##### Version 0.2.9
|
|
36
|
-
- New `icon-button` html class added to `IconButton` component
|
|
37
|
-
|
|
38
|
-
##### Version 0.2.10
|
|
39
|
-
- Remove `lodash` dependency as it was only used once
|
|
40
|
-
- New `FormBadgesSelection` component as an alternative to `FormSelect`
|
|
41
|
-
- Merge `initialState` with automatically produced state in `CreateEditModal`
|
|
42
|
-
|
|
43
|
-
##### Version 0.2.11
|
|
44
|
-
- New `initialState` and `initialValue` props given to form component in `CreateEditModal` and to `disabled` function in `FormSelect` and `FormBadgesSelection` components
|
|
45
|
-
|
|
46
|
-
##### Version 0.2.12
|
|
47
|
-
- Fix giving unrecognised `restProps` to form components
|
|
48
|
-
|
|
49
|
-
##### Version 0.2.13
|
|
50
|
-
- New `buttonSize` prop in Icon buttons to set the size of the `Button` component
|
|
51
|
-
- New `QuestionnaireButton` and `CheckIndicator` component
|
|
52
|
-
|
|
53
|
-
##### Version 0.2.14
|
|
54
|
-
- New `UnCheckButton` component with same icon as `CheckIndicator`
|
|
55
|
-
|
|
56
|
-
##### Version 0.2.15
|
|
57
|
-
- Fix missing `React` import in `CheckIndicator` component
|
|
58
|
-
|
|
59
|
-
##### Version 0.2.16
|
|
60
|
-
- Make 'Are u sure?' default text in `ConfirmButton` component
|
|
61
|
-
|
|
62
|
-
##### Version 0.2.17
|
|
63
|
-
- New `BigSpinner` component
|
|
64
|
-
- Fix `UploadTextButton` not working
|
|
65
|
-
|
|
66
|
-
##### Version 0.2.18
|
|
67
|
-
- New `FormDropdown` component
|
|
68
|
-
- Fix `CreateEditModal` component crashes when using `show` prop to toggle modal
|
|
69
|
-
|
|
70
|
-
##### Version 0.2.19
|
|
71
|
-
- New `useInterval` hook
|
|
72
|
-
|
|
73
|
-
##### Version 0.2.20
|
|
74
|
-
- New `SearchBox` and `SearchIcon` components
|
|
75
|
-
- Fix not resetting state in `CreateEditModal` when toggle `show` prop
|
|
76
|
-
|
|
77
|
-
##### Version 0.2.21
|
|
78
|
-
- Move localization strings to `src/localizations/strings.js`
|
|
79
|
-
- Fix making additional localization strings work
|
|
80
|
-
- Convert back and forth to `utc` in `FormDateTime` component
|
|
81
|
-
|
|
82
|
-
##### Version 0.2.22
|
|
83
|
-
- New `ShowButton` and `HideButton` components
|
|
84
|
-
|
|
85
|
-
##### Version 0.2.23
|
|
86
|
-
- Await result of `onConfirm()` in `ConfirmButton`
|
|
87
|
-
|
|
88
|
-
##### Version 0.2.24
|
|
89
|
-
- New `rowClassName` prop and add missing localization strings to `DataTable`
|
|
90
|
-
|
|
91
|
-
##### Version 0.3.0
|
|
92
|
-
- Minimal typescript configuration
|
|
93
|
-
|
|
94
|
-
##### Version 0.3.1
|
|
95
|
-
- Add `*.d.ts` files during build
|
|
96
|
-
|
|
97
|
-
##### Version 0.3.2
|
|
98
|
-
- Fix missing `types` in `package.json`
|
|
99
|
-
|
|
100
|
-
##### Version 0.3.3
|
|
101
|
-
- Fix default `rowsPerPage` option in `DataTable`
|
|
102
|
-
|
|
103
|
-
##### Version 0.3.4
|
|
104
|
-
- Simplify `IconButtons` & new `makeIconButton` function
|
|
105
|
-
- New `text` tag function to make using localization strings more concise
|
|
106
|
-
- Additional localization supports function and takes arguments from `text` tag function
|
|
107
|
-
- New `setLanguage` function and `languages` override to set available languages
|
|
108
|
-
- `useSetState` hook supports `callback` in setter function similar to `setState` in `class` components
|
|
109
|
-
- New optional `callback` function argument to `getCurrentUser`
|
|
110
|
-
- New French translation
|
|
111
|
-
- New `storeState` & `retrieveState` functions to store and retrieve state object from `localStorage`
|
|
112
|
-
- Convert everything to Typescript
|
|
113
|
-
- `CreateEditModal` component uses `onKeyDown` instead of deprecated `onKeyPress` handler
|
|
114
|
-
|
|
115
|
-
##### Version 0.3.5
|
|
116
|
-
- New `SaveButton` component
|
|
117
|
-
- New `setLocalization` function supplied by `useLocalization` to reset localization
|
|
118
|
-
- Fix bug in `text` function parameter types supplied by `useLocalization`
|
|
119
|
-
|
|
120
|
-
##### Version 0.3.6
|
|
121
|
-
- New `ErrorBoundary` provider that can supply custom error events
|
|
122
|
-
|
|
123
|
-
##### Version 0.3.7
|
|
124
|
-
- Improve out of context error in `ErrorBoundary` and remove debug console.log
|
|
125
|
-
|
|
126
|
-
##### Version 0.4.0
|
|
127
|
-
- Upgrade to `react@18.2.0`
|
|
128
|
-
- Install `jest` and related packages for testing
|
|
129
|
-
- Write tests for `FormFields` components
|
|
130
|
-
|
|
131
|
-
##### Version 0.4.1
|
|
132
|
-
- Upgrade dependencies
|
|
133
|
-
|
|
134
|
-
##### Version 0.4.2
|
|
135
|
-
- Fix incorrect props types in `DataTable` component
|
|
136
|
-
|
|
137
|
-
##### Version 0.4.3
|
|
138
|
-
- Fix incorrect `onMove` type of `DataTable` component prop
|
|
139
|
-
|
|
140
|
-
##### Version 0.4.4
|
|
141
|
-
- Improve types of `DataTableProps`
|
|
142
|
-
|
|
143
|
-
##### Version 0.4.5
|
|
144
|
-
- Fix pagination not working correctly in `DataTable` component
|
|
145
|
-
- Improve types of `CreateEditModalProps`
|
|
146
|
-
|
|
147
|
-
##### Version 0.4.6
|
|
148
|
-
- Allow `modalTitle` prop in `CreateEditModal` component to be `ReactElement` and string
|
|
149
|
-
- Allow props in `ConfirmButton` and `DeleteConfirmButton` component to be `ReactElement` and string
|
|
150
|
-
- Fix: loading spinner visible in modal of `DeleteConfirmButton`
|
|
151
|
-
|
|
152
|
-
##### Version 0.4.7
|
|
153
|
-
- Fix: Incorrect return type of `OnClickRow` type
|
|
154
|
-
|
|
155
|
-
##### Version 0.4.8
|
|
156
|
-
- Improvements of `CreateEditModal` types
|
|
157
|
-
|
|
158
|
-
##### Version 0.4.9
|
|
159
|
-
- Fix: Allow `component` prop of `SmallSpinner` to be string
|
|
160
|
-
- Fix: Allow `axios` prop of `loginFactory` to be of type `AxiosInstance`
|
|
161
|
-
- Fix: Not including languages from `additionalLocalization` in `LocalizationProvider`
|
|
162
|
-
- Hook `useWithDispatch` only takes function as an argument to fix broken return type
|
|
163
|
-
- Fix: `useLogin` output has types
|
|
164
|
-
|
|
165
|
-
##### Version 0.4.10
|
|
166
|
-
- Add type to input argument of `onChange` and `onKeyPress` functions
|
|
167
|
-
- Login when press enter key on email and password field on `Login` component
|
|
168
|
-
|
|
169
|
-
##### Version 0.4.11
|
|
170
|
-
- Make `onLogout` parameter optional in loginFactory
|
|
171
|
-
- Add `axios` as a dependency
|
|
172
|
-
|
|
173
|
-
##### Version 0.4.12
|
|
174
|
-
- Add missing localization for enter_email
|
|
175
|
-
|
|
176
|
-
##### Version 0.4.13
|
|
177
|
-
- Prevent login when either email address of password field is empty
|
|
178
|
-
- New optional `label` prop `Login` component
|
|
179
|
-
|
|
180
|
-
##### Version 0.4.14
|
|
181
|
-
- Replace deprecated `onKeyPress` props with `onKeyDown`
|
|
182
|
-
- Allow column name of `DataTable` to be `ReactNode`
|
|
183
|
-
|
|
184
|
-
##### Version 0.4.15
|
|
185
|
-
- New `CreateEditModalProvider` component
|
|
186
|
-
|
|
187
|
-
##### Version 0.4.16
|
|
188
|
-
- Selectively show components in header of `DataTable` component
|
|
189
|
-
|
|
190
|
-
##### Version 0.4.17
|
|
191
|
-
- Allow `textOnEmpty` of `DataTable` to be string
|
|
192
|
-
- New `cancelText` prop and make `confirmText` prop optional in `ConfirmButton` component
|
|
193
|
-
- Move `ConfirmButton` and `DeleteConfirmButton` to separate files
|
|
194
|
-
|
|
195
|
-
##### Version 0.4.18
|
|
196
|
-
- New `useLocalStorage` hook that functions like `useState`
|
|
197
|
-
- The `DataTable` `selector` function can output `string` and `number` as well
|
|
198
|
-
|
|
199
|
-
##### Version 0.4.19
|
|
200
|
-
- Improve `useLocalStorage` hook so it updates other components using it
|
|
201
|
-
|
|
202
|
-
##### Version 0.4.20
|
|
203
|
-
- New `PasteButton` component
|
|
204
|
-
|
|
205
|
-
##### Version 0.4.21
|
|
206
|
-
- Make `decimal` argument of `round` and `roundFixed` optional
|
|
207
|
-
|
|
208
|
-
##### Version 0.4.22
|
|
209
|
-
- Add `onClick` to column of `DataTable`
|
|
210
|
-
|
|
211
|
-
##### Version 0.4.23
|
|
212
|
-
- New `optionsDropdown` parameter and Dropdown menu in column of `DataTable`
|
|
213
|
-
|
|
214
|
-
##### Version 0.4.24
|
|
215
|
-
- Allow `validate` function in `CreateEditModal` to allow objects with empty values
|
|
216
|
-
|
|
217
|
-
##### Version 0.4.25
|
|
218
|
-
- Usable `onClick` handler in `ShowCreateModalButton` and `ShowEditModalButton`
|
|
219
|
-
|
|
220
|
-
##### Version 0.4.26
|
|
221
|
-
- Prop `orderByColumn` of `DataTable` can be a function that yields a number
|
|
222
|
-
|
|
223
|
-
##### Version 0.5.0
|
|
224
|
-
- Upgrade to `React` 18.3.1
|
|
225
|
-
|
|
226
|
-
##### Version 0.5.1
|
|
227
|
-
- Upgrade `react-redux` & `redux-thunk` to versions compatible with `redux` 5.0.1
|
|
228
|
-
- Update `Login` component to use `LoginActions` type.
|
|
229
|
-
|
|
230
|
-
##### Version 0.5.2
|
|
231
|
-
- Remove `prop-types` module and replace deprecated `defaultProps` with built in default properties
|
|
232
|
-
- Remove dependencies and only keep peerDependencies
|
|
233
|
-
|
|
234
|
-
##### Version 0.5.3
|
|
235
|
-
- Use `react` & `react-redux` as external modules in webpack config
|
|
236
|
-
|
|
237
|
-
##### Version 0.5.4
|
|
238
|
-
- Use `redux`, `redux-thunk`, `react-dom` & `react-dnd` as external modules in webpack config
|
|
239
|
-
|
|
240
|
-
##### Version 0.5.5
|
|
241
|
-
- Remove unnecessary packages from devDependencies
|
|
242
|
-
|
|
243
|
-
##### Version 0.5.6
|
|
244
|
-
- Rename `CreateEditModal` & `CreateEditModalProvider` to `FormModal` & `FormModalProvider`
|
|
245
|
-
- Remove out of context error when clicking row to open `EditModal` on `DataTable`
|
|
246
|
-
|
|
247
|
-
##### Version 0.5.7
|
|
248
|
-
- New optional footer with sum of values in `DataTable` component
|
|
249
|
-
|
|
250
|
-
##### Version 0.6.0
|
|
251
|
-
- Update to React 19
|
|
252
|
-
|
|
253
|
-
##### Version 0.6.1
|
|
254
|
-
- New `downloadFile` function in `utils`
|
|
255
|
-
|
|
256
|
-
##### Version 0.6.2
|
|
257
|
-
- `SearchBox` has optional label & placeholder and is wrapped by `Form.Group` component
|
|
258
|
-
|
|
259
|
-
##### Version 0.6.3
|
|
260
|
-
- New `textByLang` localization function in `useLocalization`
|
|
261
|
-
- New `combineLocalization` helper function
|
|
262
|
-
- Rename `ShowCreateModalButton` to `FormCreateModalButton`
|
|
263
|
-
- Rename `ShowEditModalButton` to `FormEditModalButton`
|
|
264
|
-
- Fix incorrect calculation of number of pages in `DataTable`
|
|
265
|
-
- Fix `FormModalProvider` does not pass `validate` function to create and edit modals
|
|
266
|
-
- New `ResetButton` component
|
|
267
|
-
|
|
268
|
-
##### Version 0.6.4
|
|
269
|
-
- Remove Node polyfills to for the module to work with Webpak 5+
|
|
270
|
-
|
|
271
|
-
##### Version 0.6.5
|
|
272
|
-
- The `DataTable` `selector` function can output `null` as well
|
|
273
|
-
|
|
274
|
-
##### Version 0.6.6
|
|
275
|
-
- Improve types of `FormFields`
|
|
276
|
-
- Validate `list` argument of `FormDropdown` component
|
|
277
|
-
|
|
278
|
-
##### Version 0.6.7
|
|
279
|
-
- New `customHeader` in `DataTable` component
|
|
280
|
-
- Stricter types in `FormDropdown` component
|
|
281
|
-
|
|
282
|
-
##### Version 0.6.8
|
|
283
|
-
- Fix: always opening `EditModal` when clicking row of `DataTable` regardless of `showEditModalOnClickRow` prop
|
|
284
|
-
|
|
285
|
-
##### Version 0.6.9
|
|
286
|
-
- `filterColumn` in `DataTable` can also be an array of strings or modifiers
|
|
287
|
-
|
|
288
|
-
##### Version 0.7.0
|
|
289
|
-
- Fix brackets in `filterColumn` type
|
|
290
|
-
|
|
291
|
-
##### Version 0.7.1
|
|
292
|
-
- Make `filterColumn` type less strict
|
|
293
|
-
|
|
294
|
-
##### Version 0.7.2
|
|
295
|
-
- Fix error when supplying `FormModal` with empty `FormFields`
|
|
296
|
-
- Fix placing `selected` on `option` html tag that breaks Reacts best practices
|
|
297
|
-
|
|
298
|
-
##### Version 0.7.3
|
|
299
|
-
- Upgrade to React@19.1.0
|
|
300
|
-
|
|
301
|
-
##### Version 0.7.4
|
|
302
|
-
- Fix type of `FormOnChange` to handle second argument
|
|
303
|
-
|
|
304
|
-
##### Version 0.7.5
|
|
305
|
-
- Make second input argument of `FormOnChange` optional
|
|
306
|
-
|
|
307
|
-
##### Version 0.8.0
|
|
308
|
-
- Completely remove Redux dependency
|
|
309
|
-
- Replace `Login` hook by simple `LoginPage` component
|
|
310
|
-
|
|
311
|
-
##### Version 0.8.1
|
|
312
|
-
- Fix typo that prevents import of `LoginPage` component
|
|
1
|
+
##### Version 0.2.1
|
|
2
|
+
- Fix not updating state correctly in `CreateEditModal` component .
|
|
3
|
+
- Install packages for development
|
|
4
|
+
|
|
5
|
+
##### Version 0.2.2
|
|
6
|
+
- New `style` prop for `DataTable` component
|
|
7
|
+
- Fix `FormInput` has `type="input"`
|
|
8
|
+
- `FormSelect` correctly handles "no data" by selecting hidden option
|
|
9
|
+
- Refactor `IconButtons` & be able to pass `children` prop
|
|
10
|
+
- Language strings for `DeleteConfirmButton`
|
|
11
|
+
|
|
12
|
+
##### Version 0.2.3
|
|
13
|
+
- New `dialogClassName` prop in `CreateEditModal` component
|
|
14
|
+
|
|
15
|
+
##### Version 0.2.4
|
|
16
|
+
- New `useSetState` hook that mimics the `setState` behavior of class based components
|
|
17
|
+
- New `useWithDispatch` hook that turns a redux action or object with redux actions to dispatchable hooks
|
|
18
|
+
|
|
19
|
+
##### Version 0.2.5
|
|
20
|
+
- Optional `width` prop in `CreateEditModal` component
|
|
21
|
+
- Improved `FormCheckbox` and `FormSelectControl` component
|
|
22
|
+
- `LoadingIndicator` component uses jumbotron component from Bootstrap 4
|
|
23
|
+
- New `loginFactory` that creates `Login` component & redux actions and reducer
|
|
24
|
+
|
|
25
|
+
##### Version 0.2.6
|
|
26
|
+
- New `useLocalization` hook
|
|
27
|
+
- New `required` property in `CreateEditModal` component
|
|
28
|
+
- Make initial state of `auth.user` `null` instead of `{}`
|
|
29
|
+
|
|
30
|
+
##### Version 0.2.7
|
|
31
|
+
- New `FormDate` and `FormDateTime` component
|
|
32
|
+
##### Version 0.2.8
|
|
33
|
+
- New `setState` prop given to custom component in `CreateEditModal` component
|
|
34
|
+
|
|
35
|
+
##### Version 0.2.9
|
|
36
|
+
- New `icon-button` html class added to `IconButton` component
|
|
37
|
+
|
|
38
|
+
##### Version 0.2.10
|
|
39
|
+
- Remove `lodash` dependency as it was only used once
|
|
40
|
+
- New `FormBadgesSelection` component as an alternative to `FormSelect`
|
|
41
|
+
- Merge `initialState` with automatically produced state in `CreateEditModal`
|
|
42
|
+
|
|
43
|
+
##### Version 0.2.11
|
|
44
|
+
- New `initialState` and `initialValue` props given to form component in `CreateEditModal` and to `disabled` function in `FormSelect` and `FormBadgesSelection` components
|
|
45
|
+
|
|
46
|
+
##### Version 0.2.12
|
|
47
|
+
- Fix giving unrecognised `restProps` to form components
|
|
48
|
+
|
|
49
|
+
##### Version 0.2.13
|
|
50
|
+
- New `buttonSize` prop in Icon buttons to set the size of the `Button` component
|
|
51
|
+
- New `QuestionnaireButton` and `CheckIndicator` component
|
|
52
|
+
|
|
53
|
+
##### Version 0.2.14
|
|
54
|
+
- New `UnCheckButton` component with same icon as `CheckIndicator`
|
|
55
|
+
|
|
56
|
+
##### Version 0.2.15
|
|
57
|
+
- Fix missing `React` import in `CheckIndicator` component
|
|
58
|
+
|
|
59
|
+
##### Version 0.2.16
|
|
60
|
+
- Make 'Are u sure?' default text in `ConfirmButton` component
|
|
61
|
+
|
|
62
|
+
##### Version 0.2.17
|
|
63
|
+
- New `BigSpinner` component
|
|
64
|
+
- Fix `UploadTextButton` not working
|
|
65
|
+
|
|
66
|
+
##### Version 0.2.18
|
|
67
|
+
- New `FormDropdown` component
|
|
68
|
+
- Fix `CreateEditModal` component crashes when using `show` prop to toggle modal
|
|
69
|
+
|
|
70
|
+
##### Version 0.2.19
|
|
71
|
+
- New `useInterval` hook
|
|
72
|
+
|
|
73
|
+
##### Version 0.2.20
|
|
74
|
+
- New `SearchBox` and `SearchIcon` components
|
|
75
|
+
- Fix not resetting state in `CreateEditModal` when toggle `show` prop
|
|
76
|
+
|
|
77
|
+
##### Version 0.2.21
|
|
78
|
+
- Move localization strings to `src/localizations/strings.js`
|
|
79
|
+
- Fix making additional localization strings work
|
|
80
|
+
- Convert back and forth to `utc` in `FormDateTime` component
|
|
81
|
+
|
|
82
|
+
##### Version 0.2.22
|
|
83
|
+
- New `ShowButton` and `HideButton` components
|
|
84
|
+
|
|
85
|
+
##### Version 0.2.23
|
|
86
|
+
- Await result of `onConfirm()` in `ConfirmButton`
|
|
87
|
+
|
|
88
|
+
##### Version 0.2.24
|
|
89
|
+
- New `rowClassName` prop and add missing localization strings to `DataTable`
|
|
90
|
+
|
|
91
|
+
##### Version 0.3.0
|
|
92
|
+
- Minimal typescript configuration
|
|
93
|
+
|
|
94
|
+
##### Version 0.3.1
|
|
95
|
+
- Add `*.d.ts` files during build
|
|
96
|
+
|
|
97
|
+
##### Version 0.3.2
|
|
98
|
+
- Fix missing `types` in `package.json`
|
|
99
|
+
|
|
100
|
+
##### Version 0.3.3
|
|
101
|
+
- Fix default `rowsPerPage` option in `DataTable`
|
|
102
|
+
|
|
103
|
+
##### Version 0.3.4
|
|
104
|
+
- Simplify `IconButtons` & new `makeIconButton` function
|
|
105
|
+
- New `text` tag function to make using localization strings more concise
|
|
106
|
+
- Additional localization supports function and takes arguments from `text` tag function
|
|
107
|
+
- New `setLanguage` function and `languages` override to set available languages
|
|
108
|
+
- `useSetState` hook supports `callback` in setter function similar to `setState` in `class` components
|
|
109
|
+
- New optional `callback` function argument to `getCurrentUser`
|
|
110
|
+
- New French translation
|
|
111
|
+
- New `storeState` & `retrieveState` functions to store and retrieve state object from `localStorage`
|
|
112
|
+
- Convert everything to Typescript
|
|
113
|
+
- `CreateEditModal` component uses `onKeyDown` instead of deprecated `onKeyPress` handler
|
|
114
|
+
|
|
115
|
+
##### Version 0.3.5
|
|
116
|
+
- New `SaveButton` component
|
|
117
|
+
- New `setLocalization` function supplied by `useLocalization` to reset localization
|
|
118
|
+
- Fix bug in `text` function parameter types supplied by `useLocalization`
|
|
119
|
+
|
|
120
|
+
##### Version 0.3.6
|
|
121
|
+
- New `ErrorBoundary` provider that can supply custom error events
|
|
122
|
+
|
|
123
|
+
##### Version 0.3.7
|
|
124
|
+
- Improve out of context error in `ErrorBoundary` and remove debug console.log
|
|
125
|
+
|
|
126
|
+
##### Version 0.4.0
|
|
127
|
+
- Upgrade to `react@18.2.0`
|
|
128
|
+
- Install `jest` and related packages for testing
|
|
129
|
+
- Write tests for `FormFields` components
|
|
130
|
+
|
|
131
|
+
##### Version 0.4.1
|
|
132
|
+
- Upgrade dependencies
|
|
133
|
+
|
|
134
|
+
##### Version 0.4.2
|
|
135
|
+
- Fix incorrect props types in `DataTable` component
|
|
136
|
+
|
|
137
|
+
##### Version 0.4.3
|
|
138
|
+
- Fix incorrect `onMove` type of `DataTable` component prop
|
|
139
|
+
|
|
140
|
+
##### Version 0.4.4
|
|
141
|
+
- Improve types of `DataTableProps`
|
|
142
|
+
|
|
143
|
+
##### Version 0.4.5
|
|
144
|
+
- Fix pagination not working correctly in `DataTable` component
|
|
145
|
+
- Improve types of `CreateEditModalProps`
|
|
146
|
+
|
|
147
|
+
##### Version 0.4.6
|
|
148
|
+
- Allow `modalTitle` prop in `CreateEditModal` component to be `ReactElement` and string
|
|
149
|
+
- Allow props in `ConfirmButton` and `DeleteConfirmButton` component to be `ReactElement` and string
|
|
150
|
+
- Fix: loading spinner visible in modal of `DeleteConfirmButton`
|
|
151
|
+
|
|
152
|
+
##### Version 0.4.7
|
|
153
|
+
- Fix: Incorrect return type of `OnClickRow` type
|
|
154
|
+
|
|
155
|
+
##### Version 0.4.8
|
|
156
|
+
- Improvements of `CreateEditModal` types
|
|
157
|
+
|
|
158
|
+
##### Version 0.4.9
|
|
159
|
+
- Fix: Allow `component` prop of `SmallSpinner` to be string
|
|
160
|
+
- Fix: Allow `axios` prop of `loginFactory` to be of type `AxiosInstance`
|
|
161
|
+
- Fix: Not including languages from `additionalLocalization` in `LocalizationProvider`
|
|
162
|
+
- Hook `useWithDispatch` only takes function as an argument to fix broken return type
|
|
163
|
+
- Fix: `useLogin` output has types
|
|
164
|
+
|
|
165
|
+
##### Version 0.4.10
|
|
166
|
+
- Add type to input argument of `onChange` and `onKeyPress` functions
|
|
167
|
+
- Login when press enter key on email and password field on `Login` component
|
|
168
|
+
|
|
169
|
+
##### Version 0.4.11
|
|
170
|
+
- Make `onLogout` parameter optional in loginFactory
|
|
171
|
+
- Add `axios` as a dependency
|
|
172
|
+
|
|
173
|
+
##### Version 0.4.12
|
|
174
|
+
- Add missing localization for enter_email
|
|
175
|
+
|
|
176
|
+
##### Version 0.4.13
|
|
177
|
+
- Prevent login when either email address of password field is empty
|
|
178
|
+
- New optional `label` prop `Login` component
|
|
179
|
+
|
|
180
|
+
##### Version 0.4.14
|
|
181
|
+
- Replace deprecated `onKeyPress` props with `onKeyDown`
|
|
182
|
+
- Allow column name of `DataTable` to be `ReactNode`
|
|
183
|
+
|
|
184
|
+
##### Version 0.4.15
|
|
185
|
+
- New `CreateEditModalProvider` component
|
|
186
|
+
|
|
187
|
+
##### Version 0.4.16
|
|
188
|
+
- Selectively show components in header of `DataTable` component
|
|
189
|
+
|
|
190
|
+
##### Version 0.4.17
|
|
191
|
+
- Allow `textOnEmpty` of `DataTable` to be string
|
|
192
|
+
- New `cancelText` prop and make `confirmText` prop optional in `ConfirmButton` component
|
|
193
|
+
- Move `ConfirmButton` and `DeleteConfirmButton` to separate files
|
|
194
|
+
|
|
195
|
+
##### Version 0.4.18
|
|
196
|
+
- New `useLocalStorage` hook that functions like `useState`
|
|
197
|
+
- The `DataTable` `selector` function can output `string` and `number` as well
|
|
198
|
+
|
|
199
|
+
##### Version 0.4.19
|
|
200
|
+
- Improve `useLocalStorage` hook so it updates other components using it
|
|
201
|
+
|
|
202
|
+
##### Version 0.4.20
|
|
203
|
+
- New `PasteButton` component
|
|
204
|
+
|
|
205
|
+
##### Version 0.4.21
|
|
206
|
+
- Make `decimal` argument of `round` and `roundFixed` optional
|
|
207
|
+
|
|
208
|
+
##### Version 0.4.22
|
|
209
|
+
- Add `onClick` to column of `DataTable`
|
|
210
|
+
|
|
211
|
+
##### Version 0.4.23
|
|
212
|
+
- New `optionsDropdown` parameter and Dropdown menu in column of `DataTable`
|
|
213
|
+
|
|
214
|
+
##### Version 0.4.24
|
|
215
|
+
- Allow `validate` function in `CreateEditModal` to allow objects with empty values
|
|
216
|
+
|
|
217
|
+
##### Version 0.4.25
|
|
218
|
+
- Usable `onClick` handler in `ShowCreateModalButton` and `ShowEditModalButton`
|
|
219
|
+
|
|
220
|
+
##### Version 0.4.26
|
|
221
|
+
- Prop `orderByColumn` of `DataTable` can be a function that yields a number
|
|
222
|
+
|
|
223
|
+
##### Version 0.5.0
|
|
224
|
+
- Upgrade to `React` 18.3.1
|
|
225
|
+
|
|
226
|
+
##### Version 0.5.1
|
|
227
|
+
- Upgrade `react-redux` & `redux-thunk` to versions compatible with `redux` 5.0.1
|
|
228
|
+
- Update `Login` component to use `LoginActions` type.
|
|
229
|
+
|
|
230
|
+
##### Version 0.5.2
|
|
231
|
+
- Remove `prop-types` module and replace deprecated `defaultProps` with built in default properties
|
|
232
|
+
- Remove dependencies and only keep peerDependencies
|
|
233
|
+
|
|
234
|
+
##### Version 0.5.3
|
|
235
|
+
- Use `react` & `react-redux` as external modules in webpack config
|
|
236
|
+
|
|
237
|
+
##### Version 0.5.4
|
|
238
|
+
- Use `redux`, `redux-thunk`, `react-dom` & `react-dnd` as external modules in webpack config
|
|
239
|
+
|
|
240
|
+
##### Version 0.5.5
|
|
241
|
+
- Remove unnecessary packages from devDependencies
|
|
242
|
+
|
|
243
|
+
##### Version 0.5.6
|
|
244
|
+
- Rename `CreateEditModal` & `CreateEditModalProvider` to `FormModal` & `FormModalProvider`
|
|
245
|
+
- Remove out of context error when clicking row to open `EditModal` on `DataTable`
|
|
246
|
+
|
|
247
|
+
##### Version 0.5.7
|
|
248
|
+
- New optional footer with sum of values in `DataTable` component
|
|
249
|
+
|
|
250
|
+
##### Version 0.6.0
|
|
251
|
+
- Update to React 19
|
|
252
|
+
|
|
253
|
+
##### Version 0.6.1
|
|
254
|
+
- New `downloadFile` function in `utils`
|
|
255
|
+
|
|
256
|
+
##### Version 0.6.2
|
|
257
|
+
- `SearchBox` has optional label & placeholder and is wrapped by `Form.Group` component
|
|
258
|
+
|
|
259
|
+
##### Version 0.6.3
|
|
260
|
+
- New `textByLang` localization function in `useLocalization`
|
|
261
|
+
- New `combineLocalization` helper function
|
|
262
|
+
- Rename `ShowCreateModalButton` to `FormCreateModalButton`
|
|
263
|
+
- Rename `ShowEditModalButton` to `FormEditModalButton`
|
|
264
|
+
- Fix incorrect calculation of number of pages in `DataTable`
|
|
265
|
+
- Fix `FormModalProvider` does not pass `validate` function to create and edit modals
|
|
266
|
+
- New `ResetButton` component
|
|
267
|
+
|
|
268
|
+
##### Version 0.6.4
|
|
269
|
+
- Remove Node polyfills to for the module to work with Webpak 5+
|
|
270
|
+
|
|
271
|
+
##### Version 0.6.5
|
|
272
|
+
- The `DataTable` `selector` function can output `null` as well
|
|
273
|
+
|
|
274
|
+
##### Version 0.6.6
|
|
275
|
+
- Improve types of `FormFields`
|
|
276
|
+
- Validate `list` argument of `FormDropdown` component
|
|
277
|
+
|
|
278
|
+
##### Version 0.6.7
|
|
279
|
+
- New `customHeader` in `DataTable` component
|
|
280
|
+
- Stricter types in `FormDropdown` component
|
|
281
|
+
|
|
282
|
+
##### Version 0.6.8
|
|
283
|
+
- Fix: always opening `EditModal` when clicking row of `DataTable` regardless of `showEditModalOnClickRow` prop
|
|
284
|
+
|
|
285
|
+
##### Version 0.6.9
|
|
286
|
+
- `filterColumn` in `DataTable` can also be an array of strings or modifiers
|
|
287
|
+
|
|
288
|
+
##### Version 0.7.0
|
|
289
|
+
- Fix brackets in `filterColumn` type
|
|
290
|
+
|
|
291
|
+
##### Version 0.7.1
|
|
292
|
+
- Make `filterColumn` type less strict
|
|
293
|
+
|
|
294
|
+
##### Version 0.7.2
|
|
295
|
+
- Fix error when supplying `FormModal` with empty `FormFields`
|
|
296
|
+
- Fix placing `selected` on `option` html tag that breaks Reacts best practices
|
|
297
|
+
|
|
298
|
+
##### Version 0.7.3
|
|
299
|
+
- Upgrade to React@19.1.0
|
|
300
|
+
|
|
301
|
+
##### Version 0.7.4
|
|
302
|
+
- Fix type of `FormOnChange` to handle second argument
|
|
303
|
+
|
|
304
|
+
##### Version 0.7.5
|
|
305
|
+
- Make second input argument of `FormOnChange` optional
|
|
306
|
+
|
|
307
|
+
##### Version 0.8.0
|
|
308
|
+
- Completely remove Redux dependency
|
|
309
|
+
- Replace `Login` hook by simple `LoginPage` component
|
|
310
|
+
|
|
311
|
+
##### Version 0.8.1
|
|
312
|
+
- Fix typo that prevents import of `LoginPage` component
|
|
313
|
+
|
|
314
|
+
##### Version 0.9.0
|
|
315
|
+
- **BREAKING**: Refactor form architecture - separate concerns between FormProvider (validation logic) and FormModal (UI only)
|
|
316
|
+
- New `FormProvider` component that handles all form state management and validation logic independently
|
|
317
|
+
- New `useFormField` hook provides shared logic for all form components - eliminates code duplication
|
|
318
|
+
- Reorganize form field components into dedicated `fields/` directory for better organization
|
|
319
|
+
- New dedicated form components: `FormInput`, `FormSelect`, `FormCheckbox`, `FormDropdown`, `FormBadgesSelection` all using consistent `useFormField` pattern
|
|
320
|
+
- FormModal now gets submit functionality from FormProvider via hooks instead of handling validation itself
|
|
321
|
+
- FormFieldsRenderer automatically chooses appropriate components based on field configuration
|
|
322
|
+
- Replace `moment` dependency with `date-fns` for better tree-shaking and modern date handling
|
|
323
|
+
- Uninstall `axios` and `downloadFile` no longer depends on `axios`.
|
|
324
|
+
- Enhanced `FormDateTime` component with better Date object support and ISO string conversion
|
|
325
|
+
- New date utility functions: `formatDate`, `formatDateTime`, `toUtc`, `fromUtc` using date-fns
|
|
326
|
+
- Form field components now accept direct HTML props instead of nested `formProps` for cleaner API
|
|
327
|
+
- Support both declarative (modal) and flexible (custom layout) form patterns
|
|
328
|
+
- Backwards compatible - existing FormModalProvider usage continues to work
|
|
329
|
+
- Renamed `FormTextArea` to `FormTextarea`
|
|
330
|
+
- Many more tests with about 72% coverage
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
2
|
import { Button } from 'react-bootstrap';
|
|
3
3
|
import { type ButtonProps } from './IconButtons';
|
|
4
4
|
export interface ConfirmButtonProps extends ButtonProps {
|
|
@@ -10,5 +10,5 @@ export interface ConfirmButtonProps extends ButtonProps {
|
|
|
10
10
|
onConfirm: (closeModal: () => void) => void;
|
|
11
11
|
buttonComponent: typeof Button;
|
|
12
12
|
}
|
|
13
|
-
declare const ConfirmButton: ({ modalTitle, modalBody, confirmText, cancelText, onConfirm, buttonComponent: ButtonComponent, loading, closeUsingCallback, ...props }: ConfirmButtonProps) =>
|
|
13
|
+
declare const ConfirmButton: ({ modalTitle, modalBody, confirmText, cancelText, onConfirm, buttonComponent: ButtonComponent, loading, closeUsingCallback, ...props }: ConfirmButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default ConfirmButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
2
|
import { ButtonProps } from './IconButtons';
|
|
3
3
|
export interface DeleteConfirmButtonProps extends ButtonProps {
|
|
4
4
|
modalTitle?: ReactElement | string;
|
|
@@ -6,5 +6,5 @@ export interface DeleteConfirmButtonProps extends ButtonProps {
|
|
|
6
6
|
confirmText?: ReactElement | string;
|
|
7
7
|
onDelete: () => void;
|
|
8
8
|
}
|
|
9
|
-
declare const DeleteConfirmButton: ({ modalTitle, modalBody, confirmText, onDelete, ...props }: DeleteConfirmButtonProps) =>
|
|
9
|
+
declare const DeleteConfirmButton: ({ modalTitle, modalBody, confirmText, onDelete, ...props }: DeleteConfirmButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default DeleteConfirmButton;
|