@k-int/stripes-kint-components 4.5.1 → 4.6.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 +8 -1
- package/README.md +14 -0
- package/es/__mocks__/@folio/stripes/components.js +10 -21
- package/es/__mocks__/@folio/stripes/core.js +4 -7
- package/es/__mocks__/@folio/stripes/smart-components.js +4 -7
- package/es/__mocks__/react-query.js +4 -7
- package/es/__mocks__/react-router-dom.js +6 -7
- package/es/artifacts/coverage-jest/lcov-report/prettify.js +2 -2
- package/es/artifacts/coverage-jest/lcov-report/sorter.js +6 -6
- package/es/index.js +62 -49
- package/es/lib/ActionList/ActionList.js +38 -51
- package/es/lib/ActionList/ActionListFieldArray.js +143 -167
- package/es/lib/ActionList/index.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +57 -77
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +15 -19
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +111 -160
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +30 -67
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +36 -48
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +83 -121
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +9 -8
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +48 -135
- package/es/lib/CustomProperties/Config/index.js +4 -4
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +19 -21
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +11 -16
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +29 -27
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +11 -16
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +86 -103
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +26 -63
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +123 -115
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +95 -176
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +43 -44
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +23 -27
- package/es/lib/CustomProperties/Edit/index.js +5 -5
- package/es/lib/CustomProperties/Edit/testResources.js +13 -35
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +60 -81
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -57
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +39 -54
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +17 -16
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +27 -23
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +18 -45
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +18 -20
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +23 -52
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +37 -41
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +77 -225
- package/es/lib/CustomProperties/Filter/index.js +6 -6
- package/es/lib/CustomProperties/Filter/testResources.js +12 -32
- package/es/lib/CustomProperties/Filter/useOperators.js +17 -16
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +17 -30
- package/es/lib/CustomProperties/Filter/useValueProps.js +22 -27
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +19 -21
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +11 -16
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +49 -57
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +14 -23
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +17 -18
- package/es/lib/CustomProperties/View/index.js +3 -3
- package/es/lib/CustomProperties/View/testResources.js +4 -4
- package/es/lib/CustomProperties/index.js +18 -18
- package/es/lib/CycleButton/CycleButton.js +17 -32
- package/es/lib/CycleButton/index.js +1 -1
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +108 -150
- package/es/lib/EditableRefdataCategoryList/index.js +1 -1
- package/es/lib/EditableRefdataList/EditableRefdataList.js +127 -170
- package/es/lib/EditableRefdataList/index.js +1 -1
- package/es/lib/EditableSettingsList/EditableSettingsList.js +16 -13
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +18 -25
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +61 -90
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +21 -34
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +99 -83
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +17 -19
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +187 -275
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +74 -109
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +52 -157
- package/es/lib/EditableSettingsList/SettingField/index.js +3 -3
- package/es/lib/EditableSettingsList/index.js +3 -3
- package/es/lib/FormModal/FormModal.js +43 -46
- package/es/lib/FormModal/index.js +1 -1
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +23 -27
- package/es/lib/FormattedKintMessage/index.js +1 -1
- package/es/lib/IconSelect/IconSelect.js +48 -68
- package/es/lib/IconSelect/index.js +1 -1
- package/es/lib/NoResultsMessage/NoResultsMessage.js +18 -17
- package/es/lib/NoResultsMessage/index.js +1 -1
- package/es/lib/QueryTypedown/QueryTypedown.js +17 -38
- package/es/lib/QueryTypedown/index.js +1 -1
- package/es/lib/RefdataButtons/RefdataButtons.js +26 -29
- package/es/lib/RefdataButtons/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +83 -88
- package/es/lib/ResponsiveButtonGroup/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +27 -40
- package/es/lib/RichSelect/RichSelect.js +70 -86
- package/es/lib/RichSelect/index.js +2 -2
- package/es/lib/RichSelect/useSelectedOption.js +3 -12
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +115 -137
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +39 -45
- package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
- package/es/lib/SASQLookupComponent/index.js +2 -2
- package/es/lib/SASQRoute/SASQRoute.js +31 -37
- package/es/lib/SASQRoute/index.js +1 -1
- package/es/lib/SASQViewComponent/SASQViewComponent.js +38 -45
- package/es/lib/SASQViewComponent/index.js +1 -1
- package/es/lib/SearchField/SearchField.js +10 -16
- package/es/lib/SearchField/index.js +1 -1
- package/es/lib/SettingPage/SettingPage.js +21 -20
- package/es/lib/SettingPage/SettingPagePane.js +8 -6
- package/es/lib/SettingPage/index.js +2 -2
- package/es/lib/SettingsFormContainer/SettingsFormContainer.js +87 -0
- package/es/lib/SettingsFormContainer/index.js +13 -0
- package/es/lib/Typedown/Typedown.js +61 -79
- package/es/lib/Typedown/index.js +1 -1
- package/es/lib/constants/customProperties.js +11 -11
- package/es/lib/constants/endpoints.js +9 -0
- package/es/lib/constants/eventCodes.js +3 -3
- package/es/lib/contexts/SettingsContext.js +1 -1
- package/es/lib/contexts/index.js +1 -1
- package/es/lib/hooks/__mocks__/index.js +9 -29
- package/es/lib/hooks/index.js +31 -17
- package/es/lib/hooks/typedownHooks/index.js +3 -3
- package/es/lib/hooks/typedownHooks/useTypedown.js +48 -48
- package/es/lib/hooks/typedownHooks/useTypedownData.js +11 -21
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +12 -20
- package/es/lib/hooks/useActiveElement.js +8 -17
- package/es/lib/hooks/useCustomProperties.js +22 -30
- package/es/lib/hooks/useHelperApp.js +30 -49
- package/es/lib/hooks/useIntlKey.js +3 -5
- package/es/lib/hooks/useIntlKeyStore.js +44 -49
- package/es/lib/hooks/useInvalidateRefdata.js +3 -5
- package/es/lib/hooks/useKintIntl.js +28 -31
- package/es/lib/hooks/useKiwtFieldArray.js +34 -45
- package/es/lib/hooks/useKiwtSASQuery.js +38 -48
- package/es/lib/hooks/useLocalStorageState.js +6 -18
- package/es/lib/hooks/useModConfigEntries.js +49 -0
- package/es/lib/hooks/useMutateCustomProperties.js +19 -62
- package/es/lib/hooks/useMutateModConfigEntry.js +40 -0
- package/es/lib/hooks/useMutateRefdataCategory.js +19 -60
- package/es/lib/hooks/useMutateRefdataValue.js +28 -65
- package/es/lib/hooks/useQIndex.js +12 -26
- package/es/lib/hooks/useRefdata.js +17 -19
- package/es/lib/hooks/useSASQQueryMeta.js +13 -20
- package/es/lib/hooks/useTemplates.js +13 -12
- package/es/lib/settingsHooks/index.js +3 -3
- package/es/lib/settingsHooks/useAppSettings.js +18 -25
- package/es/lib/settingsHooks/useSettingSection.js +16 -17
- package/es/lib/settingsHooks/useSettings.js +58 -72
- package/es/lib/utils/buildUrl.js +5 -5
- package/es/lib/utils/generateKiwtQuery.js +3 -3
- package/es/lib/utils/generateKiwtQueryParams.js +85 -93
- package/es/lib/utils/groupCustomPropertiesByCtx.js +8 -18
- package/es/lib/utils/highlightString.js +17 -37
- package/es/lib/utils/index.js +29 -15
- package/es/lib/utils/matchString.js +4 -8
- package/es/lib/utils/modConfigEntriesQueryKey.js +24 -0
- package/es/lib/utils/parseErrorResponse.js +22 -63
- package/es/lib/utils/parseKiwtQueryGroups.js +10 -10
- package/es/lib/utils/parseKiwtQueryGroups.test.js +15 -15
- package/es/lib/utils/parseModConfigEntry.js +21 -0
- package/es/lib/utils/refdataQueryKey.js +2 -2
- package/es/lib/utils/selectorSafe.js +3 -3
- package/es/lib/utils/sortByLabel.js +3 -3
- package/es/lib/utils/toCamelCase.js +7 -12
- package/es/lib/utils/typedownQueryKey.js +2 -2
- package/es/lib/validators/index.js +1 -1
- package/es/lib/validators/validators.js +22 -29
- package/junit.xml +239 -1489
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +17 -17
- 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 +44 -44
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +53 -53
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +59 -59
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +29 -29
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +53 -53
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +19 -19
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +28 -28
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +94 -94
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +118 -118
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +28 -28
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +64 -64
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +33 -33
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +47 -47
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +19 -19
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +42 -42
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +96 -96
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +35 -35
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +38 -38
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +34 -34
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +16 -16
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +45 -45
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +36 -36
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +39 -39
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +64 -64
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +64 -64
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +43 -43
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +28 -28
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +32 -32
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +9 -9
- 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 +54 -54
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +17 -17
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +17 -17
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +13 -13
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +18 -18
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/SettingsFormContainer.js.html +337 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/constants/endpoints.js.html +91 -0
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +28 -13
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +2 -2
- 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 +153 -123
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +8 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +23 -23
- 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 +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +24 -24
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +38 -38
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useModConfigEntries.js.html +226 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateModConfigEntry.js.html +238 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/index.html +257 -242
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.html +23 -23
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useAppSettings.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettingSection.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettings.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +4 -4
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +61 -31
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +11 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/modConfigEntriesQueryKey.js.html +142 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseModConfigEntry.js.html +130 -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 +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +16 -16
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/validators/index.html +19 -19
- package/src/artifacts/coverage-jest/lcov-report/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/validators/validators.js.html +32 -32
- package/src/artifacts/coverage-jest/lcov.info +1225 -1067
- package/src/index.js +6 -0
- package/src/lib/SettingsFormContainer/SettingsFormContainer.js +84 -0
- package/src/lib/SettingsFormContainer/index.js +1 -0
- package/src/lib/constants/endpoints.js +2 -0
- package/src/lib/hooks/index.js +2 -0
- package/src/lib/hooks/useModConfigEntries.js +47 -0
- package/src/lib/hooks/useMutateModConfigEntry.js +51 -0
- package/src/lib/utils/index.js +3 -0
- package/src/lib/utils/modConfigEntriesQueryKey.js +19 -0
- package/src/lib/utils/parseModConfigEntry.js +15 -0
- package/test/jest/helpers/KintHarness.js +21 -4
|
@@ -1,6 +1,5 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -12,18 +11,10 @@ var _reactFinalFormArrays = require("react-final-form-arrays");
|
|
|
12
11
|
var _finalFormArrays = _interopRequireDefault(require("final-form-arrays"));
|
|
13
12
|
var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArray"));
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["actionAssigner", "columnMapping", "contentData", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fieldComponents", "hideActionsColumn", "hideCreateButton", "intlKey", "intlNS", "label", "labelOverrides", "validateFields", "visibleFields"];
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
|
-
var propTypes = {
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
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; }
|
|
17
|
+
const propTypes = {
|
|
27
18
|
actionAssigner: _propTypes.default.func,
|
|
28
19
|
columnMapping: _propTypes.default.object,
|
|
29
20
|
contentData: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
@@ -41,55 +32,50 @@ var propTypes = {
|
|
|
41
32
|
validateFields: _propTypes.default.object,
|
|
42
33
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
43
34
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
creatableFields =
|
|
50
|
-
createCallback
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var ActionListFieldArrayWithRef = function ActionListFieldArrayWithRef(alfaProps) {
|
|
69
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionListFieldArray.default, _objectSpread({
|
|
70
|
-
ref: ref
|
|
71
|
-
}, alfaProps));
|
|
72
|
-
};
|
|
35
|
+
const ActionList = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
36
|
+
let {
|
|
37
|
+
actionAssigner,
|
|
38
|
+
columnMapping,
|
|
39
|
+
contentData,
|
|
40
|
+
creatableFields = {},
|
|
41
|
+
createCallback,
|
|
42
|
+
defaultNewObject = {},
|
|
43
|
+
editableFields = {},
|
|
44
|
+
fieldComponents = {},
|
|
45
|
+
hideActionsColumn = false,
|
|
46
|
+
hideCreateButton,
|
|
47
|
+
intlKey: passedIntlKey,
|
|
48
|
+
intlNS: passedIntlNS,
|
|
49
|
+
label,
|
|
50
|
+
labelOverrides = {},
|
|
51
|
+
validateFields,
|
|
52
|
+
visibleFields,
|
|
53
|
+
...mclProps // Assume anything left over is to directly apply to the MCL
|
|
54
|
+
} = _ref;
|
|
55
|
+
const ActionListFieldArrayWithRef = alfaProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionListFieldArray.default, {
|
|
56
|
+
ref: ref,
|
|
57
|
+
...alfaProps
|
|
58
|
+
});
|
|
73
59
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
74
60
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, {
|
|
75
61
|
enableReinitialize: true,
|
|
76
62
|
initialValues: {
|
|
77
|
-
contentData
|
|
63
|
+
contentData
|
|
78
64
|
},
|
|
79
65
|
mutators: _finalFormArrays.default,
|
|
80
|
-
onSubmit:
|
|
81
|
-
return null;
|
|
82
|
-
},
|
|
66
|
+
onSubmit: () => null,
|
|
83
67
|
subscription: {
|
|
84
68
|
contentData: true
|
|
85
69
|
},
|
|
86
|
-
children:
|
|
87
|
-
|
|
70
|
+
children: _ref2 => {
|
|
71
|
+
let {
|
|
72
|
+
handleSubmit
|
|
73
|
+
} = _ref2;
|
|
88
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
89
|
-
onSubmit:
|
|
75
|
+
onSubmit: e => {
|
|
90
76
|
e.preventDefault();
|
|
91
77
|
},
|
|
92
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray,
|
|
78
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, {
|
|
93
79
|
actionAssigner: actionAssigner,
|
|
94
80
|
columnMapping: columnMapping,
|
|
95
81
|
component: ActionListFieldArrayWithRef,
|
|
@@ -107,8 +93,9 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
107
93
|
name: "contentData",
|
|
108
94
|
triggerFormSubmit: handleSubmit,
|
|
109
95
|
validateFields: validateFields,
|
|
110
|
-
visibleFields: visibleFields
|
|
111
|
-
|
|
96
|
+
visibleFields: visibleFields,
|
|
97
|
+
...mclProps
|
|
98
|
+
})
|
|
112
99
|
});
|
|
113
100
|
}
|
|
114
101
|
})
|
|
@@ -1,6 +1,5 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -14,37 +13,13 @@ var _components = require("@folio/stripes/components");
|
|
|
14
13
|
var _hooks = require("../hooks");
|
|
15
14
|
var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/ActionListFieldArray.css"));
|
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _excluded = ["action"],
|
|
18
|
-
_excluded2 = ["actionAssigner", "columnMapping", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fields", "fieldComponents", "hideActionsColumn", "hideCreateButton", "intlKey", "intlNS", "label", "labelOverrides", "onRowClick", "validateFields", "visibleFields", "triggerFormSubmit"],
|
|
19
|
-
_excluded3 = ["actionListActions", "fieldName", "fieldIndex"],
|
|
20
|
-
_excluded4 = ["actionListActions", "fieldName", "fieldIndex"],
|
|
21
|
-
_excluded5 = ["actionListActions"],
|
|
22
|
-
_excluded6 = ["formatter"],
|
|
23
|
-
_excluded7 = ["actionListActions"];
|
|
24
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
32
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
34
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
35
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
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; }
|
|
38
|
-
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; }
|
|
39
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
40
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
41
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
42
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
43
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
44
|
-
var EDITING_ACTIONS_WIDTH = 25;
|
|
45
|
-
var NON_EDITING_ACTIONS_WIDTH = 20;
|
|
46
|
-
var TOTAL_WIDTH = 100;
|
|
47
|
-
var propTypes = {
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
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; }
|
|
19
|
+
const EDITING_ACTIONS_WIDTH = 25;
|
|
20
|
+
const NON_EDITING_ACTIONS_WIDTH = 20;
|
|
21
|
+
const TOTAL_WIDTH = 100;
|
|
22
|
+
const propTypes = {
|
|
48
23
|
actionAssigner: _propTypes.default.func,
|
|
49
24
|
columnMapping: _propTypes.default.object,
|
|
50
25
|
creatableFields: _propTypes.default.object,
|
|
@@ -67,22 +42,25 @@ var propTypes = {
|
|
|
67
42
|
};
|
|
68
43
|
|
|
69
44
|
// This needs to be outside of the main component for forwardRef to work properly it seems.
|
|
70
|
-
|
|
45
|
+
const ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
71
46
|
var _action$label;
|
|
72
|
-
|
|
73
|
-
|
|
47
|
+
let {
|
|
48
|
+
action,
|
|
49
|
+
...actionTriggerProps
|
|
50
|
+
} = _ref;
|
|
74
51
|
if (action.icon) {
|
|
75
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton,
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
76
53
|
ref: ref,
|
|
77
|
-
icon: action.icon
|
|
78
|
-
|
|
54
|
+
icon: action.icon,
|
|
55
|
+
...actionTriggerProps
|
|
56
|
+
});
|
|
79
57
|
}
|
|
80
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button,
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
81
59
|
ref: ref,
|
|
82
|
-
marginBottom0: true
|
|
83
|
-
|
|
60
|
+
marginBottom0: true,
|
|
61
|
+
...actionTriggerProps,
|
|
84
62
|
children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
|
|
85
|
-
})
|
|
63
|
+
});
|
|
86
64
|
});
|
|
87
65
|
ActionTrigger.propTypes = {
|
|
88
66
|
action: _propTypes.default.shape({
|
|
@@ -91,98 +69,94 @@ ActionTrigger.propTypes = {
|
|
|
91
69
|
name: _propTypes.default.string
|
|
92
70
|
})
|
|
93
71
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
hideActionsColumn =
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
mclProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
72
|
+
const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
73
|
+
let {
|
|
74
|
+
actionAssigner,
|
|
75
|
+
columnMapping,
|
|
76
|
+
creatableFields,
|
|
77
|
+
createCallback,
|
|
78
|
+
defaultNewObject,
|
|
79
|
+
editableFields,
|
|
80
|
+
fields,
|
|
81
|
+
fieldComponents,
|
|
82
|
+
hideActionsColumn = false,
|
|
83
|
+
hideCreateButton = false,
|
|
84
|
+
intlKey: passedIntlKey,
|
|
85
|
+
intlNS: passedIntlNS,
|
|
86
|
+
label,
|
|
87
|
+
labelOverrides = {},
|
|
88
|
+
onRowClick,
|
|
89
|
+
validateFields,
|
|
90
|
+
visibleFields,
|
|
91
|
+
triggerFormSubmit,
|
|
92
|
+
...mclProps // Assume anything left over is to directly apply to the MCL
|
|
93
|
+
} = _ref2;
|
|
117
94
|
// Grab finalForm functions/values from form hooks
|
|
118
|
-
|
|
119
|
-
change
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
95
|
+
const {
|
|
96
|
+
change
|
|
97
|
+
} = (0, _reactFinalForm.useForm)();
|
|
98
|
+
const {
|
|
99
|
+
hasValidationErrors,
|
|
100
|
+
initialValues,
|
|
101
|
+
pristine,
|
|
102
|
+
submitting,
|
|
103
|
+
values
|
|
104
|
+
} = (0, _reactFinalForm.useFormState)();
|
|
105
|
+
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
127
106
|
/*
|
|
128
107
|
Keep track of which field we are editing.
|
|
129
108
|
null for no field, string id if we are editing an existing field and
|
|
130
109
|
'NEW_ROW' for a new row
|
|
131
110
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
editing = _useState2[0],
|
|
135
|
-
setEditing = _useState2[1];
|
|
136
|
-
var toggleEditing = function toggleEditing(id) {
|
|
111
|
+
const [editing, setEditing] = (0, _react.useState)(null);
|
|
112
|
+
const toggleEditing = id => {
|
|
137
113
|
if (editing) {
|
|
138
114
|
setEditing(null);
|
|
139
115
|
} else {
|
|
140
116
|
setEditing(id);
|
|
141
117
|
}
|
|
142
118
|
};
|
|
143
|
-
|
|
119
|
+
const handleSave = index => {
|
|
144
120
|
var _actionAssigner, _actionAssigner$find;
|
|
145
|
-
|
|
146
|
-
_a
|
|
147
|
-
_fn
|
|
148
|
-
_fi
|
|
149
|
-
rowData
|
|
121
|
+
const {
|
|
122
|
+
actionListActions: _a,
|
|
123
|
+
fieldName: _fn,
|
|
124
|
+
fieldIndex: _fi,
|
|
125
|
+
...rowData
|
|
126
|
+
} = fields.value[index];
|
|
150
127
|
|
|
151
128
|
// Find "edit" entry in actionAssigner
|
|
152
|
-
|
|
153
|
-
return act.name === 'edit';
|
|
154
|
-
})) === null || _actionAssigner$find === void 0 ? void 0 : _actionAssigner$find.callback;
|
|
129
|
+
const editCallback = (_actionAssigner = actionAssigner(rowData)) === null || _actionAssigner === void 0 ? void 0 : (_actionAssigner$find = _actionAssigner.find(act => act.name === 'edit')) === null || _actionAssigner$find === void 0 ? void 0 : _actionAssigner$find.callback;
|
|
155
130
|
if (editCallback) {
|
|
156
131
|
editCallback(rowData);
|
|
157
132
|
}
|
|
158
133
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
_a
|
|
162
|
-
_fn
|
|
163
|
-
_fi
|
|
164
|
-
rowData
|
|
134
|
+
const handleCreate = index => {
|
|
135
|
+
const {
|
|
136
|
+
actionListActions: _a,
|
|
137
|
+
fieldName: _fn,
|
|
138
|
+
fieldIndex: _fi,
|
|
139
|
+
...rowData
|
|
140
|
+
} = fields.value[index];
|
|
165
141
|
if (createCallback) {
|
|
166
142
|
createCallback(rowData);
|
|
167
143
|
}
|
|
168
144
|
};
|
|
169
|
-
|
|
145
|
+
const handleClickCreate = () => {
|
|
170
146
|
toggleEditing('NEW_ROW');
|
|
171
147
|
fields.unshift(defaultNewObject);
|
|
172
148
|
};
|
|
173
149
|
|
|
174
150
|
// Way to go into create mode from external component, and way to tell internal editing state
|
|
175
|
-
(0, _react.useImperativeHandle)(ref,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
var widthsObject = {};
|
|
185
|
-
visibleFields.forEach(function (f) {
|
|
151
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
152
|
+
create: handleClickCreate,
|
|
153
|
+
editing
|
|
154
|
+
}));
|
|
155
|
+
const getColumnWidths = () => {
|
|
156
|
+
const widthNotInUseByActions = editing ? TOTAL_WIDTH - EDITING_ACTIONS_WIDTH : TOTAL_WIDTH - NON_EDITING_ACTIONS_WIDTH;
|
|
157
|
+
const staticWidth = widthNotInUseByActions / visibleFields.length;
|
|
158
|
+
const widthsObject = {};
|
|
159
|
+
visibleFields.forEach(f => {
|
|
186
160
|
if (f !== 'actionListActions') {
|
|
187
161
|
widthsObject[f] = "".concat(staticWidth, "%");
|
|
188
162
|
}
|
|
@@ -190,10 +164,12 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
190
164
|
widthsObject.actionListActions = editing ? "".concat(EDITING_ACTIONS_WIDTH, "%") : "".concat(NON_EDITING_ACTIONS_WIDTH, "%");
|
|
191
165
|
return widthsObject;
|
|
192
166
|
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
167
|
+
const renderActionButtons = data => {
|
|
168
|
+
const fieldName = "contentData[".concat(data.rowIndex, "]");
|
|
169
|
+
const {
|
|
170
|
+
actionListActions: actions,
|
|
171
|
+
...rest
|
|
172
|
+
} = data;
|
|
197
173
|
if (data.id === editing || !data.id && editing === 'NEW_ROW') {
|
|
198
174
|
// Render the save/cancel buttons
|
|
199
175
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -202,7 +178,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
202
178
|
buttonStyle: "primary",
|
|
203
179
|
disabled: hasValidationErrors || submitting || pristine,
|
|
204
180
|
marginBottom0: true,
|
|
205
|
-
onClick:
|
|
181
|
+
onClick: () => {
|
|
206
182
|
triggerFormSubmit(); // This is set up as () => null in ActionList, so essentially only acts here to force validation
|
|
207
183
|
|
|
208
184
|
if (!hasValidationErrors) {
|
|
@@ -222,7 +198,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
222
198
|
}, "save[".concat(data.rowIndex, "]")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
223
199
|
"data-type-button": "cancel",
|
|
224
200
|
marginBottom0: true,
|
|
225
|
-
onClick:
|
|
201
|
+
onClick: () => {
|
|
226
202
|
if (!data.id && editing === 'NEW_ROW') {
|
|
227
203
|
fields.remove(data.rowIndex);
|
|
228
204
|
toggleEditing('NEW_ROW');
|
|
@@ -240,21 +216,17 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
240
216
|
}
|
|
241
217
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
242
218
|
id: "action-button-parent",
|
|
243
|
-
children: actions === null || actions === void 0 ? void 0 : actions.map(
|
|
244
|
-
|
|
219
|
+
children: actions === null || actions === void 0 ? void 0 : actions.map(action => {
|
|
220
|
+
let actionFunction;
|
|
245
221
|
if (action.callback) {
|
|
246
|
-
actionFunction =
|
|
247
|
-
return action.callback(rest);
|
|
248
|
-
};
|
|
222
|
+
actionFunction = () => action.callback(rest);
|
|
249
223
|
}
|
|
250
224
|
|
|
251
225
|
// Edit has special action functionality, revealing fields etc.
|
|
252
226
|
if (action.name === 'edit') {
|
|
253
|
-
actionFunction =
|
|
254
|
-
return toggleEditing(data.id);
|
|
255
|
-
};
|
|
227
|
+
actionFunction = () => toggleEditing(data.id);
|
|
256
228
|
}
|
|
257
|
-
|
|
229
|
+
let ariaLabel = "action-".concat(action.name, "[").concat(data.rowIndex, "]");
|
|
258
230
|
if (action !== null && action !== void 0 && action.ariaLabel) {
|
|
259
231
|
if (typeof action.ariaLabel === 'function') {
|
|
260
232
|
ariaLabel = action.ariaLabel(data);
|
|
@@ -264,8 +236,8 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
264
236
|
throw new Error("Provided ariaLabel for action \"".concat(action.name, "\" must be a function or a string."));
|
|
265
237
|
}
|
|
266
238
|
}
|
|
267
|
-
|
|
268
|
-
|
|
239
|
+
let tooltip;
|
|
240
|
+
let tooltipSub;
|
|
269
241
|
if (action !== null && action !== void 0 && action.tooltip) {
|
|
270
242
|
if (typeof action.tooltip === 'function') {
|
|
271
243
|
tooltip = action.tooltip(data);
|
|
@@ -287,16 +259,18 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
287
259
|
id: "action-".concat(action.name, "[").concat(data.rowIndex, "]-tooltip"),
|
|
288
260
|
sub: tooltipSub,
|
|
289
261
|
text: tooltip,
|
|
290
|
-
children:
|
|
291
|
-
|
|
292
|
-
|
|
262
|
+
children: _ref3 => {
|
|
263
|
+
let {
|
|
264
|
+
ref: actionTriggerRef,
|
|
265
|
+
ariaIds
|
|
266
|
+
} = _ref3;
|
|
293
267
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionTrigger, {
|
|
294
268
|
ref: actionTriggerRef,
|
|
295
269
|
action: action,
|
|
296
270
|
"aria-describedby": ariaIds.sub,
|
|
297
271
|
"aria-labelledby": ariaIds.text,
|
|
298
272
|
disabled: !!editing,
|
|
299
|
-
onClick:
|
|
273
|
+
onClick: e => {
|
|
300
274
|
e.stopPropagation();
|
|
301
275
|
if (actionFunction) {
|
|
302
276
|
return actionFunction();
|
|
@@ -314,7 +288,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
314
288
|
action: action,
|
|
315
289
|
ariaLabel: ariaLabel,
|
|
316
290
|
disabled: !!editing,
|
|
317
|
-
onClick:
|
|
291
|
+
onClick: e => {
|
|
318
292
|
e.stopPropagation();
|
|
319
293
|
if (actionFunction) {
|
|
320
294
|
return actionFunction();
|
|
@@ -326,32 +300,35 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
326
300
|
})
|
|
327
301
|
});
|
|
328
302
|
};
|
|
329
|
-
|
|
330
|
-
return fields.map(
|
|
303
|
+
const assignActions = () => {
|
|
304
|
+
return fields.map((fieldName, fieldIndex) => {
|
|
331
305
|
// Fetch the content from the field Values
|
|
332
|
-
|
|
306
|
+
const cd = (0, _cloneDeep.default)((0, _get.default)(values, fieldName));
|
|
333
307
|
cd.actionListActions = actionAssigner(cd);
|
|
334
|
-
return
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
308
|
+
return {
|
|
309
|
+
...cd,
|
|
310
|
+
fieldName,
|
|
311
|
+
fieldIndex
|
|
312
|
+
};
|
|
338
313
|
});
|
|
339
314
|
};
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
315
|
+
const {
|
|
316
|
+
formatter,
|
|
317
|
+
...restOfMclProps
|
|
318
|
+
} = mclProps; // Destructure formatter part of mclProps
|
|
319
|
+
const fieldAwareFormatter = () => {
|
|
320
|
+
const returnObj = {};
|
|
344
321
|
// For each visible field, if it's being edited then ignore passed formatters, else use them
|
|
345
322
|
|
|
346
323
|
// Track whether we've autoFocused on a field yet
|
|
347
|
-
|
|
348
|
-
visibleFields.forEach(
|
|
349
|
-
returnObj[key] =
|
|
324
|
+
let autoFocus = true;
|
|
325
|
+
visibleFields.forEach(key => {
|
|
326
|
+
returnObj[key] = cd => {
|
|
350
327
|
// Row is being edited if it has no id, or its id is in the editing string
|
|
351
|
-
|
|
328
|
+
const editingRow = cd.id === editing || !cd.id;
|
|
352
329
|
|
|
353
330
|
// Default to the passed formatter values
|
|
354
|
-
|
|
331
|
+
let returnValue = formatter !== null && formatter !== void 0 && formatter[key] ? formatter[key](cd) : cd[key];
|
|
355
332
|
|
|
356
333
|
// If editing, replace values with fields
|
|
357
334
|
if (editingRow) {
|
|
@@ -360,12 +337,8 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
360
337
|
Check if the property is a visible field.
|
|
361
338
|
If it is not then we don't allow editing in this component.
|
|
362
339
|
*/
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
};
|
|
366
|
-
var createFunction = (_creatableFields$key = creatableFields[key]) !== null && _creatableFields$key !== void 0 ? _creatableFields$key : function () {
|
|
367
|
-
return true;
|
|
368
|
-
};
|
|
340
|
+
const editFunction = (_editableFields$key = editableFields[key]) !== null && _editableFields$key !== void 0 ? _editableFields$key : () => true;
|
|
341
|
+
const createFunction = (_creatableFields$key = creatableFields[key]) !== null && _creatableFields$key !== void 0 ? _creatableFields$key : () => true;
|
|
369
342
|
/*
|
|
370
343
|
Next check if this is a new row, if so we should run the createableField function with the data.
|
|
371
344
|
If it is not a new row, then we run the editableField function with the data,
|
|
@@ -374,22 +347,20 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
374
347
|
true => Field, false => display value
|
|
375
348
|
*/
|
|
376
349
|
if (!cd.id && createFunction(cd) || !!cd.id && editFunction(cd)) {
|
|
377
|
-
|
|
350
|
+
const passedObject = {
|
|
378
351
|
allValues: values,
|
|
379
352
|
index: cd === null || cd === void 0 ? void 0 : cd.fieldIndex,
|
|
380
|
-
key
|
|
353
|
+
key,
|
|
381
354
|
name: "".concat(cd.fieldName, ".").concat(key),
|
|
382
355
|
rowFieldName: cd.fieldName
|
|
383
356
|
};
|
|
384
|
-
|
|
357
|
+
const validateFunction = validateFields !== null && validateFields !== void 0 && validateFields[key] ? validateFields === null || validateFields === void 0 ? void 0 : validateFields[key](passedObject) : null;
|
|
385
358
|
returnValue = fieldComponents[key] ? fieldComponents[key](passedObject) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
386
359
|
autoFocus: autoFocus,
|
|
387
360
|
component: _components.TextField,
|
|
388
361
|
marginBottom0: true,
|
|
389
362
|
name: "".concat(cd.fieldName, ".").concat(key),
|
|
390
|
-
parse:
|
|
391
|
-
return v;
|
|
392
|
-
},
|
|
363
|
+
parse: v => v,
|
|
393
364
|
validate: validateFunction
|
|
394
365
|
});
|
|
395
366
|
// After first field, every other field should not autofocus
|
|
@@ -416,30 +387,35 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
416
387
|
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
|
|
417
388
|
})
|
|
418
389
|
})]
|
|
419
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList,
|
|
420
|
-
columnMapping:
|
|
390
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, {
|
|
391
|
+
columnMapping: {
|
|
392
|
+
...columnMapping,
|
|
421
393
|
actionListActions: kintIntl.formatKintMessage({
|
|
422
394
|
id: 'actions',
|
|
423
395
|
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.actions
|
|
424
396
|
})
|
|
425
|
-
}
|
|
397
|
+
},
|
|
426
398
|
columnWidths: getColumnWidths(),
|
|
427
399
|
contentData: assignActions(),
|
|
428
|
-
formatter:
|
|
429
|
-
actionListActions: renderActionButtons
|
|
430
|
-
|
|
400
|
+
formatter: {
|
|
401
|
+
actionListActions: renderActionButtons,
|
|
402
|
+
...fieldAwareFormatter()
|
|
403
|
+
},
|
|
431
404
|
interactive: !!onRowClick,
|
|
432
|
-
onRowClick: onRowClick ?
|
|
405
|
+
onRowClick: onRowClick ? (e, row) => {
|
|
433
406
|
// Make sure we ONLY fire row click from row, and not from action buttons.
|
|
434
|
-
|
|
407
|
+
const targetIsAction = e.target.closest('[id^=action-button-parent]') !== null;
|
|
435
408
|
if (!targetIsAction) {
|
|
436
|
-
|
|
437
|
-
|
|
409
|
+
const {
|
|
410
|
+
actionListActions: _ala,
|
|
411
|
+
...rowWithoutActions
|
|
412
|
+
} = row;
|
|
438
413
|
onRowClick(e, rowWithoutActions);
|
|
439
414
|
}
|
|
440
415
|
} : null,
|
|
441
|
-
visibleColumns: !hideActionsColumn || !!editing ? [
|
|
442
|
-
|
|
416
|
+
visibleColumns: !hideActionsColumn || !!editing ? [...visibleFields, 'actionListActions'] : visibleFields,
|
|
417
|
+
...restOfMclProps
|
|
418
|
+
})]
|
|
443
419
|
});
|
|
444
420
|
});
|
|
445
421
|
ActionListFieldArray.propTypes = propTypes;
|