@k-int/stripes-kint-components 5.31.3 → 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 +15 -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 +26 -18
- 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 +532 -0
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +58 -43
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +257 -0
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +33 -0
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +24 -0
- package/es/lib/SASQLookupComponent/__mocks__/index.js +20 -0
- package/es/lib/SASQRoute/SASQRoute.js +29 -25
- package/es/lib/SASQRoute/SASQRoute.test.js +269 -0
- package/es/lib/SASQViewComponent/SASQViewComponent.js +76 -68
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +108 -0
- package/es/lib/SASQViewComponent/__mocks__/SASQViewComponent.js +19 -0
- package/es/lib/SASQViewComponent/__mocks__/SASQViewComponentRender.js +19 -0
- package/es/lib/SASQViewComponent/__mocks__/index.js +20 -0
- 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 +12 -8
- 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 +5 -1
- package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +4 -4
- package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +10 -10
- 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 +217 -25
- 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 +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +6 -6
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +5 -5
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +4 -4
- 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 +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +2 -2
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +3 -3
- 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 +3 -3
- 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 +2 -2
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +6 -6
- 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 +2 -2
- package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +3 -3
- 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 +2 -2
- package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +146 -149
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +74 -65
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +43 -43
- package/src/artifacts/coverage-jest/SASQRoute/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +42 -42
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +4 -4
- 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 +3 -3
- 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 +4 -4
- 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 +4 -4
- 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 +3 -3
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +5 -5
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +4 -4
- 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 +3 -3
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +3 -3
- 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 +3 -3
- 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 +3 -3
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +2 -2
- 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 +5 -5
- package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +2 -2
- 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 +2 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +33 -15
- 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 +3 -3
- 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 +2 -2
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +8 -8
- 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 +5 -5
- package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +15 -6
- 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 +1006 -839
- package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/customProperties.js.html +12 -12
- package/src/artifacts/coverage-jest/constants/endpoints.js.html +4 -4
- package/src/artifacts/coverage-jest/constants/eventCodes.js.html +4 -4
- package/src/artifacts/coverage-jest/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/constants/pagination.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/index.html +51 -51
- 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 +8 -8
- 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 +12 -12
- 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 +10 -10
- 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 +2 -2
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +2 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +48 -48
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +22 -22
- package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +3 -3
- 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 +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +5 -2
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +2 -2
- 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 +2 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +68 -68
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +28 -28
- package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +2 -2
- 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 +2 -2
- package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +2 -2
- package/src/artifacts/coverage-jest/index.html +115 -100
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +34 -34
- 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 +67 -67
- 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/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/index.html +22 -22
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/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/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 +8 -8
- package/src/lib/ButtonTypedown/ButtonTypedown.js +77 -13
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +3 -4
- package/src/lib/SASQLookupComponent/SASQLookupComponent.test.js +495 -0
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +6 -3
- package/src/lib/SASQLookupComponent/TableBody/TableBody.test.js +247 -0
- package/src/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +31 -0
- package/src/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +20 -0
- package/src/lib/SASQLookupComponent/__mocks__/index.js +2 -0
- package/src/lib/SASQRoute/SASQRoute.test.js +281 -0
- package/src/lib/SASQViewComponent/SASQViewComponent.test.js +114 -0
- package/src/lib/SASQViewComponent/__mocks__/SASQViewComponent.js +13 -0
- package/src/lib/SASQViewComponent/__mocks__/SASQViewComponentRender.js +17 -0
- package/src/lib/SASQViewComponent/__mocks__/index.js +2 -0
- package/src/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +1 -1
- 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/src/lib/hooks/useMutateGeneric/index.js +1 -1
- package/styles/TypeDown.css +2 -2
- package/test/helpers/test-implementor-translations.json +2 -1
- package/test/helpers/translationsProperties.js +1 -1
- package/test/jest/setupTests.js +1 -1
|
@@ -11,7 +11,15 @@ var _components = require("@folio/stripes/components");
|
|
|
11
11
|
var _ResponsiveButtonGroup = _interopRequireDefault(require("../../../styles/ResponsiveButtonGroup.css"));
|
|
12
12
|
var _useResponsiveButtonGroupSizing = _interopRequireDefault(require("./useResponsiveButtonGroupSizing"));
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const _excluded = ["children", "className", "dropdownTriggerProps", "fullWidth", "id", "marginBottom0", "selectedIndex", "tagName"];
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
15
23
|
const propTypes = {
|
|
16
24
|
children: _propTypes.default.node,
|
|
17
25
|
className: _propTypes.default.string,
|
|
@@ -28,31 +36,31 @@ const calculateCumulativeThreshold = function (arrayOfNumbers, maximum) {
|
|
|
28
36
|
let value = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
29
37
|
// If all the numbers fit, return the last index
|
|
30
38
|
if (arrayOfNumbers.reduce((partialSum, a) => partialSum + a, 0) <= maximum) {
|
|
31
|
-
return arrayOfNumbers
|
|
39
|
+
return (arrayOfNumbers === null || arrayOfNumbers === void 0 ? void 0 : arrayOfNumbers.length) - 1;
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
// Else we'll need a down arrow button, so include that in calculations
|
|
35
43
|
const nextValue = value + arrayOfNumbers[index];
|
|
36
|
-
if (nextValue + SIZE_OF_DOWN_ARROW_BUTTON <= maximum && index + 1 < arrayOfNumbers
|
|
44
|
+
if (nextValue + SIZE_OF_DOWN_ARROW_BUTTON <= maximum && index + 1 < (arrayOfNumbers === null || arrayOfNumbers === void 0 ? void 0 : arrayOfNumbers.length)) {
|
|
37
45
|
return calculateCumulativeThreshold(arrayOfNumbers, maximum, index + 1, nextValue);
|
|
38
46
|
}
|
|
39
47
|
return index - 1;
|
|
40
48
|
};
|
|
41
49
|
const ResponsiveButtonGroup = props => {
|
|
42
50
|
const {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
children: childButtons,
|
|
52
|
+
// These MUST consist only of Button components
|
|
53
|
+
className,
|
|
54
|
+
dropdownTriggerProps = {},
|
|
55
|
+
fullWidth = false,
|
|
56
|
+
// Only bother with this when buttonGroupWidth < ContainerWidth
|
|
57
|
+
id,
|
|
58
|
+
marginBottom0,
|
|
59
|
+
// Will ONLL control the margin of the dropdown button
|
|
60
|
+
selectedIndex,
|
|
61
|
+
tagName: Tag = 'div'
|
|
62
|
+
} = props,
|
|
63
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
56
64
|
const sanitizedButtons = (0, _react.useMemo)(() => {
|
|
57
65
|
const arr = Array.isArray(childButtons) ? childButtons : [childButtons];
|
|
58
66
|
return arr.filter(_react.isValidElement);
|
|
@@ -69,6 +77,7 @@ const ResponsiveButtonGroup = props => {
|
|
|
69
77
|
});
|
|
70
78
|
const buttonThreshold = calculateCumulativeThreshold(cachedSizeArray, containerWidth);
|
|
71
79
|
const renderActionMenuToggle = (0, _react.useCallback)(_ref => {
|
|
80
|
+
var _displayButtons$lengt;
|
|
72
81
|
let {
|
|
73
82
|
displayButtons,
|
|
74
83
|
onToggle,
|
|
@@ -78,42 +87,46 @@ const ResponsiveButtonGroup = props => {
|
|
|
78
87
|
ariaProps,
|
|
79
88
|
getTriggerProps
|
|
80
89
|
} = _ref;
|
|
81
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
90
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
82
91
|
ref: triggerRef,
|
|
83
92
|
"aria-label": "menu",
|
|
84
93
|
buttonClass: (0, _classnames.default)(_ResponsiveButtonGroup.default.width100, {
|
|
85
|
-
[
|
|
94
|
+
["".concat(_ResponsiveButtonGroup.default.dropdownButtonClass)]: ((_displayButtons$lengt = displayButtons === null || displayButtons === void 0 ? void 0 : displayButtons.length) !== null && _displayButtons$lengt !== void 0 ? _displayButtons$lengt : 0) > 0
|
|
86
95
|
}, {
|
|
87
|
-
[
|
|
96
|
+
["".concat(_ResponsiveButtonGroup.default.marginBottom)]: !marginBottom0
|
|
88
97
|
}, {
|
|
89
|
-
[
|
|
98
|
+
["".concat(_ResponsiveButtonGroup.default.marginBottom0)]: marginBottom0
|
|
90
99
|
}),
|
|
91
100
|
buttonStyle: selectedIndex > buttonThreshold ? 'primary' : 'default',
|
|
92
101
|
onClick: onToggle,
|
|
93
102
|
onKeyDown: keyHandler,
|
|
94
|
-
type: "button"
|
|
95
|
-
|
|
96
|
-
...ariaProps,
|
|
97
|
-
...dropdownTriggerProps,
|
|
103
|
+
type: "button"
|
|
104
|
+
}, getTriggerProps()), ariaProps), dropdownTriggerProps), {}, {
|
|
98
105
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
99
106
|
icon: open ? 'triangle-up' : 'triangle-down',
|
|
100
107
|
iconPosition: "end"
|
|
101
108
|
})
|
|
102
|
-
});
|
|
109
|
+
}));
|
|
103
110
|
}, [buttonThreshold, dropdownTriggerProps, marginBottom0, selectedIndex]);
|
|
104
|
-
const displayButtons = (0, _react.useMemo)(() =>
|
|
105
|
-
|
|
111
|
+
const displayButtons = (0, _react.useMemo)(() => {
|
|
112
|
+
var _buttons$slice;
|
|
113
|
+
return buttons === null || buttons === void 0 || (_buttons$slice = buttons.slice(0, buttonThreshold + 1)) === null || _buttons$slice === void 0 ? void 0 : _buttons$slice.map((button, index) => {
|
|
114
|
+
if (index === selectedIndex && !(button !== null && button !== void 0 && button.buttonStyle)) {
|
|
115
|
+
return /*#__PURE__*/(0, _react.cloneElement)(button, {
|
|
116
|
+
buttonStyle: 'primary'
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return button;
|
|
120
|
+
});
|
|
121
|
+
}, [buttonThreshold, buttons, selectedIndex]);
|
|
122
|
+
const dropdownButtons = (0, _react.useMemo)(() => {
|
|
123
|
+
var _buttons$slice2;
|
|
124
|
+
return [...((_buttons$slice2 = buttons.slice(buttonThreshold + 1, buttons === null || buttons === void 0 ? void 0 : buttons.length)) === null || _buttons$slice2 === void 0 ? void 0 : _buttons$slice2.map(button => {
|
|
106
125
|
return /*#__PURE__*/(0, _react.cloneElement)(button, {
|
|
107
|
-
buttonStyle: '
|
|
126
|
+
buttonStyle: 'dropdownItem'
|
|
108
127
|
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
}), [buttonThreshold, buttons, selectedIndex]);
|
|
112
|
-
const dropdownButtons = (0, _react.useMemo)(() => [...buttons.slice(buttonThreshold + 1, buttons?.length)?.map(button => {
|
|
113
|
-
return /*#__PURE__*/(0, _react.cloneElement)(button, {
|
|
114
|
-
buttonStyle: 'dropdownItem'
|
|
115
|
-
});
|
|
116
|
-
})], [buttonThreshold, buttons]);
|
|
128
|
+
}))];
|
|
129
|
+
}, [buttonThreshold, buttons]);
|
|
117
130
|
|
|
118
131
|
// eslint-disable-next-line react/prop-types
|
|
119
132
|
const renderActionMenuContent = (0, _react.useCallback)(() => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownMenu, {
|
|
@@ -122,34 +135,33 @@ const ResponsiveButtonGroup = props => {
|
|
|
122
135
|
const buttonsSlice = (0, _react.useMemo)(() => [...displayButtons, /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
|
|
123
136
|
className: _ResponsiveButtonGroup.default.dropdownClass,
|
|
124
137
|
renderMenu: renderActionMenuContent,
|
|
125
|
-
renderTrigger: triggerProps => renderActionMenuToggle({
|
|
126
|
-
displayButtons
|
|
127
|
-
|
|
128
|
-
})
|
|
138
|
+
renderTrigger: triggerProps => renderActionMenuToggle(_objectSpread({
|
|
139
|
+
displayButtons
|
|
140
|
+
}, triggerProps))
|
|
129
141
|
}, "responsiveButtonGroup-dropdown-toggle")], [displayButtons, renderActionMenuContent, renderActionMenuToggle]);
|
|
130
142
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
131
143
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
132
144
|
ref: containerRef,
|
|
133
145
|
className: "width: 100%;"
|
|
134
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Tag, {
|
|
146
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Tag, _objectSpread(_objectSpread({
|
|
135
147
|
className: (0, _classnames.default)({
|
|
136
|
-
[
|
|
148
|
+
["".concat(_ResponsiveButtonGroup.default.hidden)]: !ready
|
|
137
149
|
}, _ResponsiveButtonGroup.default.buttonGroup, {
|
|
138
|
-
[
|
|
150
|
+
["".concat(_ResponsiveButtonGroup.default.fullWidth)]: ready && fullWidth
|
|
139
151
|
}, className),
|
|
140
152
|
style: fullWidth ? {
|
|
141
|
-
width:
|
|
142
|
-
} : {}
|
|
143
|
-
|
|
144
|
-
children: !ready || buttonThreshold === cachedSizeArray
|
|
145
|
-
if (index === selectedIndex && !button
|
|
153
|
+
width: "".concat(containerWidth, "px")
|
|
154
|
+
} : {}
|
|
155
|
+
}, rest), {}, {
|
|
156
|
+
children: !ready || buttonThreshold === (cachedSizeArray === null || cachedSizeArray === void 0 ? void 0 : cachedSizeArray.length) - 1 ? buttons === null || buttons === void 0 ? void 0 : buttons.map((button, index) => {
|
|
157
|
+
if (index === selectedIndex && !(button !== null && button !== void 0 && button.buttonStyle)) {
|
|
146
158
|
return /*#__PURE__*/(0, _react.cloneElement)(button, {
|
|
147
159
|
buttonStyle: 'primary'
|
|
148
160
|
});
|
|
149
161
|
}
|
|
150
162
|
return button;
|
|
151
163
|
}) : buttonsSlice
|
|
152
|
-
})]
|
|
164
|
+
}))]
|
|
153
165
|
});
|
|
154
166
|
};
|
|
155
167
|
ResponsiveButtonGroup.propTypes = propTypes;
|
|
@@ -14,7 +14,7 @@ const useResponsiveButtonGroupSizing = _ref => {
|
|
|
14
14
|
id,
|
|
15
15
|
buttons = []
|
|
16
16
|
} = _ref;
|
|
17
|
-
const eventString = 'responsive-button-group-loaded' + (id ?
|
|
17
|
+
const eventString = 'responsive-button-group-loaded' + (id ? "-".concat(id) : '');
|
|
18
18
|
const loadedEvent = new Event(eventString);
|
|
19
19
|
const isMounted = (0, _react.useRef)(false);
|
|
20
20
|
(0, _react.useEffect)(() => {
|
|
@@ -37,7 +37,8 @@ const useResponsiveButtonGroupSizing = _ref => {
|
|
|
37
37
|
const refArray = buttons.map((_button, index) => {
|
|
38
38
|
return node => {
|
|
39
39
|
if (node !== null) {
|
|
40
|
-
|
|
40
|
+
var _node$clientWidth;
|
|
41
|
+
const newSizeArray = sizeArray.slice(0, index).concat([(_node$clientWidth = node === null || node === void 0 ? void 0 : node.clientWidth) !== null && _node$clientWidth !== void 0 ? _node$clientWidth : 0]).concat(sizeArray.slice(index + 1));
|
|
41
42
|
if (!(0, _isEqual.default)(sizeArray, newSizeArray)) {
|
|
42
43
|
setSizeArray(newSizeArray);
|
|
43
44
|
}
|
|
@@ -49,16 +50,16 @@ const useResponsiveButtonGroupSizing = _ref => {
|
|
|
49
50
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
51
|
(0, _react.useEffect)((0, _lodash.debounce)(() => {
|
|
51
52
|
if (isMounted.current) {
|
|
52
|
-
if (!cachedSizeArray
|
|
53
|
+
if (!(cachedSizeArray !== null && cachedSizeArray !== void 0 && cachedSizeArray.length) && sizeArray !== null && sizeArray !== void 0 && sizeArray.length) {
|
|
53
54
|
setCachedSizeArray(sizeArray);
|
|
54
55
|
setReady(true);
|
|
55
56
|
document.dispatchEvent(loadedEvent);
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
}, 150), [cachedSizeArray, sizeArray]);
|
|
59
|
-
const returnButtons = buttons
|
|
60
|
+
const returnButtons = buttons === null || buttons === void 0 ? void 0 : buttons.map((button, index) => {
|
|
60
61
|
return /*#__PURE__*/(0, _react.cloneElement)(button, {
|
|
61
|
-
ref: refArray
|
|
62
|
+
ref: refArray === null || refArray === void 0 ? void 0 : refArray[index]
|
|
62
63
|
});
|
|
63
64
|
});
|
|
64
65
|
return {
|
|
@@ -11,7 +11,13 @@ var _RichSelect = _interopRequireDefault(require("../../../styles/RichSelect.css
|
|
|
11
11
|
var _FormattedKintMessage = _interopRequireDefault(require("../FormattedKintMessage"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
+
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); }
|
|
14
19
|
const RichSelect = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
20
|
+
var _ref2, _meta$initial, _findSelectedOptionBy, _meta$initial2;
|
|
15
21
|
let {
|
|
16
22
|
ariaLabel,
|
|
17
23
|
disabled = false,
|
|
@@ -32,17 +38,17 @@ const RichSelect = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
32
38
|
value
|
|
33
39
|
} = _ref;
|
|
34
40
|
const hiddenInput = (0, _react.useRef)(null);
|
|
35
|
-
const [internalValue, setInternalValue] = (0, _react.useState)(meta
|
|
41
|
+
const [internalValue, setInternalValue] = (0, _react.useState)((_ref2 = (_meta$initial = meta === null || meta === void 0 ? void 0 : meta.initial) !== null && _meta$initial !== void 0 ? _meta$initial : value) !== null && _ref2 !== void 0 ? _ref2 : '');
|
|
36
42
|
const findSelectedOptionByValue = (0, _react.useCallback)(val => {
|
|
37
43
|
return userOptions.find(opt => opt.value === val);
|
|
38
44
|
}, [userOptions]);
|
|
39
|
-
const [selectedOption, setSelectedOption] = (0, _react.useState)(findSelectedOptionByValue(meta
|
|
45
|
+
const [selectedOption, setSelectedOption] = (0, _react.useState)((_findSelectedOptionBy = findSelectedOptionByValue((_meta$initial2 = meta === null || meta === void 0 ? void 0 : meta.initial) !== null && _meta$initial2 !== void 0 ? _meta$initial2 : '')) !== null && _findSelectedOptionBy !== void 0 ? _findSelectedOptionBy : {});
|
|
40
46
|
(0, _react.useEffect)(() => {
|
|
41
47
|
// We treat non-undefined value/formInput values as valid values, whereas undefined is only relevant when prop has not been provided
|
|
42
|
-
if (value !== undefined && !(value === selectedOption
|
|
48
|
+
if (value !== undefined && !(value === (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) && value === internalValue)) {
|
|
43
49
|
setSelectedOption(findSelectedOptionByValue(value));
|
|
44
50
|
setInternalValue(value);
|
|
45
|
-
} else if (formInput
|
|
51
|
+
} else if ((formInput === null || formInput === void 0 ? void 0 : formInput.value) !== undefined && !(value === (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) && value === internalValue)) {
|
|
46
52
|
setSelectedOption(findSelectedOptionByValue(formInput.value));
|
|
47
53
|
setInternalValue(formInput.value);
|
|
48
54
|
}
|
|
@@ -52,15 +58,16 @@ const RichSelect = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
52
58
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
53
59
|
selectedOption
|
|
54
60
|
}));
|
|
55
|
-
const defaultRenderTrigger =
|
|
61
|
+
const defaultRenderTrigger = _ref3 => {
|
|
62
|
+
var _ref4, _ref5, _ref6, _selectedOption$label;
|
|
56
63
|
let {
|
|
57
64
|
onToggle,
|
|
58
65
|
triggerRef,
|
|
59
66
|
keyHandler,
|
|
60
67
|
ariaProps,
|
|
61
68
|
getTriggerProps
|
|
62
|
-
} =
|
|
63
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownButton, {
|
|
69
|
+
} = _ref3;
|
|
70
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownButton, _objectSpread(_objectSpread(_objectSpread({
|
|
64
71
|
ref: triggerRef,
|
|
65
72
|
buttonClass: _RichSelect.default.triggerButton,
|
|
66
73
|
buttonStyle: "none",
|
|
@@ -69,19 +76,18 @@ const RichSelect = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
69
76
|
onClick: onToggle,
|
|
70
77
|
onKeyDown: keyHandler,
|
|
71
78
|
paddingSide0: true,
|
|
72
|
-
type: "button"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
children: selectedOption?.label ?? selectedOption?.value ?? (internalValue || null) ?? placeholder ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormattedKintMessage.default, {
|
|
79
|
+
type: "button"
|
|
80
|
+
}, getTriggerProps()), ariaProps), {}, {
|
|
81
|
+
children: (_ref4 = (_ref5 = (_ref6 = (_selectedOption$label = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _selectedOption$label !== void 0 ? _selectedOption$label : selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _ref6 !== void 0 ? _ref6 : internalValue || null) !== null && _ref5 !== void 0 ? _ref5 : placeholder) !== null && _ref4 !== void 0 ? _ref4 : /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormattedKintMessage.default, {
|
|
76
82
|
id: "pleaseSelectOption",
|
|
77
83
|
intlKey: passedIntlKey,
|
|
78
84
|
intlNS: passedIntlNS
|
|
79
85
|
})
|
|
80
|
-
});
|
|
86
|
+
}));
|
|
81
87
|
};
|
|
82
88
|
const handleChange = e => {
|
|
83
89
|
// Actually set the value in the form (If formInput exists)
|
|
84
|
-
if (formInput
|
|
90
|
+
if (formInput !== null && formInput !== void 0 && formInput.onChange) {
|
|
85
91
|
formInput.onChange(e);
|
|
86
92
|
}
|
|
87
93
|
|
|
@@ -93,17 +99,20 @@ const RichSelect = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
93
99
|
const changeField = val => {
|
|
94
100
|
(0, _components.nativeChangeFieldValue)(hiddenInput, false, val);
|
|
95
101
|
};
|
|
96
|
-
const defaultRenderOption = opt =>
|
|
97
|
-
|
|
102
|
+
const defaultRenderOption = opt => {
|
|
103
|
+
var _opt$label;
|
|
104
|
+
return (_opt$label = opt.label) !== null && _opt$label !== void 0 ? _opt$label : opt.value;
|
|
105
|
+
};
|
|
106
|
+
const defaultRenderMenu = _ref7 => {
|
|
98
107
|
let {
|
|
99
108
|
onToggle
|
|
100
|
-
} =
|
|
109
|
+
} = _ref7;
|
|
101
110
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownMenu, {
|
|
102
111
|
children: userOptions.map(opt => {
|
|
103
112
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
104
|
-
autoFocus: selectedOption
|
|
113
|
+
autoFocus: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === opt.value,
|
|
105
114
|
buttonStyle: "dropdownItem",
|
|
106
|
-
id:
|
|
115
|
+
id: "".concat(id, "-").concat(formInput.name, "-option-").concat(opt.value),
|
|
107
116
|
marginBottom0: true,
|
|
108
117
|
onClick: () => {
|
|
109
118
|
// Trigger change event
|
|
@@ -121,43 +130,39 @@ const RichSelect = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
121
130
|
children: [label || ariaLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Label, {
|
|
122
131
|
className: ariaLabel && 'sr-only',
|
|
123
132
|
htmlFor: id,
|
|
124
|
-
id:
|
|
133
|
+
id: "".concat(id, "-label"),
|
|
125
134
|
required: required,
|
|
126
135
|
children: ariaLabel || label
|
|
127
|
-
}) : '', /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
|
|
136
|
+
}) : '', /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, _objectSpread({
|
|
128
137
|
disabled: disabled,
|
|
129
138
|
hasPadding: true,
|
|
130
139
|
placement: "bottom-start",
|
|
131
140
|
renderMenu: menuProps => {
|
|
132
141
|
if (renderMenu) {
|
|
133
|
-
return renderMenu({
|
|
134
|
-
...menuProps,
|
|
142
|
+
return renderMenu(_objectSpread(_objectSpread({}, menuProps), {}, {
|
|
135
143
|
selectedOption,
|
|
136
144
|
changeField
|
|
137
|
-
});
|
|
145
|
+
}));
|
|
138
146
|
} else {
|
|
139
147
|
return defaultRenderMenu(menuProps);
|
|
140
148
|
}
|
|
141
149
|
},
|
|
142
150
|
renderTrigger: triggerProps => {
|
|
143
151
|
if (renderTrigger) {
|
|
144
|
-
return renderTrigger({
|
|
145
|
-
...triggerProps,
|
|
152
|
+
return renderTrigger(_objectSpread(_objectSpread({}, triggerProps), {}, {
|
|
146
153
|
selectedOption
|
|
147
|
-
});
|
|
154
|
+
}));
|
|
148
155
|
} else {
|
|
149
156
|
return defaultRenderTrigger(triggerProps);
|
|
150
157
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
154
|
-
...formInput,
|
|
158
|
+
}
|
|
159
|
+
}, dropdownProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread(_objectSpread({}, formInput), {}, {
|
|
155
160
|
ref: hiddenInput,
|
|
156
161
|
hidden: true,
|
|
157
162
|
onChange: handleChange,
|
|
158
163
|
type: "text",
|
|
159
164
|
value: internalValue
|
|
160
|
-
})]
|
|
165
|
+
}))]
|
|
161
166
|
});
|
|
162
167
|
});
|
|
163
168
|
RichSelect.propTypes = {
|
|
@@ -8,7 +8,8 @@ var _react = require("react");
|
|
|
8
8
|
const useSelectedOption = () => {
|
|
9
9
|
const [selectedOption, setSelectedOption] = (0, _react.useState)();
|
|
10
10
|
const ref = (0, _react.useCallback)(node => {
|
|
11
|
-
|
|
11
|
+
var _node$selectedOption;
|
|
12
|
+
if (node !== null && (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== ((_node$selectedOption = node.selectedOption) === null || _node$selectedOption === void 0 ? void 0 : _node$selectedOption.value)) {
|
|
12
13
|
setSelectedOption(node.selectedOption);
|
|
13
14
|
}
|
|
14
15
|
}, [selectedOption]);
|