@k-int/stripes-kint-components 1.3.0 → 1.7.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 +34 -2
- 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 +69 -17
- package/es/lib/ActionList/ActionList.js +63 -24
- package/es/lib/ActionList/ActionListFieldArray.js +158 -96
- package/es/lib/ActionList/index.js +7 -3
- package/es/lib/EditableRefdataList/EditableRefdataList.js +69 -24
- package/es/lib/EditableRefdataList/index.js +7 -3
- package/es/lib/EditableSettingsList/EditableSettingsList.js +90 -0
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +90 -0
- 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/EditableSettingsList/SettingField/SettingField.js +187 -0
- 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 +48 -9
- package/es/lib/QueryTypedown/index.js +6 -2
- package/es/lib/RefdataButtons/RefdataButtons.js +143 -0
- package/es/lib/RefdataButtons/index.js +19 -0
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +202 -131
- package/es/lib/SASQLookupComponent/index.js +6 -2
- package/es/lib/SASQRoute/SASQRoute.js +55 -18
- package/es/lib/SASQRoute/index.js +6 -2
- package/es/lib/SASQViewComponent/SASQViewComponent.js +50 -11
- package/es/lib/SASQViewComponent/index.js +6 -2
- 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 +143 -101
- package/es/lib/TypeDown/index.js +6 -2
- package/es/lib/Typedown/Typedown.js +140 -96
- package/es/lib/Typedown/index.js +6 -2
- 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 +42 -8
- package/es/lib/hooks/settingsHooks/index.js +27 -0
- package/es/lib/hooks/settingsHooks/useSettingSection.js +74 -0
- package/es/lib/hooks/settingsHooks/useSettings.js +175 -0
- package/es/lib/hooks/typedownHooks/index.js +8 -28
- package/es/lib/hooks/typedownHooks/useTypedown.js +129 -12
- 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 +51 -12
- package/es/lib/hooks/useKiwtFieldArray.js +142 -0
- package/es/lib/hooks/useKiwtSASQuery.js +62 -7
- package/es/lib/hooks/useLocalStorageState.js +37 -4
- package/es/lib/hooks/useMutateRefdataValue.js +42 -9
- package/es/lib/hooks/useQIndex.js +108 -0
- package/es/lib/hooks/useRefdata.js +56 -12
- package/es/lib/hooks/useTemplates.js +36 -3
- package/es/lib/utils/buildUrl.js +43 -10
- package/es/lib/utils/generateKiwtQuery.js +31 -108
- package/es/lib/utils/generateKiwtQueryParams.js +154 -0
- package/es/lib/utils/index.js +55 -3
- package/es/lib/utils/refdataOptions.js +43 -0
- 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 +256 -0
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +799 -0
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +146 -0
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +376 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +223 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +211 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +376 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +262 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +436 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +161 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +94 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +146 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +94 -0
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +319 -0
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +184 -0
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +370 -0
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +949 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +274 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +250 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +214 -0
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +211 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +178 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +146 -0
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +91 -0
- package/src/artifacts/coverage-jest/lcov-report/TypeDown/TypeDown.js.html +769 -0
- package/src/artifacts/coverage-jest/lcov-report/TypeDown/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/TypeDown/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +790 -0
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +88 -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 +94 -0
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +116 -0
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +97 -0
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +91 -0
- package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +251 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +115 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +146 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +91 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +163 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +403 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +161 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +94 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +520 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +163 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +163 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +157 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +283 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +274 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +178 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +136 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +301 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +208 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +268 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +166 -0
- package/src/artifacts/coverage-jest/lcov-report/index.html +401 -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 +193 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +109 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +286 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +236 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +121 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +106 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +166 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +103 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +130 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +127 -0
- package/src/artifacts/coverage-jest/lcov.info +1999 -0
- package/src/index.js +21 -6
- package/src/lib/ActionList/ActionList.js +5 -2
- package/src/lib/ActionList/ActionListFieldArray.js +20 -8
- package/src/lib/ActionList/README.md +1 -0
- package/src/lib/ActionList/index.js +1 -1
- package/src/lib/EditableRefdataList/EditableRefdataList.js +10 -5
- 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/{Settings → RefdataButtons}/RefdataButtons.js +1 -1
- package/src/lib/RefdataButtons/index.js +1 -0
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +36 -8
- package/src/lib/SASQRoute/README.md +1 -1
- 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 -115
- package/src/lib/TypeDown/TypeDown.js +4 -2
- package/src/lib/Typedown/Typedown.js +2 -1
- package/src/lib/{Settings → contexts}/SettingsContext.js +1 -1
- package/src/lib/contexts/index.js +2 -0
- package/src/lib/hooks/README.md +107 -0
- package/src/lib/hooks/index.js +3 -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 +93 -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/useQIndex.js +41 -0
- package/src/lib/hooks/useRefdata.js +17 -6
- package/src/lib/utils/README.md +39 -1
- package/src/lib/utils/generateKiwtQuery.js +3 -62
- package/src/lib/utils/generateKiwtQueryParams.js +67 -0
- package/src/lib/utils/index.js +10 -0
- package/src/lib/utils/refdataOptions.js +7 -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 +4 -1
- package/babelOptions.js +0 -30
- package/es/lib/Settings/EditableSettingsList.js +0 -57
- package/es/lib/Settings/EditableSettingsListFieldArray.js +0 -59
- package/es/lib/Settings/RefdataButtons.js +0 -100
- package/es/lib/Settings/SettingField.js +0 -144
- 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/useSettings.js +0 -126
- 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,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -27,11 +27,18 @@ var _typedownHooks = require("../hooks/typedownHooks");
|
|
|
27
27
|
|
|
28
28
|
var _selectorSafe = _interopRequireDefault(require("../utils/selectorSafe"));
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
33
|
|
|
32
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
35
|
|
|
34
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return {
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
(function () {
|
|
39
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
40
|
+
enterModule && enterModule(module);
|
|
41
|
+
})();
|
|
35
42
|
|
|
36
43
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
44
|
|
|
@@ -45,6 +52,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
45
52
|
|
|
46
53
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
54
|
|
|
55
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
56
|
+
return a;
|
|
57
|
+
};
|
|
58
|
+
|
|
48
59
|
/* @deprecated
|
|
49
60
|
* Replaced by Typedown and QueryTypedown.
|
|
50
61
|
*/
|
|
@@ -62,10 +73,11 @@ var TypeDown = function TypeDown(_ref) {
|
|
|
62
73
|
uniqueIdentificationPath = _ref$uniqueIdentifica === void 0 ? 'id' : _ref$uniqueIdentifica;
|
|
63
74
|
(0, _react.useEffect)(function () {
|
|
64
75
|
if (process.env.NODE_ENV === 'development') {
|
|
76
|
+
// eslint-disable-next-line no-console
|
|
65
77
|
console.warn('TypeDown component is deprecated, you likely want either Typedown or QueryTypedown');
|
|
66
78
|
}
|
|
67
79
|
}, []);
|
|
68
|
-
var selectedUniqueId = (0, _get
|
|
80
|
+
var selectedUniqueId = (0, _get.default)(input.value, uniqueIdentificationPath);
|
|
69
81
|
|
|
70
82
|
var _useState = (0, _react.useState)(pathMutator(null, path)),
|
|
71
83
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -91,119 +103,149 @@ var TypeDown = function TypeDown(_ref) {
|
|
|
91
103
|
searchWidth = _useTypedown$variable.searchWidth;
|
|
92
104
|
|
|
93
105
|
var renderItem = (0, _react.useCallback)(function (option) {
|
|
94
|
-
return /*#__PURE__*/
|
|
95
|
-
className: _TypeDown
|
|
96
|
-
|
|
106
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
107
|
+
className: _TypeDown.default.listItem,
|
|
108
|
+
children: renderListItem ? renderListItem(option) : (0, _get.default)(option, uniqueIdentificationPath)
|
|
109
|
+
});
|
|
97
110
|
}, [renderListItem, uniqueIdentificationPath]);
|
|
98
|
-
|
|
99
|
-
var handleChange = function handleChange(value) {
|
|
111
|
+
var handleChange = (0, _react.useCallback)(function (value) {
|
|
100
112
|
input.onChange(value);
|
|
101
113
|
|
|
102
114
|
if (typeof onChange === 'function') {
|
|
103
115
|
onChange(value);
|
|
104
116
|
}
|
|
105
|
-
};
|
|
106
|
-
|
|
117
|
+
}, [input, onChange]);
|
|
107
118
|
var dropDown = (0, _react.useCallback)(function () {
|
|
108
|
-
return /*#__PURE__*/
|
|
109
|
-
className: _TypeDown
|
|
110
|
-
id: "typedown-parent-".concat((0, _selectorSafe
|
|
119
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
120
|
+
className: _TypeDown.default.dropdownMenu,
|
|
121
|
+
id: "typedown-parent-".concat((0, _selectorSafe.default)(input.name), "-menu"),
|
|
111
122
|
style: {
|
|
112
123
|
'--searchWidth': "".concat(searchWidth, "px")
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
124
|
+
},
|
|
125
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
126
|
+
ref: listRef,
|
|
127
|
+
className: _TypeDown.default.listContainer,
|
|
128
|
+
id: "typedown-list",
|
|
129
|
+
children: data !== null && data !== void 0 && data.length ? data === null || data === void 0 ? void 0 : data.map(function (d, index) {
|
|
130
|
+
var isSelected = (0, _get.default)(input.value, uniqueIdentificationPath) === (0, _get.default)(d, uniqueIdentificationPath);
|
|
131
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
132
|
+
className: (0, _classnames.default)(_interactionStyles.interactionStyles, _TypeDown.default.fullWidth, _TypeDown.default.menuButton),
|
|
133
|
+
"data-selected": isSelected,
|
|
134
|
+
id: "typedown-button-[".concat(index, "]"),
|
|
135
|
+
onClick: function onClick() {
|
|
136
|
+
handleChange(d);
|
|
137
|
+
handleNextFocus();
|
|
138
|
+
},
|
|
139
|
+
onKeyDown: listKeyDownHandler,
|
|
140
|
+
type: "button",
|
|
141
|
+
children: renderItem(d)
|
|
142
|
+
}, "typedown-button-[".concat(index, "]"));
|
|
143
|
+
}) :
|
|
144
|
+
/*#__PURE__*/
|
|
145
|
+
// TODO test this
|
|
146
|
+
(0, _jsxRuntime.jsx)(_components.EndOfList, {})
|
|
147
|
+
}), renderFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
148
|
+
ref: footerRef,
|
|
149
|
+
className: _TypeDown.default.footer,
|
|
150
|
+
id: "typedown-footer",
|
|
151
|
+
children: renderFooter()
|
|
152
|
+
})]
|
|
153
|
+
});
|
|
154
|
+
}, [data, footerRef, handleChange, handleNextFocus, input, listKeyDownHandler, listRef, renderFooter, renderItem, searchWidth, uniqueIdentificationPath]);
|
|
141
155
|
|
|
142
156
|
var renderSearchField = function renderSearchField() {
|
|
143
|
-
return /*#__PURE__*/
|
|
157
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
144
158
|
ref: triggerRef,
|
|
145
|
-
id: "typedown-parent-".concat((0, _selectorSafe
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
id: "typedown-parent-".concat((0, _selectorSafe.default)(input.name), "-searchField"),
|
|
160
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchField.default // Pass meta through so correct styling gets applied to the TextField
|
|
161
|
+
, {
|
|
162
|
+
id: "typedown-searchField",
|
|
163
|
+
marginBottom0: true,
|
|
164
|
+
meta: meta,
|
|
165
|
+
onChange: function onChange(e) {
|
|
166
|
+
setCallPath(pathMutator(e.target.value, path));
|
|
167
|
+
},
|
|
168
|
+
onKeyDown: searchFieldKeyDownHandler
|
|
169
|
+
})
|
|
170
|
+
});
|
|
156
171
|
};
|
|
157
172
|
|
|
158
|
-
return /*#__PURE__*/
|
|
159
|
-
ref: resizeRef
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
173
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
174
|
+
ref: resizeRef,
|
|
175
|
+
children: [renderSearchField(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Popper, {
|
|
176
|
+
anchorRef: triggerRef,
|
|
177
|
+
className: (0, _classnames.default)(_TypeDown.default.dropdown, _TypeDown.default.fullWidth),
|
|
178
|
+
isOpen: open,
|
|
179
|
+
modifiers: {
|
|
180
|
+
flip: {
|
|
181
|
+
boundariesElement: 'viewport',
|
|
182
|
+
padding: 10
|
|
183
|
+
},
|
|
184
|
+
preventOverflow: {
|
|
185
|
+
boundariesElement: 'viewport',
|
|
186
|
+
padding: 10
|
|
187
|
+
}
|
|
169
188
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
})));
|
|
189
|
+
overlayProps: {
|
|
190
|
+
'ref': overlayRef,
|
|
191
|
+
'tabIndex': '-1',
|
|
192
|
+
'onClick': function onClick(e) {
|
|
193
|
+
e.stopPropagation();
|
|
194
|
+
} // prevent propagation of click events
|
|
195
|
+
|
|
196
|
+
},
|
|
197
|
+
overlayRef: overlayRef,
|
|
198
|
+
portal: portal,
|
|
199
|
+
children: dropDown()
|
|
200
|
+
}, "typedown-menu-toggle"), selectedUniqueId && !open && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
201
|
+
className: (0, _classnames.default)(_TypeDown.default.selected, _TypeDown.default.selectedDisplay),
|
|
202
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
203
|
+
className: _TypeDown.default.selectedItem,
|
|
204
|
+
children: renderItem(input.value)
|
|
205
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
206
|
+
className: _TypeDown.default.clearItem,
|
|
207
|
+
icon: "times-circle-solid",
|
|
208
|
+
onClick: function onClick() {
|
|
209
|
+
return handleChange();
|
|
210
|
+
}
|
|
211
|
+
})]
|
|
212
|
+
})]
|
|
213
|
+
});
|
|
196
214
|
};
|
|
197
215
|
|
|
216
|
+
__signature__(TypeDown, "useEffect{}\nuseState{[callPath, setCallPath](pathMutator(null, path))}\nuseTypedownData{data}\nuseTypedown{{\n refs: {\n listRef,\n triggerRef,\n overlayRef,\n footerRef\n },\n handlers: {\n handleNextFocus,\n listKeyDownHandler,\n searchFieldKeyDownHandler\n },\n variables: {\n open,\n portal,\n resizeRef,\n searchWidth\n }\n }}\nuseCallback{renderItem}\nuseCallback{handleChange}\nuseCallback{dropDown}", function () {
|
|
217
|
+
return [_typedownHooks.useTypedownData, _typedownHooks.useTypedown];
|
|
218
|
+
});
|
|
219
|
+
|
|
198
220
|
TypeDown.propTypes = {
|
|
199
|
-
input: _propTypes
|
|
200
|
-
meta: _propTypes
|
|
201
|
-
onChange: _propTypes
|
|
202
|
-
path: _propTypes
|
|
203
|
-
pathMutator: _propTypes
|
|
204
|
-
renderFooter: _propTypes
|
|
205
|
-
renderListItem: _propTypes
|
|
206
|
-
uniqueIdentificationPath: _propTypes
|
|
221
|
+
input: _propTypes.default.object,
|
|
222
|
+
meta: _propTypes.default.object,
|
|
223
|
+
onChange: _propTypes.default.func,
|
|
224
|
+
path: _propTypes.default.string,
|
|
225
|
+
pathMutator: _propTypes.default.func,
|
|
226
|
+
renderFooter: _propTypes.default.func,
|
|
227
|
+
renderListItem: _propTypes.default.func,
|
|
228
|
+
uniqueIdentificationPath: _propTypes.default.string
|
|
207
229
|
};
|
|
208
230
|
var _default = TypeDown;
|
|
209
|
-
|
|
231
|
+
var _default2 = _default;
|
|
232
|
+
exports.default = _default2;
|
|
233
|
+
;
|
|
234
|
+
|
|
235
|
+
(function () {
|
|
236
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
237
|
+
|
|
238
|
+
if (!reactHotLoader) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
reactHotLoader.register(TypeDown, "TypeDown", "/home/ethan/FolioModules/stripes-kint-components/src/lib/TypeDown/TypeDown.js");
|
|
243
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/TypeDown/TypeDown.js");
|
|
244
|
+
})();
|
|
245
|
+
|
|
246
|
+
;
|
|
247
|
+
|
|
248
|
+
(function () {
|
|
249
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
250
|
+
leaveModule && leaveModule(module);
|
|
251
|
+
})();
|
package/es/lib/TypeDown/index.js
CHANGED
|
@@ -6,10 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return _TypeDown
|
|
9
|
+
return _TypeDown.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
var _TypeDown = _interopRequireDefault(require("./TypeDown"));
|
|
14
14
|
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
18
|
+
return a;
|
|
19
|
+
};
|