@k-int/stripes-kint-components 3.0.4 → 3.2.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 +13 -10
- package/LICENSE +201 -0
- package/es/artifacts/coverage-jest/lcov-report/block-navigation.js +6 -19
- package/es/artifacts/coverage-jest/lcov-report/prettify.js +2 -182
- package/es/artifacts/coverage-jest/lcov-report/sorter.js +64 -94
- package/es/index.js +13 -27
- package/es/lib/ActionList/ActionList.js +20 -40
- package/es/lib/ActionList/ActionListFieldArray.js +67 -129
- package/es/lib/ActionList/index.js +0 -2
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +34 -61
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +2 -9
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +92 -138
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +3 -18
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +18 -51
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +13 -35
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +5 -14
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -23
- package/es/lib/CustomProperties/Config/index.js +0 -5
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +8 -14
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +1 -9
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +25 -35
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +1 -9
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +32 -75
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +3 -20
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +34 -91
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +6 -33
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +15 -27
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +3 -13
- package/es/lib/CustomProperties/Edit/index.js +0 -6
- package/es/lib/CustomProperties/Edit/testResources.js +0 -3
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +35 -67
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +2 -19
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +13 -42
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +1 -12
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +6 -18
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +2 -19
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +10 -23
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +2 -19
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +13 -31
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +1 -32
- package/es/lib/CustomProperties/Filter/index.js +0 -7
- package/es/lib/CustomProperties/Filter/testResources.js +0 -3
- package/es/lib/CustomProperties/Filter/useOperators.js +5 -19
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +3 -15
- package/es/lib/CustomProperties/Filter/useValueProps.js +5 -22
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +8 -14
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +1 -10
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +45 -62
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +1 -13
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +11 -33
- package/es/lib/CustomProperties/View/index.js +0 -4
- package/es/lib/CustomProperties/index.js +0 -4
- package/es/lib/CycleButton/CycleButton.js +8 -33
- package/es/lib/CycleButton/index.js +0 -2
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +87 -132
- package/es/lib/EditableRefdataCategoryList/index.js +0 -2
- package/es/lib/EditableRefdataList/EditableRefdataList.js +92 -140
- package/es/lib/EditableRefdataList/index.js +0 -2
- package/es/lib/EditableSettingsList/EditableSettingsList.js +7 -17
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +6 -19
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +4 -19
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +7 -29
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +19 -26
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +6 -23
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +14 -35
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +18 -55
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/index.js +0 -4
- package/es/lib/EditableSettingsList/index.js +0 -4
- package/es/lib/FormModal/FormModal.js +16 -35
- package/es/lib/FormModal/index.js +0 -2
- package/es/lib/FormattedKintMessage/FormattedKintMessage.js +10 -31
- package/es/lib/FormattedKintMessage/index.js +0 -2
- package/es/lib/IconSelect/IconSelect.js +26 -63
- package/es/lib/IconSelect/index.js +0 -2
- package/es/lib/NoResultsMessage/NoResultsMessage.js +18 -28
- package/es/lib/NoResultsMessage/index.js +0 -2
- package/es/lib/QueryTypedown/QueryTypedown.js +9 -36
- package/es/lib/QueryTypedown/index.js +0 -2
- package/es/lib/RefdataButtons/RefdataButtons.js +5 -24
- package/es/lib/RefdataButtons/index.js +0 -2
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +148 -0
- package/es/lib/ResponsiveButtonGroup/index.js +13 -0
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +74 -0
- package/es/lib/RichSelect/RichSelect.js +38 -65
- package/es/lib/RichSelect/index.js +0 -3
- package/es/lib/RichSelect/useSelectedOption.js +3 -14
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +75 -93
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +20 -33
- package/es/lib/SASQLookupComponent/TableBody/index.js +0 -2
- package/es/lib/SASQLookupComponent/index.js +0 -3
- package/es/lib/SASQRoute/SASQRoute.js +21 -29
- package/es/lib/SASQRoute/index.js +0 -2
- package/es/lib/SASQViewComponent/SASQViewComponent.js +37 -41
- package/es/lib/SASQViewComponent/index.js +0 -2
- package/es/lib/SearchField/SearchField.js +1 -17
- package/es/lib/SearchField/index.js +0 -2
- package/es/lib/SettingPage/SettingPage.js +10 -25
- package/es/lib/SettingPage/SettingPagePane.js +3 -11
- package/es/lib/SettingPage/index.js +0 -3
- package/es/lib/Typedown/Typedown.js +51 -82
- package/es/lib/Typedown/index.js +0 -2
- package/es/lib/contexts/SettingsContext.js +0 -2
- package/es/lib/contexts/index.js +0 -2
- package/es/lib/hooks/__mocks__/index.js +0 -5
- package/es/lib/hooks/index.js +7 -18
- package/es/lib/hooks/settingsHooks/index.js +0 -4
- package/es/lib/hooks/settingsHooks/useAppSettings.js +6 -27
- package/es/lib/hooks/settingsHooks/useSettingSection.js +10 -20
- package/es/lib/hooks/settingsHooks/useSettings.js +13 -44
- package/es/lib/hooks/typedownHooks/index.js +0 -4
- package/es/lib/hooks/typedownHooks/useTypedown.js +17 -37
- package/es/lib/hooks/typedownHooks/useTypedownData.js +12 -26
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +5 -19
- package/es/lib/hooks/useActiveElement.js +3 -15
- package/es/lib/hooks/useCustomProperties.js +11 -25
- package/es/lib/hooks/useHelperApp.js +7 -30
- package/es/lib/hooks/useIntlKey.js +0 -7
- package/es/lib/hooks/useIntlKeyStore.js +2 -24
- package/es/lib/hooks/useInvalidateRefdata.js +0 -4
- package/es/lib/hooks/useKintIntl.js +13 -32
- package/es/lib/hooks/useKiwtFieldArray.js +5 -29
- package/es/lib/hooks/useKiwtSASQuery.js +12 -37
- package/es/lib/hooks/useLocalStorageState.js +5 -21
- package/es/lib/hooks/useMutateCustomProperties.js +11 -28
- package/es/lib/hooks/useMutateRefdataCategory.js +9 -29
- package/es/lib/hooks/useMutateRefdataValue.js +10 -27
- package/es/lib/hooks/useQIndex.js +3 -27
- package/es/lib/hooks/useRefdata.js +7 -16
- package/es/lib/hooks/useSASQQueryMeta.js +41 -0
- package/es/lib/hooks/useTemplates.js +6 -17
- package/es/lib/utils/buildUrl.js +1 -10
- package/es/lib/utils/generateKiwtQuery.js +3 -8
- package/es/lib/utils/generateKiwtQueryParams.js +46 -74
- package/es/lib/utils/groupCustomPropertiesByCtx.js +0 -14
- package/es/lib/utils/highlightString.js +6 -23
- package/es/lib/utils/index.js +0 -15
- package/es/lib/utils/matchString.js +0 -6
- package/es/lib/utils/parseErrorResponse.js +1 -23
- package/es/lib/utils/refdataQueryKey.js +0 -4
- package/es/lib/utils/selectorSafe.js +0 -2
- package/es/lib/utils/sortByLabel.js +0 -6
- package/es/lib/utils/toCamelCase.js +6 -5
- package/es/lib/utils/typedownQueryKey.js +0 -4
- package/es/lib/utils/validators.js +5 -38
- package/junit.xml +148 -148
- package/package.json +2 -2
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +44 -254
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionTrigger.js.html +418 -0
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +24 -9
- package/src/artifacts/coverage-jest/lcov-report/ActionList/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 +4 -4
- 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 +5 -5
- 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 +29 -92
- 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 +19 -19
- 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 +17 -17
- 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 +15 -15
- 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 +74 -8
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +31 -4
- 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 +2 -2
- 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 +7 -7
- 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 +3 -3
- 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 +18 -3
- 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/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 +83 -11
- 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 +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +53 -8
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +65 -11
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +9 -9
- 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 +56 -5
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +7 -7
- 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/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/customProperties.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 +1 -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 +24 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +5 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +9 -3
- 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 +3 -3
- 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 +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.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/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 +187 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +92 -77
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +20 -20
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +39 -39
- package/src/artifacts/coverage-jest/lcov.info +1063 -760
- package/src/index.js +4 -1
- package/src/lib/CustomProperties/Edit/CustomPropertyField.js +0 -7
- package/src/lib/IconSelect/IconSelect.js +22 -20
- package/src/lib/NoResultsMessage/NoResultsMessage.js +1 -1
- package/src/lib/ResponsiveButtonGroup/README.md +31 -0
- package/src/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +150 -0
- package/src/lib/ResponsiveButtonGroup/index.js +1 -0
- package/src/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +56 -0
- package/src/lib/RichSelect/RichSelect.js +1 -0
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +34 -5
- package/src/lib/SASQRoute/SASQRoute.js +18 -3
- package/src/lib/SASQViewComponent/SASQViewComponent.js +23 -5
- package/src/lib/hooks/index.js +1 -0
- package/src/lib/hooks/useSASQQueryMeta.js +34 -0
- package/src/lib/utils/README.md +3 -1
- package/src/lib/utils/generateKiwtQuery.js +3 -3
- package/src/lib/utils/generateKiwtQueryParams.js +27 -13
- package/styles/ResponsiveButtonGroup.css +79 -0
|
@@ -1,74 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _reactFinalForm = require("react-final-form");
|
|
13
|
-
|
|
14
10
|
var _components = require("@folio/stripes/components");
|
|
15
|
-
|
|
16
11
|
var CUSTOM_PROPERTY_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
|
|
17
|
-
|
|
18
12
|
var _hooks = require("../../hooks");
|
|
19
|
-
|
|
20
|
-
var _utils = require("../../utils");
|
|
21
|
-
|
|
22
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
|
|
24
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
-
|
|
26
15
|
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; }
|
|
27
|
-
|
|
28
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
-
|
|
32
18
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
33
|
-
|
|
34
19
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
-
|
|
36
20
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
37
|
-
|
|
38
21
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
39
|
-
|
|
40
22
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
41
|
-
|
|
42
23
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
43
|
-
|
|
44
24
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
45
|
-
|
|
46
25
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
47
|
-
|
|
48
26
|
var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
49
27
|
var availableCustomProperties = _ref.availableCustomProperties,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
63
|
-
|
|
28
|
+
customProperty = _ref.customProperty,
|
|
29
|
+
customPropertyType = _ref.customPropertyType,
|
|
30
|
+
customProperties = _ref.customProperties,
|
|
31
|
+
index = _ref.index,
|
|
32
|
+
passedIntlKey = _ref.intlKey,
|
|
33
|
+
passedIntlNS = _ref.intlNS,
|
|
34
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
35
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
36
|
+
name = _ref.name,
|
|
37
|
+
_onChange = _ref.onChange,
|
|
38
|
+
value = _ref.value,
|
|
39
|
+
setCustomProperties = _ref.setCustomProperties;
|
|
40
|
+
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
41
|
+
|
|
42
|
+
// Set up the validator for the customProperty
|
|
64
43
|
var customPropertyValidator = function customPropertyValidator(fieldValue, allValues) {
|
|
65
44
|
var _allValues$customProp, _allValues$customProp2, _allValues$customProp3;
|
|
66
|
-
|
|
67
45
|
var _ref2 = (_allValues$customProp = allValues === null || allValues === void 0 ? void 0 : (_allValues$customProp2 = allValues.customProperties) === null || _allValues$customProp2 === void 0 ? void 0 : (_allValues$customProp3 = _allValues$customProp2[customProperty === null || customProperty === void 0 ? void 0 : customProperty.value]) === null || _allValues$customProp3 === void 0 ? void 0 : _allValues$customProp3[0]) !== null && _allValues$customProp !== void 0 ? _allValues$customProp : {},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
46
|
+
note = _ref2.note,
|
|
47
|
+
publicNote = _ref2.publicNote,
|
|
48
|
+
currentValue = _ref2.value;
|
|
72
49
|
if (note && !currentValue || publicNote && !currentValue) {
|
|
73
50
|
if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME || customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
|
|
74
51
|
return kintIntl.formatKintMessage({
|
|
@@ -82,7 +59,6 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
82
59
|
});
|
|
83
60
|
}
|
|
84
61
|
}
|
|
85
|
-
|
|
86
62
|
if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME) {
|
|
87
63
|
var regexp = /^-?[\d]*(\.[\d]{0,2})?$/;
|
|
88
64
|
return fieldValue && !regexp.test(fieldValue) ? kintIntl.formatKintMessage({
|
|
@@ -90,7 +66,6 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
90
66
|
overrideValue: labelOverrides.maxTwoDecimalsError
|
|
91
67
|
}) : undefined;
|
|
92
68
|
}
|
|
93
|
-
|
|
94
69
|
if (customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
|
|
95
70
|
var min = Number.MIN_SAFE_INTEGER;
|
|
96
71
|
var max = Number.MAX_SAFE_INTEGER;
|
|
@@ -102,34 +77,30 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
102
77
|
max: max
|
|
103
78
|
}) : undefined;
|
|
104
79
|
}
|
|
105
|
-
|
|
106
80
|
if (!customProperty.primary && !currentValue) {
|
|
107
81
|
return kintIntl.formatMessage({
|
|
108
82
|
id: 'stripes-core.label.missingRequiredField'
|
|
109
83
|
});
|
|
110
84
|
}
|
|
111
|
-
|
|
112
85
|
return undefined;
|
|
113
86
|
};
|
|
114
|
-
|
|
115
87
|
var getCustomProperty = function getCustomProperty(customPropertyValue) {
|
|
116
88
|
return availableCustomProperties.find(function (cp) {
|
|
117
89
|
return cp.value === customPropertyValue;
|
|
118
90
|
});
|
|
119
91
|
};
|
|
120
|
-
|
|
121
92
|
var renderCustomPropertyName = function renderCustomPropertyName() {
|
|
122
93
|
var _customPropertyValue$;
|
|
123
|
-
|
|
124
94
|
var unsetCustomProperties = availableCustomProperties.filter(function (t) {
|
|
125
95
|
var _custPropValue$;
|
|
126
|
-
|
|
127
96
|
// Only optional properties can be set
|
|
128
97
|
if (t.primary) return false;
|
|
129
|
-
var custPropValue = value[t.value];
|
|
98
|
+
var custPropValue = value[t.value];
|
|
130
99
|
|
|
131
|
-
|
|
100
|
+
// The customProperty is unset and has no value.
|
|
101
|
+
if (custPropValue === undefined) return true;
|
|
132
102
|
|
|
103
|
+
// The customProperty is set but is marked for deletion. Allow reuse.
|
|
133
104
|
if ((_custPropValue$ = custPropValue[0]) !== null && _custPropValue$ !== void 0 && _custPropValue$._delete) return true;
|
|
134
105
|
return false;
|
|
135
106
|
});
|
|
@@ -146,19 +117,18 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
146
117
|
}),
|
|
147
118
|
onChange: function onChange(e) {
|
|
148
119
|
var _objectSpread2;
|
|
120
|
+
var newValue = e.target.value;
|
|
149
121
|
|
|
150
|
-
|
|
151
|
-
|
|
122
|
+
// Update `state.customProperties` which controls what customProperties are being edited.
|
|
152
123
|
var newCustomProperties = _toConsumableArray(customProperties);
|
|
153
|
-
|
|
154
124
|
newCustomProperties[index] = getCustomProperty(newValue);
|
|
155
|
-
setCustomProperties(newCustomProperties);
|
|
125
|
+
setCustomProperties(newCustomProperties);
|
|
126
|
+
|
|
127
|
+
// Update final-form (which tracks what the values for a given customProperty are) because
|
|
156
128
|
// in essence we're deleting a customProperty and creating a new customProperty.
|
|
157
129
|
// We do this by 1) marking the current customProperty for deletion and 2) initing
|
|
158
130
|
// the new customProperty to an empty object.
|
|
159
|
-
|
|
160
131
|
var currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
|
|
161
|
-
|
|
162
132
|
_onChange(_objectSpread(_objectSpread({}, value), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, customProperty.value, [{
|
|
163
133
|
id: currentValue.id,
|
|
164
134
|
_delete: true
|
|
@@ -168,26 +138,22 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
168
138
|
value: customProperty.value
|
|
169
139
|
});
|
|
170
140
|
};
|
|
171
|
-
|
|
172
141
|
var renderCustomPropertyValue = function renderCustomPropertyValue() {
|
|
173
142
|
var _customProperty$optio;
|
|
174
|
-
|
|
175
143
|
var currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
|
|
176
144
|
var min = Number.MIN_SAFE_INTEGER;
|
|
177
|
-
var max = Number.MAX_SAFE_INTEGER;
|
|
145
|
+
var max = Number.MAX_SAFE_INTEGER;
|
|
178
146
|
|
|
147
|
+
// Default change handler
|
|
179
148
|
var handleChange = function handleChange(e) {
|
|
180
149
|
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
181
150
|
_delete: e.target.value === '',
|
|
182
151
|
// Delete customProperty if removing the value.
|
|
183
152
|
value: e.target.value // send down the number for integers and decimal types
|
|
184
|
-
|
|
185
153
|
})])));
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
|
|
154
|
+
};
|
|
155
|
+
// Figure out which component we're rendering and specify its unique props.
|
|
189
156
|
var fieldProps;
|
|
190
|
-
|
|
191
157
|
switch (customProperty.type) {
|
|
192
158
|
case CUSTOM_PROPERTY_TYPES.REFDATA_CLASS_NAME:
|
|
193
159
|
fieldProps = {
|
|
@@ -198,7 +164,6 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
198
164
|
}
|
|
199
165
|
};
|
|
200
166
|
break;
|
|
201
|
-
|
|
202
167
|
case CUSTOM_PROPERTY_TYPES.MULTI_REFDATA_CLASS_NAME:
|
|
203
168
|
fieldProps = {
|
|
204
169
|
component: _components.MultiSelection,
|
|
@@ -207,8 +172,8 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
207
172
|
return !!(opt !== null && opt !== void 0 && opt.value);
|
|
208
173
|
}),
|
|
209
174
|
renderToOverlay: true
|
|
210
|
-
};
|
|
211
|
-
|
|
175
|
+
};
|
|
176
|
+
// MultiSelection passes the changed array as a value not an event
|
|
212
177
|
handleChange = function handleChange(refdataArray) {
|
|
213
178
|
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
214
179
|
_delete: (refdataArray === null || refdataArray === void 0 ? void 0 : refdataArray.length) === 0 ? true : undefined,
|
|
@@ -216,9 +181,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
216
181
|
value: refdataArray
|
|
217
182
|
})])));
|
|
218
183
|
};
|
|
219
|
-
|
|
220
184
|
break;
|
|
221
|
-
|
|
222
185
|
case CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME:
|
|
223
186
|
case CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME:
|
|
224
187
|
fieldProps = {
|
|
@@ -228,7 +191,6 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
228
191
|
step: 'any',
|
|
229
192
|
type: 'number'
|
|
230
193
|
};
|
|
231
|
-
|
|
232
194
|
handleChange = function handleChange(e) {
|
|
233
195
|
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
234
196
|
_delete: e.target.value === '' ? true : undefined,
|
|
@@ -236,19 +198,16 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
236
198
|
value: parseFloat(e.target.value)
|
|
237
199
|
})])));
|
|
238
200
|
};
|
|
239
|
-
|
|
240
201
|
break;
|
|
241
|
-
|
|
242
202
|
case CUSTOM_PROPERTY_TYPES.TEXT_CLASS_NAME:
|
|
243
203
|
fieldProps = {
|
|
244
204
|
component: _components.TextArea,
|
|
245
205
|
parse: function parse(v) {
|
|
246
206
|
return v;
|
|
247
207
|
} // Lets us send an empty string instead of `undefined`
|
|
248
|
-
|
|
249
208
|
};
|
|
250
|
-
break;
|
|
251
209
|
|
|
210
|
+
break;
|
|
252
211
|
case CUSTOM_PROPERTY_TYPES.DATE_CLASS_NAME:
|
|
253
212
|
fieldProps = {
|
|
254
213
|
component: _components.Datepicker,
|
|
@@ -257,14 +216,12 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
257
216
|
usePortal: true
|
|
258
217
|
};
|
|
259
218
|
break;
|
|
260
|
-
|
|
261
219
|
default:
|
|
262
220
|
fieldProps = {
|
|
263
221
|
component: _components.TextField
|
|
264
222
|
};
|
|
265
223
|
break;
|
|
266
224
|
}
|
|
267
|
-
|
|
268
225
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, _objectSpread({
|
|
269
226
|
"data-test-customproperty-value": true,
|
|
270
227
|
id: "edit-customproperty-".concat(index, "-value"),
|
|
@@ -280,18 +237,14 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
280
237
|
}
|
|
281
238
|
}, fieldProps));
|
|
282
239
|
};
|
|
283
|
-
|
|
284
240
|
var renderCustomPropertyVisibility = function renderCustomPropertyVisibility() {
|
|
285
241
|
var _value$customProperty, _value$customProperty2, _customPropertyObject;
|
|
286
|
-
|
|
287
242
|
var 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 : {};
|
|
288
|
-
|
|
289
243
|
var handleChange = function handleChange(e) {
|
|
290
244
|
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
291
245
|
internal: e.target.value
|
|
292
246
|
})])));
|
|
293
247
|
};
|
|
294
|
-
|
|
295
248
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
|
|
296
249
|
"data-test-customproperty-visibility": true,
|
|
297
250
|
dataOptions: [{
|
|
@@ -316,18 +269,14 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
316
269
|
value: (_customPropertyObject = customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.internal) !== null && _customPropertyObject !== void 0 ? _customPropertyObject : customProperty.defaultInternal
|
|
317
270
|
});
|
|
318
271
|
};
|
|
319
|
-
|
|
320
272
|
var renderCustomPropertyNoteInternal = function renderCustomPropertyNoteInternal() {
|
|
321
273
|
var _value$customProperty3, _value$customProperty4;
|
|
322
|
-
|
|
323
274
|
var 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 : {};
|
|
324
|
-
|
|
325
275
|
var handleChange = function handleChange(e) {
|
|
326
276
|
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
327
277
|
note: e.target.value
|
|
328
278
|
})])));
|
|
329
279
|
};
|
|
330
|
-
|
|
331
280
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
|
|
332
281
|
"data-test-customproperty-note": true,
|
|
333
282
|
id: "edit-customproperty-".concat(index, "-internal-note"),
|
|
@@ -339,18 +288,14 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
339
288
|
value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.note
|
|
340
289
|
});
|
|
341
290
|
};
|
|
342
|
-
|
|
343
291
|
var renderCustomPropertyNotePublic = function renderCustomPropertyNotePublic() {
|
|
344
292
|
var _value$customProperty5, _value$customProperty6;
|
|
345
|
-
|
|
346
293
|
var 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 : {};
|
|
347
|
-
|
|
348
294
|
var handleChange = function handleChange(e) {
|
|
349
295
|
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
350
296
|
publicNote: e.target.value
|
|
351
297
|
})])));
|
|
352
298
|
};
|
|
353
|
-
|
|
354
299
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
|
|
355
300
|
"data-test-customproperty-public-note": true,
|
|
356
301
|
id: "edit-customproperty-".concat(index, "-public-note"),
|
|
@@ -362,7 +307,6 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
362
307
|
value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.publicNote
|
|
363
308
|
});
|
|
364
309
|
};
|
|
365
|
-
|
|
366
310
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
367
311
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
368
312
|
"data-testid": "customPropertyField",
|
|
@@ -395,7 +339,6 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
|
395
339
|
})
|
|
396
340
|
});
|
|
397
341
|
};
|
|
398
|
-
|
|
399
342
|
CustomPropertyField.propTypes = {
|
|
400
343
|
availableCustomProperties: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
401
344
|
customProperty: _propTypes.default.object,
|
|
@@ -1,44 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
|
-
|
|
5
4
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
5
|
require("@folio/stripes-erm-components/test/jest/__mock__");
|
|
8
|
-
|
|
9
6
|
var _stripesTesting = require("@folio/stripes-testing");
|
|
10
|
-
|
|
11
7
|
var _helpers = require("@folio/stripes-erm-components/test/jest/helpers");
|
|
12
|
-
|
|
13
8
|
var _CustomPropertyField = _interopRequireDefault(require("./CustomPropertyField"));
|
|
14
|
-
|
|
15
9
|
var _jest = require("../../../../test/jest");
|
|
16
|
-
|
|
17
10
|
var _testResources = require("./testResources");
|
|
18
|
-
|
|
19
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
|
|
21
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
|
|
23
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
24
|
-
|
|
13
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
25
14
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
26
|
-
|
|
27
15
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
28
|
-
|
|
29
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
|
-
|
|
31
17
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
32
|
-
|
|
33
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
|
-
|
|
35
19
|
var onSubmit = jest.fn();
|
|
36
20
|
jest.mock('../../hooks');
|
|
37
|
-
|
|
38
21
|
var onChange = function onChange() {};
|
|
39
|
-
|
|
40
22
|
var setCustomProperties = function setCustomProperties() {};
|
|
41
|
-
|
|
42
23
|
var authIdentCustom = _jest.availableCustomProperties === null || _jest.availableCustomProperties === void 0 ? void 0 : _jest.availableCustomProperties.find(function (cp) {
|
|
43
24
|
return cp.value === 'AuthorIdentification';
|
|
44
25
|
});
|
|
@@ -77,12 +58,12 @@ describe('CustomPropertyField', function () {
|
|
|
77
58
|
}))
|
|
78
59
|
}));
|
|
79
60
|
var _renderComponent = renderComponent,
|
|
80
|
-
|
|
61
|
+
getByTestId = _renderComponent.getByTestId;
|
|
81
62
|
expect(getByTestId('customPropertyField')).toBeInTheDocument();
|
|
82
63
|
});
|
|
83
64
|
it('Displays expected value(s) label ', function () {
|
|
84
65
|
var _renderComponent2 = renderComponent,
|
|
85
|
-
|
|
66
|
+
getByText = _renderComponent2.getByText;
|
|
86
67
|
expect(getByText('Value(s)')).toBeInTheDocument();
|
|
87
68
|
});
|
|
88
69
|
test('Displays expected Value(s) dropdown values ', function () {
|
|
@@ -90,7 +71,7 @@ describe('CustomPropertyField', function () {
|
|
|
90
71
|
});
|
|
91
72
|
it('Displays expected Internal note label ', function () {
|
|
92
73
|
var _renderComponent3 = renderComponent,
|
|
93
|
-
|
|
74
|
+
getByText = _renderComponent3.getByText;
|
|
94
75
|
expect(getByText('Internal note')).toBeInTheDocument();
|
|
95
76
|
});
|
|
96
77
|
test('Displays expected internal note value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -102,7 +83,6 @@ describe('CustomPropertyField', function () {
|
|
|
102
83
|
return (0, _stripesTesting.TextArea)('Internal note').has({
|
|
103
84
|
value: 'this is an internal note'
|
|
104
85
|
});
|
|
105
|
-
|
|
106
86
|
case 2:
|
|
107
87
|
case "end":
|
|
108
88
|
return _context.stop();
|
|
@@ -115,7 +95,7 @@ describe('CustomPropertyField', function () {
|
|
|
115
95
|
});
|
|
116
96
|
it('Displays expected Public note label ', function () {
|
|
117
97
|
var _renderComponent4 = renderComponent,
|
|
118
|
-
|
|
98
|
+
getByText = _renderComponent4.getByText;
|
|
119
99
|
expect(getByText('Public note')).toBeInTheDocument();
|
|
120
100
|
});
|
|
121
101
|
test('Displays expected public note value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
@@ -127,7 +107,6 @@ describe('CustomPropertyField', function () {
|
|
|
127
107
|
return (0, _stripesTesting.TextArea)('Public note').has({
|
|
128
108
|
value: 'this is a public note'
|
|
129
109
|
});
|
|
130
|
-
|
|
131
110
|
case 2:
|
|
132
111
|
case "end":
|
|
133
112
|
return _context2.stop();
|
|
@@ -156,7 +135,6 @@ describe('CustomPropertyField', function () {
|
|
|
156
135
|
return (0, _stripesTesting.TextInput)({
|
|
157
136
|
id: 'edit-customproperty-2-value'
|
|
158
137
|
}).exists();
|
|
159
|
-
|
|
160
138
|
case 2:
|
|
161
139
|
case "end":
|
|
162
140
|
return _context3.stop();
|
|
@@ -187,7 +165,6 @@ describe('CustomPropertyField', function () {
|
|
|
187
165
|
}).has({
|
|
188
166
|
value: '1'
|
|
189
167
|
});
|
|
190
|
-
|
|
191
168
|
case 2:
|
|
192
169
|
case "end":
|
|
193
170
|
return _context4.stop();
|
|
@@ -214,7 +191,6 @@ describe('CustomPropertyField', function () {
|
|
|
214
191
|
case 0:
|
|
215
192
|
_context5.next = 2;
|
|
216
193
|
return (0, _stripesTesting.MultiSelect)('Value(s)').exists();
|
|
217
|
-
|
|
218
194
|
case 2:
|
|
219
195
|
case "end":
|
|
220
196
|
return _context5.stop();
|
|
@@ -224,7 +200,7 @@ describe('CustomPropertyField', function () {
|
|
|
224
200
|
})));
|
|
225
201
|
it('Displays expected value(s) label ', function () {
|
|
226
202
|
var _renderComponent5 = renderComponent,
|
|
227
|
-
|
|
203
|
+
getByText = _renderComponent5.getByText;
|
|
228
204
|
expect(getByText('Value(s)')).toBeInTheDocument();
|
|
229
205
|
});
|
|
230
206
|
test('renders multi-select Refdata values', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
@@ -234,7 +210,6 @@ describe('CustomPropertyField', function () {
|
|
|
234
210
|
case 0:
|
|
235
211
|
_context6.next = 2;
|
|
236
212
|
return (0, _stripesTesting.MultiSelect)('Value(s)').select(['Future', 'Current', 'Historical', 'Does not apply']);
|
|
237
|
-
|
|
238
213
|
case 2:
|
|
239
214
|
case "end":
|
|
240
215
|
return _context6.stop();
|
|
@@ -261,7 +236,6 @@ describe('CustomPropertyField', function () {
|
|
|
261
236
|
case 0:
|
|
262
237
|
_context7.next = 2;
|
|
263
238
|
return (0, _stripesTesting.Datepicker)('Value(s)').exists();
|
|
264
|
-
|
|
265
239
|
case 2:
|
|
266
240
|
case "end":
|
|
267
241
|
return _context7.stop();
|
|
@@ -278,7 +252,6 @@ describe('CustomPropertyField', function () {
|
|
|
278
252
|
return (0, _stripesTesting.TextInput)({
|
|
279
253
|
id: 'edit-customproperty-5-value'
|
|
280
254
|
}).exists();
|
|
281
|
-
|
|
282
255
|
case 2:
|
|
283
256
|
case "end":
|
|
284
257
|
return _context8.stop();
|
|
@@ -4,37 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
var _components = require("@folio/stripes/components");
|
|
11
|
-
|
|
12
9
|
var _CustomPropertyField = _interopRequireDefault(require("./CustomPropertyField"));
|
|
13
|
-
|
|
14
10
|
var _hooks = require("../../hooks");
|
|
15
|
-
|
|
16
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
var CustomPropertyFormCard = function CustomPropertyFormCard(_ref) {
|
|
21
14
|
var availableCustomProperties = _ref.availableCustomProperties,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
customProperty = _ref.customProperty,
|
|
16
|
+
customPropertyType = _ref.customPropertyType,
|
|
17
|
+
customProperties = _ref.customProperties,
|
|
18
|
+
handleDeleteCustomProperty = _ref.handleDeleteCustomProperty,
|
|
19
|
+
index = _ref.index,
|
|
20
|
+
internalPropertyCounter = _ref.internalPropertyCounter,
|
|
21
|
+
passedIntlKey = _ref.intlKey,
|
|
22
|
+
passedIntlNS = _ref.intlNS,
|
|
23
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
24
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
25
|
+
name = _ref.name,
|
|
26
|
+
onChange = _ref.onChange,
|
|
27
|
+
setCustomProperties = _ref.setCustomProperties,
|
|
28
|
+
value = _ref.value;
|
|
36
29
|
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
37
|
-
|
|
38
30
|
var getHeader = function getHeader() {
|
|
39
31
|
if (customPropertyType === 'optional') {
|
|
40
32
|
return kintIntl.formatKintMessage({
|
|
@@ -45,7 +37,6 @@ var CustomPropertyFormCard = function CustomPropertyFormCard(_ref) {
|
|
|
45
37
|
name: customProperty.value
|
|
46
38
|
});
|
|
47
39
|
}
|
|
48
|
-
|
|
49
40
|
return kintIntl.formatKintMessage({
|
|
50
41
|
id: 'customProperty.primaryPropertyHeader',
|
|
51
42
|
overrideValue: labelOverrides.primaryPropertyHeader,
|
|
@@ -55,7 +46,6 @@ var CustomPropertyFormCard = function CustomPropertyFormCard(_ref) {
|
|
|
55
46
|
name: customProperty.value
|
|
56
47
|
});
|
|
57
48
|
};
|
|
58
|
-
|
|
59
49
|
var getTooltipText = function getTooltipText() {
|
|
60
50
|
return kintIntl.formatKintMessage({
|
|
61
51
|
id: 'customProperty.remove',
|
|
@@ -65,7 +55,6 @@ var CustomPropertyFormCard = function CustomPropertyFormCard(_ref) {
|
|
|
65
55
|
name: customProperty.value
|
|
66
56
|
});
|
|
67
57
|
};
|
|
68
|
-
|
|
69
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Card, {
|
|
70
59
|
"data-testid": "custom-property-form-card",
|
|
71
60
|
headerEnd: customPropertyType === 'optional' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
@@ -73,7 +62,7 @@ var CustomPropertyFormCard = function CustomPropertyFormCard(_ref) {
|
|
|
73
62
|
text: getTooltipText(),
|
|
74
63
|
children: function children(_ref2) {
|
|
75
64
|
var ref = _ref2.ref,
|
|
76
|
-
|
|
65
|
+
ariaIds = _ref2.ariaIds;
|
|
77
66
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
78
67
|
ref: ref,
|
|
79
68
|
"aria-labelledby": ariaIds.text,
|
|
@@ -107,7 +96,6 @@ var CustomPropertyFormCard = function CustomPropertyFormCard(_ref) {
|
|
|
107
96
|
})
|
|
108
97
|
}, customProperty.value);
|
|
109
98
|
};
|
|
110
|
-
|
|
111
99
|
CustomPropertyFormCard.propTypes = {
|
|
112
100
|
availableCustomProperties: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
113
101
|
customProperty: _propTypes.default.object,
|