@k-int/stripes-kint-components 1.5.0 → 2.0.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 +40 -1
- package/es/index.js +80 -25
- package/es/lib/ActionList/ActionList.js +92 -33
- package/es/lib/ActionList/ActionListFieldArray.js +202 -104
- package/es/lib/ActionList/index.js +7 -3
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +198 -0
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +321 -0
- package/es/lib/CustomProperties/Config/CustomPropertiesView.js +166 -0
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +357 -0
- package/es/lib/CustomProperties/Config/index.js +41 -0
- 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/FormModal/FormModal.js +126 -0
- package/es/lib/FormModal/index.js +19 -0
- package/es/lib/NoResultsMessage/NoResultsMessage.js +65 -32
- package/es/lib/NoResultsMessage/index.js +7 -3
- 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 +194 -140
- 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 +174 -99
- package/es/lib/Typedown/index.js +6 -2
- package/es/lib/constants/customProperties.js +60 -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 +44 -10
- 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/useCustomProperties.js +112 -0
- package/es/lib/hooks/useHelperApp.js +44 -11
- package/es/lib/hooks/useKiwtFieldArray.js +37 -4
- package/es/lib/hooks/useKiwtSASQuery.js +43 -9
- package/es/lib/hooks/useLocalStorageState.js +37 -4
- package/es/lib/hooks/useMutateCustomProperties.js +143 -0
- package/es/lib/hooks/useMutateRefdataValue.js +42 -9
- package/es/lib/hooks/useQIndex.js +42 -9
- package/es/lib/hooks/useRefdata.js +43 -16
- package/es/lib/hooks/useTemplates.js +36 -3
- package/es/lib/utils/buildUrl.js +43 -10
- package/es/lib/utils/generateKiwtQuery.js +33 -4
- package/es/lib/utils/generateKiwtQueryParams.js +31 -2
- package/es/lib/utils/index.js +41 -5
- 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/package.json +19 -10
- package/src/index.js +25 -10
- package/src/lib/ActionList/ActionList.js +32 -22
- package/src/lib/ActionList/ActionListFieldArray.js +56 -10
- package/src/lib/ActionList/README.md +5 -1
- package/src/lib/ActionList/index.js +1 -1
- package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +111 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +237 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesView.js +150 -0
- package/src/lib/CustomProperties/Config/CustomPropertyForm.js +295 -0
- package/src/lib/CustomProperties/Config/index.js +4 -0
- 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/FormModal/FormModal.js +71 -0
- package/src/lib/FormModal/index.js +1 -0
- package/src/lib/NoResultsMessage/NoResultsMessage.js +2 -2
- package/src/lib/NoResultsMessage/index.js +1 -1
- package/src/lib/{Settings → RefdataButtons}/RefdataButtons.js +1 -1
- package/src/lib/RefdataButtons/index.js +1 -0
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +7 -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/Typedown.js +52 -9
- package/src/lib/constants/customProperties.js +9 -0
- package/src/lib/{Settings → contexts}/SettingsContext.js +1 -1
- package/src/lib/contexts/index.js +2 -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/useCustomProperties.js +73 -0
- package/src/lib/hooks/useMutateCustomProperties.js +62 -0
- package/src/lib/hooks/useRefdata.js +2 -8
- package/src/lib/utils/index.js +7 -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/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 +48 -1
- package/yarn-error.log +14118 -0
- 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/TypeDown/TypeDown.js +0 -209
- package/es/lib/TypeDown/index.js +0 -15
- 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/TypeDown/README.md +0 -1
- package/src/lib/TypeDown/TypeDown.js +0 -226
- package/src/lib/TypeDown/index.js +0 -1
- 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
|
@@ -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 _QueryTypedown
|
|
9
|
+
return _QueryTypedown.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
var _QueryTypedown = _interopRequireDefault(require("./QueryTypedown"));
|
|
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
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _reactIntl = require("react-intl");
|
|
13
|
+
|
|
14
|
+
var _components = require("@folio/stripes/components");
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
(function () {
|
|
21
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
22
|
+
enterModule && enterModule(module);
|
|
23
|
+
})();
|
|
24
|
+
|
|
25
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
+
|
|
27
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
|
+
|
|
29
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
|
+
|
|
31
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
32
|
+
return a;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var RefdataButtons = function RefdataButtons(props) {
|
|
36
|
+
// Render the right number of buttons:
|
|
37
|
+
var labelTranslations = props.labelTranslations,
|
|
38
|
+
lockColumns = props.lockColumns,
|
|
39
|
+
_props$maxCols = props.maxCols,
|
|
40
|
+
maxCols = _props$maxCols === void 0 ? 4 : _props$maxCols;
|
|
41
|
+
var intl = (0, _reactIntl.useIntl)(); // maxCols can be any of 1,2,3 or 4. Anything outside of this should be disregarded and default to 4.
|
|
42
|
+
|
|
43
|
+
var maximumColumns = [1, 2, 3, 4].includes(maxCols) ? maxCols : 4;
|
|
44
|
+
|
|
45
|
+
var buttonRender = function buttonRender(dataOptions, dynamicColumnWidth) {
|
|
46
|
+
// This accepts a SORTED list of dataoptions.
|
|
47
|
+
var input = props.input;
|
|
48
|
+
var numberOfButtons = dataOptions.length;
|
|
49
|
+
return dataOptions.map(function (option) {
|
|
50
|
+
var buttonProps = {
|
|
51
|
+
'checked': input.value === option.value,
|
|
52
|
+
'fullWidth': true,
|
|
53
|
+
'label': labelTranslations ? intl.formatMessage({
|
|
54
|
+
id: "".concat(labelTranslations.key, ".").concat(option.value),
|
|
55
|
+
defaultMessage: option.label
|
|
56
|
+
}) : option.label,
|
|
57
|
+
'marginBottom0': true,
|
|
58
|
+
'onChange': function onChange() {
|
|
59
|
+
return input.onChange(option.value);
|
|
60
|
+
},
|
|
61
|
+
'value': option.value
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
64
|
+
xs: dynamicColumnWidth ? 12 / numberOfButtons : 12 / maximumColumns,
|
|
65
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RadioButton, _objectSpread({}, buttonProps))
|
|
66
|
+
}, "".concat(input.name, ":").concat(option.id));
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var returnRows = function returnRows(dataOptions) {
|
|
71
|
+
var sortedDataOptions = dataOptions.sort(function (a, b) {
|
|
72
|
+
if (a.label < b.label) {
|
|
73
|
+
return -1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (a.label > b.label) {
|
|
77
|
+
return 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return 0;
|
|
81
|
+
});
|
|
82
|
+
var arrayLength = sortedDataOptions.length;
|
|
83
|
+
|
|
84
|
+
if (!lockColumns && arrayLength <= maximumColumns) {
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Row, {
|
|
86
|
+
children: buttonRender(sortedDataOptions, true)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var rowsNeeded = Math.ceil(sortedDataOptions.length / maximumColumns);
|
|
91
|
+
var chunkedDataOptions = [];
|
|
92
|
+
|
|
93
|
+
for (var i = 0; i < rowsNeeded; i++) {
|
|
94
|
+
chunkedDataOptions.push(sortedDataOptions.slice(i * maximumColumns, i * maximumColumns + maximumColumns));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return chunkedDataOptions.map(function (cdo, index) {
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Row, {
|
|
99
|
+
children: buttonRender(cdo, false)
|
|
100
|
+
}, "".concat(props.input.name, ":row").concat(index));
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
return returnRows(props.dataOptions);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
__signature__(RefdataButtons, "useIntl{intl}", function () {
|
|
108
|
+
return [_reactIntl.useIntl];
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
RefdataButtons.propTypes = {
|
|
112
|
+
dataOptions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
113
|
+
id: _propTypes.default.string.isRequired,
|
|
114
|
+
label: _propTypes.default.string.isRequired,
|
|
115
|
+
value: _propTypes.default.string.isRequired
|
|
116
|
+
})),
|
|
117
|
+
input: _propTypes.default.shape({
|
|
118
|
+
value: _propTypes.default.string.isRequired,
|
|
119
|
+
onChange: _propTypes.default.func.isRequired
|
|
120
|
+
}).isRequired
|
|
121
|
+
};
|
|
122
|
+
var _default = RefdataButtons;
|
|
123
|
+
var _default2 = _default;
|
|
124
|
+
exports.default = _default2;
|
|
125
|
+
;
|
|
126
|
+
|
|
127
|
+
(function () {
|
|
128
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
129
|
+
|
|
130
|
+
if (!reactHotLoader) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
reactHotLoader.register(RefdataButtons, "RefdataButtons", "/home/ethan/FolioModules/stripes-kint-components/src/lib/RefdataButtons/RefdataButtons.js");
|
|
135
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/RefdataButtons/RefdataButtons.js");
|
|
136
|
+
})();
|
|
137
|
+
|
|
138
|
+
;
|
|
139
|
+
|
|
140
|
+
(function () {
|
|
141
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
142
|
+
leaveModule && leaveModule(module);
|
|
143
|
+
})();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _RefdataButtons.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _RefdataButtons = _interopRequireDefault(require("./RefdataButtons"));
|
|
14
|
+
|
|
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
|
+
};
|
|
@@ -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
|
|
|
@@ -19,15 +19,20 @@ var _smartComponents = require("@folio/stripes/smart-components");
|
|
|
19
19
|
|
|
20
20
|
var _components = require("@folio/stripes/components");
|
|
21
21
|
|
|
22
|
-
var _NoResultsMessage = require("../NoResultsMessage");
|
|
22
|
+
var _NoResultsMessage = _interopRequireDefault(require("../NoResultsMessage"));
|
|
23
23
|
|
|
24
24
|
var _utils = require("../utils");
|
|
25
25
|
|
|
26
26
|
var _hooks = require("../hooks");
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
29
|
|
|
30
|
-
function
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
32
|
+
(function () {
|
|
33
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
34
|
+
enterModule && enterModule(module);
|
|
35
|
+
})();
|
|
31
36
|
|
|
32
37
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
33
38
|
|
|
@@ -37,9 +42,9 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
37
42
|
|
|
38
43
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
39
44
|
|
|
40
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
45
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
41
46
|
|
|
42
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
47
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
43
48
|
|
|
44
49
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
45
50
|
|
|
@@ -55,12 +60,20 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
55
60
|
|
|
56
61
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
57
62
|
|
|
63
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
64
|
+
return a;
|
|
65
|
+
};
|
|
66
|
+
|
|
58
67
|
var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
59
68
|
var _totalData$pages$redu, _totalData$pages;
|
|
60
69
|
|
|
61
|
-
var
|
|
70
|
+
var _children = _ref.children,
|
|
62
71
|
_ref$fetchParameters = _ref.fetchParameters,
|
|
63
72
|
fetchParameters = _ref$fetchParameters === void 0 ? {} : _ref$fetchParameters,
|
|
73
|
+
_ref$FilterPaneHeader = _ref.FilterPaneHeaderComponent,
|
|
74
|
+
FilterPaneHeaderComponent = _ref$FilterPaneHeader === void 0 ? function () {
|
|
75
|
+
return null;
|
|
76
|
+
} : _ref$FilterPaneHeader,
|
|
64
77
|
_ref$FilterComponent = _ref.FilterComponent,
|
|
65
78
|
FilterComponent = _ref$FilterComponent === void 0 ? function () {
|
|
66
79
|
return null;
|
|
@@ -150,146 +163,187 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
150
163
|
var visibleColumns = resultColumns.map(function (e) {
|
|
151
164
|
return e.propertyPath;
|
|
152
165
|
});
|
|
153
|
-
return /*#__PURE__*/
|
|
166
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_smartComponents.SearchAndSortQuery, _objectSpread(_objectSpread({
|
|
154
167
|
initialSearchState: {
|
|
155
168
|
query: ''
|
|
156
169
|
},
|
|
157
170
|
queryGetter: queryGetter,
|
|
158
171
|
querySetter: querySetter
|
|
159
|
-
}, sasqProps),
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
172
|
+
}, sasqProps), {}, {
|
|
173
|
+
children: function children(_ref3) {
|
|
174
|
+
var _query$sort;
|
|
175
|
+
|
|
176
|
+
var activeFilters = _ref3.activeFilters,
|
|
177
|
+
filterChanged = _ref3.filterChanged,
|
|
178
|
+
getFilterHandlers = _ref3.getFilterHandlers,
|
|
179
|
+
getSearchHandlers = _ref3.getSearchHandlers,
|
|
180
|
+
onSort = _ref3.onSort,
|
|
181
|
+
onSubmitSearch = _ref3.onSubmitSearch,
|
|
182
|
+
resetAll = _ref3.resetAll,
|
|
183
|
+
searchChanged = _ref3.searchChanged,
|
|
184
|
+
searchValue = _ref3.searchValue;
|
|
185
|
+
var searchHandlers = getSearchHandlers();
|
|
186
|
+
var sortOrder = (_query$sort = query.sort) !== null && _query$sort !== void 0 ? _query$sort : '';
|
|
187
|
+
var disableReset = !filterChanged && !searchChanged;
|
|
188
|
+
var filterCount = activeFilters.string ? activeFilters.string.split(',').length : 0;
|
|
189
|
+
|
|
190
|
+
var TableBody = function TableBody() {
|
|
191
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
|
|
192
|
+
autosize: true,
|
|
193
|
+
columnMapping: columnMapping,
|
|
194
|
+
contentData: data === null || data === void 0 ? void 0 : data.results,
|
|
195
|
+
isEmptyMessage: /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoResultsMessage.default, {
|
|
196
|
+
error: error,
|
|
197
|
+
isError: isError,
|
|
198
|
+
isLoading: isLoading,
|
|
199
|
+
filterPaneIsVisible: filterPaneVisible,
|
|
200
|
+
searchTerm: query.query,
|
|
201
|
+
toggleFilterPane: toggleFilterPane
|
|
202
|
+
}),
|
|
203
|
+
isSelected: function isSelected(_ref4) {
|
|
204
|
+
var _match$params;
|
|
205
|
+
|
|
206
|
+
var item = _ref4.item;
|
|
207
|
+
return item.id === (match === null || match === void 0 ? void 0 : (_match$params = match.params) === null || _match$params === void 0 ? void 0 : _match$params.id);
|
|
208
|
+
},
|
|
209
|
+
onHeaderClick: onSort,
|
|
210
|
+
onNeedMoreData: onNeedMoreData,
|
|
211
|
+
onRowClick: function onRowClick(_e, rowData) {
|
|
212
|
+
history.push("".concat(path, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id).concat(location === null || location === void 0 ? void 0 : location.search));
|
|
213
|
+
},
|
|
214
|
+
pagingType: "click",
|
|
215
|
+
sortDirection: sortOrder.startsWith('-') ? 'descending' : 'ascending',
|
|
216
|
+
sortOrder: sortOrder.replace(/^-/, '').replace(/,.*/, ''),
|
|
217
|
+
totalCount: data.totalRecords,
|
|
218
|
+
virtualize: true,
|
|
219
|
+
visibleColumns: visibleColumns
|
|
220
|
+
}, mclProps));
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
var Body = RenderBody !== null && RenderBody !== void 0 ? RenderBody : TableBody;
|
|
224
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_smartComponents.PersistedPaneset, {
|
|
225
|
+
appId: namespace,
|
|
226
|
+
id: "".concat(id, "-paneset"),
|
|
227
|
+
children: [filterPaneVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, {
|
|
228
|
+
defaultWidth: "20%",
|
|
229
|
+
lastMenu: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PaneMenu, {
|
|
230
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
231
|
+
icon: "caret-left",
|
|
232
|
+
onClick: function onClick() {
|
|
233
|
+
return setFilterPaneVisible(false);
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
}),
|
|
237
|
+
paneTitle: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
238
|
+
id: "stripes-smart-components.searchAndFilter"
|
|
239
|
+
}),
|
|
240
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("form", {
|
|
241
|
+
onSubmit: onSubmitSearch,
|
|
242
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FilterPaneHeaderComponent, {}), !noSearchField && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
243
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SearchField, {
|
|
244
|
+
autoFocus: true,
|
|
245
|
+
name: "query",
|
|
246
|
+
onChange: searchHandlers.query,
|
|
247
|
+
onClear: searchHandlers.reset,
|
|
248
|
+
value: searchValue.query
|
|
249
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
250
|
+
buttonStyle: "primary",
|
|
251
|
+
disabled: !searchValue.query,
|
|
252
|
+
fullWidth: true,
|
|
253
|
+
type: "submit",
|
|
254
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
255
|
+
id: "stripes-smart-components.search"
|
|
256
|
+
})
|
|
257
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
258
|
+
buttonStyle: "none",
|
|
259
|
+
disabled: disableReset,
|
|
260
|
+
id: "clickable-reset-all",
|
|
261
|
+
onClick: resetAll,
|
|
262
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
263
|
+
icon: "times-circle-solid",
|
|
264
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
265
|
+
id: "stripes-smart-components.resetAll"
|
|
266
|
+
})
|
|
267
|
+
})
|
|
268
|
+
})]
|
|
269
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterComponent, {
|
|
270
|
+
activeFilters: activeFilters.state,
|
|
271
|
+
filterChanged: filterChanged,
|
|
272
|
+
filterHandlers: getFilterHandlers(),
|
|
273
|
+
resetAll: resetAll,
|
|
274
|
+
searchChanged: searchChanged,
|
|
275
|
+
searchHandlers: getSearchHandlers(),
|
|
276
|
+
searchValue: searchValue
|
|
277
|
+
})]
|
|
278
|
+
})
|
|
279
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, _objectSpread(_objectSpread({
|
|
280
|
+
defaultWidth: "fill",
|
|
281
|
+
firstMenu: !filterPaneVisible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PaneMenu, {
|
|
282
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
283
|
+
badgeCount: filterCount,
|
|
284
|
+
icon: "caret-right",
|
|
285
|
+
onClick: function onClick() {
|
|
286
|
+
return setFilterPaneVisible(true);
|
|
287
|
+
}
|
|
288
|
+
})
|
|
289
|
+
}) : null,
|
|
290
|
+
paneSub: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
291
|
+
id: "stripes-kint-components.sasqLookupComponent.mainPane.found",
|
|
292
|
+
values: {
|
|
293
|
+
total: data === null || data === void 0 ? void 0 : data.total
|
|
294
|
+
}
|
|
295
|
+
})
|
|
296
|
+
}, mainPaneProps), {}, {
|
|
297
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Body, {
|
|
298
|
+
data: data
|
|
299
|
+
})
|
|
300
|
+
})), _children]
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}));
|
|
275
304
|
};
|
|
276
305
|
|
|
306
|
+
__signature__(SASQLookupComponent, "useKiwtSASQuery{{ query, queryGetter, querySetter }}\nuseNamespace{{ 0: namespace }}\nuseOkapiKy{ky}\nuseLocalStorageState{[filterPaneVisible, setFilterPaneVisible]}\nuseInfiniteQuery{{\n data: totalData = {},\n error,\n isError,\n isLoading,\n fetchNextPage,\n }}", function () {
|
|
307
|
+
return [_hooks.useKiwtSASQuery, _core.useNamespace, _core.useOkapiKy, _hooks.useLocalStorageState, _reactQuery.useInfiniteQuery];
|
|
308
|
+
});
|
|
309
|
+
|
|
277
310
|
SASQLookupComponent.propTypes = {
|
|
278
|
-
children: _propTypes
|
|
279
|
-
fetchParameters: _propTypes
|
|
280
|
-
FilterComponent: _propTypes
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
311
|
+
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
312
|
+
fetchParameters: _propTypes.default.object,
|
|
313
|
+
FilterComponent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
314
|
+
FilterPaneHeaderComponent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
315
|
+
history: _propTypes.default.object,
|
|
316
|
+
id: _propTypes.default.string.isRequired,
|
|
317
|
+
location: _propTypes.default.object,
|
|
318
|
+
mainPaneProps: _propTypes.default.object,
|
|
319
|
+
match: _propTypes.default.object,
|
|
320
|
+
mclProps: _propTypes.default.object,
|
|
321
|
+
noSearchField: _propTypes.default.bool,
|
|
322
|
+
path: _propTypes.default.string.isRequired,
|
|
323
|
+
RenderBody: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
324
|
+
resource: _propTypes.default.object,
|
|
325
|
+
resultColumns: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
326
|
+
sasqProps: _propTypes.default.object
|
|
293
327
|
};
|
|
294
328
|
var _default = SASQLookupComponent;
|
|
295
|
-
|
|
329
|
+
var _default2 = _default;
|
|
330
|
+
exports.default = _default2;
|
|
331
|
+
;
|
|
332
|
+
|
|
333
|
+
(function () {
|
|
334
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
335
|
+
|
|
336
|
+
if (!reactHotLoader) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
reactHotLoader.register(SASQLookupComponent, "SASQLookupComponent", "/home/ethan/FolioModules/stripes-kint-components/src/lib/SASQLookupComponent/SASQLookupComponent.js");
|
|
341
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/SASQLookupComponent/SASQLookupComponent.js");
|
|
342
|
+
})();
|
|
343
|
+
|
|
344
|
+
;
|
|
345
|
+
|
|
346
|
+
(function () {
|
|
347
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
348
|
+
leaveModule && leaveModule(module);
|
|
349
|
+
})();
|
|
@@ -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 _SASQLookupComponent
|
|
9
|
+
return _SASQLookupComponent.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
var _SASQLookupComponent = _interopRequireDefault(require("./SASQLookupComponent"));
|
|
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
|
+
};
|