@k-int/stripes-kint-components 4.5.1 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/README.md +14 -0
- package/es/__mocks__/@folio/stripes/components.js +10 -21
- package/es/__mocks__/@folio/stripes/core.js +4 -7
- package/es/__mocks__/@folio/stripes/smart-components.js +4 -7
- package/es/__mocks__/react-query.js +4 -7
- package/es/__mocks__/react-router-dom.js +6 -7
- package/es/artifacts/coverage-jest/lcov-report/prettify.js +2 -2
- package/es/artifacts/coverage-jest/lcov-report/sorter.js +6 -6
- package/es/index.js +62 -49
- package/es/lib/ActionList/ActionList.js +38 -51
- package/es/lib/ActionList/ActionListFieldArray.js +143 -167
- package/es/lib/ActionList/index.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +57 -77
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +15 -19
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +111 -160
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +30 -67
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +36 -48
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +83 -121
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +9 -8
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +48 -135
- package/es/lib/CustomProperties/Config/index.js +4 -4
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +19 -21
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +11 -16
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +29 -27
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +11 -16
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +86 -103
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +26 -63
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +123 -115
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +95 -176
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +43 -44
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +23 -27
- package/es/lib/CustomProperties/Edit/index.js +5 -5
- package/es/lib/CustomProperties/Edit/testResources.js +13 -35
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +60 -81
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -57
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +39 -54
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +17 -16
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +27 -23
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +18 -45
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +18 -20
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +23 -52
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +37 -41
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +77 -225
- package/es/lib/CustomProperties/Filter/index.js +6 -6
- package/es/lib/CustomProperties/Filter/testResources.js +12 -32
- package/es/lib/CustomProperties/Filter/useOperators.js +17 -16
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +17 -30
- package/es/lib/CustomProperties/Filter/useValueProps.js +22 -27
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +19 -21
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +11 -16
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +49 -57
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +14 -23
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +17 -18
- package/es/lib/CustomProperties/View/index.js +3 -3
- package/es/lib/CustomProperties/View/testResources.js +4 -4
- package/es/lib/CustomProperties/index.js +18 -18
- package/es/lib/CycleButton/CycleButton.js +17 -32
- package/es/lib/CycleButton/index.js +1 -1
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +108 -150
- package/es/lib/EditableRefdataCategoryList/index.js +1 -1
- package/es/lib/EditableRefdataList/EditableRefdataList.js +127 -170
- package/es/lib/EditableRefdataList/index.js +1 -1
- package/es/lib/EditableSettingsList/EditableSettingsList.js +16 -13
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +18 -25
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +61 -90
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +21 -34
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +99 -83
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +17 -19
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +187 -275
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +74 -109
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +52 -157
- package/es/lib/EditableSettingsList/SettingField/index.js +3 -3
- package/es/lib/EditableSettingsList/index.js +3 -3
- package/es/lib/FormModal/FormModal.js +43 -46
- package/es/lib/FormModal/index.js +1 -1
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +23 -27
- package/es/lib/FormattedKintMessage/index.js +1 -1
- package/es/lib/IconSelect/IconSelect.js +48 -68
- package/es/lib/IconSelect/index.js +1 -1
- package/es/lib/NoResultsMessage/NoResultsMessage.js +18 -17
- package/es/lib/NoResultsMessage/index.js +1 -1
- package/es/lib/QueryTypedown/QueryTypedown.js +17 -38
- package/es/lib/QueryTypedown/index.js +1 -1
- package/es/lib/RefdataButtons/RefdataButtons.js +26 -29
- package/es/lib/RefdataButtons/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +83 -88
- package/es/lib/ResponsiveButtonGroup/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +27 -40
- package/es/lib/RichSelect/RichSelect.js +70 -86
- package/es/lib/RichSelect/index.js +2 -2
- package/es/lib/RichSelect/useSelectedOption.js +3 -12
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +115 -137
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +39 -45
- package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
- package/es/lib/SASQLookupComponent/index.js +2 -2
- package/es/lib/SASQRoute/SASQRoute.js +31 -37
- package/es/lib/SASQRoute/index.js +1 -1
- package/es/lib/SASQViewComponent/SASQViewComponent.js +38 -45
- package/es/lib/SASQViewComponent/index.js +1 -1
- package/es/lib/SearchField/SearchField.js +10 -16
- package/es/lib/SearchField/index.js +1 -1
- package/es/lib/SettingPage/SettingPage.js +21 -20
- package/es/lib/SettingPage/SettingPagePane.js +8 -6
- package/es/lib/SettingPage/index.js +2 -2
- package/es/lib/SettingsFormContainer/SettingsFormContainer.js +87 -0
- package/es/lib/SettingsFormContainer/index.js +13 -0
- package/es/lib/Typedown/Typedown.js +61 -79
- package/es/lib/Typedown/index.js +1 -1
- package/es/lib/constants/customProperties.js +11 -11
- package/es/lib/constants/endpoints.js +9 -0
- package/es/lib/constants/eventCodes.js +3 -3
- package/es/lib/contexts/SettingsContext.js +1 -1
- package/es/lib/contexts/index.js +1 -1
- package/es/lib/hooks/__mocks__/index.js +9 -29
- package/es/lib/hooks/index.js +31 -17
- package/es/lib/hooks/typedownHooks/index.js +3 -3
- package/es/lib/hooks/typedownHooks/useTypedown.js +48 -48
- package/es/lib/hooks/typedownHooks/useTypedownData.js +11 -21
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +12 -20
- package/es/lib/hooks/useActiveElement.js +8 -17
- package/es/lib/hooks/useCustomProperties.js +22 -30
- package/es/lib/hooks/useHelperApp.js +30 -49
- package/es/lib/hooks/useIntlKey.js +3 -5
- package/es/lib/hooks/useIntlKeyStore.js +44 -49
- package/es/lib/hooks/useInvalidateRefdata.js +3 -5
- package/es/lib/hooks/useKintIntl.js +28 -31
- package/es/lib/hooks/useKiwtFieldArray.js +34 -45
- package/es/lib/hooks/useKiwtSASQuery.js +38 -48
- package/es/lib/hooks/useLocalStorageState.js +6 -18
- package/es/lib/hooks/useModConfigEntries.js +49 -0
- package/es/lib/hooks/useMutateCustomProperties.js +19 -62
- package/es/lib/hooks/useMutateModConfigEntry.js +40 -0
- package/es/lib/hooks/useMutateRefdataCategory.js +19 -60
- package/es/lib/hooks/useMutateRefdataValue.js +28 -65
- package/es/lib/hooks/useQIndex.js +12 -26
- package/es/lib/hooks/useRefdata.js +17 -19
- package/es/lib/hooks/useSASQQueryMeta.js +13 -20
- package/es/lib/hooks/useTemplates.js +13 -12
- package/es/lib/settingsHooks/index.js +3 -3
- package/es/lib/settingsHooks/useAppSettings.js +18 -25
- package/es/lib/settingsHooks/useSettingSection.js +16 -17
- package/es/lib/settingsHooks/useSettings.js +58 -72
- package/es/lib/utils/buildUrl.js +5 -5
- package/es/lib/utils/generateKiwtQuery.js +3 -3
- package/es/lib/utils/generateKiwtQueryParams.js +85 -93
- package/es/lib/utils/groupCustomPropertiesByCtx.js +8 -18
- package/es/lib/utils/highlightString.js +17 -37
- package/es/lib/utils/index.js +29 -15
- package/es/lib/utils/matchString.js +4 -8
- package/es/lib/utils/modConfigEntriesQueryKey.js +24 -0
- package/es/lib/utils/parseErrorResponse.js +22 -63
- package/es/lib/utils/parseKiwtQueryGroups.js +10 -10
- package/es/lib/utils/parseKiwtQueryGroups.test.js +15 -15
- package/es/lib/utils/parseModConfigEntry.js +21 -0
- package/es/lib/utils/refdataQueryKey.js +2 -2
- package/es/lib/utils/selectorSafe.js +3 -3
- package/es/lib/utils/sortByLabel.js +3 -3
- package/es/lib/utils/toCamelCase.js +7 -12
- package/es/lib/utils/typedownQueryKey.js +2 -2
- package/es/lib/validators/index.js +1 -1
- package/es/lib/validators/validators.js +22 -29
- package/junit.xml +239 -1489
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +17 -17
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +44 -44
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +53 -53
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +59 -59
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +29 -29
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +53 -53
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +19 -19
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +28 -28
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +94 -94
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +118 -118
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +28 -28
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +64 -64
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +33 -33
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +47 -47
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +19 -19
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +42 -42
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +96 -96
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +35 -35
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +38 -38
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +34 -34
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +16 -16
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +45 -45
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +36 -36
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +39 -39
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +64 -64
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +64 -64
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +43 -43
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +28 -28
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +32 -32
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +54 -54
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +17 -17
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +17 -17
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +13 -13
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +18 -18
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/SettingsFormContainer.js.html +337 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/constants/endpoints.js.html +91 -0
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +28 -13
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +153 -123
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +8 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +23 -23
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +24 -24
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +21 -21
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +38 -38
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useModConfigEntries.js.html +226 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateModConfigEntry.js.html +238 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/index.html +257 -242
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.html +23 -23
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useAppSettings.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettingSection.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettings.js.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +4 -4
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +22 -22
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +61 -31
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +11 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/modConfigEntriesQueryKey.js.html +142 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseModConfigEntry.js.html +130 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +16 -16
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/validators/index.html +19 -19
- package/src/artifacts/coverage-jest/lcov-report/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/validators/validators.js.html +32 -32
- package/src/artifacts/coverage-jest/lcov.info +1225 -1067
- package/src/index.js +6 -0
- package/src/lib/SettingsFormContainer/SettingsFormContainer.js +84 -0
- package/src/lib/SettingsFormContainer/index.js +1 -0
- package/src/lib/constants/endpoints.js +2 -0
- package/src/lib/hooks/index.js +2 -0
- package/src/lib/hooks/useModConfigEntries.js +47 -0
- package/src/lib/hooks/useMutateModConfigEntry.js +51 -0
- package/src/lib/utils/index.js +3 -0
- package/src/lib/utils/modConfigEntriesQueryKey.js +19 -0
- package/src/lib/utils/parseModConfigEntry.js +15 -0
- package/test/jest/helpers/KintHarness.js +21 -4
|
@@ -9,28 +9,28 @@ var _reactResizeDetector = require("react-resize-detector");
|
|
|
9
9
|
var _components = require("@folio/stripes/components");
|
|
10
10
|
var _eventCodes = require("../../constants/eventCodes");
|
|
11
11
|
var _selectorSafe = _interopRequireDefault(require("../../utils/selectorSafe"));
|
|
12
|
-
var
|
|
12
|
+
var _useTypedownToggle = _interopRequireDefault(require("./useTypedownToggle"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
14
|
+
const useTypedown = name => {
|
|
15
15
|
// SEARCHFIELD COMPONENT
|
|
16
|
-
|
|
16
|
+
const searchFieldComponent = document.getElementById("typedown-searchField-".concat((0, _selectorSafe.default)(name)));
|
|
17
17
|
|
|
18
18
|
// SET UP REFS
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const listRef = (0, _react.useRef)();
|
|
20
|
+
const triggerRef = (0, _react.useRef)();
|
|
21
|
+
const overlayRef = (0, _react.useRef)();
|
|
22
|
+
const footerRef = (0, _react.useRef)();
|
|
23
|
+
const footer = document.getElementById("typedown-footer-".concat((0, _selectorSafe.default)(name)));
|
|
24
24
|
// Add an event listener to the footer, so that we can control tab behaviour between footer elements
|
|
25
25
|
|
|
26
26
|
if (footer && footer.getAttribute('hasListener') !== 'true') {
|
|
27
|
-
footer.addEventListener('keydown',
|
|
27
|
+
footer.addEventListener('keydown', e => {
|
|
28
28
|
// We want special behaviour on tab
|
|
29
29
|
if (e.code === _eventCodes.TAB) {
|
|
30
30
|
// Prevent the default behaviour
|
|
31
31
|
e.preventDefault();
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const focusFunc = e.shiftKey ? _components.getPreviousFocusable : _components.getNextFocusable;
|
|
33
|
+
const elem = focusFunc(footerRef.current, true, true, false, true);
|
|
34
34
|
if (elem) {
|
|
35
35
|
// Focus on next focusable element
|
|
36
36
|
elem.focus();
|
|
@@ -47,17 +47,17 @@ var useTypedown = function useTypedown(name) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// SET UP HANDLERS
|
|
50
|
-
|
|
50
|
+
const searchFieldKeyDownHandler = e => {
|
|
51
51
|
if (e.code === _eventCodes.UP_ARROW) {
|
|
52
|
-
|
|
52
|
+
const elem = (0, _components.getLastFocusable)(listRef.current, true, true);
|
|
53
53
|
if (elem) {
|
|
54
54
|
elem.focus();
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
if (e.code === _eventCodes.DOWN_ARROW) {
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
58
|
+
const elem = (0, _components.getFirstFocusable)(listRef.current, true, true);
|
|
59
|
+
if (elem) {
|
|
60
|
+
elem.focus();
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -65,68 +65,68 @@ var useTypedown = function useTypedown(name) {
|
|
|
65
65
|
if (e.code === _eventCodes.TAB && !e.shiftKey) {
|
|
66
66
|
e.preventDefault();
|
|
67
67
|
// If we have focusable elements in the footer, then focus on them, else unfocus searchbar
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
|
|
68
|
+
const elem = (0, _components.getNextFocusable)(footerRef.current, true, true, true, true);
|
|
69
|
+
if (elem) {
|
|
70
|
+
elem.focus();
|
|
71
71
|
} else {
|
|
72
72
|
(0, _components.getNextFocusable)(searchFieldComponent, false).focus();
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
const listKeyDownHandler = e => {
|
|
77
77
|
if (e.code === _eventCodes.DOWN_ARROW) {
|
|
78
|
-
|
|
78
|
+
const elem = (0, _components.getNextFocusable)(listRef.current, true, true);
|
|
79
79
|
elem.focus();
|
|
80
80
|
}
|
|
81
81
|
if (e.code === _eventCodes.UP_ARROW) {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
const elem = (0, _components.getPreviousFocusable)(listRef.current, true, true);
|
|
83
|
+
elem.focus();
|
|
84
84
|
}
|
|
85
85
|
if (e.code === _eventCodes.TAB) {
|
|
86
86
|
e.preventDefault();
|
|
87
|
-
|
|
87
|
+
let elem;
|
|
88
88
|
if (!e.shiftKey && !footerRef.current) {
|
|
89
|
-
|
|
89
|
+
elem = (0, _components.getNextFocusable)(searchFieldComponent, false);
|
|
90
90
|
} else if (!e.shiftKey) {
|
|
91
|
-
|
|
91
|
+
elem = (0, _components.getNextFocusable)(footerRef.current, true, true, true, true);
|
|
92
92
|
} else {
|
|
93
|
-
|
|
93
|
+
elem = searchFieldComponent;
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
elem.focus();
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
|
|
99
|
-
return (0, _components.getNextFocusable)(searchFieldComponent, false).focus();
|
|
100
|
-
};
|
|
98
|
+
const handleNextFocus = () => (0, _components.getNextFocusable)(searchFieldComponent, false).focus();
|
|
101
99
|
|
|
102
100
|
// SET UP VARIABLES
|
|
103
|
-
|
|
104
|
-
open
|
|
101
|
+
const {
|
|
102
|
+
open
|
|
103
|
+
} = (0, _useTypedownToggle.default)(name);
|
|
105
104
|
|
|
106
105
|
// RESIZE STUFF
|
|
107
|
-
|
|
108
|
-
searchWidth
|
|
109
|
-
resizeRef
|
|
106
|
+
const {
|
|
107
|
+
width: searchWidth,
|
|
108
|
+
ref: resizeRef
|
|
109
|
+
} = (0, _reactResizeDetector.useResizeDetector)();
|
|
110
110
|
|
|
111
111
|
// OVERLAY PORTAL
|
|
112
|
-
|
|
112
|
+
const portal = document.getElementById('OverlayContainer');
|
|
113
113
|
return {
|
|
114
114
|
refs: {
|
|
115
|
-
listRef
|
|
116
|
-
triggerRef
|
|
117
|
-
overlayRef
|
|
118
|
-
footerRef
|
|
115
|
+
listRef,
|
|
116
|
+
triggerRef,
|
|
117
|
+
overlayRef,
|
|
118
|
+
footerRef
|
|
119
119
|
},
|
|
120
120
|
handlers: {
|
|
121
|
-
handleNextFocus
|
|
122
|
-
listKeyDownHandler
|
|
123
|
-
searchFieldKeyDownHandler
|
|
121
|
+
handleNextFocus,
|
|
122
|
+
listKeyDownHandler,
|
|
123
|
+
searchFieldKeyDownHandler
|
|
124
124
|
},
|
|
125
125
|
variables: {
|
|
126
|
-
open
|
|
127
|
-
portal
|
|
128
|
-
resizeRef
|
|
129
|
-
searchWidth
|
|
126
|
+
open,
|
|
127
|
+
portal,
|
|
128
|
+
resizeRef,
|
|
129
|
+
searchWidth
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
};
|
|
@@ -8,32 +8,22 @@ var _react = require("react");
|
|
|
8
8
|
var _reactQuery = require("react-query");
|
|
9
9
|
var _core = require("@folio/stripes/core");
|
|
10
10
|
var _utils = require("../../utils");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
var useTypedownData = function useTypedownData(path, callPath) {
|
|
18
|
-
var ky = (0, _core.useOkapiKy)();
|
|
19
|
-
var queryKey = (0, _utils.typedownQueryKey)(path);
|
|
11
|
+
const useTypedownData = (path, callPath) => {
|
|
12
|
+
const ky = (0, _core.useOkapiKy)();
|
|
13
|
+
const queryKey = (0, _utils.typedownQueryKey)(path);
|
|
20
14
|
if (callPath) {
|
|
21
15
|
queryKey.push(callPath);
|
|
22
16
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
isLoading = _useQuery.isLoading;
|
|
17
|
+
const {
|
|
18
|
+
data,
|
|
19
|
+
isLoading
|
|
20
|
+
} = (0, _reactQuery.useQuery)(
|
|
21
|
+
// Ensure when multiple apps are using this function that each one gets memoized individually
|
|
22
|
+
queryKey, () => ky(callPath).json());
|
|
30
23
|
|
|
31
24
|
// Smooth out transitions while data changes by only displaying once call has been loaded.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
contentData = _useState2[0],
|
|
35
|
-
setContentData = _useState2[1];
|
|
36
|
-
(0, _react.useEffect)(function () {
|
|
25
|
+
const [contentData, setContentData] = (0, _react.useState)();
|
|
26
|
+
(0, _react.useEffect)(() => {
|
|
37
27
|
if (!isLoading) {
|
|
38
28
|
setContentData(data);
|
|
39
29
|
}
|
|
@@ -5,37 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _useActiveElement = _interopRequireDefault(require("../useActiveElement"));
|
|
9
9
|
var _selectorSafe = _interopRequireDefault(require("../../utils/selectorSafe"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
var useTypedownToggle = function useTypedownToggle(name) {
|
|
18
|
-
var _useState = (0, _react.useState)(false),
|
|
19
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
-
open = _useState2[0],
|
|
21
|
-
setOpen = _useState2[1];
|
|
22
|
-
var onToggle = (0, _react.useCallback)(function () {
|
|
11
|
+
const useTypedownToggle = name => {
|
|
12
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
13
|
+
const onToggle = (0, _react.useCallback)(() => {
|
|
23
14
|
setOpen(!open);
|
|
24
15
|
}, [open, setOpen]);
|
|
25
|
-
|
|
26
|
-
hasParent
|
|
16
|
+
const {
|
|
17
|
+
hasParent
|
|
18
|
+
} = (0, _useActiveElement.default)();
|
|
27
19
|
|
|
28
20
|
// Trawl up element stack and check if a typedown-parent exists, use that to toggle
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
(0, _react.useEffect)(
|
|
21
|
+
const openBool = !open && hasParent("typedown-parent-".concat((0, _selectorSafe.default)(name)));
|
|
22
|
+
const closeBool = open && !hasParent("typedown-parent-".concat((0, _selectorSafe.default)(name)));
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
32
24
|
if (openBool || closeBool) {
|
|
33
25
|
onToggle();
|
|
34
26
|
}
|
|
35
27
|
}, [closeBool, onToggle, openBool]);
|
|
36
28
|
return {
|
|
37
|
-
open
|
|
38
|
-
onToggle
|
|
29
|
+
open,
|
|
30
|
+
onToggle
|
|
39
31
|
};
|
|
40
32
|
};
|
|
41
33
|
var _default = useTypedownToggle;
|
|
@@ -5,32 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
var useActiveElement = function useActiveElement() {
|
|
15
|
-
var _useState = (0, _react.useState)(document.activeElement),
|
|
16
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
-
active = _useState2[0],
|
|
18
|
-
setActive = _useState2[1];
|
|
19
|
-
var handleFocusIn = function handleFocusIn() {
|
|
8
|
+
const useActiveElement = () => {
|
|
9
|
+
const [active, setActive] = (0, _react.useState)(document.activeElement);
|
|
10
|
+
const handleFocusIn = () => {
|
|
20
11
|
setActive(document.activeElement);
|
|
21
12
|
};
|
|
22
|
-
|
|
13
|
+
const hasParent = id => {
|
|
23
14
|
return active.closest("[id^=".concat(id, "]")) !== null;
|
|
24
15
|
};
|
|
25
|
-
(0, _react.useEffect)(
|
|
16
|
+
(0, _react.useEffect)(() => {
|
|
26
17
|
document.addEventListener('focusin', handleFocusIn);
|
|
27
|
-
return
|
|
18
|
+
return () => {
|
|
28
19
|
document.removeEventListener('focusin', handleFocusIn);
|
|
29
20
|
};
|
|
30
21
|
}, []);
|
|
31
22
|
return {
|
|
32
|
-
active
|
|
33
|
-
hasParent
|
|
23
|
+
active,
|
|
24
|
+
hasParent
|
|
34
25
|
};
|
|
35
26
|
};
|
|
36
27
|
var _default = useActiveElement;
|
|
@@ -9,26 +9,19 @@ var _reactQuery = require("react-query");
|
|
|
9
9
|
var _core = require("@folio/stripes/core");
|
|
10
10
|
var _utils = require("../utils");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
-
var useCustomProperties = function useCustomProperties(_ref) {
|
|
19
|
-
var endpoint = _ref.endpoint,
|
|
20
|
-
ctx = _ref.ctx,
|
|
21
|
-
_ref$nsValues = _ref.nsValues,
|
|
22
|
-
nsValues = _ref$nsValues === void 0 ? {
|
|
12
|
+
const useCustomProperties = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
endpoint,
|
|
15
|
+
ctx,
|
|
16
|
+
nsValues = {
|
|
23
17
|
sort: 'id'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var custPropOptions = _objectSpread({
|
|
18
|
+
},
|
|
19
|
+
options = {},
|
|
20
|
+
queryParams,
|
|
21
|
+
returnQueryObject = false
|
|
22
|
+
} = _ref;
|
|
23
|
+
const ky = (0, _core.useOkapiKy)();
|
|
24
|
+
const custPropOptions = {
|
|
32
25
|
searchKey: 'label,name,description',
|
|
33
26
|
filterKeys: {
|
|
34
27
|
ContextKey: 'ctx'
|
|
@@ -40,16 +33,15 @@ var useCustomProperties = function useCustomProperties(_ref) {
|
|
|
40
33
|
}],
|
|
41
34
|
filters: [],
|
|
42
35
|
stats: false,
|
|
43
|
-
max: 100
|
|
44
|
-
|
|
36
|
+
max: 100,
|
|
37
|
+
...options
|
|
38
|
+
};
|
|
45
39
|
if (Array.isArray(ctx)) {
|
|
46
40
|
// If we have an array, append a context filter for each ctx given
|
|
47
41
|
|
|
48
42
|
// Special case if one is isNull
|
|
49
43
|
custPropOptions.filters.push({
|
|
50
|
-
values: ctx.map(
|
|
51
|
-
return c === 'isNull' ? 'ctx isNull' : "ctx==".concat(c);
|
|
52
|
-
})
|
|
44
|
+
values: ctx.map(c => c === 'isNull' ? 'ctx isNull' : "ctx==".concat(c))
|
|
53
45
|
});
|
|
54
46
|
} else if (ctx === 'isNull') {
|
|
55
47
|
// isNull is a special case
|
|
@@ -62,15 +54,15 @@ var useCustomProperties = function useCustomProperties(_ref) {
|
|
|
62
54
|
value: ctx
|
|
63
55
|
});
|
|
64
56
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return ky(path).json();
|
|
69
|
-
}, queryParams);
|
|
57
|
+
const query = (0, _utils.generateKiwtQuery)(custPropOptions, nsValues);
|
|
58
|
+
const path = "".concat(endpoint).concat(query);
|
|
59
|
+
const queryObject = (0, _reactQuery.useQuery)(['stripes-kint-components', 'useCustomProperties', 'custprops', ctx, path], () => ky(path).json(), queryParams);
|
|
70
60
|
if (returnQueryObject) {
|
|
71
61
|
return queryObject || {};
|
|
72
62
|
}
|
|
73
|
-
|
|
63
|
+
const {
|
|
64
|
+
data: custprops
|
|
65
|
+
} = queryObject;
|
|
74
66
|
return custprops || [];
|
|
75
67
|
};
|
|
76
68
|
useCustomProperties.propTypes = {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -11,43 +10,30 @@ var _queryString = _interopRequireDefault(require("query-string"));
|
|
|
11
10
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
25
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
26
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
var helperObject = {};
|
|
28
|
-
var useHelperApp = function useHelperApp(helpers) {
|
|
29
|
-
var history = (0, _reactRouterDom.useHistory)();
|
|
30
|
-
var location = (0, _reactRouterDom.useLocation)();
|
|
31
|
-
var query = _queryString.default.parse(location.search);
|
|
32
|
-
var _useState = (0, _react.useState)(query === null || query === void 0 ? void 0 : query.helper),
|
|
33
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
-
currentHelper = _useState2[0],
|
|
35
|
-
setCurrentHelper = _useState2[1];
|
|
36
|
-
var handleToggleHelper = (0, _react.useCallback)(function (helper) {
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
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; }
|
|
15
|
+
let helperObject = {};
|
|
16
|
+
const useHelperApp = helpers => {
|
|
17
|
+
const history = (0, _reactRouterDom.useHistory)();
|
|
18
|
+
const location = (0, _reactRouterDom.useLocation)();
|
|
19
|
+
const query = _queryString.default.parse(location.search);
|
|
20
|
+
const [currentHelper, setCurrentHelper] = (0, _react.useState)(query === null || query === void 0 ? void 0 : query.helper);
|
|
21
|
+
const handleToggleHelper = (0, _react.useCallback)(helper => {
|
|
37
22
|
setCurrentHelper(helper !== currentHelper ? helper : undefined);
|
|
38
23
|
}, [currentHelper]);
|
|
39
|
-
|
|
24
|
+
const isOpen = hlp => {
|
|
40
25
|
return currentHelper === hlp;
|
|
41
26
|
};
|
|
42
|
-
(0, _react.useEffect)(
|
|
27
|
+
(0, _react.useEffect)(() => {
|
|
43
28
|
// Keep object outside of hook to avoid redraw, oncly change when keys change
|
|
44
29
|
if (!(0, _isEqual.default)(Object.keys(helperObject), Object.keys(helpers))) {
|
|
45
30
|
helperObject = helpers;
|
|
46
31
|
}
|
|
47
32
|
if (currentHelper !== (query === null || query === void 0 ? void 0 : query.helper)) {
|
|
48
|
-
|
|
33
|
+
const newQuery = {
|
|
34
|
+
...query,
|
|
49
35
|
helper: currentHelper
|
|
50
|
-
}
|
|
36
|
+
};
|
|
51
37
|
history.push({
|
|
52
38
|
pathname: location.pathname,
|
|
53
39
|
search: "?".concat(_queryString.default.stringify(newQuery))
|
|
@@ -56,32 +42,27 @@ var useHelperApp = function useHelperApp(helpers) {
|
|
|
56
42
|
}, [currentHelper, helpers, history, location, query]);
|
|
57
43
|
|
|
58
44
|
// Set the HelperComponent
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}, props));
|
|
70
|
-
};
|
|
45
|
+
const HelperComponent = (0, _react.useMemo)(() => props => {
|
|
46
|
+
if (!(query !== null && query !== void 0 && query.helper)) return null;
|
|
47
|
+
let Component = null;
|
|
48
|
+
Component = helperObject[query === null || query === void 0 ? void 0 : query.helper];
|
|
49
|
+
if (!Component) return null;
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
51
|
+
onToggle: () => handleToggleHelper(query === null || query === void 0 ? void 0 : query.helper),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
71
54
|
}, [handleToggleHelper, query.helper]);
|
|
72
55
|
|
|
73
56
|
// Set up the helperToggleFunctions
|
|
74
|
-
|
|
75
|
-
Object.keys(helperObject).forEach(
|
|
76
|
-
helperToggleFunctions[h] =
|
|
77
|
-
return handleToggleHelper(h);
|
|
78
|
-
};
|
|
57
|
+
const helperToggleFunctions = {};
|
|
58
|
+
Object.keys(helperObject).forEach(h => {
|
|
59
|
+
helperToggleFunctions[h] = () => handleToggleHelper(h);
|
|
79
60
|
});
|
|
80
61
|
return {
|
|
81
|
-
currentHelper
|
|
82
|
-
HelperComponent
|
|
83
|
-
helperToggleFunctions
|
|
84
|
-
isOpen
|
|
62
|
+
currentHelper,
|
|
63
|
+
HelperComponent,
|
|
64
|
+
helperToggleFunctions,
|
|
65
|
+
isOpen
|
|
85
66
|
};
|
|
86
67
|
};
|
|
87
68
|
var _default = useHelperApp;
|
|
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _useIntlKeyStore = _interopRequireDefault(require("./useIntlKeyStore"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
var intlKey;
|
|
9
|
+
const useIntlKey = (passedIntlKey, passedIntlNS) => {
|
|
10
|
+
const getKey = (0, _useIntlKeyStore.default)(state => state.getKey);
|
|
11
|
+
let intlKey;
|
|
14
12
|
if (passedIntlKey) {
|
|
15
13
|
intlKey = passedIntlKey;
|
|
16
14
|
} else if (passedIntlNS) {
|
|
@@ -6,56 +6,51 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _core = require("@folio/stripes/core");
|
|
8
8
|
var _zustand = require("zustand");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ns = folioNS;
|
|
27
|
-
}
|
|
28
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
29
|
-
intlKeys: _objectSpread(_defineProperty({}, ns, key), state.intlKeys)
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
removeKey: function removeKey(namespace) {
|
|
34
|
-
return set(function (state) {
|
|
35
|
-
var _useNamespace2;
|
|
36
|
-
var ns = namespace;
|
|
37
|
-
var folioNS = (_useNamespace2 = (0, _core.useNamespace)()) === null || _useNamespace2 === void 0 ? void 0 : _useNamespace2[0];
|
|
38
|
-
if (!ns) {
|
|
39
|
-
ns = folioNS;
|
|
40
|
-
}
|
|
41
|
-
var _state$intlKeys = state.intlKeys,
|
|
42
|
-
_valueToRemove = _state$intlKeys[ns],
|
|
43
|
-
newKeys = _objectWithoutProperties(_state$intlKeys, [ns].map(_toPropertyKey));
|
|
44
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
45
|
-
intlKeys: newKeys
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
getKey: function getKey(namespace) {
|
|
50
|
-
var _useNamespace3, _get$intlKeys;
|
|
51
|
-
var ns = namespace;
|
|
52
|
-
var folioNS = (_useNamespace3 = (0, _core.useNamespace)()) === null || _useNamespace3 === void 0 ? void 0 : _useNamespace3[0];
|
|
53
|
-
if (!ns) {
|
|
54
|
-
ns = folioNS;
|
|
9
|
+
// We can use hooks within zustand store functions without violating the laws of hooks
|
|
10
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
11
|
+
|
|
12
|
+
const useIntlKeyStore = (0, _zustand.create)((set, get) => ({
|
|
13
|
+
intlKeys: {},
|
|
14
|
+
addKey: (key, namespace) => set(state => {
|
|
15
|
+
var _useNamespace;
|
|
16
|
+
let ns = namespace;
|
|
17
|
+
const folioNS = (_useNamespace = (0, _core.useNamespace)()) === null || _useNamespace === void 0 ? void 0 : _useNamespace[0];
|
|
18
|
+
if (!ns) {
|
|
19
|
+
ns = folioNS;
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
...state,
|
|
23
|
+
intlKeys: {
|
|
24
|
+
[ns]: key,
|
|
25
|
+
...state.intlKeys
|
|
55
26
|
}
|
|
56
|
-
|
|
27
|
+
};
|
|
28
|
+
}),
|
|
29
|
+
removeKey: namespace => set(state => {
|
|
30
|
+
var _useNamespace2;
|
|
31
|
+
let ns = namespace;
|
|
32
|
+
const folioNS = (_useNamespace2 = (0, _core.useNamespace)()) === null || _useNamespace2 === void 0 ? void 0 : _useNamespace2[0];
|
|
33
|
+
if (!ns) {
|
|
34
|
+
ns = folioNS;
|
|
57
35
|
}
|
|
58
|
-
|
|
59
|
-
|
|
36
|
+
const {
|
|
37
|
+
[ns]: _valueToRemove,
|
|
38
|
+
...newKeys
|
|
39
|
+
} = state.intlKeys;
|
|
40
|
+
return {
|
|
41
|
+
...state,
|
|
42
|
+
intlKeys: newKeys
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
45
|
+
getKey: namespace => {
|
|
46
|
+
var _useNamespace3, _get$intlKeys;
|
|
47
|
+
let ns = namespace;
|
|
48
|
+
const folioNS = (_useNamespace3 = (0, _core.useNamespace)()) === null || _useNamespace3 === void 0 ? void 0 : _useNamespace3[0];
|
|
49
|
+
if (!ns) {
|
|
50
|
+
ns = folioNS;
|
|
51
|
+
}
|
|
52
|
+
return (_get$intlKeys = get().intlKeys) === null || _get$intlKeys === void 0 ? void 0 : _get$intlKeys[ns];
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
60
55
|
var _default = useIntlKeyStore;
|
|
61
56
|
exports.default = _default;
|