@k-int/stripes-kint-components 5.32.0 → 5.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/es/lib/Settings/Settings/Settings.js +20 -0
- package/es/lib/Settings/hooks/useSettings/useSettings.js +52 -38
- package/es/lib/Settings/index.js +8 -0
- 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 +1 -1
- 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 +123 -115
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +1 -1
- 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 +21 -21
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryFilters.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/highlightString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/refdataQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/validators/index.html +1 -1
- package/src/artifacts/coverage-jest/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/validators/validators.js.html +1 -1
- package/src/lib/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
|
@@ -94,7 +94,7 @@ export default generateKiwtQuery;
|
|
|
94
94
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
95
95
|
Code coverage generated by
|
|
96
96
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
97
|
-
at 2026-
|
|
97
|
+
at 2026-03-06T00:03:21.988Z
|
|
98
98
|
</div>
|
|
99
99
|
<script src="../prettify.js"></script>
|
|
100
100
|
<script>
|
package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html
CHANGED
|
@@ -790,7 +790,7 @@ export default generateKiwtQueryParams;
|
|
|
790
790
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
791
791
|
Code coverage generated by
|
|
792
792
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
793
|
-
at 2026-
|
|
793
|
+
at 2026-03-06T00:03:21.988Z
|
|
794
794
|
</div>
|
|
795
795
|
<script src="../../prettify.js"></script>
|
|
796
796
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2026-
|
|
119
|
+
at 2026-03-06T00:03:21.988Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2026-
|
|
76
|
+
at 2026-03-06T00:03:21.988Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -109,7 +109,7 @@ export default groupCustomPropertiesByCtx;
|
|
|
109
109
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
110
110
|
Code coverage generated by
|
|
111
111
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
112
|
-
at 2026-
|
|
112
|
+
at 2026-03-06T00:03:21.988Z
|
|
113
113
|
</div>
|
|
114
114
|
<script src="../prettify.js"></script>
|
|
115
115
|
<script>
|
|
@@ -244,7 +244,7 @@ export {
|
|
|
244
244
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
245
245
|
Code coverage generated by
|
|
246
246
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
247
|
-
at 2026-
|
|
247
|
+
at 2026-03-06T00:03:21.988Z
|
|
248
248
|
</div>
|
|
249
249
|
<script src="../prettify.js"></script>
|
|
250
250
|
<script>
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
297
297
|
Code coverage generated by
|
|
298
298
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
299
|
-
at 2026-
|
|
299
|
+
at 2026-03-06T00:03:21.988Z
|
|
300
300
|
</div>
|
|
301
301
|
<script src="../prettify.js"></script>
|
|
302
302
|
<script>
|
|
@@ -175,7 +175,7 @@ export { default as parseModConfigEntry } from './parseModConfigEntry';
|
|
|
175
175
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
176
176
|
Code coverage generated by
|
|
177
177
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
178
|
-
at 2026-
|
|
178
|
+
at 2026-03-06T00:03:21.988Z
|
|
179
179
|
</div>
|
|
180
180
|
<script src="../prettify.js"></script>
|
|
181
181
|
<script>
|
|
@@ -175,7 +175,7 @@ export default matchString;
|
|
|
175
175
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
176
176
|
Code coverage generated by
|
|
177
177
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
178
|
-
at 2026-
|
|
178
|
+
at 2026-03-06T00:03:21.988Z
|
|
179
179
|
</div>
|
|
180
180
|
<script src="../prettify.js"></script>
|
|
181
181
|
<script>
|
|
@@ -127,7 +127,7 @@ export default modConfigEntriesQueryKey;
|
|
|
127
127
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
128
128
|
Code coverage generated by
|
|
129
129
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
130
|
-
at 2026-
|
|
130
|
+
at 2026-03-06T00:03:21.988Z
|
|
131
131
|
</div>
|
|
132
132
|
<script src="../prettify.js"></script>
|
|
133
133
|
<script>
|
|
@@ -142,7 +142,7 @@ export default parseErrorResponse;
|
|
|
142
142
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
143
143
|
Code coverage generated by
|
|
144
144
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
145
|
-
at 2026-
|
|
145
|
+
at 2026-03-06T00:03:21.988Z
|
|
146
146
|
</div>
|
|
147
147
|
<script src="../prettify.js"></script>
|
|
148
148
|
<script>
|
|
@@ -115,7 +115,7 @@ export default parseModConfigEntry;
|
|
|
115
115
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
116
116
|
Code coverage generated by
|
|
117
117
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
118
|
-
at 2026-
|
|
118
|
+
at 2026-03-06T00:03:21.988Z
|
|
119
119
|
</div>
|
|
120
120
|
<script src="../prettify.js"></script>
|
|
121
121
|
<script>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
95
95
|
Code coverage generated by
|
|
96
96
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
97
|
-
at 2026-
|
|
97
|
+
at 2026-03-06T00:03:21.988Z
|
|
98
98
|
</div>
|
|
99
99
|
<script src="../prettify.js"></script>
|
|
100
100
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2026-
|
|
119
|
+
at 2026-03-06T00:03:21.988Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2026-
|
|
76
|
+
at 2026-03-06T00:03:21.988Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -97,7 +97,7 @@ export default refdataQueryKey;
|
|
|
97
97
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
98
98
|
Code coverage generated by
|
|
99
99
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
100
|
-
at 2026-
|
|
100
|
+
at 2026-03-06T00:03:21.988Z
|
|
101
101
|
</div>
|
|
102
102
|
<script src="../../prettify.js"></script>
|
|
103
103
|
<script>
|
|
@@ -130,7 +130,7 @@ export default selectorSafe;
|
|
|
130
130
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
131
131
|
Code coverage generated by
|
|
132
132
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
133
|
-
at 2026-
|
|
133
|
+
at 2026-03-06T00:03:21.988Z
|
|
134
134
|
</div>
|
|
135
135
|
<script src="../prettify.js"></script>
|
|
136
136
|
<script>
|
|
@@ -115,7 +115,7 @@ export default sortByLabel;
|
|
|
115
115
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
116
116
|
Code coverage generated by
|
|
117
117
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
118
|
-
at 2026-
|
|
118
|
+
at 2026-03-06T00:03:21.988Z
|
|
119
119
|
</div>
|
|
120
120
|
<script src="../prettify.js"></script>
|
|
121
121
|
<script>
|
|
@@ -112,7 +112,7 @@ export default toCamelCase;
|
|
|
112
112
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
113
113
|
Code coverage generated by
|
|
114
114
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
115
|
-
at 2026-
|
|
115
|
+
at 2026-03-06T00:03:21.988Z
|
|
116
116
|
</div>
|
|
117
117
|
<script src="../prettify.js"></script>
|
|
118
118
|
<script>
|
|
@@ -97,7 +97,7 @@ export default typedownQueryKey;
|
|
|
97
97
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
98
98
|
Code coverage generated by
|
|
99
99
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
100
|
-
at 2026-
|
|
100
|
+
at 2026-03-06T00:03:21.988Z
|
|
101
101
|
</div>
|
|
102
102
|
<script src="../prettify.js"></script>
|
|
103
103
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2026-
|
|
119
|
+
at 2026-03-06T00:03:21.988Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2026-
|
|
76
|
+
at 2026-03-06T00:03:21.988Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -355,7 +355,7 @@ export {
|
|
|
355
355
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
356
356
|
Code coverage generated by
|
|
357
357
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
358
|
-
at 2026-
|
|
358
|
+
at 2026-03-06T00:03:21.988Z
|
|
359
359
|
</div>
|
|
360
360
|
<script src="../prettify.js"></script>
|
|
361
361
|
<script>
|
|
@@ -99,11 +99,40 @@ const Settings = ({
|
|
|
99
99
|
}, [location.pathname, location.search, match.path, stripes]);
|
|
100
100
|
|
|
101
101
|
const routes = useMemo(() => internalRoutes.map((internalRoute) => {
|
|
102
|
+
const { page } = internalRoute;
|
|
103
|
+
const { component: Component, contextValue, Provider } = page;
|
|
104
|
+
|
|
105
|
+
if (Provider) {
|
|
106
|
+
return (
|
|
107
|
+
<Route
|
|
108
|
+
key={internalRoute.page.route}
|
|
109
|
+
path={`${match.path}/${internalRoute.page.route}`}
|
|
110
|
+
render={props2 => (
|
|
111
|
+
<Provider
|
|
112
|
+
contextValue={contextValue}
|
|
113
|
+
>
|
|
114
|
+
<Component
|
|
115
|
+
{...props2}
|
|
116
|
+
label={internalRoute.page.label}
|
|
117
|
+
stripes={stripes}
|
|
118
|
+
/>
|
|
119
|
+
</Provider>
|
|
120
|
+
)}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
102
125
|
const Current = internalRoute.component;
|
|
103
126
|
return (<Route
|
|
104
127
|
key={internalRoute.page.route}
|
|
105
128
|
path={`${match.path}/${internalRoute.page.route}`}
|
|
106
|
-
render={props2 =>
|
|
129
|
+
render={props2 => (
|
|
130
|
+
<Current
|
|
131
|
+
{...props2}
|
|
132
|
+
label={internalRoute.page.label}
|
|
133
|
+
stripes={stripes}
|
|
134
|
+
/>
|
|
135
|
+
)}
|
|
107
136
|
/>);
|
|
108
137
|
}), [internalRoutes, match.path, stripes]);
|
|
109
138
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# useSettings
|
|
2
2
|
|
|
3
|
+
>[!WARNING]
|
|
4
|
+
>Legacy Pattern > This hook has become significantly complex and "heavy" due to the need to support legacy stripes-smart-components patterns while managing dynamic context injection.
|
|
5
|
+
> It is possible that this pattern will be significantly reworked in future versions to separate data-fetching logic from UI component generation in a more modular way.
|
|
6
|
+
|
|
3
7
|
A comprehensive hook that manages the retrieval and configuration of settings data for one or multiple sections. It orchestrates multiple queries with `react-query`, constructs dynamic pages for each settings section, and returns a pre-configured `SettingsComponent` for rendering the settings UI.
|
|
4
8
|
|
|
5
9
|
## Overview
|
|
@@ -45,24 +49,25 @@ const SettingsContainer = () => {
|
|
|
45
49
|
|
|
46
50
|
`useSettings` accepts an optional settings props object (`settingsProps`) that may include the following properties:
|
|
47
51
|
|
|
48
|
-
| Name
|
|
49
|
-
|
|
50
|
-
| `allowGlobalEdit`
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
52
|
+
| Name | Type | Description | Required |
|
|
53
|
+
|-------------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
|
|
54
|
+
| `allowGlobalEdit` | `boolean` | Global flag to enable or disable editing of settings. Defaults to `true`. | ✕ |
|
|
55
|
+
| `contextPerPage` | `boolean` | If `true`, wraps every individual page component in a Context Provider. Set to `false` if encountering redraw issues with SASQ components. Defaults to `true`, see "Performance & Redraws" section below for more information. | ✕ |
|
|
56
|
+
| `dynamicPageExclusions` | `array` | Array of section names to be excluded from dynamic page generation. | ✕ |
|
|
57
|
+
| `intlKey` | `string` | Base internationalization key for resolving labels. | ✕ |
|
|
58
|
+
| `intlNS` | `string` | Internationalization namespace. | ✕ |
|
|
59
|
+
| `labelOverrides` | `object` | Custom label overrides for specific settings keys. | ✕ |
|
|
60
|
+
| `pages` | `array` | If provided, acts as a passthrough configuration for either sections or standalone pages, disabling query execution. | ✕ |
|
|
61
|
+
| `persistentPages` | `array` | Array of pages that persist regardless of dynamic query results. | ✕ |
|
|
62
|
+
| `preventQueries` | `boolean` | Flag to disable querying if settings data is provided externally. | ✕ |
|
|
63
|
+
| `refdataEndpoint` | `string` | The API endpoint to retrieve reference data for settings. | ✕ |
|
|
64
|
+
| `renderSingleSection` | `boolean` | When only one section is available, determines if it should be rendered as a single section with its own label. | ✕ |
|
|
65
|
+
| `sectionPermission` | `string` | Permission string that, if provided, restricts the rendering of a section unless the current user has the specified permission. | ✕ |
|
|
66
|
+
| `sectionRoute` | `string` | Base route path to be used when constructing dynamic page routes for settings sections. | ✕ |
|
|
67
|
+
| `sections` | `array` | Array of section configuration objects. Each object can override or extend the global settings props for that specific section. This means that the shape here matches more or less the shape for the props of `useSettings` itself. | ✕ |
|
|
68
|
+
| `settingEndpoint` | `string` | The base URL endpoint for fetching and updating settings. | ✕ |
|
|
69
|
+
| `templateEndpoint` | `string` | The endpoint for retrieving settings templates (if applicable). | ✕ |
|
|
70
|
+
| `render` | `func` | A custom render function for rendering individual setting fields. This function is passed down to the underlying settings components for specialized display logic. See `EditableSettingsList` for more information on how render is used. | ✕ |
|
|
66
71
|
|
|
67
72
|
## Returns
|
|
68
73
|
|
|
@@ -81,4 +86,29 @@ The hook returns an object containing:
|
|
|
81
86
|
A component pre-configured with the pages and sections that renders the settings UI. This component wraps the settings in the required `Settings` component from `@folio/stripes/smart-components`.
|
|
82
87
|
|
|
83
88
|
- **`SettingsContextProvider`** (`React Component`):
|
|
84
|
-
A context provider component for settings configuration. If only one section is available, it is provided directly; otherwise, it defaults to a pass-through provider.
|
|
89
|
+
A context provider component for settings configuration. If only one section is available, it is provided directly; otherwise, it defaults to a pass-through provider.
|
|
90
|
+
|
|
91
|
+
## Performance and redraws
|
|
92
|
+
Because SettingsComponent is generated within the hook, its function reference changes whenever the underlying settings data (like pageList or sections) updates.
|
|
93
|
+
|
|
94
|
+
In some complex scenarios (e.g., using SearchAndSortQuery inside a settings page), this can cause the entire settings pane to unmount and remount (a "redraw"). If you experience lost input focus or flickering, instead of using the returned SettingsComponent, manually render the Settings component using the pageList or sections provided by the hook:
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
import { Settings } from '@k-int/stripes-kint-components';
|
|
98
|
+
|
|
99
|
+
const { isLoading, pageList, sections } = useSettings({
|
|
100
|
+
contextPerPage: false, // This should be turned off for this pattern
|
|
101
|
+
...restOfConfig
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
if (isLoading) return null;
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<Settings
|
|
108
|
+
{...props}
|
|
109
|
+
pages={pageList}
|
|
110
|
+
sections={sections}
|
|
111
|
+
paneTitle={<FormattedMessage id="my-app.settings.title" />}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
3
|
import { useQueries } from 'react-query';
|
|
4
|
+
|
|
5
5
|
import { useOkapiKy, useStripes } from '@folio/stripes/core';
|
|
6
6
|
|
|
7
7
|
// We have swapped from the stripes-smart components settings page to our own internal one.
|
|
@@ -13,12 +13,30 @@ import { SettingPage, SettingPagePane } from '../../SettingPage';
|
|
|
13
13
|
import { SettingsContext } from '../../contexts';
|
|
14
14
|
|
|
15
15
|
import { generateKiwtQueryParams, sortByLabel, toCamelCase } from '../../../utils';
|
|
16
|
-
import {
|
|
16
|
+
import { useIntlKey, useKintIntl } from '../../../hooks';
|
|
17
|
+
|
|
18
|
+
const InternalSettingsContextProvider = ({ children, contextValue }) => (
|
|
19
|
+
<SettingsContext.Provider value={contextValue}>
|
|
20
|
+
{children}
|
|
21
|
+
</SettingsContext.Provider>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
InternalSettingsContextProvider.propTypes = {
|
|
25
|
+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
26
|
+
contextValue: PropTypes.object,
|
|
27
|
+
};
|
|
17
28
|
|
|
18
29
|
// TODO work underway to make the settings hook more useful when trying to render multiple sections at a time
|
|
19
30
|
const useSettings = (settingsProps = {}) => {
|
|
20
31
|
const {
|
|
21
32
|
allowGlobalEdit = true,
|
|
33
|
+
// DEPRECATED This prop will eventually be set to FALSE in a breaking change.
|
|
34
|
+
// This is a LEGACY prop, which ensured each page had context pre-wrapped.
|
|
35
|
+
// This is NOT required while using Settings component within kint-components
|
|
36
|
+
// to render dynamic pages, but the dynamic pages break if context is missing with
|
|
37
|
+
// the stripes smart components model
|
|
38
|
+
// Turn this OFF if having difficulties with settings page redraws (When using SASQ in particular)
|
|
39
|
+
contextPerPage = true,
|
|
22
40
|
dynamicPageExclusions,
|
|
23
41
|
intlKey: passedIntlKey,
|
|
24
42
|
intlNS: passedIntlNS,
|
|
@@ -40,6 +58,7 @@ const useSettings = (settingsProps = {}) => {
|
|
|
40
58
|
const ky = useOkapiKy();
|
|
41
59
|
const stripes = useStripes();
|
|
42
60
|
const kintIntl = useKintIntl(passedIntlKey, passedIntlNS);
|
|
61
|
+
const intlKey = useIntlKey(passedIntlKey, passedIntlNS);
|
|
43
62
|
|
|
44
63
|
// Set up array of queryParams, pageLists etc etc ready for us to do all the work in a single place
|
|
45
64
|
|
|
@@ -154,50 +173,42 @@ const useSettings = (settingsProps = {}) => {
|
|
|
154
173
|
|
|
155
174
|
const finalSections = useMemo(() => {
|
|
156
175
|
return sectionMetaArray.map(((sma, idx) => {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
refdataEndpoint: sma.refdataEndpoint ?? refdataEndpoint,
|
|
163
|
-
settingEndpoint: sma.settingEndpoint ?? settingEndpoint,
|
|
164
|
-
templateEndpoint: sma.templateEndpoint ?? templateEndpoint,
|
|
165
|
-
}), [intlKey]);
|
|
166
|
-
|
|
167
|
-
return (
|
|
168
|
-
<SettingsContext.Provider
|
|
169
|
-
value={contextValue}
|
|
170
|
-
>
|
|
171
|
-
{children}
|
|
172
|
-
</SettingsContext.Provider>
|
|
173
|
-
);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
SettingsContextProvider.propTypes = {
|
|
177
|
-
children: PropTypes.oneOfType([
|
|
178
|
-
PropTypes.func,
|
|
179
|
-
PropTypes.node
|
|
180
|
-
])
|
|
176
|
+
const contextValue = {
|
|
177
|
+
intlKey: sma.intlKey ?? intlKey, // This is only here for backwards compatibility... is now grabbed from useIntlKey instead of what's passed in directly
|
|
178
|
+
refdataEndpoint: sma.refdataEndpoint ?? refdataEndpoint,
|
|
179
|
+
settingEndpoint: sma.settingEndpoint ?? settingEndpoint,
|
|
180
|
+
templateEndpoint: sma.templateEndpoint ?? templateEndpoint,
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
const finalPermission = sma.sectionPermission ?? sectionPermission;
|
|
184
184
|
if (!finalPermission || stripes.hasPerm(finalPermission)) {
|
|
185
185
|
const dynamicPagesFromQueryReturn = getDynamicPages(queryReturnArray[idx], sma);
|
|
186
186
|
|
|
187
|
-
const finalPages = sma.pages ?? pages ??
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
187
|
+
const finalPages = sma.pages ?? pages ??
|
|
188
|
+
(sma.persistentPages ?? persistentPages)
|
|
189
|
+
.concat(dynamicPagesFromQueryReturn.dynamic)
|
|
190
|
+
.sort(sortByLabel)
|
|
191
|
+
.map((p) => {
|
|
192
|
+
let component = p.component;
|
|
193
|
+
if (contextPerPage) {
|
|
194
|
+
component = (cprops) => (
|
|
195
|
+
<InternalSettingsContextProvider contextValue={contextValue}>
|
|
196
|
+
<p.component {...cprops} />
|
|
197
|
+
</InternalSettingsContextProvider>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
...p,
|
|
203
|
+
component,
|
|
204
|
+
Provider: InternalSettingsContextProvider,
|
|
205
|
+
contextValue,
|
|
206
|
+
};
|
|
207
|
+
});
|
|
197
208
|
|
|
198
209
|
return {
|
|
199
210
|
...sma,
|
|
200
|
-
SettingsContextProvider,
|
|
211
|
+
SettingsContextProvider: InternalSettingsContextProvider,
|
|
201
212
|
...dynamicPagesFromQueryReturn,
|
|
202
213
|
pageList: finalPages, // DEPRECATED Here for backwards compatibility
|
|
203
214
|
pages: finalPages // ASSUMPTION MADE THAT INDICES REMAIN THE SAME
|
|
@@ -205,46 +216,47 @@ const useSettings = (settingsProps = {}) => {
|
|
|
205
216
|
}
|
|
206
217
|
return null;
|
|
207
218
|
})).filter(Boolean);
|
|
208
|
-
}, [
|
|
219
|
+
}, [contextPerPage, getDynamicPages, intlKey, pages, persistentPages, queryReturnArray, refdataEndpoint, sectionMetaArray, sectionPermission, settingEndpoint, stripes, templateEndpoint]);
|
|
209
220
|
|
|
210
|
-
const
|
|
221
|
+
const outputPages = useMemo(() => {
|
|
211
222
|
let finalPages = null;
|
|
212
|
-
if (finalSections
|
|
223
|
+
if (finalSections?.length === 1 && !renderSingleSection) {
|
|
213
224
|
finalPages = pages ?? finalSections[0].pages;
|
|
214
225
|
}
|
|
215
226
|
|
|
216
227
|
return finalPages;
|
|
217
228
|
}, [finalSections, pages, renderSingleSection]);
|
|
218
229
|
|
|
219
|
-
const
|
|
230
|
+
const outputSections = useMemo(() => {
|
|
220
231
|
if (finalSections.length > 1 || (finalSections.length === 1 && renderSingleSection)) {
|
|
221
232
|
return finalSections;
|
|
222
233
|
}
|
|
223
234
|
return null;
|
|
224
235
|
}, [finalSections, renderSingleSection]);
|
|
225
236
|
|
|
226
|
-
const SettingsComponent = (props) => {
|
|
237
|
+
const SettingsComponent = useCallback((props) => {
|
|
227
238
|
return (
|
|
228
239
|
<Settings
|
|
229
|
-
pages={
|
|
240
|
+
pages={outputPages}
|
|
230
241
|
paneTitle={
|
|
231
242
|
kintIntl.formatKintMessage({
|
|
232
243
|
id: 'meta.title'
|
|
233
244
|
})}
|
|
234
|
-
sections={
|
|
245
|
+
sections={outputSections}
|
|
235
246
|
{...props}
|
|
236
247
|
/>
|
|
237
248
|
);
|
|
238
|
-
};
|
|
249
|
+
}, [kintIntl, outputPages, outputSections]);
|
|
239
250
|
|
|
240
251
|
return {
|
|
241
252
|
isLoading,
|
|
242
|
-
pageList,
|
|
243
|
-
sections:
|
|
253
|
+
pageList: outputPages,
|
|
254
|
+
sections: outputSections,
|
|
244
255
|
SettingsComponent,
|
|
245
256
|
// This doesn't make much sense if there is more than one section, here to avoid breaking changes
|
|
246
|
-
SettingsContextProvider: (finalSections
|
|
257
|
+
SettingsContextProvider: (finalSections?.length === 1) ? finalSections[0].SettingsContextProvider : ({ children }) => <> { children } </>
|
|
247
258
|
};
|
|
248
259
|
};
|
|
249
260
|
|
|
250
261
|
export default useSettings;
|
|
262
|
+
|
|
@@ -9,6 +9,9 @@ export {
|
|
|
9
9
|
SettingPagePane,
|
|
10
10
|
} from './SettingPage';
|
|
11
11
|
|
|
12
|
+
// Internal replacement for stripes-smart-components Settings component
|
|
13
|
+
export { default as Settings } from './Settings';
|
|
14
|
+
|
|
12
15
|
// EditableSettingsList
|
|
13
16
|
export * from './EditableSettingsList';
|
|
14
17
|
|