@k-int/stripes-kint-components 2.6.5 → 2.7.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +15 -12
  2. package/es/index.js +24 -0
  3. package/es/lib/ActionList/ActionList.js +6 -2
  4. package/es/lib/ActionList/ActionListFieldArray.js +39 -16
  5. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +2 -1
  6. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +2 -1
  7. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +2 -1
  8. package/es/lib/CustomProperties/Config/CustomPropertyView.js +2 -1
  9. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +2 -1
  10. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +2 -1
  11. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +2 -1
  12. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +2 -1
  13. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +2 -1
  14. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +2 -1
  15. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +2 -1
  16. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +3 -2
  17. package/es/lib/CustomProperties/View/CustomPropertyCard.js +2 -1
  18. package/es/lib/CycleButton/CycleButton.js +81 -0
  19. package/es/lib/CycleButton/index.js +15 -0
  20. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +281 -0
  21. package/es/lib/EditableRefdataCategoryList/index.js +15 -0
  22. package/es/lib/EditableRefdataList/EditableRefdataList.js +2 -1
  23. package/es/lib/IconSelect/IconSelect.js +183 -0
  24. package/es/lib/IconSelect/index.js +15 -0
  25. package/es/lib/hooks/index.js +8 -0
  26. package/es/lib/hooks/useMutateRefdataCategory.js +108 -0
  27. package/es/lib/utils/refdataOptions.js +3 -0
  28. package/package.json +1 -1
  29. package/src/index.js +4 -0
  30. package/src/lib/ActionList/ActionList.js +4 -1
  31. package/src/lib/ActionList/ActionListFieldArray.js +36 -13
  32. package/src/lib/ActionList/README.md +11 -8
  33. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +1 -1
  34. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +1 -1
  35. package/src/lib/CustomProperties/Config/CustomPropertyForm.js +1 -1
  36. package/src/lib/CustomProperties/Config/CustomPropertyView.js +1 -1
  37. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +1 -1
  38. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +1 -1
  39. package/src/lib/CustomProperties/Edit/CustomPropertyField.js +1 -1
  40. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +1 -1
  41. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +1 -1
  42. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +1 -1
  43. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +1 -1
  44. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +2 -3
  45. package/src/lib/CustomProperties/View/CustomPropertyCard.js +1 -1
  46. package/src/lib/CycleButton/CycleButton.js +43 -0
  47. package/src/lib/CycleButton/README.md +28 -0
  48. package/src/lib/CycleButton/index.js +1 -0
  49. package/src/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +167 -0
  50. package/src/lib/EditableRefdataCategoryList/index.js +1 -0
  51. package/src/lib/EditableRefdataList/EditableRefdataList.js +1 -1
  52. package/src/lib/IconSelect/IconSelect.js +149 -0
  53. package/src/lib/IconSelect/README.md +36 -0
  54. package/src/lib/IconSelect/index.js +1 -0
  55. package/src/lib/hooks/index.js +1 -0
  56. package/src/lib/hooks/useMutateRefdataCategory.js +63 -0
  57. package/src/lib/utils/refdataOptions.js +1 -0
  58. package/styles/CycleButton.css +5 -0
  59. package/styles/IconSelect.css +5 -0
  60. package/translations/stripes-kint-components/ar.json +14 -7
  61. package/translations/stripes-kint-components/cs_CZ.json +14 -7
  62. package/translations/stripes-kint-components/de.json +14 -7
  63. package/translations/stripes-kint-components/en.json +13 -1
  64. package/translations/stripes-kint-components/es.json +14 -7
  65. package/translations/stripes-kint-components/hi_IN.json +121 -1
  66. package/translations/stripes-kint-components/hu.json +14 -7
  67. package/translations/stripes-kint-components/it_IT.json +14 -7
  68. package/translations/stripes-kint-components/ja.json +14 -7
  69. package/translations/stripes-kint-components/ko.json +14 -7
  70. package/translations/stripes-kint-components/pl.json +1 -114
  71. package/translations/stripes-kint-components/pt_PT.json +14 -7
  72. package/translations/stripes-kint-components/ru.json +14 -7
  73. package/translations/stripes-kint-components/sv.json +14 -7
  74. package/translations/stripes-kint-components/zh_CN.json +14 -7
package/CHANGELOG.md CHANGED
@@ -1,17 +1,20 @@
1
- ## 2.6.5 2022-06-22
2
- * Added label override ability for custom property types. Also documentation
1
+ ## 2.7.1 2022-07-06
2
+ * Fixed bug where non-createable fields which were editable would display a field on creation.
3
3
 
4
- ## 2.6.4 2022-06-21
5
- * Custom property weight sorting not working as expected
6
-
7
- ## 2.6.3 2022-06-21
8
- * Null safety issue
9
-
10
- ## 2.6.2 2022-06-21
11
- * Fixed more missing translations issues
12
-
13
- ## 2.6.1 2022-06-21
4
+ ## 2.7.0 2022-07-05
14
5
  * Fixed missing translation issue
6
+ * EditableRefdataCategoryList component set up for ease of refdata category creation/deletion
7
+ * Also exposed useMutateRefdataCategory that it uses under the hood
8
+ * Custom property weight sorting not working as expected
9
+ * Fix aria label null safety in ActionList
10
+ * refdataOptions now sorts by desc by default
11
+ * ActionList
12
+ * autoFocus only applied to first field in editing row.
13
+ * formatter accidentally applied over editing fields
14
+ * validateFields prop to allow validation of fields. Takes an object with keys from `visibleFields` and values which are functions accepting the rowData, and returning a function to be used for validation in final-form.
15
+ * CustomProperties added default `labelOverrides={}` to all components to allow proper modular use without unnecessary props.
16
+ * CycleButton component
17
+ * IconSelect component
15
18
 
16
19
  ## 2.6.0 2022-06-20
17
20
  * UIOA-118 App does not function when code-splitting is enabled - no longer set history when url has not changed
package/es/index.js CHANGED
@@ -107,6 +107,18 @@ Object.defineProperty(exports, "CustomPropertyView", {
107
107
  return _CustomProperties.CustomPropertyView;
108
108
  }
109
109
  });
110
+ Object.defineProperty(exports, "CycleButton", {
111
+ enumerable: true,
112
+ get: function get() {
113
+ return _CycleButton.default;
114
+ }
115
+ });
116
+ Object.defineProperty(exports, "EditableRefdataCategoryList", {
117
+ enumerable: true,
118
+ get: function get() {
119
+ return _EditableRefdataCategoryList.default;
120
+ }
121
+ });
110
122
  Object.defineProperty(exports, "EditableRefdataList", {
111
123
  enumerable: true,
112
124
  get: function get() {
@@ -119,6 +131,12 @@ Object.defineProperty(exports, "FormModal", {
119
131
  return _FormModal.default;
120
132
  }
121
133
  });
134
+ Object.defineProperty(exports, "IconSelect", {
135
+ enumerable: true,
136
+ get: function get() {
137
+ return _IconSelect.default;
138
+ }
139
+ });
122
140
  Object.defineProperty(exports, "NoResultsMessage", {
123
141
  enumerable: true,
124
142
  get: function get() {
@@ -393,6 +411,8 @@ var _ActionList = _interopRequireDefault(require("./lib/ActionList"));
393
411
 
394
412
  var _EditableRefdataList = _interopRequireDefault(require("./lib/EditableRefdataList"));
395
413
 
414
+ var _EditableRefdataCategoryList = _interopRequireDefault(require("./lib/EditableRefdataCategoryList"));
415
+
396
416
  var _Typedown = _interopRequireDefault(require("./lib/Typedown"));
397
417
 
398
418
  var _QueryTypedown = _interopRequireDefault(require("./lib/QueryTypedown"));
@@ -417,6 +437,10 @@ var _customPropertyContants = _interopRequireWildcard(require("./lib/constants/c
417
437
 
418
438
  exports.customPropertyContants = _customPropertyContants;
419
439
 
440
+ var _CycleButton = _interopRequireDefault(require("./lib/CycleButton"));
441
+
442
+ var _IconSelect = _interopRequireDefault(require("./lib/IconSelect"));
443
+
420
444
  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); }
421
445
 
422
446
  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; }
@@ -21,7 +21,7 @@ var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArr
21
21
 
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
 
24
- var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "createCallback", "editableFields", "fieldComponents", "hideCreateButton", "label", "visibleFields"];
24
+ var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "createCallback", "editableFields", "fieldComponents", "hideCreateButton", "label", "validateFields", "visibleFields"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
@@ -67,6 +67,7 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
67
67
  fieldComponents = _ref$fieldComponents === void 0 ? {} : _ref$fieldComponents,
68
68
  hideCreateButton = _ref.hideCreateButton,
69
69
  label = _ref.label,
70
+ validateFields = _ref.validateFields,
70
71
  visibleFields = _ref.visibleFields,
71
72
  mclProps = _objectWithoutProperties(_ref, _excluded);
72
73
 
@@ -89,7 +90,8 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
89
90
  subscription: {
90
91
  contentData: true
91
92
  },
92
- children: function children() {
93
+ children: function children(_ref2) {
94
+ var handleSubmit = _ref2.handleSubmit;
93
95
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
94
96
  onSubmit: function onSubmit(e) {
95
97
  e.preventDefault();
@@ -106,6 +108,8 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
106
108
  hideCreateButton: hideCreateButton,
107
109
  label: label,
108
110
  name: "contentData",
111
+ triggerFormSubmit: handleSubmit,
112
+ validateFields: validateFields,
109
113
  visibleFields: visibleFields
110
114
  }, mclProps))
111
115
  });
@@ -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", "createCallback", "editableFields", "fields", "fieldComponents", "hideCreateButton", "label", "visibleFields"],
26
+ var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "createCallback", "editableFields", "fields", "fieldComponents", "hideCreateButton", "label", "validateFields", "visibleFields", "triggerFormSubmit"],
27
27
  _excluded2 = ["actionListActions", "fieldName", "fieldIndex"],
28
28
  _excluded3 = ["actionListActions", "fieldName", "fieldIndex"],
29
29
  _excluded4 = ["actionListActions"],
@@ -94,7 +94,9 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
94
94
  _ref$hideCreateButton = _ref.hideCreateButton,
95
95
  hideCreateButton = _ref$hideCreateButton === void 0 ? false : _ref$hideCreateButton,
96
96
  label = _ref.label,
97
+ validateFields = _ref.validateFields,
97
98
  visibleFields = _ref.visibleFields,
99
+ triggerFormSubmit = _ref.triggerFormSubmit,
98
100
  mclProps = _objectWithoutProperties(_ref, _excluded);
99
101
 
100
102
  // Grab finalForm functions/values from form hooks
@@ -102,6 +104,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
102
104
  change = _useForm.change;
103
105
 
104
106
  var _useFormState = (0, _reactFinalForm.useFormState)(),
107
+ hasValidationErrors = _useFormState.hasValidationErrors,
105
108
  initialValues = _useFormState.initialValues,
106
109
  pristine = _useFormState.pristine,
107
110
  submitting = _useFormState.submitting,
@@ -201,14 +204,19 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
201
204
  disabled: submitting || pristine,
202
205
  marginBottom0: true,
203
206
  onClick: function onClick() {
204
- if (!data.id && editing === 'NEW_ROW') {
205
- handleCreate(data.rowIndex);
206
- } else {
207
- handleSave(data.rowIndex);
208
- }
207
+ triggerFormSubmit(); // This is set up as () => null in ActionList, so essentially only acts here to force validation
208
+
209
+ if (!hasValidationErrors) {
210
+ if (!data.id && editing === 'NEW_ROW') {
211
+ handleCreate(data.rowIndex);
212
+ } else {
213
+ handleSave(data.rowIndex);
214
+ }
209
215
 
210
- toggleEditing(data.id);
216
+ toggleEditing(data.id);
217
+ }
211
218
  },
219
+ type: "submit",
212
220
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
213
221
  id: "stripes-kint-components.actionList.save"
214
222
  })
@@ -255,12 +263,24 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
255
263
  actionFunction = function actionFunction() {
256
264
  return toggleEditing(data.id);
257
265
  };
266
+ }
267
+
268
+ var ariaLabel = "action-".concat(action.name, "[").concat(data.rowIndex, "]");
269
+
270
+ if (action !== null && action !== void 0 && action.ariaLabel) {
271
+ if (typeof action.ariaLabel === 'function') {
272
+ ariaLabel = action.ariaLabel(data);
273
+ } else if (typeof action.ariaLabel === 'string') {
274
+ ariaLabel = action.ariaLabel;
275
+ } else {
276
+ throw new Error("Provided ariaLabel for action \"".concat(action.name, "\" must be a function or a string."));
277
+ }
258
278
  } // If we're handed an icon, use that for the action button
259
279
 
260
280
 
261
281
  if (action.icon) {
262
282
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
263
- ariaLabel: action === null || action === void 0 ? void 0 : action.ariaLabel(data),
283
+ ariaLabel: ariaLabel,
264
284
  disabled: editing,
265
285
  icon: action.icon,
266
286
  onClick: function onClick() {
@@ -274,6 +294,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
274
294
 
275
295
 
276
296
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
297
+ ariaLabel: ariaLabel,
277
298
  disabled: editing,
278
299
  marginBottom0: true,
279
300
  onClick: function onClick() {
@@ -306,7 +327,9 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
306
327
 
307
328
  var fieldAwareFormatter = function fieldAwareFormatter() {
308
329
  var returnObj = {}; // For each visible field, if it's being edited then ignore passed formatters, else use them
330
+ // Track whether we've autoFocused on a field yet
309
331
 
332
+ var autoFocus = true;
310
333
  visibleFields.forEach(function (key) {
311
334
  returnObj[key] = function (cd) {
312
335
  // Row is being edited if it has no id, or its id is in the editing string
@@ -335,23 +358,23 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
335
358
  true => Field, false => display value
336
359
  */
337
360
 
338
- if (!cd.id && createFunction(cd) || editFunction(cd)) {
361
+ if (!cd.id && createFunction(cd) || !!cd.id && editFunction(cd)) {
362
+ var validateFunction = validateFields !== null && validateFields !== void 0 && validateFields[key] ? validateFields === null || validateFields === void 0 ? void 0 : validateFields[key](cd) : null;
339
363
  returnValue = fieldComponents[key] ? fieldComponents[key]({
340
364
  name: "".concat(cd.fieldName, ".").concat(key)
341
365
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
342
- autoFocus: cd.fieldIndex === 0,
366
+ autoFocus: autoFocus,
343
367
  component: _components.TextField,
344
368
  marginBottom0: true,
345
369
  name: "".concat(cd.fieldName, ".").concat(key),
346
370
  parse: function parse(v) {
347
371
  return v;
348
- }
349
- });
350
- }
351
- }
372
+ },
373
+ validate: validateFunction
374
+ }); // After first field, every other field should not autofocus
352
375
 
353
- if (formatter !== null && formatter !== void 0 && formatter[key]) {
354
- returnValue = formatter[key](cd);
376
+ autoFocus = false;
377
+ }
355
378
  }
356
379
 
357
380
  return returnValue;
@@ -48,7 +48,8 @@ var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
48
48
 
49
49
  var contextFilterOptions = _ref.contextFilterOptions,
50
50
  endpoint = _ref.customPropertiesEndpoint,
51
- labelOverrides = _ref.labelOverrides,
51
+ _ref$labelOverrides = _ref.labelOverrides,
52
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
52
53
  mclProps = _ref.mclProps,
53
54
  onSelectCustomProperty = _ref.onSelectCustomProperty,
54
55
  queryParams = _ref.queryParams;
@@ -71,7 +71,8 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
71
71
  contextFilterOptions = _ref.contextFilterOptions,
72
72
  customPropertiesEndpoint = _ref.customPropertiesEndpoint,
73
73
  helpPopovers = _ref.helpPopovers,
74
- labelOverrides = _ref.labelOverrides,
74
+ _ref$labelOverrides = _ref.labelOverrides,
75
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
75
76
  refdataEndpoint = _ref.refdataEndpoint;
76
77
  var callout = (0, _react.useContext)(_core.CalloutContext);
77
78
  var queryClient = (0, _reactQuery.useQueryClient)();
@@ -48,7 +48,8 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
48
48
 
49
49
  var contextFilterOptions = _ref.contextFilterOptions,
50
50
  helpPopovers = _ref.helpPopovers,
51
- labelOverrides = _ref.labelOverrides,
51
+ _ref$labelOverrides = _ref.labelOverrides,
52
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
52
53
  refdata = _ref.refdata;
53
54
 
54
55
  var _useFormState = (0, _reactFinalForm.useFormState)(),
@@ -23,7 +23,8 @@ var CustomPropertyView = function CustomPropertyView(_ref) {
23
23
 
24
24
  var customProperty = _ref.customProperty,
25
25
  helpPopovers = _ref.helpPopovers,
26
- labelOverrides = _ref.labelOverrides;
26
+ _ref$labelOverrides = _ref.labelOverrides,
27
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
27
28
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
28
29
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
29
30
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
@@ -23,7 +23,8 @@ var CustomPropertiesEditCtx = function CustomPropertiesEditCtx(_ref) {
23
23
  var ctx = _ref.ctx,
24
24
  customPropertiesEndpoint = _ref.customPropertiesEndpoint,
25
25
  id = _ref.id,
26
- labelOverrides = _ref.labelOverrides,
26
+ _ref$labelOverrides = _ref.labelOverrides,
27
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
27
28
  nameOverride = _ref.nameOverride;
28
29
 
29
30
  // Deal with all the possible label override options
@@ -64,7 +64,8 @@ var CustomPropertiesList = function CustomPropertiesList(_ref) {
64
64
  name = _ref$input.name,
65
65
  onChange = _ref$input.onChange,
66
66
  value = _ref$input.value,
67
- labelOverrides = _ref.labelOverrides,
67
+ _ref$labelOverrides = _ref.labelOverrides,
68
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
68
69
  pristine = _ref.meta.pristine;
69
70
 
70
71
  var _useState = (0, _react.useState)([]),
@@ -51,7 +51,8 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
51
51
  customPropertyType = _ref.customPropertyType,
52
52
  customProperties = _ref.customProperties,
53
53
  index = _ref.index,
54
- labelOverrides = _ref.labelOverrides,
54
+ _ref$labelOverrides = _ref.labelOverrides,
55
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
55
56
  name = _ref.name,
56
57
  _onChange = _ref.onChange,
57
58
  value = _ref.value,
@@ -25,7 +25,8 @@ var CustomPropertyFormCard = function CustomPropertyFormCard(_ref) {
25
25
  handleDeleteCustomProperty = _ref.handleDeleteCustomProperty,
26
26
  index = _ref.index,
27
27
  internalPropertyCounter = _ref.internalPropertyCounter,
28
- labelOverrides = _ref.labelOverrides,
28
+ _ref$labelOverrides = _ref.labelOverrides,
29
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
29
30
  name = _ref.name,
30
31
  onChange = _ref.onChange,
31
32
  setCustomProperties = _ref.setCustomProperties,
@@ -57,7 +57,8 @@ var CustomPropertiesFilter = function CustomPropertiesFilter(_ref) {
57
57
  restOfFilters = _objectWithoutProperties(_ref$activeFilters, _excluded),
58
58
  customPropertiesEndpoint = _ref.customPropertiesEndpoint,
59
59
  filterHandlers = _ref.filterHandlers,
60
- labelOverrides = _ref.labelOverrides;
60
+ _ref$labelOverrides = _ref.labelOverrides,
61
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
61
62
 
62
63
  var _useState = (0, _react.useState)(false),
63
64
  _useState2 = _slicedToArray(_useState, 2),
@@ -25,7 +25,8 @@ var CustomPropertiesFilterFieldArray = function CustomPropertiesFilterFieldArray
25
25
  var _labelOverrides$addFi;
26
26
 
27
27
  var customProperties = _ref.customProperties,
28
- labelOverrides = _ref.labelOverrides;
28
+ _ref$labelOverrides = _ref.labelOverrides,
29
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
29
30
 
30
31
  var _useForm = (0, _reactFinalForm.useForm)(),
31
32
  push = _useForm.mutators.push;
@@ -36,7 +36,8 @@ var CustomPropertyFiltersForm = function CustomPropertyFiltersForm(_ref) {
36
36
  _ref$handlers = _ref.handlers,
37
37
  closeEditModal = _ref$handlers.closeEditModal,
38
38
  openEditModal = _ref$handlers.openEditModal,
39
- labelOverrides = _ref.labelOverrides,
39
+ _ref$labelOverrides = _ref.labelOverrides,
40
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
40
41
  onSubmit = _ref.onSubmit;
41
42
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
42
43
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
@@ -39,7 +39,8 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
39
39
  customProperties = _ref$customProperties === void 0 ? [] : _ref$customProperties,
40
40
  customPropertiesEndpoint = _ref.customPropertiesEndpoint,
41
41
  id = _ref.id,
42
- labelOverrides = _ref.labelOverrides;
42
+ _ref$labelOverrides = _ref.labelOverrides,
43
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
43
44
 
44
45
  // Deal with all the possible label override options
45
46
  var getAccordionLabel = function getAccordionLabel() {
@@ -90,7 +91,7 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
90
91
  }, // Within those groups, sort by weight
91
92
  {
92
93
  path: 'label'
93
- } // For those with the same weight, sort by label
94
+ } //For those with the same weight, sort by label
94
95
  ]
95
96
  }
96
97
  }),
@@ -31,7 +31,8 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
31
31
  _ref$customPropertyDe = _ref.customPropertyDefinition,
32
32
  customPropertyDefinition = _ref$customPropertyDe === void 0 ? {} : _ref$customPropertyDe,
33
33
  index = _ref.index,
34
- labelOverrides = _ref.labelOverrides;
34
+ _ref$labelOverrides = _ref.labelOverrides,
35
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
35
36
  // We only need to display primary and set properties
36
37
  var toDisplay = !!(customPropertyDefinition.primary || customProperty);
37
38
 
@@ -0,0 +1,81 @@
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 _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _components = require("@folio/stripes/components");
15
+
16
+ var _CycleButton = _interopRequireDefault(require("../../../styles/CycleButton.css"));
17
+
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+
20
+ var _excluded = ["className", "onClick"];
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+
24
+ 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; }
25
+
26
+ 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; }
27
+
28
+ 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; }
29
+
30
+ 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; }
31
+
32
+ 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; }
33
+
34
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
35
+
36
+ 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."); }
37
+
38
+ 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); }
39
+
40
+ 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; }
41
+
42
+ 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; }
43
+
44
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45
+
46
+ var CycleButton = function CycleButton(_ref) {
47
+ var buttons = _ref.buttons,
48
+ _ref$startIndex = _ref.startIndex,
49
+ startIndex = _ref$startIndex === void 0 ? 0 : _ref$startIndex;
50
+
51
+ var _useState = (0, _react.useState)(startIndex),
52
+ _useState2 = _slicedToArray(_useState, 2),
53
+ index = _useState2[0],
54
+ setIndex = _useState2[1];
55
+
56
+ var _buttons$index = buttons[index],
57
+ className = _buttons$index.className,
58
+ _onClick = _buttons$index.onClick,
59
+ buttonProps = _objectWithoutProperties(_buttons$index, _excluded);
60
+
61
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, _objectSpread(_objectSpread({}, buttonProps), {}, {
62
+ className: (0, _classnames.default)(className, _CycleButton.default.buttonStyle),
63
+ onClick: function onClick(e) {
64
+ if (_onClick) {
65
+ _onClick(e);
66
+ }
67
+
68
+ setIndex(index !== (buttons === null || buttons === void 0 ? void 0 : buttons.length) - 1 ? index + 1 : 0);
69
+ }
70
+ }));
71
+ };
72
+
73
+ CycleButton.propTypes = {
74
+ buttons: _propTypes.default.arrayOf(_propTypes.default.shape({
75
+ className: _propTypes.default.object,
76
+ icon: _propTypes.default.string.isRequired,
77
+ onClick: _propTypes.default.func.isRequired
78
+ }))
79
+ };
80
+ var _default = CycleButton;
81
+ exports.default = _default;
@@ -0,0 +1,15 @@
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 _CycleButton.default;
10
+ }
11
+ });
12
+
13
+ var _CycleButton = _interopRequireDefault(require("./CycleButton"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }