@k-int/stripes-kint-components 1.7.0 → 2.1.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 +36 -0
- package/es/index.js +51 -8
- package/es/lib/ActionList/ActionList.js +48 -28
- package/es/lib/ActionList/ActionListFieldArray.js +56 -16
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +198 -0
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +326 -0
- package/es/lib/CustomProperties/Config/CustomPropertiesView.js +166 -0
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +360 -0
- package/es/lib/CustomProperties/Config/index.js +41 -0
- package/es/lib/EditableRefdataList/EditableRefdataList.js +0 -1
- package/es/lib/FormModal/FormModal.js +126 -0
- package/es/lib/{TypeDown → FormModal}/index.js +2 -2
- package/es/lib/NoResultsMessage/NoResultsMessage.js +1 -1
- package/es/lib/SASQRoute/SASQRoute.js +15 -11
- package/es/lib/SASQViewComponent/SASQViewComponent.js +6 -3
- package/es/lib/Typedown/Typedown.js +50 -18
- package/es/lib/constants/customProperties.js +60 -0
- package/es/lib/hooks/index.js +16 -0
- package/es/lib/hooks/useCustomProperties.js +122 -0
- package/es/lib/hooks/useMutateCustomProperties.js +143 -0
- package/es/lib/utils/generateKiwtQueryParams.js +51 -8
- package/junit.xml +40 -40
- package/package.json +5 -3
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +47 -26
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +122 -8
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +10 -10
- 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 +418 -0
- package/src/artifacts/coverage-jest/lcov-report/{TypeDown/TypeDown.js.html → CustomProperties/Config/CustomPropertiesSettings.js.html} +268 -232
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesView.js.html +535 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +973 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +176 -0
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +97 -0
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +2 -5
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +1 -1
- 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 +298 -0
- package/src/artifacts/coverage-jest/lcov-report/{TypeDown → FormModal}/index.html +14 -14
- package/src/artifacts/coverage-jest/lcov-report/{TypeDown → FormModal}/index.js.html +4 -4
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +3 -3
- 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 +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +3 -3
- 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 +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +43 -16
- 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 +6 -3
- 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 +150 -21
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +112 -0
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +18 -3
- 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 +35 -5
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +8 -2
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +1 -1
- 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 +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
- 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 +1 -1
- 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/useCustomProperties.js.html +313 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +1 -1
- 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 +271 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +62 -47
- 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 +174 -12
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +17 -17
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- 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.info +841 -348
- package/src/index.js +14 -4
- package/src/lib/ActionList/ActionList.js +30 -23
- package/src/lib/ActionList/ActionListFieldArray.js +40 -2
- package/src/lib/ActionList/README.md +4 -1
- package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +111 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +240 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesView.js +150 -0
- package/src/lib/CustomProperties/Config/CustomPropertyForm.js +296 -0
- package/src/lib/CustomProperties/Config/index.js +4 -0
- package/src/lib/EditableRefdataList/EditableRefdataList.js +0 -1
- 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/SASQRoute/SASQRoute.js +23 -14
- package/src/lib/SASQViewComponent/SASQViewComponent.js +2 -1
- package/src/lib/Typedown/Typedown.js +56 -13
- package/src/lib/constants/customProperties.js +9 -0
- package/src/lib/hooks/index.js +2 -0
- package/src/lib/hooks/useCustomProperties.js +76 -0
- package/src/lib/hooks/useMutateCustomProperties.js +62 -0
- package/src/lib/utils/generateKiwtQueryParams.js +58 -4
- package/styles/TypeDown.css +7 -0
- package/translations/stripes-kint-components/en.json +49 -1
- package/es/lib/TypeDown/TypeDown.js +0 -251
- package/src/lib/TypeDown/README.md +0 -1
- package/src/lib/TypeDown/TypeDown.js +0 -228
- package/src/lib/TypeDown/index.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
## 2.1.0 In progress
|
|
2
|
+
* Fixes for ActionList
|
|
3
|
+
* When no formatter is present, it no longer crashes
|
|
4
|
+
* Formatting for buttons
|
|
5
|
+
* Fixes for CustomProperty work
|
|
6
|
+
* Editing CustProp with context no longer crashes
|
|
7
|
+
* Added translation for "no matching context found"
|
|
8
|
+
* Custom properties now sorted by label by default
|
|
9
|
+
* generateKiwtQuery now allows for filters and sort objects to be passed in with options, to avoid weird parsing nsValues used by SASQ if desired.
|
|
10
|
+
* useCustomProperties migrated over to use this feature
|
|
11
|
+
* SASQViewComponent now hands "queryProps" to the ViewComponent, allowing access to the react-query internals
|
|
12
|
+
* SASQRoute children are now rendered above the SASQViewComponent, allowing for Route patterns such as 'Charges' in OA
|
|
13
|
+
* FormModal is actually exported now
|
|
14
|
+
* Typedown
|
|
15
|
+
* Interaction styles have been improved, onHover and onFocus styles are now in line with Stripes standards
|
|
16
|
+
* Can now pass className to Field containing Typedown and they will be applied to Typedown
|
|
17
|
+
* Selected item style is no longer "selected" colour, instead blank with border
|
|
18
|
+
|
|
19
|
+
## 2.0.0 2022-03-04
|
|
20
|
+
* ActionList updates
|
|
21
|
+
* Formatter now accepted, will apply while not editing a row
|
|
22
|
+
* MCL props not specified in prop list will be passed directly to MCL
|
|
23
|
+
* fieldComponents prop allows for rendering of a custom Field for use in editing a specific field on a row
|
|
24
|
+
* Removed deprecated TypeDown component (replaced by Typedown in v1.3.0)
|
|
25
|
+
* Typedown
|
|
26
|
+
* Added isSelected prop
|
|
27
|
+
* Added id prop
|
|
28
|
+
* Added label prop
|
|
29
|
+
* Added required prop
|
|
30
|
+
* Added endOfList prop
|
|
31
|
+
* FormModal component
|
|
32
|
+
* Custom Property configuration components
|
|
33
|
+
* CustomPropertiesLookup
|
|
34
|
+
* CustomPropertiesView
|
|
35
|
+
* CustomPropertiesSettings
|
|
36
|
+
* Added jest artifacts one level below root to gitignore
|
|
1
37
|
## 1.7.0 Released 20th January 2022
|
|
2
38
|
* EditableRefdataList fixes and sorting
|
|
3
39
|
* Fixes to create action in actionlist
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -9,12 +11,36 @@ Object.defineProperty(exports, "ActionList", {
|
|
|
9
11
|
return _ActionList.default;
|
|
10
12
|
}
|
|
11
13
|
});
|
|
14
|
+
Object.defineProperty(exports, "CustomPropertiesLookup", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _Config.CustomPropertiesLookup;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "CustomPropertiesSettings", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _Config.CustomPropertiesSettings;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "CustomPropertiesView", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function get() {
|
|
29
|
+
return _Config.CustomPropertiesView;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
12
32
|
Object.defineProperty(exports, "EditableRefdataList", {
|
|
13
33
|
enumerable: true,
|
|
14
34
|
get: function get() {
|
|
15
35
|
return _EditableRefdataList.default;
|
|
16
36
|
}
|
|
17
37
|
});
|
|
38
|
+
Object.defineProperty(exports, "FormModal", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _FormModal.default;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
18
44
|
Object.defineProperty(exports, "NoResultsMessage", {
|
|
19
45
|
enumerable: true,
|
|
20
46
|
get: function get() {
|
|
@@ -75,18 +101,13 @@ Object.defineProperty(exports, "SettingsContext", {
|
|
|
75
101
|
return _contexts.SettingsContext;
|
|
76
102
|
}
|
|
77
103
|
});
|
|
78
|
-
Object.defineProperty(exports, "TypeDown", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function get() {
|
|
81
|
-
return _TypeDown.default;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
104
|
Object.defineProperty(exports, "Typedown", {
|
|
85
105
|
enumerable: true,
|
|
86
106
|
get: function get() {
|
|
87
107
|
return _Typedown.default;
|
|
88
108
|
}
|
|
89
109
|
});
|
|
110
|
+
exports.customPropertyContants = void 0;
|
|
90
111
|
Object.defineProperty(exports, "generateKiwtQuery", {
|
|
91
112
|
enumerable: true,
|
|
92
113
|
get: function get() {
|
|
@@ -117,6 +138,12 @@ Object.defineProperty(exports, "useActiveElement", {
|
|
|
117
138
|
return _hooks.useActiveElement;
|
|
118
139
|
}
|
|
119
140
|
});
|
|
141
|
+
Object.defineProperty(exports, "useCustomProperties", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: function get() {
|
|
144
|
+
return _hooks.useCustomProperties;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
120
147
|
Object.defineProperty(exports, "useHelperApp", {
|
|
121
148
|
enumerable: true,
|
|
122
149
|
get: function get() {
|
|
@@ -141,6 +168,12 @@ Object.defineProperty(exports, "useLocalStorageState", {
|
|
|
141
168
|
return _hooks.useLocalStorageState;
|
|
142
169
|
}
|
|
143
170
|
});
|
|
171
|
+
Object.defineProperty(exports, "useMutateCustomProperties", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function get() {
|
|
174
|
+
return _hooks.useMutateCustomProperties;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
144
177
|
Object.defineProperty(exports, "useMutateRefdataValue", {
|
|
145
178
|
enumerable: true,
|
|
146
179
|
get: function get() {
|
|
@@ -184,8 +217,6 @@ var _ActionList = _interopRequireDefault(require("./lib/ActionList"));
|
|
|
184
217
|
|
|
185
218
|
var _EditableRefdataList = _interopRequireDefault(require("./lib/EditableRefdataList"));
|
|
186
219
|
|
|
187
|
-
var _TypeDown = _interopRequireDefault(require("./lib/TypeDown"));
|
|
188
|
-
|
|
189
220
|
var _Typedown = _interopRequireDefault(require("./lib/Typedown"));
|
|
190
221
|
|
|
191
222
|
var _QueryTypedown = _interopRequireDefault(require("./lib/QueryTypedown"));
|
|
@@ -202,6 +233,18 @@ var _NoResultsMessage = _interopRequireDefault(require("./lib/NoResultsMessage")
|
|
|
202
233
|
|
|
203
234
|
var _RefdataButtons = _interopRequireDefault(require("./lib/RefdataButtons"));
|
|
204
235
|
|
|
236
|
+
var _FormModal = _interopRequireDefault(require("./lib/FormModal"));
|
|
237
|
+
|
|
238
|
+
var _Config = require("./lib/CustomProperties/Config");
|
|
239
|
+
|
|
240
|
+
var _customPropertyContants = _interopRequireWildcard(require("./lib/constants/customProperties"));
|
|
241
|
+
|
|
242
|
+
exports.customPropertyContants = _customPropertyContants;
|
|
243
|
+
|
|
244
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
245
|
+
|
|
246
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
247
|
+
|
|
205
248
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
206
249
|
|
|
207
250
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
@@ -19,6 +19,8 @@ var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArr
|
|
|
19
19
|
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
|
|
22
|
+
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "editableFields", "fieldComponents", "visibleFields"];
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
24
26
|
(function () {
|
|
@@ -26,6 +28,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
26
28
|
enterModule && enterModule(module);
|
|
27
29
|
})();
|
|
28
30
|
|
|
31
|
+
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; }
|
|
32
|
+
|
|
33
|
+
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; }
|
|
34
|
+
|
|
35
|
+
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; }
|
|
36
|
+
|
|
37
|
+
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; }
|
|
38
|
+
|
|
39
|
+
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; }
|
|
40
|
+
|
|
29
41
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
30
42
|
return a;
|
|
31
43
|
};
|
|
@@ -37,6 +49,7 @@ var propTypes = {
|
|
|
37
49
|
contentData: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
38
50
|
creatableFields: _propTypes.default.object,
|
|
39
51
|
editableFields: _propTypes.default.object,
|
|
52
|
+
fieldComponents: _propTypes.default.object,
|
|
40
53
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
41
54
|
};
|
|
42
55
|
|
|
@@ -50,34 +63,41 @@ var ActionList = function ActionList(_ref) {
|
|
|
50
63
|
creatableFields = _ref$creatableFields === void 0 ? {} : _ref$creatableFields,
|
|
51
64
|
_ref$editableFields = _ref.editableFields,
|
|
52
65
|
editableFields = _ref$editableFields === void 0 ? {} : _ref$editableFields,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
66
|
+
_ref$fieldComponents = _ref.fieldComponents,
|
|
67
|
+
fieldComponents = _ref$fieldComponents === void 0 ? {} : _ref$fieldComponents,
|
|
68
|
+
visibleFields = _ref.visibleFields,
|
|
69
|
+
mclProps = _objectWithoutProperties(_ref, _excluded);
|
|
70
|
+
|
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
72
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Form, {
|
|
73
|
+
enableReinitialize: true,
|
|
74
|
+
initialValues: {
|
|
75
|
+
contentData: contentData
|
|
76
|
+
},
|
|
77
|
+
mutators: _finalFormArrays.default,
|
|
78
|
+
onSubmit: actionCalls.edit,
|
|
79
|
+
subscription: {
|
|
80
|
+
contentData: true
|
|
81
|
+
},
|
|
82
|
+
children: function children() {
|
|
83
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
84
|
+
onSubmit: function onSubmit(e) {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
},
|
|
87
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, _objectSpread({
|
|
88
|
+
actionAssigner: actionAssigner,
|
|
89
|
+
actionCalls: actionCalls,
|
|
90
|
+
columnMapping: columnMapping,
|
|
91
|
+
component: _ActionListFieldArray.default,
|
|
92
|
+
creatableFields: creatableFields,
|
|
93
|
+
editableFields: editableFields,
|
|
94
|
+
fieldComponents: fieldComponents,
|
|
95
|
+
name: "contentData",
|
|
96
|
+
visibleFields: visibleFields
|
|
97
|
+
}, mclProps))
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
})
|
|
81
101
|
});
|
|
82
102
|
};
|
|
83
103
|
|
|
@@ -23,9 +23,11 @@ var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/Acti
|
|
|
23
23
|
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["
|
|
26
|
+
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "editableFields", "fields", "fieldComponents", "visibleFields"],
|
|
27
27
|
_excluded2 = ["actionListActions"],
|
|
28
|
-
_excluded3 = ["actionListActions"]
|
|
28
|
+
_excluded3 = ["actionListActions"],
|
|
29
|
+
_excluded4 = ["actionListActions"],
|
|
30
|
+
_excluded5 = ["formatter"];
|
|
29
31
|
|
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
33
|
|
|
@@ -54,10 +56,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
54
56
|
|
|
55
57
|
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; }
|
|
56
58
|
|
|
57
|
-
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; }
|
|
58
|
-
|
|
59
|
-
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; }
|
|
60
|
-
|
|
61
59
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
62
60
|
|
|
63
61
|
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."); }
|
|
@@ -70,6 +68,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
70
68
|
|
|
71
69
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
72
70
|
|
|
71
|
+
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; }
|
|
72
|
+
|
|
73
|
+
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; }
|
|
74
|
+
|
|
73
75
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
74
76
|
return a;
|
|
75
77
|
};
|
|
@@ -84,6 +86,8 @@ var propTypes = {
|
|
|
84
86
|
creatableFields: _propTypes.default.object,
|
|
85
87
|
editableFields: _propTypes.default.object,
|
|
86
88
|
fields: _propTypes.default.object,
|
|
89
|
+
fieldComponents: _propTypes.default.object,
|
|
90
|
+
formatter: _propTypes.default.object,
|
|
87
91
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
88
92
|
};
|
|
89
93
|
|
|
@@ -94,7 +98,9 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
94
98
|
creatableFields = _ref.creatableFields,
|
|
95
99
|
editableFields = _ref.editableFields,
|
|
96
100
|
fields = _ref.fields,
|
|
97
|
-
|
|
101
|
+
fieldComponents = _ref.fieldComponents,
|
|
102
|
+
visibleFields = _ref.visibleFields,
|
|
103
|
+
mclProps = _objectWithoutProperties(_ref, _excluded);
|
|
98
104
|
|
|
99
105
|
// Grab finalForm functions/values from form hooks
|
|
100
106
|
var _useForm = (0, _reactFinalForm.useForm)(),
|
|
@@ -128,7 +134,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
128
134
|
var handleSave = function handleSave(index) {
|
|
129
135
|
var _fields$value$index = fields.value[index],
|
|
130
136
|
_a = _fields$value$index.actionListActions,
|
|
131
|
-
rowData = _objectWithoutProperties(_fields$value$index,
|
|
137
|
+
rowData = _objectWithoutProperties(_fields$value$index, _excluded2);
|
|
132
138
|
|
|
133
139
|
actionCalls.edit(rowData);
|
|
134
140
|
};
|
|
@@ -136,7 +142,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
136
142
|
var handleCreate = function handleCreate(index) {
|
|
137
143
|
var _fields$value$index2 = fields.value[index],
|
|
138
144
|
_a = _fields$value$index2.actionListActions,
|
|
139
|
-
rowData = _objectWithoutProperties(_fields$value$index2,
|
|
145
|
+
rowData = _objectWithoutProperties(_fields$value$index2, _excluded3);
|
|
140
146
|
|
|
141
147
|
actionCalls.create(rowData);
|
|
142
148
|
};
|
|
@@ -158,7 +164,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
158
164
|
var fieldName = "contentData[".concat(data.rowIndex, "]");
|
|
159
165
|
|
|
160
166
|
var actions = data.actionListActions,
|
|
161
|
-
rest = _objectWithoutProperties(data,
|
|
167
|
+
rest = _objectWithoutProperties(data, _excluded4);
|
|
162
168
|
|
|
163
169
|
if (data.id === editing || !data.id && editing === 'NEW_ROW') {
|
|
164
170
|
// Render the save/cancel buttons
|
|
@@ -166,6 +172,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
166
172
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
167
173
|
buttonStyle: "primary",
|
|
168
174
|
disabled: submitting || pristine,
|
|
175
|
+
marginBottom0: true,
|
|
169
176
|
onClick: function onClick() {
|
|
170
177
|
if (!data.id && editing === 'NEW_ROW') {
|
|
171
178
|
handleCreate(data.rowIndex);
|
|
@@ -180,6 +187,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
180
187
|
})
|
|
181
188
|
}, "save[".concat(data.rowIndex, "]")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
182
189
|
"data-type-button": "cancel",
|
|
190
|
+
marginBottom0: true,
|
|
183
191
|
onClick: function onClick() {
|
|
184
192
|
if (!data.id && editing === 'NEW_ROW') {
|
|
185
193
|
fields.remove(data.rowIndex);
|
|
@@ -216,6 +224,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
216
224
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
217
225
|
disabled: editing,
|
|
218
226
|
icon: action.icon,
|
|
227
|
+
marginBottom0: true,
|
|
219
228
|
onClick: actionFunction
|
|
220
229
|
}, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
|
|
221
230
|
} // Else return a button with the label, or failing that the name of the action
|
|
@@ -223,6 +232,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
223
232
|
|
|
224
233
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
225
234
|
disabled: editing,
|
|
235
|
+
marginBottom0: true,
|
|
226
236
|
onClick: actionFunction,
|
|
227
237
|
children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
|
|
228
238
|
}, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
|
|
@@ -269,10 +279,16 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
269
279
|
*/
|
|
270
280
|
|
|
271
281
|
if (!cd.id && createFunction(cd) || editFunction(cd)) {
|
|
272
|
-
returnObj[key] =
|
|
282
|
+
returnObj[key] = fieldComponents[key] ? fieldComponents[key]({
|
|
283
|
+
name: "".concat(fieldName, ".").concat(key)
|
|
284
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
273
285
|
autofocus: fieldIndex === 0,
|
|
274
286
|
component: _components.TextField,
|
|
275
|
-
|
|
287
|
+
marginBottom0: true,
|
|
288
|
+
name: "".concat(fieldName, ".").concat(key),
|
|
289
|
+
parse: function parse(v) {
|
|
290
|
+
return v;
|
|
291
|
+
}
|
|
276
292
|
});
|
|
277
293
|
}
|
|
278
294
|
}
|
|
@@ -287,6 +303,30 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
287
303
|
});
|
|
288
304
|
};
|
|
289
305
|
|
|
306
|
+
var formatter = mclProps.formatter,
|
|
307
|
+
restOfMclProps = _objectWithoutProperties(mclProps, _excluded5); // Destructure formatter part of mclProps
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
var fieldAwareFormatter = function fieldAwareFormatter() {
|
|
311
|
+
var returnObj = {}; // For each visible field, if it's being edited then ignore passed formatters, else use them
|
|
312
|
+
|
|
313
|
+
visibleFields.forEach(function (key) {
|
|
314
|
+
returnObj[key] = function (cd) {
|
|
315
|
+
// Row is being edited if it has no id, or its id is in the editing string
|
|
316
|
+
var editingRow = cd.id === editing || !cd.id; // If not editing, use the passed formatter values
|
|
317
|
+
|
|
318
|
+
var returnValue = cd[key];
|
|
319
|
+
|
|
320
|
+
if (!editingRow && formatter !== null && formatter !== void 0 && formatter[key]) {
|
|
321
|
+
returnValue = formatter[key](cd);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return returnValue;
|
|
325
|
+
};
|
|
326
|
+
});
|
|
327
|
+
return returnObj;
|
|
328
|
+
};
|
|
329
|
+
|
|
290
330
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
291
331
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
292
332
|
buttonClass: _ActionListFieldArray.default.buttonRight,
|
|
@@ -298,7 +338,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
298
338
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
299
339
|
id: "stripes-kint-components.actionList.create"
|
|
300
340
|
})
|
|
301
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, {
|
|
341
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
|
|
302
342
|
columnMapping: _objectSpread(_objectSpread({}, columnMapping), {}, {
|
|
303
343
|
actionListActions: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
304
344
|
id: "stripes-kint-components.actionList.actions"
|
|
@@ -306,12 +346,12 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
306
346
|
}),
|
|
307
347
|
columnWidths: getColumnWidths(),
|
|
308
348
|
contentData: formatContent(),
|
|
309
|
-
formatter: {
|
|
349
|
+
formatter: _objectSpread({
|
|
310
350
|
actionListActions: renderActionButtons
|
|
311
|
-
},
|
|
351
|
+
}, fieldAwareFormatter()),
|
|
312
352
|
interactive: false,
|
|
313
353
|
visibleColumns: [].concat(_toConsumableArray(visibleFields), ['actionListActions'])
|
|
314
|
-
})]
|
|
354
|
+
}, restOfMclProps))]
|
|
315
355
|
});
|
|
316
356
|
};
|
|
317
357
|
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _reactIntl = require("react-intl");
|
|
13
|
+
|
|
14
|
+
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
15
|
+
|
|
16
|
+
var _components = require("@folio/stripes/components");
|
|
17
|
+
|
|
18
|
+
var _SearchField = _interopRequireDefault(require("../../SearchField"));
|
|
19
|
+
|
|
20
|
+
var _hooks = require("../../hooks");
|
|
21
|
+
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
(function () {
|
|
27
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
28
|
+
enterModule && enterModule(module);
|
|
29
|
+
})();
|
|
30
|
+
|
|
31
|
+
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; }
|
|
32
|
+
|
|
33
|
+
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; }
|
|
34
|
+
|
|
35
|
+
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; }
|
|
36
|
+
|
|
37
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
38
|
+
|
|
39
|
+
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."); }
|
|
40
|
+
|
|
41
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
42
|
+
|
|
43
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
44
|
+
|
|
45
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
46
|
+
|
|
47
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
48
|
+
|
|
49
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
50
|
+
return a;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var DEBOUNCE_TIME = 500;
|
|
54
|
+
|
|
55
|
+
var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
|
|
56
|
+
var _labelOverrides$label, _labelOverrides$prima, _labelOverrides$ctx, _labelOverrides$weigh, _labelOverrides$type, _labelOverrides$categ;
|
|
57
|
+
|
|
58
|
+
var contextFilterOptions = _ref.contextFilterOptions,
|
|
59
|
+
endpoint = _ref.customPropertiesEndpoint,
|
|
60
|
+
labelOverrides = _ref.labelOverrides,
|
|
61
|
+
mclProps = _ref.mclProps,
|
|
62
|
+
onSelectCustomProperty = _ref.onSelectCustomProperty,
|
|
63
|
+
queryParams = _ref.queryParams;
|
|
64
|
+
|
|
65
|
+
var _useState = (0, _react.useState)({
|
|
66
|
+
sort: 'label'
|
|
67
|
+
}),
|
|
68
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
69
|
+
nsValues = _useState2[0],
|
|
70
|
+
setNsValues = _useState2[1];
|
|
71
|
+
|
|
72
|
+
var _useState3 = (0, _react.useState)(),
|
|
73
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
74
|
+
selectedContext = _useState4[0],
|
|
75
|
+
setSelectedContext = _useState4[1];
|
|
76
|
+
|
|
77
|
+
var _useCustomProperties = (0, _hooks.useCustomProperties)({
|
|
78
|
+
endpoint: endpoint,
|
|
79
|
+
nsValues: nsValues,
|
|
80
|
+
queryParams: queryParams,
|
|
81
|
+
returnQueryObject: true,
|
|
82
|
+
ctx: selectedContext
|
|
83
|
+
}),
|
|
84
|
+
custprops = _useCustomProperties.data,
|
|
85
|
+
isLoading = _useCustomProperties.isLoading;
|
|
86
|
+
|
|
87
|
+
var handleSearch = (0, _debounce.default)(function (query) {
|
|
88
|
+
setNsValues(_objectSpread(_objectSpread({}, nsValues), {}, {
|
|
89
|
+
query: query
|
|
90
|
+
}));
|
|
91
|
+
}, DEBOUNCE_TIME);
|
|
92
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
93
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchField.default, {
|
|
94
|
+
fullWidth: true,
|
|
95
|
+
onChange: function onChange(e) {
|
|
96
|
+
return handleSearch(e.target.value);
|
|
97
|
+
}
|
|
98
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Row, {
|
|
99
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
100
|
+
xs: 6,
|
|
101
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
|
|
102
|
+
dataOptions: contextFilterOptions,
|
|
103
|
+
onChange: function onChange(e) {
|
|
104
|
+
setSelectedContext(e.target.value);
|
|
105
|
+
},
|
|
106
|
+
value: selectedContext
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
}), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
|
|
110
|
+
columnMapping: {
|
|
111
|
+
'label': (_labelOverrides$label = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.label) !== null && _labelOverrides$label !== void 0 ? _labelOverrides$label : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
112
|
+
id: "stripes-kint-components.customProperties.label"
|
|
113
|
+
}),
|
|
114
|
+
'primary': (_labelOverrides$prima = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primary) !== null && _labelOverrides$prima !== void 0 ? _labelOverrides$prima : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
115
|
+
id: "stripes-kint-components.customProperties.primary"
|
|
116
|
+
}),
|
|
117
|
+
'ctx': (_labelOverrides$ctx = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx) !== null && _labelOverrides$ctx !== void 0 ? _labelOverrides$ctx : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
118
|
+
id: "stripes-kint-components.customProperties.ctx"
|
|
119
|
+
}),
|
|
120
|
+
'weight': (_labelOverrides$weigh = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.weight) !== null && _labelOverrides$weigh !== void 0 ? _labelOverrides$weigh : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
121
|
+
id: "stripes-kint-components.customProperties.weight"
|
|
122
|
+
}),
|
|
123
|
+
'type': (_labelOverrides$type = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.type) !== null && _labelOverrides$type !== void 0 ? _labelOverrides$type : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
124
|
+
id: "stripes-kint-components.customProperties.type"
|
|
125
|
+
}),
|
|
126
|
+
'category': (_labelOverrides$categ = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.category) !== null && _labelOverrides$categ !== void 0 ? _labelOverrides$categ : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
127
|
+
id: "stripes-kint-components.customProperties.category"
|
|
128
|
+
})
|
|
129
|
+
},
|
|
130
|
+
contentData: custprops,
|
|
131
|
+
formatter: {
|
|
132
|
+
primary: function primary(data) {
|
|
133
|
+
if (data !== null && data !== void 0 && data.primary) {
|
|
134
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
135
|
+
id: "stripes-kint-components.yes"
|
|
136
|
+
});
|
|
137
|
+
} else {
|
|
138
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
139
|
+
id: "stripes-kint-components.no"
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
type: function type(data) {
|
|
144
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
145
|
+
id: "stripes-kint-components.customProperties.type.".concat(data === null || data === void 0 ? void 0 : data.type)
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
category: function category(data) {
|
|
149
|
+
var _data$category;
|
|
150
|
+
|
|
151
|
+
return data === null || data === void 0 ? void 0 : (_data$category = data.category) === null || _data$category === void 0 ? void 0 : _data$category.desc;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
onRowClick: onSelectCustomProperty,
|
|
155
|
+
visibleColumns: ['label', 'primary', 'ctx', 'weight', 'type', 'category']
|
|
156
|
+
}, mclProps))]
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
__signature__(CustomPropertiesLookup, "useState{[nsValues, setNsValues]({\n sort: 'label'\n })}\nuseState{[selectedContext, setSelectedContext]}\nuseCustomProperties{{ data: custprops, isLoading }}", function () {
|
|
161
|
+
return [_hooks.useCustomProperties];
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
CustomPropertiesLookup.propTypes = {
|
|
165
|
+
contextFilterOptions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
166
|
+
value: _propTypes.default.string,
|
|
167
|
+
label: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.string])
|
|
168
|
+
})),
|
|
169
|
+
customPropertiesEndpoint: _propTypes.default.string,
|
|
170
|
+
labelOverrides: _propTypes.default.object,
|
|
171
|
+
mclProps: _propTypes.default.object,
|
|
172
|
+
onSelectCustomProperty: _propTypes.default.func,
|
|
173
|
+
queryParams: _propTypes.default.object,
|
|
174
|
+
refdataEndpoint: _propTypes.default.string
|
|
175
|
+
};
|
|
176
|
+
var _default = CustomPropertiesLookup;
|
|
177
|
+
var _default2 = _default;
|
|
178
|
+
exports.default = _default2;
|
|
179
|
+
;
|
|
180
|
+
|
|
181
|
+
(function () {
|
|
182
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
183
|
+
|
|
184
|
+
if (!reactHotLoader) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
reactHotLoader.register(DEBOUNCE_TIME, "DEBOUNCE_TIME", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertiesLookup.js");
|
|
189
|
+
reactHotLoader.register(CustomPropertiesLookup, "CustomPropertiesLookup", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertiesLookup.js");
|
|
190
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertiesLookup.js");
|
|
191
|
+
})();
|
|
192
|
+
|
|
193
|
+
;
|
|
194
|
+
|
|
195
|
+
(function () {
|
|
196
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
197
|
+
leaveModule && leaveModule(module);
|
|
198
|
+
})();
|