@k-int/stripes-kint-components 2.3.3 → 2.5.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 +21 -7
- package/README.md +14 -1
- package/es/index.js +26 -2
- package/es/lib/ActionList/ActionList.js +20 -7
- package/es/lib/ActionList/ActionListFieldArray.js +86 -85
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +1 -3
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +2 -2
- package/es/lib/EditableRefdataList/EditableRefdataList.js +3 -0
- package/es/lib/EditableSettingsList/EditableSettingsList.js +4 -1
- package/es/lib/FormModal/FormModal.js +10 -1
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +62 -105
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +146 -0
- package/es/lib/SASQLookupComponent/TableBody/index.js +19 -0
- package/es/lib/SASQLookupComponent/index.js +9 -1
- package/es/lib/SASQRoute/SASQRoute.js +2 -2
- package/es/lib/Typedown/Typedown.js +5 -7
- package/es/lib/hooks/settingsHooks/useSettingSection.js +16 -3
- package/es/lib/hooks/settingsHooks/useSettings.js +14 -7
- package/es/lib/utils/generateKiwtQueryParams.js +21 -4
- package/es/lib/utils/highlightString.js +94 -0
- package/es/lib/utils/index.js +23 -1
- package/es/lib/utils/matchString.js +59 -0
- package/junit.xml +37 -37
- package/package.json +1 -2
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +42 -12
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +222 -93
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +12 -12
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +20 -17
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +601 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +15 -15
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +190 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +340 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +667 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +982 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +478 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +191 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +100 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +460 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +529 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +424 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +307 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +451 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +236 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +103 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +250 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +190 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +220 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +193 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +436 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +616 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +161 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +94 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +116 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +175 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +33 -18
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +8 -2
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +102 -24
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +14 -8
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +11 -11
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +60 -153
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +373 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +131 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +88 -0
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +9 -9
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +6 -3
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +2 -2
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +7 -25
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +7 -4
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +39 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +8 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +5 -5
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +57 -6
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +29 -8
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +26 -8
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useAvailableCustomProperties.js.html +205 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +118 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +21 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +6 -9
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +126 -51
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +36 -9
- package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +124 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +211 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +95 -20
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +29 -2
- package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +127 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +112 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +112 -0
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +126 -6
- package/src/artifacts/coverage-jest/lcov.info +2043 -718
- package/src/index.js +6 -1
- package/src/lib/ActionList/ActionList.js +12 -5
- package/src/lib/ActionList/ActionListFieldArray.js +86 -65
- package/src/lib/ActionList/README.md +19 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +1 -3
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +2 -2
- package/src/lib/EditableRefdataList/EditableRefdataList.js +3 -1
- package/src/lib/EditableSettingsList/EditableSettingsList.js +8 -1
- package/src/lib/FormModal/FormModal.js +6 -2
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +46 -77
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +96 -0
- package/src/lib/SASQLookupComponent/TableBody/index.js +1 -0
- package/src/lib/SASQLookupComponent/index.js +2 -1
- package/src/lib/SASQRoute/SASQRoute.js +1 -1
- package/src/lib/Typedown/Typedown.js +4 -10
- package/src/lib/hooks/settingsHooks/useSettingSection.js +19 -2
- package/src/lib/hooks/settingsHooks/useSettings.js +12 -5
- package/src/lib/utils/generateKiwtQueryParams.js +10 -1
- package/src/lib/utils/highlightString.js +42 -0
- package/src/lib/utils/index.js +4 -0
- package/src/lib/utils/matchString.js +14 -0
- package/styles/ActionListFieldArray.css +10 -2
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
9
|
|
|
12
10
|
var _reactIntl = require("react-intl");
|
|
@@ -19,14 +17,16 @@ var _smartComponents = require("@folio/stripes/smart-components");
|
|
|
19
17
|
|
|
20
18
|
var _components = require("@folio/stripes/components");
|
|
21
19
|
|
|
22
|
-
var _NoResultsMessage = _interopRequireDefault(require("../NoResultsMessage"));
|
|
23
|
-
|
|
24
20
|
var _utils = require("../utils");
|
|
25
21
|
|
|
26
22
|
var _hooks = require("../hooks");
|
|
27
23
|
|
|
24
|
+
var _TableBody = _interopRequireDefault(require("./TableBody"));
|
|
25
|
+
|
|
28
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
27
|
|
|
28
|
+
var _excluded = ["data"];
|
|
29
|
+
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
32
32
|
(function () {
|
|
@@ -48,6 +48,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
48
48
|
|
|
49
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; }
|
|
50
50
|
|
|
51
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
52
|
+
|
|
53
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
54
|
+
|
|
51
55
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
52
56
|
|
|
53
57
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -64,32 +68,26 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
64
68
|
return a;
|
|
65
69
|
};
|
|
66
70
|
|
|
67
|
-
var SASQLookupComponent = function SASQLookupComponent(
|
|
71
|
+
var SASQLookupComponent = function SASQLookupComponent(props) {
|
|
68
72
|
var _totalData$pages$redu, _totalData$pages;
|
|
69
73
|
|
|
70
|
-
var _children =
|
|
71
|
-
|
|
72
|
-
fetchParameters =
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
var _children = props.children,
|
|
75
|
+
_props$fetchParameter = props.fetchParameters,
|
|
76
|
+
fetchParameters = _props$fetchParameter === void 0 ? {} : _props$fetchParameter,
|
|
77
|
+
_props$FilterComponen = props.FilterComponent,
|
|
78
|
+
FilterComponent = _props$FilterComponen === void 0 ? function () {
|
|
75
79
|
return null;
|
|
76
|
-
} :
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
} : _props$FilterComponen,
|
|
81
|
+
_props$FilterPaneHead = props.FilterPaneHeaderComponent,
|
|
82
|
+
FilterPaneHeaderComponent = _props$FilterPaneHead === void 0 ? function () {
|
|
79
83
|
return null;
|
|
80
|
-
} :
|
|
81
|
-
|
|
82
|
-
id =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
noSearchField = _ref.noSearchField,
|
|
88
|
-
path = _ref.path,
|
|
89
|
-
_ref$resultColumns = _ref.resultColumns,
|
|
90
|
-
resultColumns = _ref$resultColumns === void 0 ? [] : _ref$resultColumns,
|
|
91
|
-
RenderBody = _ref.RenderBody,
|
|
92
|
-
sasqProps = _ref.sasqProps;
|
|
84
|
+
} : _props$FilterPaneHead,
|
|
85
|
+
filterPaneProps = props.filterPaneProps,
|
|
86
|
+
id = props.id,
|
|
87
|
+
mainPaneProps = props.mainPaneProps,
|
|
88
|
+
noSearchField = props.noSearchField,
|
|
89
|
+
RenderBody = props.RenderBody,
|
|
90
|
+
sasqProps = props.sasqProps;
|
|
93
91
|
|
|
94
92
|
var _useKiwtSASQuery = (0, _hooks.useKiwtSASQuery)(),
|
|
95
93
|
query = _useKiwtSASQuery.query,
|
|
@@ -102,9 +100,9 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
102
100
|
var ky = (0, _core.useOkapiKy)();
|
|
103
101
|
var filterPaneVisibileKey = "".concat(namespace, "-").concat(id, "-filterPaneVisibility");
|
|
104
102
|
|
|
105
|
-
var fetchPageData = function fetchPageData(
|
|
106
|
-
var
|
|
107
|
-
pageParam =
|
|
103
|
+
var fetchPageData = function fetchPageData(_ref) {
|
|
104
|
+
var _ref$pageParam = _ref.pageParam,
|
|
105
|
+
pageParam = _ref$pageParam === void 0 ? 0 : _ref$pageParam;
|
|
108
106
|
var queryMap = fetchParameters.SASQ_MAP;
|
|
109
107
|
queryMap.offset = pageParam;
|
|
110
108
|
return ky("".concat(fetchParameters.endpoint).concat((0, _utils.generateKiwtQuery)(queryMap, query))).json();
|
|
@@ -122,10 +120,7 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
122
120
|
var _useInfiniteQuery = (0, _reactQuery.useInfiniteQuery)([namespace, id, 'data', query], fetchPageData),
|
|
123
121
|
_useInfiniteQuery$dat = _useInfiniteQuery.data,
|
|
124
122
|
totalData = _useInfiniteQuery$dat === void 0 ? {} : _useInfiniteQuery$dat,
|
|
125
|
-
|
|
126
|
-
isError = _useInfiniteQuery.isError,
|
|
127
|
-
isLoading = _useInfiniteQuery.isLoading,
|
|
128
|
-
fetchNextPage = _useInfiniteQuery.fetchNextPage;
|
|
123
|
+
restOfInfiniteQueryProps = _objectWithoutProperties(_useInfiniteQuery, _excluded);
|
|
129
124
|
|
|
130
125
|
var data = (_totalData$pages$redu = (_totalData$pages = totalData.pages) === null || _totalData$pages === void 0 ? void 0 : _totalData$pages.reduce(function (acc, curr) {
|
|
131
126
|
var _acc$results, _curr$results;
|
|
@@ -147,22 +142,7 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
147
142
|
newResults.push.apply(newResults, _toConsumableArray((_curr$results = curr.results) !== null && _curr$results !== void 0 ? _curr$results : []));
|
|
148
143
|
newAcc.results = newResults;
|
|
149
144
|
return newAcc;
|
|
150
|
-
}, {})) !== null && _totalData$pages$redu !== void 0 ? _totalData$pages$redu : {};
|
|
151
|
-
|
|
152
|
-
var onNeedMoreData = function onNeedMoreData(_askAmount, index) {
|
|
153
|
-
fetchNextPage({
|
|
154
|
-
pageParam: index
|
|
155
|
-
});
|
|
156
|
-
}; // Build the map of column definitions
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
var columnMapping = Object.fromEntries(resultColumns.map(function (e) {
|
|
160
|
-
return [e.propertyPath, e.label];
|
|
161
|
-
})); // Build the list of visible columns
|
|
162
|
-
|
|
163
|
-
var visibleColumns = resultColumns.map(function (e) {
|
|
164
|
-
return e.propertyPath;
|
|
165
|
-
});
|
|
145
|
+
}, {})) !== null && _totalData$pages$redu !== void 0 ? _totalData$pages$redu : {};
|
|
166
146
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_smartComponents.SearchAndSortQuery, _objectSpread(_objectSpread({
|
|
167
147
|
initialSearchState: {
|
|
168
148
|
query: ''
|
|
@@ -170,61 +150,23 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
170
150
|
queryGetter: queryGetter,
|
|
171
151
|
querySetter: querySetter
|
|
172
152
|
}, sasqProps), {}, {
|
|
173
|
-
children: function children(
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
resetAll = _ref3.resetAll,
|
|
183
|
-
searchChanged = _ref3.searchChanged,
|
|
184
|
-
searchValue = _ref3.searchValue;
|
|
153
|
+
children: function children(sasqRenderProps) {
|
|
154
|
+
var activeFilters = sasqRenderProps.activeFilters,
|
|
155
|
+
filterChanged = sasqRenderProps.filterChanged,
|
|
156
|
+
getFilterHandlers = sasqRenderProps.getFilterHandlers,
|
|
157
|
+
getSearchHandlers = sasqRenderProps.getSearchHandlers,
|
|
158
|
+
onSubmitSearch = sasqRenderProps.onSubmitSearch,
|
|
159
|
+
resetAll = sasqRenderProps.resetAll,
|
|
160
|
+
searchChanged = sasqRenderProps.searchChanged,
|
|
161
|
+
searchValue = sasqRenderProps.searchValue;
|
|
185
162
|
var searchHandlers = getSearchHandlers();
|
|
186
|
-
var sortOrder = (_query$sort = query.sort) !== null && _query$sort !== void 0 ? _query$sort : '';
|
|
187
163
|
var disableReset = !filterChanged && !searchChanged;
|
|
188
164
|
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;
|
|
165
|
+
var Body = RenderBody !== null && RenderBody !== void 0 ? RenderBody : _TableBody.default;
|
|
224
166
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_smartComponents.PersistedPaneset, {
|
|
225
167
|
appId: namespace,
|
|
226
168
|
id: "".concat(id, "-paneset"),
|
|
227
|
-
children: [filterPaneVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, {
|
|
169
|
+
children: [filterPaneVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, _objectSpread(_objectSpread({
|
|
228
170
|
defaultWidth: "20%",
|
|
229
171
|
lastMenu: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PaneMenu, {
|
|
230
172
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
@@ -236,14 +178,23 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
236
178
|
}),
|
|
237
179
|
paneTitle: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
238
180
|
id: "stripes-smart-components.searchAndFilter"
|
|
239
|
-
})
|
|
181
|
+
})
|
|
182
|
+
}, filterPaneProps), {}, {
|
|
240
183
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("form", {
|
|
241
184
|
onSubmit: onSubmitSearch,
|
|
242
185
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FilterPaneHeaderComponent, {}), !noSearchField && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
243
186
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SearchField, {
|
|
244
187
|
autoFocus: true,
|
|
245
188
|
name: "query",
|
|
246
|
-
onChange:
|
|
189
|
+
onChange: function onChange(e) {
|
|
190
|
+
var _e$target;
|
|
191
|
+
|
|
192
|
+
if ((_e$target = e.target) !== null && _e$target !== void 0 && _e$target.value) {
|
|
193
|
+
searchHandlers.query(e); // SASQ needs the whole event here
|
|
194
|
+
} else {
|
|
195
|
+
searchHandlers.reset();
|
|
196
|
+
}
|
|
197
|
+
},
|
|
247
198
|
onClear: searchHandlers.reset,
|
|
248
199
|
value: searchValue.query
|
|
249
200
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
@@ -276,7 +227,7 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
276
227
|
searchValue: searchValue
|
|
277
228
|
})]
|
|
278
229
|
})
|
|
279
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, _objectSpread(_objectSpread({
|
|
230
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, _objectSpread(_objectSpread({
|
|
280
231
|
defaultWidth: "fill",
|
|
281
232
|
firstMenu: !filterPaneVisible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PaneMenu, {
|
|
282
233
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
@@ -287,6 +238,8 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
287
238
|
}
|
|
288
239
|
})
|
|
289
240
|
}) : null,
|
|
241
|
+
noOverflow: true,
|
|
242
|
+
padContent: false,
|
|
290
243
|
paneSub: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
291
244
|
id: "stripes-kint-components.sasqLookupComponent.mainPane.found",
|
|
292
245
|
values: {
|
|
@@ -294,22 +247,26 @@ var SASQLookupComponent = function SASQLookupComponent(_ref) {
|
|
|
294
247
|
}
|
|
295
248
|
})
|
|
296
249
|
}, mainPaneProps), {}, {
|
|
297
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Body, {
|
|
298
|
-
data: data
|
|
299
|
-
|
|
250
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Body, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
251
|
+
data: data,
|
|
252
|
+
filterPaneVisible: filterPaneVisible,
|
|
253
|
+
query: query,
|
|
254
|
+
toggleFilterPane: toggleFilterPane
|
|
255
|
+
}, restOfInfiniteQueryProps), sasqRenderProps), sasqProps), props))
|
|
300
256
|
})), _children]
|
|
301
257
|
});
|
|
302
258
|
}
|
|
303
259
|
}));
|
|
304
260
|
};
|
|
305
261
|
|
|
306
|
-
__signature__(SASQLookupComponent, "useKiwtSASQuery{{ query, queryGetter, querySetter }}\nuseNamespace{{ 0: namespace }}\nuseOkapiKy{ky}\nuseLocalStorageState{[filterPaneVisible, setFilterPaneVisible]}\nuseInfiniteQuery{{\n data: totalData = {},\n
|
|
262
|
+
__signature__(SASQLookupComponent, "useKiwtSASQuery{{ query, queryGetter, querySetter }}\nuseNamespace{{ 0: namespace }}\nuseOkapiKy{ky}\nuseLocalStorageState{[filterPaneVisible, setFilterPaneVisible]}\nuseInfiniteQuery{{\n data: totalData = {},\n ...restOfInfiniteQueryProps\n }}", function () {
|
|
307
263
|
return [_hooks.useKiwtSASQuery, _core.useNamespace, _core.useOkapiKy, _hooks.useLocalStorageState, _reactQuery.useInfiniteQuery];
|
|
308
264
|
});
|
|
309
265
|
|
|
310
266
|
SASQLookupComponent.propTypes = {
|
|
311
267
|
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
312
268
|
fetchParameters: _propTypes.default.object,
|
|
269
|
+
filterPaneProps: _propTypes.default.object,
|
|
313
270
|
FilterComponent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
314
271
|
FilterPaneHeaderComponent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
315
272
|
history: _propTypes.default.object,
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _reactRouterDom = require("react-router-dom");
|
|
11
|
+
|
|
12
|
+
var _components = require("@folio/stripes/components");
|
|
13
|
+
|
|
14
|
+
var _NoResultsMessage = _interopRequireDefault(require("../../NoResultsMessage"));
|
|
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 TableBody = function TableBody(_ref) {
|
|
36
|
+
var _query$sort;
|
|
37
|
+
|
|
38
|
+
var data = _ref.data,
|
|
39
|
+
error = _ref.error,
|
|
40
|
+
fetchNextPage = _ref.fetchNextPage,
|
|
41
|
+
filterPaneVisible = _ref.filterPaneVisible,
|
|
42
|
+
isError = _ref.isError,
|
|
43
|
+
isLoading = _ref.isLoading,
|
|
44
|
+
match = _ref.match,
|
|
45
|
+
mclProps = _ref.mclProps,
|
|
46
|
+
onSort = _ref.onSort,
|
|
47
|
+
path = _ref.path,
|
|
48
|
+
resultColumns = _ref.resultColumns,
|
|
49
|
+
toggleFilterPane = _ref.toggleFilterPane,
|
|
50
|
+
query = _ref.query;
|
|
51
|
+
var sortOrder = (_query$sort = query.sort) !== null && _query$sort !== void 0 ? _query$sort : '';
|
|
52
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
53
|
+
var location = (0, _reactRouterDom.useLocation)();
|
|
54
|
+
|
|
55
|
+
var onNeedMoreData = function onNeedMoreData(_askAmount, index) {
|
|
56
|
+
fetchNextPage({
|
|
57
|
+
pageParam: index
|
|
58
|
+
});
|
|
59
|
+
}; // Build the map of column definitions
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
var columnMapping = Object.fromEntries(resultColumns.map(function (e) {
|
|
63
|
+
return [e.propertyPath, e.label];
|
|
64
|
+
})); // Build the list of visible columns
|
|
65
|
+
|
|
66
|
+
var visibleColumns = resultColumns.map(function (e) {
|
|
67
|
+
return e.propertyPath;
|
|
68
|
+
});
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
|
|
70
|
+
autosize: true,
|
|
71
|
+
columnMapping: columnMapping,
|
|
72
|
+
contentData: data === null || data === void 0 ? void 0 : data.results,
|
|
73
|
+
hasMargin: true,
|
|
74
|
+
isEmptyMessage: /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoResultsMessage.default, {
|
|
75
|
+
error: error,
|
|
76
|
+
isError: isError,
|
|
77
|
+
isLoading: isLoading,
|
|
78
|
+
filterPaneIsVisible: filterPaneVisible,
|
|
79
|
+
searchTerm: query.query,
|
|
80
|
+
toggleFilterPane: toggleFilterPane
|
|
81
|
+
}),
|
|
82
|
+
isSelected: function isSelected(_ref2) {
|
|
83
|
+
var _match$params;
|
|
84
|
+
|
|
85
|
+
var item = _ref2.item;
|
|
86
|
+
return item.id === (match === null || match === void 0 ? void 0 : (_match$params = match.params) === null || _match$params === void 0 ? void 0 : _match$params.id);
|
|
87
|
+
},
|
|
88
|
+
onHeaderClick: onSort,
|
|
89
|
+
onNeedMoreData: onNeedMoreData,
|
|
90
|
+
onRowClick: function onRowClick(_e, rowData) {
|
|
91
|
+
history.push("".concat(path, "/").concat(rowData === null || rowData === void 0 ? void 0 : rowData.id).concat(location === null || location === void 0 ? void 0 : location.search));
|
|
92
|
+
},
|
|
93
|
+
pagingType: "click",
|
|
94
|
+
sortDirection: sortOrder.startsWith('-') ? 'descending' : 'ascending',
|
|
95
|
+
sortOrder: sortOrder.replace(/^-/, '').replace(/,.*/, ''),
|
|
96
|
+
totalCount: data.totalRecords,
|
|
97
|
+
visibleColumns: visibleColumns
|
|
98
|
+
}, mclProps));
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
__signature__(TableBody, "useHistory{history}\nuseLocation{location}", function () {
|
|
102
|
+
return [_reactRouterDom.useHistory, _reactRouterDom.useLocation];
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
TableBody.propTypes = {
|
|
106
|
+
data: _propTypes.default.shape({
|
|
107
|
+
totalRecords: _propTypes.default.number,
|
|
108
|
+
results: _propTypes.default.arrayOf(_propTypes.default.object)
|
|
109
|
+
}),
|
|
110
|
+
error: _propTypes.default.object,
|
|
111
|
+
fetchNextPage: _propTypes.default.func,
|
|
112
|
+
filterPaneVisible: _propTypes.default.bool,
|
|
113
|
+
history: _propTypes.default.object,
|
|
114
|
+
isError: _propTypes.default.bool,
|
|
115
|
+
isLoading: _propTypes.default.bool,
|
|
116
|
+
location: _propTypes.default.object,
|
|
117
|
+
match: _propTypes.default.object,
|
|
118
|
+
mclProps: _propTypes.default.object,
|
|
119
|
+
onSort: _propTypes.default.func,
|
|
120
|
+
path: _propTypes.default.string.isRequired,
|
|
121
|
+
query: _propTypes.default.object,
|
|
122
|
+
resultColumns: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
123
|
+
toggleFilterPane: _propTypes.default.func
|
|
124
|
+
};
|
|
125
|
+
var _default = TableBody;
|
|
126
|
+
var _default2 = _default;
|
|
127
|
+
exports.default = _default2;
|
|
128
|
+
;
|
|
129
|
+
|
|
130
|
+
(function () {
|
|
131
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
132
|
+
|
|
133
|
+
if (!reactHotLoader) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
reactHotLoader.register(TableBody, "TableBody", "/home/ethan/FolioModules/stripes-kint-components/src/lib/SASQLookupComponent/TableBody/TableBody.js");
|
|
138
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/SASQLookupComponent/TableBody/TableBody.js");
|
|
139
|
+
})();
|
|
140
|
+
|
|
141
|
+
;
|
|
142
|
+
|
|
143
|
+
(function () {
|
|
144
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
145
|
+
leaveModule && leaveModule(module);
|
|
146
|
+
})();
|
|
@@ -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 _TableBody.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _TableBody = _interopRequireDefault(require("./TableBody"));
|
|
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,15 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "SASQLookupComponent", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
9
|
return _SASQLookupComponent.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "TableBody", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _TableBody.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
|
|
13
19
|
var _SASQLookupComponent = _interopRequireDefault(require("./SASQLookupComponent"));
|
|
14
20
|
|
|
21
|
+
var _TableBody = _interopRequireDefault(require("./TableBody"));
|
|
22
|
+
|
|
15
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
24
|
|
|
17
25
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _reactRouterDom = require("react-router-dom");
|
|
13
13
|
|
|
14
|
-
var _SASQLookupComponent =
|
|
14
|
+
var _SASQLookupComponent = require("../SASQLookupComponent");
|
|
15
15
|
|
|
16
16
|
var _SASQViewComponent = _interopRequireDefault(require("../SASQViewComponent"));
|
|
17
17
|
|
|
@@ -60,7 +60,7 @@ var SASQRoute = function SASQRoute(_ref) {
|
|
|
60
60
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Route, {
|
|
61
61
|
path: "".concat(path, "/:id?"),
|
|
62
62
|
render: function render(routeProps) {
|
|
63
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SASQLookupComponent.
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SASQLookupComponent.SASQLookupComponent, _objectSpread(_objectSpread(_objectSpread({}, routeProps), {}, {
|
|
64
64
|
fetchParameters: fetchParameters,
|
|
65
65
|
path: path
|
|
66
66
|
}, props), {}, {
|
|
@@ -199,10 +199,12 @@ var Typedown = function Typedown(_ref) {
|
|
|
199
199
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchField.default // Pass meta through so correct styling gets applied to the TextField
|
|
200
200
|
, {
|
|
201
201
|
id: "typedown-searchField-".concat((0, _selectorSafe.default)(input.name)),
|
|
202
|
+
label: label,
|
|
202
203
|
marginBottom0: true,
|
|
203
204
|
meta: meta,
|
|
204
205
|
onChange: handleType,
|
|
205
|
-
onKeyDown: searchFieldKeyDownHandler
|
|
206
|
+
onKeyDown: searchFieldKeyDownHandler,
|
|
207
|
+
required: required
|
|
206
208
|
})
|
|
207
209
|
});
|
|
208
210
|
};
|
|
@@ -210,12 +212,8 @@ var Typedown = function Typedown(_ref) {
|
|
|
210
212
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
211
213
|
ref: resizeRef,
|
|
212
214
|
className: (0, _classnames.default)(_TypeDown.default.typedown, className),
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
id: "".concat(id, "-label"),
|
|
216
|
-
required: required,
|
|
217
|
-
children: label
|
|
218
|
-
}), renderSearchField(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Popper, {
|
|
215
|
+
id: "typedown-id-".concat(id),
|
|
216
|
+
children: [renderSearchField(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Popper, {
|
|
219
217
|
anchorRef: triggerRef,
|
|
220
218
|
className: (0, _classnames.default)(_TypeDown.default.dropdown, _TypeDown.default.fullWidth),
|
|
221
219
|
isOpen: open,
|
|
@@ -11,6 +11,8 @@ var _reactQuery = require("react-query");
|
|
|
11
11
|
|
|
12
12
|
var _core = require("@folio/stripes/core");
|
|
13
13
|
|
|
14
|
+
var _utils = require("../../utils");
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
(function () {
|
|
@@ -26,9 +28,20 @@ var useSettingSection = function useSettingSection(_ref) {
|
|
|
26
28
|
var sectionName = _ref.sectionName,
|
|
27
29
|
settingEndpoint = _ref.settingEndpoint;
|
|
28
30
|
var ky = (0, _core.useOkapiKy)();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
var queryParams = (0, _utils.generateKiwtQueryParams)({
|
|
32
|
+
filters: [{
|
|
33
|
+
path: 'section',
|
|
34
|
+
value: sectionName
|
|
35
|
+
}],
|
|
36
|
+
sort: [{
|
|
37
|
+
path: 'key'
|
|
38
|
+
}],
|
|
39
|
+
perPage: 100,
|
|
40
|
+
stats: false
|
|
41
|
+
}, {});
|
|
42
|
+
|
|
43
|
+
var _useQuery = (0, _reactQuery.useQuery)(['stripes-kint-components', 'useSetting', 'appSettings', queryParams, sectionName], function () {
|
|
44
|
+
return ky("".concat(settingEndpoint, "?").concat(queryParams === null || queryParams === void 0 ? void 0 : queryParams.join('&'))).json();
|
|
32
45
|
}),
|
|
33
46
|
_useQuery$data = _useQuery.data,
|
|
34
47
|
settings = _useQuery$data === void 0 ? [] : _useQuery$data;
|
|
@@ -69,13 +69,20 @@ var useSettings = function useSettings(_ref) {
|
|
|
69
69
|
templateEndpoint = _ref.templateEndpoint;
|
|
70
70
|
var ky = (0, _core.useOkapiKy)();
|
|
71
71
|
var intl = (0, _reactIntl.useIntl)();
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
var queryParams = (0, _utils.generateKiwtQueryParams)({
|
|
73
|
+
filters: dynamicPageExclusions === null || dynamicPageExclusions === void 0 ? void 0 : dynamicPageExclusions.map(function (dpe) {
|
|
74
|
+
return {
|
|
75
|
+
path: 'section',
|
|
76
|
+
comparator: '!=',
|
|
77
|
+
value: dpe
|
|
78
|
+
};
|
|
79
|
+
}),
|
|
80
|
+
perPage: 100,
|
|
81
|
+
stats: false
|
|
82
|
+
}, {});
|
|
83
|
+
|
|
84
|
+
var _useQuery = (0, _reactQuery.useQuery)(['stripes-kint-components', 'useSettings', 'appSettings', settingEndpoint, queryParams], function () {
|
|
85
|
+
return ky("".concat(settingEndpoint, "?").concat(queryParams === null || queryParams === void 0 ? void 0 : queryParams.join('&'))).json();
|
|
79
86
|
}),
|
|
80
87
|
_useQuery$data = _useQuery.data,
|
|
81
88
|
appSettings = _useQuery$data === void 0 ? [] : _useQuery$data,
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _excluded = ["searchKey", "filterKeys", "sortKeys", "stats", "sort", "filters"];
|
|
7
|
+
var _excluded = ["searchKey", "filterConfig", "filterKeys", "sortKeys", "stats", "sort", "filters"];
|
|
8
8
|
|
|
9
9
|
(function () {
|
|
10
10
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
@@ -49,6 +49,8 @@ var generateKiwtQueryParams = function generateKiwtQueryParams(options, nsValues
|
|
|
49
49
|
|
|
50
50
|
var _options$searchKey = options.searchKey,
|
|
51
51
|
searchKey = _options$searchKey === void 0 ? '' : _options$searchKey,
|
|
52
|
+
_options$filterConfig = options.filterConfig,
|
|
53
|
+
filterConfig = _options$filterConfig === void 0 ? [] : _options$filterConfig,
|
|
52
54
|
_options$filterKeys = options.filterKeys,
|
|
53
55
|
filterKeys = _options$filterKeys === void 0 ? {} : _options$filterKeys,
|
|
54
56
|
_options$sortKeys = options.sortKeys,
|
|
@@ -118,18 +120,33 @@ var generateKiwtQueryParams = function generateKiwtQueryParams(options, nsValues
|
|
|
118
120
|
filterName = _ref2[0],
|
|
119
121
|
filterValues = _ref2[1];
|
|
120
122
|
|
|
123
|
+
var filterConfigEntry = filterConfig.find(function (conf) {
|
|
124
|
+
return conf.name === filterName;
|
|
125
|
+
});
|
|
121
126
|
var filterKey = filterKeys[filterName];
|
|
122
127
|
|
|
123
|
-
if (
|
|
128
|
+
if (filterConfigEntry) {
|
|
129
|
+
// We have a direct mapping instruction, use it
|
|
130
|
+
var filterString = filterValues.map(function (v) {
|
|
131
|
+
var _filterConfigEntry$va, _filterConfigEntry$va2;
|
|
132
|
+
|
|
133
|
+
var fceValue = filterConfigEntry === null || filterConfigEntry === void 0 ? void 0 : (_filterConfigEntry$va = filterConfigEntry.values) === null || _filterConfigEntry$va === void 0 ? void 0 : (_filterConfigEntry$va2 = _filterConfigEntry$va.find(function (fce) {
|
|
134
|
+
return fce.name === v;
|
|
135
|
+
})) === null || _filterConfigEntry$va2 === void 0 ? void 0 : _filterConfigEntry$va2.value;
|
|
136
|
+
return "".concat(filterName, "==").concat(fceValue !== null && fceValue !== void 0 ? fceValue : v);
|
|
137
|
+
}).join('||');
|
|
138
|
+
paramsArray.push("filters=".concat(filterString));
|
|
139
|
+
} else if (!filterKey) {
|
|
124
140
|
// These filters have no key mapping so we just pass the values to the backend as-is.
|
|
125
141
|
paramsArray.push.apply(paramsArray, _toConsumableArray(filterValues === null || filterValues === void 0 ? void 0 : filterValues.map(function (f) {
|
|
126
142
|
return "filters=".concat(f);
|
|
127
143
|
})));
|
|
128
144
|
} else {
|
|
129
|
-
var
|
|
145
|
+
var _filterString = filterValues.map(function (v) {
|
|
130
146
|
return "".concat(filterKey, "==").concat(v);
|
|
131
147
|
}).join('||');
|
|
132
|
-
|
|
148
|
+
|
|
149
|
+
paramsArray.push("filters=".concat(_filterString));
|
|
133
150
|
}
|
|
134
151
|
});
|
|
135
152
|
}
|