@k-int/stripes-kint-components 1.2.5 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -11
- package/artifacts/coverage-jest/lcov-report/base.css +224 -0
- package/artifacts/coverage-jest/lcov-report/block-navigation.js +87 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/ActionList/ActionList.js.html +389 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/ActionList/ActionListFieldArray.js.html +1076 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/ActionList/index.html +147 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/ActionList/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableRefdataList/EditableRefdataList.js.html +680 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableRefdataList/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableRefdataList/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/EditableSettingsList.js.html +353 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js.html +353 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/SettingField/EditSettingValue.js.html +482 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js.html +434 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/SettingField/SettingField.js.html +644 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/SettingField/index.html +162 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/SettingField/index.js.html +188 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/index.html +147 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/EditableSettingsList/index.js.html +188 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/NoResultsMessage/NoResultsMessage.js.html +449 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/NoResultsMessage/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/NoResultsMessage/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/QueryTypedown/QueryTypedown.js.html +413 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/QueryTypedown/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/QueryTypedown/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/RefdataButtons/RefdataButtons.js.html +512 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/RefdataButtons/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/RefdataButtons/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQLookupComponent/SASQLookupComponent.js.html +1115 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQLookupComponent/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQLookupComponent/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQRoute/SASQRoute.js.html +404 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQRoute/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQRoute/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQViewComponent/SASQViewComponent.js.html +413 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQViewComponent/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SASQViewComponent/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SearchField/SearchField.js.html +353 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SearchField/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SearchField/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SettingPage/SettingPage.js.html +380 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SettingPage/SettingPagePane.js.html +308 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SettingPage/index.html +147 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/SettingPage/index.js.html +164 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/TypeDown/TypeDown.js.html +839 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/TypeDown/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/TypeDown/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/Typedown/Typedown.js.html +887 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/Typedown/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/Typedown/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/constants/eventCodes.js.html +209 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/constants/index.html +117 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/contexts/SettingsContext.js.html +206 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/contexts/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/contexts/index.js.html +140 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/index.html +252 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/index.js.html +374 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/settingsHooks/index.html +147 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/settingsHooks/index.js.html +164 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/settingsHooks/useSettingSection.js.html +305 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/settingsHooks/useSettings.js.html +584 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/typedownHooks/index.html +162 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/typedownHooks/index.js.html +188 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/typedownHooks/useTypedown.js.html +644 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/typedownHooks/useTypedownData.js.html +335 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/typedownHooks/useTypedownToggle.js.html +350 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useActiveElement.js.html +323 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useHelperApp.js.html +488 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useKiwtFieldArray.js.html +509 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useKiwtSASQuery.js.html +467 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useLocalStorageState.js.html +329 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useMutateRefdataValue.js.html +488 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useQIndex.js.html +407 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useRefdata.js.html +401 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/hooks/useTemplates.js.html +314 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/buildUrl.js.html +296 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/generateKiwtQuery.js.html +230 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/generateKiwtQueryParams.js.html +545 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/getFocusableElements.js.html +572 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/index.html +237 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/index.js.html +284 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/renderHelpText.js.html +410 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/selectorSafe.js.html +209 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/sortByLabel.js.html +248 -0
- package/artifacts/coverage-jest/lcov-report/es/lib/utils/toCamelCase.js.html +227 -0
- package/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
- package/artifacts/coverage-jest/lcov-report/index.html +717 -0
- package/artifacts/coverage-jest/lcov-report/prettify.css +1 -0
- package/artifacts/coverage-jest/lcov-report/prettify.js +2 -0
- package/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
- package/artifacts/coverage-jest/lcov-report/sorter.js +196 -0
- package/artifacts/coverage-jest/lcov-report/src/index.html +117 -0
- package/artifacts/coverage-jest/lcov-report/src/index.js.html +305 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/ActionList/ActionList.js.html +248 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/ActionList/ActionListFieldArray.js.html +764 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/ActionList/index.html +147 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/ActionList/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableRefdataList/EditableRefdataList.js.html +362 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableRefdataList/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableRefdataList/index.js.html +86 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/EditableSettingsList.js.html +224 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/EditableSettingsListFieldArray.js.html +212 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/SettingField/EditSettingValue.js.html +308 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/SettingField/RenderSettingValue.js.html +260 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/SettingField/SettingField.js.html +437 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/SettingField/index.html +162 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/SettingField/index.js.html +95 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/index.html +147 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/EditableSettingsList/index.js.html +95 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/NoResultsMessage/NoResultsMessage.js.html +320 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/NoResultsMessage/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/NoResultsMessage/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/QueryTypedown/QueryTypedown.js.html +185 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/QueryTypedown/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/QueryTypedown/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/RefdataButtons/RefdataButtons.js.html +371 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/RefdataButtons/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/RefdataButtons/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQLookupComponent/SASQLookupComponent.js.html +932 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQLookupComponent/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQLookupComponent/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQRoute/SASQRoute.js.html +275 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQRoute/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQRoute/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQViewComponent/SASQViewComponent.js.html +251 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQViewComponent/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SASQViewComponent/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SearchField/SearchField.js.html +215 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SearchField/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SearchField/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SettingPage/SettingPage.js.html +212 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SettingPage/SettingPagePane.js.html +149 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SettingPage/index.html +147 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/SettingPage/index.js.html +92 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/TypeDown/TypeDown.js.html +764 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/TypeDown/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/TypeDown/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/Typedown/Typedown.js.html +788 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/Typedown/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/Typedown/index.js.html +89 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/constants/eventCodes.js.html +95 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/constants/index.html +117 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/contexts/SettingsContext.js.html +98 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/contexts/index.html +132 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/contexts/index.js.html +86 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/index.html +252 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/index.js.html +116 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/settingsHooks/index.html +147 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/settingsHooks/index.js.html +92 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/settingsHooks/useSettingSection.js.html +164 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/settingsHooks/useSettings.js.html +377 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/typedownHooks/index.html +162 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/typedownHooks/index.js.html +95 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/typedownHooks/useTypedown.js.html +524 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/typedownHooks/useTypedownData.js.html +164 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/typedownHooks/useTypedownToggle.js.html +164 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useActiveElement.js.html +158 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useHelperApp.js.html +284 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useKiwtFieldArray.js.html +275 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useKiwtSASQuery.js.html +179 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useLocalStorageState.js.html +137 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useMutateRefdataValue.js.html +302 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useQIndex.js.html +209 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useRefdata.js.html +287 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/hooks/useTemplates.js.html +167 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/buildUrl.js.html +194 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/generateKiwtQuery.js.html +110 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/generateKiwtQueryParams.js.html +287 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/getFocusableElements.js.html +380 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/index.html +237 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/index.js.html +116 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/renderHelpText.js.html +167 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/selectorSafe.js.html +104 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/sortByLabel.js.html +131 -0
- package/artifacts/coverage-jest/lcov-report/src/lib/utils/toCamelCase.js.html +128 -0
- package/artifacts/coverage-jest/lcov.info +10040 -0
- package/es/artifacts/coverage-jest/lcov-report/block-navigation.js +109 -0
- package/es/artifacts/coverage-jest/lcov-report/prettify.js +998 -0
- package/es/artifacts/coverage-jest/lcov-report/sorter.js +238 -0
- package/es/index.js +104 -12
- package/es/lib/ActionList/ActionList.js +58 -24
- package/es/lib/ActionList/ActionListFieldArray.js +129 -84
- package/es/lib/ActionList/index.js +7 -3
- package/es/lib/EditableRefdataList/EditableRefdataList.js +52 -16
- package/es/lib/EditableRefdataList/index.js +7 -3
- package/es/lib/EditableSettingsList/EditableSettingsList.js +90 -0
- package/es/lib/{Settings → EditableSettingsList}/EditableSettingsListFieldArray.js +45 -14
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +181 -0
- package/es/lib/{Settings → EditableSettingsList/SettingField}/EditSettingValue.js +72 -9
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +447 -0
- package/es/lib/{Settings → EditableSettingsList/SettingField}/RenderSettingValue.js +45 -7
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +495 -0
- package/es/lib/{Settings → EditableSettingsList/SettingField}/SettingField.js +79 -36
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +180 -0
- package/es/lib/EditableSettingsList/SettingField/index.js +35 -0
- package/es/lib/EditableSettingsList/index.js +35 -0
- package/es/lib/NoResultsMessage/NoResultsMessage.js +122 -0
- package/es/lib/NoResultsMessage/index.js +19 -0
- package/es/lib/QueryTypedown/QueryTypedown.js +110 -0
- package/es/lib/QueryTypedown/index.js +19 -0
- package/es/lib/RefdataButtons/RefdataButtons.js +143 -0
- package/es/lib/RefdataButtons/index.js +19 -0
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +344 -0
- package/es/lib/SASQLookupComponent/index.js +19 -0
- package/es/lib/SASQRoute/SASQRoute.js +107 -0
- package/es/lib/SASQRoute/index.js +19 -0
- package/es/lib/SASQViewComponent/SASQViewComponent.js +110 -0
- package/es/lib/SASQViewComponent/index.js +19 -0
- package/es/lib/SearchField/SearchField.js +48 -13
- package/es/lib/SearchField/index.js +6 -2
- package/es/lib/SettingPage/SettingPage.js +99 -0
- package/es/lib/SettingPage/SettingPagePane.js +83 -0
- package/es/lib/SettingPage/index.js +27 -0
- package/es/lib/TypeDown/TypeDown.js +156 -95
- package/es/lib/TypeDown/index.js +6 -2
- package/es/lib/Typedown/Typedown.js +269 -0
- package/es/lib/Typedown/index.js +19 -0
- package/es/lib/constants/eventCodes.js +31 -1
- package/es/lib/contexts/SettingsContext.js +41 -0
- package/es/lib/contexts/index.js +19 -0
- package/es/lib/hooks/index.js +49 -7
- package/es/lib/hooks/settingsHooks/index.js +27 -0
- package/es/lib/hooks/settingsHooks/useSettingSection.js +74 -0
- package/es/lib/{Settings → hooks/settingsHooks}/useSettings.js +70 -21
- package/es/lib/hooks/typedownHooks/index.js +8 -28
- package/es/lib/hooks/typedownHooks/useTypedown.js +132 -11
- package/es/lib/hooks/typedownHooks/useTypedownData.js +35 -2
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +39 -6
- package/es/lib/hooks/useActiveElement.js +33 -2
- package/es/lib/hooks/useHelperApp.js +48 -9
- package/es/lib/hooks/useKiwtFieldArray.js +142 -0
- package/es/lib/hooks/useKiwtSASQuery.js +61 -6
- package/es/lib/hooks/useLocalStorageState.js +82 -0
- package/es/lib/hooks/useMutateRefdataValue.js +42 -9
- package/es/lib/hooks/useQIndex.js +108 -0
- package/es/lib/hooks/useRefdata.js +63 -13
- package/es/lib/hooks/useTemplates.js +36 -3
- package/es/lib/utils/buildUrl.js +43 -10
- package/es/lib/utils/generateKiwtQuery.js +31 -92
- package/es/lib/utils/generateKiwtQueryParams.js +154 -0
- package/es/lib/utils/index.js +47 -3
- package/es/lib/utils/renderHelpText.js +109 -0
- package/es/lib/utils/selectorSafe.js +31 -2
- package/es/lib/utils/sortByLabel.js +55 -0
- package/es/lib/utils/toCamelCase.js +48 -0
- package/jest.config.js +15 -1
- package/junit.xml +79 -0
- package/package.json +17 -10
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +248 -0
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +764 -0
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +147 -0
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +362 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +224 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +212 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +377 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +263 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +437 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +162 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +95 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +147 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +95 -0
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +320 -0
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +185 -0
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +371 -0
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +932 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +275 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +251 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +215 -0
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +212 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +179 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +147 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +92 -0
- package/src/artifacts/coverage-jest/lcov-report/TypeDown/TypeDown.js.html +770 -0
- package/src/artifacts/coverage-jest/lcov-report/TypeDown/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/TypeDown/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +791 -0
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +89 -0
- package/src/artifacts/coverage-jest/lcov-report/base.css +224 -0
- package/src/artifacts/coverage-jest/lcov-report/block-navigation.js +87 -0
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +95 -0
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +117 -0
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +98 -0
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +132 -0
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +92 -0
- package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +252 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +116 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +147 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +92 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +164 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +404 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +162 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +95 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +524 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +164 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +164 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +158 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +284 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +275 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +179 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +137 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +302 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +209 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +287 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +167 -0
- package/src/artifacts/coverage-jest/lcov-report/index.html +402 -0
- package/src/artifacts/coverage-jest/lcov-report/prettify.css +1 -0
- package/src/artifacts/coverage-jest/lcov-report/prettify.js +2 -0
- package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/sorter.js +196 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +194 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +110 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +287 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/getFocusableElements.js.html +386 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +237 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +116 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +167 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +104 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +128 -0
- package/src/artifacts/coverage-jest/lcov.info +2073 -0
- package/src/index.js +44 -6
- package/src/lib/ActionList/index.js +1 -1
- package/src/lib/EditableRefdataList/EditableRefdataList.js +1 -1
- package/src/lib/EditableRefdataList/README.md +1 -1
- package/src/lib/EditableRefdataList/index.js +1 -1
- package/src/lib/{Settings → EditableSettingsList}/EditableSettingsList.js +0 -0
- package/src/lib/{Settings → EditableSettingsList}/EditableSettingsListFieldArray.js +2 -2
- package/src/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +111 -0
- package/src/lib/{Settings → EditableSettingsList/SettingField}/EditSettingValue.js +24 -1
- package/src/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +379 -0
- package/src/lib/{Settings → EditableSettingsList/SettingField}/RenderSettingValue.js +2 -1
- package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +368 -0
- package/src/lib/{Settings → EditableSettingsList/SettingField}/SettingField.js +7 -7
- package/src/lib/EditableSettingsList/SettingField/SettingField.test.js +80 -0
- package/src/lib/EditableSettingsList/SettingField/index.js +3 -0
- package/src/lib/EditableSettingsList/index.js +3 -0
- package/src/lib/NoResultsMessage/NoResultsMessage.js +78 -0
- package/src/lib/NoResultsMessage/index.js +1 -0
- package/src/lib/QueryTypedown/QueryTypedown.js +33 -0
- package/src/lib/QueryTypedown/index.js +1 -0
- package/src/lib/{Settings → RefdataButtons}/RefdataButtons.js +1 -1
- package/src/lib/RefdataButtons/index.js +1 -0
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +282 -0
- package/src/lib/SASQLookupComponent/index.js +1 -0
- package/src/lib/SASQRoute/README.md +55 -0
- package/src/lib/SASQRoute/SASQRoute.js +63 -0
- package/src/lib/SASQRoute/index.js +1 -0
- package/src/lib/SASQViewComponent/SASQViewComponent.js +55 -0
- package/src/lib/SASQViewComponent/index.js +1 -0
- package/src/lib/{Settings → SettingPage}/SettingPage.js +5 -5
- package/src/lib/{Settings → SettingPage}/SettingPagePane.js +12 -2
- package/src/lib/SettingPage/index.js +2 -0
- package/src/lib/TypeDown/README.md +1 -0
- package/src/lib/TypeDown/TypeDown.js +24 -3
- package/src/lib/Typedown/README.md +115 -0
- package/src/lib/Typedown/Typedown.js +235 -0
- package/src/lib/Typedown/index.js +1 -0
- package/src/lib/{Settings → contexts}/SettingsContext.js +1 -1
- package/src/lib/contexts/index.js +2 -0
- package/src/lib/hooks/README.md +109 -2
- package/src/lib/hooks/index.js +4 -0
- package/src/lib/hooks/settingsHooks/index.js +2 -0
- package/src/lib/{Settings → hooks/settingsHooks}/useSettingSection.js +0 -0
- package/src/lib/{Settings → hooks/settingsHooks}/useSettings.js +14 -6
- package/src/lib/hooks/typedownHooks/index.js +0 -3
- package/src/lib/hooks/typedownHooks/useTypedown.js +95 -11
- package/src/lib/hooks/useHelperApp.js +5 -1
- package/src/lib/hooks/useKiwtFieldArray.js +63 -0
- package/src/lib/hooks/useKiwtSASQuery.js +9 -1
- package/src/lib/hooks/useLocalStorageState.js +17 -0
- package/src/lib/hooks/useQIndex.js +41 -0
- package/src/lib/hooks/useRefdata.js +23 -6
- package/src/lib/utils/README.md +39 -1
- package/src/lib/utils/generateKiwtQuery.js +3 -57
- package/src/lib/utils/generateKiwtQueryParams.js +67 -0
- package/src/lib/utils/index.js +8 -0
- package/src/lib/{Settings/utils → utils}/renderHelpText.js +1 -1
- package/src/lib/{Settings/utils → utils}/sortByLabel.js +1 -1
- package/src/lib/{Settings/utils → utils}/toCamelCase.js +0 -0
- package/styles/NoResultsMessage.css +38 -0
- package/test/helpers/index.js +1 -0
- package/test/helpers/translationsProperties.js +40 -0
- package/test/jest/helpers/KintHarness.js +36 -0
- package/test/jest/helpers/index.js +2 -0
- package/test/jest/helpers/renderWithKintHarness.js +15 -0
- package/test/jest/jest-transformer.js +4 -0
- package/test/jest/setupTests.js +1 -0
- package/translations/stripes-kint-components/en.json +6 -1
- package/yarn-error.log +15050 -0
- package/babelOptions.js +0 -30
- package/es/lib/Settings/EditableSettingsList.js +0 -57
- package/es/lib/Settings/RefdataButtons.js +0 -100
- package/es/lib/Settings/SettingPage.js +0 -64
- package/es/lib/Settings/SettingPagePane.js +0 -43
- package/es/lib/Settings/SettingsContext.js +0 -18
- package/es/lib/Settings/index.js +0 -71
- package/es/lib/Settings/useSettingSection.js +0 -41
- package/es/lib/Settings/utils/index.js +0 -31
- package/es/lib/Settings/utils/renderHelpText.js +0 -57
- package/es/lib/Settings/utils/sortByLabel.js +0 -26
- package/es/lib/Settings/utils/toCamelCase.js +0 -19
- package/es/lib/hooks/typedownHooks/useTypedownFooter.js +0 -47
- package/es/lib/hooks/typedownHooks/useTypedownList.js +0 -45
- package/es/lib/hooks/typedownHooks/useTypedownSearchField.js +0 -47
- package/es/lib/utils/getFocusableElements.js +0 -132
- package/src/lib/Settings/index.js +0 -8
- package/src/lib/Settings/utils/index.js +0 -3
- package/src/lib/hooks/typedownHooks/useTypedownFooter.js +0 -43
- package/src/lib/hooks/typedownHooks/useTypedownList.js +0 -36
- package/src/lib/hooks/typedownHooks/useTypedownSearchField.js +0 -39
- package/src/lib/utils/getFocusableElements.js +0 -99
|
@@ -1,31 +1,115 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
2
|
import { useResizeDetector } from 'react-resize-detector';
|
|
3
3
|
|
|
4
|
-
// TODO swap to stripes-components export once available (Will need <= peer dep bump)
|
|
5
4
|
import {
|
|
5
|
+
getFirstFocusable,
|
|
6
|
+
getLastFocusable,
|
|
6
7
|
getNextFocusable,
|
|
7
|
-
|
|
8
|
+
getPreviousFocusable,
|
|
9
|
+
} from '@folio/stripes/components';
|
|
8
10
|
|
|
9
11
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
DOWN_ARROW,
|
|
13
|
+
TAB,
|
|
14
|
+
UP_ARROW
|
|
15
|
+
} from '../../constants/eventCodes';
|
|
16
|
+
|
|
17
|
+
import selectorSafe from '../../utils/selectorSafe';
|
|
18
|
+
|
|
19
|
+
import useTypedownToggle from './useTypedownToggle';
|
|
15
20
|
|
|
16
21
|
const useTypedown = (name) => {
|
|
17
22
|
// SEARCHFIELD COMPONENT
|
|
18
|
-
const searchFieldComponent = document.getElementById(
|
|
23
|
+
const searchFieldComponent = document.getElementById(`typedown-searchField-${selectorSafe(name)}`);
|
|
19
24
|
|
|
20
25
|
// SET UP REFS
|
|
21
26
|
const listRef = useRef();
|
|
22
27
|
const triggerRef = useRef();
|
|
23
28
|
const overlayRef = useRef();
|
|
24
|
-
const footerRef =
|
|
29
|
+
const footerRef = useRef();
|
|
30
|
+
|
|
31
|
+
const footer = document.getElementById(`typedown-footer-${selectorSafe(name)}`);
|
|
32
|
+
// Add an event listener to the footer, so that we can control tab behaviour between footer elements
|
|
33
|
+
|
|
34
|
+
if (footer && footer.getAttribute('hasListener') !== 'true') {
|
|
35
|
+
footer.addEventListener('keydown', e => {
|
|
36
|
+
// We want special behaviour on tab
|
|
37
|
+
if (e.code === TAB) {
|
|
38
|
+
// Prevent the default behaviour
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
const focusFunc = e.shiftKey ? getPreviousFocusable : getNextFocusable;
|
|
41
|
+
const elem = focusFunc(footerRef.current, true, true, false, true);
|
|
42
|
+
|
|
43
|
+
if (elem) {
|
|
44
|
+
// Focus on next focusable element
|
|
45
|
+
elem.focus();
|
|
46
|
+
} else if (e.shiftKey) {
|
|
47
|
+
// We are at the beginning of the list, refocus on search bar
|
|
48
|
+
searchFieldComponent.focus();
|
|
49
|
+
} else {
|
|
50
|
+
// We are at the end of the list, move onto next focusable element in page
|
|
51
|
+
getNextFocusable(searchFieldComponent, false).focus();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
footer.setAttribute('hasListener', 'true');
|
|
57
|
+
}
|
|
25
58
|
|
|
26
59
|
// SET UP HANDLERS
|
|
27
|
-
const searchFieldKeyDownHandler =
|
|
28
|
-
|
|
60
|
+
const searchFieldKeyDownHandler = e => {
|
|
61
|
+
if (e.code === UP_ARROW) {
|
|
62
|
+
const elem = getLastFocusable(listRef.current, true, true);
|
|
63
|
+
if (elem) {
|
|
64
|
+
elem.focus();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (e.code === DOWN_ARROW) {
|
|
69
|
+
const elem = getFirstFocusable(listRef.current, true, true);
|
|
70
|
+
if (elem) {
|
|
71
|
+
elem.focus();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Tab key (But not while shifting)
|
|
76
|
+
if (e.code === TAB && !e.shiftKey) {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
// If we have focusable elements in the footer, then focus on them, else unfocus searchbar
|
|
79
|
+
const elem = getNextFocusable(footerRef.current, true, true, true, true);
|
|
80
|
+
if (elem) {
|
|
81
|
+
elem.focus();
|
|
82
|
+
} else {
|
|
83
|
+
getNextFocusable(searchFieldComponent, false).focus();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const listKeyDownHandler = e => {
|
|
89
|
+
if (e.code === DOWN_ARROW) {
|
|
90
|
+
const elem = getNextFocusable(listRef.current, true, true);
|
|
91
|
+
elem.focus();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (e.code === UP_ARROW) {
|
|
95
|
+
const elem = getPreviousFocusable(listRef.current, true, true);
|
|
96
|
+
elem.focus();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (e.code === TAB) {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
let elem;
|
|
102
|
+
if (!e.shiftKey && !footerRef.current) {
|
|
103
|
+
elem = getNextFocusable(searchFieldComponent, false);
|
|
104
|
+
} else if (!e.shiftKey) {
|
|
105
|
+
elem = getNextFocusable(footerRef.current, true, true, true, true);
|
|
106
|
+
} else {
|
|
107
|
+
elem = searchFieldComponent;
|
|
108
|
+
}
|
|
109
|
+
elem.focus();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
29
113
|
const handleNextFocus = () => getNextFocusable(searchFieldComponent, false).focus();
|
|
30
114
|
|
|
31
115
|
// SET UP VARIABLES
|
|
@@ -13,6 +13,10 @@ const useHelperApp = (helpers) => {
|
|
|
13
13
|
setCurrentHelper(helper !== currentHelper ? helper : undefined);
|
|
14
14
|
}, [currentHelper]);
|
|
15
15
|
|
|
16
|
+
const isOpen = (hlp) => {
|
|
17
|
+
return currentHelper === hlp;
|
|
18
|
+
};
|
|
19
|
+
|
|
16
20
|
useEffect(() => {
|
|
17
21
|
if (currentHelper !== query?.helper) {
|
|
18
22
|
const newQuery = {
|
|
@@ -56,7 +60,7 @@ const useHelperApp = (helpers) => {
|
|
|
56
60
|
helperToggleFunctions[h] = () => handleToggleHelper(h);
|
|
57
61
|
});
|
|
58
62
|
|
|
59
|
-
return { HelperComponent, helperToggleFunctions };
|
|
63
|
+
return { HelperComponent, helperToggleFunctions, isOpen };
|
|
60
64
|
};
|
|
61
65
|
|
|
62
66
|
export default useHelperApp;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useFieldArray } from 'react-final-form-arrays';
|
|
3
|
+
|
|
4
|
+
const useKiwtFieldArray = (name, submitWholeDeletedObject = false) => {
|
|
5
|
+
const { fields } = useFieldArray(name);
|
|
6
|
+
const { value: values = [] } = fields;
|
|
7
|
+
const [endOfList, setEndOfList] = useState(0);
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const i = values.filter(line => !line._delete);
|
|
11
|
+
setEndOfList(i.length);
|
|
12
|
+
}, [values]);
|
|
13
|
+
|
|
14
|
+
const onAddField = (field = { _delete: false }) => {
|
|
15
|
+
fields.insert(endOfList, field);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const onMarkForDeletion = (field) => {
|
|
19
|
+
if (field && field.id) {
|
|
20
|
+
if (submitWholeDeletedObject) {
|
|
21
|
+
fields.push({ ...field, _delete: true });
|
|
22
|
+
} else {
|
|
23
|
+
fields.push({ id: field.id, _delete: true });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const onDeleteField = (index, field) => {
|
|
29
|
+
fields.remove(index);
|
|
30
|
+
onMarkForDeletion(field);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const onPrependField = (field = { _delete: false }) => {
|
|
34
|
+
fields.unshift(field);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const onReplaceField = (index, field) => {
|
|
38
|
+
if (fields.update) { // react-final-form-arrays
|
|
39
|
+
fields.update(index, field);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const onUpdateField = (index, field) => {
|
|
44
|
+
fields.update(index, {
|
|
45
|
+
...fields.value[index],
|
|
46
|
+
...field,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const items = values.slice(0, endOfList);
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
items,
|
|
54
|
+
onAddField,
|
|
55
|
+
onDeleteField,
|
|
56
|
+
onMarkForDeletion,
|
|
57
|
+
onPrependField,
|
|
58
|
+
onReplaceField,
|
|
59
|
+
onUpdateField,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default useKiwtFieldArray;
|
|
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { useLocation, useHistory } from 'react-router-dom';
|
|
3
3
|
|
|
4
4
|
import buildUrl from '../utils/buildUrl';
|
|
5
|
+
import useQindex from './useQIndex';
|
|
5
6
|
|
|
6
7
|
const locationQuerySetter = ({ location, history, nsValues }) => {
|
|
7
8
|
const url = buildUrl(location, nsValues);
|
|
@@ -13,8 +14,15 @@ const useKiwtSASQuery = () => {
|
|
|
13
14
|
const location = useLocation();
|
|
14
15
|
const [query, setQuery] = useState({});
|
|
15
16
|
const queryGetter = () => query;
|
|
17
|
+
|
|
18
|
+
const [qindex] = useQindex();
|
|
19
|
+
// Ensure we update the query along with the querySetter
|
|
20
|
+
if (query.qindex !== qindex) {
|
|
21
|
+
setQuery({ ...query, qindex });
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
const querySetter = ({ nsValues }) => {
|
|
17
|
-
setQuery(nsValues);
|
|
25
|
+
setQuery({ ...query, ...nsValues, qindex });
|
|
18
26
|
locationQuerySetter({ location, history, nsValues });
|
|
19
27
|
};
|
|
20
28
|
return { query, queryGetter, querySetter };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useLocalStorage, writeStorage } from '@rehooks/local-storage';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const useLocalStorageState = (key, defaultValue) => {
|
|
6
|
+
const [local] = useLocalStorage(key, defaultValue);
|
|
7
|
+
const [localState, setLocalState] = useState(local);
|
|
8
|
+
|
|
9
|
+
const setLocalStorageState = (newValue) => {
|
|
10
|
+
setLocalState(newValue);
|
|
11
|
+
writeStorage(key, newValue);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return [localState, setLocalStorageState];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default useLocalStorageState;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom';
|
|
3
|
+
import queryString from 'query-string';
|
|
4
|
+
|
|
5
|
+
const useQIndex = () => {
|
|
6
|
+
const history = useHistory();
|
|
7
|
+
const location = useLocation();
|
|
8
|
+
|
|
9
|
+
const query = queryString.parse(location.search);
|
|
10
|
+
const [currentQindex, setCurrentQindex] = useState(query?.qindex);
|
|
11
|
+
|
|
12
|
+
const handleQindexChange = (newQindex) => {
|
|
13
|
+
setCurrentQindex(newQindex);
|
|
14
|
+
if (newQindex !== query?.qindex) {
|
|
15
|
+
const newQuery = {
|
|
16
|
+
...query,
|
|
17
|
+
qindex: newQindex
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
history.push({
|
|
21
|
+
pathname: location.pathname,
|
|
22
|
+
search: `?${queryString.stringify(newQuery)}`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (currentQindex !== query?.qindex) {
|
|
29
|
+
setCurrentQindex(query?.qindex);
|
|
30
|
+
}
|
|
31
|
+
}, [
|
|
32
|
+
currentQindex,
|
|
33
|
+
history,
|
|
34
|
+
location,
|
|
35
|
+
query
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
return [currentQindex, handleQindexChange];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default useQIndex;
|
|
@@ -4,25 +4,42 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { useQuery } from 'react-query';
|
|
5
5
|
import { useOkapiKy } from '@folio/stripes/core';
|
|
6
6
|
|
|
7
|
+
import { generateKiwtQuery } from '../utils';
|
|
8
|
+
|
|
7
9
|
const useRefdata = ({
|
|
8
10
|
endpoint,
|
|
9
11
|
desc,
|
|
10
12
|
queryParams,
|
|
11
|
-
returnQueryObject = false
|
|
13
|
+
returnQueryObject = false,
|
|
14
|
+
options = {
|
|
15
|
+
filterKeys: {
|
|
16
|
+
DescKey: 'desc'
|
|
17
|
+
},
|
|
18
|
+
stats: false,
|
|
19
|
+
max: 100
|
|
20
|
+
}
|
|
12
21
|
}) => {
|
|
13
22
|
const ky = useOkapiKy();
|
|
14
|
-
|
|
23
|
+
|
|
24
|
+
const nsValues = {};
|
|
25
|
+
|
|
26
|
+
/* Desc will tend to contain a '.', which will throw off generateKiwtQuery.
|
|
27
|
+
* To combat this we can insert another Desc. at the beginning to act as the filtername, so
|
|
28
|
+
* Funder.Name => Desc.desc=Funder.Name. This way "Desc" acts as the filterName, and without a filterKey
|
|
29
|
+
* "desc=Funder.Name" is passed wholesale to the query.
|
|
30
|
+
*/
|
|
15
31
|
|
|
16
32
|
if (Array.isArray(desc)) {
|
|
17
33
|
// If we have an array, append a desc filter for each desc given
|
|
18
|
-
desc.
|
|
19
|
-
path += `${index === 0 ? '?filters=' : '%7C%7C'}desc=${d}`;
|
|
20
|
-
});
|
|
34
|
+
nsValues.filters = desc.map(d => `DescKey.${d}`).join(',');
|
|
21
35
|
} else if (desc) {
|
|
22
36
|
// If we just have a string, append a single desc filter
|
|
23
|
-
|
|
37
|
+
nsValues.filters = `DescKey.${desc}`;
|
|
24
38
|
}
|
|
25
39
|
|
|
40
|
+
const query = generateKiwtQuery(options, nsValues);
|
|
41
|
+
const path = `${endpoint}${query}`;
|
|
42
|
+
|
|
26
43
|
const queryObject = useQuery(
|
|
27
44
|
['stripes-kint-components', 'useRefdata', 'refdata', desc ?? ''],
|
|
28
45
|
() => ky(path).json(),
|
package/src/lib/utils/README.md
CHANGED
|
@@ -29,5 +29,43 @@ import { generateKiwtQuery } from '@k-int/stripes-kint-components'
|
|
|
29
29
|
### Props
|
|
30
30
|
Name | Type | Description | default | required
|
|
31
31
|
--- | --- | --- | --- | ---
|
|
32
|
-
options | object | An object with keys: `searchKey`, `filterKeys`, `sortKeys` and `stats`, which maps the incoming nsValues objects to a KIWT query. | | ✓ |
|
|
32
|
+
options | object | An object with keys: `searchKey`, `filterKeys`, `sortKeys` and `stats`, which maps the incoming nsValues objects to a KIWT query. You can also pass arbitrary `key`/`value` pairs to append `key==value` onto the query. | | ✓ |
|
|
33
|
+
nsValues | object | An object containing the actual query parameters to become the mapped KIWT query | | ✓ |
|
|
34
|
+
|
|
35
|
+
## generateKiwtQueryParams
|
|
36
|
+
A util function for generating an array of "KIWT" (K-Int Web-Toolkit) style backend query parameters from a SASQ query object
|
|
37
|
+
### Basic usage
|
|
38
|
+
```
|
|
39
|
+
import { generateKiwtQueryParams } from '@k-int/stripes-kint-components'
|
|
40
|
+
...
|
|
41
|
+
const nsValues = {
|
|
42
|
+
query: 'test',
|
|
43
|
+
filters: 'requestStatus.completed,journalVolume.test1,startDate.startDate>=2021-10-28'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const options = {
|
|
47
|
+
searchKey: 'request.name',
|
|
48
|
+
filterKeys: {
|
|
49
|
+
requestStatus: 'requestStatus.value,
|
|
50
|
+
journalVolume: 'journalVolume'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const queryArray = generateKiwtQueryParams(options, nsValues)
|
|
55
|
+
|
|
56
|
+
// We'd expect queryArray === [
|
|
57
|
+
"match=request.name",
|
|
58
|
+
"term=test",
|
|
59
|
+
"filters=requestStatus.value==completed",
|
|
60
|
+
"filters=journalVolume==test1",
|
|
61
|
+
"filters=startDate%3E=2021-10-28",
|
|
62
|
+
"stats=true"
|
|
63
|
+
]
|
|
64
|
+
...
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Props
|
|
68
|
+
Name | Type | Description | default | required
|
|
69
|
+
--- | --- | --- | --- | ---
|
|
70
|
+
options | object | An object with keys: `searchKey`, `filterKeys`, `sortKeys` and `stats`, which maps the incoming nsValues objects to an KIWT query array. You can also pass arbitrary `key`/`value` pairs to append `key==value` onto the query. | | ✓ |
|
|
33
71
|
nsValues | object | An object containing the actual query parameters to become the mapped KIWT query | | ✓ |
|
|
@@ -1,61 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const { query, filters, sort } = nsValues;
|
|
3
|
-
const {
|
|
4
|
-
searchKey = '',
|
|
5
|
-
/* Assumtion made that if no filterKey is provided then the given filterValues for that key are standalaone, ie require no comparator or key */
|
|
6
|
-
filterKeys = {},
|
|
7
|
-
sortKeys = {},
|
|
8
|
-
stats = true,
|
|
9
|
-
} = options;
|
|
10
|
-
|
|
11
|
-
const paramsArray = [];
|
|
12
|
-
|
|
13
|
-
if (query) {
|
|
14
|
-
paramsArray.push(...searchKey.split(',')?.map(m => `match=${m}`));
|
|
15
|
-
paramsArray.push(`term=${query}`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (filters) {
|
|
19
|
-
const filterMap = {};
|
|
20
|
-
filters.split(',').forEach(filter => {
|
|
21
|
-
const [filterName, ...rest] = filter.split('.');
|
|
22
|
-
const filterValue = rest.join('.');
|
|
23
|
-
|
|
24
|
-
if (filterMap[filterName] === undefined) filterMap[filterName] = [];
|
|
25
|
-
filterMap[filterName].push(filterValue);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// We now have a filterMap of shape { status: ['active', 'cancelled'], type: ['local'] }
|
|
29
|
-
Object.entries(filterMap).forEach(([filterName, filterValues]) => {
|
|
30
|
-
const filterKey = filterKeys[filterName];
|
|
31
|
-
|
|
32
|
-
if (!filterKey) {
|
|
33
|
-
// These filters have no key mapping so we just pass the values to the backend as-is.
|
|
34
|
-
paramsArray.push(...filterValues?.map(f => `filters=${f}`));
|
|
35
|
-
} else {
|
|
36
|
-
const filterString = filterValues.map(v => `${filterKey}==${v}`).join('||');
|
|
37
|
-
paramsArray.push(`filters=${filterString}`);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (sort) {
|
|
43
|
-
paramsArray.push(...sort.split(',').map(sortKey => {
|
|
44
|
-
const descending = sortKey.startsWith('-');
|
|
45
|
-
let term = sortKey.replace('-', '');
|
|
46
|
-
|
|
47
|
-
if (term in sortKeys) {
|
|
48
|
-
term = term.replace(term, sortKeys[term]);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return `sort=${term};${descending ? 'desc' : 'asc'}`;
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (stats) {
|
|
56
|
-
paramsArray.push('stats=true');
|
|
57
|
-
}
|
|
1
|
+
import generateKiwtQueryParams from './generateKiwtQueryParams';
|
|
58
2
|
|
|
3
|
+
const generateKiwtQuery = (options, nsValues) => {
|
|
4
|
+
const paramsArray = generateKiwtQueryParams(options, nsValues);
|
|
59
5
|
return paramsArray.length ? '?' + paramsArray.map(p => encodeURI(p)).join('&') : '';
|
|
60
6
|
};
|
|
61
7
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const generateKiwtQueryParams = (options, nsValues) => {
|
|
2
|
+
const { qindex, query, filters, sort } = nsValues;
|
|
3
|
+
const {
|
|
4
|
+
searchKey = '',
|
|
5
|
+
/* Assumtion made that if no filterKey is provided then the given filterValues for that key are standalaone, ie require no comparator or key */
|
|
6
|
+
filterKeys = {},
|
|
7
|
+
sortKeys = {},
|
|
8
|
+
stats = true,
|
|
9
|
+
...rest
|
|
10
|
+
} = options;
|
|
11
|
+
|
|
12
|
+
const paramsArray = [];
|
|
13
|
+
|
|
14
|
+
if (query) {
|
|
15
|
+
paramsArray.push(...(qindex || searchKey).split(',')?.map(m => `match=${m}`));
|
|
16
|
+
paramsArray.push(`term=${query}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (filters) {
|
|
20
|
+
const filterMap = {};
|
|
21
|
+
filters.split(',').forEach(filter => {
|
|
22
|
+
const [filterName, ...filterRest] = filter.split('.');
|
|
23
|
+
const filterValue = filterRest.join('.');
|
|
24
|
+
|
|
25
|
+
if (filterMap[filterName] === undefined) filterMap[filterName] = [];
|
|
26
|
+
filterMap[filterName].push(filterValue);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// We now have a filterMap of shape { status: ['active', 'cancelled'], type: ['local'] }
|
|
30
|
+
Object.entries(filterMap).forEach(([filterName, filterValues]) => {
|
|
31
|
+
const filterKey = filterKeys[filterName];
|
|
32
|
+
|
|
33
|
+
if (!filterKey) {
|
|
34
|
+
// These filters have no key mapping so we just pass the values to the backend as-is.
|
|
35
|
+
paramsArray.push(...filterValues?.map(f => `filters=${f}`));
|
|
36
|
+
} else {
|
|
37
|
+
const filterString = filterValues.map(v => `${filterKey}==${v}`).join('||');
|
|
38
|
+
paramsArray.push(`filters=${filterString}`);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (sort) {
|
|
44
|
+
paramsArray.push(...sort.split(',').map(sortKey => {
|
|
45
|
+
const descending = sortKey.startsWith('-');
|
|
46
|
+
let term = sortKey.replace('-', '');
|
|
47
|
+
|
|
48
|
+
if (term in sortKeys) {
|
|
49
|
+
term = term.replace(term, sortKeys[term]);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return `sort=${term};${descending ? 'desc' : 'asc'}`;
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (stats) {
|
|
57
|
+
paramsArray.push('stats=true');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
61
|
+
paramsArray.push(`${key}=${value}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return paramsArray;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default generateKiwtQueryParams;
|
package/src/lib/utils/index.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export { default as generateKiwtQuery } from './generateKiwtQuery';
|
|
2
|
+
export { default as generateKiwtQueryParams } from './generateKiwtQueryParams';
|
|
3
|
+
export { default as selectorSafe } from './selectorSafe';
|
|
4
|
+
|
|
2
5
|
export { default as buildUrl } from './buildUrl';
|
|
6
|
+
|
|
7
|
+
// Settings utils
|
|
8
|
+
export { default as renderHelpText } from './renderHelpText';
|
|
9
|
+
export { default as sortByLabel } from './sortByLabel';
|
|
10
|
+
export { default as toCamelCase } from './toCamelCase'; // I hate that this exists
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* No Results Message
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@import '@folio/stripes-components/lib/variables.css';
|
|
6
|
+
|
|
7
|
+
/* Empty Message */
|
|
8
|
+
.noResultsMessage {
|
|
9
|
+
padding: 15px;
|
|
10
|
+
color: var(--color-text-p2);
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
background: var(--color-fill);
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.noResultsMessage,
|
|
21
|
+
.noResultsMessageLabelWrap {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.noResultsMessageLabelWrap {
|
|
28
|
+
font-size: var(--font-size-large);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.noResultsMessageIcon,
|
|
32
|
+
.noResultsMessageLabel {
|
|
33
|
+
margin: 0 4px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.noResultsMessageButton {
|
|
37
|
+
margin-top: 15px;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './translationsProperties';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import translations from '../../translations/stripes-kint-components/en';
|
|
2
|
+
|
|
3
|
+
const translationsProperties = [
|
|
4
|
+
{
|
|
5
|
+
prefix: 'stripes-kint-components',
|
|
6
|
+
translations,
|
|
7
|
+
},
|
|
8
|
+
/* Don't think we're using any of the below rn */
|
|
9
|
+
{
|
|
10
|
+
prefix: 'stripes-core',
|
|
11
|
+
translations: {
|
|
12
|
+
'label.missingRequiredField': 'Please fill this in to continue',
|
|
13
|
+
'button.save': 'Save',
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
prefix: 'stripes-components',
|
|
18
|
+
translations: {
|
|
19
|
+
'saveAndClose': 'Save and close',
|
|
20
|
+
'cancel': 'Cancel',
|
|
21
|
+
'paneMenuActionsToggleLabel': 'Actions',
|
|
22
|
+
'collapseAll': 'Collapse all',
|
|
23
|
+
'button.edit': 'Edit'
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
prefix: 'stripes-smart-components',
|
|
28
|
+
translations: {
|
|
29
|
+
'permissionError': 'Sorry - your permissions do not allow access to this page.',
|
|
30
|
+
'searchAndFilter': 'Search and filter',
|
|
31
|
+
'hideSearchPane': 'Hide search pane',
|
|
32
|
+
'search': 'Search',
|
|
33
|
+
'resetAll': 'Reset all',
|
|
34
|
+
'searchResultsCountHeader': '"{count, number} {count, plural, one {record found} other {records found}}"',
|
|
35
|
+
'new': 'New'
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
export default translationsProperties;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Harness } from '@folio/stripes-erm-components/test/jest/helpers';
|
|
4
|
+
|
|
5
|
+
import { SettingsContext } from '../../../src/lib/contexts';
|
|
6
|
+
import translationsProperties from '../../helpers';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export default function KintHarness({
|
|
10
|
+
children,
|
|
11
|
+
settingsValues = {
|
|
12
|
+
intlKey: 'stripes-kint-components',
|
|
13
|
+
refdataEndpoint: 'path/to/refdata',
|
|
14
|
+
settingEndpoint: 'path/to/settings',
|
|
15
|
+
templateEndpoint: 'path/to/templates'
|
|
16
|
+
},
|
|
17
|
+
translations = translationsProperties,
|
|
18
|
+
...harnessProps
|
|
19
|
+
}) {
|
|
20
|
+
return (
|
|
21
|
+
<SettingsContext.Provider value={settingsValues}>
|
|
22
|
+
<Harness
|
|
23
|
+
translations={translations}
|
|
24
|
+
{...harnessProps}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</Harness>
|
|
28
|
+
</SettingsContext.Provider>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
KintHarness.propTypes = {
|
|
33
|
+
children: PropTypes.node,
|
|
34
|
+
settingsValues: PropTypes.object,
|
|
35
|
+
translations: PropTypes.object
|
|
36
|
+
};
|