@k-int/stripes-kint-components 5.32.0 → 5.33.1
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 +14 -0
- package/LICENSE +1 -1
- package/es/__mocks__/@folio/stripes/components.js +3 -7
- package/es/__mocks__/@folio/stripes/core.js +4 -6
- package/es/__mocks__/@folio/stripes/smart-components.js +4 -6
- package/es/__mocks__/react-query.js +4 -6
- package/es/__mocks__/react-router-dom.js +6 -6
- package/es/lib/ActionList/ActionList.js +26 -33
- package/es/lib/ActionList/ActionListFieldArray.js +103 -119
- package/es/lib/ButtonTypedown/ButtonTypedown.js +25 -33
- package/es/lib/ComboButton/ComboButton.js +42 -47
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +11 -17
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +42 -46
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +58 -58
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +4 -8
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +32 -33
- 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 +29 -35
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +61 -59
- 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 +11 -12
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +22 -33
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +24 -37
- 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 +3 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +4 -8
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +15 -19
- package/es/lib/CustomProperties/Filter/testResources.js +1 -2
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +1 -2
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +1 -1
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +17 -25
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +3 -6
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +7 -11
- package/es/lib/CycleButton/CycleButton.js +9 -17
- package/es/lib/FormModal/FormModal.js +24 -32
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +23 -30
- package/es/lib/IconSelect/IconSelect.js +22 -32
- package/es/lib/NoResultsMessage/NoResultsMessage.js +4 -5
- package/es/lib/NumberField/NumberField.js +17 -25
- package/es/lib/NumberField/NumberField.test.js +6 -7
- package/es/lib/QueryTypedown/QueryTypedown.js +8 -15
- package/es/lib/RefdataButtons/RefdataButtons.js +6 -9
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +48 -60
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +5 -6
- package/es/lib/RichSelect/RichSelect.js +31 -36
- package/es/lib/RichSelect/useSelectedOption.js +1 -2
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +91 -94
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +44 -36
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +42 -53
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +19 -23
- package/es/lib/SASQRoute/SASQRoute.js +25 -29
- package/es/lib/SASQRoute/SASQRoute.test.js +11 -13
- package/es/lib/SASQViewComponent/SASQViewComponent.js +68 -76
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +4 -8
- package/es/lib/SearchField/SearchField.js +7 -13
- package/es/lib/SearchKeyControl/SearchKeyControl.js +8 -13
- package/es/lib/SearchKeyControl/SearchKeyControl.test.js +2 -6
- package/es/lib/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js +30 -46
- package/es/lib/Settings/EditableRefdataList/EditableRefdataList.js +33 -43
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +7 -11
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +13 -20
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +10 -12
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +10 -15
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +3 -3
- package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +19 -26
- package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +2 -2
- package/es/lib/Settings/Settings/Settings.js +31 -13
- package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +30 -35
- package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +5 -8
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +18 -22
- 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 +3 -7
- package/es/lib/Settings/hooks/useAppSettings/useAppSettings.js +7 -11
- package/es/lib/Settings/hooks/useSettingSection/useSettingSection.js +16 -22
- package/es/lib/Settings/hooks/useSettings/useSettings.js +104 -88
- package/es/lib/Settings/index.js +8 -0
- package/es/lib/Tags/Tags.js +5 -8
- package/es/lib/Tags/hooks/useTags.js +1 -1
- package/es/lib/Tags/hooks/useTagsEnabled.js +2 -3
- package/es/lib/Tags/tagsConfig.js +1 -1
- package/es/lib/Typedown/Typedown.js +21 -28
- package/es/lib/hooks/__mocks__/index.js +3 -7
- package/es/lib/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js +20 -26
- package/es/lib/hooks/intlHooks/useKintIntl/useKintIntl.js +24 -34
- package/es/lib/hooks/typedownHooks/useTypedown.js +11 -12
- 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 +6 -10
- package/es/lib/hooks/useHelperApp.js +13 -16
- package/es/lib/hooks/useKiwtFieldArray.js +7 -8
- package/es/lib/hooks/useKiwtSASQuery.js +15 -19
- package/es/lib/hooks/useLocalPageStore.js +7 -10
- package/es/lib/hooks/useModConfigEntries.js +2 -2
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.js +10 -17
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.js +2 -2
- package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js +15 -21
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.js +16 -23
- package/es/lib/hooks/usePrevNextPagination.js +17 -19
- package/es/lib/hooks/useQIndex.js +11 -14
- package/es/lib/hooks/useRefdata.js +3 -3
- package/es/lib/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js +9 -13
- package/es/lib/hooks/useTemplates.js +4 -4
- package/es/lib/utils/buildUrl.js +2 -3
- 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 +4 -5
- package/es/lib/utils/filterParsers/parseKiwtQueryString.js +1 -1
- package/es/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.js +94 -107
- package/es/lib/utils/groupCustomPropertiesByCtx.js +5 -9
- package/es/lib/utils/index.js +34 -13
- package/es/lib/utils/matchString/index.js +13 -0
- package/es/lib/utils/{matchString.js → matchString/matchString.js} +8 -9
- package/es/lib/utils/matchString/matchString.test.js +40 -0
- package/es/lib/utils/parseErrorResponse.js +3 -7
- package/es/lib/utils/selectorSafe.js +2 -3
- package/es/lib/utils/sortByLabel.js +2 -3
- package/es/lib/utils/stringStyling/boldString.js +30 -0
- package/es/lib/utils/stringStyling/boldString.test.js +47 -0
- package/es/lib/utils/stringStyling/highlightString.js +30 -0
- package/es/lib/utils/stringStyling/highlightString.test.js +51 -0
- package/es/lib/utils/stringStyling/index.js +20 -0
- package/es/lib/validators/validators.js +6 -9
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/ButtonTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useOperators.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/CycleButton.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/FieldLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.js.html +1 -1
- package/src/artifacts/coverage-jest/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 +15 -15
- 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 +96 -9
- package/src/artifacts/coverage-jest/Settings/Settings/index.html +14 -14
- package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/useAppSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +13 -13
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +105 -69
- package/src/artifacts/coverage-jest/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.js.html +11 -2
- 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 +1 -1
- package/src/artifacts/coverage-jest/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/cobertura-coverage.xml +371 -334
- 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 +63 -33
- 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/index.html +9 -39
- package/src/artifacts/coverage-jest/utils/index.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/matchString/index.html +131 -0
- package/src/artifacts/coverage-jest/utils/matchString/index.js.html +88 -0
- package/src/artifacts/coverage-jest/utils/{matchString.js.html → matchString/matchString.js.html} +82 -55
- 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/stringStyling/boldString.js.html +190 -0
- package/src/artifacts/coverage-jest/utils/stringStyling/highlightString.js.html +190 -0
- package/src/artifacts/coverage-jest/utils/stringStyling/index.html +146 -0
- package/src/artifacts/coverage-jest/utils/stringStyling/index.js.html +91 -0
- 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/Settings/Settings/Settings.js +30 -1
- package/src/lib/Settings/hooks/useSettings/README.md +49 -19
- package/src/lib/Settings/hooks/useSettings/useSettings.js +60 -48
- package/src/lib/Settings/index.js +3 -0
- package/src/lib/utils/index.js +1 -1
- package/src/lib/utils/matchString/index.js +1 -0
- package/src/lib/utils/matchString/matchString.js +44 -0
- package/src/lib/utils/matchString/matchString.test.js +68 -0
- package/src/lib/utils/stringStyling/boldString.js +35 -0
- package/src/lib/utils/stringStyling/boldString.test.js +59 -0
- package/src/lib/utils/stringStyling/highlightString.js +35 -0
- package/src/lib/utils/stringStyling/highlightString.test.js +67 -0
- package/src/lib/utils/stringStyling/index.js +2 -0
- package/styles/stringMatchStyles.css +3 -0
- package/es/lib/utils/highlightString.js +0 -45
- package/src/artifacts/coverage-jest/utils/highlightString.js.html +0 -259
- package/src/lib/utils/highlightString.js +0 -58
- package/src/lib/utils/matchString.js +0 -35
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [5.33.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.33.0...v5.33.1) (2026-03-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Issue with highlighted/bold strings ([9d2451e](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/9d2451edc6fcea947b4e57fc468a88feee4f26ff))
|
|
7
|
+
|
|
8
|
+
# [5.33.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.32.0...v5.33.0) (2026-03-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **Settings:** Settings now includes the ability to turn off contextPerPage. ([73df695](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/73df6953d616cd5f5a6900157d2b5f252e5f63c4))
|
|
14
|
+
|
|
1
15
|
# [5.32.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.31.4...v5.32.0) (2026-02-17)
|
|
2
16
|
|
|
3
17
|
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2018-
|
|
189
|
+
Copyright 2018-2026 Knowledge Integration Ltd
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var _mocks = require("@folio/stripes-erm-testing/jest/mocks");
|
|
4
4
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
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; }
|
|
6
|
-
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; }
|
|
7
|
-
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; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
5
|
jest.mock('@folio/stripes-components/lib/Icon', () => _mocks.mockStripesIcon);
|
|
11
|
-
module.exports =
|
|
6
|
+
module.exports = {
|
|
7
|
+
...jest.requireActual('@folio/stripes/components'),
|
|
12
8
|
Icon: _mocks.mockStripesIcon,
|
|
13
9
|
LoadingView: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
14
10
|
children: "LoadingView"
|
|
@@ -16,4 +12,4 @@ module.exports = _objectSpread(_objectSpread({}, jest.requireActual('@folio/stri
|
|
|
16
12
|
LoadingPane: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
17
13
|
children: "LoadingPane"
|
|
18
14
|
})
|
|
19
|
-
}
|
|
15
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _mocks = require("@folio/stripes-erm-testing/jest/mocks");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
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
|
-
module.exports = _objectSpread(_objectSpread({}, jest.requireActual('@folio/stripes-core')), _mocks.mockStripesCore);
|
|
4
|
+
module.exports = {
|
|
5
|
+
...jest.requireActual('@folio/stripes-core'),
|
|
6
|
+
..._mocks.mockStripesCore
|
|
7
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _mocks = require("@folio/stripes-erm-testing/jest/mocks");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
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
|
-
module.exports = _objectSpread(_objectSpread({}, jest.requireActual('@folio/stripes/smart-components')), _mocks.mockStripesSmartComponents);
|
|
4
|
+
module.exports = {
|
|
5
|
+
...jest.requireActual('@folio/stripes/smart-components'),
|
|
6
|
+
..._mocks.mockStripesSmartComponents
|
|
7
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _mocks = require("@folio/stripes-erm-testing/jest/mocks");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
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
|
-
module.exports = _objectSpread(_objectSpread({}, jest.requireActual('react-query')), _mocks.mockReactQuery);
|
|
4
|
+
module.exports = {
|
|
5
|
+
...jest.requireActual('react-query'),
|
|
6
|
+
..._mocks.mockReactQuery
|
|
7
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _mocks = require("@folio/stripes-erm-testing/jest/mocks");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
// FIXME currently since erm-testing exports TestForm using stripes-components, we have an issue
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
...jest.requireActual('react-router-dom'),
|
|
8
|
+
..._mocks.mockReactRouterDom
|
|
9
|
+
};
|
|
@@ -11,16 +11,8 @@ var _reactFinalFormArrays = require("react-final-form-arrays");
|
|
|
11
11
|
var _finalFormArrays = _interopRequireDefault(require("final-form-arrays"));
|
|
12
12
|
var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArray"));
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
const _excluded = ["actionAssigner", "columnMapping", "contentData", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fieldComponents", "hideActionsColumn", "hideCreateButton", "intlKey", "intlNS", "label", "labelOverrides", "validateFields", "visibleFields"];
|
|
15
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
|
-
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; }
|
|
20
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
21
|
-
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); }
|
|
22
|
-
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; }
|
|
23
|
-
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; }
|
|
24
16
|
const propTypes = {
|
|
25
17
|
actionAssigner: _propTypes.default.func,
|
|
26
18
|
columnMapping: _propTypes.default.object,
|
|
@@ -41,28 +33,28 @@ const propTypes = {
|
|
|
41
33
|
};
|
|
42
34
|
const ActionList = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
43
35
|
let {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
36
|
+
actionAssigner,
|
|
37
|
+
columnMapping,
|
|
38
|
+
contentData,
|
|
39
|
+
creatableFields = {},
|
|
40
|
+
createCallback,
|
|
41
|
+
defaultNewObject = {},
|
|
42
|
+
editableFields = {},
|
|
43
|
+
fieldComponents = {},
|
|
44
|
+
hideActionsColumn = false,
|
|
45
|
+
hideCreateButton,
|
|
46
|
+
intlKey: passedIntlKey,
|
|
47
|
+
intlNS: passedIntlNS,
|
|
48
|
+
label,
|
|
49
|
+
labelOverrides = {},
|
|
50
|
+
validateFields,
|
|
51
|
+
visibleFields,
|
|
52
|
+
...mclProps // Assume anything left over is to directly apply to the MCL
|
|
53
|
+
} = _ref;
|
|
54
|
+
const ActionListFieldArrayWithRef = alfaProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionListFieldArray.default, {
|
|
55
|
+
ref: ref,
|
|
56
|
+
...alfaProps
|
|
57
|
+
});
|
|
66
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
67
59
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, {
|
|
68
60
|
enableReinitialize: true,
|
|
@@ -82,7 +74,7 @@ const ActionList = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
82
74
|
onSubmit: e => {
|
|
83
75
|
e.preventDefault();
|
|
84
76
|
},
|
|
85
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray,
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, {
|
|
86
78
|
actionAssigner: actionAssigner,
|
|
87
79
|
columnMapping: columnMapping,
|
|
88
80
|
component: ActionListFieldArrayWithRef,
|
|
@@ -100,8 +92,9 @@ const ActionList = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
100
92
|
name: "contentData",
|
|
101
93
|
triggerFormSubmit: handleSubmit,
|
|
102
94
|
validateFields: validateFields,
|
|
103
|
-
visibleFields: visibleFields
|
|
104
|
-
|
|
95
|
+
visibleFields: visibleFields,
|
|
96
|
+
...mclProps
|
|
97
|
+
})
|
|
105
98
|
});
|
|
106
99
|
}
|
|
107
100
|
})
|
|
@@ -13,22 +13,8 @@ var _components = require("@folio/stripes/components");
|
|
|
13
13
|
var _hooks = require("../hooks");
|
|
14
14
|
var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/ActionListFieldArray.css"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["action"],
|
|
17
|
-
_excluded2 = ["actionAssigner", "columnMapping", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fields", "fieldComponents", "hideActionsColumn", "hideCreateButton", "intlKey", "intlNS", "label", "labelOverrides", "onRowClick", "validateFields", "visibleFields", "triggerFormSubmit"],
|
|
18
|
-
_excluded3 = ["actionListActions", "fieldName", "fieldIndex", "_isNewActionListRow"],
|
|
19
|
-
_excluded4 = ["actionListActions", "fieldName", "fieldIndex", "_isNewActionListRow"],
|
|
20
|
-
_excluded5 = ["actionListActions"],
|
|
21
|
-
_excluded6 = ["formatter"],
|
|
22
|
-
_excluded7 = ["actionListActions"];
|
|
23
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
25
|
-
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; }
|
|
26
|
-
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; }
|
|
27
|
-
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; }
|
|
28
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
29
|
-
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); }
|
|
30
|
-
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; }
|
|
31
|
-
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; }
|
|
32
18
|
const EDITING_ACTIONS_WIDTH = 25;
|
|
33
19
|
const NON_EDITING_ACTIONS_WIDTH = 20;
|
|
34
20
|
const TOTAL_WIDTH = 100;
|
|
@@ -56,23 +42,23 @@ const propTypes = {
|
|
|
56
42
|
|
|
57
43
|
// This needs to be outside of the main component for forwardRef to work properly it seems.
|
|
58
44
|
const ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
59
|
-
var _action$label;
|
|
60
45
|
let {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
action,
|
|
47
|
+
...actionTriggerProps
|
|
48
|
+
} = _ref;
|
|
64
49
|
if (action.icon) {
|
|
65
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton,
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
66
51
|
ref: ref,
|
|
67
|
-
icon: action.icon
|
|
68
|
-
|
|
52
|
+
icon: action.icon,
|
|
53
|
+
...actionTriggerProps
|
|
54
|
+
});
|
|
69
55
|
}
|
|
70
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button,
|
|
56
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
71
57
|
ref: ref,
|
|
72
|
-
marginBottom0: true
|
|
73
|
-
|
|
74
|
-
children:
|
|
75
|
-
})
|
|
58
|
+
marginBottom0: true,
|
|
59
|
+
...actionTriggerProps,
|
|
60
|
+
children: action.label ?? action.name
|
|
61
|
+
});
|
|
76
62
|
});
|
|
77
63
|
ActionTrigger.propTypes = {
|
|
78
64
|
action: _propTypes.default.shape({
|
|
@@ -83,29 +69,27 @@ ActionTrigger.propTypes = {
|
|
|
83
69
|
};
|
|
84
70
|
const NEW_ROW = 'NEW_ROW';
|
|
85
71
|
const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
86
|
-
var _fields$value$filter$, _fields$value;
|
|
87
72
|
let {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
mclProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
73
|
+
actionAssigner,
|
|
74
|
+
columnMapping,
|
|
75
|
+
creatableFields,
|
|
76
|
+
createCallback,
|
|
77
|
+
defaultNewObject,
|
|
78
|
+
editableFields,
|
|
79
|
+
fields,
|
|
80
|
+
fieldComponents,
|
|
81
|
+
hideActionsColumn = false,
|
|
82
|
+
hideCreateButton = false,
|
|
83
|
+
intlKey: passedIntlKey,
|
|
84
|
+
intlNS: passedIntlNS,
|
|
85
|
+
label,
|
|
86
|
+
labelOverrides = {},
|
|
87
|
+
onRowClick,
|
|
88
|
+
validateFields,
|
|
89
|
+
visibleFields,
|
|
90
|
+
triggerFormSubmit,
|
|
91
|
+
...mclProps // Assume anything left over is to directly apply to the MCL
|
|
92
|
+
} = _ref2;
|
|
109
93
|
// Grab finalForm functions/values from form hooks
|
|
110
94
|
const {
|
|
111
95
|
change
|
|
@@ -123,7 +107,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
123
107
|
null for no field, string id if we are editing an existing field and
|
|
124
108
|
'NEW_ROW' for a new row
|
|
125
109
|
*/
|
|
126
|
-
const [editing, setEditing] = (0, _react.useState)((
|
|
110
|
+
const [editing, setEditing] = (0, _react.useState)((fields?.value?.filter(f => f._isNewActionListRow)?.length ?? 0) > 0 ? NEW_ROW : undefined);
|
|
127
111
|
const toggleEditing = (0, _react.useCallback)(id => {
|
|
128
112
|
if (editing) {
|
|
129
113
|
setEditing();
|
|
@@ -134,46 +118,43 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
134
118
|
|
|
135
119
|
// Ensure editing doesn't get stuck in "NEW_ROW" state;
|
|
136
120
|
(0, _react.useEffect)(() => {
|
|
137
|
-
|
|
138
|
-
if (editing === NEW_ROW && ((_fields$value$filter$2 = fields === null || fields === void 0 || (_fields$value2 = fields.value) === null || _fields$value2 === void 0 || (_fields$value2 = _fields$value2.filter(f => f._isNewActionListRow)) === null || _fields$value2 === void 0 ? void 0 : _fields$value2.length) !== null && _fields$value$filter$2 !== void 0 ? _fields$value$filter$2 : 0) === 0) {
|
|
121
|
+
if (editing === NEW_ROW && (fields?.value?.filter(f => f._isNewActionListRow)?.length ?? 0) === 0) {
|
|
139
122
|
setEditing();
|
|
140
123
|
}
|
|
141
|
-
}, [editing, fields
|
|
124
|
+
}, [editing, fields?.value]);
|
|
142
125
|
const handleSave = index => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
} = _fields$value$index,
|
|
151
|
-
rowData = _objectWithoutProperties(_fields$value$index, _excluded3);
|
|
126
|
+
const {
|
|
127
|
+
actionListActions: _a,
|
|
128
|
+
fieldName: _fn,
|
|
129
|
+
fieldIndex: _fi,
|
|
130
|
+
_isNewActionListRow: _inalr,
|
|
131
|
+
...rowData
|
|
132
|
+
} = fields.value[index];
|
|
152
133
|
|
|
153
134
|
// Find "edit" entry in actionAssigner
|
|
154
|
-
const editCallback =
|
|
135
|
+
const editCallback = actionAssigner(rowData)?.find(act => act.name === 'edit')?.callback;
|
|
155
136
|
if (editCallback) {
|
|
156
137
|
editCallback(rowData);
|
|
157
138
|
}
|
|
158
139
|
};
|
|
159
140
|
const handleCreate = index => {
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
rowData = _objectWithoutProperties(_fields$value$index2, _excluded4);
|
|
141
|
+
const {
|
|
142
|
+
actionListActions: _a,
|
|
143
|
+
fieldName: _fn,
|
|
144
|
+
fieldIndex: _fi,
|
|
145
|
+
_isNewActionListRow: _inalr,
|
|
146
|
+
...rowData
|
|
147
|
+
} = fields.value[index];
|
|
168
148
|
if (createCallback) {
|
|
169
149
|
createCallback(rowData);
|
|
170
150
|
}
|
|
171
151
|
};
|
|
172
152
|
const handleClickCreate = (0, _react.useCallback)(() => {
|
|
173
153
|
toggleEditing(NEW_ROW);
|
|
174
|
-
fields.unshift(
|
|
154
|
+
fields.unshift({
|
|
155
|
+
...defaultNewObject,
|
|
175
156
|
_isNewActionListRow: true
|
|
176
|
-
})
|
|
157
|
+
});
|
|
177
158
|
}, [defaultNewObject, fields, toggleEditing]);
|
|
178
159
|
|
|
179
160
|
// Way to go into create mode from external component, and way to tell internal editing state
|
|
@@ -187,22 +168,22 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
187
168
|
const widthsObject = {};
|
|
188
169
|
visibleFields.forEach(f => {
|
|
189
170
|
if (f !== 'actionListActions') {
|
|
190
|
-
widthsObject[f] =
|
|
171
|
+
widthsObject[f] = `${staticWidth}%`;
|
|
191
172
|
}
|
|
192
173
|
});
|
|
193
|
-
widthsObject.actionListActions = editing ?
|
|
174
|
+
widthsObject.actionListActions = editing ? `${EDITING_ACTIONS_WIDTH}%` : `${NON_EDITING_ACTIONS_WIDTH}%`;
|
|
194
175
|
return widthsObject;
|
|
195
176
|
};
|
|
196
177
|
const renderActionButtons = data => {
|
|
197
|
-
const fieldName =
|
|
178
|
+
const fieldName = `contentData[${data.rowIndex}]`;
|
|
198
179
|
const {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
180
|
+
actionListActions: actions,
|
|
181
|
+
...rest
|
|
182
|
+
} = data;
|
|
202
183
|
if (data.id === editing || !data.id && editing === NEW_ROW) {
|
|
203
184
|
// Render the save/cancel buttons
|
|
204
185
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
205
|
-
id:
|
|
186
|
+
id: `action-button-parent-${data.rowIndex + 1}`,
|
|
206
187
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
207
188
|
buttonStyle: "primary",
|
|
208
189
|
disabled: hasValidationErrors || submitting || pristine,
|
|
@@ -222,9 +203,9 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
222
203
|
type: "submit",
|
|
223
204
|
children: kintIntl.formatKintMessage({
|
|
224
205
|
id: 'save',
|
|
225
|
-
overrideValue: labelOverrides
|
|
206
|
+
overrideValue: labelOverrides?.save
|
|
226
207
|
})
|
|
227
|
-
},
|
|
208
|
+
}, `save[${data.rowIndex}]`), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
228
209
|
"data-type-button": "cancel",
|
|
229
210
|
marginBottom0: true,
|
|
230
211
|
onClick: () => {
|
|
@@ -238,14 +219,14 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
238
219
|
},
|
|
239
220
|
children: kintIntl.formatKintMessage({
|
|
240
221
|
id: 'cancel',
|
|
241
|
-
overrideValue: labelOverrides
|
|
222
|
+
overrideValue: labelOverrides?.cancel
|
|
242
223
|
})
|
|
243
|
-
},
|
|
224
|
+
}, `cancel[${data.rowIndex}]`)]
|
|
244
225
|
});
|
|
245
226
|
}
|
|
246
227
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
247
|
-
id:
|
|
248
|
-
children: actions
|
|
228
|
+
id: `action-button-parent-${data.rowIndex + 1}`,
|
|
229
|
+
children: actions?.map(action => {
|
|
249
230
|
let actionFunction;
|
|
250
231
|
if (action.callback) {
|
|
251
232
|
actionFunction = () => action.callback(rest);
|
|
@@ -255,25 +236,25 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
255
236
|
if (action.name === 'edit') {
|
|
256
237
|
actionFunction = () => toggleEditing(data.id);
|
|
257
238
|
}
|
|
258
|
-
let ariaLabel =
|
|
259
|
-
if (action
|
|
239
|
+
let ariaLabel = `action-${action.name}[${data.rowIndex}]`;
|
|
240
|
+
if (action?.ariaLabel) {
|
|
260
241
|
if (typeof action.ariaLabel === 'function') {
|
|
261
242
|
ariaLabel = action.ariaLabel(data);
|
|
262
243
|
} else if (typeof action.ariaLabel === 'string') {
|
|
263
244
|
ariaLabel = action.ariaLabel;
|
|
264
245
|
} else {
|
|
265
|
-
throw new Error(
|
|
246
|
+
throw new Error(`Provided ariaLabel for action "${action.name}" must be a function or a string.`);
|
|
266
247
|
}
|
|
267
248
|
}
|
|
268
249
|
let tooltip;
|
|
269
250
|
let tooltipSub;
|
|
270
|
-
if (action
|
|
251
|
+
if (action?.tooltip) {
|
|
271
252
|
if (typeof action.tooltip === 'function') {
|
|
272
253
|
tooltip = action.tooltip(data);
|
|
273
254
|
} else {
|
|
274
255
|
tooltip = action.tooltip;
|
|
275
256
|
}
|
|
276
|
-
if (action
|
|
257
|
+
if (action?.tooltipSub) {
|
|
277
258
|
if (typeof action.tooltipSub === 'function') {
|
|
278
259
|
tooltipSub = action.tooltipSub(data);
|
|
279
260
|
} else {
|
|
@@ -285,7 +266,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
285
266
|
// If a tooltip is declared, render that around the actionButton
|
|
286
267
|
if (tooltip) {
|
|
287
268
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
288
|
-
id:
|
|
269
|
+
id: `action-${action.name}[${data.rowIndex}]-tooltip`,
|
|
289
270
|
sub: tooltipSub,
|
|
290
271
|
text: tooltip,
|
|
291
272
|
children: _ref3 => {
|
|
@@ -307,7 +288,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
307
288
|
return null;
|
|
308
289
|
},
|
|
309
290
|
to: action.to
|
|
310
|
-
},
|
|
291
|
+
}, `action-${action.name}[${data.rowIndex}]`);
|
|
311
292
|
}
|
|
312
293
|
});
|
|
313
294
|
}
|
|
@@ -325,7 +306,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
325
306
|
return null;
|
|
326
307
|
},
|
|
327
308
|
to: action.to
|
|
328
|
-
},
|
|
309
|
+
}, `action-${action.name}[${data.rowIndex}]`);
|
|
329
310
|
})
|
|
330
311
|
});
|
|
331
312
|
};
|
|
@@ -334,16 +315,17 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
334
315
|
// Fetch the content from the field Values
|
|
335
316
|
const cd = (0, _cloneDeep.default)((0, _get.default)(values, fieldName));
|
|
336
317
|
cd.actionListActions = actionAssigner(cd);
|
|
337
|
-
return
|
|
318
|
+
return {
|
|
319
|
+
...cd,
|
|
338
320
|
fieldName,
|
|
339
321
|
fieldIndex
|
|
340
|
-
}
|
|
322
|
+
};
|
|
341
323
|
});
|
|
342
324
|
};
|
|
343
325
|
const {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
326
|
+
formatter,
|
|
327
|
+
...restOfMclProps
|
|
328
|
+
} = mclProps; // Destructure formatter part of mclProps
|
|
347
329
|
|
|
348
330
|
const fieldAwareFormatter = () => {
|
|
349
331
|
const returnObj = {};
|
|
@@ -357,17 +339,16 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
357
339
|
const editingRow = cd.id === editing || !cd.id;
|
|
358
340
|
|
|
359
341
|
// Default to the passed formatter values
|
|
360
|
-
let returnValue = formatter
|
|
342
|
+
let returnValue = formatter?.[key] ? formatter[key](cd) : cd[key];
|
|
361
343
|
|
|
362
344
|
// If editing, replace values with fields
|
|
363
345
|
if (editingRow) {
|
|
364
|
-
var _editableFields$key, _creatableFields$key;
|
|
365
346
|
/*
|
|
366
347
|
Check if the property is a visible field.
|
|
367
348
|
If it is not then we don't allow editing in this component.
|
|
368
349
|
*/
|
|
369
|
-
const editFunction =
|
|
370
|
-
const createFunction =
|
|
350
|
+
const editFunction = editableFields[key] ?? (() => true);
|
|
351
|
+
const createFunction = creatableFields[key] ?? (() => true);
|
|
371
352
|
/*
|
|
372
353
|
Next check if this is a new row, if so we should run the createableField function with the data.
|
|
373
354
|
If it is not a new row, then we run the editableField function with the data,
|
|
@@ -378,12 +359,12 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
378
359
|
if (!cd.id && createFunction(cd) || !!cd.id && editFunction(cd)) {
|
|
379
360
|
const passedObject = {
|
|
380
361
|
allValues: values,
|
|
381
|
-
index: cd
|
|
362
|
+
index: cd?.fieldIndex,
|
|
382
363
|
key,
|
|
383
|
-
name:
|
|
364
|
+
name: `${cd.fieldName}.${key}`,
|
|
384
365
|
rowFieldName: cd.fieldName
|
|
385
366
|
};
|
|
386
|
-
const validateFunction = validateFields
|
|
367
|
+
const validateFunction = validateFields?.[key] ? validateFields?.[key](passedObject) : null;
|
|
387
368
|
returnValue = fieldComponents[key] ? fieldComponents[key](passedObject) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
388
369
|
ariaLabel: key // TODO at the moment the only way to override this is passing in an entire fieldComponent.
|
|
389
370
|
,
|
|
@@ -391,7 +372,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
391
372
|
,
|
|
392
373
|
component: _components.TextField,
|
|
393
374
|
marginBottom0: true,
|
|
394
|
-
name:
|
|
375
|
+
name: `${cd.fieldName}.${key}`,
|
|
395
376
|
parse: v => v,
|
|
396
377
|
validate: validateFunction
|
|
397
378
|
});
|
|
@@ -415,35 +396,38 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
415
396
|
onClick: handleClickCreate,
|
|
416
397
|
children: kintIntl.formatKintMessage({
|
|
417
398
|
id: 'new',
|
|
418
|
-
overrideValue: labelOverrides
|
|
399
|
+
overrideValue: labelOverrides?.new
|
|
419
400
|
})
|
|
420
401
|
})]
|
|
421
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList,
|
|
422
|
-
columnMapping:
|
|
402
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, {
|
|
403
|
+
columnMapping: {
|
|
404
|
+
...columnMapping,
|
|
423
405
|
actionListActions: kintIntl.formatKintMessage({
|
|
424
406
|
id: 'actions',
|
|
425
|
-
overrideValue: labelOverrides
|
|
407
|
+
overrideValue: labelOverrides?.actions
|
|
426
408
|
})
|
|
427
|
-
}
|
|
409
|
+
},
|
|
428
410
|
columnWidths: getColumnWidths(),
|
|
429
411
|
contentData: assignActions(),
|
|
430
|
-
formatter:
|
|
431
|
-
actionListActions: renderActionButtons
|
|
432
|
-
|
|
412
|
+
formatter: {
|
|
413
|
+
actionListActions: renderActionButtons,
|
|
414
|
+
...fieldAwareFormatter()
|
|
415
|
+
},
|
|
433
416
|
interactive: !!onRowClick,
|
|
434
417
|
onRowClick: onRowClick ? (e, row) => {
|
|
435
418
|
// Make sure we ONLY fire row click from row, and not from action buttons.
|
|
436
419
|
const targetIsAction = e.target.closest('[id^=action-button-parent]') !== null;
|
|
437
420
|
if (!targetIsAction) {
|
|
438
421
|
const {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
422
|
+
actionListActions: _ala,
|
|
423
|
+
...rowWithoutActions
|
|
424
|
+
} = row;
|
|
442
425
|
onRowClick(e, rowWithoutActions);
|
|
443
426
|
}
|
|
444
427
|
} : null,
|
|
445
|
-
visibleColumns: !hideActionsColumn || !!editing ? [...visibleFields, 'actionListActions'] : visibleFields
|
|
446
|
-
|
|
428
|
+
visibleColumns: !hideActionsColumn || !!editing ? [...visibleFields, 'actionListActions'] : visibleFields,
|
|
429
|
+
...restOfMclProps
|
|
430
|
+
})]
|
|
447
431
|
});
|
|
448
432
|
});
|
|
449
433
|
ActionListFieldArray.propTypes = propTypes;
|