@k-int/stripes-kint-components 3.2.2 → 3.2.4
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 +10 -0
- package/es/index.js +78 -79
- package/es/lib/ActionList/ActionList.js +38 -51
- package/es/lib/ActionList/ActionListFieldArray.js +159 -194
- package/es/lib/ActionList/index.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +59 -83
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +15 -19
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +124 -177
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +30 -73
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +93 -106
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +83 -129
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +42 -43
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +48 -153
- 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 +33 -32
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +11 -16
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +88 -111
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +26 -69
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +134 -134
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +95 -192
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +46 -48
- 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 -39
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +64 -91
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -63
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +53 -77
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +17 -16
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +34 -31
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +18 -49
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -22
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +23 -56
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +44 -49
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +77 -257
- package/es/lib/CustomProperties/Filter/index.js +6 -6
- package/es/lib/CustomProperties/Filter/testResources.js +13 -37
- package/es/lib/CustomProperties/Filter/useOperators.js +18 -18
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +18 -33
- 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 +63 -80
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +14 -23
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +25 -31
- 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 +19 -35
- package/es/lib/CycleButton/index.js +1 -1
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +105 -164
- package/es/lib/EditableRefdataCategoryList/index.js +1 -1
- package/es/lib/EditableRefdataList/EditableRefdataList.js +119 -181
- package/es/lib/EditableRefdataList/index.js +1 -1
- package/es/lib/EditableSettingsList/EditableSettingsList.js +15 -13
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +19 -26
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +61 -96
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +27 -41
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +99 -83
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +25 -30
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +187 -299
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +76 -111
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +51 -172
- 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 +27 -35
- package/es/lib/FormattedKintMessage/index.js +1 -1
- package/es/lib/IconSelect/IconSelect.js +52 -77
- package/es/lib/IconSelect/index.js +1 -1
- package/es/lib/NoResultsMessage/NoResultsMessage.js +23 -23
- package/es/lib/NoResultsMessage/index.js +1 -1
- package/es/lib/QueryTypedown/QueryTypedown.js +16 -35
- package/es/lib/QueryTypedown/index.js +1 -1
- package/es/lib/RefdataButtons/RefdataButtons.js +30 -34
- package/es/lib/RefdataButtons/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +77 -95
- package/es/lib/ResponsiveButtonGroup/index.js +1 -1
- package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +24 -39
- package/es/lib/RichSelect/RichSelect.js +78 -100
- package/es/lib/RichSelect/index.js +2 -2
- package/es/lib/RichSelect/useSelectedOption.js +5 -16
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +107 -139
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +43 -52
- package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
- package/es/lib/SASQLookupComponent/index.js +2 -2
- package/es/lib/SASQRoute/SASQRoute.js +34 -41
- package/es/lib/SASQRoute/index.js +1 -1
- package/es/lib/SASQViewComponent/SASQViewComponent.js +37 -49
- package/es/lib/SASQViewComponent/index.js +1 -1
- package/es/lib/SearchField/SearchField.js +11 -18
- package/es/lib/SearchField/index.js +1 -1
- package/es/lib/SettingPage/SettingPage.js +20 -19
- package/es/lib/SettingPage/SettingPagePane.js +11 -10
- package/es/lib/SettingPage/index.js +2 -2
- package/es/lib/Typedown/Typedown.js +73 -98
- package/es/lib/Typedown/index.js +1 -1
- package/es/lib/constants/customProperties.js +11 -22
- 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 +20 -20
- package/es/lib/hooks/settingsHooks/index.js +3 -3
- package/es/lib/hooks/settingsHooks/useAppSettings.js +22 -34
- package/es/lib/hooks/settingsHooks/useSettingSection.js +17 -19
- package/es/lib/hooks/settingsHooks/useSettings.js +58 -72
- 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 +10 -20
- 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 +42 -51
- package/es/lib/hooks/useInvalidateRefdata.js +4 -7
- package/es/lib/hooks/useKintIntl.js +31 -41
- package/es/lib/hooks/useKiwtFieldArray.js +35 -47
- package/es/lib/hooks/useKiwtSASQuery.js +40 -51
- package/es/lib/hooks/useLocalStorageState.js +7 -20
- package/es/lib/hooks/useMutateCustomProperties.js +23 -73
- package/es/lib/hooks/useMutateRefdataCategory.js +22 -68
- package/es/lib/hooks/useMutateRefdataValue.js +31 -73
- package/es/lib/hooks/useQIndex.js +17 -32
- package/es/lib/hooks/useRefdata.js +19 -22
- package/es/lib/hooks/useSASQQueryMeta.js +14 -22
- package/es/lib/hooks/useTemplates.js +16 -16
- package/es/lib/utils/buildUrl.js +6 -6
- package/es/lib/utils/generateKiwtQuery.js +4 -7
- package/es/lib/utils/generateKiwtQueryParams.js +77 -96
- package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -21
- package/es/lib/utils/highlightString.js +17 -37
- package/es/lib/utils/index.js +21 -21
- package/es/lib/utils/matchString.js +5 -10
- package/es/lib/utils/parseErrorResponse.js +22 -67
- package/es/lib/utils/refdataOptions.js +2 -3
- package/es/lib/utils/refdataQueryKey.js +3 -4
- package/es/lib/utils/selectorSafe.js +2 -3
- package/es/lib/utils/sortByLabel.js +4 -6
- package/es/lib/utils/toCamelCase.js +8 -14
- package/es/lib/utils/typedownQueryKey.js +3 -4
- package/es/lib/utils/validators.js +25 -32
- package/package.json +12 -2
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +3 -3
- package/es/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -69
- package/es/artifacts/coverage-jest/lcov-report/prettify.js +0 -814
- package/es/artifacts/coverage-jest/lcov-report/sorter.js +0 -181
- package/junit.xml +0 -273
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +0 -364
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +0 -1426
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +0 -667
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +0 -1162
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +0 -1474
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +0 -733
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +0 -176
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +0 -97
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/testResources.js.html +0 -793
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +0 -208
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +0 -352
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +0 -826
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +0 -1297
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +0 -454
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +0 -206
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +0 -100
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +0 -271
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +0 -499
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +0 -568
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +0 -415
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +0 -340
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +0 -502
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +0 -251
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +0 -103
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +0 -223
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +0 -271
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +0 -199
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +0 -253
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +0 -211
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +0 -445
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +0 -619
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +0 -176
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +0 -571
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +0 -116
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +0 -175
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +0 -217
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +0 -664
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +0 -730
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +0 -271
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +0 -250
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +0 -412
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +0 -313
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +0 -559
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +0 -161
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +0 -379
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +0 -247
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +0 -508
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +0 -361
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +0 -190
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +0 -370
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +0 -571
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +0 -253
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +0 -718
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +0 -127
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +0 -1069
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +0 -400
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +0 -346
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +0 -307
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +0 -214
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +0 -208
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +0 -208
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +0 -901
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/base.css +0 -224
- package/src/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -87
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +0 -121
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +0 -97
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +0 -371
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +0 -139
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +0 -161
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +0 -292
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +0 -214
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +0 -463
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +0 -161
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +0 -520
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +0 -181
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +0 -163
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +0 -157
- package/src/artifacts/coverage-jest/lcov-report/hooks/useAvailableCustomProperties.js.html +0 -205
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +0 -325
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +0 -283
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +0 -151
- package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +0 -199
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +0 -118
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +0 -238
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +0 -274
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +0 -196
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +0 -136
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +0 -283
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +0 -274
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +0 -322
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +0 -208
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +0 -265
- package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +0 -187
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +0 -166
- package/src/artifacts/coverage-jest/lcov-report/index.html +0 -581
- package/src/artifacts/coverage-jest/lcov-report/prettify.css +0 -1
- package/src/artifacts/coverage-jest/lcov-report/prettify.js +0 -2
- package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/sorter.js +0 -196
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +0 -193
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +0 -109
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +0 -631
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +0 -124
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +0 -211
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +0 -341
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +0 -193
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +0 -127
- package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +0 -142
- package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +0 -280
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +0 -109
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +0 -112
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +0 -166
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +0 -103
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +0 -130
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +0 -127
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +0 -112
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +0 -370
- package/src/artifacts/coverage-jest/lcov.info +0 -4957
|
@@ -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
|
});
|
|
@@ -8,17 +7,19 @@ exports.default = void 0;
|
|
|
8
7
|
var _components = require("@folio/stripes/components");
|
|
9
8
|
var CUSTPROP_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
|
|
10
9
|
var _validators = require("../../utils/validators");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
const {
|
|
13
|
+
REFDATA_CLASS_NAME: REFDATA,
|
|
14
|
+
MULTI_REFDATA_CLASS_NAME: MULTIREFDATA,
|
|
15
|
+
DECIMAL_CLASS_NAME: DECIMAL,
|
|
16
|
+
INTEGER_CLASS_NAME: INTEGER,
|
|
17
|
+
DATE_CLASS_NAME: DATE,
|
|
18
|
+
TEXT_CLASS_NAME: TEXT
|
|
19
|
+
} = CUSTPROP_TYPES;
|
|
20
|
+
const useValueProps = function (custPropDefinition, intlKey, intlNS) {
|
|
21
|
+
let labelOverrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
22
|
+
const props = {
|
|
22
23
|
validate: _validators.required
|
|
23
24
|
};
|
|
24
25
|
switch (custPropDefinition.type) {
|
|
@@ -26,28 +27,22 @@ var useValueProps = function useValueProps(custPropDefinition, intlKey, intlNS)
|
|
|
26
27
|
case DECIMAL:
|
|
27
28
|
props.component = _components.TextField;
|
|
28
29
|
props.type = 'number';
|
|
29
|
-
props.validate =
|
|
30
|
-
return (0, _validators.invalidNumber)(value, intlKey, intlNS, labelOverrides);
|
|
31
|
-
};
|
|
30
|
+
props.validate = value => (0, _validators.invalidNumber)(value, intlKey, intlNS, labelOverrides);
|
|
32
31
|
break;
|
|
33
32
|
case REFDATA:
|
|
34
33
|
props.component = _components.Select;
|
|
35
|
-
props.dataOptions = custPropDefinition.category.values.map(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
});
|
|
34
|
+
props.dataOptions = custPropDefinition.category.values.map(rdv => ({
|
|
35
|
+
label: rdv.label,
|
|
36
|
+
value: rdv.id
|
|
37
|
+
}));
|
|
41
38
|
props.placeholder = ' ';
|
|
42
39
|
break;
|
|
43
40
|
case MULTIREFDATA:
|
|
44
41
|
props.component = _components.Select;
|
|
45
|
-
props.dataOptions = custPropDefinition.category.values.map(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
});
|
|
42
|
+
props.dataOptions = custPropDefinition.category.values.map(mrdv => ({
|
|
43
|
+
label: mrdv.label,
|
|
44
|
+
value: mrdv.id
|
|
45
|
+
}));
|
|
51
46
|
props.placeholder = ' ';
|
|
52
47
|
break;
|
|
53
48
|
case DATE:
|
|
@@ -63,5 +58,4 @@ var useValueProps = function useValueProps(custPropDefinition, intlKey, intlNS)
|
|
|
63
58
|
}
|
|
64
59
|
return props;
|
|
65
60
|
};
|
|
66
|
-
var _default = useValueProps;
|
|
67
|
-
exports.default = _default;
|
|
61
|
+
var _default = exports.default = useValueProps;
|
|
@@ -8,27 +8,25 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
8
8
|
var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertiesViewCtx"));
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
contexts =
|
|
14
|
-
customProperties
|
|
15
|
-
customPropertiesEndpoint
|
|
16
|
-
id
|
|
17
|
-
passedIntlKey
|
|
18
|
-
passedIntlNS
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return contexts.map(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, "customPropertiesView-".concat(ctx));
|
|
31
|
-
});
|
|
11
|
+
const CustomPropertiesView = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
contexts = [],
|
|
14
|
+
customProperties,
|
|
15
|
+
customPropertiesEndpoint,
|
|
16
|
+
id,
|
|
17
|
+
intlKey: passedIntlKey,
|
|
18
|
+
intlNS: passedIntlNS,
|
|
19
|
+
labelOverrides = {}
|
|
20
|
+
} = _ref;
|
|
21
|
+
return contexts.map(ctx => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
|
|
22
|
+
ctx,
|
|
23
|
+
customProperties,
|
|
24
|
+
customPropertiesEndpoint,
|
|
25
|
+
id,
|
|
26
|
+
intlKey: passedIntlKey,
|
|
27
|
+
intlNS: passedIntlNS,
|
|
28
|
+
labelOverrides
|
|
29
|
+
}, `customPropertiesView-${ctx}`));
|
|
32
30
|
};
|
|
33
31
|
CustomPropertiesView.propTypes = {
|
|
34
32
|
contexts: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
@@ -40,5 +38,4 @@ CustomPropertiesView.propTypes = {
|
|
|
40
38
|
labelOverrides: _propTypes.default.object,
|
|
41
39
|
nameOverride: _propTypes.default.string
|
|
42
40
|
};
|
|
43
|
-
var _default = CustomPropertiesView;
|
|
44
|
-
exports.default = _default;
|
|
41
|
+
var _default = exports.default = CustomPropertiesView;
|
|
@@ -10,16 +10,12 @@ var _jest = require("../../../../test/jest");
|
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
jest.mock('../../hooks');
|
|
13
|
-
jest.mock('./CustomPropertiesViewCtx',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
describe('CustomPropertiesView', function () {
|
|
21
|
-
var renderComponent;
|
|
22
|
-
beforeEach(function () {
|
|
13
|
+
jest.mock('./CustomPropertiesViewCtx', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
14
|
+
children: "CustomPropertiesViewCtx"
|
|
15
|
+
}));
|
|
16
|
+
describe('CustomPropertiesView', () => {
|
|
17
|
+
let renderComponent;
|
|
18
|
+
beforeEach(() => {
|
|
23
19
|
renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
24
20
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesView.default, {
|
|
25
21
|
contexts: _testResources.contexts,
|
|
@@ -30,11 +26,10 @@ describe('CustomPropertiesView', function () {
|
|
|
30
26
|
})
|
|
31
27
|
}));
|
|
32
28
|
});
|
|
33
|
-
it('renders CustomPropertiesViewCtx component ',
|
|
34
|
-
|
|
35
|
-
getByText
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
29
|
+
it('renders CustomPropertiesViewCtx component ', () => {
|
|
30
|
+
const {
|
|
31
|
+
getByText
|
|
32
|
+
} = renderComponent;
|
|
33
|
+
(0, _react2.waitFor)(() => expect(getByText('CustomPropertiesViewCtx')).toBeInTheDocument());
|
|
39
34
|
});
|
|
40
35
|
});
|
|
@@ -10,27 +10,20 @@ var _hooks = require("../../hooks");
|
|
|
10
10
|
var _CustomPropertyCard = _interopRequireDefault(require("./CustomPropertyCard"));
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
25
|
-
id = _ref.id,
|
|
26
|
-
passedIntlKey = _ref.intlKey,
|
|
27
|
-
passedIntlNS = _ref.intlNS,
|
|
28
|
-
_ref$labelOverrides = _ref.labelOverrides,
|
|
29
|
-
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
|
|
30
|
-
var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
13
|
+
const CustomPropertiesViewCtx = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
ctx,
|
|
16
|
+
customProperties = [],
|
|
17
|
+
customPropertiesEndpoint,
|
|
18
|
+
id,
|
|
19
|
+
intlKey: passedIntlKey,
|
|
20
|
+
intlNS: passedIntlNS,
|
|
21
|
+
labelOverrides = {}
|
|
22
|
+
} = _ref;
|
|
23
|
+
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
31
24
|
|
|
32
25
|
// Deal with all the possible label override options
|
|
33
|
-
|
|
26
|
+
const getAccordionLabel = () => {
|
|
34
27
|
// Special case for null context
|
|
35
28
|
if (ctx === 'isNull') {
|
|
36
29
|
return kintIntl.formatKintMessage({
|
|
@@ -42,74 +35,68 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
|
|
|
42
35
|
// Chain formatKintMessages together using provided fallbackMessage to
|
|
43
36
|
// allow for "If override or translation exists, use it, else use default"
|
|
44
37
|
return kintIntl.formatKintMessage({
|
|
45
|
-
id:
|
|
38
|
+
id: `customProperties.ctx.${ctx}`,
|
|
46
39
|
overrideValue: labelOverrides[ctx],
|
|
47
40
|
fallbackMessage: kintIntl.formatKintMessage({
|
|
48
41
|
id: 'customProperties.defaultTitle',
|
|
49
42
|
overrideValue: labelOverrides.defaultTitle
|
|
50
43
|
}, {
|
|
51
|
-
ctx
|
|
44
|
+
ctx
|
|
52
45
|
})
|
|
53
46
|
}, {
|
|
54
|
-
ctx
|
|
47
|
+
ctx
|
|
55
48
|
});
|
|
56
49
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
50
|
+
const {
|
|
51
|
+
data: custprops,
|
|
52
|
+
isLoading
|
|
53
|
+
} = (0, _hooks.useCustomProperties)({
|
|
54
|
+
ctx,
|
|
55
|
+
endpoint: customPropertiesEndpoint,
|
|
56
|
+
returnQueryObject: true,
|
|
57
|
+
options: {
|
|
58
|
+
sort: [{
|
|
59
|
+
path: 'retired'
|
|
60
|
+
},
|
|
61
|
+
// Place retired custprops at the end
|
|
62
|
+
{
|
|
63
|
+
path: 'primary',
|
|
64
|
+
direction: 'desc'
|
|
65
|
+
},
|
|
66
|
+
// Primary properties should display before optional
|
|
67
|
+
{
|
|
68
|
+
path: 'weight'
|
|
69
|
+
},
|
|
70
|
+
// Within those groups, sort by weight
|
|
71
|
+
{
|
|
72
|
+
path: 'label'
|
|
73
|
+
} // For those with the same weight, sort by label
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
83
78
|
if (isLoading) {
|
|
84
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
85
80
|
closedByDefault: true,
|
|
86
81
|
displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
|
|
87
82
|
displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
|
|
88
|
-
id:
|
|
83
|
+
id: `${id}-accordion-${ctx}`,
|
|
89
84
|
label: getAccordionLabel(),
|
|
90
85
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {})
|
|
91
86
|
});
|
|
92
87
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return (((_cp$ = cp[0]) === null || _cp$ === void 0 ? void 0 : (_cp$$type = _cp$.type) === null || _cp$$type === void 0 ? void 0 : _cp$$type.ctx) === ctx || ctx === 'isNull' && !((_cp$2 = cp[0]) !== null && _cp$2 !== void 0 && (_cp$2$type = _cp$2.type) !== null && _cp$2$type !== void 0 && _cp$2$type.ctx)) &&
|
|
101
|
-
// Either the ctx string matches, or isNull matches blank
|
|
102
|
-
((_cp$3 = cp[0]) === null || _cp$3 === void 0 ? void 0 : (_cp$3$type = _cp$3.type) === null || _cp$3$type === void 0 ? void 0 : _cp$3$type.primary) === primary // Only count non-primary set custprops
|
|
103
|
-
;
|
|
104
|
-
})) === null || _Object$entries$filte2 === void 0 ? void 0 : _Object$entries$filte2.length) !== null && _Object$entries$filte !== void 0 ? _Object$entries$filte : 0;
|
|
105
|
-
};
|
|
88
|
+
const countSetProperties = primary => Object.entries(customProperties)?.filter(_ref2 => {
|
|
89
|
+
let [_key, cp] = _ref2;
|
|
90
|
+
return (cp[0]?.type?.ctx === ctx || ctx === 'isNull' && !cp[0]?.type?.ctx) &&
|
|
91
|
+
// Either the ctx string matches, or isNull matches blank
|
|
92
|
+
cp[0]?.type?.primary === primary // Only count non-primary set custprops
|
|
93
|
+
;
|
|
94
|
+
})?.length ?? 0;
|
|
106
95
|
|
|
107
96
|
// We need to display any set properties, along with any non-set primary properties
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var optionalCount = countSetProperties(false);
|
|
112
|
-
var setPrimaryCount = countSetProperties(true);
|
|
97
|
+
const primaryCount = custprops?.filter(cp => cp.primary === true)?.length ?? 0;
|
|
98
|
+
const optionalCount = countSetProperties(false);
|
|
99
|
+
const setPrimaryCount = countSetProperties(true);
|
|
113
100
|
return primaryCount + optionalCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
114
101
|
closedByDefault: true,
|
|
115
102
|
displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
|
|
@@ -118,18 +105,15 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
|
|
|
118
105
|
displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
|
|
119
106
|
children: setPrimaryCount + optionalCount
|
|
120
107
|
}),
|
|
121
|
-
id:
|
|
108
|
+
id: `${id}-accordion-${ctx}`,
|
|
122
109
|
label: getAccordionLabel(),
|
|
123
|
-
children: custprops.map(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
labelOverrides: labelOverrides
|
|
131
|
-
}, "custom-property-card-".concat(ctx, "[").concat(index, "]"));
|
|
132
|
-
})
|
|
110
|
+
children: custprops.map((cp, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyCard.default, {
|
|
111
|
+
ctx: ctx,
|
|
112
|
+
customProperty: customProperties?.[cp.name]?.[0],
|
|
113
|
+
customPropertyDefinition: cp,
|
|
114
|
+
index: index,
|
|
115
|
+
labelOverrides: labelOverrides
|
|
116
|
+
}, `custom-property-card-${ctx}[${index}]`))
|
|
133
117
|
});
|
|
134
118
|
};
|
|
135
119
|
CustomPropertiesViewCtx.propTypes = {
|
|
@@ -141,5 +125,4 @@ CustomPropertiesViewCtx.propTypes = {
|
|
|
141
125
|
intlNS: _propTypes.default.string,
|
|
142
126
|
labelOverrides: _propTypes.default.object
|
|
143
127
|
};
|
|
144
|
-
var _default = CustomPropertiesViewCtx;
|
|
145
|
-
exports.default = _default;
|
|
128
|
+
var _default = exports.default = CustomPropertiesViewCtx;
|
|
@@ -9,32 +9,23 @@ var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertie
|
|
|
9
9
|
var _jest = require("../../../../test/jest");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
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; }
|
|
15
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
12
|
jest.mock('../../hooks');
|
|
19
|
-
jest.mock('./CustomPropertyCard',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
describe('CustomPropertiesViewCtx', function () {
|
|
27
|
-
var renderComponent;
|
|
28
|
-
beforeEach(function () {
|
|
13
|
+
jest.mock('./CustomPropertyCard', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
14
|
+
children: "CustomPropertyCard"
|
|
15
|
+
}));
|
|
16
|
+
describe('CustomPropertiesViewCtx', () => {
|
|
17
|
+
let renderComponent;
|
|
18
|
+
beforeEach(() => {
|
|
29
19
|
renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
30
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default,
|
|
20
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
|
|
21
|
+
..._testResources.data
|
|
22
|
+
})
|
|
31
23
|
}));
|
|
32
24
|
});
|
|
33
|
-
it('renders CustomPropertyCard component ',
|
|
34
|
-
|
|
35
|
-
getByText
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
25
|
+
it('renders CustomPropertyCard component ', () => {
|
|
26
|
+
const {
|
|
27
|
+
getByText
|
|
28
|
+
} = renderComponent;
|
|
29
|
+
(0, _react2.waitFor)(() => expect(getByText('CustomPropertyCard')).toBeInTheDocument());
|
|
39
30
|
});
|
|
40
31
|
});
|
|
@@ -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,29 +10,28 @@ var _components = require("@folio/stripes/components");
|
|
|
11
10
|
var CUSTPROP_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
|
|
12
11
|
var _hooks = require("../../hooks");
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
function _interopRequireWildcard(
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
customPropertyDefinition =
|
|
22
|
-
index
|
|
23
|
-
passedIntlKey
|
|
24
|
-
passedIntlNS
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const CustomPropertyCard = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
ctx,
|
|
19
|
+
customProperty,
|
|
20
|
+
customPropertyDefinition = {},
|
|
21
|
+
index,
|
|
22
|
+
intlKey: passedIntlKey,
|
|
23
|
+
intlNS: passedIntlNS,
|
|
24
|
+
labelOverrides = {}
|
|
25
|
+
} = _ref;
|
|
26
|
+
const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
|
|
28
27
|
|
|
29
28
|
// We only need to display primary and set properties
|
|
30
|
-
|
|
29
|
+
const toDisplay = !!(customPropertyDefinition.primary || customProperty);
|
|
31
30
|
if (!toDisplay) {
|
|
32
31
|
return null;
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var _customProperty$value, _customProperty$value2, _customProperty$value3, _customProperty$value4;
|
|
33
|
+
const internalFalse = customProperty?.internal === false || customProperty?.internal === undefined && customPropertyDefinition.defaultInternal === false;
|
|
34
|
+
const renderValue = () => {
|
|
37
35
|
if (!customProperty) {
|
|
38
36
|
return kintIntl.formatKintMessage({
|
|
39
37
|
id: 'notSet',
|
|
@@ -43,14 +41,11 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
43
41
|
switch (customPropertyDefinition.type) {
|
|
44
42
|
case CUSTPROP_TYPES.MULTI_REFDATA_CLASS_NAME:
|
|
45
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.List, {
|
|
46
|
-
items:
|
|
47
|
-
var _item$label;
|
|
48
|
-
return (_item$label = item === null || item === void 0 ? void 0 : item.label) !== null && _item$label !== void 0 ? _item$label : item === null || item === void 0 ? void 0 : item.value;
|
|
49
|
-
}),
|
|
44
|
+
items: customProperty.value?.map(item => item?.label ?? item?.value),
|
|
50
45
|
listStyle: "bullets"
|
|
51
46
|
});
|
|
52
47
|
case CUSTPROP_TYPES.REFDATA_CLASS_NAME:
|
|
53
|
-
return
|
|
48
|
+
return customProperty.value?.label ?? customProperty.value?.value;
|
|
54
49
|
case CUSTPROP_TYPES.DECIMAL_CLASS_NAME:
|
|
55
50
|
case CUSTPROP_TYPES.INTEGER_CLASS_NAME:
|
|
56
51
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedNumber, {
|
|
@@ -78,7 +73,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
78
73
|
content: customPropertyDefinition.description
|
|
79
74
|
}) : null]
|
|
80
75
|
}),
|
|
81
|
-
id:
|
|
76
|
+
id: `customproperty-card-${index}`,
|
|
82
77
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
83
78
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
84
79
|
xs: 6,
|
|
@@ -89,7 +84,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
89
84
|
}),
|
|
90
85
|
children: renderValue()
|
|
91
86
|
})
|
|
92
|
-
}), customProperty
|
|
87
|
+
}), customProperty?.note ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
93
88
|
xs: 6,
|
|
94
89
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
95
90
|
label: kintIntl.formatKintMessage({
|
|
@@ -113,8 +108,8 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
113
108
|
overrideValue: labelOverrides.visibility
|
|
114
109
|
}),
|
|
115
110
|
children: kintIntl.formatKintMessage({
|
|
116
|
-
id: 'customProperties.internalFalse',
|
|
117
|
-
overrideValue: labelOverrides.internalFalse
|
|
111
|
+
id: internalFalse ? 'customProperties.internalFalse' : 'customProperties.internalTrue',
|
|
112
|
+
overrideValue: internalFalse ? labelOverrides.internalFalse : labelOverrides.internalTrue
|
|
118
113
|
})
|
|
119
114
|
})
|
|
120
115
|
}), internalFalse && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
@@ -124,7 +119,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
124
119
|
id: 'customProperties.publicNote',
|
|
125
120
|
overrideValue: labelOverrides.publicNote
|
|
126
121
|
}),
|
|
127
|
-
children: customProperty
|
|
122
|
+
children: customProperty?.publicNote ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
128
123
|
style: {
|
|
129
124
|
whiteSpace: 'pre-wrap'
|
|
130
125
|
},
|
|
@@ -133,7 +128,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
|
|
|
133
128
|
})
|
|
134
129
|
})]
|
|
135
130
|
})]
|
|
136
|
-
},
|
|
131
|
+
}, `customPropertyCard-${ctx}[${index}]`);
|
|
137
132
|
};
|
|
138
133
|
CustomPropertyCard.propTypes = {
|
|
139
134
|
ctx: _propTypes.default.string,
|
|
@@ -144,5 +139,4 @@ CustomPropertyCard.propTypes = {
|
|
|
144
139
|
intlNS: _propTypes.default.string,
|
|
145
140
|
labelOverrides: _propTypes.default.object
|
|
146
141
|
};
|
|
147
|
-
var _default = CustomPropertyCard;
|
|
148
|
-
exports.default = _default;
|
|
142
|
+
var _default = exports.default = CustomPropertyCard;
|
|
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "CustomPropertiesView", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _CustomPropertiesView.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "CustomPropertiesViewCtx", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _CustomPropertiesViewCtx.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "CustomPropertyCard", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _CustomPropertyCard.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.labelOverrides = exports.data = exports.customProperties = exports.contexts = void 0;
|
|
7
|
-
|
|
8
|
-
exports.
|
|
9
|
-
var customProperties = {
|
|
7
|
+
const contexts = exports.contexts = ['isNull', 'OpenAccess'];
|
|
8
|
+
const customProperties = exports.customProperties = {
|
|
10
9
|
'AuthorIdentification': [{
|
|
11
10
|
'id': 2,
|
|
12
11
|
'publicNote': 'public note',
|
|
@@ -65,15 +64,13 @@ var customProperties = {
|
|
|
65
64
|
}
|
|
66
65
|
}]
|
|
67
66
|
};
|
|
68
|
-
exports.
|
|
69
|
-
var labelOverrides = {
|
|
67
|
+
const labelOverrides = exports.labelOverrides = {
|
|
70
68
|
'defaultTitle': 'ƒ defaultTitle() {}',
|
|
71
69
|
'noContext': '<Memo />',
|
|
72
70
|
'OpenAccess': '<Memo />',
|
|
73
71
|
'retiredName': 'ƒ retiredName() {}'
|
|
74
72
|
};
|
|
75
|
-
exports.
|
|
76
|
-
var data = {
|
|
73
|
+
const data = exports.data = {
|
|
77
74
|
'ctx': 'isNull',
|
|
78
75
|
'customProperties': {
|
|
79
76
|
'AuthorIdentification': [{
|
|
@@ -140,5 +137,4 @@ var data = {
|
|
|
140
137
|
'OpenAccess': '<Memo />',
|
|
141
138
|
'retiredName': 'ƒ retiredName() {}'
|
|
142
139
|
}
|
|
143
|
-
};
|
|
144
|
-
exports.data = data;
|
|
140
|
+
};
|