@k-int/stripes-kint-components 2.3.3 → 2.5.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/CHANGELOG.md +21 -7
- package/README.md +14 -1
- package/es/index.js +26 -2
- package/es/lib/ActionList/ActionList.js +20 -7
- package/es/lib/ActionList/ActionListFieldArray.js +86 -85
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +1 -3
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +2 -2
- package/es/lib/EditableRefdataList/EditableRefdataList.js +3 -0
- package/es/lib/EditableSettingsList/EditableSettingsList.js +4 -1
- package/es/lib/FormModal/FormModal.js +10 -1
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +62 -105
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +146 -0
- package/es/lib/SASQLookupComponent/TableBody/index.js +19 -0
- package/es/lib/SASQLookupComponent/index.js +9 -1
- package/es/lib/SASQRoute/SASQRoute.js +2 -2
- package/es/lib/Typedown/Typedown.js +5 -7
- package/es/lib/hooks/settingsHooks/useSettingSection.js +16 -3
- package/es/lib/hooks/settingsHooks/useSettings.js +14 -7
- package/es/lib/utils/generateKiwtQueryParams.js +21 -4
- package/es/lib/utils/highlightString.js +94 -0
- package/es/lib/utils/index.js +23 -1
- package/es/lib/utils/matchString.js +59 -0
- package/junit.xml +37 -37
- package/package.json +1 -2
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +42 -12
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +222 -93
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +20 -17
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +601 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +190 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +340 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +667 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +982 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +478 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +191 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +100 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +460 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +529 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +424 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +307 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +451 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +236 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +103 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +250 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +190 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +220 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +193 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +436 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +616 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +161 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +94 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +116 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +175 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +33 -18
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +8 -2
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +102 -24
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +14 -8
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +60 -153
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +373 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +6 -3
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +7 -25
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +7 -4
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +39 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +8 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +57 -6
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +29 -8
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +26 -8
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useAvailableCustomProperties.js.html +205 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +118 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +21 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +6 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +126 -51
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +36 -9
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +124 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +211 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +95 -20
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +29 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +127 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +112 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +112 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +126 -6
- package/src/artifacts/coverage-jest/lcov.info +2043 -718
- package/src/index.js +6 -1
- package/src/lib/ActionList/ActionList.js +12 -5
- package/src/lib/ActionList/ActionListFieldArray.js +86 -65
- package/src/lib/ActionList/README.md +19 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +1 -3
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +2 -2
- package/src/lib/EditableRefdataList/EditableRefdataList.js +3 -1
- package/src/lib/EditableSettingsList/EditableSettingsList.js +8 -1
- package/src/lib/FormModal/FormModal.js +6 -2
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +46 -77
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +96 -0
- package/src/lib/SASQLookupComponent/TableBody/index.js +1 -0
- package/src/lib/SASQLookupComponent/index.js +2 -1
- package/src/lib/SASQRoute/SASQRoute.js +1 -1
- package/src/lib/Typedown/Typedown.js +4 -10
- package/src/lib/hooks/settingsHooks/useSettingSection.js +19 -2
- package/src/lib/hooks/settingsHooks/useSettings.js +12 -5
- package/src/lib/utils/generateKiwtQueryParams.js +10 -1
- package/src/lib/utils/highlightString.js +42 -0
- package/src/lib/utils/index.js +4 -0
- package/src/lib/utils/matchString.js +14 -0
- package/styles/ActionListFieldArray.css +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
## 2.
|
|
2
|
-
*
|
|
3
|
-
*
|
|
1
|
+
## 2.5.0 In progress
|
|
2
|
+
* Added FilterConfig support to generateKiwtQueryParams
|
|
3
|
+
* Added a way to trigger inline creation externally through refs and useImperativeHandle
|
|
4
|
+
* Fix for ActionList editing. When a formatter was in place and a field was not editable, the formatter was ignored.
|
|
5
|
+
* Added disabled prop to create button so it is no longer to create infinite new rows, or enter create while editing another row.
|
|
6
|
+
* "Show filters" button on SASQ main pane still displayed when filters are visible
|
|
7
|
+
* AppSettings now use generateKiwtQueryParams and are not limitied to 10.
|
|
8
|
+
* FormModal now disables default footer button when form is invalid/prisitn/submitting (Submit handler must be asyncronous for submitting to be parsed correctly)
|
|
9
|
+
* Typedown labels are now accessible
|
|
4
10
|
|
|
5
|
-
## 2.
|
|
11
|
+
## 2.4.0 2022-04-21
|
|
12
|
+
* Custom Property component fixes
|
|
6
13
|
* Fix to actionAssigner callback pattern
|
|
7
14
|
* Tweak to remove marginBottom0 warning
|
|
8
15
|
* FormModal buttons have marginBottom0 prop on them now
|
|
9
16
|
* Fixed issue where cusotm property updates would not be reflected on the open view pane in settings
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
17
|
+
* Fixed inconsistent `retiredName` labelOverride function behaviour, where in `filters` the function accepted the name, and in `view` the function accepted the entire object. The behaviour has been standardised to be the name alone in both scenarios.
|
|
18
|
+
* Fixed improper custom property count behaviour in view mode, now only _set_ primary properties are included in the count.
|
|
19
|
+
* ActionListFieldArray changed autofocus to autoFocus to avoid react console noise
|
|
20
|
+
* Refactored SASQ Components to fix various bugs/oddities
|
|
21
|
+
* TableBody default now exported as SASQTableBody from module
|
|
22
|
+
* Table now no longer redraws on row click
|
|
23
|
+
* Formatting tweaks to fix horizontal scroll issue
|
|
24
|
+
* Manually clearing the search field now has the same effect as clicking the "x" button to clear, ensuring the items are refetched without a search term.
|
|
25
|
+
* Implementor can pass props to the filter pane via "filterPaneProps" on SASQRoute/SASQLookupComponent
|
|
26
|
+
* boldString, highlightString, matchString util functions
|
|
13
27
|
|
|
14
28
|
## 2.3.0 2022-03-25
|
|
15
29
|
* FormModal
|
package/README.md
CHANGED
|
@@ -10,10 +10,23 @@ This repository is available as a public NPM and is pre-transpiled, so it should
|
|
|
10
10
|
|
|
11
11
|
In the case where components from this repository require translations, it will need to be added to the `stripesDeps` array in the implementing module's `package.json`.
|
|
12
12
|
|
|
13
|
+
## Development
|
|
14
|
+
In order to develop this module within a stripes workspace, a couple of steps are needed
|
|
15
|
+
- An environment variable must be set up (See https://chlee.co/how-to-setup-environment-variables-for-windows-mac-and-linux/), `STRIPES_TRANSPILE_TOKENS="@k-int"`
|
|
16
|
+
- Clone this repository `git clone git@gitlab.com:knowledge-integration/folio/stripes-kint-components.git`
|
|
17
|
+
- Delete all the `devDependencies` in your local package.json. (DO NOT MERGE THESE CHANGES BACK TO MASTER)
|
|
18
|
+
- Nuke your workspace node_modules and rebuild
|
|
19
|
+
|
|
20
|
+
### What went wrong
|
|
21
|
+
- If you aren't seeing changes take effect double check
|
|
22
|
+
- Your environment variable is definitely set `printenv STRIPES_TRANSPILE_TOKENS` on Linux, Windows may differ
|
|
23
|
+
- The `es` directory does not exist inside your local copy of kint-components. When built, this directory is constructed, and will take precedence if present, so if present, always delete for development work
|
|
24
|
+
- If you aren't seeing translations properly, ensure stripes-kint-components is present in the stripesDeps of your implementing module
|
|
25
|
+
|
|
13
26
|
## Documentation
|
|
14
27
|
The gitlab repository for this project can be found [here](https://gitlab.com/knowledge-integration/folio/stripes-kint-components).
|
|
15
28
|
|
|
16
29
|
### Quick links
|
|
17
30
|
- [Components](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/-/tree/main/src/lib)
|
|
18
31
|
- [Hooks](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/-/tree/main/src/lib/hooks)
|
|
19
|
-
- [Utility functions](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/-/tree/main/src/lib/utils)
|
|
32
|
+
- [Utility functions](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/-/tree/main/src/lib/utils)
|
package/es/index.js
CHANGED
|
@@ -140,7 +140,7 @@ Object.defineProperty(exports, "RefdataButtons", {
|
|
|
140
140
|
Object.defineProperty(exports, "SASQLookupComponent", {
|
|
141
141
|
enumerable: true,
|
|
142
142
|
get: function get() {
|
|
143
|
-
return _SASQLookupComponent.
|
|
143
|
+
return _SASQLookupComponent.SASQLookupComponent;
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "SASQRoute", {
|
|
@@ -149,6 +149,12 @@ Object.defineProperty(exports, "SASQRoute", {
|
|
|
149
149
|
return _SASQRoute.default;
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
|
+
Object.defineProperty(exports, "SASQTableBody", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: function get() {
|
|
155
|
+
return _SASQLookupComponent.TableBody;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
152
158
|
Object.defineProperty(exports, "SASQViewComponent", {
|
|
153
159
|
enumerable: true,
|
|
154
160
|
get: function get() {
|
|
@@ -185,6 +191,12 @@ Object.defineProperty(exports, "Typedown", {
|
|
|
185
191
|
return _Typedown.default;
|
|
186
192
|
}
|
|
187
193
|
});
|
|
194
|
+
Object.defineProperty(exports, "boldString", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function get() {
|
|
197
|
+
return _utils.boldString;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
188
200
|
Object.defineProperty(exports, "composeValidators", {
|
|
189
201
|
enumerable: true,
|
|
190
202
|
get: function get() {
|
|
@@ -210,12 +222,24 @@ Object.defineProperty(exports, "groupCustomPropertiesByCtx", {
|
|
|
210
222
|
return _utils.groupCustomPropertiesByCtx;
|
|
211
223
|
}
|
|
212
224
|
});
|
|
225
|
+
Object.defineProperty(exports, "highlightString", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function get() {
|
|
228
|
+
return _utils.highlightString;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
213
231
|
Object.defineProperty(exports, "invalidNumber", {
|
|
214
232
|
enumerable: true,
|
|
215
233
|
get: function get() {
|
|
216
234
|
return _validators.invalidNumber;
|
|
217
235
|
}
|
|
218
236
|
});
|
|
237
|
+
Object.defineProperty(exports, "matchString", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function get() {
|
|
240
|
+
return _utils.matchString;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
219
243
|
Object.defineProperty(exports, "refdataOptions", {
|
|
220
244
|
enumerable: true,
|
|
221
245
|
get: function get() {
|
|
@@ -371,7 +395,7 @@ var _SearchField = _interopRequireDefault(require("./lib/SearchField"));
|
|
|
371
395
|
|
|
372
396
|
var _SASQRoute = _interopRequireDefault(require("./lib/SASQRoute"));
|
|
373
397
|
|
|
374
|
-
var _SASQLookupComponent =
|
|
398
|
+
var _SASQLookupComponent = require("./lib/SASQLookupComponent");
|
|
375
399
|
|
|
376
400
|
var _SASQViewComponent = _interopRequireDefault(require("./lib/SASQViewComponent"));
|
|
377
401
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = void 0;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
|
|
10
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
13
|
|
|
@@ -19,10 +21,14 @@ var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArr
|
|
|
19
21
|
|
|
20
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
23
|
|
|
22
|
-
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "createCallback", "editableFields", "fieldComponents", "hideCreateButton", "visibleFields"];
|
|
24
|
+
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "createCallback", "editableFields", "fieldComponents", "hideCreateButton", "label", "visibleFields"];
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
+
|
|
26
32
|
(function () {
|
|
27
33
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
28
34
|
enterModule && enterModule(module);
|
|
@@ -52,10 +58,10 @@ var propTypes = {
|
|
|
52
58
|
editableFields: _propTypes.default.object,
|
|
53
59
|
fieldComponents: _propTypes.default.object,
|
|
54
60
|
hideCreateButton: _propTypes.default.bool,
|
|
61
|
+
label: _propTypes.default.string,
|
|
55
62
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
56
63
|
};
|
|
57
|
-
|
|
58
|
-
var ActionList = function ActionList(_ref) {
|
|
64
|
+
var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
59
65
|
var actionAssigner = _ref.actionAssigner,
|
|
60
66
|
_ref$actionCalls = _ref.actionCalls,
|
|
61
67
|
actionCalls = _ref$actionCalls === void 0 ? {} : _ref$actionCalls,
|
|
@@ -69,9 +75,16 @@ var ActionList = function ActionList(_ref) {
|
|
|
69
75
|
_ref$fieldComponents = _ref.fieldComponents,
|
|
70
76
|
fieldComponents = _ref$fieldComponents === void 0 ? {} : _ref$fieldComponents,
|
|
71
77
|
hideCreateButton = _ref.hideCreateButton,
|
|
78
|
+
label = _ref.label,
|
|
72
79
|
visibleFields = _ref.visibleFields,
|
|
73
80
|
mclProps = _objectWithoutProperties(_ref, _excluded);
|
|
74
81
|
|
|
82
|
+
var ActionListFieldArrayWithRef = function ActionListFieldArrayWithRef(alfaProps) {
|
|
83
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionListFieldArray.default, _objectSpread({
|
|
84
|
+
ref: ref
|
|
85
|
+
}, alfaProps));
|
|
86
|
+
};
|
|
87
|
+
|
|
75
88
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
76
89
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, {
|
|
77
90
|
enableReinitialize: true,
|
|
@@ -94,12 +107,13 @@ var ActionList = function ActionList(_ref) {
|
|
|
94
107
|
actionAssigner: actionAssigner,
|
|
95
108
|
actionCalls: actionCalls,
|
|
96
109
|
columnMapping: columnMapping,
|
|
97
|
-
component:
|
|
110
|
+
component: ActionListFieldArrayWithRef,
|
|
98
111
|
creatableFields: creatableFields,
|
|
99
112
|
createCallback: createCallback,
|
|
100
113
|
editableFields: editableFields,
|
|
101
114
|
fieldComponents: fieldComponents,
|
|
102
115
|
hideCreateButton: hideCreateButton,
|
|
116
|
+
label: label,
|
|
103
117
|
name: "contentData",
|
|
104
118
|
visibleFields: visibleFields
|
|
105
119
|
}, mclProps))
|
|
@@ -107,8 +121,7 @@ var ActionList = function ActionList(_ref) {
|
|
|
107
121
|
}
|
|
108
122
|
})
|
|
109
123
|
});
|
|
110
|
-
};
|
|
111
|
-
|
|
124
|
+
});
|
|
112
125
|
ActionList.propTypes = propTypes;
|
|
113
126
|
var _default = ActionList;
|
|
114
127
|
var _default2 = _default;
|
|
@@ -23,9 +23,9 @@ var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/Acti
|
|
|
23
23
|
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "createCallback", "editableFields", "fields", "fieldComponents", "hideCreateButton", "visibleFields"],
|
|
27
|
-
_excluded2 = ["actionListActions"],
|
|
28
|
-
_excluded3 = ["actionListActions"],
|
|
26
|
+
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "createCallback", "editableFields", "fields", "fieldComponents", "hideCreateButton", "label", "visibleFields"],
|
|
27
|
+
_excluded2 = ["actionListActions", "fieldName", "fieldIndex"],
|
|
28
|
+
_excluded3 = ["actionListActions", "fieldName", "fieldIndex"],
|
|
29
29
|
_excluded4 = ["actionListActions"],
|
|
30
30
|
_excluded5 = ["formatter"];
|
|
31
31
|
|
|
@@ -48,8 +48,6 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
48
48
|
|
|
49
49
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
50
50
|
|
|
51
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
52
|
-
|
|
53
51
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
54
52
|
|
|
55
53
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -90,10 +88,10 @@ var propTypes = {
|
|
|
90
88
|
fieldComponents: _propTypes.default.object,
|
|
91
89
|
formatter: _propTypes.default.object,
|
|
92
90
|
hideCreateButton: _propTypes.default.bool,
|
|
91
|
+
label: _propTypes.default.string,
|
|
93
92
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
94
93
|
};
|
|
95
|
-
|
|
96
|
-
var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
94
|
+
var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(__signature__(function (_ref, ref) {
|
|
97
95
|
var actionAssigner = _ref.actionAssigner,
|
|
98
96
|
actionCalls = _ref.actionCalls,
|
|
99
97
|
columnMapping = _ref.columnMapping,
|
|
@@ -104,6 +102,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
104
102
|
fieldComponents = _ref.fieldComponents,
|
|
105
103
|
_ref$hideCreateButton = _ref.hideCreateButton,
|
|
106
104
|
hideCreateButton = _ref$hideCreateButton === void 0 ? false : _ref$hideCreateButton,
|
|
105
|
+
label = _ref.label,
|
|
107
106
|
visibleFields = _ref.visibleFields,
|
|
108
107
|
mclProps = _objectWithoutProperties(_ref, _excluded);
|
|
109
108
|
|
|
@@ -141,6 +140,8 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
141
140
|
|
|
142
141
|
var _fields$value$index = fields.value[index],
|
|
143
142
|
_a = _fields$value$index.actionListActions,
|
|
143
|
+
_fn = _fields$value$index.fieldName,
|
|
144
|
+
_fi = _fields$value$index.fieldIndex,
|
|
144
145
|
rowData = _objectWithoutProperties(_fields$value$index, _excluded2); // Find "edit" entry in actionAssigner
|
|
145
146
|
|
|
146
147
|
|
|
@@ -158,6 +159,8 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
158
159
|
var handleCreate = function handleCreate(index) {
|
|
159
160
|
var _fields$value$index2 = fields.value[index],
|
|
160
161
|
_a = _fields$value$index2.actionListActions,
|
|
162
|
+
_fn = _fields$value$index2.fieldName,
|
|
163
|
+
_fi = _fields$value$index2.fieldIndex,
|
|
161
164
|
rowData = _objectWithoutProperties(_fields$value$index2, _excluded3);
|
|
162
165
|
|
|
163
166
|
if (createCallback) {
|
|
@@ -167,6 +170,19 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
167
170
|
}
|
|
168
171
|
};
|
|
169
172
|
|
|
173
|
+
var handleClickCreate = function handleClickCreate() {
|
|
174
|
+
toggleEditing('NEW_ROW');
|
|
175
|
+
fields.push({});
|
|
176
|
+
}; // Way to go into create mode from external component, and way to tell internal editing state
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
180
|
+
return {
|
|
181
|
+
create: handleClickCreate,
|
|
182
|
+
editing: editing
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
|
|
170
186
|
var getColumnWidths = function getColumnWidths() {
|
|
171
187
|
var widthNotInUseByActions = editing ? TOTAL_WIDTH - EDITING_ACTIONS_WIDTH : TOTAL_WIDTH - NON_EDITING_ACTIONS_WIDTH;
|
|
172
188
|
var staticWidth = widthNotInUseByActions / visibleFields.length;
|
|
@@ -280,66 +296,15 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
280
296
|
});
|
|
281
297
|
};
|
|
282
298
|
|
|
283
|
-
var
|
|
299
|
+
var assignActions = function assignActions() {
|
|
284
300
|
return fields.map(function (fieldName, fieldIndex) {
|
|
285
301
|
// Fetch the content from the field Values
|
|
286
302
|
var cd = (0, _get.default)(values, fieldName);
|
|
287
|
-
cd.actionListActions = actionAssigner(cd);
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
if (editingRow) {
|
|
295
|
-
/*
|
|
296
|
-
Check if the property is a visible field.
|
|
297
|
-
If it is not then we don't allow editing in this component.
|
|
298
|
-
*/
|
|
299
|
-
var _iterator = _createForOfIteratorHelper(visibleFields),
|
|
300
|
-
_step;
|
|
301
|
-
|
|
302
|
-
try {
|
|
303
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
304
|
-
var _editableFields$key, _creatableFields$key;
|
|
305
|
-
|
|
306
|
-
var key = _step.value;
|
|
307
|
-
var editFunction = (_editableFields$key = editableFields[key]) !== null && _editableFields$key !== void 0 ? _editableFields$key : function () {
|
|
308
|
-
return true;
|
|
309
|
-
};
|
|
310
|
-
var createFunction = (_creatableFields$key = creatableFields[key]) !== null && _creatableFields$key !== void 0 ? _creatableFields$key : function () {
|
|
311
|
-
return true;
|
|
312
|
-
};
|
|
313
|
-
/*
|
|
314
|
-
Next check if this is a new row, if so we should run the createableField function with the data.
|
|
315
|
-
If it is not a new row, then we run the editableField function with the data,
|
|
316
|
-
and it should return true/false
|
|
317
|
-
For both checks
|
|
318
|
-
true => Field, false => display value
|
|
319
|
-
*/
|
|
320
|
-
|
|
321
|
-
if (!cd.id && createFunction(cd) || editFunction(cd)) {
|
|
322
|
-
returnObj[key] = fieldComponents[key] ? fieldComponents[key]({
|
|
323
|
-
name: "".concat(fieldName, ".").concat(key)
|
|
324
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
325
|
-
autofocus: fieldIndex === 0,
|
|
326
|
-
component: _components.TextField,
|
|
327
|
-
marginBottom0: true,
|
|
328
|
-
name: "".concat(fieldName, ".").concat(key),
|
|
329
|
-
parse: function parse(v) {
|
|
330
|
-
return v;
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
} catch (err) {
|
|
336
|
-
_iterator.e(err);
|
|
337
|
-
} finally {
|
|
338
|
-
_iterator.f();
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
return returnObj;
|
|
303
|
+
cd.actionListActions = actionAssigner(cd);
|
|
304
|
+
return _objectSpread(_objectSpread({}, cd), {}, {
|
|
305
|
+
fieldName: fieldName,
|
|
306
|
+
fieldIndex: fieldIndex
|
|
307
|
+
});
|
|
343
308
|
});
|
|
344
309
|
};
|
|
345
310
|
|
|
@@ -353,11 +318,47 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
353
318
|
visibleFields.forEach(function (key) {
|
|
354
319
|
returnObj[key] = function (cd) {
|
|
355
320
|
// Row is being edited if it has no id, or its id is in the editing string
|
|
356
|
-
var editingRow = cd.id === editing || !cd.id; //
|
|
321
|
+
var editingRow = cd.id === editing || !cd.id; // Default to the passed formatter values
|
|
357
322
|
|
|
358
|
-
var returnValue = cd[key];
|
|
323
|
+
var returnValue = formatter !== null && formatter !== void 0 && formatter[key] ? formatter[key](cd) : cd[key]; // If editing, replace values with fields
|
|
324
|
+
|
|
325
|
+
if (editingRow) {
|
|
326
|
+
var _editableFields$key, _creatableFields$key;
|
|
327
|
+
|
|
328
|
+
/*
|
|
329
|
+
Check if the property is a visible field.
|
|
330
|
+
If it is not then we don't allow editing in this component.
|
|
331
|
+
*/
|
|
332
|
+
var editFunction = (_editableFields$key = editableFields[key]) !== null && _editableFields$key !== void 0 ? _editableFields$key : function () {
|
|
333
|
+
return true;
|
|
334
|
+
};
|
|
335
|
+
var createFunction = (_creatableFields$key = creatableFields[key]) !== null && _creatableFields$key !== void 0 ? _creatableFields$key : function () {
|
|
336
|
+
return true;
|
|
337
|
+
};
|
|
338
|
+
/*
|
|
339
|
+
Next check if this is a new row, if so we should run the createableField function with the data.
|
|
340
|
+
If it is not a new row, then we run the editableField function with the data,
|
|
341
|
+
and it should return true/false
|
|
342
|
+
For both checks
|
|
343
|
+
true => Field, false => display value
|
|
344
|
+
*/
|
|
345
|
+
|
|
346
|
+
if (!cd.id && createFunction(cd) || editFunction(cd)) {
|
|
347
|
+
returnValue = fieldComponents[key] ? fieldComponents[key]({
|
|
348
|
+
name: "".concat(cd.fieldName, ".").concat(key)
|
|
349
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
350
|
+
autoFocus: cd.fieldIndex === 0,
|
|
351
|
+
component: _components.TextField,
|
|
352
|
+
marginBottom0: true,
|
|
353
|
+
name: "".concat(cd.fieldName, ".").concat(key),
|
|
354
|
+
parse: function parse(v) {
|
|
355
|
+
return v;
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
359
360
|
|
|
360
|
-
if (
|
|
361
|
+
if (formatter !== null && formatter !== void 0 && formatter[key]) {
|
|
361
362
|
returnValue = formatter[key](cd);
|
|
362
363
|
}
|
|
363
364
|
|
|
@@ -368,17 +369,20 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
368
369
|
};
|
|
369
370
|
|
|
370
371
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
371
|
-
children: [
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
372
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
373
|
+
className: _ActionListFieldArray.default.header,
|
|
374
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Headline, {
|
|
375
|
+
className: _ActionListFieldArray.default.headerText,
|
|
376
|
+
children: label
|
|
377
|
+
}), !hideCreateButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
378
|
+
disabled: editing || !actionCalls.create && !createCallback // DEPRECATED actionCalls
|
|
379
|
+
,
|
|
380
|
+
marginBottom0: true,
|
|
381
|
+
onClick: handleClickCreate,
|
|
382
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
383
|
+
id: "stripes-kint-components.actionList.create"
|
|
384
|
+
})
|
|
385
|
+
})]
|
|
382
386
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
|
|
383
387
|
columnMapping: _objectSpread(_objectSpread({}, columnMapping), {}, {
|
|
384
388
|
actionListActions: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
@@ -386,7 +390,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
386
390
|
})
|
|
387
391
|
}),
|
|
388
392
|
columnWidths: getColumnWidths(),
|
|
389
|
-
contentData:
|
|
393
|
+
contentData: assignActions(),
|
|
390
394
|
formatter: _objectSpread({
|
|
391
395
|
actionListActions: renderActionButtons
|
|
392
396
|
}, fieldAwareFormatter()),
|
|
@@ -394,12 +398,9 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
394
398
|
visibleColumns: [].concat(_toConsumableArray(visibleFields), ['actionListActions'])
|
|
395
399
|
}, restOfMclProps))]
|
|
396
400
|
});
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return [_reactFinalForm.useForm, _reactFinalForm.useFormState];
|
|
401
|
-
});
|
|
402
|
-
|
|
401
|
+
}, "useForm{{ change }}\nuseFormState{{ initialValues, pristine, submitting, values }}\nuseState{[editing, setEditing](null)}\nuseImperativeHandle{}", function () {
|
|
402
|
+
return [_reactFinalForm.useForm, _reactFinalForm.useFormState, _react.useImperativeHandle];
|
|
403
|
+
}));
|
|
403
404
|
ActionListFieldArray.propTypes = propTypes;
|
|
404
405
|
var _default = ActionListFieldArray;
|
|
405
406
|
var _default2 = _default;
|
|
@@ -15,8 +15,6 @@ var _reactIntl = require("react-intl");
|
|
|
15
15
|
|
|
16
16
|
var _reactQuery = require("react-query");
|
|
17
17
|
|
|
18
|
-
var _reactIntlSafeHtml = _interopRequireDefault(require("@folio/react-intl-safe-html"));
|
|
19
|
-
|
|
20
18
|
var _components = require("@folio/stripes/components");
|
|
21
19
|
|
|
22
20
|
var _FormModal = _interopRequireDefault(require("../../FormModal/FormModal"));
|
|
@@ -269,7 +267,7 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
|
|
|
269
267
|
id: "stripes-kint-components.customProperties.delete.confirmHeading"
|
|
270
268
|
}),
|
|
271
269
|
id: "delete-job-confirmation",
|
|
272
|
-
message: (_labelOverrides$confi3 = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmMessage) !== null && _labelOverrides$confi3 !== void 0 ? _labelOverrides$confi3 : /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
270
|
+
message: (_labelOverrides$confi3 = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmMessage) !== null && _labelOverrides$confi3 !== void 0 ? _labelOverrides$confi3 : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
273
271
|
id: "stripes-kint-components.customProperties.delete.confirmMessage",
|
|
274
272
|
values: {
|
|
275
273
|
name: customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
|
|
@@ -133,7 +133,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
133
133
|
}),
|
|
134
134
|
children: renderValue()
|
|
135
135
|
})
|
|
136
|
-
}), customProperty !== null && customProperty !== void 0 && customProperty.
|
|
136
|
+
}), customProperty !== null && customProperty !== void 0 && customProperty.note ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
137
137
|
xs: 6,
|
|
138
138
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
139
139
|
label: (_labelOverrides$inter3 = labelOverrides.internalNote) !== null && _labelOverrides$inter3 !== void 0 ? _labelOverrides$inter3 : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
@@ -143,7 +143,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
143
143
|
style: {
|
|
144
144
|
whiteSpace: 'pre-wrap'
|
|
145
145
|
},
|
|
146
|
-
children: customProperty.
|
|
146
|
+
children: customProperty.note
|
|
147
147
|
})
|
|
148
148
|
})
|
|
149
149
|
}) : null]
|
|
@@ -48,11 +48,13 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
48
48
|
|
|
49
49
|
var propTypes = {
|
|
50
50
|
desc: _propTypes.default.string,
|
|
51
|
+
label: _propTypes.default.string,
|
|
51
52
|
refdataEndpoint: _propTypes.default.string
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
55
56
|
var desc = _ref.desc,
|
|
57
|
+
label = _ref.label,
|
|
56
58
|
refdataEndpoint = _ref.refdataEndpoint;
|
|
57
59
|
|
|
58
60
|
/* A component that allows for editing of refdata values */
|
|
@@ -169,6 +171,7 @@ var EditableRefdataList = function EditableRefdataList(_ref) {
|
|
|
169
171
|
return false;
|
|
170
172
|
}
|
|
171
173
|
},
|
|
174
|
+
label: label,
|
|
172
175
|
visibleFields: ['label', 'value']
|
|
173
176
|
});
|
|
174
177
|
};
|
|
@@ -33,6 +33,7 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
33
33
|
var EditableSettingsList = function EditableSettingsList(_ref) {
|
|
34
34
|
var data = _ref.data,
|
|
35
35
|
initialValues = _ref.initialValues,
|
|
36
|
+
label = _ref.label,
|
|
36
37
|
onSave = _ref.onSave;
|
|
37
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, {
|
|
38
39
|
enableReinitialize: true,
|
|
@@ -51,6 +52,7 @@ var EditableSettingsList = function EditableSettingsList(_ref) {
|
|
|
51
52
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, {
|
|
52
53
|
component: _EditableSettingsListFieldArray.default,
|
|
53
54
|
data: data,
|
|
55
|
+
label: label,
|
|
54
56
|
name: "settings",
|
|
55
57
|
onSave: onSave
|
|
56
58
|
})
|
|
@@ -64,7 +66,8 @@ EditableSettingsList.propTypes = {
|
|
|
64
66
|
data: _propTypes.default.shape({
|
|
65
67
|
refdatavalues: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
66
68
|
}),
|
|
67
|
-
initialValues: _propTypes.default.object
|
|
69
|
+
initialValues: _propTypes.default.object,
|
|
70
|
+
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node, _propTypes.default.object])
|
|
68
71
|
};
|
|
69
72
|
var _default = EditableSettingsList;
|
|
70
73
|
var _default2 = _default;
|
|
@@ -55,7 +55,10 @@ var FormModal = function FormModal(_ref) {
|
|
|
55
55
|
}, formProps), {}, {
|
|
56
56
|
children: function children(_ref2) {
|
|
57
57
|
var handleSubmit = _ref2.handleSubmit,
|
|
58
|
-
|
|
58
|
+
_ref2$form = _ref2.form,
|
|
59
|
+
getState = _ref2$form.getState,
|
|
60
|
+
restart = _ref2$form.restart;
|
|
61
|
+
var formState = getState();
|
|
59
62
|
|
|
60
63
|
var handleClose = function handleClose(e) {
|
|
61
64
|
onClose(e);
|
|
@@ -67,16 +70,22 @@ var FormModal = function FormModal(_ref) {
|
|
|
67
70
|
|
|
68
71
|
if (footer) {
|
|
69
72
|
return footer({
|
|
73
|
+
formState: formState,
|
|
70
74
|
handleSubmit: handleSubmit,
|
|
71
75
|
handleClose: handleClose
|
|
72
76
|
});
|
|
73
77
|
}
|
|
74
78
|
|
|
79
|
+
var invalid = formState.invalid,
|
|
80
|
+
pristine = formState.pristine,
|
|
81
|
+
submitting = formState.submitting;
|
|
75
82
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.ModalFooter, {
|
|
76
83
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
77
84
|
buttonStyle: "primary",
|
|
85
|
+
disabled: submitting || invalid || pristine,
|
|
78
86
|
marginBottom0: true,
|
|
79
87
|
onClick: handleSubmit,
|
|
88
|
+
type: "submit",
|
|
80
89
|
children: (_labelOverrides$save = labelOverrides.save) !== null && _labelOverrides$save !== void 0 ? _labelOverrides$save : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
81
90
|
id: "stripes-kint-components.save"
|
|
82
91
|
})
|