@k-int/stripes-kint-components 5.0.0 → 5.1.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 +11 -0
- package/es/__mocks__/@folio/stripes/components.js +10 -21
- package/es/__mocks__/@folio/stripes/core.js +4 -7
- package/es/__mocks__/@folio/stripes/smart-components.js +4 -7
- package/es/__mocks__/react-query.js +4 -7
- package/es/__mocks__/react-router-dom.js +6 -7
- package/es/artifacts/coverage-jest/lcov-report/prettify.js +2 -2
- package/es/artifacts/coverage-jest/lcov-report/sorter.js +6 -6
- package/es/index.js +56 -49
- package/es/lib/ActionList/ActionList.js +39 -53
- package/es/lib/ActionList/ActionListFieldArray.js +144 -169
- package/es/lib/ActionList/index.js +1 -1
- package/es/lib/ComboButton/ComboButton.js +73 -91
- package/es/lib/ComboButton/index.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +58 -79
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +15 -19
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +112 -162
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +30 -67
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +37 -50
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +83 -121
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +10 -10
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +48 -135
- package/es/lib/CustomProperties/Config/index.js +4 -4
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +20 -23
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +11 -16
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +30 -29
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +11 -16
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +87 -105
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +26 -63
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +124 -117
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +101 -179
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +44 -46
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +23 -27
- package/es/lib/CustomProperties/Edit/index.js +5 -5
- package/es/lib/CustomProperties/Edit/testResources.js +14 -38
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +61 -83
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -57
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +40 -56
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +17 -16
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +28 -25
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +19 -47
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -22
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +23 -52
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +38 -43
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +94 -226
- package/es/lib/CustomProperties/Filter/index.js +6 -6
- package/es/lib/CustomProperties/Filter/testResources.js +13 -36
- package/es/lib/CustomProperties/Filter/useOperators.js +18 -18
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +18 -32
- package/es/lib/CustomProperties/Filter/useValueProps.js +23 -29
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +20 -23
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +11 -16
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +50 -59
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +14 -23
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +18 -20
- package/es/lib/CustomProperties/View/index.js +3 -3
- package/es/lib/CustomProperties/View/testResources.js +5 -9
- package/es/lib/CustomProperties/index.js +18 -18
- package/es/lib/CycleButton/CycleButton.js +18 -34
- package/es/lib/CycleButton/index.js +1 -1
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +109 -152
- package/es/lib/EditableRefdataCategoryList/index.js +1 -1
- package/es/lib/EditableRefdataList/EditableRefdataList.js +128 -172
- package/es/lib/EditableRefdataList/index.js +1 -1
- package/es/lib/EditableSettingsList/EditableSettingsList.js +17 -15
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +19 -27
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +61 -90
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +22 -36
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +99 -83
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +18 -21
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +187 -275
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +75 -111
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +55 -168
- package/es/lib/EditableSettingsList/SettingField/index.js +3 -3
- package/es/lib/EditableSettingsList/index.js +3 -3
- package/es/lib/FormModal/FormModal.js +44 -48
- package/es/lib/FormModal/index.js +1 -1
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +25 -29
- package/es/lib/FormattedKintMessage/index.js +1 -1
- package/es/lib/IconSelect/IconSelect.js +50 -70
- package/es/lib/IconSelect/index.js +1 -1
- package/es/lib/NoResultsMessage/NoResultsMessage.js +19 -19
- package/es/lib/NoResultsMessage/index.js +1 -1
- package/es/lib/QueryTypedown/QueryTypedown.js +18 -40
- package/es/lib/QueryTypedown/index.js +1 -1
- package/es/lib/RefdataButtons/RefdataButtons.js +27 -31
- package/es/lib/RefdataButtons/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +84 -90
- package/es/lib/ResponsiveButtonGroup/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +28 -42
- package/es/lib/RichSelect/RichSelect.js +71 -88
- package/es/lib/RichSelect/index.js +2 -2
- package/es/lib/RichSelect/useSelectedOption.js +4 -14
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +116 -139
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +40 -47
- package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
- package/es/lib/SASQLookupComponent/index.js +2 -2
- package/es/lib/SASQRoute/SASQRoute.js +32 -39
- package/es/lib/SASQRoute/index.js +1 -1
- package/es/lib/SASQViewComponent/SASQViewComponent.js +39 -47
- package/es/lib/SASQViewComponent/index.js +1 -1
- package/es/lib/SearchField/SearchField.js +12 -18
- package/es/lib/SearchField/index.js +1 -1
- package/es/lib/SettingPage/SettingPage.js +22 -22
- package/es/lib/SettingPage/SettingPagePane.js +9 -8
- package/es/lib/SettingPage/index.js +2 -2
- package/es/lib/SettingsFormContainer/SettingsFormContainer.js +51 -55
- package/es/lib/SettingsFormContainer/index.js +1 -1
- package/es/lib/Typedown/Typedown.js +62 -81
- package/es/lib/Typedown/index.js +1 -1
- package/es/lib/constants/comparators.js +7 -0
- package/es/lib/constants/customProperties.js +11 -22
- package/es/lib/constants/endpoints.js +1 -2
- package/es/lib/constants/eventCodes.js +3 -6
- package/es/lib/contexts/SettingsContext.js +2 -3
- package/es/lib/contexts/index.js +1 -1
- package/es/lib/hooks/__mocks__/index.js +9 -29
- package/es/lib/hooks/index.js +19 -19
- package/es/lib/hooks/typedownHooks/index.js +3 -3
- package/es/lib/hooks/typedownHooks/useTypedown.js +49 -50
- package/es/lib/hooks/typedownHooks/useTypedownData.js +12 -23
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +13 -22
- package/es/lib/hooks/useActiveElement.js +9 -19
- package/es/lib/hooks/useCustomProperties.js +23 -32
- package/es/lib/hooks/useHelperApp.js +31 -51
- package/es/lib/hooks/useIntlKey.js +4 -7
- package/es/lib/hooks/useIntlKeyStore.js +44 -51
- package/es/lib/hooks/useInvalidateRefdata.js +4 -7
- package/es/lib/hooks/useKintIntl.js +29 -33
- package/es/lib/hooks/useKiwtFieldArray.js +35 -47
- package/es/lib/hooks/useKiwtSASQuery.js +38 -51
- package/es/lib/hooks/useLocalStorageState.js +7 -20
- package/es/lib/hooks/useModConfigEntries.js +27 -27
- package/es/lib/hooks/useMutateCustomProperties.js +20 -64
- package/es/lib/hooks/useMutateModConfigEntry.js +22 -61
- package/es/lib/hooks/useMutateRefdataCategory.js +20 -62
- package/es/lib/hooks/useMutateRefdataValue.js +29 -67
- package/es/lib/hooks/useQIndex.js +13 -28
- package/es/lib/hooks/useRefdata.js +18 -21
- package/es/lib/hooks/useSASQQueryMeta.js +14 -22
- package/es/lib/hooks/useTemplates.js +14 -14
- package/es/lib/settingsHooks/index.js +3 -3
- package/es/lib/settingsHooks/useAppSettings.js +19 -27
- package/es/lib/settingsHooks/useSettingSection.js +17 -19
- package/es/lib/settingsHooks/useSettings.js +59 -74
- package/es/lib/utils/buildUrl.js +6 -8
- package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +36 -0
- package/es/lib/utils/filterParsers/index.js +48 -0
- package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +47 -0
- package/es/lib/utils/{parseKiwtQueryGroups.js → filterParsers/parseKiwtQueryGroups.js} +12 -13
- package/es/lib/utils/{parseKiwtQueryGroups.test.js → filterParsers/parseKiwtQueryGroups.test.js} +15 -15
- package/es/lib/utils/filterParsers/parseKiwtQueryString.js +34 -0
- package/es/lib/utils/generateKiwtQuery.js +4 -5
- package/es/lib/utils/generateKiwtQueryParams.js +93 -99
- package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -20
- package/es/lib/utils/highlightString.js +17 -37
- package/es/lib/utils/index.js +49 -19
- package/es/lib/utils/matchString.js +5 -10
- package/es/lib/utils/modConfigEntriesQueryKey.js +9 -9
- package/es/lib/utils/parseErrorResponse.js +23 -65
- package/es/lib/utils/parseModConfigEntry.js +3 -4
- package/es/lib/utils/refdataOptions.js +2 -3
- package/es/lib/utils/refdataQueryKey.js +3 -4
- package/es/lib/utils/selectorSafe.js +5 -6
- package/es/lib/utils/sortByLabel.js +4 -5
- package/es/lib/utils/toCamelCase.js +8 -14
- package/es/lib/utils/typedownQueryKey.js +3 -4
- package/es/lib/validators/index.js +1 -1
- package/es/lib/validators/validators.js +22 -29
- package/junit.xml +161 -161
- package/package.json +5 -5
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionTrigger.js.html +418 -0
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ComboButton/ComboButton.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ComboButton/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ComboButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/EditSettingValue.js.html +514 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/RenderSettingValue.js.html +358 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/SettingsActionList.js.html +736 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/index.html +161 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/comparators.js.html +121 -0
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/endpoints.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +16 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +161 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +94 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +292 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +214 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +463 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useModConfigEntries.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +41 -26
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useAppSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +6 -18
- package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/deparseKiwtQueryFilters.js.html +181 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/index.html +176 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/index.js.html +124 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/parseKiwtQueryFilters.js.html +211 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/parseKiwtQueryGroups.js.html +367 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/parseKiwtQueryString.js.html +184 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +13 -7
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +13 -28
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +24 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/modConfigEntriesQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/parseModConfigEntry.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +370 -0
- package/src/artifacts/coverage-jest/lcov-report/validators/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/validators/validators.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov.info +352 -228
- package/src/index.js +1 -0
- package/src/lib/CustomProperties/Edit/CustomPropertyField.test.js +9 -5
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +1 -4
- package/src/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +26 -10
- package/src/lib/constants/comparators.js +12 -0
- package/src/lib/hooks/useKiwtSASQuery.js +1 -1
- package/src/lib/utils/buildUrl.js +1 -5
- package/src/lib/utils/filterParsers/deparseKiwtQueryFilters.js +32 -0
- package/src/lib/utils/filterParsers/index.js +13 -0
- package/src/lib/utils/filterParsers/parseKiwtQueryFilters.js +42 -0
- package/src/lib/utils/{parseKiwtQueryGroups.js → filterParsers/parseKiwtQueryGroups.js} +3 -1
- package/src/lib/utils/filterParsers/parseKiwtQueryString.js +33 -0
- package/src/lib/utils/generateKiwtQueryParams.js +6 -4
- package/src/lib/utils/index.js +8 -1
- /package/src/lib/utils/{parseKiwtQueryGroups.test.js → filterParsers/parseKiwtQueryGroups.test.js} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -11,43 +10,34 @@ var _components = require("@folio/stripes/components");
|
|
|
11
10
|
var CUSTOM_PROPERTY_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
|
|
12
11
|
var _hooks = require("../../hooks");
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
index = _ref.index,
|
|
34
|
-
passedIntlKey = _ref.intlKey,
|
|
35
|
-
passedIntlNS = _ref.intlNS,
|
|
36
|
-
_ref$labelOverrides = _ref.labelOverrides,
|
|
37
|
-
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
38
|
-
name = _ref.name,
|
|
39
|
-
_onChange = _ref.onChange,
|
|
40
|
-
value = _ref.value,
|
|
41
|
-
setCustomProperties = _ref.setCustomProperties;
|
|
42
|
-
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
16
|
+
const CustomPropertyField = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
availableCustomProperties,
|
|
19
|
+
customProperty,
|
|
20
|
+
customPropertyType,
|
|
21
|
+
customProperties,
|
|
22
|
+
index,
|
|
23
|
+
intlKey: passedIntlKey,
|
|
24
|
+
intlNS: passedIntlNS,
|
|
25
|
+
labelOverrides = {},
|
|
26
|
+
name,
|
|
27
|
+
onChange,
|
|
28
|
+
value,
|
|
29
|
+
setCustomProperties
|
|
30
|
+
} = _ref;
|
|
31
|
+
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
43
32
|
|
|
44
33
|
// Set up the validator for the customProperty
|
|
45
|
-
|
|
34
|
+
const customPropertyValidator = (fieldValue, allValues) => {
|
|
46
35
|
var _allValues$customProp, _allValues$customProp2;
|
|
47
|
-
|
|
48
|
-
note
|
|
49
|
-
publicNote
|
|
50
|
-
currentValue
|
|
36
|
+
const {
|
|
37
|
+
note,
|
|
38
|
+
publicNote,
|
|
39
|
+
value: currentValue
|
|
40
|
+
} = (_allValues$customProp = allValues === null || allValues === void 0 || (_allValues$customProp2 = allValues.customProperties) === null || _allValues$customProp2 === void 0 || (_allValues$customProp2 = _allValues$customProp2[customProperty === null || customProperty === void 0 ? void 0 : customProperty.value]) === null || _allValues$customProp2 === void 0 ? void 0 : _allValues$customProp2[0]) !== null && _allValues$customProp !== void 0 ? _allValues$customProp : {};
|
|
51
41
|
if (note && !currentValue || publicNote && !currentValue) {
|
|
52
42
|
if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME || customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
|
|
53
43
|
return kintIntl.formatKintMessage({
|
|
@@ -62,21 +52,21 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
62
52
|
}
|
|
63
53
|
}
|
|
64
54
|
if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME) {
|
|
65
|
-
|
|
55
|
+
const regexp = /^-?[\d]*(\.[\d]{0,2})?$/;
|
|
66
56
|
return fieldValue && !regexp.test(fieldValue) ? kintIntl.formatKintMessage({
|
|
67
57
|
id: 'errors.maxTwoDecimals',
|
|
68
58
|
overrideValue: labelOverrides.maxTwoDecimalsError
|
|
69
59
|
}) : undefined;
|
|
70
60
|
}
|
|
71
61
|
if (customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
const min = Number.MIN_SAFE_INTEGER;
|
|
63
|
+
const max = Number.MAX_SAFE_INTEGER;
|
|
74
64
|
return fieldValue && (fieldValue > max || fieldValue < min) ? kintIntl.formatKintMessage({
|
|
75
65
|
id: 'errors.valueNotInRange',
|
|
76
66
|
overrideValue: labelOverrides.valueNotInRangeError
|
|
77
67
|
}, {
|
|
78
|
-
min
|
|
79
|
-
max
|
|
68
|
+
min,
|
|
69
|
+
max
|
|
80
70
|
}) : undefined;
|
|
81
71
|
}
|
|
82
72
|
if (!customProperty.primary && !currentValue) {
|
|
@@ -86,18 +76,16 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
86
76
|
}
|
|
87
77
|
return undefined;
|
|
88
78
|
};
|
|
89
|
-
|
|
90
|
-
return availableCustomProperties.find(
|
|
91
|
-
return cp.value === customPropertyValue;
|
|
92
|
-
});
|
|
79
|
+
const getCustomProperty = customPropertyValue => {
|
|
80
|
+
return availableCustomProperties.find(cp => cp.value === customPropertyValue);
|
|
93
81
|
};
|
|
94
|
-
|
|
82
|
+
const renderCustomPropertyName = () => {
|
|
95
83
|
var _customPropertyValue$;
|
|
96
|
-
|
|
84
|
+
const unsetCustomProperties = availableCustomProperties.filter(t => {
|
|
97
85
|
var _custPropValue$;
|
|
98
86
|
// Only optional properties can be set
|
|
99
87
|
if (t.primary) return false;
|
|
100
|
-
|
|
88
|
+
const custPropValue = value[t.value];
|
|
101
89
|
|
|
102
90
|
// The customProperty is unset and has no value.
|
|
103
91
|
if (custPropValue === undefined) return true;
|
|
@@ -106,23 +94,22 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
106
94
|
if ((_custPropValue$ = custPropValue[0]) !== null && _custPropValue$ !== void 0 && _custPropValue$._delete) return true;
|
|
107
95
|
return false;
|
|
108
96
|
});
|
|
109
|
-
|
|
110
|
-
|
|
97
|
+
const customPropertyValue = value[customProperty.value];
|
|
98
|
+
const id = customPropertyValue === null || customPropertyValue === void 0 || (_customPropertyValue$ = customPropertyValue[0]) === null || _customPropertyValue$ === void 0 ? void 0 : _customPropertyValue$.id;
|
|
111
99
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
|
|
112
100
|
autoFocus: !id,
|
|
113
|
-
dataOptions: [customProperty]
|
|
101
|
+
dataOptions: [customProperty, ...unsetCustomProperties] // The selected customProperty, and the available unset customProperties
|
|
114
102
|
,
|
|
115
103
|
id: "edit-customproperty-".concat(index, "-name"),
|
|
116
104
|
label: kintIntl.formatKintMessage({
|
|
117
105
|
id: 'customProperties.name',
|
|
118
106
|
overrideValue: labelOverrides.name
|
|
119
107
|
}),
|
|
120
|
-
onChange:
|
|
121
|
-
|
|
122
|
-
var newValue = e.target.value;
|
|
108
|
+
onChange: e => {
|
|
109
|
+
const newValue = e.target.value;
|
|
123
110
|
|
|
124
111
|
// Update `state.customProperties` which controls what customProperties are being edited.
|
|
125
|
-
|
|
112
|
+
const newCustomProperties = [...customProperties];
|
|
126
113
|
newCustomProperties[index] = getCustomProperty(newValue);
|
|
127
114
|
setCustomProperties(newCustomProperties);
|
|
128
115
|
|
|
@@ -130,83 +117,93 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
130
117
|
// in essence we're deleting a customProperty and creating a new customProperty.
|
|
131
118
|
// We do this by 1) marking the current customProperty for deletion and 2) initing
|
|
132
119
|
// the new customProperty to an empty object.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
const currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
|
|
121
|
+
onChange({
|
|
122
|
+
...value,
|
|
123
|
+
[customProperty.value]: [{
|
|
124
|
+
id: currentValue.id,
|
|
125
|
+
_delete: true
|
|
126
|
+
}],
|
|
127
|
+
[newValue]: [{}]
|
|
128
|
+
});
|
|
138
129
|
},
|
|
139
130
|
required: true,
|
|
140
131
|
value: customProperty.value
|
|
141
132
|
});
|
|
142
133
|
};
|
|
143
|
-
|
|
134
|
+
const renderCustomPropertyValue = () => {
|
|
144
135
|
var _customProperty$optio;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
const currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
|
|
137
|
+
const min = Number.MIN_SAFE_INTEGER;
|
|
138
|
+
const max = Number.MAX_SAFE_INTEGER;
|
|
148
139
|
|
|
149
140
|
// Default change handler
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
141
|
+
let handleChange = e => {
|
|
142
|
+
onChange({
|
|
143
|
+
...value,
|
|
144
|
+
[customProperty.value]: [{
|
|
145
|
+
...currentValue,
|
|
146
|
+
_delete: e.target.value === '',
|
|
147
|
+
// Delete customProperty if removing the value.
|
|
148
|
+
value: e.target.value // send down the number for integers and decimal types
|
|
149
|
+
}]
|
|
150
|
+
});
|
|
156
151
|
};
|
|
157
152
|
// Figure out which component we're rendering and specify its unique props.
|
|
158
|
-
|
|
153
|
+
let fieldProps;
|
|
159
154
|
switch (customProperty.type) {
|
|
160
155
|
case CUSTOM_PROPERTY_TYPES.REFDATA_CLASS_NAME:
|
|
161
156
|
fieldProps = {
|
|
162
157
|
component: _components.Select,
|
|
163
158
|
dataOptions: customProperty.options,
|
|
164
|
-
format:
|
|
165
|
-
return v === null || v === void 0 ? void 0 : v.value;
|
|
166
|
-
}
|
|
159
|
+
format: v => v === null || v === void 0 ? void 0 : v.value
|
|
167
160
|
};
|
|
168
161
|
break;
|
|
169
162
|
case CUSTOM_PROPERTY_TYPES.MULTI_REFDATA_CLASS_NAME:
|
|
170
163
|
fieldProps = {
|
|
171
164
|
component: _components.MultiSelection,
|
|
172
165
|
// The "not set" value is not relevant for a multi select
|
|
173
|
-
dataOptions: (_customProperty$optio = customProperty.options) === null || _customProperty$optio === void 0 ? void 0 : _customProperty$optio.filter(
|
|
174
|
-
return !!(opt !== null && opt !== void 0 && opt.value);
|
|
175
|
-
}),
|
|
166
|
+
dataOptions: (_customProperty$optio = customProperty.options) === null || _customProperty$optio === void 0 ? void 0 : _customProperty$optio.filter(opt => !!(opt !== null && opt !== void 0 && opt.value)),
|
|
176
167
|
renderToOverlay: true
|
|
177
168
|
};
|
|
178
169
|
// MultiSelection passes the changed array as a value not an event
|
|
179
|
-
handleChange =
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
170
|
+
handleChange = refdataArray => {
|
|
171
|
+
onChange({
|
|
172
|
+
...value,
|
|
173
|
+
[customProperty.value]: [{
|
|
174
|
+
...currentValue,
|
|
175
|
+
_delete: (refdataArray === null || refdataArray === void 0 ? void 0 : refdataArray.length) === 0 ? true : undefined,
|
|
176
|
+
// Delete customProperty if removing all values.
|
|
177
|
+
value: refdataArray
|
|
178
|
+
}]
|
|
179
|
+
});
|
|
185
180
|
};
|
|
186
181
|
break;
|
|
187
182
|
case CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME:
|
|
188
183
|
case CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME:
|
|
189
184
|
fieldProps = {
|
|
190
185
|
component: _components.TextField,
|
|
191
|
-
max
|
|
192
|
-
min
|
|
186
|
+
max,
|
|
187
|
+
min,
|
|
193
188
|
step: 'any',
|
|
194
189
|
type: 'number'
|
|
195
190
|
};
|
|
196
|
-
handleChange =
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
191
|
+
handleChange = e => {
|
|
192
|
+
onChange({
|
|
193
|
+
...value,
|
|
194
|
+
[customProperty.value]: [{
|
|
195
|
+
...currentValue,
|
|
196
|
+
_delete: e.target.value === '' ? true : undefined,
|
|
197
|
+
// Delete customProperty if removing the value.
|
|
198
|
+
value: parseFloat(e.target.value)
|
|
199
|
+
}]
|
|
200
|
+
});
|
|
202
201
|
};
|
|
203
202
|
break;
|
|
204
203
|
case CUSTOM_PROPERTY_TYPES.TEXT_CLASS_NAME:
|
|
205
204
|
fieldProps = {
|
|
206
205
|
component: _components.TextArea,
|
|
207
|
-
parse:
|
|
208
|
-
return v;
|
|
209
|
-
} // Lets us send an empty string instead of `undefined`
|
|
206
|
+
parse: v => v // Lets us send an empty string instead of `undefined`
|
|
210
207
|
};
|
|
211
208
|
|
|
212
209
|
break;
|
|
@@ -224,7 +221,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
224
221
|
};
|
|
225
222
|
break;
|
|
226
223
|
}
|
|
227
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field,
|
|
224
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
228
225
|
"data-test-customproperty-value": true,
|
|
229
226
|
id: "edit-customproperty-".concat(index, "-value"),
|
|
230
227
|
label: kintIntl.formatKintMessage({
|
|
@@ -234,18 +231,21 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
234
231
|
name: "".concat(name, ".").concat(customProperty.value, "[0].value"),
|
|
235
232
|
onChange: handleChange,
|
|
236
233
|
required: !customProperty.primary,
|
|
237
|
-
validate:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}, fieldProps));
|
|
234
|
+
validate: (fieldValue, allValues) => customPropertyValidator(fieldValue, allValues),
|
|
235
|
+
...fieldProps
|
|
236
|
+
});
|
|
241
237
|
};
|
|
242
|
-
|
|
238
|
+
const renderCustomPropertyVisibility = () => {
|
|
243
239
|
var _value$customProperty, _value$customProperty2, _customPropertyObject;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
240
|
+
const customPropertyObject = (_value$customProperty = (_value$customProperty2 = value[customProperty.value]) === null || _value$customProperty2 === void 0 ? void 0 : _value$customProperty2[0]) !== null && _value$customProperty !== void 0 ? _value$customProperty : {};
|
|
241
|
+
const handleChange = e => {
|
|
242
|
+
onChange({
|
|
243
|
+
...value,
|
|
244
|
+
[customProperty.value]: [{
|
|
245
|
+
...customPropertyObject,
|
|
246
|
+
internal: e.target.value
|
|
247
|
+
}]
|
|
248
|
+
});
|
|
249
249
|
};
|
|
250
250
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
|
|
251
251
|
"data-test-customproperty-visibility": true,
|
|
@@ -271,13 +271,17 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
271
271
|
value: (_customPropertyObject = customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.internal) !== null && _customPropertyObject !== void 0 ? _customPropertyObject : customProperty.defaultInternal
|
|
272
272
|
});
|
|
273
273
|
};
|
|
274
|
-
|
|
274
|
+
const renderCustomPropertyNoteInternal = () => {
|
|
275
275
|
var _value$customProperty3, _value$customProperty4;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
276
|
+
const customPropertyObject = (_value$customProperty3 = (_value$customProperty4 = value[customProperty.value]) === null || _value$customProperty4 === void 0 ? void 0 : _value$customProperty4[0]) !== null && _value$customProperty3 !== void 0 ? _value$customProperty3 : {};
|
|
277
|
+
const handleChange = e => {
|
|
278
|
+
onChange({
|
|
279
|
+
...value,
|
|
280
|
+
[customProperty.value]: [{
|
|
281
|
+
...customPropertyObject,
|
|
282
|
+
note: e.target.value
|
|
283
|
+
}]
|
|
284
|
+
});
|
|
281
285
|
};
|
|
282
286
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
|
|
283
287
|
"data-test-customproperty-note": true,
|
|
@@ -290,13 +294,17 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
290
294
|
value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.note
|
|
291
295
|
});
|
|
292
296
|
};
|
|
293
|
-
|
|
297
|
+
const renderCustomPropertyNotePublic = () => {
|
|
294
298
|
var _value$customProperty5, _value$customProperty6;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
299
|
+
const customPropertyObject = (_value$customProperty5 = (_value$customProperty6 = value[customProperty.value]) === null || _value$customProperty6 === void 0 ? void 0 : _value$customProperty6[0]) !== null && _value$customProperty5 !== void 0 ? _value$customProperty5 : {};
|
|
300
|
+
const handleChange = e => {
|
|
301
|
+
onChange({
|
|
302
|
+
...value,
|
|
303
|
+
[customProperty.value]: [{
|
|
304
|
+
...customPropertyObject,
|
|
305
|
+
publicNote: e.target.value
|
|
306
|
+
}]
|
|
307
|
+
});
|
|
300
308
|
};
|
|
301
309
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
|
|
302
310
|
"data-test-customproperty-public-note": true,
|
|
@@ -355,5 +363,4 @@ CustomPropertyField.propTypes = {
|
|
|
355
363
|
setCustomProperties: _propTypes.default.func,
|
|
356
364
|
value: _propTypes.default.object
|
|
357
365
|
};
|
|
358
|
-
var _default = CustomPropertyField;
|
|
359
|
-
exports.default = _default;
|
|
366
|
+
var _default = exports.default = CustomPropertyField;
|