@k-int/stripes-kint-components 2.2.0 → 2.3.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 -0
- package/es/index.js +124 -4
- package/es/lib/ActionList/ActionList.js +7 -2
- package/es/lib/ActionList/ActionListFieldArray.js +49 -10
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +2 -2
- package/es/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +5 -5
- package/es/lib/CustomProperties/Config/index.js +6 -4
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +72 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +133 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +279 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +370 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +156 -0
- package/es/lib/CustomProperties/Edit/index.js +51 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +216 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +236 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +159 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +119 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +173 -0
- package/es/lib/CustomProperties/Filter/index.js +59 -0
- package/es/lib/CustomProperties/Filter/useOperators.js +138 -0
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +97 -0
- package/es/lib/CustomProperties/Filter/useValueProps.js +101 -0
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +73 -0
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +187 -0
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +204 -0
- package/es/lib/CustomProperties/View/index.js +35 -0
- package/es/lib/CustomProperties/index.js +125 -0
- package/es/lib/EditableRefdataList/EditableRefdataList.js +12 -16
- package/es/lib/FormModal/FormModal.js +18 -4
- package/es/lib/QueryTypedown/QueryTypedown.js +9 -4
- package/es/lib/constants/customProperties.js +4 -1
- package/es/lib/hooks/index.js +16 -0
- package/es/lib/hooks/typedownHooks/useTypedownData.js +9 -2
- package/es/lib/hooks/useAvailableCustomProperties.js +106 -0
- package/es/lib/hooks/useInvalidateRefdata.js +53 -0
- package/es/lib/hooks/useMutateRefdataValue.js +11 -6
- package/es/lib/hooks/useRefdata.js +1 -3
- package/es/lib/utils/groupCustomPropertiesByCtx.js +69 -0
- package/es/lib/utils/index.js +24 -0
- package/es/lib/utils/refdataQueryKey.js +48 -0
- package/es/lib/utils/typedownQueryKey.js +48 -0
- package/es/lib/utils/validators.js +60 -1
- package/git_translate.sh +8 -0
- package/package.json +1 -1
- package/src/index.js +27 -3
- package/src/lib/ActionList/ActionList.js +5 -2
- package/src/lib/ActionList/ActionListFieldArray.js +31 -8
- package/src/lib/ActionList/README.md +23 -20
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +2 -2
- package/src/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +3 -3
- package/src/lib/CustomProperties/Config/index.js +1 -1
- package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +35 -0
- package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +85 -0
- package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +194 -0
- package/src/lib/CustomProperties/Edit/CustomPropertyField.js +299 -0
- package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +131 -0
- package/src/lib/CustomProperties/Edit/index.js +5 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +125 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +148 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +113 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +74 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +122 -0
- package/src/lib/CustomProperties/Filter/index.js +6 -0
- package/src/lib/CustomProperties/Filter/useOperators.js +55 -0
- package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +35 -0
- package/src/lib/CustomProperties/Filter/useValueProps.js +45 -0
- package/src/lib/CustomProperties/View/CustomPropertiesView.js +36 -0
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +112 -0
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +177 -0
- package/src/lib/CustomProperties/View/index.js +3 -0
- package/src/lib/CustomProperties/index.js +30 -0
- package/src/lib/EditableRefdataList/EditableRefdataList.js +13 -10
- package/src/lib/FormModal/FormModal.js +37 -17
- package/src/lib/QueryTypedown/QueryTypedown.js +3 -1
- package/src/lib/constants/customProperties.js +1 -0
- package/src/lib/hooks/index.js +2 -0
- package/src/lib/hooks/typedownHooks/useTypedownData.js +9 -3
- package/src/lib/hooks/useAvailableCustomProperties.js +40 -0
- package/src/lib/hooks/useInvalidateRefdata.js +11 -0
- package/src/lib/hooks/useMutateRefdataValue.js +7 -3
- package/src/lib/hooks/useRefdata.js +2 -3
- package/src/lib/utils/groupCustomPropertiesByCtx.js +13 -0
- package/src/lib/utils/index.js +5 -0
- package/src/lib/utils/refdataQueryKey.js +9 -0
- package/src/lib/utils/typedownQueryKey.js +9 -0
- package/src/lib/utils/validators.js +40 -0
- package/translate.sh +63 -0
- package/translations/stripes-kint-components/ar.json +105 -0
- package/translations/stripes-kint-components/ca.json +1 -0
- package/translations/stripes-kint-components/cs_CZ.json +105 -0
- package/translations/stripes-kint-components/da.json +1 -0
- package/translations/stripes-kint-components/de.json +105 -0
- package/translations/stripes-kint-components/en.json +54 -2
- package/translations/stripes-kint-components/es.json +105 -0
- package/translations/stripes-kint-components/fr.json +105 -0
- package/translations/stripes-kint-components/he.json +1 -0
- package/translations/stripes-kint-components/hi_IN.json +105 -0
- package/translations/stripes-kint-components/hu.json +105 -0
- package/translations/stripes-kint-components/it_IT.json +105 -0
- package/translations/stripes-kint-components/ja.json +105 -0
- package/translations/stripes-kint-components/ko.json +105 -0
- package/translations/stripes-kint-components/nb.json +1 -0
- package/translations/stripes-kint-components/nn.json +1 -0
- package/translations/stripes-kint-components/pl.json +105 -0
- package/translations/stripes-kint-components/pt_PT.json +105 -0
- package/translations/stripes-kint-components/ru.json +105 -0
- package/translations/stripes-kint-components/sv.json +105 -0
- package/translations/stripes-kint-components/ur.json +1 -0
- package/translations/stripes-kint-components/zh_CN.json +105 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## 2.3.0 2022-03-25
|
|
2
|
+
* FormModal
|
|
3
|
+
* Ability to override labels for "save" and "cancel"
|
|
4
|
+
* Ability to override whole footer section
|
|
5
|
+
* CustomProperties Edit components:
|
|
6
|
+
* CustomPropertiesEdit
|
|
7
|
+
* CustomPropertiesEditCtx
|
|
8
|
+
* CustomPropertiesListField
|
|
9
|
+
* CustomPropertyField
|
|
10
|
+
* CustomPropertyFormCard
|
|
11
|
+
* useAvailableCustomProperties
|
|
12
|
+
* Refdata hooks and utils
|
|
13
|
+
* useInvalidateRefdata hook
|
|
14
|
+
* refdataQueryKey utility function
|
|
15
|
+
* useRefdata refactored to use the above
|
|
16
|
+
* useMutateRefdata now invalidates query cache after changes
|
|
17
|
+
* QueryTypedown
|
|
18
|
+
* Added "dataFormatter" prop, to allow massaging of data between fetch and injections into Typedown
|
|
19
|
+
* ActionList
|
|
20
|
+
* ActionCalls deprecated in favour of a direct `callback` prop on actionAssigner, and separate createCallback prop.
|
|
21
|
+
* `to` prop on actionAssigner allowing for rendering of <Link/> as opposed to <Button>/<IconButton/>
|
|
1
22
|
## 2.2.0 2022-03-11
|
|
2
23
|
* Fix -- GenerateQueryParams no longer assumes you want EITHER nsValues filters or options filters, it simply adds both to the params array
|
|
3
24
|
* ActionList -- added a hideCreateButton prop for custom rolled solutions
|
package/es/index.js
CHANGED
|
@@ -11,22 +11,100 @@ Object.defineProperty(exports, "ActionList", {
|
|
|
11
11
|
return _ActionList.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
+
Object.defineProperty(exports, "CustomPropertiesEdit", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _CustomProperties.CustomPropertiesEdit;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "CustomPropertiesEditCtx", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _CustomProperties.CustomPropertiesEditCtx;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "CustomPropertiesFilter", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function get() {
|
|
29
|
+
return _CustomProperties.CustomPropertiesFilter;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "CustomPropertiesFilterField", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _CustomProperties.CustomPropertiesFilterField;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "CustomPropertiesFilterFieldArray", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _CustomProperties.CustomPropertiesFilterFieldArray;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "CustomPropertiesFilterForm", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function get() {
|
|
47
|
+
return _CustomProperties.CustomPropertiesFilterForm;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "CustomPropertiesListField", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function get() {
|
|
53
|
+
return _CustomProperties.CustomPropertiesListField;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
14
56
|
Object.defineProperty(exports, "CustomPropertiesLookup", {
|
|
15
57
|
enumerable: true,
|
|
16
58
|
get: function get() {
|
|
17
|
-
return
|
|
59
|
+
return _CustomProperties.CustomPropertiesLookup;
|
|
18
60
|
}
|
|
19
61
|
});
|
|
20
62
|
Object.defineProperty(exports, "CustomPropertiesSettings", {
|
|
21
63
|
enumerable: true,
|
|
22
64
|
get: function get() {
|
|
23
|
-
return
|
|
65
|
+
return _CustomProperties.CustomPropertiesSettings;
|
|
24
66
|
}
|
|
25
67
|
});
|
|
26
68
|
Object.defineProperty(exports, "CustomPropertiesView", {
|
|
27
69
|
enumerable: true,
|
|
28
70
|
get: function get() {
|
|
29
|
-
return
|
|
71
|
+
return _CustomProperties.CustomPropertiesView;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(exports, "CustomPropertiesViewCtx", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function get() {
|
|
77
|
+
return _CustomProperties.CustomPropertiesViewCtx;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "CustomPropertyCard", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function get() {
|
|
83
|
+
return _CustomProperties.CustomPropertyCard;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(exports, "CustomPropertyField", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function get() {
|
|
89
|
+
return _CustomProperties.CustomPropertyField;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, "CustomPropertyForm", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function get() {
|
|
95
|
+
return _CustomProperties.CustomPropertyForm;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, "CustomPropertyFormCard", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function get() {
|
|
101
|
+
return _CustomProperties.CustomPropertyFormCard;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(exports, "CustomPropertyView", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function get() {
|
|
107
|
+
return _CustomProperties.CustomPropertyView;
|
|
30
108
|
}
|
|
31
109
|
});
|
|
32
110
|
Object.defineProperty(exports, "EditableRefdataList", {
|
|
@@ -126,6 +204,12 @@ Object.defineProperty(exports, "generateKiwtQueryParams", {
|
|
|
126
204
|
return _utils.generateKiwtQueryParams;
|
|
127
205
|
}
|
|
128
206
|
});
|
|
207
|
+
Object.defineProperty(exports, "groupCustomPropertiesByCtx", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function get() {
|
|
210
|
+
return _utils.groupCustomPropertiesByCtx;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
129
213
|
Object.defineProperty(exports, "invalidNumber", {
|
|
130
214
|
enumerable: true,
|
|
131
215
|
get: function get() {
|
|
@@ -138,6 +222,12 @@ Object.defineProperty(exports, "refdataOptions", {
|
|
|
138
222
|
return _utils.refdataOptions;
|
|
139
223
|
}
|
|
140
224
|
});
|
|
225
|
+
Object.defineProperty(exports, "refdataQueryKey", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function get() {
|
|
228
|
+
return _utils.refdataQueryKey;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
141
231
|
Object.defineProperty(exports, "required", {
|
|
142
232
|
enumerable: true,
|
|
143
233
|
get: function get() {
|
|
@@ -156,12 +246,24 @@ Object.defineProperty(exports, "selectorSafe", {
|
|
|
156
246
|
return _utils.selectorSafe;
|
|
157
247
|
}
|
|
158
248
|
});
|
|
249
|
+
Object.defineProperty(exports, "typedownQueryKey", {
|
|
250
|
+
enumerable: true,
|
|
251
|
+
get: function get() {
|
|
252
|
+
return _utils.typedownQueryKey;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
159
255
|
Object.defineProperty(exports, "useActiveElement", {
|
|
160
256
|
enumerable: true,
|
|
161
257
|
get: function get() {
|
|
162
258
|
return _hooks.useActiveElement;
|
|
163
259
|
}
|
|
164
260
|
});
|
|
261
|
+
Object.defineProperty(exports, "useAvailableCustomProperties", {
|
|
262
|
+
enumerable: true,
|
|
263
|
+
get: function get() {
|
|
264
|
+
return _hooks.useAvailableCustomProperties;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
165
267
|
Object.defineProperty(exports, "useCustomProperties", {
|
|
166
268
|
enumerable: true,
|
|
167
269
|
get: function get() {
|
|
@@ -174,6 +276,12 @@ Object.defineProperty(exports, "useHelperApp", {
|
|
|
174
276
|
return _hooks.useHelperApp;
|
|
175
277
|
}
|
|
176
278
|
});
|
|
279
|
+
Object.defineProperty(exports, "useInvalidateRefdata", {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
get: function get() {
|
|
282
|
+
return _hooks.useInvalidateRefdata;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
177
285
|
Object.defineProperty(exports, "useKiwtFieldArray", {
|
|
178
286
|
enumerable: true,
|
|
179
287
|
get: function get() {
|
|
@@ -204,6 +312,18 @@ Object.defineProperty(exports, "useMutateRefdataValue", {
|
|
|
204
312
|
return _hooks.useMutateRefdataValue;
|
|
205
313
|
}
|
|
206
314
|
});
|
|
315
|
+
Object.defineProperty(exports, "useOperators", {
|
|
316
|
+
enumerable: true,
|
|
317
|
+
get: function get() {
|
|
318
|
+
return _CustomProperties.useOperators;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
Object.defineProperty(exports, "useParseActiveFilterStrings", {
|
|
322
|
+
enumerable: true,
|
|
323
|
+
get: function get() {
|
|
324
|
+
return _CustomProperties.useParseActiveFilterStrings;
|
|
325
|
+
}
|
|
326
|
+
});
|
|
207
327
|
Object.defineProperty(exports, "useQIndex", {
|
|
208
328
|
enumerable: true,
|
|
209
329
|
get: function get() {
|
|
@@ -261,7 +381,7 @@ var _RefdataButtons = _interopRequireDefault(require("./lib/RefdataButtons"));
|
|
|
261
381
|
|
|
262
382
|
var _FormModal = _interopRequireDefault(require("./lib/FormModal"));
|
|
263
383
|
|
|
264
|
-
var
|
|
384
|
+
var _CustomProperties = require("./lib/CustomProperties");
|
|
265
385
|
|
|
266
386
|
var _customPropertyContants = _interopRequireWildcard(require("./lib/constants/customProperties"));
|
|
267
387
|
|
|
@@ -19,7 +19,7 @@ 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", "hideCreateButton", "visibleFields"];
|
|
22
|
+
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "createCallback", "editableFields", "fieldComponents", "hideCreateButton", "visibleFields"];
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
@@ -48,6 +48,7 @@ var propTypes = {
|
|
|
48
48
|
columnMapping: _propTypes.default.object,
|
|
49
49
|
contentData: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
50
50
|
creatableFields: _propTypes.default.object,
|
|
51
|
+
createCallback: _propTypes.default.func,
|
|
51
52
|
editableFields: _propTypes.default.object,
|
|
52
53
|
fieldComponents: _propTypes.default.object,
|
|
53
54
|
hideCreateButton: _propTypes.default.bool,
|
|
@@ -62,6 +63,7 @@ var ActionList = function ActionList(_ref) {
|
|
|
62
63
|
contentData = _ref.contentData,
|
|
63
64
|
_ref$creatableFields = _ref.creatableFields,
|
|
64
65
|
creatableFields = _ref$creatableFields === void 0 ? {} : _ref$creatableFields,
|
|
66
|
+
createCallback = _ref.createCallback,
|
|
65
67
|
_ref$editableFields = _ref.editableFields,
|
|
66
68
|
editableFields = _ref$editableFields === void 0 ? {} : _ref$editableFields,
|
|
67
69
|
_ref$fieldComponents = _ref.fieldComponents,
|
|
@@ -77,7 +79,9 @@ var ActionList = function ActionList(_ref) {
|
|
|
77
79
|
contentData: contentData
|
|
78
80
|
},
|
|
79
81
|
mutators: _finalFormArrays.default,
|
|
80
|
-
onSubmit:
|
|
82
|
+
onSubmit: function onSubmit() {
|
|
83
|
+
return null;
|
|
84
|
+
},
|
|
81
85
|
subscription: {
|
|
82
86
|
contentData: true
|
|
83
87
|
},
|
|
@@ -92,6 +96,7 @@ var ActionList = function ActionList(_ref) {
|
|
|
92
96
|
columnMapping: columnMapping,
|
|
93
97
|
component: _ActionListFieldArray.default,
|
|
94
98
|
creatableFields: creatableFields,
|
|
99
|
+
createCallback: createCallback,
|
|
95
100
|
editableFields: editableFields,
|
|
96
101
|
fieldComponents: fieldComponents,
|
|
97
102
|
hideCreateButton: hideCreateButton,
|
|
@@ -23,7 +23,7 @@ var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/Acti
|
|
|
23
23
|
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "editableFields", "fields", "fieldComponents", "hideCreateButton", "visibleFields"],
|
|
26
|
+
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "createCallback", "editableFields", "fields", "fieldComponents", "hideCreateButton", "visibleFields"],
|
|
27
27
|
_excluded2 = ["actionListActions"],
|
|
28
28
|
_excluded3 = ["actionListActions"],
|
|
29
29
|
_excluded4 = ["actionListActions"],
|
|
@@ -84,6 +84,7 @@ var propTypes = {
|
|
|
84
84
|
actionCalls: _propTypes.default.object,
|
|
85
85
|
columnMapping: _propTypes.default.object,
|
|
86
86
|
creatableFields: _propTypes.default.object,
|
|
87
|
+
createCallback: _propTypes.default.func,
|
|
87
88
|
editableFields: _propTypes.default.object,
|
|
88
89
|
fields: _propTypes.default.object,
|
|
89
90
|
fieldComponents: _propTypes.default.object,
|
|
@@ -97,6 +98,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
97
98
|
actionCalls = _ref.actionCalls,
|
|
98
99
|
columnMapping = _ref.columnMapping,
|
|
99
100
|
creatableFields = _ref.creatableFields,
|
|
101
|
+
createCallback = _ref.createCallback,
|
|
100
102
|
editableFields = _ref.editableFields,
|
|
101
103
|
fields = _ref.fields,
|
|
102
104
|
fieldComponents = _ref.fieldComponents,
|
|
@@ -135,11 +137,22 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
135
137
|
};
|
|
136
138
|
|
|
137
139
|
var handleSave = function handleSave(index) {
|
|
140
|
+
var _actionAssigner$find;
|
|
141
|
+
|
|
138
142
|
var _fields$value$index = fields.value[index],
|
|
139
143
|
_a = _fields$value$index.actionListActions,
|
|
140
|
-
rowData = _objectWithoutProperties(_fields$value$index, _excluded2);
|
|
144
|
+
rowData = _objectWithoutProperties(_fields$value$index, _excluded2); // Find "edit" entry in actionAssigner
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
var editCallback = (_actionAssigner$find = actionAssigner.find(function (act) {
|
|
148
|
+
return act.name === 'edit';
|
|
149
|
+
})) === null || _actionAssigner$find === void 0 ? void 0 : _actionAssigner$find.callback;
|
|
141
150
|
|
|
142
|
-
|
|
151
|
+
if (editCallback) {
|
|
152
|
+
editCallback(rowData);
|
|
153
|
+
} else {
|
|
154
|
+
actionCalls.edit(rowData); // DEPRECATED
|
|
155
|
+
}
|
|
143
156
|
};
|
|
144
157
|
|
|
145
158
|
var handleCreate = function handleCreate(index) {
|
|
@@ -147,7 +160,11 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
147
160
|
_a = _fields$value$index2.actionListActions,
|
|
148
161
|
rowData = _objectWithoutProperties(_fields$value$index2, _excluded3);
|
|
149
162
|
|
|
150
|
-
|
|
163
|
+
if (createCallback) {
|
|
164
|
+
createCallback(rowData);
|
|
165
|
+
} else {
|
|
166
|
+
actionCalls.create(rowData); // DEPRECATED
|
|
167
|
+
}
|
|
151
168
|
};
|
|
152
169
|
|
|
153
170
|
var getColumnWidths = function getColumnWidths() {
|
|
@@ -211,9 +228,20 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
211
228
|
children: actions === null || actions === void 0 ? void 0 : actions.map(function (action) {
|
|
212
229
|
var _action$label;
|
|
213
230
|
|
|
214
|
-
var actionFunction
|
|
215
|
-
|
|
216
|
-
|
|
231
|
+
var actionFunction;
|
|
232
|
+
|
|
233
|
+
if (action.callback) {
|
|
234
|
+
actionFunction = function actionFunction() {
|
|
235
|
+
return action.callback(rest);
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (!actionFunction && actionCalls[action.name]) {
|
|
240
|
+
actionFunction = function actionFunction() {
|
|
241
|
+
return actionCalls[action.name](rest);
|
|
242
|
+
}; // DEPRECATED
|
|
243
|
+
|
|
244
|
+
} // Edit has special action functionality, revealing fields etc.
|
|
217
245
|
|
|
218
246
|
|
|
219
247
|
if (action.name === 'edit') {
|
|
@@ -228,7 +256,12 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
228
256
|
disabled: editing,
|
|
229
257
|
icon: action.icon,
|
|
230
258
|
marginBottom0: true,
|
|
231
|
-
onClick:
|
|
259
|
+
onClick: function onClick() {
|
|
260
|
+
return actionFunction ? actionFunction() : function () {
|
|
261
|
+
return null;
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
to: action.to
|
|
232
265
|
}, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
|
|
233
266
|
} // Else return a button with the label, or failing that the name of the action
|
|
234
267
|
|
|
@@ -236,7 +269,12 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
236
269
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
237
270
|
disabled: editing,
|
|
238
271
|
marginBottom0: true,
|
|
239
|
-
onClick:
|
|
272
|
+
onClick: function onClick() {
|
|
273
|
+
return actionFunction ? actionFunction() : function () {
|
|
274
|
+
return null;
|
|
275
|
+
};
|
|
276
|
+
},
|
|
277
|
+
to: action.to,
|
|
240
278
|
children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
|
|
241
279
|
}, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
|
|
242
280
|
})
|
|
@@ -333,7 +371,8 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
333
371
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
334
372
|
children: [!hideCreateButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
335
373
|
buttonClass: _ActionListFieldArray.default.buttonRight,
|
|
336
|
-
disabled: !actionCalls.create
|
|
374
|
+
disabled: !actionCalls.create && !createCallback // DEPRECATED actionCalls
|
|
375
|
+
,
|
|
337
376
|
onClick: function onClick() {
|
|
338
377
|
toggleEditing('NEW_ROW');
|
|
339
378
|
fields.push({});
|
|
@@ -23,7 +23,7 @@ var _FormModal = _interopRequireDefault(require("../../FormModal/FormModal"));
|
|
|
23
23
|
|
|
24
24
|
var _CustomPropertiesLookup = _interopRequireDefault(require("./CustomPropertiesLookup"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _CustomPropertyView = _interopRequireDefault(require("./CustomPropertyView"));
|
|
27
27
|
|
|
28
28
|
var _CustomPropertyForm = _interopRequireDefault(require("./CustomPropertyForm"));
|
|
29
29
|
|
|
@@ -222,7 +222,7 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
|
|
|
222
222
|
return setCustomProperty();
|
|
223
223
|
},
|
|
224
224
|
paneTitle: (_ref3 = (_renderViewPaneTitle = renderViewPaneTitle) !== null && _renderViewPaneTitle !== void 0 ? _renderViewPaneTitle : customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _ref3 !== void 0 ? _ref3 : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name,
|
|
225
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
225
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyView.default, {
|
|
226
226
|
customProperty: customProperty,
|
|
227
227
|
labelOverrides: labelOverrides
|
|
228
228
|
})
|
|
@@ -27,7 +27,7 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// A default option for CustProp view pane, with the ability to override labels for fields
|
|
30
|
-
var
|
|
30
|
+
var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
31
31
|
var _labelOverrides$label, _labelOverrides$name, _labelOverrides$descr, _labelOverrides$prima, _labelOverrides$retir, _labelOverrides$weigh, _labelOverrides$defau, _labelOverrides$ctx, _customProperty$ctx, _labelOverrides$type, _labelOverrides$categ, _customProperty$categ, _customProperty$categ2;
|
|
32
32
|
|
|
33
33
|
var customProperty = _ref.customProperty,
|
|
@@ -137,7 +137,7 @@ var CustomPropertiesView = function CustomPropertiesView(_ref) {
|
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
CustomPropertyView.propTypes = {
|
|
141
141
|
customProperty: _propTypes.default.shape({
|
|
142
142
|
id: _propTypes.default.string,
|
|
143
143
|
label: _propTypes.default.string,
|
|
@@ -155,7 +155,7 @@ CustomPropertiesView.propTypes = {
|
|
|
155
155
|
}),
|
|
156
156
|
labelOverrides: _propTypes.default.object
|
|
157
157
|
};
|
|
158
|
-
var _default =
|
|
158
|
+
var _default = CustomPropertyView;
|
|
159
159
|
var _default2 = _default;
|
|
160
160
|
exports.default = _default2;
|
|
161
161
|
;
|
|
@@ -167,8 +167,8 @@ exports.default = _default2;
|
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
reactHotLoader.register(
|
|
171
|
-
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/
|
|
170
|
+
reactHotLoader.register(CustomPropertyView, "CustomPropertyView", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertyView.js");
|
|
171
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertyView.js");
|
|
172
172
|
})();
|
|
173
173
|
|
|
174
174
|
;
|
|
@@ -15,21 +15,23 @@ Object.defineProperty(exports, "CustomPropertiesSettings", {
|
|
|
15
15
|
return _CustomPropertiesSettings.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "CustomPropertyForm", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _CustomPropertyForm.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "CustomPropertyView", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function get() {
|
|
27
|
-
return
|
|
27
|
+
return _CustomPropertyView.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
var _CustomPropertiesLookup = _interopRequireDefault(require("./CustomPropertiesLookup"));
|
|
32
32
|
|
|
33
|
+
var _CustomPropertyView = _interopRequireDefault(require("./CustomPropertyView"));
|
|
34
|
+
|
|
33
35
|
var _CustomPropertiesSettings = _interopRequireDefault(require("./CustomPropertiesSettings"));
|
|
34
36
|
|
|
35
37
|
var _CustomPropertyForm = _interopRequireDefault(require("./CustomPropertyForm"));
|
|
@@ -0,0 +1,72 @@
|
|
|
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 _CustomPropertiesEditCtx = _interopRequireDefault(require("./CustomPropertiesEditCtx"));
|
|
11
|
+
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
(function () {
|
|
17
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
18
|
+
enterModule && enterModule(module);
|
|
19
|
+
})();
|
|
20
|
+
|
|
21
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var CustomPropertiesEdit = function CustomPropertiesEdit(_ref) {
|
|
26
|
+
var _ref$contexts = _ref.contexts,
|
|
27
|
+
contexts = _ref$contexts === void 0 ? [] : _ref$contexts,
|
|
28
|
+
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
29
|
+
id = _ref.id,
|
|
30
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
31
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
32
|
+
nameOverride = _ref.nameOverride;
|
|
33
|
+
return contexts.map(function (ctx) {
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesEditCtx.default, {
|
|
35
|
+
ctx: ctx,
|
|
36
|
+
customPropertiesEndpoint: customPropertiesEndpoint,
|
|
37
|
+
id: id,
|
|
38
|
+
labelOverrides: labelOverrides,
|
|
39
|
+
nameOverride: nameOverride
|
|
40
|
+
}, "customPropertiesEdit-".concat(ctx));
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
CustomPropertiesEdit.propTypes = {
|
|
45
|
+
contexts: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
46
|
+
customPropertiesEndpoint: _propTypes.default.string,
|
|
47
|
+
id: _propTypes.default.string,
|
|
48
|
+
labelOverrides: _propTypes.default.object,
|
|
49
|
+
nameOverride: _propTypes.default.string
|
|
50
|
+
};
|
|
51
|
+
var _default = CustomPropertiesEdit;
|
|
52
|
+
var _default2 = _default;
|
|
53
|
+
exports.default = _default2;
|
|
54
|
+
;
|
|
55
|
+
|
|
56
|
+
(function () {
|
|
57
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
58
|
+
|
|
59
|
+
if (!reactHotLoader) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
reactHotLoader.register(CustomPropertiesEdit, "CustomPropertiesEdit", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js");
|
|
64
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js");
|
|
65
|
+
})();
|
|
66
|
+
|
|
67
|
+
;
|
|
68
|
+
|
|
69
|
+
(function () {
|
|
70
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
71
|
+
leaveModule && leaveModule(module);
|
|
72
|
+
})();
|
|
@@ -0,0 +1,133 @@
|
|
|
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 _reactIntl = require("react-intl");
|
|
11
|
+
|
|
12
|
+
var _components = require("@folio/stripes/components");
|
|
13
|
+
|
|
14
|
+
var _CustomPropertiesListField = _interopRequireDefault(require("./CustomPropertiesListField"));
|
|
15
|
+
|
|
16
|
+
var _hooks = require("../../hooks");
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
(function () {
|
|
23
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
24
|
+
enterModule && enterModule(module);
|
|
25
|
+
})();
|
|
26
|
+
|
|
27
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
28
|
+
return a;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var CustomPropertiesEditCtx = function CustomPropertiesEditCtx(_ref) {
|
|
32
|
+
var ctx = _ref.ctx,
|
|
33
|
+
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
34
|
+
id = _ref.id,
|
|
35
|
+
labelOverrides = _ref.labelOverrides,
|
|
36
|
+
nameOverride = _ref.nameOverride;
|
|
37
|
+
|
|
38
|
+
// Deal with all the possible label override options
|
|
39
|
+
var getAccordionLabel = function getAccordionLabel() {
|
|
40
|
+
var _labelOverrides$defau;
|
|
41
|
+
|
|
42
|
+
// Special case for null context
|
|
43
|
+
if (ctx === 'isNull') {
|
|
44
|
+
var _labelOverrides$noCon;
|
|
45
|
+
|
|
46
|
+
return (_labelOverrides$noCon = labelOverrides.noContext) !== null && _labelOverrides$noCon !== void 0 ? _labelOverrides$noCon : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
47
|
+
id: "stripes-kint-components.customProperties"
|
|
48
|
+
});
|
|
49
|
+
} // Label overrides for specific contexts
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if (labelOverrides[ctx]) {
|
|
53
|
+
return labelOverrides[ctx];
|
|
54
|
+
} // Label override for default title, taking ctx into account
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
if (labelOverrides.defaultTitle && typeof labelOverrides.defaultTitle === 'function') {
|
|
58
|
+
return labelOverrides.defaultTitle(ctx);
|
|
59
|
+
} // Label override for default title or finally built in default
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
return (_labelOverrides$defau = labelOverrides.defaultTitle) !== null && _labelOverrides$defau !== void 0 ? _labelOverrides$defau : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
63
|
+
id: "stripes-kint-components.customProperties.ctx.title",
|
|
64
|
+
values: {
|
|
65
|
+
ctx: ctx
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var _useCustomProperties = (0, _hooks.useCustomProperties)({
|
|
71
|
+
ctx: ctx,
|
|
72
|
+
endpoint: customPropertiesEndpoint,
|
|
73
|
+
returnQueryObject: true,
|
|
74
|
+
options: {
|
|
75
|
+
filters: [{
|
|
76
|
+
path: 'retired',
|
|
77
|
+
comparator: '!=',
|
|
78
|
+
value: 'true'
|
|
79
|
+
}]
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
custprops = _useCustomProperties.data,
|
|
83
|
+
isLoading = _useCustomProperties.isLoading;
|
|
84
|
+
|
|
85
|
+
if (isLoading) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return custprops.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
90
|
+
id: "".concat(id, "-accordion-").concat(ctx),
|
|
91
|
+
label: getAccordionLabel(),
|
|
92
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesListField.default, {
|
|
93
|
+
ctx: ctx,
|
|
94
|
+
customProperties: custprops,
|
|
95
|
+
labelOverrides: labelOverrides,
|
|
96
|
+
name: nameOverride !== null && nameOverride !== void 0 ? nameOverride : 'customProperties'
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
__signature__(CustomPropertiesEditCtx, "useCustomProperties{{ data: custprops, isLoading }}", function () {
|
|
102
|
+
return [_hooks.useCustomProperties];
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
CustomPropertiesEditCtx.propTypes = {
|
|
106
|
+
ctx: _propTypes.default.string,
|
|
107
|
+
customPropertiesEndpoint: _propTypes.default.string,
|
|
108
|
+
id: _propTypes.default.string,
|
|
109
|
+
labelOverrides: _propTypes.default.object,
|
|
110
|
+
nameOverride: _propTypes.default.string
|
|
111
|
+
};
|
|
112
|
+
var _default = CustomPropertiesEditCtx;
|
|
113
|
+
var _default2 = _default;
|
|
114
|
+
exports.default = _default2;
|
|
115
|
+
;
|
|
116
|
+
|
|
117
|
+
(function () {
|
|
118
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
119
|
+
|
|
120
|
+
if (!reactHotLoader) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
reactHotLoader.register(CustomPropertiesEditCtx, "CustomPropertiesEditCtx", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js");
|
|
125
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js");
|
|
126
|
+
})();
|
|
127
|
+
|
|
128
|
+
;
|
|
129
|
+
|
|
130
|
+
(function () {
|
|
131
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
132
|
+
leaveModule && leaveModule(module);
|
|
133
|
+
})();
|