@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
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
(function () {
|
|
4
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
5
|
+
enterModule && enterModule(module);
|
|
6
|
+
})();
|
|
7
|
+
|
|
8
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
9
|
+
return a;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/* eslint-disable */
|
|
13
|
+
var addSorting = function () {
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
var cols,
|
|
17
|
+
currentSort = {
|
|
18
|
+
index: 0,
|
|
19
|
+
desc: false
|
|
20
|
+
}; // returns the summary table element
|
|
21
|
+
|
|
22
|
+
function getTable() {
|
|
23
|
+
return document.querySelector('.coverage-summary');
|
|
24
|
+
} // returns the thead element of the summary table
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function getTableHeader() {
|
|
28
|
+
return getTable().querySelector('thead tr');
|
|
29
|
+
} // returns the tbody element of the summary table
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
function getTableBody() {
|
|
33
|
+
return getTable().querySelector('tbody');
|
|
34
|
+
} // returns the th element for nth column
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
function getNthColumn(n) {
|
|
38
|
+
return getTableHeader().querySelectorAll('th')[n];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function onFilterInput() {
|
|
42
|
+
var searchValue = document.getElementById('fileSearch').value;
|
|
43
|
+
var rows = document.getElementsByTagName('tbody')[0].children;
|
|
44
|
+
|
|
45
|
+
for (var i = 0; i < rows.length; i++) {
|
|
46
|
+
var row = rows[i];
|
|
47
|
+
|
|
48
|
+
if (row.textContent.toLowerCase().includes(searchValue.toLowerCase())) {
|
|
49
|
+
row.style.display = '';
|
|
50
|
+
} else {
|
|
51
|
+
row.style.display = 'none';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} // loads the search box
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
function addSearchBox() {
|
|
58
|
+
var template = document.getElementById('filterTemplate');
|
|
59
|
+
var templateClone = template.content.cloneNode(true);
|
|
60
|
+
templateClone.getElementById('fileSearch').oninput = onFilterInput;
|
|
61
|
+
template.parentElement.appendChild(templateClone);
|
|
62
|
+
} // loads all columns
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
function loadColumns() {
|
|
66
|
+
var colNodes = getTableHeader().querySelectorAll('th'),
|
|
67
|
+
colNode,
|
|
68
|
+
cols = [],
|
|
69
|
+
col,
|
|
70
|
+
i;
|
|
71
|
+
|
|
72
|
+
for (i = 0; i < colNodes.length; i += 1) {
|
|
73
|
+
colNode = colNodes[i];
|
|
74
|
+
col = {
|
|
75
|
+
key: colNode.getAttribute('data-col'),
|
|
76
|
+
sortable: !colNode.getAttribute('data-nosort'),
|
|
77
|
+
type: colNode.getAttribute('data-type') || 'string'
|
|
78
|
+
};
|
|
79
|
+
cols.push(col);
|
|
80
|
+
|
|
81
|
+
if (col.sortable) {
|
|
82
|
+
col.defaultDescSort = col.type === 'number';
|
|
83
|
+
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return cols;
|
|
88
|
+
} // attaches a data attribute to every tr element with an object
|
|
89
|
+
// of data values keyed by column name
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
function loadRowData(tableRow) {
|
|
93
|
+
var tableCols = tableRow.querySelectorAll('td'),
|
|
94
|
+
colNode,
|
|
95
|
+
col,
|
|
96
|
+
data = {},
|
|
97
|
+
i,
|
|
98
|
+
val;
|
|
99
|
+
|
|
100
|
+
for (i = 0; i < tableCols.length; i += 1) {
|
|
101
|
+
colNode = tableCols[i];
|
|
102
|
+
col = cols[i];
|
|
103
|
+
val = colNode.getAttribute('data-value');
|
|
104
|
+
|
|
105
|
+
if (col.type === 'number') {
|
|
106
|
+
val = Number(val);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
data[col.key] = val;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return data;
|
|
113
|
+
} // loads all row data
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
function loadData() {
|
|
117
|
+
var rows = getTableBody().querySelectorAll('tr'),
|
|
118
|
+
i;
|
|
119
|
+
|
|
120
|
+
for (i = 0; i < rows.length; i += 1) {
|
|
121
|
+
rows[i].data = loadRowData(rows[i]);
|
|
122
|
+
}
|
|
123
|
+
} // sorts the table using the data for the ith column
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
function sortByIndex(index, desc) {
|
|
127
|
+
var key = cols[index].key,
|
|
128
|
+
sorter = function sorter(a, b) {
|
|
129
|
+
a = a.data[key];
|
|
130
|
+
b = b.data[key];
|
|
131
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
132
|
+
},
|
|
133
|
+
finalSorter = sorter,
|
|
134
|
+
tableBody = document.querySelector('.coverage-summary tbody'),
|
|
135
|
+
rowNodes = tableBody.querySelectorAll('tr'),
|
|
136
|
+
rows = [],
|
|
137
|
+
i;
|
|
138
|
+
|
|
139
|
+
if (desc) {
|
|
140
|
+
finalSorter = function finalSorter(a, b) {
|
|
141
|
+
return -1 * sorter(a, b);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
for (i = 0; i < rowNodes.length; i += 1) {
|
|
146
|
+
rows.push(rowNodes[i]);
|
|
147
|
+
tableBody.removeChild(rowNodes[i]);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
rows.sort(finalSorter);
|
|
151
|
+
|
|
152
|
+
for (i = 0; i < rows.length; i += 1) {
|
|
153
|
+
tableBody.appendChild(rows[i]);
|
|
154
|
+
}
|
|
155
|
+
} // removes sort indicators for current column being sorted
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
function removeSortIndicators() {
|
|
159
|
+
var col = getNthColumn(currentSort.index),
|
|
160
|
+
cls = col.className;
|
|
161
|
+
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
|
162
|
+
col.className = cls;
|
|
163
|
+
} // adds sort indicators for current column being sorted
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
function addSortIndicators() {
|
|
167
|
+
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
|
|
168
|
+
} // adds event listeners for all sorter widgets
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
function enableUI() {
|
|
172
|
+
var i,
|
|
173
|
+
el,
|
|
174
|
+
ithSorter = function ithSorter(i) {
|
|
175
|
+
var col = cols[i];
|
|
176
|
+
return function () {
|
|
177
|
+
var desc = col.defaultDescSort;
|
|
178
|
+
|
|
179
|
+
if (currentSort.index === i) {
|
|
180
|
+
desc = !currentSort.desc;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
sortByIndex(i, desc);
|
|
184
|
+
removeSortIndicators();
|
|
185
|
+
currentSort.index = i;
|
|
186
|
+
currentSort.desc = desc;
|
|
187
|
+
addSortIndicators();
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
for (i = 0; i < cols.length; i += 1) {
|
|
192
|
+
if (cols[i].sortable) {
|
|
193
|
+
// add the click event handler on the th so users
|
|
194
|
+
// dont have to click on those tiny arrows
|
|
195
|
+
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
|
196
|
+
|
|
197
|
+
if (el.addEventListener) {
|
|
198
|
+
el.addEventListener('click', ithSorter(i));
|
|
199
|
+
} else {
|
|
200
|
+
el.attachEvent('onclick', ithSorter(i));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
} // adds sorting functionality to the UI
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
return function () {
|
|
208
|
+
if (!getTable()) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
cols = loadColumns();
|
|
213
|
+
loadData();
|
|
214
|
+
addSearchBox();
|
|
215
|
+
addSortIndicators();
|
|
216
|
+
enableUI();
|
|
217
|
+
};
|
|
218
|
+
}();
|
|
219
|
+
|
|
220
|
+
window.addEventListener('load', addSorting);
|
|
221
|
+
;
|
|
222
|
+
|
|
223
|
+
(function () {
|
|
224
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
225
|
+
|
|
226
|
+
if (!reactHotLoader) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
reactHotLoader.register(addSorting, "addSorting", "/home/ethan/FolioModules/stripes-kint-components/src/artifacts/coverage-jest/lcov-report/sorter.js");
|
|
231
|
+
})();
|
|
232
|
+
|
|
233
|
+
;
|
|
234
|
+
|
|
235
|
+
(function () {
|
|
236
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
237
|
+
leaveModule && leaveModule(module);
|
|
238
|
+
})();
|
package/es/index.js
CHANGED
|
@@ -6,73 +6,85 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "ActionList", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return _ActionList.
|
|
9
|
+
return _ActionList.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "EditableRefdataList", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return _EditableRefdataList.
|
|
15
|
+
return _EditableRefdataList.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "NoResultsMessage", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _NoResultsMessage.default;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
18
24
|
Object.defineProperty(exports, "QueryTypedown", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
21
|
-
return _QueryTypedown
|
|
27
|
+
return _QueryTypedown.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "RefdataButtons", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _RefdataButtons.default;
|
|
22
34
|
}
|
|
23
35
|
});
|
|
24
36
|
Object.defineProperty(exports, "SASQLookupComponent", {
|
|
25
37
|
enumerable: true,
|
|
26
38
|
get: function get() {
|
|
27
|
-
return _SASQLookupComponent
|
|
39
|
+
return _SASQLookupComponent.default;
|
|
28
40
|
}
|
|
29
41
|
});
|
|
30
42
|
Object.defineProperty(exports, "SASQRoute", {
|
|
31
43
|
enumerable: true,
|
|
32
44
|
get: function get() {
|
|
33
|
-
return _SASQRoute
|
|
45
|
+
return _SASQRoute.default;
|
|
34
46
|
}
|
|
35
47
|
});
|
|
36
48
|
Object.defineProperty(exports, "SASQViewComponent", {
|
|
37
49
|
enumerable: true,
|
|
38
50
|
get: function get() {
|
|
39
|
-
return _SASQViewComponent
|
|
51
|
+
return _SASQViewComponent.default;
|
|
40
52
|
}
|
|
41
53
|
});
|
|
42
54
|
Object.defineProperty(exports, "SearchField", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function get() {
|
|
45
|
-
return _SearchField
|
|
57
|
+
return _SearchField.default;
|
|
46
58
|
}
|
|
47
59
|
});
|
|
48
60
|
Object.defineProperty(exports, "SettingPage", {
|
|
49
61
|
enumerable: true,
|
|
50
62
|
get: function get() {
|
|
51
|
-
return
|
|
63
|
+
return _SettingPage.SettingPage;
|
|
52
64
|
}
|
|
53
65
|
});
|
|
54
66
|
Object.defineProperty(exports, "SettingPagePane", {
|
|
55
67
|
enumerable: true,
|
|
56
68
|
get: function get() {
|
|
57
|
-
return
|
|
69
|
+
return _SettingPage.SettingPagePane;
|
|
58
70
|
}
|
|
59
71
|
});
|
|
60
72
|
Object.defineProperty(exports, "SettingsContext", {
|
|
61
73
|
enumerable: true,
|
|
62
74
|
get: function get() {
|
|
63
|
-
return
|
|
75
|
+
return _contexts.SettingsContext;
|
|
64
76
|
}
|
|
65
77
|
});
|
|
66
78
|
Object.defineProperty(exports, "TypeDown", {
|
|
67
79
|
enumerable: true,
|
|
68
80
|
get: function get() {
|
|
69
|
-
return _TypeDown
|
|
81
|
+
return _TypeDown.default;
|
|
70
82
|
}
|
|
71
83
|
});
|
|
72
84
|
Object.defineProperty(exports, "Typedown", {
|
|
73
85
|
enumerable: true,
|
|
74
86
|
get: function get() {
|
|
75
|
-
return _Typedown
|
|
87
|
+
return _Typedown.default;
|
|
76
88
|
}
|
|
77
89
|
});
|
|
78
90
|
Object.defineProperty(exports, "generateKiwtQuery", {
|
|
@@ -81,6 +93,24 @@ Object.defineProperty(exports, "generateKiwtQuery", {
|
|
|
81
93
|
return _utils.generateKiwtQuery;
|
|
82
94
|
}
|
|
83
95
|
});
|
|
96
|
+
Object.defineProperty(exports, "generateKiwtQueryParams", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function get() {
|
|
99
|
+
return _utils.generateKiwtQueryParams;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "refdataOptions", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _utils.refdataOptions;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "selectorSafe", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function get() {
|
|
111
|
+
return _utils.selectorSafe;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
84
114
|
Object.defineProperty(exports, "useActiveElement", {
|
|
85
115
|
enumerable: true,
|
|
86
116
|
get: function get() {
|
|
@@ -93,6 +123,12 @@ Object.defineProperty(exports, "useHelperApp", {
|
|
|
93
123
|
return _hooks.useHelperApp;
|
|
94
124
|
}
|
|
95
125
|
});
|
|
126
|
+
Object.defineProperty(exports, "useKiwtFieldArray", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function get() {
|
|
129
|
+
return _hooks.useKiwtFieldArray;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
96
132
|
Object.defineProperty(exports, "useKiwtSASQuery", {
|
|
97
133
|
enumerable: true,
|
|
98
134
|
get: function get() {
|
|
@@ -111,6 +147,12 @@ Object.defineProperty(exports, "useMutateRefdataValue", {
|
|
|
111
147
|
return _hooks.useMutateRefdataValue;
|
|
112
148
|
}
|
|
113
149
|
});
|
|
150
|
+
Object.defineProperty(exports, "useQIndex", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function get() {
|
|
153
|
+
return _hooks.useQIndex;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
114
156
|
Object.defineProperty(exports, "useRefdata", {
|
|
115
157
|
enumerable: true,
|
|
116
158
|
get: function get() {
|
|
@@ -120,7 +162,7 @@ Object.defineProperty(exports, "useRefdata", {
|
|
|
120
162
|
Object.defineProperty(exports, "useSettings", {
|
|
121
163
|
enumerable: true,
|
|
122
164
|
get: function get() {
|
|
123
|
-
return
|
|
165
|
+
return _hooks.useSettings;
|
|
124
166
|
}
|
|
125
167
|
});
|
|
126
168
|
Object.defineProperty(exports, "useTemplates", {
|
|
@@ -134,11 +176,13 @@ var _hooks = require("./lib/hooks");
|
|
|
134
176
|
|
|
135
177
|
var _utils = require("./lib/utils");
|
|
136
178
|
|
|
137
|
-
var
|
|
179
|
+
var _contexts = require("./lib/contexts");
|
|
138
180
|
|
|
139
|
-
var
|
|
181
|
+
var _SettingPage = require("./lib/SettingPage");
|
|
140
182
|
|
|
141
|
-
var
|
|
183
|
+
var _ActionList = _interopRequireDefault(require("./lib/ActionList"));
|
|
184
|
+
|
|
185
|
+
var _EditableRefdataList = _interopRequireDefault(require("./lib/EditableRefdataList"));
|
|
142
186
|
|
|
143
187
|
var _TypeDown = _interopRequireDefault(require("./lib/TypeDown"));
|
|
144
188
|
|
|
@@ -154,4 +198,12 @@ var _SASQLookupComponent = _interopRequireDefault(require("./lib/SASQLookupCompo
|
|
|
154
198
|
|
|
155
199
|
var _SASQViewComponent = _interopRequireDefault(require("./lib/SASQViewComponent"));
|
|
156
200
|
|
|
157
|
-
|
|
201
|
+
var _NoResultsMessage = _interopRequireDefault(require("./lib/NoResultsMessage"));
|
|
202
|
+
|
|
203
|
+
var _RefdataButtons = _interopRequireDefault(require("./lib/RefdataButtons"));
|
|
204
|
+
|
|
205
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
206
|
+
|
|
207
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
208
|
+
return a;
|
|
209
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -17,15 +17,27 @@ var _finalFormArrays = _interopRequireDefault(require("final-form-arrays"));
|
|
|
17
17
|
|
|
18
18
|
var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArray"));
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
(function () {
|
|
25
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
26
|
+
enterModule && enterModule(module);
|
|
27
|
+
})();
|
|
28
|
+
|
|
29
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
30
|
+
return a;
|
|
31
|
+
};
|
|
21
32
|
|
|
22
33
|
var propTypes = {
|
|
23
|
-
actionAssigner: _propTypes
|
|
24
|
-
actionCalls: _propTypes
|
|
25
|
-
columnMapping: _propTypes
|
|
26
|
-
contentData: _propTypes
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
actionAssigner: _propTypes.default.func,
|
|
35
|
+
actionCalls: _propTypes.default.object,
|
|
36
|
+
columnMapping: _propTypes.default.object,
|
|
37
|
+
contentData: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
38
|
+
creatableFields: _propTypes.default.object,
|
|
39
|
+
editableFields: _propTypes.default.object,
|
|
40
|
+
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
29
41
|
};
|
|
30
42
|
|
|
31
43
|
var ActionList = function ActionList(_ref) {
|
|
@@ -34,35 +46,62 @@ var ActionList = function ActionList(_ref) {
|
|
|
34
46
|
actionCalls = _ref$actionCalls === void 0 ? {} : _ref$actionCalls,
|
|
35
47
|
columnMapping = _ref.columnMapping,
|
|
36
48
|
contentData = _ref.contentData,
|
|
49
|
+
_ref$creatableFields = _ref.creatableFields,
|
|
50
|
+
creatableFields = _ref$creatableFields === void 0 ? {} : _ref$creatableFields,
|
|
37
51
|
_ref$editableFields = _ref.editableFields,
|
|
38
52
|
editableFields = _ref$editableFields === void 0 ? {} : _ref$editableFields,
|
|
39
53
|
visibleFields = _ref.visibleFields;
|
|
40
|
-
return /*#__PURE__*/
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, {
|
|
41
55
|
enableReinitialize: true,
|
|
42
56
|
initialValues: {
|
|
43
57
|
contentData: contentData
|
|
44
58
|
},
|
|
45
|
-
mutators: _finalFormArrays
|
|
59
|
+
mutators: _finalFormArrays.default,
|
|
46
60
|
onSubmit: actionCalls.edit,
|
|
47
61
|
subscription: {
|
|
48
62
|
contentData: true
|
|
63
|
+
},
|
|
64
|
+
children: function children() {
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
66
|
+
onSubmit: function onSubmit(e) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
},
|
|
69
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, {
|
|
70
|
+
actionAssigner: actionAssigner,
|
|
71
|
+
actionCalls: actionCalls,
|
|
72
|
+
columnMapping: columnMapping,
|
|
73
|
+
component: _ActionListFieldArray.default,
|
|
74
|
+
creatableFields: creatableFields,
|
|
75
|
+
editableFields: editableFields,
|
|
76
|
+
name: "contentData",
|
|
77
|
+
visibleFields: visibleFields
|
|
78
|
+
})
|
|
79
|
+
});
|
|
49
80
|
}
|
|
50
|
-
}, function (_ref2) {
|
|
51
|
-
var handleSubmit = _ref2.handleSubmit;
|
|
52
|
-
return /*#__PURE__*/_react["default"].createElement("form", {
|
|
53
|
-
onSubmit: handleSubmit
|
|
54
|
-
}, /*#__PURE__*/_react["default"].createElement(_reactFinalFormArrays.FieldArray, {
|
|
55
|
-
actionAssigner: actionAssigner,
|
|
56
|
-
actionCalls: actionCalls,
|
|
57
|
-
columnMapping: columnMapping,
|
|
58
|
-
component: _ActionListFieldArray["default"],
|
|
59
|
-
editableFields: editableFields,
|
|
60
|
-
name: "contentData",
|
|
61
|
-
visibleFields: visibleFields
|
|
62
|
-
}));
|
|
63
81
|
});
|
|
64
82
|
};
|
|
65
83
|
|
|
66
84
|
ActionList.propTypes = propTypes;
|
|
67
85
|
var _default = ActionList;
|
|
68
|
-
|
|
86
|
+
var _default2 = _default;
|
|
87
|
+
exports.default = _default2;
|
|
88
|
+
;
|
|
89
|
+
|
|
90
|
+
(function () {
|
|
91
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
92
|
+
|
|
93
|
+
if (!reactHotLoader) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
reactHotLoader.register(propTypes, "propTypes", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionList.js");
|
|
98
|
+
reactHotLoader.register(ActionList, "ActionList", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionList.js");
|
|
99
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionList.js");
|
|
100
|
+
})();
|
|
101
|
+
|
|
102
|
+
;
|
|
103
|
+
|
|
104
|
+
(function () {
|
|
105
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
106
|
+
leaveModule && leaveModule(module);
|
|
107
|
+
})();
|