@k-int/stripes-kint-components 2.8.1 → 3.0.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 +16 -1
- package/es/index.js +54 -12
- package/es/lib/ActionList/ActionList.js +11 -5
- package/es/lib/ActionList/ActionListFieldArray.js +147 -77
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +43 -31
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +17 -14
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +67 -47
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +17 -24
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +91 -70
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +53 -36
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +50 -31
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +13 -14
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +8 -12
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +22 -24
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +9 -12
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +62 -13
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +12 -13
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +91 -44
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +80 -73
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +31 -32
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +26 -24
- package/es/lib/CustomProperties/Edit/testResources.js +73 -908
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +21 -29
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -10
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +38 -39
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +28 -13
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +29 -44
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +6 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +16 -10
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +12 -12
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +20 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +4 -3
- package/es/lib/CustomProperties/Filter/testResources.js +37 -233
- package/es/lib/CustomProperties/Filter/useOperators.js +69 -27
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +3 -2
- package/es/lib/CustomProperties/Filter/useValueProps.js +7 -2
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +4 -3
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +13 -19
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +4 -10
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +34 -51
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +38 -28
- package/es/lib/EditableRefdataList/EditableRefdataList.js +44 -32
- package/es/lib/EditableSettingsList/EditableSettingsList.js +11 -1
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +10 -0
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +19 -11
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +21 -9
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +83 -16
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +138 -65
- package/es/lib/FormModal/FormModal.js +14 -9
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +91 -0
- package/es/lib/FormattedKintMessage/index.js +15 -0
- package/es/lib/IconSelect/IconSelect.js +18 -12
- package/es/lib/NoResultsMessage/NoResultsMessage.js +13 -2
- package/es/lib/RichSelect/RichSelect.js +13 -34
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +16 -5
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +11 -1
- package/es/lib/SettingPage/SettingPage.js +12 -13
- package/es/lib/SettingPage/SettingPagePane.js +12 -20
- package/es/lib/hooks/__mocks__/index.js +46 -0
- package/es/lib/hooks/index.js +24 -8
- package/es/lib/hooks/settingsHooks/useSettings.js +22 -17
- package/es/lib/hooks/useIntlKey.js +34 -0
- package/es/lib/hooks/useIntlKeyStore.js +84 -0
- package/es/lib/hooks/useKintIntl.js +93 -0
- package/es/lib/utils/index.js +48 -4
- package/es/lib/utils/parseErrorResponse.js +91 -0
- package/es/lib/utils/validators.js +76 -59
- package/jest.config.js +4 -1
- package/junit.xml +157 -656
- package/package.json +54 -33
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +56 -8
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +394 -64
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +10 -10
- 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 +187 -52
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +372 -87
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +293 -74
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +126 -54
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +45 -60
- 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 +23 -5
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +59 -47
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +259 -97
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +399 -105
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +41 -68
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +57 -57
- 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 +67 -688
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +92 -53
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +103 -64
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +54 -63
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +49 -16
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +69 -18
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +89 -89
- 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 +33 -786
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +46 -46
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +45 -36
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +43 -28
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +20 -2
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +50 -41
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +54 -75
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +24 -24
- 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/{hooks/useAvailableCustomProperties.js.html → CycleButton/CycleButton.js.html} +62 -50
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +664 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +264 -39
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +41 -14
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +45 -6
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +47 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +65 -14
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +154 -31
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +26 -26
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +18 -18
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +35 -17
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +247 -0
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/CustomPropertiesView.js.html → IconSelect/IconSelect.js.html} +158 -257
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +48 -6
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +3 -3
- 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/{CustomProperties/Config/testResources.js.html → RichSelect/RichSelect.js.html} +256 -334
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +146 -0
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +91 -0
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +127 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +52 -7
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +31 -4
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
- 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 +24 -27
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +47 -17
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
- 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/favicon.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +142 -97
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +13 -4
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +35 -20
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +5 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +61 -22
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
- 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 +1 -1
- 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 +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +19 -22
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +151 -0
- package/src/artifacts/coverage-jest/lcov-report/{utils/renderHelpText.js.html → hooks/useIntlKeyStore.js.html} +71 -38
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +238 -0
- 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/useMutateCustomProperties.js.html +23 -11
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +274 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +19 -10
- 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/useTemplates.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/index.html +205 -130
- package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
- 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 +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +34 -34
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +42 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +139 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +5 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +128 -80
- package/src/artifacts/coverage-jest/lcov.info +2603 -2086
- package/src/index.js +12 -4
- package/src/lib/ActionList/ActionList.js +9 -3
- package/src/lib/ActionList/ActionListFieldArray.js +115 -37
- package/src/lib/ActionList/README.md +2 -1
- package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +60 -16
- package/src/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +14 -4
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +109 -34
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +16 -9
- package/src/lib/CustomProperties/Config/CustomPropertyForm.js +131 -58
- package/src/lib/CustomProperties/Config/CustomPropertyForm.test.js +52 -33
- package/src/lib/CustomProperties/Config/CustomPropertyView.js +71 -47
- package/src/lib/CustomProperties/Config/CustomPropertyView.test.js +8 -6
- package/src/lib/CustomProperties/Config/README.md +33 -28
- package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
- package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +7 -3
- package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +23 -19
- package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +5 -3
- package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +65 -11
- package/src/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +10 -8
- package/src/lib/CustomProperties/Edit/CustomPropertyField.js +115 -21
- package/src/lib/CustomProperties/Edit/CustomPropertyField.test.js +59 -60
- package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +24 -33
- package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +20 -27
- package/src/lib/CustomProperties/Edit/testResources.js +46 -1047
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +22 -22
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -8
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +44 -31
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +26 -13
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +33 -36
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +3 -3
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -8
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +9 -12
- package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +22 -5
- package/src/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +3 -1
- package/src/lib/CustomProperties/Filter/testResources.js +14 -265
- package/src/lib/CustomProperties/Filter/useOperators.js +20 -20
- package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -2
- package/src/lib/CustomProperties/Filter/useValueProps.js +8 -3
- package/src/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
- package/src/lib/CustomProperties/View/CustomPropertiesView.test.js +2 -1
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +15 -13
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +2 -5
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +36 -43
- package/src/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +47 -28
- package/src/lib/EditableRefdataList/EditableRefdataList.js +58 -33
- package/src/lib/EditableSettingsList/EditableSettingsList.js +10 -1
- package/src/lib/EditableSettingsList/EditableSettingsListFieldArray.js +14 -1
- package/src/lib/EditableSettingsList/SettingField/EditSettingValue.js +17 -5
- package/src/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
- package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.js +24 -7
- package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
- package/src/lib/EditableSettingsList/SettingField/SettingField.js +57 -16
- package/src/lib/EditableSettingsList/SettingField/SettingField.test.js +14 -19
- package/src/lib/FormModal/FormModal.js +15 -9
- package/src/lib/FormattedKintMessage/FormattedKintMessage.js +54 -0
- package/src/lib/FormattedKintMessage/index.js +1 -0
- package/src/lib/IconSelect/IconSelect.js +17 -8
- package/src/lib/NoResultsMessage/NoResultsMessage.js +15 -1
- package/src/lib/RichSelect/RichSelect.js +16 -36
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +17 -2
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +10 -1
- package/src/lib/SettingPage/SettingPage.js +12 -13
- package/src/lib/SettingPage/SettingPagePane.js +16 -6
- package/src/lib/hooks/__mocks__/index.js +17 -0
- package/src/lib/hooks/index.js +3 -1
- package/src/lib/hooks/settingsHooks/useSettings.js +25 -12
- package/src/lib/hooks/useIntlKey.js +22 -0
- package/src/lib/hooks/useIntlKeyStore.js +38 -0
- package/src/lib/hooks/useKintIntl.js +51 -0
- package/src/lib/utils/index.js +14 -1
- package/src/lib/utils/parseErrorResponse.js +18 -0
- package/src/lib/utils/validators.js +57 -41
- package/styles/RichSelect.css +7 -4
- package/test/helpers/test-implementor-translations.json +80 -0
- package/test/helpers/translationsProperties.js +6 -1
- package/test/jest/customProperties.js +166 -0
- package/test/jest/helpers/KintHarness.js +1 -1
- package/test/jest/helpers/renderWithKintHarness.js +2 -1
- package/test/jest/index.js +8 -0
- package/test/jest/refdata.js +471 -0
- package/test/jest/resolver.js +29 -0
- package/translations/stripes-kint-components/ar.json +1 -122
- package/translations/stripes-kint-components/cs_CZ.json +1 -122
- package/translations/stripes-kint-components/de.json +1 -122
- package/translations/stripes-kint-components/en.json +1 -148
- package/translations/stripes-kint-components/es.json +1 -122
- package/translations/stripes-kint-components/hi_IN.json +1 -122
- package/translations/stripes-kint-components/hu.json +1 -122
- package/translations/stripes-kint-components/it_IT.json +1 -122
- package/translations/stripes-kint-components/ja.json +1 -122
- package/translations/stripes-kint-components/ko.json +1 -122
- package/translations/stripes-kint-components/pt_PT.json +1 -122
- package/translations/stripes-kint-components/ru.json +1 -122
- package/translations/stripes-kint-components/sv.json +1 -122
- package/translations/stripes-kint-components/zh_CN.json +1 -122
- package/es/lib/CustomProperties/Config/testResources.js +0 -198
- package/es/lib/hooks/useAvailableCustomProperties.js +0 -73
- package/es/lib/utils/renderHelpText.js +0 -80
- package/src/lib/CustomProperties/Config/testResources.js +0 -236
- package/src/lib/hooks/useAvailableCustomProperties.js +0 -40
- package/src/lib/utils/renderHelpText.js +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
##
|
|
1
|
+
## 3.0.0 In progress
|
|
2
|
+
* RichSelect default trigger now uses DropdownButton under the hood -- changed styling
|
|
2
3
|
* ActionList previously added actionListItems directly to cached object--sometimes this caused the react-query cache ITSELF to update, although I'm not sure why here and not anywhere else. Fixed by creating a clone internally in ActionListFieldArray and assigning actionListActions on that.
|
|
4
|
+
* New util function `parseErrorResponse`, used in places where we catch http errors, allows for text only response bodies
|
|
5
|
+
* onRowClick supplied to ActionList now controls whether or not the underlying MCL is considered "interactive"
|
|
6
|
+
* ActionList actions now accept `tooltip` and `tooltipSub` props to control a wrapper Tooltip on the action
|
|
7
|
+
* Complete overhaul of translations and labelOverrides. Not backwards compatible, hence major version bump.
|
|
8
|
+
* Translations now require a setup hook "useIntlKeyStore" to set up a favoured intl key, then use that throughout:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
const addKey = useIntlKeyStore(state => state.addKey);
|
|
12
|
+
addKey('ui-agreements');
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
* Translations can be overridden by labelOverrides, but these must now ALWAYS be a String, either direct translated string value, or an intl key that can then be passed certain values where applicable
|
|
16
|
+
* Removed deprecated "actionCalls" prop from ActionList
|
|
17
|
+
* Removed `useAvailableCustomProperties`
|
|
3
18
|
|
|
4
19
|
## 2.8.0 2022-07-15
|
|
5
20
|
* Fixed bug where non-createable fields which were editable would display a field on creation.
|
package/es/index.js
CHANGED
|
@@ -131,6 +131,12 @@ Object.defineProperty(exports, "FormModal", {
|
|
|
131
131
|
return _FormModal.default;
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
+
Object.defineProperty(exports, "FormattedKintMessage", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function get() {
|
|
137
|
+
return _FormattedKintMessage.default;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
134
140
|
Object.defineProperty(exports, "IconSelect", {
|
|
135
141
|
enumerable: true,
|
|
136
142
|
get: function get() {
|
|
@@ -224,7 +230,13 @@ Object.defineProperty(exports, "boldString", {
|
|
|
224
230
|
Object.defineProperty(exports, "composeValidators", {
|
|
225
231
|
enumerable: true,
|
|
226
232
|
get: function get() {
|
|
227
|
-
return
|
|
233
|
+
return _utils.composeValidators;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
Object.defineProperty(exports, "composeValidatorsWithArgs", {
|
|
237
|
+
enumerable: true,
|
|
238
|
+
get: function get() {
|
|
239
|
+
return _utils.composeValidatorsWithArgs;
|
|
228
240
|
}
|
|
229
241
|
});
|
|
230
242
|
exports.customPropertyContants = void 0;
|
|
@@ -255,7 +267,7 @@ Object.defineProperty(exports, "highlightString", {
|
|
|
255
267
|
Object.defineProperty(exports, "invalidNumber", {
|
|
256
268
|
enumerable: true,
|
|
257
269
|
get: function get() {
|
|
258
|
-
return
|
|
270
|
+
return _utils.invalidNumber;
|
|
259
271
|
}
|
|
260
272
|
});
|
|
261
273
|
Object.defineProperty(exports, "matchString", {
|
|
@@ -264,6 +276,24 @@ Object.defineProperty(exports, "matchString", {
|
|
|
264
276
|
return _utils.matchString;
|
|
265
277
|
}
|
|
266
278
|
});
|
|
279
|
+
Object.defineProperty(exports, "parseErrorResponse", {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
get: function get() {
|
|
282
|
+
return _utils.parseErrorResponse;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
Object.defineProperty(exports, "rangeOverflow", {
|
|
286
|
+
enumerable: true,
|
|
287
|
+
get: function get() {
|
|
288
|
+
return _utils.rangeOverflow;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
Object.defineProperty(exports, "rangeUnderflow", {
|
|
292
|
+
enumerable: true,
|
|
293
|
+
get: function get() {
|
|
294
|
+
return _utils.rangeUnderflow;
|
|
295
|
+
}
|
|
296
|
+
});
|
|
267
297
|
Object.defineProperty(exports, "refdataOptions", {
|
|
268
298
|
enumerable: true,
|
|
269
299
|
get: function get() {
|
|
@@ -279,13 +309,13 @@ Object.defineProperty(exports, "refdataQueryKey", {
|
|
|
279
309
|
Object.defineProperty(exports, "required", {
|
|
280
310
|
enumerable: true,
|
|
281
311
|
get: function get() {
|
|
282
|
-
return
|
|
312
|
+
return _utils.required;
|
|
283
313
|
}
|
|
284
314
|
});
|
|
285
315
|
Object.defineProperty(exports, "requiredObject", {
|
|
286
316
|
enumerable: true,
|
|
287
317
|
get: function get() {
|
|
288
|
-
return
|
|
318
|
+
return _utils.requiredObject;
|
|
289
319
|
}
|
|
290
320
|
});
|
|
291
321
|
Object.defineProperty(exports, "selectorSafe", {
|
|
@@ -312,12 +342,6 @@ Object.defineProperty(exports, "useAppSettings", {
|
|
|
312
342
|
return _hooks.useAppSettings;
|
|
313
343
|
}
|
|
314
344
|
});
|
|
315
|
-
Object.defineProperty(exports, "useAvailableCustomProperties", {
|
|
316
|
-
enumerable: true,
|
|
317
|
-
get: function get() {
|
|
318
|
-
return _hooks.useAvailableCustomProperties;
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
345
|
Object.defineProperty(exports, "useCustomProperties", {
|
|
322
346
|
enumerable: true,
|
|
323
347
|
get: function get() {
|
|
@@ -330,12 +354,30 @@ Object.defineProperty(exports, "useHelperApp", {
|
|
|
330
354
|
return _hooks.useHelperApp;
|
|
331
355
|
}
|
|
332
356
|
});
|
|
357
|
+
Object.defineProperty(exports, "useIntlKey", {
|
|
358
|
+
enumerable: true,
|
|
359
|
+
get: function get() {
|
|
360
|
+
return _hooks.useIntlKey;
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
Object.defineProperty(exports, "useIntlKeyStore", {
|
|
364
|
+
enumerable: true,
|
|
365
|
+
get: function get() {
|
|
366
|
+
return _hooks.useIntlKeyStore;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
333
369
|
Object.defineProperty(exports, "useInvalidateRefdata", {
|
|
334
370
|
enumerable: true,
|
|
335
371
|
get: function get() {
|
|
336
372
|
return _hooks.useInvalidateRefdata;
|
|
337
373
|
}
|
|
338
374
|
});
|
|
375
|
+
Object.defineProperty(exports, "useKintIntl", {
|
|
376
|
+
enumerable: true,
|
|
377
|
+
get: function get() {
|
|
378
|
+
return _hooks.useKintIntl;
|
|
379
|
+
}
|
|
380
|
+
});
|
|
339
381
|
Object.defineProperty(exports, "useKiwtFieldArray", {
|
|
340
382
|
enumerable: true,
|
|
341
383
|
get: function get() {
|
|
@@ -413,8 +455,6 @@ var _hooks = require("./lib/hooks");
|
|
|
413
455
|
|
|
414
456
|
var _utils = require("./lib/utils");
|
|
415
457
|
|
|
416
|
-
var _validators = require("./lib/utils/validators");
|
|
417
|
-
|
|
418
458
|
var _contexts = require("./lib/contexts");
|
|
419
459
|
|
|
420
460
|
var _SettingPage = require("./lib/SettingPage");
|
|
@@ -455,6 +495,8 @@ var _IconSelect = _interopRequireDefault(require("./lib/IconSelect"));
|
|
|
455
495
|
|
|
456
496
|
var _RichSelect = _interopRequireWildcard(require("./lib/RichSelect"));
|
|
457
497
|
|
|
498
|
+
var _FormattedKintMessage = _interopRequireDefault(require("./lib/FormattedKintMessage"));
|
|
499
|
+
|
|
458
500
|
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); }
|
|
459
501
|
|
|
460
502
|
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; }
|
|
@@ -21,7 +21,7 @@ var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArr
|
|
|
21
21
|
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
|
|
24
|
-
var _excluded = ["actionAssigner", "
|
|
24
|
+
var _excluded = ["actionAssigner", "columnMapping", "contentData", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fieldComponents", "hideCreateButton", "intlKey", "intlNS", "label", "labelOverrides", "validateFields", "visibleFields"];
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
27
|
|
|
@@ -41,7 +41,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
41
41
|
|
|
42
42
|
var propTypes = {
|
|
43
43
|
actionAssigner: _propTypes.default.func,
|
|
44
|
-
actionCalls: _propTypes.default.object,
|
|
45
44
|
columnMapping: _propTypes.default.object,
|
|
46
45
|
contentData: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
47
46
|
creatableFields: _propTypes.default.object,
|
|
@@ -50,14 +49,15 @@ var propTypes = {
|
|
|
50
49
|
editableFields: _propTypes.default.object,
|
|
51
50
|
fieldComponents: _propTypes.default.object,
|
|
52
51
|
hideCreateButton: _propTypes.default.bool,
|
|
52
|
+
intlKey: _propTypes.default.string,
|
|
53
|
+
intlNS: _propTypes.default.string,
|
|
53
54
|
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
55
|
+
labelOverrides: _propTypes.default.object,
|
|
54
56
|
validateFields: _propTypes.default.object,
|
|
55
57
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
56
58
|
};
|
|
57
59
|
var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
58
60
|
var actionAssigner = _ref.actionAssigner,
|
|
59
|
-
_ref$actionCalls = _ref.actionCalls,
|
|
60
|
-
actionCalls = _ref$actionCalls === void 0 ? {} : _ref$actionCalls,
|
|
61
61
|
columnMapping = _ref.columnMapping,
|
|
62
62
|
contentData = _ref.contentData,
|
|
63
63
|
_ref$creatableFields = _ref.creatableFields,
|
|
@@ -70,7 +70,11 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
70
70
|
_ref$fieldComponents = _ref.fieldComponents,
|
|
71
71
|
fieldComponents = _ref$fieldComponents === void 0 ? {} : _ref$fieldComponents,
|
|
72
72
|
hideCreateButton = _ref.hideCreateButton,
|
|
73
|
+
passedIntlKey = _ref.intlKey,
|
|
74
|
+
passedIntlNS = _ref.intlNS,
|
|
73
75
|
label = _ref.label,
|
|
76
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
77
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
74
78
|
validateFields = _ref.validateFields,
|
|
75
79
|
visibleFields = _ref.visibleFields,
|
|
76
80
|
mclProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -102,7 +106,6 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
102
106
|
},
|
|
103
107
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, _objectSpread({
|
|
104
108
|
actionAssigner: actionAssigner,
|
|
105
|
-
actionCalls: actionCalls,
|
|
106
109
|
columnMapping: columnMapping,
|
|
107
110
|
component: ActionListFieldArrayWithRef,
|
|
108
111
|
creatableFields: creatableFields,
|
|
@@ -111,7 +114,10 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
111
114
|
editableFields: editableFields,
|
|
112
115
|
fieldComponents: fieldComponents,
|
|
113
116
|
hideCreateButton: hideCreateButton,
|
|
117
|
+
intlKey: passedIntlKey,
|
|
118
|
+
intlNS: passedIntlNS,
|
|
114
119
|
label: label,
|
|
120
|
+
labelOverrides: labelOverrides,
|
|
115
121
|
name: "contentData",
|
|
116
122
|
triggerFormSubmit: handleSubmit,
|
|
117
123
|
validateFields: validateFields,
|
|
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
|
|
14
|
-
var _reactIntl = require("react-intl");
|
|
15
|
-
|
|
16
14
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
17
15
|
|
|
18
16
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
@@ -21,15 +19,19 @@ var _reactFinalForm = require("react-final-form");
|
|
|
21
19
|
|
|
22
20
|
var _components = require("@folio/stripes/components");
|
|
23
21
|
|
|
22
|
+
var _hooks = require("../hooks");
|
|
23
|
+
|
|
24
24
|
var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/ActionListFieldArray.css"));
|
|
25
25
|
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
28
|
-
var _excluded = ["
|
|
29
|
-
_excluded2 = ["
|
|
28
|
+
var _excluded = ["action"],
|
|
29
|
+
_excluded2 = ["actionAssigner", "columnMapping", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fields", "fieldComponents", "hideCreateButton", "intlKey", "intlNS", "label", "labelOverrides", "onRowClick", "validateFields", "visibleFields", "triggerFormSubmit"],
|
|
30
30
|
_excluded3 = ["actionListActions", "fieldName", "fieldIndex"],
|
|
31
|
-
_excluded4 = ["actionListActions"],
|
|
32
|
-
_excluded5 = ["
|
|
31
|
+
_excluded4 = ["actionListActions", "fieldName", "fieldIndex"],
|
|
32
|
+
_excluded5 = ["actionListActions"],
|
|
33
|
+
_excluded6 = ["formatter"],
|
|
34
|
+
_excluded7 = ["actionListActions"];
|
|
33
35
|
|
|
34
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
37
|
|
|
@@ -45,12 +47,6 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
45
47
|
|
|
46
48
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
47
49
|
|
|
48
|
-
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; }
|
|
49
|
-
|
|
50
|
-
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; }
|
|
51
|
-
|
|
52
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
-
|
|
54
50
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
55
51
|
|
|
56
52
|
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."); }
|
|
@@ -63,6 +59,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
63
59
|
|
|
64
60
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
65
61
|
|
|
62
|
+
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; }
|
|
63
|
+
|
|
64
|
+
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; }
|
|
65
|
+
|
|
66
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
67
|
+
|
|
66
68
|
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; }
|
|
67
69
|
|
|
68
70
|
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; }
|
|
@@ -72,7 +74,6 @@ var NON_EDITING_ACTIONS_WIDTH = 20;
|
|
|
72
74
|
var TOTAL_WIDTH = 100;
|
|
73
75
|
var propTypes = {
|
|
74
76
|
actionAssigner: _propTypes.default.func,
|
|
75
|
-
actionCalls: _propTypes.default.object,
|
|
76
77
|
columnMapping: _propTypes.default.object,
|
|
77
78
|
creatableFields: _propTypes.default.object,
|
|
78
79
|
createCallback: _propTypes.default.func,
|
|
@@ -82,28 +83,64 @@ var propTypes = {
|
|
|
82
83
|
fieldComponents: _propTypes.default.object,
|
|
83
84
|
formatter: _propTypes.default.object,
|
|
84
85
|
hideCreateButton: _propTypes.default.bool,
|
|
86
|
+
intlKey: _propTypes.default.string,
|
|
87
|
+
intlNS: _propTypes.default.string,
|
|
85
88
|
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
89
|
+
labelOverrides: _propTypes.default.object,
|
|
90
|
+
onRowClick: _propTypes.default.func,
|
|
86
91
|
triggerFormSubmit: _propTypes.default.func.isRequired,
|
|
87
92
|
validateFields: _propTypes.default.object,
|
|
88
93
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
94
|
+
}; // This needs to be outside of the main component for forwardRef to work properly it seems.
|
|
95
|
+
|
|
96
|
+
var ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
97
|
+
var _action$label;
|
|
98
|
+
|
|
99
|
+
var action = _ref.action,
|
|
100
|
+
actionTriggerProps = _objectWithoutProperties(_ref, _excluded);
|
|
101
|
+
|
|
102
|
+
if (action.icon) {
|
|
103
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, _objectSpread({
|
|
104
|
+
ref: ref,
|
|
105
|
+
icon: action.icon
|
|
106
|
+
}, actionTriggerProps));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, _objectSpread(_objectSpread({
|
|
110
|
+
ref: ref,
|
|
111
|
+
marginBottom0: true
|
|
112
|
+
}, actionTriggerProps), {}, {
|
|
113
|
+
children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
|
|
114
|
+
}));
|
|
115
|
+
});
|
|
116
|
+
ActionTrigger.propTypes = {
|
|
117
|
+
action: _propTypes.default.shape({
|
|
118
|
+
icon: _propTypes.default.string,
|
|
119
|
+
label: _propTypes.default.string,
|
|
120
|
+
name: _propTypes.default.string
|
|
121
|
+
})
|
|
89
122
|
};
|
|
90
|
-
var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (
|
|
91
|
-
var actionAssigner =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
123
|
+
var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
124
|
+
var actionAssigner = _ref2.actionAssigner,
|
|
125
|
+
columnMapping = _ref2.columnMapping,
|
|
126
|
+
creatableFields = _ref2.creatableFields,
|
|
127
|
+
createCallback = _ref2.createCallback,
|
|
128
|
+
defaultNewObject = _ref2.defaultNewObject,
|
|
129
|
+
editableFields = _ref2.editableFields,
|
|
130
|
+
fields = _ref2.fields,
|
|
131
|
+
fieldComponents = _ref2.fieldComponents,
|
|
132
|
+
_ref2$hideCreateButto = _ref2.hideCreateButton,
|
|
133
|
+
hideCreateButton = _ref2$hideCreateButto === void 0 ? false : _ref2$hideCreateButto,
|
|
134
|
+
passedIntlKey = _ref2.intlKey,
|
|
135
|
+
passedIntlNS = _ref2.intlNS,
|
|
136
|
+
label = _ref2.label,
|
|
137
|
+
_ref2$labelOverrides = _ref2.labelOverrides,
|
|
138
|
+
labelOverrides = _ref2$labelOverrides === void 0 ? {} : _ref2$labelOverrides,
|
|
139
|
+
onRowClick = _ref2.onRowClick,
|
|
140
|
+
validateFields = _ref2.validateFields,
|
|
141
|
+
visibleFields = _ref2.visibleFields,
|
|
142
|
+
triggerFormSubmit = _ref2.triggerFormSubmit,
|
|
143
|
+
mclProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
107
144
|
|
|
108
145
|
// Grab finalForm functions/values from form hooks
|
|
109
146
|
var _useForm = (0, _reactFinalForm.useForm)(),
|
|
@@ -115,13 +152,14 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
115
152
|
pristine = _useFormState.pristine,
|
|
116
153
|
submitting = _useFormState.submitting,
|
|
117
154
|
values = _useFormState.values;
|
|
155
|
+
|
|
156
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
118
157
|
/*
|
|
119
158
|
Keep track of which field we are editing.
|
|
120
159
|
null for no field, string id if we are editing an existing field and
|
|
121
160
|
'NEW_ROW' for a new row
|
|
122
161
|
*/
|
|
123
162
|
|
|
124
|
-
|
|
125
163
|
var _useState = (0, _react.useState)(null),
|
|
126
164
|
_useState2 = _slicedToArray(_useState, 2),
|
|
127
165
|
editing = _useState2[0],
|
|
@@ -142,7 +180,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
142
180
|
_a = _fields$value$index.actionListActions,
|
|
143
181
|
_fn = _fields$value$index.fieldName,
|
|
144
182
|
_fi = _fields$value$index.fieldIndex,
|
|
145
|
-
rowData = _objectWithoutProperties(_fields$value$index,
|
|
183
|
+
rowData = _objectWithoutProperties(_fields$value$index, _excluded3); // Find "edit" entry in actionAssigner
|
|
146
184
|
|
|
147
185
|
|
|
148
186
|
var editCallback = (_actionAssigner = actionAssigner(rowData)) === null || _actionAssigner === void 0 ? void 0 : (_actionAssigner$find = _actionAssigner.find(function (act) {
|
|
@@ -151,8 +189,6 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
151
189
|
|
|
152
190
|
if (editCallback) {
|
|
153
191
|
editCallback(rowData);
|
|
154
|
-
} else {
|
|
155
|
-
actionCalls.edit(rowData); // DEPRECATED
|
|
156
192
|
}
|
|
157
193
|
};
|
|
158
194
|
|
|
@@ -161,12 +197,10 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
161
197
|
_a = _fields$value$index2.actionListActions,
|
|
162
198
|
_fn = _fields$value$index2.fieldName,
|
|
163
199
|
_fi = _fields$value$index2.fieldIndex,
|
|
164
|
-
rowData = _objectWithoutProperties(_fields$value$index2,
|
|
200
|
+
rowData = _objectWithoutProperties(_fields$value$index2, _excluded4);
|
|
165
201
|
|
|
166
202
|
if (createCallback) {
|
|
167
203
|
createCallback(rowData);
|
|
168
|
-
} else {
|
|
169
|
-
actionCalls.create(rowData); // DEPRECATED
|
|
170
204
|
}
|
|
171
205
|
};
|
|
172
206
|
|
|
@@ -200,11 +234,12 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
200
234
|
var fieldName = "contentData[".concat(data.rowIndex, "]");
|
|
201
235
|
|
|
202
236
|
var actions = data.actionListActions,
|
|
203
|
-
rest = _objectWithoutProperties(data,
|
|
237
|
+
rest = _objectWithoutProperties(data, _excluded5);
|
|
204
238
|
|
|
205
239
|
if (data.id === editing || !data.id && editing === 'NEW_ROW') {
|
|
206
240
|
// Render the save/cancel buttons
|
|
207
241
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
242
|
+
id: "action-button-parent",
|
|
208
243
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
209
244
|
buttonStyle: "primary",
|
|
210
245
|
disabled: hasValidationErrors || submitting || pristine,
|
|
@@ -223,8 +258,9 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
223
258
|
}
|
|
224
259
|
},
|
|
225
260
|
type: "submit",
|
|
226
|
-
children:
|
|
227
|
-
id:
|
|
261
|
+
children: kintIntl.formatKintMessage({
|
|
262
|
+
id: 'save',
|
|
263
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.save
|
|
228
264
|
})
|
|
229
265
|
}, "save[".concat(data.rowIndex, "]")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
230
266
|
"data-type-button": "cancel",
|
|
@@ -238,30 +274,23 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
238
274
|
toggleEditing(data.id);
|
|
239
275
|
}
|
|
240
276
|
},
|
|
241
|
-
children:
|
|
242
|
-
id:
|
|
277
|
+
children: kintIntl.formatKintMessage({
|
|
278
|
+
id: 'cancel',
|
|
279
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.cancel
|
|
243
280
|
})
|
|
244
281
|
}, "cancel[".concat(data.rowIndex, "]"))]
|
|
245
282
|
});
|
|
246
283
|
}
|
|
247
284
|
|
|
248
285
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
286
|
+
id: "action-button-parent",
|
|
249
287
|
children: actions === null || actions === void 0 ? void 0 : actions.map(function (action) {
|
|
250
|
-
var _action$label;
|
|
251
|
-
|
|
252
288
|
var actionFunction;
|
|
253
289
|
|
|
254
290
|
if (action.callback) {
|
|
255
291
|
actionFunction = function actionFunction() {
|
|
256
292
|
return action.callback(rest);
|
|
257
293
|
};
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (!actionFunction && actionCalls[action.name]) {
|
|
261
|
-
actionFunction = function actionFunction() {
|
|
262
|
-
return actionCalls[action.name](rest);
|
|
263
|
-
}; // DEPRECATED
|
|
264
|
-
|
|
265
294
|
} // Edit has special action functionality, revealing fields etc.
|
|
266
295
|
|
|
267
296
|
|
|
@@ -281,35 +310,64 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
281
310
|
} else {
|
|
282
311
|
throw new Error("Provided ariaLabel for action \"".concat(action.name, "\" must be a function or a string."));
|
|
283
312
|
}
|
|
284
|
-
}
|
|
313
|
+
}
|
|
285
314
|
|
|
315
|
+
var tooltip;
|
|
316
|
+
var tooltipSub;
|
|
317
|
+
|
|
318
|
+
if (action !== null && action !== void 0 && action.tooltip) {
|
|
319
|
+
if (typeof action.tooltip === 'function') {
|
|
320
|
+
tooltip = action.tooltip(data);
|
|
321
|
+
} else {
|
|
322
|
+
tooltip = action.tooltip;
|
|
323
|
+
}
|
|
286
324
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
325
|
+
if (action !== null && action !== void 0 && action.tooltipSub) {
|
|
326
|
+
if (typeof action.tooltipSub === 'function') {
|
|
327
|
+
tooltipSub = action.tooltipSub(data);
|
|
328
|
+
} else {
|
|
329
|
+
tooltipSub = action.tooltipSub;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
} // If a tooltip is declared, render that around the actionButton
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
if (tooltip) {
|
|
336
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
337
|
+
id: "action-".concat(action.name, "[").concat(data.rowIndex, "]-tooltip"),
|
|
338
|
+
sub: tooltipSub,
|
|
339
|
+
text: tooltip,
|
|
340
|
+
children: function children(_ref3) {
|
|
341
|
+
var actionTriggerRef = _ref3.ref,
|
|
342
|
+
ariaIds = _ref3.ariaIds;
|
|
343
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionTrigger, {
|
|
344
|
+
ref: actionTriggerRef,
|
|
345
|
+
action: action,
|
|
346
|
+
"aria-describedby": ariaIds.sub,
|
|
347
|
+
"aria-labelledby": ariaIds.text,
|
|
348
|
+
disabled: editing,
|
|
349
|
+
onClick: function onClick() {
|
|
350
|
+
return actionFunction ? actionFunction() : function () {
|
|
351
|
+
return null;
|
|
352
|
+
};
|
|
353
|
+
},
|
|
354
|
+
to: action.to
|
|
355
|
+
}, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
} // Finally, render the action button itself
|
|
300
359
|
|
|
301
360
|
|
|
302
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
361
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionTrigger, {
|
|
362
|
+
action: action,
|
|
303
363
|
ariaLabel: ariaLabel,
|
|
304
364
|
disabled: editing,
|
|
305
|
-
marginBottom0: true,
|
|
306
365
|
onClick: function onClick() {
|
|
307
366
|
return actionFunction ? actionFunction() : function () {
|
|
308
367
|
return null;
|
|
309
368
|
};
|
|
310
369
|
},
|
|
311
|
-
to: action.to
|
|
312
|
-
children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
|
|
370
|
+
to: action.to
|
|
313
371
|
}, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
|
|
314
372
|
})
|
|
315
373
|
});
|
|
@@ -328,7 +386,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
328
386
|
};
|
|
329
387
|
|
|
330
388
|
var formatter = mclProps.formatter,
|
|
331
|
-
restOfMclProps = _objectWithoutProperties(mclProps,
|
|
389
|
+
restOfMclProps = _objectWithoutProperties(mclProps, _excluded6); // Destructure formatter part of mclProps
|
|
332
390
|
|
|
333
391
|
|
|
334
392
|
var fieldAwareFormatter = function fieldAwareFormatter() {
|
|
@@ -396,18 +454,19 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
396
454
|
className: _ActionListFieldArray.default.headerText,
|
|
397
455
|
children: label
|
|
398
456
|
}), !hideCreateButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
399
|
-
disabled: editing || !
|
|
400
|
-
,
|
|
457
|
+
disabled: editing || !createCallback,
|
|
401
458
|
marginBottom0: true,
|
|
402
459
|
onClick: handleClickCreate,
|
|
403
|
-
children:
|
|
404
|
-
id:
|
|
460
|
+
children: kintIntl.formatKintMessage({
|
|
461
|
+
id: 'new',
|
|
462
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
|
|
405
463
|
})
|
|
406
464
|
})]
|
|
407
465
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
|
|
408
466
|
columnMapping: _objectSpread(_objectSpread({}, columnMapping), {}, {
|
|
409
|
-
actionListActions:
|
|
410
|
-
id:
|
|
467
|
+
actionListActions: kintIntl.formatKintMessage({
|
|
468
|
+
id: 'actions',
|
|
469
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.actions
|
|
411
470
|
})
|
|
412
471
|
}),
|
|
413
472
|
columnWidths: getColumnWidths(),
|
|
@@ -415,7 +474,18 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
415
474
|
formatter: _objectSpread({
|
|
416
475
|
actionListActions: renderActionButtons
|
|
417
476
|
}, fieldAwareFormatter()),
|
|
418
|
-
interactive:
|
|
477
|
+
interactive: !!onRowClick,
|
|
478
|
+
onRowClick: onRowClick ? function (e, row) {
|
|
479
|
+
// Make sure we ONLY fire row click from row, and not from action buttons.
|
|
480
|
+
var targetIsAction = e.target.closest('[id^=action-button-parent]') !== null;
|
|
481
|
+
|
|
482
|
+
if (!targetIsAction) {
|
|
483
|
+
var _ala = row.actionListActions,
|
|
484
|
+
rowWithoutActions = _objectWithoutProperties(row, _excluded7);
|
|
485
|
+
|
|
486
|
+
onRowClick(e, rowWithoutActions);
|
|
487
|
+
}
|
|
488
|
+
} : null,
|
|
419
489
|
visibleColumns: [].concat(_toConsumableArray(visibleFields), ['actionListActions'])
|
|
420
490
|
}, restOfMclProps))]
|
|
421
491
|
});
|