@k-int/stripes-kint-components 5.36.1 → 5.37.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 +7 -0
- package/README.md +23 -8
- package/es/__mocks__/@folio/stripes/components.js +7 -3
- package/es/__mocks__/@folio/stripes/core.js +6 -4
- package/es/__mocks__/@folio/stripes/smart-components.js +6 -4
- package/es/__mocks__/react-query.js +6 -4
- package/es/__mocks__/react-router-dom.js +6 -6
- package/es/lib/ActionList/ActionList.js +38 -30
- package/es/lib/ActionList/ActionListFieldArray.js +131 -122
- package/es/lib/ButtonTypedown/ButtonTypedown.js +39 -41
- package/es/lib/ComboButton/ComboButton.js +66 -57
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +62 -46
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +4 -6
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +153 -135
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +4 -6
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +83 -81
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +32 -40
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +39 -39
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +10 -10
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +2 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +24 -26
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +2 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +62 -49
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +4 -6
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +75 -79
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +30 -35
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +19 -22
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +7 -10
- package/es/lib/CustomProperties/Edit/testResources.js +12 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +67 -51
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +2 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +62 -47
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +4 -7
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +16 -24
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +2 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +17 -16
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +10 -7
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +35 -35
- package/es/lib/CustomProperties/Filter/testResources.js +2 -1
- package/es/lib/CustomProperties/Filter/useOperators.js +6 -8
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +12 -2
- package/es/lib/CustomProperties/Filter/useValueProps.js +6 -8
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +10 -10
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +2 -3
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +67 -52
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +8 -6
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +20 -16
- package/es/lib/CycleButton/CycleButton.js +28 -14
- package/es/lib/FieldLabel/FieldLabel.js +5 -9
- package/es/lib/Files/FileUploader/FileUploader.js +41 -40
- package/es/lib/Files/FileView/FileView.js +11 -14
- package/es/lib/Files/useFileHandlers.js +63 -68
- package/es/lib/FormModal/FormModal.js +38 -38
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +29 -24
- package/es/lib/IconSelect/IconSelect.js +60 -44
- package/es/lib/NoResultsMessage/NoResultsMessage.js +31 -31
- package/es/lib/NumberField/NumberField.js +39 -19
- package/es/lib/NumberField/NumberField.test.js +19 -10
- package/es/lib/QueryTypedown/QueryTypedown.js +34 -12
- package/es/lib/RefdataButtons/RefdataButtons.js +14 -14
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +75 -68
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +30 -16
- package/es/lib/RichSelect/RichSelect.js +74 -58
- package/es/lib/RichSelect/useSelectedOption.js +12 -2
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +195 -188
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +81 -95
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +68 -48
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +37 -34
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +4 -5
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +1 -3
- package/es/lib/SASQRoute/SASQRoute.js +34 -29
- package/es/lib/SASQRoute/SASQRoute.test.js +34 -42
- package/es/lib/SASQViewComponent/SASQViewComponent.js +69 -66
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +13 -12
- package/es/lib/SearchField/SearchField.js +12 -8
- package/es/lib/SearchKeyControl/SearchKeyControl.js +46 -31
- package/es/lib/SearchKeyControl/SearchKeyControl.test.js +6 -2
- package/es/lib/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js +124 -103
- package/es/lib/Settings/EditableRefdataList/EditableRefdataList.js +120 -107
- package/es/lib/Settings/EditableSettingsList/EditableSettingsList.js +12 -16
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +45 -31
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.test.js +6 -9
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +20 -14
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.test.js +32 -48
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +19 -19
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.test.js +24 -36
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +48 -45
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +9 -12
- package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +50 -38
- package/es/lib/Settings/SettingPage/SettingPage.js +17 -19
- package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +6 -8
- package/es/lib/Settings/Settings/Settings.js +33 -42
- package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +47 -45
- package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +7 -5
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +21 -19
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js +13 -17
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js +6 -10
- package/es/lib/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js +20 -20
- package/es/lib/Settings/hooks/useAppSettings/useAppSettings.js +18 -15
- package/es/lib/Settings/hooks/useSettingSection/useSettingSection.js +27 -26
- package/es/lib/Settings/hooks/useSettings/useSettings.js +95 -99
- package/es/lib/Tags/Tags.js +37 -38
- package/es/lib/Tags/Tags.test.js +12 -18
- package/es/lib/Tags/hooks/useTags.js +1 -1
- package/es/lib/Tags/hooks/useTagsEnabled.js +13 -14
- package/es/lib/Tags/tagsConfig.js +1 -1
- package/es/lib/Typedown/Typedown.js +128 -78
- package/es/lib/hooks/__mocks__/index.js +7 -3
- package/es/lib/hooks/__mocks__/useMutateGeneric.js +22 -0
- package/es/lib/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js +24 -20
- package/es/lib/hooks/intlHooks/useKintIntl/useKintIntl.js +33 -25
- package/es/lib/hooks/typedownHooks/useTypedown.js +55 -37
- package/es/lib/hooks/typedownHooks/useTypedownData.js +15 -7
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +15 -7
- package/es/lib/hooks/useActionListRef.js +11 -2
- package/es/lib/hooks/useActiveElement.js +11 -2
- package/es/lib/hooks/useCustProps.js +45 -37
- package/es/lib/hooks/useCustomProperties.js +21 -18
- package/es/lib/hooks/useHelperApp.js +33 -15
- package/es/lib/hooks/useKiwtFieldArray.js +22 -14
- package/es/lib/hooks/useKiwtSASQuery.js +37 -28
- package/es/lib/hooks/useLocalPageStore.js +10 -7
- package/es/lib/hooks/useLocalStorageState.js +13 -2
- package/es/lib/hooks/useModConfigEntries.js +12 -15
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.js +16 -11
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.test.js +51 -0
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.js +70 -48
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.test.js +192 -0
- package/es/lib/hooks/useMutateModConfigEntry.js +5 -7
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js +23 -16
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.test.js +69 -0
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.js +25 -17
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.test.js +95 -0
- package/es/lib/hooks/useMutateTemplates/useMutateTemplates.js +21 -13
- package/es/lib/hooks/useMutateTemplates/useMutateTemplates.test.js +34 -0
- package/es/lib/hooks/useParallelBatchFetch.js +61 -38
- package/es/lib/hooks/usePrevNextPagination.js +46 -32
- package/es/lib/hooks/useQIndex.js +23 -11
- package/es/lib/hooks/useRefdata.js +11 -13
- package/es/lib/hooks/useSASQQueryMeta.js +2 -3
- package/es/lib/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js +18 -19
- package/es/lib/hooks/useTemplates.js +9 -12
- package/es/lib/utils/buildUrl.js +3 -2
- package/es/lib/utils/downloadBlob.js +12 -8
- package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
- package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +2 -2
- package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +5 -4
- package/es/lib/utils/filterParsers/parseKiwtQueryString.js +1 -1
- package/es/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.js +78 -102
- package/es/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.test.js +322 -29
- package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -5
- package/es/lib/utils/matchString/matchString.js +7 -5
- package/es/lib/utils/matchString/matchString.test.js +26 -7
- package/es/lib/utils/modConfigEntriesQueryKey.js +4 -5
- package/es/lib/utils/parseErrorResponse.js +18 -8
- package/es/lib/utils/selectorSafe.js +3 -2
- package/es/lib/utils/sortByLabel.js +3 -2
- package/es/lib/utils/stringStyling/boldString.js +13 -4
- package/es/lib/utils/stringStyling/boldString.test.js +4 -5
- package/es/lib/utils/stringStyling/highlightString.js +13 -4
- package/es/lib/utils/stringStyling/highlightString.test.js +4 -5
- package/es/lib/validators/validators.js +8 -7
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/ButtonTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useOperators.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/CycleButton.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/FieldLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/FileUploader.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/FileView.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/useFileHandlers.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/FormModal.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/IconSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/NumberField.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/QueryTypedown.js.html +24 -9
- package/src/artifacts/coverage-jest/QueryTypedown/index.html +13 -13
- package/src/artifacts/coverage-jest/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/useSelectedOption.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +30 -30
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/SearchKeyControl.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/Settings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/useAppSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/Tags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/tagsConfig.js.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +136 -7
- package/src/artifacts/coverage-jest/Typedown/index.html +3 -3
- package/src/artifacts/coverage-jest/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/cobertura-coverage.xml +513 -507
- package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/endpoints.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/constants/pagination.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/useIntlKey.js.html +7 -7
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/useKintIntl.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustProps.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/useInvalidateRefdata.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +9 -9
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +5 -5
- package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.html +17 -17
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +16 -16
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +93 -93
- package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +40 -40
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.js.html +44 -44
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/useMutateTemplates.js.html +38 -38
- package/src/artifacts/coverage-jest/hooks/useParallelBatchFetch.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +20 -20
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +8 -8
- package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/index.html +83 -83
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/downloadBlob.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/filterParsers/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryFilters.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +5 -5
- package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +7 -7
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +125 -125
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +21 -21
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/index.html +5 -5
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/refdataQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/boldString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/highlightString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/validators/index.html +1 -1
- package/src/artifacts/coverage-jest/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/validators/validators.js.html +1 -1
- package/src/lib/QueryTypedown/QueryTypedown.js +7 -2
- package/src/lib/QueryTypedown/README.md +7 -6
- package/src/lib/Typedown/README.md +27 -1
- package/src/lib/Typedown/Typedown.js +47 -4
- package/src/lib/hooks/__mocks__/useMutateGeneric.js +14 -0
- package/src/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.test.js +65 -0
- package/src/lib/hooks/useMutateGeneric/useMutateGeneric.test.js +194 -0
- package/src/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.test.js +76 -0
- package/src/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.test.js +93 -0
- package/src/lib/hooks/useMutateTemplates/useMutateTemplates.test.js +33 -0
- package/src/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.test.js +248 -17
|
@@ -6,47 +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
|
-
|
|
9
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // We can use hooks within zustand store functions without violating the laws of hooks
|
|
10
16
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
11
|
-
|
|
12
17
|
const useIntlKeyStore = (0, _zustand.create)((set, get) => ({
|
|
13
18
|
intlKeys: {},
|
|
14
19
|
addKey: (key, namespace) => set(state => {
|
|
20
|
+
var _useNamespace;
|
|
15
21
|
let ns = namespace;
|
|
16
|
-
const folioNS = (0, _core.useNamespace)()
|
|
22
|
+
const folioNS = (_useNamespace = (0, _core.useNamespace)()) === null || _useNamespace === void 0 ? void 0 : _useNamespace[0];
|
|
17
23
|
if (!ns) {
|
|
18
24
|
ns = folioNS;
|
|
19
25
|
}
|
|
20
|
-
return {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
};
|
|
26
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
27
|
+
intlKeys: _objectSpread({
|
|
28
|
+
[ns]: key
|
|
29
|
+
}, state.intlKeys)
|
|
30
|
+
});
|
|
27
31
|
}),
|
|
28
32
|
removeKey: namespace => set(state => {
|
|
33
|
+
var _useNamespace2;
|
|
29
34
|
let ns = namespace;
|
|
30
|
-
const folioNS = (0, _core.useNamespace)()
|
|
35
|
+
const folioNS = (_useNamespace2 = (0, _core.useNamespace)()) === null || _useNamespace2 === void 0 ? void 0 : _useNamespace2[0];
|
|
31
36
|
if (!ns) {
|
|
32
37
|
ns = folioNS;
|
|
33
38
|
}
|
|
34
|
-
const
|
|
35
|
-
[ns]
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
...state,
|
|
39
|
+
const _state$intlKeys = state.intlKeys,
|
|
40
|
+
_valueToRemove = _state$intlKeys[ns],
|
|
41
|
+
newKeys = _objectWithoutProperties(_state$intlKeys, [ns].map(_toPropertyKey));
|
|
42
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
40
43
|
intlKeys: newKeys
|
|
41
|
-
};
|
|
44
|
+
});
|
|
42
45
|
}),
|
|
43
46
|
getKey: namespace => {
|
|
47
|
+
var _useNamespace3, _get$intlKeys;
|
|
44
48
|
let ns = namespace;
|
|
45
|
-
const folioNS = (0, _core.useNamespace)()
|
|
49
|
+
const folioNS = (_useNamespace3 = (0, _core.useNamespace)()) === null || _useNamespace3 === void 0 ? void 0 : _useNamespace3[0];
|
|
46
50
|
if (!ns) {
|
|
47
51
|
ns = folioNS;
|
|
48
52
|
}
|
|
49
|
-
return get().intlKeys
|
|
53
|
+
return (_get$intlKeys = get().intlKeys) === null || _get$intlKeys === void 0 ? void 0 : _get$intlKeys[ns];
|
|
50
54
|
}
|
|
51
55
|
}));
|
|
52
56
|
var _default = exports.default = useIntlKeyStore;
|
|
@@ -6,7 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _reactIntl = require("react-intl");
|
|
8
8
|
var _useIntlKey = _interopRequireDefault(require("../useIntlKey"));
|
|
9
|
+
const _excluded = ["id", "overrideValue", "fallbackMessage"];
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
18
|
/* A hook to enrich the intl object we get from useIntl */
|
|
11
19
|
const useKintIntl = (passedIntlKey, passedIntlNS) => {
|
|
12
20
|
const intlObj = (0, _reactIntl.useIntl)();
|
|
@@ -15,23 +23,22 @@ const useKintIntl = (passedIntlKey, passedIntlNS) => {
|
|
|
15
23
|
// FormatKintMessage id misses out the top level key part of the path.
|
|
16
24
|
// This works analogously to FormattedKintMessage component
|
|
17
25
|
const formatKintMessage = (_ref, formatValues) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
overrideValue,
|
|
21
|
-
fallbackMessage,
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
26
|
+
var _intlObj$messages2;
|
|
27
|
+
let id = _ref.id,
|
|
28
|
+
overrideValue = _ref.overrideValue,
|
|
29
|
+
fallbackMessage = _ref.fallbackMessage,
|
|
30
|
+
formatParams = _objectWithoutProperties(_ref, _excluded);
|
|
24
31
|
if (overrideValue) {
|
|
32
|
+
var _intlObj$messages;
|
|
25
33
|
// Version 3 is a breaking change, where labelOverrides must be strings.
|
|
26
34
|
if (typeof overrideValue !== 'string') {
|
|
27
35
|
throw new Error('Override values must be strings as of stripes-kint-components ^3.0.0');
|
|
28
36
|
}
|
|
29
|
-
if (intlObj.messages
|
|
37
|
+
if ((_intlObj$messages = intlObj.messages) !== null && _intlObj$messages !== void 0 && _intlObj$messages[overrideValue]) {
|
|
30
38
|
// We've been passed a key as an override, use it
|
|
31
|
-
return intlObj.formatMessage({
|
|
32
|
-
id: overrideValue
|
|
33
|
-
|
|
34
|
-
}, formatValues);
|
|
39
|
+
return intlObj.formatMessage(_objectSpread({
|
|
40
|
+
id: overrideValue
|
|
41
|
+
}, formatParams), formatValues);
|
|
35
42
|
}
|
|
36
43
|
// At this stage we have an overrideValue that's not a key, return it.
|
|
37
44
|
return overrideValue;
|
|
@@ -40,28 +47,29 @@ const useKintIntl = (passedIntlKey, passedIntlNS) => {
|
|
|
40
47
|
// If key does not exist in intl, and we have a specified "fallbackMessage", use that
|
|
41
48
|
|
|
42
49
|
// (FallbackMessage works like defaultMessage but with no warning)
|
|
43
|
-
if (!intlObj.messages
|
|
50
|
+
if (!((_intlObj$messages2 = intlObj.messages) !== null && _intlObj$messages2 !== void 0 && _intlObj$messages2["".concat(intlKey, ".").concat(id)]) && fallbackMessage) {
|
|
51
|
+
var _intlObj$messages3;
|
|
44
52
|
// Allow fallback message to be an intl key
|
|
45
|
-
if (intlObj.messages
|
|
46
|
-
return intlObj.formatMessage({
|
|
47
|
-
id: fallbackMessage
|
|
48
|
-
|
|
49
|
-
}, formatValues);
|
|
53
|
+
if ((_intlObj$messages3 = intlObj.messages) !== null && _intlObj$messages3 !== void 0 && _intlObj$messages3[fallbackMessage]) {
|
|
54
|
+
return intlObj.formatMessage(_objectSpread({
|
|
55
|
+
id: fallbackMessage
|
|
56
|
+
}, formatParams), formatValues);
|
|
50
57
|
}
|
|
51
58
|
return fallbackMessage;
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
// After all that, render the message from key
|
|
55
|
-
return intlObj.formatMessage({
|
|
56
|
-
id:
|
|
57
|
-
|
|
58
|
-
}, formatValues);
|
|
62
|
+
return intlObj.formatMessage(_objectSpread({
|
|
63
|
+
id: "".concat(intlKey, ".").concat(id)
|
|
64
|
+
}, formatParams), formatValues);
|
|
59
65
|
};
|
|
60
|
-
const messageExists = key =>
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
const messageExists = key => {
|
|
67
|
+
var _intlObj$messages4;
|
|
68
|
+
return !!((_intlObj$messages4 = intlObj.messages) !== null && _intlObj$messages4 !== void 0 && _intlObj$messages4["".concat(intlKey, ".").concat(key)]);
|
|
69
|
+
};
|
|
70
|
+
return _objectSpread(_objectSpread({}, intlObj), {}, {
|
|
63
71
|
formatKintMessage,
|
|
64
72
|
messageExists
|
|
65
|
-
};
|
|
73
|
+
});
|
|
66
74
|
};
|
|
67
75
|
var _default = exports.default = useKintIntl;
|
|
@@ -8,18 +8,36 @@ var _react = require("react");
|
|
|
8
8
|
var _reactResizeDetector = require("react-resize-detector");
|
|
9
9
|
var _components = require("@folio/stripes/components");
|
|
10
10
|
var _eventCodes = require("../../constants/eventCodes");
|
|
11
|
-
var
|
|
11
|
+
var _useTypedownToggle2 = _interopRequireDefault(require("./useTypedownToggle"));
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
14
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
19
|
const useTypedown = function (name) {
|
|
14
|
-
let {
|
|
15
|
-
dataOptions,
|
|
16
|
-
timeout =
|
|
17
|
-
|
|
20
|
+
let _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
21
|
+
dataOptions = _ref.dataOptions,
|
|
22
|
+
_ref$timeout = _ref.timeout,
|
|
23
|
+
timeout = _ref$timeout === void 0 ? 800 : _ref$timeout;
|
|
18
24
|
// SET UP STATE HOLDING DOM ELEMENTS
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
const _useState = (0, _react.useState)(),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
list = _useState2[0],
|
|
28
|
+
setList = _useState2[1];
|
|
29
|
+
const _useState3 = (0, _react.useState)(),
|
|
30
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
|
+
trigger = _useState4[0],
|
|
32
|
+
setTrigger = _useState4[1];
|
|
33
|
+
const _useState5 = (0, _react.useState)(),
|
|
34
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
35
|
+
footer = _useState6[0],
|
|
36
|
+
setFooter = _useState6[1];
|
|
37
|
+
const _useState7 = (0, _react.useState)(),
|
|
38
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
39
|
+
header = _useState8[0],
|
|
40
|
+
setHeader = _useState8[1];
|
|
23
41
|
|
|
24
42
|
// SET UP REFS
|
|
25
43
|
const triggerRef = (0, _react.useRef)();
|
|
@@ -47,20 +65,21 @@ const useTypedown = function (name) {
|
|
|
47
65
|
// There appears to be some BIZARRE off-by-one issue with selectors here, that can be fixed by introducing a 1ms delay...
|
|
48
66
|
// I hate it but it is effective
|
|
49
67
|
setTimeout(() => {
|
|
68
|
+
var _dataOptions$length, _dataOptions$length2, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
|
|
50
69
|
// Split these out to shut up the linter
|
|
51
70
|
const rawFirstItemInList = list ? (0, _components.getFirstFocusable)(list) : null;
|
|
52
71
|
const rawLastItemInList = list ? (0, _components.getLastFocusable)(list) : null;
|
|
53
72
|
|
|
54
73
|
// If there are no dataOptions, this can get a bit stuck, so deliberately set to null when no dataOptions are present
|
|
55
|
-
const firstItemInList = (dataOptions
|
|
56
|
-
const lastItemInList = (dataOptions
|
|
74
|
+
const firstItemInList = ((_dataOptions$length = dataOptions === null || dataOptions === void 0 ? void 0 : dataOptions.length) !== null && _dataOptions$length !== void 0 ? _dataOptions$length : 0) > 0 ? rawFirstItemInList : null;
|
|
75
|
+
const lastItemInList = ((_dataOptions$length2 = dataOptions === null || dataOptions === void 0 ? void 0 : dataOptions.length) !== null && _dataOptions$length2 !== void 0 ? _dataOptions$length2 : 0) > 0 ? rawLastItemInList : null;
|
|
57
76
|
const configs = [
|
|
58
77
|
// --- HEADER CONFIG ---
|
|
59
78
|
{
|
|
60
79
|
element: header,
|
|
61
80
|
allowTabThroughContents: true,
|
|
62
81
|
previousElement: trigger,
|
|
63
|
-
nextElement: (footer ? (0, _components.getFirstFocusable)(footer) : null)
|
|
82
|
+
nextElement: (_ref2 = footer ? (0, _components.getFirstFocusable)(footer) : null) !== null && _ref2 !== void 0 ? _ref2 : (0, _components.getNextFocusable)(trigger, false),
|
|
64
83
|
downElement: firstItemInList,
|
|
65
84
|
upElement: lastItemInList
|
|
66
85
|
},
|
|
@@ -68,7 +87,7 @@ const useTypedown = function (name) {
|
|
|
68
87
|
{
|
|
69
88
|
element: footer,
|
|
70
89
|
allowTabThroughContents: true,
|
|
71
|
-
previousElement: (header ? (0, _components.getLastFocusable)(header) : null)
|
|
90
|
+
previousElement: (_ref3 = header ? (0, _components.getLastFocusable)(header) : null) !== null && _ref3 !== void 0 ? _ref3 : trigger,
|
|
72
91
|
nextElement: (0, _components.getNextFocusable)(trigger, false),
|
|
73
92
|
downElement: firstItemInList,
|
|
74
93
|
upElement: lastItemInList
|
|
@@ -77,35 +96,33 @@ const useTypedown = function (name) {
|
|
|
77
96
|
{
|
|
78
97
|
element: list,
|
|
79
98
|
allowUpDownThroughContents: true,
|
|
80
|
-
previousElement: (header ? (0, _components.getLastFocusable)(header) : null)
|
|
81
|
-
nextElement: (footer ? (0, _components.getFirstFocusable)(footer) : null)
|
|
99
|
+
previousElement: (_ref4 = header ? (0, _components.getLastFocusable)(header) : null) !== null && _ref4 !== void 0 ? _ref4 : trigger,
|
|
100
|
+
nextElement: (_ref5 = footer ? (0, _components.getFirstFocusable)(footer) : null) !== null && _ref5 !== void 0 ? _ref5 : (0, _components.getNextFocusable)(trigger, false)
|
|
82
101
|
},
|
|
83
102
|
// --- TRIGGER CONFIG ---
|
|
84
103
|
{
|
|
85
104
|
element: trigger,
|
|
86
|
-
nextElement: (header ? (0, _components.getFirstFocusable)(header) : null)
|
|
105
|
+
nextElement: (_ref6 = (_ref7 = header ? (0, _components.getFirstFocusable)(header) : null) !== null && _ref7 !== void 0 ? _ref7 : footer ? (0, _components.getFirstFocusable)(footer) : null) !== null && _ref6 !== void 0 ? _ref6 : (0, _components.getNextFocusable)(trigger, false),
|
|
87
106
|
previousElement: getPreviousToTrigger(),
|
|
88
107
|
downElement: firstItemInList,
|
|
89
108
|
upElement: lastItemInList
|
|
90
109
|
}].filter(c => c.element); // Filter out configs where the element (e.g., header) is null
|
|
91
110
|
|
|
92
111
|
const setupListener = config => {
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
upElement
|
|
101
|
-
} = config;
|
|
112
|
+
const element = config.element,
|
|
113
|
+
allowTabThroughContents = config.allowTabThroughContents,
|
|
114
|
+
previousElement = config.previousElement,
|
|
115
|
+
nextElement = config.nextElement,
|
|
116
|
+
allowUpDownThroughContents = config.allowUpDownThroughContents,
|
|
117
|
+
downElement = config.downElement,
|
|
118
|
+
upElement = config.upElement;
|
|
102
119
|
const handleTab = e => {
|
|
103
120
|
const IS_SHIFT = e.shiftKey;
|
|
104
121
|
const tabIgnoreContents = () => {
|
|
105
122
|
if (IS_SHIFT) {
|
|
106
|
-
return previousElement
|
|
123
|
+
return previousElement === null || previousElement === void 0 ? void 0 : previousElement.focus();
|
|
107
124
|
}
|
|
108
|
-
return nextElement
|
|
125
|
+
return nextElement === null || nextElement === void 0 ? void 0 : nextElement.focus();
|
|
109
126
|
};
|
|
110
127
|
if (!allowTabThroughContents) {
|
|
111
128
|
return tabIgnoreContents();
|
|
@@ -122,9 +139,9 @@ const useTypedown = function (name) {
|
|
|
122
139
|
const IS_UP = e.code === _eventCodes.UP_ARROW;
|
|
123
140
|
const upDownIgnoreContents = () => {
|
|
124
141
|
if (IS_UP) {
|
|
125
|
-
return upElement
|
|
142
|
+
return upElement === null || upElement === void 0 ? void 0 : upElement.focus();
|
|
126
143
|
}
|
|
127
|
-
return downElement
|
|
144
|
+
return downElement === null || downElement === void 0 ? void 0 : downElement.focus();
|
|
128
145
|
};
|
|
129
146
|
if (!allowUpDownThroughContents) {
|
|
130
147
|
return upDownIgnoreContents();
|
|
@@ -167,10 +184,12 @@ const useTypedown = function (name) {
|
|
|
167
184
|
const handleNextFocus = () => (0, _components.getNextFocusable)(trigger, false).focus();
|
|
168
185
|
|
|
169
186
|
// SET UP VARIABLES
|
|
170
|
-
const
|
|
171
|
-
open
|
|
172
|
-
|
|
173
|
-
|
|
187
|
+
const _useTypedownToggle = (0, _useTypedownToggle2.default)(name),
|
|
188
|
+
open = _useTypedownToggle.open;
|
|
189
|
+
const _useState9 = (0, _react.useState)(false),
|
|
190
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
191
|
+
useOpen = _useState0[0],
|
|
192
|
+
setUseOpen = _useState0[1];
|
|
174
193
|
(0, _react.useEffect)(() => {
|
|
175
194
|
// Use setTimeout to update the message after 2000 milliseconds (2 seconds)
|
|
176
195
|
const timeoutId = setTimeout(() => {
|
|
@@ -182,10 +201,9 @@ const useTypedown = function (name) {
|
|
|
182
201
|
}, [timeout]);
|
|
183
202
|
|
|
184
203
|
// RESIZE STUFF
|
|
185
|
-
const
|
|
186
|
-
width
|
|
187
|
-
ref
|
|
188
|
-
} = (0, _reactResizeDetector.useResizeDetector)();
|
|
204
|
+
const _useResizeDetector = (0, _reactResizeDetector.useResizeDetector)(),
|
|
205
|
+
searchWidth = _useResizeDetector.width,
|
|
206
|
+
resizeRef = _useResizeDetector.ref;
|
|
189
207
|
return {
|
|
190
208
|
refs: {
|
|
191
209
|
listRef,
|
|
@@ -8,21 +8,29 @@ 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
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
17
|
const useTypedownData = (path, callPath) => {
|
|
12
18
|
const ky = (0, _core.useOkapiKy)();
|
|
13
19
|
const queryKey = (0, _utils.typedownQueryKey)(path);
|
|
14
20
|
if (callPath) {
|
|
15
21
|
queryKey.push(callPath);
|
|
16
22
|
}
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
queryKey, () => ky(callPath).json());
|
|
23
|
+
const _useQuery = (0, _reactQuery.useQuery)(
|
|
24
|
+
// Ensure when multiple apps are using this function that each one gets memoized individually
|
|
25
|
+
queryKey, () => ky(callPath).json()),
|
|
26
|
+
data = _useQuery.data,
|
|
27
|
+
isLoading = _useQuery.isLoading;
|
|
23
28
|
|
|
24
29
|
// Smooth out transitions while data changes by only displaying once call has been loaded.
|
|
25
|
-
const
|
|
30
|
+
const _useState = (0, _react.useState)(),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
contentData = _useState2[0],
|
|
33
|
+
setContentData = _useState2[1];
|
|
26
34
|
(0, _react.useEffect)(() => {
|
|
27
35
|
if (!isLoading) {
|
|
28
36
|
setContentData(data);
|
|
@@ -5,21 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _useActiveElement2 = _interopRequireDefault(require("../useActiveElement"));
|
|
9
9
|
var _selectorSafe = _interopRequireDefault(require("../../utils/selectorSafe"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
17
|
const useTypedownToggle = name => {
|
|
12
|
-
const
|
|
18
|
+
const _useState = (0, _react.useState)(false),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
open = _useState2[0],
|
|
21
|
+
setOpen = _useState2[1];
|
|
13
22
|
const onToggle = (0, _react.useCallback)(() => {
|
|
14
23
|
setOpen(!open);
|
|
15
24
|
}, [open, setOpen]);
|
|
16
|
-
const
|
|
17
|
-
hasParent
|
|
18
|
-
} = (0, _useActiveElement.default)();
|
|
25
|
+
const _useActiveElement = (0, _useActiveElement2.default)(),
|
|
26
|
+
hasParent = _useActiveElement.hasParent;
|
|
19
27
|
|
|
20
28
|
// Trawl up element stack and check if a typedown-parent exists, use that to toggle
|
|
21
|
-
const openBool = !open && hasParent(
|
|
22
|
-
const closeBool = open && !hasParent(
|
|
29
|
+
const openBool = !open && hasParent("typedown-parent-".concat((0, _selectorSafe.default)(name)));
|
|
30
|
+
const closeBool = open && !hasParent("typedown-parent-".concat((0, _selectorSafe.default)(name)));
|
|
23
31
|
(0, _react.useEffect)(() => {
|
|
24
32
|
if (openBool || closeBool) {
|
|
25
33
|
onToggle();
|
|
@@ -5,15 +5,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
14
|
// Using the passed actionListRef in a stateful way
|
|
9
15
|
// is somewhat complicated, so here's a hook to simplify that work
|
|
10
16
|
const useActionListRef = () => {
|
|
11
17
|
const actionListRef = (0, _react.useRef)();
|
|
12
|
-
const
|
|
18
|
+
const _useState = (0, _react.useState)(),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
editing = _useState2[0],
|
|
21
|
+
setEditing = _useState2[1];
|
|
13
22
|
const passedRef = (0, _react.useCallback)(node => {
|
|
14
23
|
// All functions must be present on here
|
|
15
24
|
actionListRef.current = node;
|
|
16
|
-
if (node
|
|
25
|
+
if (node !== null && node !== void 0 && node.editing) {
|
|
17
26
|
setEditing(node.editing);
|
|
18
27
|
} else {
|
|
19
28
|
setEditing();
|
|
@@ -5,13 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
14
|
const useActiveElement = () => {
|
|
9
|
-
const
|
|
15
|
+
const _useState = (0, _react.useState)(document.activeElement),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
active = _useState2[0],
|
|
18
|
+
setActive = _useState2[1];
|
|
10
19
|
const handleFocusIn = () => {
|
|
11
20
|
setActive(document.activeElement);
|
|
12
21
|
};
|
|
13
22
|
const hasParent = id => {
|
|
14
|
-
return active.closest(
|
|
23
|
+
return active.closest("[id^=".concat(id, "]")) !== null;
|
|
15
24
|
};
|
|
16
25
|
(0, _react.useEffect)(() => {
|
|
17
26
|
document.addEventListener('focusin', handleFocusIn);
|
|
@@ -7,21 +7,30 @@ exports.default = exports.CUSTPROPS_QUERY_KEY_BASE = void 0;
|
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _useParallelBatchFetch = _interopRequireDefault(require("./useParallelBatchFetch"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
15
|
const CUSTPROPS_QUERY_KEY_BASE = exports.CUSTPROPS_QUERY_KEY_BASE = ['stripes-kint-components', 'useCustProps', 'custprops'];
|
|
11
16
|
const useCustProps = _ref => {
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
nsValues = {
|
|
17
|
+
let endpoint = _ref.endpoint,
|
|
18
|
+
ctx = _ref.ctx,
|
|
19
|
+
_ref$nsValues = _ref.nsValues,
|
|
20
|
+
nsValues = _ref$nsValues === void 0 ? {
|
|
16
21
|
sort: 'id'
|
|
17
|
-
},
|
|
18
|
-
options =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
} : _ref$nsValues,
|
|
23
|
+
_ref$options = _ref.options,
|
|
24
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
25
|
+
_ref$queryParams = _ref.queryParams,
|
|
26
|
+
queryParams = _ref$queryParams === void 0 ? {} : _ref$queryParams,
|
|
27
|
+
_ref$batchLimit = _ref.batchLimit,
|
|
28
|
+
batchLimit = _ref$batchLimit === void 0 ? Infinity : _ref$batchLimit,
|
|
29
|
+
_ref$batchSize = _ref.batchSize,
|
|
30
|
+
batchSize = _ref$batchSize === void 0 ? 100 : _ref$batchSize,
|
|
31
|
+
_ref$concurrentReques = _ref.concurrentRequests,
|
|
32
|
+
concurrentRequests = _ref$concurrentReques === void 0 ? 5 : _ref$concurrentReques;
|
|
33
|
+
const custPropOptions = _objectSpread({
|
|
25
34
|
searchKey: 'label,name,description',
|
|
26
35
|
filterKeys: {
|
|
27
36
|
ContextKey: 'ctx'
|
|
@@ -31,12 +40,11 @@ const useCustProps = _ref => {
|
|
|
31
40
|
}, {
|
|
32
41
|
path: 'label'
|
|
33
42
|
}],
|
|
34
|
-
filters: []
|
|
35
|
-
|
|
36
|
-
};
|
|
43
|
+
filters: []
|
|
44
|
+
}, options);
|
|
37
45
|
if (Array.isArray(ctx)) {
|
|
38
46
|
custPropOptions.filters.push({
|
|
39
|
-
values: ctx.map(c => c === 'isNull' ? 'ctx isNull' :
|
|
47
|
+
values: ctx.map(c => c === 'isNull' ? 'ctx isNull' : "ctx==".concat(c))
|
|
40
48
|
});
|
|
41
49
|
} else if (ctx === 'isNull') {
|
|
42
50
|
custPropOptions.filters.push({
|
|
@@ -48,27 +56,27 @@ const useCustProps = _ref => {
|
|
|
48
56
|
value: ctx
|
|
49
57
|
});
|
|
50
58
|
}
|
|
51
|
-
const {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
const _useParallelBatchFetc = (0, _useParallelBatchFetch.default)({
|
|
60
|
+
endpoint,
|
|
61
|
+
BATCH_LIMIT: batchLimit,
|
|
62
|
+
BATCH_SIZE: batchSize,
|
|
63
|
+
CONCURRENT_REQUESTS: concurrentRequests,
|
|
64
|
+
batchParams: custPropOptions,
|
|
65
|
+
nsValues,
|
|
66
|
+
generateQueryKey: _ref2 => {
|
|
67
|
+
let queryEndpoint = _ref2.endpoint,
|
|
68
|
+
offset = _ref2.offset,
|
|
69
|
+
paramsArray = _ref2.paramsArray;
|
|
70
|
+
return [...CUSTPROPS_QUERY_KEY_BASE, ctx, queryEndpoint, offset, paramsArray];
|
|
71
|
+
},
|
|
72
|
+
queryOptions: queryParams
|
|
73
|
+
}),
|
|
74
|
+
_useParallelBatchFetc2 = _useParallelBatchFetc.items,
|
|
75
|
+
custprops = _useParallelBatchFetc2 === void 0 ? [] : _useParallelBatchFetc2,
|
|
76
|
+
_useParallelBatchFetc3 = _useParallelBatchFetc.isLoading,
|
|
77
|
+
isLoading = _useParallelBatchFetc3 === void 0 ? true : _useParallelBatchFetc3,
|
|
78
|
+
_useParallelBatchFetc4 = _useParallelBatchFetc.total,
|
|
79
|
+
total = _useParallelBatchFetc4 === void 0 ? 0 : _useParallelBatchFetc4;
|
|
72
80
|
return {
|
|
73
81
|
custprops,
|
|
74
82
|
isLoading,
|