@k-int/stripes-kint-components 2.8.5 → 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 +11 -0
- package/es/index.js +70 -71
- package/es/lib/ActionList/ActionList.js +37 -47
- package/es/lib/ActionList/ActionListFieldArray.js +124 -162
- package/es/lib/ActionList/index.js +1 -1
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +62 -86
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +17 -21
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +114 -165
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +37 -87
- 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 -154
- 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 -20
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +30 -31
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +14 -20
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +82 -101
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +29 -73
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +131 -129
- package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +90 -176
- 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 -93
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -63
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +50 -72
- 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 -19
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +20 -50
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +42 -43
- 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 -27
- 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 -32
- package/es/lib/CycleButton/index.js +1 -1
- package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +98 -155
- package/es/lib/EditableRefdataCategoryList/index.js +1 -1
- package/es/lib/EditableRefdataList/EditableRefdataList.js +110 -170
- package/es/lib/EditableRefdataList/index.js +1 -1
- package/es/lib/EditableSettingsList/EditableSettingsList.js +12 -9
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +16 -19
- 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 -55
- 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 -45
- package/es/lib/FormModal/index.js +1 -1
- package/es/lib/IconSelect/IconSelect.js +50 -74
- 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 -33
- package/es/lib/QueryTypedown/index.js +1 -1
- package/es/lib/RefdataButtons/RefdataButtons.js +30 -31
- package/es/lib/RefdataButtons/index.js +1 -1
- package/es/lib/RichSelect/RichSelect.js +77 -96
- package/es/lib/RichSelect/index.js +2 -2
- package/es/lib/RichSelect/useSelectedOption.js +5 -16
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +84 -110
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +39 -44
- package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
- package/es/lib/SASQLookupComponent/index.js +2 -2
- package/es/lib/SASQRoute/SASQRoute.js +26 -29
- package/es/lib/SASQRoute/index.js +1 -1
- package/es/lib/SASQViewComponent/SASQViewComponent.js +29 -37
- package/es/lib/SASQViewComponent/index.js +1 -1
- package/es/lib/SearchField/SearchField.js +11 -15
- 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 -67
- 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 -29
- package/es/lib/hooks/useHelperApp.js +31 -49
- package/es/lib/hooks/useInvalidateRefdata.js +4 -7
- package/es/lib/hooks/useKiwtFieldArray.js +35 -44
- package/es/lib/hooks/useKiwtSASQuery.js +40 -49
- package/es/lib/hooks/useLocalStorageState.js +7 -20
- package/es/lib/hooks/useMutateCustomProperties.js +23 -73
- package/es/lib/hooks/useMutateRefdataCategory.js +22 -66
- package/es/lib/hooks/useMutateRefdataValue.js +31 -73
- package/es/lib/hooks/useQIndex.js +17 -30
- 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 -18
- 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 -63
- 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/src/lib/utils/parseErrorResponse.js +3 -2
- package/translations/stripes-kint-components/ja.json +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 -1384
- 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 -535
- 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 -523
- 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 -326
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +0 -187
- 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 -139
- 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 -4830
- package/yarn-error.log +0 -147
|
@@ -11,77 +11,55 @@ var _components = require("@folio/stripes/components");
|
|
|
11
11
|
var _RichSelect = _interopRequireDefault(require("../../../styles/RichSelect.css"));
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_ref$options = _ref.options,
|
|
37
|
-
userOptions = _ref$options === void 0 ? [] : _ref$options,
|
|
38
|
-
placeholder = _ref.placeholder,
|
|
39
|
-
_renderMenu = _ref.renderMenu,
|
|
40
|
-
renderOption = _ref.renderOption,
|
|
41
|
-
_renderTrigger = _ref.renderTrigger,
|
|
42
|
-
_ref$required = _ref.required,
|
|
43
|
-
required = _ref$required === void 0 ? false : _ref$required,
|
|
44
|
-
value = _ref.value;
|
|
45
|
-
var hiddenInput = (0, _react.useRef)(null);
|
|
46
|
-
var _useState = (0, _react.useState)((_ref2 = (_meta$initial = meta === null || meta === void 0 ? void 0 : meta.initial) !== null && _meta$initial !== void 0 ? _meta$initial : value) !== null && _ref2 !== void 0 ? _ref2 : ''),
|
|
47
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
-
internalValue = _useState2[0],
|
|
49
|
-
setInternalValue = _useState2[1];
|
|
50
|
-
var findSelectedOptionByValue = (0, _react.useCallback)(function (val) {
|
|
51
|
-
return userOptions.find(function (opt) {
|
|
52
|
-
return opt.value === val;
|
|
53
|
-
});
|
|
14
|
+
const RichSelect = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
15
|
+
let {
|
|
16
|
+
ariaLabel,
|
|
17
|
+
disabled = false,
|
|
18
|
+
dropdownProps = {},
|
|
19
|
+
id,
|
|
20
|
+
input: formInput = {},
|
|
21
|
+
label,
|
|
22
|
+
meta,
|
|
23
|
+
onChange,
|
|
24
|
+
options: userOptions = [],
|
|
25
|
+
placeholder,
|
|
26
|
+
renderMenu,
|
|
27
|
+
renderOption,
|
|
28
|
+
renderTrigger,
|
|
29
|
+
required = false,
|
|
30
|
+
value
|
|
31
|
+
} = _ref;
|
|
32
|
+
const hiddenInput = (0, _react.useRef)(null);
|
|
33
|
+
const [internalValue, setInternalValue] = (0, _react.useState)(meta?.initial ?? value ?? '');
|
|
34
|
+
const findSelectedOptionByValue = (0, _react.useCallback)(val => {
|
|
35
|
+
return userOptions.find(opt => opt.value === val);
|
|
54
36
|
}, [userOptions]);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
selectedOption = _useState4[0],
|
|
58
|
-
setSelectedOption = _useState4[1];
|
|
59
|
-
(0, _react.useEffect)(function () {
|
|
37
|
+
const [selectedOption, setSelectedOption] = (0, _react.useState)(findSelectedOptionByValue(meta?.initial ?? '') ?? {});
|
|
38
|
+
(0, _react.useEffect)(() => {
|
|
60
39
|
// We treat non-undefined value/formInput values as valid values, whereas undefined is only relevant when prop has not been provided
|
|
61
|
-
if (value !== undefined && !(value ===
|
|
40
|
+
if (value !== undefined && !(value === selectedOption?.value && value === internalValue)) {
|
|
62
41
|
setSelectedOption(findSelectedOptionByValue(value));
|
|
63
42
|
setInternalValue(value);
|
|
64
|
-
} else if (
|
|
43
|
+
} else if (formInput?.value !== undefined && !(value === selectedOption?.value && value === internalValue)) {
|
|
65
44
|
setSelectedOption(findSelectedOptionByValue(formInput.value));
|
|
66
45
|
setInternalValue(formInput.value);
|
|
67
46
|
}
|
|
68
47
|
}, [formInput, value, internalValue, selectedOption, findSelectedOptionByValue]);
|
|
69
48
|
|
|
70
49
|
// Way to grab internal selectedOption state, thereby avoiding having to reparse options for it
|
|
71
|
-
(0, _react.useImperativeHandle)(ref,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, _objectSpread(_objectSpread(_objectSpread({
|
|
50
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
51
|
+
selectedOption
|
|
52
|
+
}));
|
|
53
|
+
const defaultRenderTrigger = _ref2 => {
|
|
54
|
+
let {
|
|
55
|
+
onToggle,
|
|
56
|
+
triggerRef,
|
|
57
|
+
keyHandler,
|
|
58
|
+
open,
|
|
59
|
+
ariaProps,
|
|
60
|
+
getTriggerProps
|
|
61
|
+
} = _ref2;
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
85
63
|
ref: triggerRef,
|
|
86
64
|
buttonClass: _RichSelect.default.iconButtonText,
|
|
87
65
|
buttonStyle: "none",
|
|
@@ -90,16 +68,17 @@ var RichSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
90
68
|
onClick: onToggle,
|
|
91
69
|
onKeyDown: keyHandler,
|
|
92
70
|
paddingSide0: true,
|
|
93
|
-
type: "button"
|
|
94
|
-
|
|
71
|
+
type: "button",
|
|
72
|
+
...getTriggerProps(),
|
|
73
|
+
...ariaProps,
|
|
95
74
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
96
75
|
icon: open ? 'caret-up' : 'caret-down',
|
|
97
76
|
iconPosition: "end",
|
|
98
|
-
children:
|
|
77
|
+
children: selectedOption?.label ?? selectedOption?.value ?? (internalValue || null) ?? placeholder ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
99
78
|
id: "stripes-kint-components.richSelect.placeholder"
|
|
100
79
|
})
|
|
101
80
|
})
|
|
102
|
-
})
|
|
81
|
+
})
|
|
103
82
|
// Awaiting result of conversation about whether we want to allow labels on IconButtons
|
|
104
83
|
/* <IconButton
|
|
105
84
|
ref={triggerRef}
|
|
@@ -123,9 +102,9 @@ var RichSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
123
102
|
</IconButton> */;
|
|
124
103
|
};
|
|
125
104
|
|
|
126
|
-
|
|
105
|
+
const handleChange = e => {
|
|
127
106
|
// Actually set the value in the form (If formInput exists)
|
|
128
|
-
if (formInput
|
|
107
|
+
if (formInput?.onChange) {
|
|
129
108
|
formInput.onChange(e);
|
|
130
109
|
}
|
|
131
110
|
|
|
@@ -134,23 +113,22 @@ var RichSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
134
113
|
onChange(e, e.target.value);
|
|
135
114
|
}
|
|
136
115
|
};
|
|
137
|
-
|
|
116
|
+
const changeField = val => {
|
|
138
117
|
(0, _components.nativeChangeFieldValue)(hiddenInput, false, val);
|
|
139
118
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
var onToggle = _ref7.onToggle;
|
|
119
|
+
const defaultRenderOption = opt => opt.label ?? opt.value;
|
|
120
|
+
const defaultRenderMenu = _ref3 => {
|
|
121
|
+
let {
|
|
122
|
+
onToggle
|
|
123
|
+
} = _ref3;
|
|
146
124
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.DropdownMenu, {
|
|
147
|
-
children: userOptions.map(
|
|
125
|
+
children: userOptions.map(opt => {
|
|
148
126
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
149
|
-
autoFocus:
|
|
127
|
+
autoFocus: selectedOption?.value === opt.value,
|
|
150
128
|
buttonStyle: "dropdownItem",
|
|
151
|
-
id:
|
|
129
|
+
id: `${id}-${formInput.name}-option-${opt.value}`,
|
|
152
130
|
marginBottom0: true,
|
|
153
|
-
onClick:
|
|
131
|
+
onClick: () => {
|
|
154
132
|
// Trigger change event
|
|
155
133
|
changeField(opt.value);
|
|
156
134
|
|
|
@@ -166,38 +144,42 @@ var RichSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
166
144
|
children: [label || ariaLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Label, {
|
|
167
145
|
className: ariaLabel && 'sr-only',
|
|
168
146
|
htmlFor: id,
|
|
169
|
-
id:
|
|
147
|
+
id: `${id}-label`,
|
|
170
148
|
required: required,
|
|
171
149
|
children: ariaLabel || label
|
|
172
|
-
}) : '', /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown,
|
|
150
|
+
}) : '', /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
|
|
173
151
|
hasPadding: true,
|
|
174
152
|
placement: "bottom-start",
|
|
175
|
-
renderMenu:
|
|
176
|
-
if (
|
|
177
|
-
return
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
153
|
+
renderMenu: menuProps => {
|
|
154
|
+
if (renderMenu) {
|
|
155
|
+
return renderMenu({
|
|
156
|
+
...menuProps,
|
|
157
|
+
selectedOption,
|
|
158
|
+
changeField
|
|
159
|
+
});
|
|
181
160
|
} else {
|
|
182
161
|
return defaultRenderMenu(menuProps);
|
|
183
162
|
}
|
|
184
163
|
},
|
|
185
|
-
renderTrigger:
|
|
186
|
-
if (
|
|
187
|
-
return
|
|
188
|
-
|
|
189
|
-
|
|
164
|
+
renderTrigger: triggerProps => {
|
|
165
|
+
if (renderTrigger) {
|
|
166
|
+
return renderTrigger({
|
|
167
|
+
...triggerProps,
|
|
168
|
+
selectedOption
|
|
169
|
+
});
|
|
190
170
|
} else {
|
|
191
171
|
return defaultRenderTrigger(triggerProps);
|
|
192
172
|
}
|
|
193
|
-
}
|
|
194
|
-
|
|
173
|
+
},
|
|
174
|
+
...dropdownProps
|
|
175
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
176
|
+
...formInput,
|
|
195
177
|
ref: hiddenInput,
|
|
196
178
|
hidden: true,
|
|
197
179
|
onChange: handleChange,
|
|
198
180
|
type: "text",
|
|
199
181
|
value: internalValue
|
|
200
|
-
})
|
|
182
|
+
})]
|
|
201
183
|
});
|
|
202
184
|
});
|
|
203
185
|
RichSelect.propTypes = {
|
|
@@ -220,5 +202,4 @@ RichSelect.propTypes = {
|
|
|
220
202
|
required: _propTypes.default.bool,
|
|
221
203
|
value: _propTypes.default.string
|
|
222
204
|
};
|
|
223
|
-
var _default = RichSelect;
|
|
224
|
-
exports.default = _default;
|
|
205
|
+
var _default = exports.default = RichSelect;
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _RichSelect.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "useSelectedOption", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _useSelectedOption.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -5,24 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
var useSelectedOption = function useSelectedOption() {
|
|
15
|
-
var _useState = (0, _react.useState)(),
|
|
16
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
-
selectedOption = _useState2[0],
|
|
18
|
-
setSelectedOption = _useState2[1];
|
|
19
|
-
var ref = (0, _react.useCallback)(function (node) {
|
|
20
|
-
var _node$selectedOption;
|
|
21
|
-
if (node !== null && (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== ((_node$selectedOption = node.selectedOption) === null || _node$selectedOption === void 0 ? void 0 : _node$selectedOption.value)) {
|
|
8
|
+
const useSelectedOption = () => {
|
|
9
|
+
const [selectedOption, setSelectedOption] = (0, _react.useState)();
|
|
10
|
+
const ref = (0, _react.useCallback)(node => {
|
|
11
|
+
if (node !== null && selectedOption?.value !== node.selectedOption?.value) {
|
|
22
12
|
setSelectedOption(node.selectedOption);
|
|
23
13
|
}
|
|
24
14
|
}, [selectedOption]);
|
|
25
15
|
return [ref, selectedOption];
|
|
26
16
|
};
|
|
27
|
-
var _default = useSelectedOption;
|
|
28
|
-
exports.default = _default;
|
|
17
|
+
var _default = exports.default = useSelectedOption;
|
|
@@ -14,131 +14,104 @@ var _utils = require("../utils");
|
|
|
14
14
|
var _hooks = require("../hooks");
|
|
15
15
|
var _TableBody = _interopRequireDefault(require("./TableBody"));
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _excluded = ["data"];
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
filterPaneProps = props.filterPaneProps,
|
|
48
|
-
id = props.id,
|
|
49
|
-
mainPaneProps = props.mainPaneProps,
|
|
50
|
-
noSearchField = props.noSearchField,
|
|
51
|
-
RenderBody = props.RenderBody,
|
|
52
|
-
sasqProps = props.sasqProps;
|
|
53
|
-
var _useKiwtSASQuery = (0, _hooks.useKiwtSASQuery)(),
|
|
54
|
-
query = _useKiwtSASQuery.query,
|
|
55
|
-
queryGetter = _useKiwtSASQuery.queryGetter,
|
|
56
|
-
querySetter = _useKiwtSASQuery.querySetter;
|
|
57
|
-
var _useNamespace = (0, _core.useNamespace)(),
|
|
58
|
-
namespace = _useNamespace[0];
|
|
59
|
-
var ky = (0, _core.useOkapiKy)();
|
|
60
|
-
var filterPaneVisibileKey = "".concat(namespace, "-").concat(id, "-filterPaneVisibility");
|
|
61
|
-
var fetchPageData = function fetchPageData(_ref) {
|
|
62
|
-
var _ref$pageParam = _ref.pageParam,
|
|
63
|
-
pageParam = _ref$pageParam === void 0 ? 0 : _ref$pageParam;
|
|
64
|
-
var queryMap = fetchParameters.SASQ_MAP;
|
|
18
|
+
const SASQLookupComponent = props => {
|
|
19
|
+
const {
|
|
20
|
+
children,
|
|
21
|
+
fetchParameters = {},
|
|
22
|
+
FilterComponent = () => null,
|
|
23
|
+
FilterPaneHeaderComponent = () => null,
|
|
24
|
+
filterPaneProps,
|
|
25
|
+
id,
|
|
26
|
+
mainPaneProps,
|
|
27
|
+
noSearchField,
|
|
28
|
+
RenderBody,
|
|
29
|
+
sasqProps
|
|
30
|
+
} = props;
|
|
31
|
+
const {
|
|
32
|
+
query,
|
|
33
|
+
queryGetter,
|
|
34
|
+
querySetter
|
|
35
|
+
} = (0, _hooks.useKiwtSASQuery)();
|
|
36
|
+
const {
|
|
37
|
+
0: namespace
|
|
38
|
+
} = (0, _core.useNamespace)();
|
|
39
|
+
const ky = (0, _core.useOkapiKy)();
|
|
40
|
+
const filterPaneVisibileKey = `${namespace}-${id}-filterPaneVisibility`;
|
|
41
|
+
const fetchPageData = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
pageParam = 0
|
|
44
|
+
} = _ref;
|
|
45
|
+
const queryMap = fetchParameters.SASQ_MAP;
|
|
65
46
|
queryMap.offset = pageParam;
|
|
66
|
-
return ky(
|
|
47
|
+
return ky(`${fetchParameters.endpoint}${(0, _utils.generateKiwtQuery)(queryMap, query)}`).json();
|
|
67
48
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var data = (_totalData$pages$redu = (_totalData$pages = totalData.pages) === null || _totalData$pages === void 0 ? void 0 : _totalData$pages.reduce(function (acc, curr) {
|
|
80
|
-
var _acc$results, _curr$results;
|
|
81
|
-
var newAcc = _objectSpread({}, acc);
|
|
82
|
-
for (var _i2 = 0, _Object$entries = Object.entries(curr); _i2 < _Object$entries.length; _i2++) {
|
|
83
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
|
|
84
|
-
key = _Object$entries$_i[0],
|
|
85
|
-
value = _Object$entries$_i[1];
|
|
49
|
+
const [filterPaneVisible, setFilterPaneVisible] = (0, _hooks.useLocalStorageState)(filterPaneVisibileKey, true);
|
|
50
|
+
const toggleFilterPane = () => setFilterPaneVisible(!filterPaneVisible);
|
|
51
|
+
const {
|
|
52
|
+
data: totalData = {},
|
|
53
|
+
...restOfInfiniteQueryProps
|
|
54
|
+
} = (0, _reactQuery.useInfiniteQuery)([namespace, id, 'data', query], fetchPageData);
|
|
55
|
+
const data = totalData.pages?.reduce((acc, curr) => {
|
|
56
|
+
const newAcc = {
|
|
57
|
+
...acc
|
|
58
|
+
};
|
|
59
|
+
for (const [key, value] of Object.entries(curr)) {
|
|
86
60
|
if (key !== 'page' && key !== 'result' && acc[key] !== value) {
|
|
87
61
|
newAcc[key] = value;
|
|
88
62
|
}
|
|
89
63
|
}
|
|
90
|
-
|
|
91
|
-
newResults.push
|
|
64
|
+
const newResults = [...(acc.results ?? [])];
|
|
65
|
+
newResults.push(...(curr.results ?? []));
|
|
92
66
|
newAcc.results = newResults;
|
|
93
67
|
return newAcc;
|
|
94
|
-
}, {})
|
|
95
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_smartComponents.SearchAndSortQuery,
|
|
68
|
+
}, {}) ?? {};
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_smartComponents.SearchAndSortQuery, {
|
|
96
70
|
initialSearchState: {
|
|
97
71
|
query: ''
|
|
98
72
|
},
|
|
99
73
|
queryGetter: queryGetter,
|
|
100
|
-
querySetter: querySetter
|
|
101
|
-
|
|
102
|
-
children:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
74
|
+
querySetter: querySetter,
|
|
75
|
+
...sasqProps,
|
|
76
|
+
children: sasqRenderProps => {
|
|
77
|
+
const {
|
|
78
|
+
activeFilters,
|
|
79
|
+
filterChanged,
|
|
80
|
+
getFilterHandlers,
|
|
81
|
+
getSearchHandlers,
|
|
82
|
+
onSubmitSearch,
|
|
83
|
+
resetAll,
|
|
84
|
+
searchChanged,
|
|
85
|
+
searchValue
|
|
86
|
+
} = sasqRenderProps;
|
|
87
|
+
const searchHandlers = getSearchHandlers();
|
|
88
|
+
const disableReset = !filterChanged && !searchChanged;
|
|
89
|
+
const filterCount = activeFilters.string ? activeFilters.string.split(',').length : 0;
|
|
90
|
+
const Body = RenderBody ?? _TableBody.default;
|
|
115
91
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_smartComponents.PersistedPaneset, {
|
|
116
92
|
appId: namespace,
|
|
117
|
-
id:
|
|
118
|
-
children: [filterPaneVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane,
|
|
93
|
+
id: `${id}-paneset`,
|
|
94
|
+
children: [filterPaneVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, {
|
|
119
95
|
defaultWidth: "20%",
|
|
120
96
|
lastMenu: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PaneMenu, {
|
|
121
97
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
122
98
|
icon: "caret-left",
|
|
123
|
-
onClick:
|
|
124
|
-
return setFilterPaneVisible(false);
|
|
125
|
-
}
|
|
99
|
+
onClick: () => setFilterPaneVisible(false)
|
|
126
100
|
})
|
|
127
101
|
}),
|
|
128
102
|
paneTitle: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
129
103
|
id: "stripes-smart-components.searchAndFilter"
|
|
130
|
-
})
|
|
131
|
-
|
|
104
|
+
}),
|
|
105
|
+
...filterPaneProps,
|
|
132
106
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("form", {
|
|
133
107
|
onSubmit: onSubmitSearch,
|
|
134
108
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FilterPaneHeaderComponent, {}), !noSearchField && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
135
109
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SearchField, {
|
|
136
110
|
autoFocus: true,
|
|
137
|
-
id:
|
|
111
|
+
id: `sasq-search-field-${id}`,
|
|
138
112
|
name: "query",
|
|
139
|
-
onChange:
|
|
140
|
-
|
|
141
|
-
if ((_e$target = e.target) !== null && _e$target !== void 0 && _e$target.value) {
|
|
113
|
+
onChange: e => {
|
|
114
|
+
if (e.target?.value) {
|
|
142
115
|
searchHandlers.query(e); // SASQ needs the whole event here
|
|
143
116
|
} else {
|
|
144
117
|
searchHandlers.reset();
|
|
@@ -176,15 +149,13 @@ var SASQLookupComponent = function SASQLookupComponent(props) {
|
|
|
176
149
|
searchValue: searchValue
|
|
177
150
|
})]
|
|
178
151
|
})
|
|
179
|
-
})
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, {
|
|
180
153
|
defaultWidth: "fill",
|
|
181
154
|
firstMenu: !filterPaneVisible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PaneMenu, {
|
|
182
155
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
183
156
|
badgeCount: filterCount,
|
|
184
157
|
icon: "caret-right",
|
|
185
|
-
onClick:
|
|
186
|
-
return setFilterPaneVisible(true);
|
|
187
|
-
}
|
|
158
|
+
onClick: () => setFilterPaneVisible(true)
|
|
188
159
|
})
|
|
189
160
|
}) : null,
|
|
190
161
|
noOverflow: true,
|
|
@@ -192,20 +163,24 @@ var SASQLookupComponent = function SASQLookupComponent(props) {
|
|
|
192
163
|
paneSub: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
193
164
|
id: "stripes-kint-components.sasqLookupComponent.mainPane.found",
|
|
194
165
|
values: {
|
|
195
|
-
total: data
|
|
166
|
+
total: data?.total
|
|
196
167
|
}
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Body,
|
|
168
|
+
}),
|
|
169
|
+
...mainPaneProps,
|
|
170
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Body, {
|
|
200
171
|
data: data,
|
|
201
172
|
filterPaneVisible: filterPaneVisible,
|
|
202
173
|
query: query,
|
|
203
|
-
toggleFilterPane: toggleFilterPane
|
|
204
|
-
|
|
205
|
-
|
|
174
|
+
toggleFilterPane: toggleFilterPane,
|
|
175
|
+
...restOfInfiniteQueryProps,
|
|
176
|
+
...sasqRenderProps,
|
|
177
|
+
...sasqProps,
|
|
178
|
+
...props
|
|
179
|
+
})
|
|
180
|
+
}), children]
|
|
206
181
|
});
|
|
207
182
|
}
|
|
208
|
-
})
|
|
183
|
+
});
|
|
209
184
|
};
|
|
210
185
|
SASQLookupComponent.propTypes = {
|
|
211
186
|
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
@@ -226,5 +201,4 @@ SASQLookupComponent.propTypes = {
|
|
|
226
201
|
resultColumns: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
227
202
|
sasqProps: _propTypes.default.object
|
|
228
203
|
};
|
|
229
|
-
var _default = SASQLookupComponent;
|
|
230
|
-
exports.default = _default;
|
|
204
|
+
var _default = exports.default = SASQLookupComponent;
|