@k-int/stripes-kint-components 2.8.6 → 2.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/es/index.js +70 -71
- package/es/lib/ActionList/ActionList.js +37 -49
- package/es/lib/ActionList/ActionListFieldArray.js +124 -164
- package/es/lib/ActionList/index.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +62 -89
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +17 -24
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +114 -167
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +37 -89
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +85 -102
- package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +90 -122
- package/es/lib/CustomProperties/Config/CustomPropertyView.js +36 -37
- package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +50 -156
- package/es/lib/CustomProperties/Config/index.js +4 -4
- package/es/lib/CustomProperties/Config/testResources.js +13 -21
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +16 -19
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +14 -23
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +30 -31
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +14 -23
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +82 -104
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +29 -75
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +131 -131
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +90 -178
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +40 -43
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +20 -21
- package/es/lib/CustomProperties/Edit/index.js +5 -5
- package/es/lib/CustomProperties/Edit/testResources.js +15 -29
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +66 -96
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -63
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +50 -75
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +7 -6
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +33 -33
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +18 -49
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +18 -22
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +20 -52
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +42 -46
- 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 +36 -42
- package/es/lib/CustomProperties/Filter/useOperators.js +17 -19
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +17 -32
- package/es/lib/CustomProperties/Filter/useValueProps.js +21 -25
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +16 -19
- package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +11 -16
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +60 -79
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +17 -30
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +30 -41
- 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 +98 -157
- package/es/lib/EditableRefdataCategoryList/index.js +1 -1
- package/es/lib/EditableRefdataList/EditableRefdataList.js +110 -172
- package/es/lib/EditableRefdataList/index.js +1 -1
- package/es/lib/EditableSettingsList/EditableSettingsList.js +12 -9
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +16 -22
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +61 -96
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +23 -36
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +99 -83
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +19 -24
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +187 -299
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +43 -57
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +60 -106
- package/es/lib/EditableSettingsList/SettingField/index.js +3 -3
- package/es/lib/EditableSettingsList/index.js +3 -3
- package/es/lib/FormModal/FormModal.js +43 -48
- package/es/lib/FormModal/index.js +1 -1
- package/es/lib/IconSelect/IconSelect.js +50 -76
- package/es/lib/IconSelect/index.js +1 -1
- package/es/lib/NoResultsMessage/NoResultsMessage.js +18 -17
- 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/RichSelect/RichSelect.js +77 -99
- package/es/lib/RichSelect/index.js +2 -2
- package/es/lib/RichSelect/useSelectedOption.js +5 -16
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +84 -113
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +39 -47
- package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
- package/es/lib/SASQLookupComponent/index.js +2 -2
- package/es/lib/SASQRoute/SASQRoute.js +26 -32
- package/es/lib/SASQRoute/index.js +1 -1
- package/es/lib/SASQViewComponent/SASQViewComponent.js +29 -40
- 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 +17 -15
- package/es/lib/SettingPage/SettingPagePane.js +13 -12
- 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/index.js +17 -17
- 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 +56 -69
- 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/useAvailableCustomProperties.js +10 -25
- package/es/lib/hooks/useCustomProperties.js +23 -32
- package/es/lib/hooks/useHelperApp.js +31 -51
- package/es/lib/hooks/useInvalidateRefdata.js +4 -7
- 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/useTemplates.js +16 -16
- package/es/lib/utils/buildUrl.js +9 -11
- 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 +15 -15
- 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/renderHelpText.js +32 -53
- 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 +28 -34
- package/package.json +24 -9
- 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 -559
- 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 -991
- 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 -4951
|
@@ -6,49 +6,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _useOperators = _interopRequireDefault(require("./useOperators"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var useParseActiveFilterStrings = function useParseActiveFilterStrings(filterStrings) {
|
|
16
|
-
var operators = (0, _useOperators.default)().map(function (o) {
|
|
17
|
-
return o.value;
|
|
18
|
-
});
|
|
19
|
-
var numberOfFilters = 0;
|
|
20
|
-
var filters = filterStrings.map(function (filter) {
|
|
21
|
-
var customProperty;
|
|
22
|
-
var rules = filter.split('||').map(function (ruleString) {
|
|
23
|
-
var _operators$find;
|
|
9
|
+
const useParseActiveFilterStrings = filterStrings => {
|
|
10
|
+
const operators = (0, _useOperators.default)().map(o => o.value);
|
|
11
|
+
let numberOfFilters = 0;
|
|
12
|
+
const filters = filterStrings.map(filter => {
|
|
13
|
+
let customProperty;
|
|
14
|
+
const rules = filter.split('||').map(ruleString => {
|
|
24
15
|
// ruleString is constructed in this.handleSubmit passed to CustomPropertyFiltersForm
|
|
25
16
|
// and has shape "customProperties.foo.value!=42"
|
|
26
17
|
// OR customProperties.foo.value.id==1234, so make sure to disregard the .id
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
customPropertyPath = _ruleString$split2[0],
|
|
30
|
-
rule = _ruleString$split2[1];
|
|
31
|
-
var idSafeRule = rule.replace('.id', '');
|
|
18
|
+
const [customPropertyPath, rule] = ruleString.split('.value');
|
|
19
|
+
const idSafeRule = rule.replace('.id', '');
|
|
32
20
|
customProperty = customPropertyPath.replace('customProperties.', '');
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})) !== null && _operators$find !== void 0 ? _operators$find : '';
|
|
36
|
-
var value = idSafeRule.substring(operator.length);
|
|
21
|
+
const operator = operators.find(o => idSafeRule.startsWith(o)) ?? '';
|
|
22
|
+
const value = idSafeRule.substring(operator.length);
|
|
37
23
|
numberOfFilters += 1;
|
|
38
24
|
return {
|
|
39
|
-
operator
|
|
40
|
-
value
|
|
25
|
+
operator,
|
|
26
|
+
value
|
|
41
27
|
};
|
|
42
28
|
});
|
|
43
29
|
return {
|
|
44
|
-
customProperty
|
|
45
|
-
rules
|
|
30
|
+
customProperty,
|
|
31
|
+
rules
|
|
46
32
|
};
|
|
47
33
|
});
|
|
48
34
|
return {
|
|
49
|
-
filters
|
|
50
|
-
numberOfFilters
|
|
35
|
+
filters,
|
|
36
|
+
numberOfFilters
|
|
51
37
|
};
|
|
52
38
|
};
|
|
53
|
-
var _default = useParseActiveFilterStrings;
|
|
54
|
-
exports.default = _default;
|
|
39
|
+
var _default = exports.default = useParseActiveFilterStrings;
|
|
@@ -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,16 +7,18 @@ 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
|
-
|
|
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 = custPropDefinition => {
|
|
21
|
+
const props = {
|
|
21
22
|
validate: _validators.required
|
|
22
23
|
};
|
|
23
24
|
switch (custPropDefinition.type) {
|
|
@@ -29,22 +30,18 @@ var useValueProps = function useValueProps(custPropDefinition) {
|
|
|
29
30
|
break;
|
|
30
31
|
case REFDATA:
|
|
31
32
|
props.component = _components.Select;
|
|
32
|
-
props.dataOptions = custPropDefinition.category.values.map(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
});
|
|
33
|
+
props.dataOptions = custPropDefinition.category.values.map(rdv => ({
|
|
34
|
+
label: rdv.label,
|
|
35
|
+
value: rdv.id
|
|
36
|
+
}));
|
|
38
37
|
props.placeholder = ' ';
|
|
39
38
|
break;
|
|
40
39
|
case MULTIREFDATA:
|
|
41
40
|
props.component = _components.Select;
|
|
42
|
-
props.dataOptions = custPropDefinition.category.values.map(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
});
|
|
41
|
+
props.dataOptions = custPropDefinition.category.values.map(mrdv => ({
|
|
42
|
+
label: mrdv.label,
|
|
43
|
+
value: mrdv.id
|
|
44
|
+
}));
|
|
48
45
|
props.placeholder = ' ';
|
|
49
46
|
break;
|
|
50
47
|
case DATE:
|
|
@@ -60,5 +57,4 @@ var useValueProps = function useValueProps(custPropDefinition) {
|
|
|
60
57
|
}
|
|
61
58
|
return props;
|
|
62
59
|
};
|
|
63
|
-
var _default = useValueProps;
|
|
64
|
-
exports.default = _default;
|
|
60
|
+
var _default = exports.default = useValueProps;
|
|
@@ -8,23 +8,21 @@ 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
|
-
|
|
18
|
-
|
|
19
|
-
return contexts.map(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, "customPropertiesView-".concat(ctx));
|
|
27
|
-
});
|
|
11
|
+
const CustomPropertiesView = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
contexts = [],
|
|
14
|
+
customProperties,
|
|
15
|
+
customPropertiesEndpoint,
|
|
16
|
+
id,
|
|
17
|
+
labelOverrides = {}
|
|
18
|
+
} = _ref;
|
|
19
|
+
return contexts.map(ctx => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
|
|
20
|
+
ctx,
|
|
21
|
+
customProperties,
|
|
22
|
+
customPropertiesEndpoint,
|
|
23
|
+
id,
|
|
24
|
+
labelOverrides
|
|
25
|
+
}, `customPropertiesView-${ctx}`));
|
|
28
26
|
};
|
|
29
27
|
CustomPropertiesView.propTypes = {
|
|
30
28
|
contexts: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
@@ -34,5 +32,4 @@ CustomPropertiesView.propTypes = {
|
|
|
34
32
|
labelOverrides: _propTypes.default.object,
|
|
35
33
|
nameOverride: _propTypes.default.string
|
|
36
34
|
};
|
|
37
|
-
var _default = CustomPropertiesView;
|
|
38
|
-
exports.default = _default;
|
|
35
|
+
var _default = exports.default = CustomPropertiesView;
|
|
@@ -9,16 +9,12 @@ var _testResources = require("./testResources");
|
|
|
9
9
|
var _CustomPropertiesView = _interopRequireDefault(require("./CustomPropertiesView"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
jest.mock('./CustomPropertiesViewCtx',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
describe('CustomPropertiesView', function () {
|
|
20
|
-
var renderComponent;
|
|
21
|
-
beforeEach(function () {
|
|
12
|
+
jest.mock('./CustomPropertiesViewCtx', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
13
|
+
children: "CustomPropertiesViewCtx"
|
|
14
|
+
}));
|
|
15
|
+
describe('CustomPropertiesView', () => {
|
|
16
|
+
let renderComponent;
|
|
17
|
+
beforeEach(() => {
|
|
22
18
|
renderComponent = (0, _helpers.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
23
19
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesView.default, {
|
|
24
20
|
contexts: _testResources.contexts,
|
|
@@ -29,11 +25,10 @@ describe('CustomPropertiesView', function () {
|
|
|
29
25
|
})
|
|
30
26
|
}));
|
|
31
27
|
});
|
|
32
|
-
it('renders CustomPropertiesViewCtx component ',
|
|
33
|
-
|
|
34
|
-
getByText
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
28
|
+
it('renders CustomPropertiesViewCtx component ', () => {
|
|
29
|
+
const {
|
|
30
|
+
getByText
|
|
31
|
+
} = renderComponent;
|
|
32
|
+
(0, _react2.waitFor)(() => expect(getByText('CustomPropertiesViewCtx')).toBeInTheDocument());
|
|
38
33
|
});
|
|
39
34
|
});
|
|
@@ -11,28 +11,19 @@ var _hooks = require("../../hooks");
|
|
|
11
11
|
var _CustomPropertyCard = _interopRequireDefault(require("./CustomPropertyCard"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var ctx = _ref.ctx,
|
|
23
|
-
_ref$customProperties = _ref.customProperties,
|
|
24
|
-
customProperties = _ref$customProperties === void 0 ? [] : _ref$customProperties,
|
|
25
|
-
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
26
|
-
id = _ref.id,
|
|
27
|
-
_ref$labelOverrides = _ref.labelOverrides,
|
|
28
|
-
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
|
|
14
|
+
const CustomPropertiesViewCtx = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
ctx,
|
|
17
|
+
customProperties = [],
|
|
18
|
+
customPropertiesEndpoint,
|
|
19
|
+
id,
|
|
20
|
+
labelOverrides = {}
|
|
21
|
+
} = _ref;
|
|
29
22
|
// Deal with all the possible label override options
|
|
30
|
-
|
|
31
|
-
var _labelOverrides$defau;
|
|
23
|
+
const getAccordionLabel = () => {
|
|
32
24
|
// Special case for null context
|
|
33
25
|
if (ctx === 'isNull') {
|
|
34
|
-
|
|
35
|
-
return (_labelOverrides$noCon = labelOverrides.noContext) !== null && _labelOverrides$noCon !== void 0 ? _labelOverrides$noCon : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
26
|
+
return labelOverrides.noContext ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
36
27
|
id: "stripes-kint-components.customProperties"
|
|
37
28
|
});
|
|
38
29
|
}
|
|
@@ -48,69 +39,63 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
|
|
|
48
39
|
}
|
|
49
40
|
|
|
50
41
|
// Label override for default title or finally built in default
|
|
51
|
-
return
|
|
42
|
+
return labelOverrides.defaultTitle ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
52
43
|
id: "stripes-kint-components.customProperties.ctx.title",
|
|
53
44
|
values: {
|
|
54
|
-
ctx
|
|
45
|
+
ctx
|
|
55
46
|
}
|
|
56
47
|
});
|
|
57
48
|
};
|
|
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
|
-
|
|
83
|
-
|
|
49
|
+
const {
|
|
50
|
+
data: custprops,
|
|
51
|
+
isLoading
|
|
52
|
+
} = (0, _hooks.useCustomProperties)({
|
|
53
|
+
ctx,
|
|
54
|
+
endpoint: customPropertiesEndpoint,
|
|
55
|
+
returnQueryObject: true,
|
|
56
|
+
options: {
|
|
57
|
+
sort: [{
|
|
58
|
+
path: 'retired'
|
|
59
|
+
},
|
|
60
|
+
// Place retired custprops at the end
|
|
61
|
+
{
|
|
62
|
+
path: 'primary',
|
|
63
|
+
direction: 'desc'
|
|
64
|
+
},
|
|
65
|
+
// Primary properties should display before optional
|
|
66
|
+
{
|
|
67
|
+
path: 'weight'
|
|
68
|
+
},
|
|
69
|
+
// Within those groups, sort by weight
|
|
70
|
+
{
|
|
71
|
+
path: 'label'
|
|
72
|
+
} // For those with the same weight, sort by label
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
84
77
|
if (isLoading) {
|
|
85
78
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
86
79
|
closedByDefault: true,
|
|
87
80
|
displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
|
|
88
81
|
displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
|
|
89
|
-
id:
|
|
82
|
+
id: `${id}-accordion-${ctx}`,
|
|
90
83
|
label: getAccordionLabel(),
|
|
91
84
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {})
|
|
92
85
|
});
|
|
93
86
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
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)) &&
|
|
102
|
-
// Either the ctx string matches, or isNull matches blank
|
|
103
|
-
((_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
|
|
104
|
-
;
|
|
105
|
-
})) === null || _Object$entries$filte2 === void 0 ? void 0 : _Object$entries$filte2.length) !== null && _Object$entries$filte !== void 0 ? _Object$entries$filte : 0;
|
|
106
|
-
};
|
|
87
|
+
const countSetProperties = primary => Object.entries(customProperties)?.filter(_ref2 => {
|
|
88
|
+
let [_key, cp] = _ref2;
|
|
89
|
+
return (cp[0]?.type?.ctx === ctx || ctx === 'isNull' && !cp[0]?.type?.ctx) &&
|
|
90
|
+
// Either the ctx string matches, or isNull matches blank
|
|
91
|
+
cp[0]?.type?.primary === primary // Only count non-primary set custprops
|
|
92
|
+
;
|
|
93
|
+
})?.length ?? 0;
|
|
107
94
|
|
|
108
95
|
// We need to display any set properties, along with any non-set primary properties
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var optionalCount = countSetProperties(false);
|
|
113
|
-
var setPrimaryCount = countSetProperties(true);
|
|
96
|
+
const primaryCount = custprops?.filter(cp => cp.primary === true)?.length ?? 0;
|
|
97
|
+
const optionalCount = countSetProperties(false);
|
|
98
|
+
const setPrimaryCount = countSetProperties(true);
|
|
114
99
|
return primaryCount + optionalCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
115
100
|
closedByDefault: true,
|
|
116
101
|
displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
|
|
@@ -119,18 +104,15 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
|
|
|
119
104
|
displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
|
|
120
105
|
children: setPrimaryCount + optionalCount
|
|
121
106
|
}),
|
|
122
|
-
id:
|
|
107
|
+
id: `${id}-accordion-${ctx}`,
|
|
123
108
|
label: getAccordionLabel(),
|
|
124
|
-
children: custprops.map(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
labelOverrides: labelOverrides
|
|
132
|
-
}, "custom-property-card-".concat(ctx, "[").concat(index, "]"));
|
|
133
|
-
})
|
|
109
|
+
children: custprops.map((cp, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyCard.default, {
|
|
110
|
+
ctx: ctx,
|
|
111
|
+
customProperty: customProperties?.[cp.name]?.[0],
|
|
112
|
+
customPropertyDefinition: cp,
|
|
113
|
+
index: index,
|
|
114
|
+
labelOverrides: labelOverrides
|
|
115
|
+
}, `custom-property-card-${ctx}[${index}]`))
|
|
134
116
|
});
|
|
135
117
|
};
|
|
136
118
|
CustomPropertiesViewCtx.propTypes = {
|
|
@@ -140,5 +122,4 @@ CustomPropertiesViewCtx.propTypes = {
|
|
|
140
122
|
id: _propTypes.default.string,
|
|
141
123
|
labelOverrides: _propTypes.default.object
|
|
142
124
|
};
|
|
143
|
-
var _default = CustomPropertiesViewCtx;
|
|
144
|
-
exports.default = _default;
|
|
125
|
+
var _default = exports.default = CustomPropertiesViewCtx;
|
|
@@ -9,38 +9,25 @@ var _testResources = require("./testResources");
|
|
|
9
9
|
var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertiesViewCtx"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
jest.mock('./CustomPropertyCard', function () {
|
|
26
|
-
return function () {
|
|
27
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
28
|
-
children: "CustomPropertyCard"
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
describe('CustomPropertiesViewCtx', function () {
|
|
33
|
-
var renderComponent;
|
|
34
|
-
beforeEach(function () {
|
|
12
|
+
jest.mock('../../hooks', () => ({
|
|
13
|
+
useCustomProperties: () => []
|
|
14
|
+
}));
|
|
15
|
+
jest.mock('./CustomPropertyCard', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
16
|
+
children: "CustomPropertyCard"
|
|
17
|
+
}));
|
|
18
|
+
describe('CustomPropertiesViewCtx', () => {
|
|
19
|
+
let renderComponent;
|
|
20
|
+
beforeEach(() => {
|
|
35
21
|
renderComponent = (0, _helpers.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
36
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default,
|
|
22
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
|
|
23
|
+
..._testResources.data
|
|
24
|
+
})
|
|
37
25
|
}));
|
|
38
26
|
});
|
|
39
|
-
it('renders CustomPropertyCard component ',
|
|
40
|
-
|
|
41
|
-
getByText
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
27
|
+
it('renders CustomPropertyCard component ', () => {
|
|
28
|
+
const {
|
|
29
|
+
getByText
|
|
30
|
+
} = renderComponent;
|
|
31
|
+
(0, _react2.waitFor)(() => expect(getByText('CustomPropertyCard')).toBeInTheDocument());
|
|
45
32
|
});
|
|
46
33
|
});
|