@k-int/stripes-kint-components 5.36.1 → 5.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +23 -8
- package/es/__mocks__/@folio/stripes/components.js +7 -3
- package/es/__mocks__/@folio/stripes/core.js +6 -4
- package/es/__mocks__/@folio/stripes/smart-components.js +6 -4
- package/es/__mocks__/react-query.js +6 -4
- package/es/__mocks__/react-router-dom.js +6 -6
- package/es/lib/ActionList/ActionList.js +38 -30
- package/es/lib/ActionList/ActionListFieldArray.js +131 -122
- package/es/lib/ButtonTypedown/ButtonTypedown.js +39 -41
- package/es/lib/ComboButton/ComboButton.js +66 -57
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +62 -46
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +4 -6
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +153 -135
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +4 -6
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +83 -81
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +32 -40
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +39 -39
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +10 -10
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +2 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +24 -26
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +2 -3
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +62 -49
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +4 -6
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +75 -79
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +30 -35
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +19 -22
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +7 -10
- package/es/lib/CustomProperties/Edit/testResources.js +12 -11
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +67 -51
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +2 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +62 -47
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +4 -7
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +16 -24
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +2 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +17 -16
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +10 -7
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +35 -35
- package/es/lib/CustomProperties/Filter/testResources.js +2 -1
- package/es/lib/CustomProperties/Filter/useOperators.js +6 -8
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +12 -2
- package/es/lib/CustomProperties/Filter/useValueProps.js +6 -8
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +10 -10
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +2 -3
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +67 -52
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +8 -6
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +20 -16
- package/es/lib/CycleButton/CycleButton.js +28 -14
- package/es/lib/FieldLabel/FieldLabel.js +5 -9
- package/es/lib/Files/FileUploader/FileUploader.js +41 -40
- package/es/lib/Files/FileView/FileView.js +11 -14
- package/es/lib/Files/useFileHandlers.js +63 -68
- package/es/lib/FormModal/FormModal.js +38 -38
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +29 -24
- package/es/lib/IconSelect/IconSelect.js +60 -44
- package/es/lib/NoResultsMessage/NoResultsMessage.js +31 -31
- package/es/lib/NumberField/NumberField.js +39 -19
- package/es/lib/NumberField/NumberField.test.js +19 -10
- package/es/lib/QueryTypedown/QueryTypedown.js +34 -12
- package/es/lib/RefdataButtons/RefdataButtons.js +14 -14
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +75 -68
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +30 -16
- package/es/lib/RichSelect/RichSelect.js +74 -58
- package/es/lib/RichSelect/useSelectedOption.js +12 -2
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +195 -188
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +81 -95
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +68 -48
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +37 -34
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +4 -5
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +1 -3
- package/es/lib/SASQRoute/SASQRoute.js +34 -29
- package/es/lib/SASQRoute/SASQRoute.test.js +34 -42
- package/es/lib/SASQViewComponent/SASQViewComponent.js +69 -66
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +13 -12
- package/es/lib/SearchField/SearchField.js +12 -8
- package/es/lib/SearchKeyControl/SearchKeyControl.js +46 -31
- package/es/lib/SearchKeyControl/SearchKeyControl.test.js +6 -2
- package/es/lib/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js +124 -103
- package/es/lib/Settings/EditableRefdataList/EditableRefdataList.js +120 -107
- package/es/lib/Settings/EditableSettingsList/EditableSettingsList.js +12 -16
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +45 -31
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.test.js +6 -9
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +20 -14
- package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.test.js +32 -48
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +19 -19
- package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.test.js +24 -36
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +48 -45
- package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +9 -12
- package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +50 -38
- package/es/lib/Settings/SettingPage/SettingPage.js +17 -19
- package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +6 -8
- package/es/lib/Settings/Settings/Settings.js +33 -42
- package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +47 -45
- package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +7 -5
- package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +21 -19
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js +13 -17
- package/es/lib/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js +6 -10
- package/es/lib/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js +20 -20
- package/es/lib/Settings/hooks/useAppSettings/useAppSettings.js +18 -15
- package/es/lib/Settings/hooks/useSettingSection/useSettingSection.js +27 -26
- package/es/lib/Settings/hooks/useSettings/useSettings.js +95 -99
- package/es/lib/Tags/Tags.js +37 -38
- package/es/lib/Tags/Tags.test.js +12 -18
- package/es/lib/Tags/hooks/useTags.js +1 -1
- package/es/lib/Tags/hooks/useTagsEnabled.js +13 -14
- package/es/lib/Tags/tagsConfig.js +1 -1
- package/es/lib/Typedown/Typedown.js +128 -78
- package/es/lib/hooks/__mocks__/index.js +7 -3
- package/es/lib/hooks/__mocks__/useMutateGeneric.js +22 -0
- package/es/lib/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js +24 -20
- package/es/lib/hooks/intlHooks/useKintIntl/useKintIntl.js +33 -25
- package/es/lib/hooks/typedownHooks/useTypedown.js +55 -37
- package/es/lib/hooks/typedownHooks/useTypedownData.js +15 -7
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +15 -7
- package/es/lib/hooks/useActionListRef.js +11 -2
- package/es/lib/hooks/useActiveElement.js +11 -2
- package/es/lib/hooks/useCustProps.js +45 -37
- package/es/lib/hooks/useCustomProperties.js +21 -18
- package/es/lib/hooks/useHelperApp.js +33 -15
- package/es/lib/hooks/useKiwtFieldArray.js +22 -14
- package/es/lib/hooks/useKiwtSASQuery.js +37 -28
- package/es/lib/hooks/useLocalPageStore.js +10 -7
- package/es/lib/hooks/useLocalStorageState.js +13 -2
- package/es/lib/hooks/useModConfigEntries.js +12 -15
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.js +16 -11
- package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.test.js +51 -0
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.js +70 -48
- package/es/lib/hooks/useMutateGeneric/useMutateGeneric.test.js +192 -0
- package/es/lib/hooks/useMutateModConfigEntry.js +5 -7
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js +23 -16
- package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.test.js +69 -0
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.js +25 -17
- package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.test.js +95 -0
- package/es/lib/hooks/useMutateTemplates/useMutateTemplates.js +21 -13
- package/es/lib/hooks/useMutateTemplates/useMutateTemplates.test.js +34 -0
- package/es/lib/hooks/useParallelBatchFetch.js +61 -38
- package/es/lib/hooks/usePrevNextPagination.js +46 -32
- package/es/lib/hooks/useQIndex.js +23 -11
- package/es/lib/hooks/useRefdata.js +11 -13
- package/es/lib/hooks/useSASQQueryMeta.js +2 -3
- package/es/lib/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js +18 -19
- package/es/lib/hooks/useTemplates.js +9 -12
- package/es/lib/utils/buildUrl.js +3 -2
- package/es/lib/utils/downloadBlob.js +12 -8
- package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
- package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +2 -2
- package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +5 -4
- package/es/lib/utils/filterParsers/parseKiwtQueryString.js +1 -1
- package/es/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.js +78 -102
- package/es/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.test.js +322 -29
- package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -5
- package/es/lib/utils/matchString/matchString.js +7 -5
- package/es/lib/utils/matchString/matchString.test.js +26 -7
- package/es/lib/utils/modConfigEntriesQueryKey.js +4 -5
- package/es/lib/utils/parseErrorResponse.js +18 -8
- package/es/lib/utils/selectorSafe.js +3 -2
- package/es/lib/utils/sortByLabel.js +3 -2
- package/es/lib/utils/stringStyling/boldString.js +13 -4
- package/es/lib/utils/stringStyling/boldString.test.js +4 -5
- package/es/lib/utils/stringStyling/highlightString.js +13 -4
- package/es/lib/utils/stringStyling/highlightString.test.js +4 -5
- package/es/lib/validators/validators.js +8 -7
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/ButtonTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useOperators.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/CycleButton.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/FieldLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/FileUploader.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileUploader/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/FileView.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/FileView/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/index.html +1 -1
- package/src/artifacts/coverage-jest/Files/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Files/useFileHandlers.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/FormModal.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/IconSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/NumberField.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/QueryTypedown.js.html +24 -9
- package/src/artifacts/coverage-jest/QueryTypedown/index.html +13 -13
- package/src/artifacts/coverage-jest/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/useSelectedOption.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +30 -30
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/SearchKeyControl.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsList.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/Settings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/useAppSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/Tags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/tagsConfig.js.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +136 -7
- package/src/artifacts/coverage-jest/Typedown/index.html +3 -3
- package/src/artifacts/coverage-jest/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/cobertura-coverage.xml +513 -507
- package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/endpoints.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/constants/pagination.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/useIntlKey.js.html +7 -7
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/useKintIntl.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustProps.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/useInvalidateRefdata.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +9 -9
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +5 -5
- package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.html +17 -17
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +16 -16
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +93 -93
- package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +40 -40
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.js.html +44 -44
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/index.html +21 -21
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateTemplates/useMutateTemplates.js.html +38 -38
- package/src/artifacts/coverage-jest/hooks/useParallelBatchFetch.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +20 -20
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +8 -8
- package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/index.html +83 -83
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/downloadBlob.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/filterParsers/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryFilters.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +5 -5
- package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +7 -7
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +125 -125
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +21 -21
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/index.html +5 -5
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/refdataQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/boldString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/highlightString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/stringStyling/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/stringStyling/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/validators/index.html +1 -1
- package/src/artifacts/coverage-jest/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/validators/validators.js.html +1 -1
- package/src/lib/QueryTypedown/QueryTypedown.js +7 -2
- package/src/lib/QueryTypedown/README.md +7 -6
- package/src/lib/Typedown/README.md +27 -1
- package/src/lib/Typedown/Typedown.js +47 -4
- package/src/lib/hooks/__mocks__/useMutateGeneric.js +14 -0
- package/src/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.test.js +65 -0
- package/src/lib/hooks/useMutateGeneric/useMutateGeneric.test.js +194 -0
- package/src/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.test.js +76 -0
- package/src/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.test.js +93 -0
- package/src/lib/hooks/useMutateTemplates/useMutateTemplates.test.js +33 -0
- package/src/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.test.js +248 -17
|
@@ -13,8 +13,28 @@ 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"];
|
|
16
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
24
|
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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
26
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
28
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
29
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
30
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
31
|
+
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; }
|
|
32
|
+
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; }
|
|
33
|
+
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; }
|
|
34
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
35
|
+
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); }
|
|
36
|
+
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; }
|
|
37
|
+
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; }
|
|
18
38
|
const EDITING_ACTIONS_WIDTH = 25;
|
|
19
39
|
const NON_EDITING_ACTIONS_WIDTH = 20;
|
|
20
40
|
const TOTAL_WIDTH = 100;
|
|
@@ -42,23 +62,21 @@ const propTypes = {
|
|
|
42
62
|
|
|
43
63
|
// This needs to be outside of the main component for forwardRef to work properly it seems.
|
|
44
64
|
const ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} = _ref;
|
|
65
|
+
var _action$label;
|
|
66
|
+
let action = _ref.action,
|
|
67
|
+
actionTriggerProps = _objectWithoutProperties(_ref, _excluded);
|
|
49
68
|
if (action.icon) {
|
|
50
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, _objectSpread({
|
|
51
70
|
ref: ref,
|
|
52
|
-
icon: action.icon
|
|
53
|
-
|
|
54
|
-
});
|
|
71
|
+
icon: action.icon
|
|
72
|
+
}, actionTriggerProps));
|
|
55
73
|
}
|
|
56
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
74
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, _objectSpread(_objectSpread({
|
|
57
75
|
ref: ref,
|
|
58
|
-
marginBottom0: true
|
|
59
|
-
|
|
60
|
-
children: action.label
|
|
61
|
-
});
|
|
76
|
+
marginBottom0: true
|
|
77
|
+
}, actionTriggerProps), {}, {
|
|
78
|
+
children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
|
|
79
|
+
}));
|
|
62
80
|
});
|
|
63
81
|
ActionTrigger.propTypes = {
|
|
64
82
|
action: _propTypes.default.shape({
|
|
@@ -69,45 +87,48 @@ ActionTrigger.propTypes = {
|
|
|
69
87
|
};
|
|
70
88
|
const NEW_ROW = 'NEW_ROW';
|
|
71
89
|
const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
columnMapping,
|
|
75
|
-
creatableFields,
|
|
76
|
-
createCallback,
|
|
77
|
-
defaultNewObject,
|
|
78
|
-
editableFields,
|
|
79
|
-
fields,
|
|
80
|
-
fieldComponents,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
var _fields$value$filter$, _fields$value;
|
|
91
|
+
let actionAssigner = _ref2.actionAssigner,
|
|
92
|
+
columnMapping = _ref2.columnMapping,
|
|
93
|
+
creatableFields = _ref2.creatableFields,
|
|
94
|
+
createCallback = _ref2.createCallback,
|
|
95
|
+
defaultNewObject = _ref2.defaultNewObject,
|
|
96
|
+
editableFields = _ref2.editableFields,
|
|
97
|
+
fields = _ref2.fields,
|
|
98
|
+
fieldComponents = _ref2.fieldComponents,
|
|
99
|
+
_ref2$hideActionsColu = _ref2.hideActionsColumn,
|
|
100
|
+
hideActionsColumn = _ref2$hideActionsColu === void 0 ? false : _ref2$hideActionsColu,
|
|
101
|
+
_ref2$hideCreateButto = _ref2.hideCreateButton,
|
|
102
|
+
hideCreateButton = _ref2$hideCreateButto === void 0 ? false : _ref2$hideCreateButto,
|
|
103
|
+
passedIntlKey = _ref2.intlKey,
|
|
104
|
+
passedIntlNS = _ref2.intlNS,
|
|
105
|
+
label = _ref2.label,
|
|
106
|
+
_ref2$labelOverrides = _ref2.labelOverrides,
|
|
107
|
+
labelOverrides = _ref2$labelOverrides === void 0 ? {} : _ref2$labelOverrides,
|
|
108
|
+
onRowClick = _ref2.onRowClick,
|
|
109
|
+
validateFields = _ref2.validateFields,
|
|
110
|
+
visibleFields = _ref2.visibleFields,
|
|
111
|
+
triggerFormSubmit = _ref2.triggerFormSubmit,
|
|
112
|
+
mclProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
93
113
|
// Grab finalForm functions/values from form hooks
|
|
94
|
-
const
|
|
95
|
-
change
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
values
|
|
103
|
-
} = (0, _reactFinalForm.useFormState)();
|
|
114
|
+
const _useForm = (0, _reactFinalForm.useForm)(),
|
|
115
|
+
change = _useForm.change;
|
|
116
|
+
const _useFormState = (0, _reactFinalForm.useFormState)(),
|
|
117
|
+
hasValidationErrors = _useFormState.hasValidationErrors,
|
|
118
|
+
initialValues = _useFormState.initialValues,
|
|
119
|
+
pristine = _useFormState.pristine,
|
|
120
|
+
submitting = _useFormState.submitting,
|
|
121
|
+
values = _useFormState.values;
|
|
104
122
|
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
105
123
|
/*
|
|
106
124
|
Keep track of which field we are editing.
|
|
107
125
|
null for no field, string id if we are editing an existing field and
|
|
108
126
|
'NEW_ROW' for a new row
|
|
109
127
|
*/
|
|
110
|
-
const
|
|
128
|
+
const _useState = (0, _react.useState)(((_fields$value$filter$ = fields === null || fields === void 0 || (_fields$value = fields.value) === null || _fields$value === void 0 || (_fields$value = _fields$value.filter(f => f._isNewActionListRow)) === null || _fields$value === void 0 ? void 0 : _fields$value.length) !== null && _fields$value$filter$ !== void 0 ? _fields$value$filter$ : 0) > 0 ? NEW_ROW : undefined),
|
|
129
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
130
|
+
editing = _useState2[0],
|
|
131
|
+
setEditing = _useState2[1];
|
|
111
132
|
const toggleEditing = (0, _react.useCallback)(id => {
|
|
112
133
|
if (editing) {
|
|
113
134
|
setEditing();
|
|
@@ -118,43 +139,42 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
118
139
|
|
|
119
140
|
// Ensure editing doesn't get stuck in "NEW_ROW" state;
|
|
120
141
|
(0, _react.useEffect)(() => {
|
|
121
|
-
|
|
142
|
+
var _fields$value$filter$2, _fields$value2;
|
|
143
|
+
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) {
|
|
122
144
|
setEditing();
|
|
123
145
|
}
|
|
124
|
-
}, [editing, fields
|
|
146
|
+
}, [editing, fields === null || fields === void 0 ? void 0 : fields.value]);
|
|
125
147
|
const handleSave = index => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
148
|
+
var _actionAssigner;
|
|
149
|
+
const _fields$value$index = fields.value[index],
|
|
150
|
+
_a = _fields$value$index.actionListActions,
|
|
151
|
+
_fn = _fields$value$index.fieldName,
|
|
152
|
+
_fi = _fields$value$index.fieldIndex,
|
|
153
|
+
_inalr = _fields$value$index._isNewActionListRow,
|
|
154
|
+
rowData = _objectWithoutProperties(_fields$value$index, _excluded3);
|
|
133
155
|
|
|
134
156
|
// Find "edit" entry in actionAssigner
|
|
135
|
-
const editCallback = actionAssigner(rowData)
|
|
157
|
+
const editCallback = (_actionAssigner = actionAssigner(rowData)) === null || _actionAssigner === void 0 || (_actionAssigner = _actionAssigner.find(act => act.name === 'edit')) === null || _actionAssigner === void 0 ? void 0 : _actionAssigner.callback;
|
|
136
158
|
if (editCallback) {
|
|
137
159
|
editCallback(rowData);
|
|
138
160
|
}
|
|
139
161
|
};
|
|
140
162
|
const handleCreate = index => {
|
|
141
|
-
const
|
|
142
|
-
actionListActions
|
|
143
|
-
fieldName
|
|
144
|
-
fieldIndex
|
|
145
|
-
_isNewActionListRow
|
|
146
|
-
|
|
147
|
-
} = fields.value[index];
|
|
163
|
+
const _fields$value$index2 = fields.value[index],
|
|
164
|
+
_a = _fields$value$index2.actionListActions,
|
|
165
|
+
_fn = _fields$value$index2.fieldName,
|
|
166
|
+
_fi = _fields$value$index2.fieldIndex,
|
|
167
|
+
_inalr = _fields$value$index2._isNewActionListRow,
|
|
168
|
+
rowData = _objectWithoutProperties(_fields$value$index2, _excluded4);
|
|
148
169
|
if (createCallback) {
|
|
149
170
|
createCallback(rowData);
|
|
150
171
|
}
|
|
151
172
|
};
|
|
152
173
|
const handleClickCreate = (0, _react.useCallback)(() => {
|
|
153
174
|
toggleEditing(NEW_ROW);
|
|
154
|
-
fields.unshift({
|
|
155
|
-
...defaultNewObject,
|
|
175
|
+
fields.unshift(_objectSpread(_objectSpread({}, defaultNewObject), {}, {
|
|
156
176
|
_isNewActionListRow: true
|
|
157
|
-
});
|
|
177
|
+
}));
|
|
158
178
|
}, [defaultNewObject, fields, toggleEditing]);
|
|
159
179
|
|
|
160
180
|
// Way to go into create mode from external component, and way to tell internal editing state
|
|
@@ -168,22 +188,20 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
168
188
|
const widthsObject = {};
|
|
169
189
|
visibleFields.forEach(f => {
|
|
170
190
|
if (f !== 'actionListActions') {
|
|
171
|
-
widthsObject[f] =
|
|
191
|
+
widthsObject[f] = "".concat(staticWidth, "%");
|
|
172
192
|
}
|
|
173
193
|
});
|
|
174
|
-
widthsObject.actionListActions = editing ?
|
|
194
|
+
widthsObject.actionListActions = editing ? "".concat(EDITING_ACTIONS_WIDTH, "%") : "".concat(NON_EDITING_ACTIONS_WIDTH, "%");
|
|
175
195
|
return widthsObject;
|
|
176
196
|
};
|
|
177
197
|
const renderActionButtons = data => {
|
|
178
|
-
const fieldName =
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
...rest
|
|
182
|
-
} = data;
|
|
198
|
+
const fieldName = "contentData[".concat(data.rowIndex, "]");
|
|
199
|
+
const actions = data.actionListActions,
|
|
200
|
+
rest = _objectWithoutProperties(data, _excluded5);
|
|
183
201
|
if (data.id === editing || !data.id && editing === NEW_ROW) {
|
|
184
202
|
// Render the save/cancel buttons
|
|
185
203
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
186
|
-
id:
|
|
204
|
+
id: "action-button-parent-".concat(data.rowIndex + 1),
|
|
187
205
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
188
206
|
buttonStyle: "primary",
|
|
189
207
|
disabled: hasValidationErrors || submitting || pristine,
|
|
@@ -203,9 +221,9 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
203
221
|
type: "submit",
|
|
204
222
|
children: kintIntl.formatKintMessage({
|
|
205
223
|
id: 'save',
|
|
206
|
-
overrideValue: labelOverrides
|
|
224
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.save
|
|
207
225
|
})
|
|
208
|
-
},
|
|
226
|
+
}, "save[".concat(data.rowIndex, "]")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
209
227
|
"data-type-button": "cancel",
|
|
210
228
|
marginBottom0: true,
|
|
211
229
|
onClick: () => {
|
|
@@ -219,14 +237,14 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
219
237
|
},
|
|
220
238
|
children: kintIntl.formatKintMessage({
|
|
221
239
|
id: 'cancel',
|
|
222
|
-
overrideValue: labelOverrides
|
|
240
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.cancel
|
|
223
241
|
})
|
|
224
|
-
},
|
|
242
|
+
}, "cancel[".concat(data.rowIndex, "]"))]
|
|
225
243
|
});
|
|
226
244
|
}
|
|
227
245
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
228
|
-
id:
|
|
229
|
-
children: actions
|
|
246
|
+
id: "action-button-parent-".concat(data.rowIndex + 1),
|
|
247
|
+
children: actions === null || actions === void 0 ? void 0 : actions.map(action => {
|
|
230
248
|
let actionFunction;
|
|
231
249
|
if (action.callback) {
|
|
232
250
|
actionFunction = () => action.callback(rest);
|
|
@@ -236,25 +254,25 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
236
254
|
if (action.name === 'edit') {
|
|
237
255
|
actionFunction = () => toggleEditing(data.id);
|
|
238
256
|
}
|
|
239
|
-
let ariaLabel =
|
|
240
|
-
if (action
|
|
257
|
+
let ariaLabel = "action-".concat(action.name, "[").concat(data.rowIndex, "]");
|
|
258
|
+
if (action !== null && action !== void 0 && action.ariaLabel) {
|
|
241
259
|
if (typeof action.ariaLabel === 'function') {
|
|
242
260
|
ariaLabel = action.ariaLabel(data);
|
|
243
261
|
} else if (typeof action.ariaLabel === 'string') {
|
|
244
262
|
ariaLabel = action.ariaLabel;
|
|
245
263
|
} else {
|
|
246
|
-
throw new Error(
|
|
264
|
+
throw new Error("Provided ariaLabel for action \"".concat(action.name, "\" must be a function or a string."));
|
|
247
265
|
}
|
|
248
266
|
}
|
|
249
267
|
let tooltip;
|
|
250
268
|
let tooltipSub;
|
|
251
|
-
if (action
|
|
269
|
+
if (action !== null && action !== void 0 && action.tooltip) {
|
|
252
270
|
if (typeof action.tooltip === 'function') {
|
|
253
271
|
tooltip = action.tooltip(data);
|
|
254
272
|
} else {
|
|
255
273
|
tooltip = action.tooltip;
|
|
256
274
|
}
|
|
257
|
-
if (action
|
|
275
|
+
if (action !== null && action !== void 0 && action.tooltipSub) {
|
|
258
276
|
if (typeof action.tooltipSub === 'function') {
|
|
259
277
|
tooltipSub = action.tooltipSub(data);
|
|
260
278
|
} else {
|
|
@@ -266,14 +284,12 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
266
284
|
// If a tooltip is declared, render that around the actionButton
|
|
267
285
|
if (tooltip) {
|
|
268
286
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
269
|
-
id:
|
|
287
|
+
id: "action-".concat(action.name, "[").concat(data.rowIndex, "]-tooltip"),
|
|
270
288
|
sub: tooltipSub,
|
|
271
289
|
text: tooltip,
|
|
272
290
|
children: _ref3 => {
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
ariaIds
|
|
276
|
-
} = _ref3;
|
|
291
|
+
let actionTriggerRef = _ref3.ref,
|
|
292
|
+
ariaIds = _ref3.ariaIds;
|
|
277
293
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionTrigger, {
|
|
278
294
|
ref: actionTriggerRef,
|
|
279
295
|
action: action,
|
|
@@ -288,7 +304,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
288
304
|
return null;
|
|
289
305
|
},
|
|
290
306
|
to: action.to
|
|
291
|
-
},
|
|
307
|
+
}, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
|
|
292
308
|
}
|
|
293
309
|
});
|
|
294
310
|
}
|
|
@@ -306,7 +322,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
306
322
|
return null;
|
|
307
323
|
},
|
|
308
324
|
to: action.to
|
|
309
|
-
},
|
|
325
|
+
}, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
|
|
310
326
|
})
|
|
311
327
|
});
|
|
312
328
|
};
|
|
@@ -315,17 +331,14 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
315
331
|
// Fetch the content from the field Values
|
|
316
332
|
const cd = (0, _cloneDeep.default)((0, _get.default)(values, fieldName));
|
|
317
333
|
cd.actionListActions = actionAssigner(cd);
|
|
318
|
-
return {
|
|
319
|
-
...cd,
|
|
334
|
+
return _objectSpread(_objectSpread({}, cd), {}, {
|
|
320
335
|
fieldName,
|
|
321
336
|
fieldIndex
|
|
322
|
-
};
|
|
337
|
+
});
|
|
323
338
|
});
|
|
324
339
|
};
|
|
325
|
-
const
|
|
326
|
-
formatter
|
|
327
|
-
...restOfMclProps
|
|
328
|
-
} = mclProps; // Destructure formatter part of mclProps
|
|
340
|
+
const formatter = mclProps.formatter,
|
|
341
|
+
restOfMclProps = _objectWithoutProperties(mclProps, _excluded6); // Destructure formatter part of mclProps
|
|
329
342
|
|
|
330
343
|
const fieldAwareFormatter = () => {
|
|
331
344
|
const returnObj = {};
|
|
@@ -339,16 +352,17 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
339
352
|
const editingRow = cd.id === editing || !cd.id;
|
|
340
353
|
|
|
341
354
|
// Default to the passed formatter values
|
|
342
|
-
let returnValue = formatter
|
|
355
|
+
let returnValue = formatter !== null && formatter !== void 0 && formatter[key] ? formatter[key](cd) : cd[key];
|
|
343
356
|
|
|
344
357
|
// If editing, replace values with fields
|
|
345
358
|
if (editingRow) {
|
|
359
|
+
var _editableFields$key, _creatableFields$key;
|
|
346
360
|
/*
|
|
347
361
|
Check if the property is a visible field.
|
|
348
362
|
If it is not then we don't allow editing in this component.
|
|
349
363
|
*/
|
|
350
|
-
const editFunction = editableFields[key]
|
|
351
|
-
const createFunction = creatableFields[key]
|
|
364
|
+
const editFunction = (_editableFields$key = editableFields[key]) !== null && _editableFields$key !== void 0 ? _editableFields$key : () => true;
|
|
365
|
+
const createFunction = (_creatableFields$key = creatableFields[key]) !== null && _creatableFields$key !== void 0 ? _creatableFields$key : () => true;
|
|
352
366
|
/*
|
|
353
367
|
Next check if this is a new row, if so we should run the createableField function with the data.
|
|
354
368
|
If it is not a new row, then we run the editableField function with the data,
|
|
@@ -359,12 +373,12 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
359
373
|
if (!cd.id && createFunction(cd) || !!cd.id && editFunction(cd)) {
|
|
360
374
|
const passedObject = {
|
|
361
375
|
allValues: values,
|
|
362
|
-
index: cd
|
|
376
|
+
index: cd === null || cd === void 0 ? void 0 : cd.fieldIndex,
|
|
363
377
|
key,
|
|
364
|
-
name:
|
|
378
|
+
name: "".concat(cd.fieldName, ".").concat(key),
|
|
365
379
|
rowFieldName: cd.fieldName
|
|
366
380
|
};
|
|
367
|
-
const validateFunction = validateFields
|
|
381
|
+
const validateFunction = validateFields !== null && validateFields !== void 0 && validateFields[key] ? validateFields === null || validateFields === void 0 ? void 0 : validateFields[key](passedObject) : null;
|
|
368
382
|
returnValue = fieldComponents[key] ? fieldComponents[key](passedObject) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
369
383
|
ariaLabel: key // TODO at the moment the only way to override this is passing in an entire fieldComponent.
|
|
370
384
|
,
|
|
@@ -372,7 +386,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
372
386
|
,
|
|
373
387
|
component: _components.TextField,
|
|
374
388
|
marginBottom0: true,
|
|
375
|
-
name:
|
|
389
|
+
name: "".concat(cd.fieldName, ".").concat(key),
|
|
376
390
|
parse: v => v,
|
|
377
391
|
validate: validateFunction
|
|
378
392
|
});
|
|
@@ -396,38 +410,33 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
396
410
|
onClick: handleClickCreate,
|
|
397
411
|
children: kintIntl.formatKintMessage({
|
|
398
412
|
id: 'new',
|
|
399
|
-
overrideValue: labelOverrides
|
|
413
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
|
|
400
414
|
})
|
|
401
415
|
})]
|
|
402
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, {
|
|
403
|
-
columnMapping: {
|
|
404
|
-
...columnMapping,
|
|
416
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
|
|
417
|
+
columnMapping: _objectSpread(_objectSpread({}, columnMapping), {}, {
|
|
405
418
|
actionListActions: kintIntl.formatKintMessage({
|
|
406
419
|
id: 'actions',
|
|
407
|
-
overrideValue: labelOverrides
|
|
420
|
+
overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.actions
|
|
408
421
|
})
|
|
409
|
-
},
|
|
422
|
+
}),
|
|
410
423
|
columnWidths: getColumnWidths(),
|
|
411
424
|
contentData: assignActions(),
|
|
412
|
-
formatter: {
|
|
413
|
-
actionListActions: renderActionButtons
|
|
414
|
-
|
|
415
|
-
},
|
|
425
|
+
formatter: _objectSpread({
|
|
426
|
+
actionListActions: renderActionButtons
|
|
427
|
+
}, fieldAwareFormatter()),
|
|
416
428
|
interactive: !!onRowClick,
|
|
417
429
|
onRowClick: onRowClick ? (e, row) => {
|
|
418
430
|
// Make sure we ONLY fire row click from row, and not from action buttons.
|
|
419
431
|
const targetIsAction = e.target.closest('[id^=action-button-parent]') !== null;
|
|
420
432
|
if (!targetIsAction) {
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
...rowWithoutActions
|
|
424
|
-
} = row;
|
|
433
|
+
const _ala = row.actionListActions,
|
|
434
|
+
rowWithoutActions = _objectWithoutProperties(row, _excluded7);
|
|
425
435
|
onRowClick(e, rowWithoutActions);
|
|
426
436
|
}
|
|
427
437
|
} : null,
|
|
428
|
-
visibleColumns: !hideActionsColumn || !!editing ? [...visibleFields, 'actionListActions'] : visibleFields
|
|
429
|
-
|
|
430
|
-
})]
|
|
438
|
+
visibleColumns: !hideActionsColumn || !!editing ? [...visibleFields, 'actionListActions'] : visibleFields
|
|
439
|
+
}, restOfMclProps))]
|
|
431
440
|
});
|
|
432
441
|
});
|
|
433
442
|
ActionListFieldArray.propTypes = propTypes;
|
|
@@ -10,35 +10,40 @@ var _components = require("@folio/stripes/components");
|
|
|
10
10
|
var _SearchField = _interopRequireDefault(require("../SearchField"));
|
|
11
11
|
var _Typedown = _interopRequireDefault(require("../Typedown"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
const _excluded = ["getTooltipText"],
|
|
14
|
+
_excluded2 = ["id", "renderButtonItem", "renderListItem", "tooltipProps"],
|
|
15
|
+
_excluded3 = ["buttonRef"];
|
|
13
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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; }
|
|
14
24
|
const ButtonTypedown = _ref => {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
tooltipProps:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = {},
|
|
24
|
-
...typedownProps
|
|
25
|
-
} = _ref;
|
|
25
|
+
let id = _ref.id,
|
|
26
|
+
renderButtonItem = _ref.renderButtonItem,
|
|
27
|
+
renderListItem = _ref.renderListItem,
|
|
28
|
+
_ref$tooltipProps = _ref.tooltipProps,
|
|
29
|
+
_ref$tooltipProps2 = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
30
|
+
getTooltipText = _ref$tooltipProps2.getTooltipText,
|
|
31
|
+
tooltipProps = _objectWithoutProperties(_ref$tooltipProps2, _excluded),
|
|
32
|
+
typedownProps = _objectWithoutProperties(_ref, _excluded2);
|
|
26
33
|
const renderButtonFunc = (0, _react.useCallback)(selectedValue => {
|
|
27
34
|
if (renderButtonItem) {
|
|
28
35
|
return renderButtonItem(selectedValue);
|
|
29
36
|
}
|
|
30
37
|
return renderListItem(selectedValue);
|
|
31
38
|
}, [renderButtonItem, renderListItem]);
|
|
32
|
-
const usesTypedown = getTooltipText && typeof getTooltipText === 'function' || tooltipProps
|
|
33
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typedown.default, {
|
|
39
|
+
const usesTypedown = getTooltipText && typeof getTooltipText === 'function' || (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.text) && tooltipProps.text !== '';
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typedown.default, _objectSpread({
|
|
34
41
|
getDisplayValue: () => false,
|
|
35
42
|
renderHeader: _ref2 => {
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
currentlyTyped
|
|
39
|
-
} = _ref2;
|
|
43
|
+
let handleType = _ref2.handleType,
|
|
44
|
+
currentlyTyped = _ref2.currentlyTyped;
|
|
40
45
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchField.default, {
|
|
41
|
-
id:
|
|
46
|
+
id: "button-typedown-searchfield-".concat(id),
|
|
42
47
|
marginBottom0: true,
|
|
43
48
|
onChange: handleType,
|
|
44
49
|
value: currentlyTyped
|
|
@@ -46,42 +51,36 @@ const ButtonTypedown = _ref => {
|
|
|
46
51
|
},
|
|
47
52
|
renderListItem: renderListItem,
|
|
48
53
|
renderTrigger: _ref3 => {
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
typedownTriggerKeyDownHandler
|
|
54
|
-
} = _ref3;
|
|
54
|
+
let selectedValue = _ref3.selectedValue,
|
|
55
|
+
triggerComponentRef = _ref3.triggerComponentRef,
|
|
56
|
+
triggerId = _ref3.triggerId,
|
|
57
|
+
typedownTriggerKeyDownHandler = _ref3.typedownTriggerKeyDownHandler;
|
|
55
58
|
const renderButton = _ref4 => {
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} = _ref4;
|
|
60
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownButton, {
|
|
59
|
+
let buttonRef = _ref4.buttonRef,
|
|
60
|
+
buttonProps = _objectWithoutProperties(_ref4, _excluded3);
|
|
61
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownButton, _objectSpread(_objectSpread({
|
|
61
62
|
ref: buttonRef,
|
|
62
63
|
buttonStyle: "dropdownItem",
|
|
63
64
|
id: triggerId,
|
|
64
65
|
marginBottom0: true,
|
|
65
|
-
onKeyDown: typedownTriggerKeyDownHandler
|
|
66
|
-
|
|
66
|
+
onKeyDown: typedownTriggerKeyDownHandler
|
|
67
|
+
}, buttonProps), {}, {
|
|
67
68
|
children: renderButtonFunc(selectedValue)
|
|
68
|
-
});
|
|
69
|
+
}));
|
|
69
70
|
};
|
|
70
71
|
if (!usesTypedown) {
|
|
71
72
|
return renderButton({
|
|
72
73
|
buttonRef: triggerComponentRef
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
|
-
const typedownText = getTooltipText && typeof getTooltipText === 'function' ? getTooltipText(selectedValue) : tooltipProps
|
|
76
|
+
const typedownText = getTooltipText && typeof getTooltipText === 'function' ? getTooltipText(selectedValue) : (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.text) || '';
|
|
76
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
77
|
-
id:
|
|
78
|
+
id: "button-typedown-trigger-".concat(id),
|
|
78
79
|
placement: "bottom",
|
|
79
80
|
text: typedownText,
|
|
80
81
|
children: _ref5 => {
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
ariaIds
|
|
84
|
-
} = _ref5;
|
|
82
|
+
let tooltipRef = _ref5.ref,
|
|
83
|
+
ariaIds = _ref5.ariaIds;
|
|
85
84
|
return renderButton({
|
|
86
85
|
buttonRef: node => {
|
|
87
86
|
// Contrive composed node from tooltip AND triggerComponent
|
|
@@ -94,9 +93,8 @@ const ButtonTypedown = _ref => {
|
|
|
94
93
|
});
|
|
95
94
|
}
|
|
96
95
|
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
});
|
|
96
|
+
}
|
|
97
|
+
}, typedownProps));
|
|
100
98
|
};
|
|
101
99
|
var _default = exports.default = ButtonTypedown;
|
|
102
100
|
ButtonTypedown.propTypes = {
|