@k-int/stripes-kint-components 5.31.4 → 5.32.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/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 +33 -26
- package/es/lib/ActionList/ActionListFieldArray.js +119 -103
- package/es/lib/ButtonTypedown/ButtonTypedown.js +72 -17
- package/es/lib/ComboButton/ComboButton.js +47 -42
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +17 -11
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +46 -42
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +58 -58
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +8 -4
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +33 -32
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +3 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +35 -29
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +59 -61
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +20 -20
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +2 -2
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +1 -1
- package/es/lib/CustomProperties/Edit/testResources.js +12 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +33 -22
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +37 -24
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +1 -1
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +6 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +6 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +8 -4
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +19 -15
- package/es/lib/CustomProperties/Filter/testResources.js +2 -1
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -1
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +1 -1
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +25 -17
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +6 -3
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +11 -7
- package/es/lib/CycleButton/CycleButton.js +17 -9
- package/es/lib/FormModal/FormModal.js +32 -24
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +30 -23
- package/es/lib/IconSelect/IconSelect.js +32 -22
- package/es/lib/NoResultsMessage/NoResultsMessage.js +5 -4
- package/es/lib/NumberField/NumberField.js +25 -17
- package/es/lib/NumberField/NumberField.test.js +7 -6
- package/es/lib/QueryTypedown/QueryTypedown.js +15 -8
- package/es/lib/RefdataButtons/RefdataButtons.js +9 -6
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +60 -48
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +6 -5
- package/es/lib/RichSelect/RichSelect.js +36 -31
- package/es/lib/RichSelect/useSelectedOption.js +2 -1
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +94 -91
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +36 -44
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +53 -42
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +23 -19
- package/es/lib/SASQRoute/SASQRoute.js +29 -25
- package/es/lib/SASQRoute/SASQRoute.test.js +13 -11
- package/es/lib/SASQViewComponent/SASQViewComponent.js +76 -68
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +8 -4
- package/es/lib/SearchField/SearchField.js +13 -7
- package/es/lib/SearchKeyControl/SearchKeyControl.js +13 -8
- package/es/lib/SearchKeyControl/SearchKeyControl.test.js +6 -2
- package/es/lib/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js +46 -30
- package/es/lib/Settings/EditableRefdataList/EditableRefdataList.js +43 -33
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +11 -7
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +20 -13
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +12 -10
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +15 -10
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +3 -3
- package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +26 -19
- package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +2 -2
- package/es/lib/Settings/Settings/Settings.js +158 -0
- package/es/lib/Settings/Settings/index.js +13 -0
- package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +35 -30
- package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +8 -5
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +22 -18
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js +2 -2
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js +1 -1
- package/es/lib/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js +7 -3
- package/es/lib/Settings/hooks/useAppSettings/useAppSettings.js +11 -7
- package/es/lib/Settings/hooks/useSettingSection/useSettingSection.js +22 -16
- package/es/lib/Settings/hooks/useSettings/useSettings.js +69 -63
- package/es/lib/Tags/Tags.js +8 -5
- package/es/lib/Tags/hooks/useTags.js +1 -1
- package/es/lib/Tags/hooks/useTagsEnabled.js +3 -2
- package/es/lib/Tags/tagsConfig.js +1 -1
- package/es/lib/Typedown/Typedown.js +31 -21
- package/es/lib/hooks/__mocks__/index.js +7 -3
- package/es/lib/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js +26 -20
- package/es/lib/hooks/intlHooks/useKintIntl/useKintIntl.js +34 -24
- package/es/lib/hooks/typedownHooks/useTypedown.js +12 -11
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +2 -2
- package/es/lib/hooks/useActionListRef.js +1 -1
- package/es/lib/hooks/useActiveElement.js +1 -1
- package/es/lib/hooks/useCustomProperties.js +10 -6
- package/es/lib/hooks/useHelperApp.js +16 -13
- package/es/lib/hooks/useKiwtFieldArray.js +8 -7
- package/es/lib/hooks/useKiwtSASQuery.js +19 -15
- package/es/lib/hooks/useLocalPageStore.js +10 -7
- package/es/lib/hooks/useModConfigEntries.js +2 -2
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.js +17 -10
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.js +2 -2
- package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js +21 -15
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.js +23 -16
- package/es/lib/hooks/usePrevNextPagination.js +19 -17
- package/es/lib/hooks/useQIndex.js +14 -11
- package/es/lib/hooks/useRefdata.js +3 -3
- package/es/lib/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js +13 -9
- package/es/lib/hooks/useTemplates.js +4 -4
- package/es/lib/utils/buildUrl.js +3 -2
- 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 +107 -94
- package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -5
- package/es/lib/utils/matchString.js +7 -5
- package/es/lib/utils/parseErrorResponse.js +7 -3
- package/es/lib/utils/selectorSafe.js +3 -2
- package/es/lib/utils/sortByLabel.js +3 -2
- package/es/lib/validators/validators.js +9 -6
- 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 +215 -23
- package/src/artifacts/coverage-jest/ButtonTypedown/index.html +17 -17
- 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/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 +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/index.html +1 -1
- 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 +31 -31
- 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 +643 -0
- package/src/artifacts/coverage-jest/Settings/Settings/index.html +131 -0
- package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +88 -0
- 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 +12 -12
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +32 -14
- 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 +13 -4
- 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 +433 -268
- 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/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 +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.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 +40 -25
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/highlightString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +1 -1
- 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/ButtonTypedown/ButtonTypedown.js +77 -13
- package/src/lib/Settings/Settings/Settings.js +186 -0
- package/src/lib/Settings/Settings/index.js +1 -0
- package/src/lib/Settings/hooks/useSettings/useSettings.js +13 -7
- package/src/lib/Typedown/Typedown.js +4 -1
- package/styles/TypeDown.css +2 -2
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var
|
|
10
|
+
var _get3 = _interopRequireDefault(require("lodash/get"));
|
|
11
11
|
var _components = require("@folio/stripes/components");
|
|
12
12
|
var _SearchField = _interopRequireDefault(require("../SearchField"));
|
|
13
13
|
var _TypeDown = _interopRequireDefault(require("../../../styles/TypeDown.css"));
|
|
@@ -21,6 +21,7 @@ const Typedown = _ref => {
|
|
|
21
21
|
dataOptions,
|
|
22
22
|
displayClearItem = true,
|
|
23
23
|
displayValueWhileOpen = true,
|
|
24
|
+
dropdownPlacement = 'bottom-start',
|
|
24
25
|
endOfList,
|
|
25
26
|
getDisplayValue,
|
|
26
27
|
// Can overrule displayValue entirely
|
|
@@ -43,7 +44,7 @@ const Typedown = _ref => {
|
|
|
43
44
|
// A way to pass any styles that need to be applied globally on selection
|
|
44
45
|
uniqueIdentificationPath = 'id'
|
|
45
46
|
} = _ref;
|
|
46
|
-
const selectedUniqueId = (0,
|
|
47
|
+
const selectedUniqueId = (0, _get3.default)(input.value, uniqueIdentificationPath);
|
|
47
48
|
const [selectedValue, setSelectedValue] = (0, _react.useState)(input.value); // Track what's been selected in state as well
|
|
48
49
|
|
|
49
50
|
// Display data needs to be in line with data options but also able to react to default handleType
|
|
@@ -58,18 +59,25 @@ const Typedown = _ref => {
|
|
|
58
59
|
|
|
59
60
|
// Setup default handleType
|
|
60
61
|
const handleType = (0, _react.useCallback)(e => {
|
|
61
|
-
|
|
62
|
+
var _e$target, _e$target2;
|
|
63
|
+
const regex = new RegExp("".concat(e.target.value.toLowerCase()));
|
|
62
64
|
if (onType) {
|
|
63
65
|
onType(e);
|
|
64
|
-
} else if (filterPath && e
|
|
65
|
-
setDisplayData(dataOptions.filter(item =>
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
} else if (filterPath && e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.value) {
|
|
67
|
+
setDisplayData(dataOptions.filter(item => {
|
|
68
|
+
var _get;
|
|
69
|
+
return (_get = (0, _get3.default)(item, filterPath)) === null || _get === void 0 || (_get = _get.toLowerCase()) === null || _get === void 0 ? void 0 : _get.match(regex);
|
|
70
|
+
}));
|
|
71
|
+
} else if (e !== null && e !== void 0 && (_e$target2 = e.target) !== null && _e$target2 !== void 0 && _e$target2.value) {
|
|
72
|
+
setDisplayData(dataOptions.filter(item => {
|
|
73
|
+
var _get2;
|
|
74
|
+
return (_get2 = (0, _get3.default)(item, uniqueIdentificationPath)) === null || _get2 === void 0 || (_get2 = _get2.toLowerCase()) === null || _get2 === void 0 ? void 0 : _get2.match(regex);
|
|
75
|
+
}));
|
|
68
76
|
} else {
|
|
69
77
|
setDisplayData(dataOptions);
|
|
70
78
|
}
|
|
71
79
|
setCurrentlyTyped(e.target.value);
|
|
72
|
-
if (displayData.length === 1 && (0,
|
|
80
|
+
if (displayData.length === 1 && (0, _get3.default)(displayData[0], filterPath) === e.target.value) {
|
|
73
81
|
setExactMatch(true);
|
|
74
82
|
} else {
|
|
75
83
|
setExactMatch(false);
|
|
@@ -103,7 +111,7 @@ const Typedown = _ref => {
|
|
|
103
111
|
let optionIsSelected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
104
112
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
105
113
|
className: _TypeDown.default.listItem,
|
|
106
|
-
children: renderListItem ? renderListItem(option, currentlyTyped, exactMatch, optionIsSelected, selectedValue) : (0,
|
|
114
|
+
children: renderListItem ? renderListItem(option, currentlyTyped, exactMatch, optionIsSelected, selectedValue) : (0, _get3.default)(option, uniqueIdentificationPath)
|
|
107
115
|
});
|
|
108
116
|
}, [currentlyTyped, exactMatch, renderListItem, selectedValue, uniqueIdentificationPath]);
|
|
109
117
|
const handleChange = (0, _react.useCallback)(value => {
|
|
@@ -114,16 +122,17 @@ const Typedown = _ref => {
|
|
|
114
122
|
}
|
|
115
123
|
}, [input, onChange]);
|
|
116
124
|
const renderTypedownTrigger = () => {
|
|
117
|
-
const triggerComponentId =
|
|
125
|
+
const triggerComponentId = "typedown-trigger-".concat((0, _selectorSafe.default)(input.name));
|
|
118
126
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
119
127
|
ref: triggerRef,
|
|
120
|
-
id:
|
|
128
|
+
id: "typedown-parent-".concat((0, _selectorSafe.default)(input.name), "-trigger"),
|
|
121
129
|
children: renderTrigger ? renderTrigger({
|
|
122
130
|
// Pass all props in that searchfield uses.
|
|
123
131
|
handleType,
|
|
124
132
|
input,
|
|
125
133
|
// Pass input? Useful when not controlled I guess
|
|
126
134
|
meta,
|
|
135
|
+
open,
|
|
127
136
|
selectedValue,
|
|
128
137
|
triggerComponentId,
|
|
129
138
|
triggerComponentRef
|
|
@@ -143,14 +152,14 @@ const Typedown = _ref => {
|
|
|
143
152
|
const dropDown = (0, _react.useCallback)(() => {
|
|
144
153
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
145
154
|
className: _TypeDown.default.dropdownMenu,
|
|
146
|
-
id:
|
|
155
|
+
id: "typedown-parent-".concat((0, _selectorSafe.default)(input.name), "-menu"),
|
|
147
156
|
style: {
|
|
148
|
-
'--searchWidth':
|
|
157
|
+
'--searchWidth': "".concat(searchWidth, "px")
|
|
149
158
|
},
|
|
150
159
|
children: [renderHeader && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
151
160
|
ref: headerRef,
|
|
152
161
|
className: _TypeDown.default.header,
|
|
153
|
-
id:
|
|
162
|
+
id: "typedown-header-".concat((0, _selectorSafe.default)(input.name)),
|
|
154
163
|
children: renderHeader({
|
|
155
164
|
currentlyTyped,
|
|
156
165
|
displayData,
|
|
@@ -167,13 +176,13 @@ const Typedown = _ref => {
|
|
|
167
176
|
* This does NOT prevent item click, as e.propagation is not prevented.
|
|
168
177
|
*/,
|
|
169
178
|
onMouseDown: e => e.preventDefault(),
|
|
170
|
-
children: displayData
|
|
171
|
-
const isSelectedEval = isSelected ? isSelected(input.value, d) : (0,
|
|
172
|
-
const selectedCSS = selectedStyles
|
|
173
|
-
const uniqueButtonKey =
|
|
179
|
+
children: displayData !== null && displayData !== void 0 && displayData.length ? displayData === null || displayData === void 0 ? void 0 : displayData.map((d, _index) => {
|
|
180
|
+
const isSelectedEval = isSelected ? isSelected(input.value, d) : (0, _get3.default)(input.value, uniqueIdentificationPath) === (0, _get3.default)(d, uniqueIdentificationPath);
|
|
181
|
+
const selectedCSS = selectedStyles !== null && selectedStyles !== void 0 ? selectedStyles : _TypeDown.default.selectedMenuButton;
|
|
182
|
+
const uniqueButtonKey = "typedown-button-[".concat((0, _get3.default)(d, uniqueIdentificationPath), "]");
|
|
174
183
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
175
184
|
className: (0, _classnames.default)(_TypeDown.default.fullWidth, _TypeDown.default.menuButton, {
|
|
176
|
-
[
|
|
185
|
+
["".concat(selectedCSS)]: isSelectedEval
|
|
177
186
|
}),
|
|
178
187
|
"data-selected": isSelectedEval,
|
|
179
188
|
id: uniqueButtonKey,
|
|
@@ -188,7 +197,7 @@ const Typedown = _ref => {
|
|
|
188
197
|
}), renderFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
189
198
|
ref: footerRef,
|
|
190
199
|
className: _TypeDown.default.footer,
|
|
191
|
-
id:
|
|
200
|
+
id: "typedown-footer-".concat((0, _selectorSafe.default)(input.name)),
|
|
192
201
|
children: renderFooter(displayData, currentlyTyped, exactMatch)
|
|
193
202
|
})]
|
|
194
203
|
});
|
|
@@ -217,7 +226,7 @@ const Typedown = _ref => {
|
|
|
217
226
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
218
227
|
ref: resizeRef,
|
|
219
228
|
className: (0, _classnames.default)(_TypeDown.default.typedown, className),
|
|
220
|
-
id:
|
|
229
|
+
id: "typedown-id-".concat(id),
|
|
221
230
|
children: [renderTypedownTrigger(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Popper, {
|
|
222
231
|
anchorRef: triggerRef,
|
|
223
232
|
className: (0, _classnames.default)(_TypeDown.default.dropdown, _TypeDown.default.fullWidth),
|
|
@@ -240,6 +249,7 @@ const Typedown = _ref => {
|
|
|
240
249
|
} // prevent propagation of click events
|
|
241
250
|
},
|
|
242
251
|
overlayRef: overlayRef,
|
|
252
|
+
placement: dropdownPlacement,
|
|
243
253
|
portal: portal,
|
|
244
254
|
children: dropDown()
|
|
245
255
|
}, "typedown-menu-toggle"), displayValue && renderSelectedItem()]
|
|
@@ -4,14 +4,18 @@ var _refdata = _interopRequireDefault(require("../../../../test/jest/refdata"));
|
|
|
4
4
|
var _customProperties = _interopRequireDefault(require("../../../../test/jest/customProperties"));
|
|
5
5
|
var _useKintIntl = _interopRequireDefault(require("../intlHooks/useKintIntl"));
|
|
6
6
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
|
+
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); }
|
|
7
12
|
/* EXAMPLE Grab actual hooks for anything not mocked here */
|
|
8
13
|
const hooks = jest.requireActual('../index');
|
|
9
14
|
|
|
10
15
|
// We have to do this up here too so that our passed useKintIntl
|
|
11
16
|
// ALSO has a mocked useIntlKeyStore... I think anyway
|
|
12
17
|
jest.mock('../intlHooks/useIntlKeyStore', () => () => () => 'ui-test-implementor');
|
|
13
|
-
module.exports = {
|
|
14
|
-
...hooks,
|
|
18
|
+
module.exports = _objectSpread(_objectSpread({}, hooks), {}, {
|
|
15
19
|
useRefdata: () => _refdata.default,
|
|
16
20
|
useTemplates: () => [],
|
|
17
21
|
// We should set up some templates to test this properly
|
|
@@ -22,4 +26,4 @@ module.exports = {
|
|
|
22
26
|
useMutateCustomProperties: () => [],
|
|
23
27
|
useIntlKeyStore: () => () => () => 'ui-test-implementor',
|
|
24
28
|
useKintIntl: _useKintIntl.default // Use the "proper" useKintIntl but with a mocked intlKeyStore which returns the ui-test-implementor
|
|
25
|
-
};
|
|
29
|
+
});
|
|
@@ -6,47 +6,53 @@ 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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const _state$intlKeys = state.intlKeys,
|
|
40
|
+
{
|
|
41
|
+
[ns]: _valueToRemove
|
|
42
|
+
} = _state$intlKeys,
|
|
43
|
+
newKeys = _objectWithoutProperties(_state$intlKeys, [ns].map(_toPropertyKey));
|
|
44
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
40
45
|
intlKeys: newKeys
|
|
41
|
-
};
|
|
46
|
+
});
|
|
42
47
|
}),
|
|
43
48
|
getKey: namespace => {
|
|
49
|
+
var _useNamespace3, _get$intlKeys;
|
|
44
50
|
let ns = namespace;
|
|
45
|
-
const folioNS = (0, _core.useNamespace)()
|
|
51
|
+
const folioNS = (_useNamespace3 = (0, _core.useNamespace)()) === null || _useNamespace3 === void 0 ? void 0 : _useNamespace3[0];
|
|
46
52
|
if (!ns) {
|
|
47
53
|
ns = folioNS;
|
|
48
54
|
}
|
|
49
|
-
return get().intlKeys
|
|
55
|
+
return (_get$intlKeys = get().intlKeys) === null || _get$intlKeys === void 0 ? void 0 : _get$intlKeys[ns];
|
|
50
56
|
}
|
|
51
57
|
}));
|
|
52
58
|
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,24 @@ 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) => {
|
|
26
|
+
var _intlObj$messages2;
|
|
18
27
|
let {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
id,
|
|
29
|
+
overrideValue,
|
|
30
|
+
fallbackMessage
|
|
31
|
+
} = _ref,
|
|
32
|
+
formatParams = _objectWithoutProperties(_ref, _excluded);
|
|
24
33
|
if (overrideValue) {
|
|
34
|
+
var _intlObj$messages;
|
|
25
35
|
// Version 3 is a breaking change, where labelOverrides must be strings.
|
|
26
36
|
if (typeof overrideValue !== 'string') {
|
|
27
37
|
throw new Error('Override values must be strings as of stripes-kint-components ^3.0.0');
|
|
28
38
|
}
|
|
29
|
-
if (intlObj.messages
|
|
39
|
+
if ((_intlObj$messages = intlObj.messages) !== null && _intlObj$messages !== void 0 && _intlObj$messages[overrideValue]) {
|
|
30
40
|
// We've been passed a key as an override, use it
|
|
31
|
-
return intlObj.formatMessage({
|
|
32
|
-
id: overrideValue
|
|
33
|
-
|
|
34
|
-
}, formatValues);
|
|
41
|
+
return intlObj.formatMessage(_objectSpread({
|
|
42
|
+
id: overrideValue
|
|
43
|
+
}, formatParams), formatValues);
|
|
35
44
|
}
|
|
36
45
|
// At this stage we have an overrideValue that's not a key, return it.
|
|
37
46
|
return overrideValue;
|
|
@@ -40,28 +49,29 @@ const useKintIntl = (passedIntlKey, passedIntlNS) => {
|
|
|
40
49
|
// If key does not exist in intl, and we have a specified "fallbackMessage", use that
|
|
41
50
|
|
|
42
51
|
// (FallbackMessage works like defaultMessage but with no warning)
|
|
43
|
-
if (!intlObj.messages
|
|
52
|
+
if (!((_intlObj$messages2 = intlObj.messages) !== null && _intlObj$messages2 !== void 0 && _intlObj$messages2["".concat(intlKey, ".").concat(id)]) && fallbackMessage) {
|
|
53
|
+
var _intlObj$messages3;
|
|
44
54
|
// Allow fallback message to be an intl key
|
|
45
|
-
if (intlObj.messages
|
|
46
|
-
return intlObj.formatMessage({
|
|
47
|
-
id: fallbackMessage
|
|
48
|
-
|
|
49
|
-
}, formatValues);
|
|
55
|
+
if ((_intlObj$messages3 = intlObj.messages) !== null && _intlObj$messages3 !== void 0 && _intlObj$messages3[fallbackMessage]) {
|
|
56
|
+
return intlObj.formatMessage(_objectSpread({
|
|
57
|
+
id: fallbackMessage
|
|
58
|
+
}, formatParams), formatValues);
|
|
50
59
|
}
|
|
51
60
|
return fallbackMessage;
|
|
52
61
|
}
|
|
53
62
|
|
|
54
63
|
// After all that, render the message from key
|
|
55
|
-
return intlObj.formatMessage({
|
|
56
|
-
id:
|
|
57
|
-
|
|
58
|
-
}, formatValues);
|
|
64
|
+
return intlObj.formatMessage(_objectSpread({
|
|
65
|
+
id: "".concat(intlKey, ".").concat(id)
|
|
66
|
+
}, formatParams), formatValues);
|
|
59
67
|
};
|
|
60
|
-
const messageExists = key =>
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
const messageExists = key => {
|
|
69
|
+
var _intlObj$messages4;
|
|
70
|
+
return !!((_intlObj$messages4 = intlObj.messages) !== null && _intlObj$messages4 !== void 0 && _intlObj$messages4["".concat(intlKey, ".").concat(key)]);
|
|
71
|
+
};
|
|
72
|
+
return _objectSpread(_objectSpread({}, intlObj), {}, {
|
|
63
73
|
formatKintMessage,
|
|
64
74
|
messageExists
|
|
65
|
-
};
|
|
75
|
+
});
|
|
66
76
|
};
|
|
67
77
|
var _default = exports.default = useKintIntl;
|
|
@@ -47,20 +47,21 @@ const useTypedown = function (name) {
|
|
|
47
47
|
// There appears to be some BIZARRE off-by-one issue with selectors here, that can be fixed by introducing a 1ms delay...
|
|
48
48
|
// I hate it but it is effective
|
|
49
49
|
setTimeout(() => {
|
|
50
|
+
var _dataOptions$length, _dataOptions$length2, _ref, _ref2, _ref3, _ref4, _ref5, _ref6;
|
|
50
51
|
// Split these out to shut up the linter
|
|
51
52
|
const rawFirstItemInList = list ? (0, _components.getFirstFocusable)(list) : null;
|
|
52
53
|
const rawLastItemInList = list ? (0, _components.getLastFocusable)(list) : null;
|
|
53
54
|
|
|
54
55
|
// 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
|
|
56
|
+
const firstItemInList = ((_dataOptions$length = dataOptions === null || dataOptions === void 0 ? void 0 : dataOptions.length) !== null && _dataOptions$length !== void 0 ? _dataOptions$length : 0) > 0 ? rawFirstItemInList : null;
|
|
57
|
+
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
58
|
const configs = [
|
|
58
59
|
// --- HEADER CONFIG ---
|
|
59
60
|
{
|
|
60
61
|
element: header,
|
|
61
62
|
allowTabThroughContents: true,
|
|
62
63
|
previousElement: trigger,
|
|
63
|
-
nextElement: (footer ? (0, _components.getFirstFocusable)(footer) : null)
|
|
64
|
+
nextElement: (_ref = footer ? (0, _components.getFirstFocusable)(footer) : null) !== null && _ref !== void 0 ? _ref : (0, _components.getNextFocusable)(trigger, false),
|
|
64
65
|
downElement: firstItemInList,
|
|
65
66
|
upElement: lastItemInList
|
|
66
67
|
},
|
|
@@ -68,7 +69,7 @@ const useTypedown = function (name) {
|
|
|
68
69
|
{
|
|
69
70
|
element: footer,
|
|
70
71
|
allowTabThroughContents: true,
|
|
71
|
-
previousElement: (header ? (0, _components.getLastFocusable)(header) : null)
|
|
72
|
+
previousElement: (_ref2 = header ? (0, _components.getLastFocusable)(header) : null) !== null && _ref2 !== void 0 ? _ref2 : trigger,
|
|
72
73
|
nextElement: (0, _components.getNextFocusable)(trigger, false),
|
|
73
74
|
downElement: firstItemInList,
|
|
74
75
|
upElement: lastItemInList
|
|
@@ -77,13 +78,13 @@ const useTypedown = function (name) {
|
|
|
77
78
|
{
|
|
78
79
|
element: list,
|
|
79
80
|
allowUpDownThroughContents: true,
|
|
80
|
-
previousElement: (header ? (0, _components.getLastFocusable)(header) : null)
|
|
81
|
-
nextElement: (footer ? (0, _components.getFirstFocusable)(footer) : null)
|
|
81
|
+
previousElement: (_ref3 = header ? (0, _components.getLastFocusable)(header) : null) !== null && _ref3 !== void 0 ? _ref3 : trigger,
|
|
82
|
+
nextElement: (_ref4 = footer ? (0, _components.getFirstFocusable)(footer) : null) !== null && _ref4 !== void 0 ? _ref4 : (0, _components.getNextFocusable)(trigger, false)
|
|
82
83
|
},
|
|
83
84
|
// --- TRIGGER CONFIG ---
|
|
84
85
|
{
|
|
85
86
|
element: trigger,
|
|
86
|
-
nextElement: (header ? (0, _components.getFirstFocusable)(header) : null)
|
|
87
|
+
nextElement: (_ref5 = (_ref6 = header ? (0, _components.getFirstFocusable)(header) : null) !== null && _ref6 !== void 0 ? _ref6 : footer ? (0, _components.getFirstFocusable)(footer) : null) !== null && _ref5 !== void 0 ? _ref5 : (0, _components.getNextFocusable)(trigger, false),
|
|
87
88
|
previousElement: getPreviousToTrigger(),
|
|
88
89
|
downElement: firstItemInList,
|
|
89
90
|
upElement: lastItemInList
|
|
@@ -103,9 +104,9 @@ const useTypedown = function (name) {
|
|
|
103
104
|
const IS_SHIFT = e.shiftKey;
|
|
104
105
|
const tabIgnoreContents = () => {
|
|
105
106
|
if (IS_SHIFT) {
|
|
106
|
-
return previousElement
|
|
107
|
+
return previousElement === null || previousElement === void 0 ? void 0 : previousElement.focus();
|
|
107
108
|
}
|
|
108
|
-
return nextElement
|
|
109
|
+
return nextElement === null || nextElement === void 0 ? void 0 : nextElement.focus();
|
|
109
110
|
};
|
|
110
111
|
if (!allowTabThroughContents) {
|
|
111
112
|
return tabIgnoreContents();
|
|
@@ -122,9 +123,9 @@ const useTypedown = function (name) {
|
|
|
122
123
|
const IS_UP = e.code === _eventCodes.UP_ARROW;
|
|
123
124
|
const upDownIgnoreContents = () => {
|
|
124
125
|
if (IS_UP) {
|
|
125
|
-
return upElement
|
|
126
|
+
return upElement === null || upElement === void 0 ? void 0 : upElement.focus();
|
|
126
127
|
}
|
|
127
|
-
return downElement
|
|
128
|
+
return downElement === null || downElement === void 0 ? void 0 : downElement.focus();
|
|
128
129
|
};
|
|
129
130
|
if (!allowUpDownThroughContents) {
|
|
130
131
|
return upDownIgnoreContents();
|
|
@@ -18,8 +18,8 @@ const useTypedownToggle = name => {
|
|
|
18
18
|
} = (0, _useActiveElement.default)();
|
|
19
19
|
|
|
20
20
|
// 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(
|
|
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
23
|
(0, _react.useEffect)(() => {
|
|
24
24
|
if (openBool || closeBool) {
|
|
25
25
|
onToggle();
|
|
@@ -13,7 +13,7 @@ const useActionListRef = () => {
|
|
|
13
13
|
const passedRef = (0, _react.useCallback)(node => {
|
|
14
14
|
// All functions must be present on here
|
|
15
15
|
actionListRef.current = node;
|
|
16
|
-
if (node
|
|
16
|
+
if (node !== null && node !== void 0 && node.editing) {
|
|
17
17
|
setEditing(node.editing);
|
|
18
18
|
} else {
|
|
19
19
|
setEditing();
|
|
@@ -11,7 +11,7 @@ const useActiveElement = () => {
|
|
|
11
11
|
setActive(document.activeElement);
|
|
12
12
|
};
|
|
13
13
|
const hasParent = id => {
|
|
14
|
-
return active.closest(
|
|
14
|
+
return active.closest("[id^=".concat(id, "]")) !== null;
|
|
15
15
|
};
|
|
16
16
|
(0, _react.useEffect)(() => {
|
|
17
17
|
document.addEventListener('focusin', handleFocusIn);
|
|
@@ -9,6 +9,11 @@ var _reactQuery = require("react-query");
|
|
|
9
9
|
var _core = require("@folio/stripes/core");
|
|
10
10
|
var _utils = require("../utils");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
+
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); }
|
|
12
17
|
const useCustomProperties = _ref => {
|
|
13
18
|
let {
|
|
14
19
|
endpoint,
|
|
@@ -21,7 +26,7 @@ const useCustomProperties = _ref => {
|
|
|
21
26
|
returnQueryObject = false
|
|
22
27
|
} = _ref;
|
|
23
28
|
const ky = (0, _core.useOkapiKy)();
|
|
24
|
-
const custPropOptions = {
|
|
29
|
+
const custPropOptions = _objectSpread({
|
|
25
30
|
searchKey: 'label,name,description',
|
|
26
31
|
filterKeys: {
|
|
27
32
|
ContextKey: 'ctx'
|
|
@@ -33,15 +38,14 @@ const useCustomProperties = _ref => {
|
|
|
33
38
|
}],
|
|
34
39
|
filters: [],
|
|
35
40
|
stats: false,
|
|
36
|
-
max: 100
|
|
37
|
-
|
|
38
|
-
};
|
|
41
|
+
max: 100
|
|
42
|
+
}, options);
|
|
39
43
|
if (Array.isArray(ctx)) {
|
|
40
44
|
// If we have an array, append a context filter for each ctx given
|
|
41
45
|
|
|
42
46
|
// Special case if one is isNull
|
|
43
47
|
custPropOptions.filters.push({
|
|
44
|
-
values: ctx.map(c => c === 'isNull' ? 'ctx isNull' :
|
|
48
|
+
values: ctx.map(c => c === 'isNull' ? 'ctx isNull' : "ctx==".concat(c))
|
|
45
49
|
});
|
|
46
50
|
} else if (ctx === 'isNull') {
|
|
47
51
|
// isNull is a special case
|
|
@@ -55,7 +59,7 @@ const useCustomProperties = _ref => {
|
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
61
|
const query = (0, _utils.generateKiwtQuery)(custPropOptions, nsValues);
|
|
58
|
-
const path =
|
|
62
|
+
const path = "".concat(endpoint).concat(query);
|
|
59
63
|
const queryObject = (0, _reactQuery.useQuery)(['stripes-kint-components', 'useCustomProperties', 'custprops', ctx, path], () => ky(path).json(), queryParams);
|
|
60
64
|
if (returnQueryObject) {
|
|
61
65
|
return queryObject || {};
|
|
@@ -10,13 +10,18 @@ var _queryString = _interopRequireDefault(require("query-string"));
|
|
|
10
10
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
17
|
+
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); }
|
|
13
18
|
const useHelperApp = helpers => {
|
|
14
19
|
const history = (0, _reactRouterDom.useHistory)();
|
|
15
20
|
const location = (0, _reactRouterDom.useLocation)();
|
|
16
21
|
const [helperObject, setHelperObject] = (0, _react.useState)({});
|
|
17
22
|
const [helperToggleFunctions, setHelperToggleFunctions] = (0, _react.useState)({});
|
|
18
23
|
const query = _queryString.default.parse(location.search);
|
|
19
|
-
const [currentHelper, setCurrentHelper] = (0, _react.useState)(query
|
|
24
|
+
const [currentHelper, setCurrentHelper] = (0, _react.useState)(query === null || query === void 0 ? void 0 : query.helper);
|
|
20
25
|
const handleToggleHelper = (0, _react.useCallback)(helper => {
|
|
21
26
|
setCurrentHelper(helper !== currentHelper ? helper : undefined);
|
|
22
27
|
}, [currentHelper]);
|
|
@@ -35,14 +40,13 @@ const useHelperApp = helpers => {
|
|
|
35
40
|
// This makes sure adding/removing helpers changes the functions
|
|
36
41
|
setHelperToggleFunctions(newHelperToggleFunctions);
|
|
37
42
|
}
|
|
38
|
-
if (currentHelper !== query
|
|
39
|
-
const newQuery = {
|
|
40
|
-
...query,
|
|
43
|
+
if (currentHelper !== (query === null || query === void 0 ? void 0 : query.helper)) {
|
|
44
|
+
const newQuery = _objectSpread(_objectSpread({}, query), {}, {
|
|
41
45
|
helper: currentHelper
|
|
42
|
-
};
|
|
46
|
+
});
|
|
43
47
|
history.push({
|
|
44
48
|
pathname: location.pathname,
|
|
45
|
-
search:
|
|
49
|
+
search: "?".concat(_queryString.default.stringify(newQuery))
|
|
46
50
|
});
|
|
47
51
|
|
|
48
52
|
// When helper changes, reset helperToggleFunctions
|
|
@@ -52,15 +56,14 @@ const useHelperApp = helpers => {
|
|
|
52
56
|
|
|
53
57
|
// Set the HelperComponent
|
|
54
58
|
const HelperComponent = (0, _react.useCallback)(props => {
|
|
55
|
-
if (!query
|
|
59
|
+
if (!(query !== null && query !== void 0 && query.helper)) return null;
|
|
56
60
|
let Component = null;
|
|
57
|
-
Component = helperObject[query
|
|
61
|
+
Component = helperObject[query === null || query === void 0 ? void 0 : query.helper];
|
|
58
62
|
if (!Component) return null;
|
|
59
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
60
|
-
onToggle: () => handleToggleHelper(query
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, [handleToggleHelper, helperObject, query?.helper]);
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({
|
|
64
|
+
onToggle: () => handleToggleHelper(query === null || query === void 0 ? void 0 : query.helper)
|
|
65
|
+
}, props));
|
|
66
|
+
}, [handleToggleHelper, helperObject, query === null || query === void 0 ? void 0 : query.helper]);
|
|
64
67
|
return {
|
|
65
68
|
currentHelper,
|
|
66
69
|
HelperComponent,
|
|
@@ -6,6 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactFinalFormArrays = require("react-final-form-arrays");
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
|
+
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); }
|
|
9
14
|
const useKiwtFieldArray = function (name) {
|
|
10
15
|
let submitWholeDeletedObject = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
11
16
|
const {
|
|
@@ -28,10 +33,9 @@ const useKiwtFieldArray = function (name) {
|
|
|
28
33
|
const onMarkForDeletion = field => {
|
|
29
34
|
if (field && field.id) {
|
|
30
35
|
if (submitWholeDeletedObject) {
|
|
31
|
-
fields.push({
|
|
32
|
-
...field,
|
|
36
|
+
fields.push(_objectSpread(_objectSpread({}, field), {}, {
|
|
33
37
|
_delete: true
|
|
34
|
-
});
|
|
38
|
+
}));
|
|
35
39
|
} else {
|
|
36
40
|
fields.push({
|
|
37
41
|
id: field.id,
|
|
@@ -57,10 +61,7 @@ const useKiwtFieldArray = function (name) {
|
|
|
57
61
|
}
|
|
58
62
|
};
|
|
59
63
|
const onUpdateField = (index, field) => {
|
|
60
|
-
fields.update(index, {
|
|
61
|
-
...fields.value[index],
|
|
62
|
-
...field
|
|
63
|
-
});
|
|
64
|
+
fields.update(index, _objectSpread(_objectSpread({}, fields.value[index]), field));
|
|
64
65
|
};
|
|
65
66
|
const items = values.slice(0, endOfList);
|
|
66
67
|
return {
|