@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
|
@@ -15,19 +15,26 @@ var _components = require("@folio/stripes/components");
|
|
|
15
15
|
|
|
16
16
|
var _NoResultsMessage = _interopRequireDefault(require("../../../styles/NoResultsMessage.css"));
|
|
17
17
|
|
|
18
|
+
var _hooks = require("../hooks");
|
|
19
|
+
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
24
|
var NoResultsMessage = function NoResultsMessage(_ref) {
|
|
23
25
|
var userIcon = _ref.icon,
|
|
26
|
+
passedIntlKey = _ref.intlKey,
|
|
27
|
+
passedIntlNS = _ref.intlNS,
|
|
24
28
|
isLoading = _ref.isLoading,
|
|
25
29
|
isError = _ref.isError,
|
|
26
30
|
error = _ref.error,
|
|
27
31
|
filterPaneIsVisible = _ref.filterPaneIsVisible,
|
|
28
32
|
userLabel = _ref.label,
|
|
33
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
34
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
29
35
|
searchTerm = _ref.searchTerm,
|
|
30
36
|
toggleFilterPane = _ref.toggleFilterPane;
|
|
37
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
31
38
|
var icon = 'search';
|
|
32
39
|
var label = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
33
40
|
id: "stripes-smart-components.sas.noResults.default",
|
|
@@ -72,8 +79,9 @@ var NoResultsMessage = function NoResultsMessage(_ref) {
|
|
|
72
79
|
buttonClass: _NoResultsMessage.default.noResultsMessageButton,
|
|
73
80
|
marginBottom0: true,
|
|
74
81
|
onClick: toggleFilterPane,
|
|
75
|
-
children:
|
|
76
|
-
id:
|
|
82
|
+
children: kintIntl.formatKintMessage({
|
|
83
|
+
id: 'showFilters',
|
|
84
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.showFilters
|
|
77
85
|
})
|
|
78
86
|
})]
|
|
79
87
|
});
|
|
@@ -83,9 +91,12 @@ NoResultsMessage.propTypes = {
|
|
|
83
91
|
error: _propTypes.default.object,
|
|
84
92
|
filterPaneIsVisible: _propTypes.default.bool.isRequired,
|
|
85
93
|
icon: _propTypes.default.string,
|
|
94
|
+
intlKey: _propTypes.default.string,
|
|
95
|
+
intlNS: _propTypes.default.string,
|
|
86
96
|
isLoading: _propTypes.default.bool,
|
|
87
97
|
isError: _propTypes.default.bool,
|
|
88
98
|
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node, _propTypes.default.func]),
|
|
99
|
+
labelOverrides: _propTypes.default.object,
|
|
89
100
|
searchTerm: _propTypes.default.string.isRequired,
|
|
90
101
|
toggleFilterPane: _propTypes.default.func.isRequired
|
|
91
102
|
};
|
|
@@ -9,12 +9,12 @@ var _react = require("react");
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _reactIntl = require("react-intl");
|
|
13
|
-
|
|
14
12
|
var _components = require("@folio/stripes/components");
|
|
15
13
|
|
|
16
14
|
var _RichSelect = _interopRequireDefault(require("../../../styles/RichSelect.css"));
|
|
17
15
|
|
|
16
|
+
var _FormattedKintMessage = _interopRequireDefault(require("../FormattedKintMessage"));
|
|
17
|
+
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -48,6 +48,8 @@ var RichSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
48
48
|
id = _ref.id,
|
|
49
49
|
_ref$input = _ref.input,
|
|
50
50
|
formInput = _ref$input === void 0 ? {} : _ref$input,
|
|
51
|
+
passedIntlKey = _ref.intlKey,
|
|
52
|
+
passedIntlNS = _ref.intlNS,
|
|
51
53
|
label = _ref.label,
|
|
52
54
|
meta = _ref.meta,
|
|
53
55
|
onChange = _ref.onChange,
|
|
@@ -101,12 +103,11 @@ var RichSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
101
103
|
var onToggle = _ref3.onToggle,
|
|
102
104
|
triggerRef = _ref3.triggerRef,
|
|
103
105
|
keyHandler = _ref3.keyHandler,
|
|
104
|
-
open = _ref3.open,
|
|
105
106
|
ariaProps = _ref3.ariaProps,
|
|
106
107
|
getTriggerProps = _ref3.getTriggerProps;
|
|
107
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.
|
|
108
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownButton, _objectSpread(_objectSpread(_objectSpread({
|
|
108
109
|
ref: triggerRef,
|
|
109
|
-
buttonClass: _RichSelect.default.
|
|
110
|
+
buttonClass: _RichSelect.default.triggerButton,
|
|
110
111
|
buttonStyle: "none",
|
|
111
112
|
disabled: disabled,
|
|
112
113
|
marginBottom0: true,
|
|
@@ -115,36 +116,12 @@ var RichSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
115
116
|
paddingSide0: true,
|
|
116
117
|
type: "button"
|
|
117
118
|
}, getTriggerProps()), ariaProps), {}, {
|
|
118
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
id: "stripes-kint-components.richSelect.placeholder"
|
|
123
|
-
})
|
|
119
|
+
children: (_ref4 = (_ref5 = (_ref6 = (_selectedOption$label = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _selectedOption$label !== void 0 ? _selectedOption$label : selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _ref6 !== void 0 ? _ref6 : internalValue || null) !== null && _ref5 !== void 0 ? _ref5 : placeholder) !== null && _ref4 !== void 0 ? _ref4 : /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormattedKintMessage.default, {
|
|
120
|
+
id: "pleaseSelectOption",
|
|
121
|
+
intlKey: passedIntlKey,
|
|
122
|
+
intlNS: passedIntlNS
|
|
124
123
|
})
|
|
125
|
-
}))
|
|
126
|
-
|
|
127
|
-
/* <IconButton
|
|
128
|
-
ref={triggerRef}
|
|
129
|
-
disabled={disabled}
|
|
130
|
-
icon={open ? 'caret-up' : 'caret-down'}
|
|
131
|
-
iconPosition="end"
|
|
132
|
-
marginBottom0
|
|
133
|
-
onClick={onToggle}
|
|
134
|
-
onKeyDown={keyHandler}
|
|
135
|
-
type="button"
|
|
136
|
-
{...getTriggerProps()}
|
|
137
|
-
{...ariaProps}
|
|
138
|
-
>
|
|
139
|
-
{
|
|
140
|
-
selectedOption?.label ??
|
|
141
|
-
selectedOption?.value ??
|
|
142
|
-
(internalValue ? internalValue : null) ??
|
|
143
|
-
placeholder ??
|
|
144
|
-
<FormattedMessage id="stripes-kint-components.richSelect.placeholder" />
|
|
145
|
-
}
|
|
146
|
-
</IconButton> */
|
|
147
|
-
;
|
|
124
|
+
}));
|
|
148
125
|
};
|
|
149
126
|
|
|
150
127
|
var handleChange = function handleChange(e) {
|
|
@@ -234,6 +211,8 @@ RichSelect.propTypes = {
|
|
|
234
211
|
dropdownProps: _propTypes.default.object,
|
|
235
212
|
id: _propTypes.default.string,
|
|
236
213
|
input: _propTypes.default.object,
|
|
214
|
+
intlKey: _propTypes.default.string,
|
|
215
|
+
intlNS: _propTypes.default.string,
|
|
237
216
|
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func, _propTypes.default.node]),
|
|
238
217
|
meta: _propTypes.default.object,
|
|
239
218
|
onChange: _propTypes.default.func,
|
|
@@ -75,10 +75,15 @@ var SASQLookupComponent = function SASQLookupComponent(props) {
|
|
|
75
75
|
} : _props$FilterPaneHead,
|
|
76
76
|
filterPaneProps = props.filterPaneProps,
|
|
77
77
|
id = props.id,
|
|
78
|
+
passedIntlKey = props.intlKey,
|
|
79
|
+
passedIntlNS = props.intlNS,
|
|
80
|
+
_props$labelOverrides = props.labelOverrides,
|
|
81
|
+
labelOverrides = _props$labelOverrides === void 0 ? {} : _props$labelOverrides,
|
|
78
82
|
mainPaneProps = props.mainPaneProps,
|
|
79
83
|
noSearchField = props.noSearchField,
|
|
80
84
|
RenderBody = props.RenderBody,
|
|
81
85
|
sasqProps = props.sasqProps;
|
|
86
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
82
87
|
|
|
83
88
|
var _useKiwtSASQuery = (0, _hooks.useKiwtSASQuery)(),
|
|
84
89
|
query = _useKiwtSASQuery.query,
|
|
@@ -232,16 +237,19 @@ var SASQLookupComponent = function SASQLookupComponent(props) {
|
|
|
232
237
|
}) : null,
|
|
233
238
|
noOverflow: true,
|
|
234
239
|
padContent: false,
|
|
235
|
-
paneSub:
|
|
236
|
-
id:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
paneSub: kintIntl.formatKintMessage({
|
|
241
|
+
id: 'found#Values',
|
|
242
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.foundValues
|
|
243
|
+
}, {
|
|
244
|
+
total: data === null || data === void 0 ? void 0 : data.total
|
|
240
245
|
})
|
|
241
246
|
}, mainPaneProps), {}, {
|
|
242
247
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Body, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
243
248
|
data: data,
|
|
244
249
|
filterPaneVisible: filterPaneVisible,
|
|
250
|
+
intlKey: passedIntlKey,
|
|
251
|
+
intlNS: passedIntlNS,
|
|
252
|
+
labelOverrides: labelOverrides,
|
|
245
253
|
query: query,
|
|
246
254
|
toggleFilterPane: toggleFilterPane
|
|
247
255
|
}, restOfInfiniteQueryProps), sasqRenderProps), sasqProps), props))
|
|
@@ -259,6 +267,9 @@ SASQLookupComponent.propTypes = {
|
|
|
259
267
|
FilterPaneHeaderComponent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
260
268
|
history: _propTypes.default.object,
|
|
261
269
|
id: _propTypes.default.string.isRequired,
|
|
270
|
+
intlKey: _propTypes.default.string,
|
|
271
|
+
intlNS: _propTypes.default.string,
|
|
272
|
+
labelOverrides: _propTypes.default.object,
|
|
262
273
|
location: _propTypes.default.object,
|
|
263
274
|
mainPaneProps: _propTypes.default.object,
|
|
264
275
|
match: _propTypes.default.object,
|
|
@@ -30,8 +30,12 @@ var TableBody = function TableBody(_ref) {
|
|
|
30
30
|
error = _ref.error,
|
|
31
31
|
fetchNextPage = _ref.fetchNextPage,
|
|
32
32
|
filterPaneVisible = _ref.filterPaneVisible,
|
|
33
|
+
passedIntlKey = _ref.intlKey,
|
|
34
|
+
passedIntlNS = _ref.intlNS,
|
|
33
35
|
isError = _ref.isError,
|
|
34
36
|
isLoading = _ref.isLoading,
|
|
37
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
38
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
35
39
|
match = _ref.match,
|
|
36
40
|
mclProps = _ref.mclProps,
|
|
37
41
|
onSort = _ref.onSort,
|
|
@@ -64,9 +68,12 @@ var TableBody = function TableBody(_ref) {
|
|
|
64
68
|
hasMargin: true,
|
|
65
69
|
isEmptyMessage: /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoResultsMessage.default, {
|
|
66
70
|
error: error,
|
|
71
|
+
filterPaneIsVisible: filterPaneVisible,
|
|
72
|
+
intlKey: passedIntlKey,
|
|
73
|
+
intlNS: passedIntlNS,
|
|
67
74
|
isError: isError,
|
|
68
75
|
isLoading: isLoading,
|
|
69
|
-
|
|
76
|
+
labelOverrides: labelOverrides,
|
|
70
77
|
searchTerm: query.query,
|
|
71
78
|
toggleFilterPane: toggleFilterPane
|
|
72
79
|
}),
|
|
@@ -98,8 +105,11 @@ TableBody.propTypes = {
|
|
|
98
105
|
fetchNextPage: _propTypes.default.func,
|
|
99
106
|
filterPaneVisible: _propTypes.default.bool,
|
|
100
107
|
history: _propTypes.default.object,
|
|
108
|
+
intlKey: _propTypes.default.string,
|
|
109
|
+
intlNS: _propTypes.default.string,
|
|
101
110
|
isError: _propTypes.default.bool,
|
|
102
111
|
isLoading: _propTypes.default.bool,
|
|
112
|
+
labelOverrides: _propTypes.default.object,
|
|
103
113
|
location: _propTypes.default.object,
|
|
104
114
|
match: _propTypes.default.object,
|
|
105
115
|
mclProps: _propTypes.default.object,
|
|
@@ -26,7 +26,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
28
|
var SettingPage = function SettingPage(_ref) {
|
|
29
|
-
var
|
|
29
|
+
var passedIntlKey = _ref.intlKey,
|
|
30
|
+
passedIntlNS = _ref.intlNS,
|
|
31
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
32
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
33
|
+
sectionName = _ref.sectionName;
|
|
30
34
|
|
|
31
35
|
var _useContext = (0, _react.useContext)(_contexts.SettingsContext),
|
|
32
36
|
settingEndpoint = _useContext.settingEndpoint;
|
|
@@ -42,6 +46,9 @@ var SettingPage = function SettingPage(_ref) {
|
|
|
42
46
|
initialValues: {
|
|
43
47
|
'settings': settings
|
|
44
48
|
},
|
|
49
|
+
intlKey: passedIntlKey,
|
|
50
|
+
intlNS: passedIntlNS,
|
|
51
|
+
labelOverrides: labelOverrides,
|
|
45
52
|
onSave: handleSubmit,
|
|
46
53
|
onSubmit: handleSubmit,
|
|
47
54
|
settingSection: sectionName
|
|
@@ -49,18 +56,10 @@ var SettingPage = function SettingPage(_ref) {
|
|
|
49
56
|
};
|
|
50
57
|
|
|
51
58
|
SettingPage.propTypes = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
sectionName: _propTypes.default.string
|
|
56
|
-
resources: _propTypes.default.shape({
|
|
57
|
-
settings: _propTypes.default.shape({
|
|
58
|
-
records: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
59
|
-
}),
|
|
60
|
-
refdatavalues: _propTypes.default.shape({
|
|
61
|
-
records: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
62
|
-
})
|
|
63
|
-
})
|
|
59
|
+
intlKey: _propTypes.default.string,
|
|
60
|
+
intlNS: _propTypes.default.string,
|
|
61
|
+
labelOverrides: _propTypes.default.object,
|
|
62
|
+
sectionName: _propTypes.default.string
|
|
64
63
|
};
|
|
65
64
|
var _default = SettingPage;
|
|
66
65
|
exports.default = _default;
|
|
@@ -1,44 +1,34 @@
|
|
|
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
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
7
|
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
9
|
|
|
14
10
|
var _components = require("@folio/stripes/components");
|
|
15
11
|
|
|
16
|
-
var _reactIntl = require("react-intl");
|
|
17
|
-
|
|
18
|
-
var _contexts = require("../contexts");
|
|
19
|
-
|
|
20
12
|
var _utils = require("../utils");
|
|
21
13
|
|
|
14
|
+
var _hooks = require("../hooks");
|
|
15
|
+
|
|
22
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
17
|
|
|
24
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
19
|
|
|
26
|
-
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); }
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
20
|
var SettingPagePane = function SettingPagePane(_ref) {
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
var children = _ref.children,
|
|
22
|
+
passedIntlKey = _ref.intlKey,
|
|
23
|
+
passedIntlNS = _ref.intlNS,
|
|
24
|
+
sectionName = _ref.sectionName;
|
|
25
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
37
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, {
|
|
38
27
|
defaultWidth: "fill",
|
|
39
28
|
id: "settings-".concat(sectionName),
|
|
40
|
-
paneTitle:
|
|
41
|
-
id: "
|
|
29
|
+
paneTitle: kintIntl.formatKintMessage({
|
|
30
|
+
id: "settings.settingsSection.".concat((0, _utils.toCamelCase)(sectionName)),
|
|
31
|
+
fallbackMessage: sectionName
|
|
42
32
|
}),
|
|
43
33
|
children: children
|
|
44
34
|
});
|
|
@@ -46,6 +36,8 @@ var SettingPagePane = function SettingPagePane(_ref) {
|
|
|
46
36
|
|
|
47
37
|
SettingPagePane.propTypes = {
|
|
48
38
|
sectionName: _propTypes.default.string,
|
|
39
|
+
intlKey: _propTypes.default.string,
|
|
40
|
+
intlNS: _propTypes.default.string,
|
|
49
41
|
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node])
|
|
50
42
|
};
|
|
51
43
|
var _default = SettingPagePane;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _refdata = _interopRequireDefault(require("../../../../test/jest/refdata"));
|
|
4
|
+
|
|
5
|
+
var _customProperties = _interopRequireDefault(require("../../../../test/jest/customProperties"));
|
|
6
|
+
|
|
7
|
+
var _useKintIntl = _interopRequireDefault(require("../useKintIntl"));
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
// We have to do this up here too so that our passed useKintIntl
|
|
12
|
+
// ALSO has a mocked useIntlKeyStore... I think anyway
|
|
13
|
+
jest.mock('../useIntlKeyStore', function () {
|
|
14
|
+
return function () {
|
|
15
|
+
return function () {
|
|
16
|
+
return 'ui-test-implementor';
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
module.exports = {
|
|
21
|
+
useRefdata: function useRefdata() {
|
|
22
|
+
return _refdata.default;
|
|
23
|
+
},
|
|
24
|
+
useTemplates: function useTemplates() {
|
|
25
|
+
return [];
|
|
26
|
+
},
|
|
27
|
+
// We should set up some templates to test this properly
|
|
28
|
+
useCustomProperties: function useCustomProperties() {
|
|
29
|
+
return {
|
|
30
|
+
data: _customProperties.default,
|
|
31
|
+
isLoading: false
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
useMutateCustomProperties: function useMutateCustomProperties() {
|
|
35
|
+
return [];
|
|
36
|
+
},
|
|
37
|
+
useIntlKeyStore: function useIntlKeyStore() {
|
|
38
|
+
return function () {
|
|
39
|
+
return function () {
|
|
40
|
+
return 'ui-test-implementor';
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
useKintIntl: _useKintIntl.default // Use the "proper" useKintIntl but with a mocked intlKeyStore which returns the ui-test-implementor
|
|
45
|
+
|
|
46
|
+
};
|
package/es/lib/hooks/index.js
CHANGED
|
@@ -15,12 +15,6 @@ Object.defineProperty(exports, "useAppSettings", {
|
|
|
15
15
|
return _settingsHooks.useAppSettings;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "useAvailableCustomProperties", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _useAvailableCustomProperties.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
18
|
Object.defineProperty(exports, "useCustomProperties", {
|
|
25
19
|
enumerable: true,
|
|
26
20
|
get: function get() {
|
|
@@ -33,12 +27,30 @@ Object.defineProperty(exports, "useHelperApp", {
|
|
|
33
27
|
return _useHelperApp.default;
|
|
34
28
|
}
|
|
35
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "useIntlKey", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _useIntlKey.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "useIntlKeyStore", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _useIntlKeyStore.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "useInvalidateRefdata", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function get() {
|
|
39
45
|
return _useInvalidateRefdata.default;
|
|
40
46
|
}
|
|
41
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "useKintIntl", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _useKintIntl.default;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
42
54
|
Object.defineProperty(exports, "useKiwtFieldArray", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function get() {
|
|
@@ -130,10 +142,14 @@ var _useCustomProperties = _interopRequireDefault(require("./useCustomProperties
|
|
|
130
142
|
|
|
131
143
|
var _useMutateCustomProperties = _interopRequireDefault(require("./useMutateCustomProperties"));
|
|
132
144
|
|
|
133
|
-
var _useAvailableCustomProperties = _interopRequireDefault(require("./useAvailableCustomProperties"));
|
|
134
|
-
|
|
135
145
|
var _useInvalidateRefdata = _interopRequireDefault(require("./useInvalidateRefdata"));
|
|
136
146
|
|
|
137
147
|
var _useMutateRefdataCategory = _interopRequireDefault(require("./useMutateRefdataCategory"));
|
|
138
148
|
|
|
149
|
+
var _useKintIntl = _interopRequireDefault(require("./useKintIntl"));
|
|
150
|
+
|
|
151
|
+
var _useIntlKeyStore = _interopRequireDefault(require("./useIntlKeyStore"));
|
|
152
|
+
|
|
153
|
+
var _useIntlKey = _interopRequireDefault(require("./useIntlKey"));
|
|
154
|
+
|
|
139
155
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,20 +1,16 @@
|
|
|
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
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
7
|
|
|
10
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
11
|
|
|
14
12
|
var _reactQuery = require("react-query");
|
|
15
13
|
|
|
16
|
-
var _reactIntl = require("react-intl");
|
|
17
|
-
|
|
18
14
|
var _core = require("@folio/stripes/core");
|
|
19
15
|
|
|
20
16
|
var _smartComponents = require("@folio/stripes/smart-components");
|
|
@@ -25,13 +21,13 @@ var _contexts = require("../../contexts");
|
|
|
25
21
|
|
|
26
22
|
var _utils = require("../../utils");
|
|
27
23
|
|
|
28
|
-
var
|
|
24
|
+
var _useKintIntl = _interopRequireDefault(require("../useKintIntl"));
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
var _useIntlKey = _interopRequireDefault(require("../useIntlKey"));
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
29
|
|
|
34
|
-
function
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
31
|
|
|
36
32
|
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; }
|
|
37
33
|
|
|
@@ -53,13 +49,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
53
49
|
|
|
54
50
|
var useSettings = function useSettings(_ref) {
|
|
55
51
|
var dynamicPageExclusions = _ref.dynamicPageExclusions,
|
|
56
|
-
|
|
52
|
+
passedIntlKey = _ref.intlKey,
|
|
53
|
+
passedIntlNS = _ref.intlNS,
|
|
54
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
55
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
57
56
|
persistentPages = _ref.persistentPages,
|
|
58
57
|
refdataEndpoint = _ref.refdataEndpoint,
|
|
59
58
|
settingEndpoint = _ref.settingEndpoint,
|
|
60
59
|
templateEndpoint = _ref.templateEndpoint;
|
|
61
60
|
var ky = (0, _core.useOkapiKy)();
|
|
62
|
-
var
|
|
61
|
+
var kintIntl = (0, _useKintIntl.default)(passedIntlKey, passedIntlNS);
|
|
63
62
|
var queryParams = (0, _utils.generateKiwtQueryParams)({
|
|
64
63
|
filters: dynamicPageExclusions === null || dynamicPageExclusions === void 0 ? void 0 : dynamicPageExclusions.map(function (dpe) {
|
|
65
64
|
return {
|
|
@@ -86,14 +85,19 @@ var useSettings = function useSettings(_ref) {
|
|
|
86
85
|
var dynamic = sections.map(function (section) {
|
|
87
86
|
return {
|
|
88
87
|
route: section,
|
|
89
|
-
label:
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
label: kintIntl.formatKintMessage({
|
|
89
|
+
id: "settings.settingsSection.".concat((0, _utils.toCamelCase)(section)),
|
|
90
|
+
fallbackMessage: section
|
|
92
91
|
}),
|
|
93
92
|
component: function component(props) {
|
|
94
93
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingPage.SettingPagePane, {
|
|
94
|
+
intlKey: passedIntlKey,
|
|
95
|
+
intlNS: passedIntlNS,
|
|
95
96
|
sectionName: section,
|
|
96
97
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingPage.SettingPage, _objectSpread({
|
|
98
|
+
intlKey: passedIntlKey,
|
|
99
|
+
intlNS: passedIntlNS,
|
|
100
|
+
labelOverrides: labelOverrides,
|
|
97
101
|
sectionName: section
|
|
98
102
|
}, props))
|
|
99
103
|
});
|
|
@@ -101,12 +105,14 @@ var useSettings = function useSettings(_ref) {
|
|
|
101
105
|
};
|
|
102
106
|
});
|
|
103
107
|
var pageList = persistentPages.concat(dynamic).sort(_utils.sortByLabel);
|
|
108
|
+
var intlKey = (0, _useIntlKey.default)(passedIntlKey, passedIntlNS);
|
|
104
109
|
|
|
105
110
|
var SettingsContextProvider = function SettingsContextProvider(_ref2) {
|
|
106
111
|
var children = _ref2.children;
|
|
107
112
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_contexts.SettingsContext.Provider, {
|
|
108
113
|
value: {
|
|
109
114
|
intlKey: intlKey,
|
|
115
|
+
// This is only here for backwards compatibility... is now grabbed from useIntlKey instead of what's passed in directly
|
|
110
116
|
refdataEndpoint: refdataEndpoint,
|
|
111
117
|
settingEndpoint: settingEndpoint,
|
|
112
118
|
templateEndpoint: templateEndpoint
|
|
@@ -120,11 +126,10 @@ var useSettings = function useSettings(_ref) {
|
|
|
120
126
|
};
|
|
121
127
|
|
|
122
128
|
var SettingsComponent = function SettingsComponent(props) {
|
|
123
|
-
var settingsData = (0, _react.useContext)(_contexts.SettingsContext);
|
|
124
129
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_smartComponents.Settings, _objectSpread({
|
|
125
130
|
pages: pageList,
|
|
126
|
-
paneTitle:
|
|
127
|
-
id:
|
|
131
|
+
paneTitle: kintIntl.formatKintMessage({
|
|
132
|
+
id: 'meta.title'
|
|
128
133
|
})
|
|
129
134
|
}, props));
|
|
130
135
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _useIntlKeyStore = _interopRequireDefault(require("./useIntlKeyStore"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var useIntlKey = function useIntlKey(passedIntlKey, passedIntlNS) {
|
|
13
|
+
var getKey = (0, _useIntlKeyStore.default)(function (state) {
|
|
14
|
+
return state.getKey;
|
|
15
|
+
});
|
|
16
|
+
var intlKey;
|
|
17
|
+
|
|
18
|
+
if (passedIntlKey) {
|
|
19
|
+
intlKey = passedIntlKey;
|
|
20
|
+
} else if (passedIntlNS) {
|
|
21
|
+
intlKey = getKey(passedIntlNS);
|
|
22
|
+
} else {
|
|
23
|
+
intlKey = getKey();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (!intlKey) {
|
|
27
|
+
throw new Error('Stripes kint components requires an intl key to be either configured via `addKey` from `useIntlKeyStore` or passed directly into components');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return intlKey;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var _default = useIntlKey;
|
|
34
|
+
exports.default = _default;
|