@k-int/stripes-kint-components 5.2.3 → 5.3.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 (98) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/es/index.js +8 -0
  3. package/es/lib/ActionList/ActionListFieldArray.js +61 -43
  4. package/es/lib/ComboButton/ComboButton.js +6 -5
  5. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +7 -4
  6. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +32 -30
  7. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +58 -58
  8. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +2 -2
  9. package/es/lib/CustomProperties/Config/CustomPropertyView.js +33 -32
  10. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
  11. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +1 -1
  12. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +3 -3
  13. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +10 -5
  14. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +25 -19
  15. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +5 -5
  16. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +2 -2
  17. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +1 -1
  18. package/es/lib/CustomProperties/Edit/testResources.js +12 -11
  19. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +11 -7
  20. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +28 -20
  21. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +1 -1
  22. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +6 -6
  23. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +8 -8
  24. package/es/lib/CustomProperties/Filter/testResources.js +2 -1
  25. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -1
  26. package/es/lib/CustomProperties/View/CustomPropertiesView.js +1 -1
  27. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +26 -19
  28. package/es/lib/CustomProperties/View/CustomPropertyCard.js +11 -7
  29. package/es/lib/CycleButton/CycleButton.js +1 -1
  30. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +82 -29
  31. package/es/lib/EditableRefdataList/EditableRefdataList.js +33 -27
  32. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +1 -1
  33. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +5 -6
  34. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +12 -10
  35. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +0 -1
  36. package/es/lib/EditableSettingsList/SettingField/SettingField.js +4 -4
  37. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +7 -4
  38. package/es/lib/IconSelect/IconSelect.js +9 -5
  39. package/es/lib/NoResultsMessage/NoResultsMessage.js +4 -4
  40. package/es/lib/RefdataButtons/RefdataButtons.js +3 -3
  41. package/es/lib/RefdataCategoriesSettings/RefdataCategoriesSettings.js +158 -0
  42. package/es/lib/RefdataCategoriesSettings/index.js +13 -0
  43. package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +28 -21
  44. package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +6 -5
  45. package/es/lib/RichSelect/RichSelect.js +19 -14
  46. package/es/lib/RichSelect/useSelectedOption.js +2 -1
  47. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +17 -14
  48. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +6 -4
  49. package/es/lib/SASQRoute/SASQRoute.js +2 -2
  50. package/es/lib/SASQViewComponent/SASQViewComponent.js +9 -5
  51. package/es/lib/SettingPage/SettingPagePane.js +2 -2
  52. package/es/lib/SettingsFormContainer/SettingsFormContainer.js +2 -3
  53. package/es/lib/Typedown/Typedown.js +26 -20
  54. package/es/lib/hooks/__mocks__/index.js +4 -0
  55. package/es/lib/hooks/index.js +7 -0
  56. package/es/lib/hooks/typedownHooks/useTypedown.js +2 -2
  57. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +2 -2
  58. package/es/lib/hooks/useActionListRef.js +34 -0
  59. package/es/lib/hooks/useActiveElement.js +1 -1
  60. package/es/lib/hooks/useCustomProperties.js +2 -2
  61. package/es/lib/hooks/useHelperApp.js +6 -6
  62. package/es/lib/hooks/useIntlKeyStore.js +7 -4
  63. package/es/lib/hooks/useKintIntl.js +11 -5
  64. package/es/lib/hooks/useKiwtSASQuery.js +1 -1
  65. package/es/lib/hooks/useModConfigEntries.js +2 -2
  66. package/es/lib/hooks/useMutateCustomProperties.js +8 -8
  67. package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
  68. package/es/lib/hooks/useMutateRefdataCategory.js +4 -4
  69. package/es/lib/hooks/useMutateRefdataValue.js +6 -6
  70. package/es/lib/hooks/useQIndex.js +17 -9
  71. package/es/lib/hooks/useRefdata.js +3 -3
  72. package/es/lib/hooks/useTemplates.js +4 -4
  73. package/es/lib/settingsHooks/useAppSettings.js +11 -7
  74. package/es/lib/settingsHooks/useSettingSection.js +2 -2
  75. package/es/lib/settingsHooks/useSettings.js +3 -3
  76. package/es/lib/utils/buildUrl.js +3 -2
  77. package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
  78. package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +2 -2
  79. package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +5 -4
  80. package/es/lib/utils/filterParsers/parseKiwtQueryString.js +3 -2
  81. package/es/lib/utils/generateKiwtQueryParams.js +37 -28
  82. package/es/lib/utils/groupCustomPropertiesByCtx.js +3 -2
  83. package/es/lib/utils/matchString.js +1 -1
  84. package/es/lib/utils/parseErrorResponse.js +3 -2
  85. package/es/lib/utils/parseModConfigEntry.js +0 -1
  86. package/es/lib/utils/selectorSafe.js +3 -2
  87. package/es/lib/utils/sortByLabel.js +3 -2
  88. package/es/lib/validators/validators.js +3 -3
  89. package/package.json +1 -1
  90. package/src/index.js +3 -0
  91. package/src/lib/ActionList/ActionListFieldArray.js +29 -15
  92. package/src/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +67 -13
  93. package/src/lib/RefdataCategoriesSettings/RefdataCategoriesSettings.js +176 -0
  94. package/src/lib/RefdataCategoriesSettings/index.js +1 -0
  95. package/src/lib/hooks/__mocks__/index.js +4 -0
  96. package/src/lib/hooks/index.js +1 -0
  97. package/src/lib/hooks/useActionListRef.js +36 -0
  98. package/src/lib/hooks/useQIndex.js +12 -4
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [5.3.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.3.0...v5.3.1) (2024-01-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Do not submit qIndex when qIndex string is empty ([a64fe51](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/a64fe5122929d8ebe69b95f90938f581b93cf423))
7
+
8
+ # [5.3.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.2.3...v5.3.0) (2023-12-04)
9
+
10
+
11
+ ### Features
12
+
13
+ * ActionList ([fbf2a30](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/fbf2a3060f1429383489a4ffec2aea243720d1ad))
14
+ * RefdataCategoriesSettings component, improvements to EditableRefdataCategoryList ([a19e503](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/a19e503934b8ff4fbb70aeae0cdcc087fc62a6be))
15
+
1
16
  ## [5.2.3](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.2.2...v5.2.3) (2023-11-03)
2
17
 
3
18
 
package/es/index.js CHANGED
@@ -38,6 +38,7 @@ var _exportNames = {
38
38
  CustomPropertiesFilterFieldArray: true,
39
39
  useOperators: true,
40
40
  useParseActiveFilterStrings: true,
41
+ RefdataCategoriesSettings: true,
41
42
  customPropertyConstants: true,
42
43
  endpoints: true,
43
44
  comparators: true,
@@ -212,6 +213,12 @@ Object.defineProperty(exports, "RefdataButtons", {
212
213
  return _RefdataButtons.default;
213
214
  }
214
215
  });
216
+ Object.defineProperty(exports, "RefdataCategoriesSettings", {
217
+ enumerable: true,
218
+ get: function () {
219
+ return _RefdataCategoriesSettings.default;
220
+ }
221
+ });
215
222
  Object.defineProperty(exports, "ResponsiveButtonGroup", {
216
223
  enumerable: true,
217
224
  get: function () {
@@ -372,6 +379,7 @@ var _NoResultsMessage = _interopRequireDefault(require("./lib/NoResultsMessage")
372
379
  var _RefdataButtons = _interopRequireDefault(require("./lib/RefdataButtons"));
373
380
  var _FormModal = _interopRequireDefault(require("./lib/FormModal"));
374
381
  var _CustomProperties = require("./lib/CustomProperties");
382
+ var _RefdataCategoriesSettings = _interopRequireDefault(require("./lib/RefdataCategoriesSettings"));
375
383
  var _customPropertyConstants = _interopRequireWildcard(require("./lib/constants/customProperties"));
376
384
  exports.customPropertyConstants = _customPropertyConstants;
377
385
  var _endpoints = _interopRequireWildcard(require("./lib/constants/endpoints"));
@@ -43,6 +43,7 @@ const propTypes = {
43
43
 
44
44
  // This needs to be outside of the main component for forwardRef to work properly it seems.
45
45
  const ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
46
+ var _action$label;
46
47
  let {
47
48
  action,
48
49
  ...actionTriggerProps
@@ -58,7 +59,7 @@ const ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
58
59
  ref: ref,
59
60
  marginBottom0: true,
60
61
  ...actionTriggerProps,
61
- children: action.label ?? action.name
62
+ children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
62
63
  });
63
64
  });
64
65
  ActionTrigger.propTypes = {
@@ -68,7 +69,9 @@ ActionTrigger.propTypes = {
68
69
  name: _propTypes.default.string
69
70
  })
70
71
  };
72
+ const NEW_ROW = 'NEW_ROW';
71
73
  const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
74
+ var _fields$value$filter$, _fields$value;
72
75
  let {
73
76
  actionAssigner,
74
77
  columnMapping,
@@ -107,24 +110,34 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
107
110
  null for no field, string id if we are editing an existing field and
108
111
  'NEW_ROW' for a new row
109
112
  */
110
- const [editing, setEditing] = (0, _react.useState)(null);
111
- const toggleEditing = id => {
113
+ const [editing, setEditing] = (0, _react.useState)(((_fields$value$filter$ = fields === null || fields === void 0 || (_fields$value = fields.value) === null || _fields$value === void 0 || (_fields$value = _fields$value.filter(f => f._isNewActionListRow)) === null || _fields$value === void 0 ? void 0 : _fields$value.length) !== null && _fields$value$filter$ !== void 0 ? _fields$value$filter$ : 0) > 0 ? NEW_ROW : undefined);
114
+ const toggleEditing = (0, _react.useCallback)(id => {
112
115
  if (editing) {
113
- setEditing(null);
116
+ setEditing();
114
117
  } else {
115
118
  setEditing(id);
116
119
  }
117
- };
120
+ }, [editing]);
121
+
122
+ // Ensure editing doesn't get stuck in "NEW_ROW" state;
123
+ (0, _react.useEffect)(() => {
124
+ var _fields$value$filter$2, _fields$value2;
125
+ if (editing === NEW_ROW && ((_fields$value$filter$2 = fields === null || fields === void 0 || (_fields$value2 = fields.value) === null || _fields$value2 === void 0 || (_fields$value2 = _fields$value2.filter(f => f._isNewActionListRow)) === null || _fields$value2 === void 0 ? void 0 : _fields$value2.length) !== null && _fields$value$filter$2 !== void 0 ? _fields$value$filter$2 : 0) === 0) {
126
+ setEditing();
127
+ }
128
+ }, [editing, fields === null || fields === void 0 ? void 0 : fields.value]);
118
129
  const handleSave = index => {
130
+ var _actionAssigner;
119
131
  const {
120
132
  actionListActions: _a,
121
133
  fieldName: _fn,
122
134
  fieldIndex: _fi,
135
+ _isNewActionListRow: _inalr,
123
136
  ...rowData
124
137
  } = fields.value[index];
125
138
 
126
139
  // Find "edit" entry in actionAssigner
127
- const editCallback = actionAssigner(rowData)?.find(act => act.name === 'edit')?.callback;
140
+ const editCallback = (_actionAssigner = actionAssigner(rowData)) === null || _actionAssigner === void 0 || (_actionAssigner = _actionAssigner.find(act => act.name === 'edit')) === null || _actionAssigner === void 0 ? void 0 : _actionAssigner.callback;
128
141
  if (editCallback) {
129
142
  editCallback(rowData);
130
143
  }
@@ -134,44 +147,48 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
134
147
  actionListActions: _a,
135
148
  fieldName: _fn,
136
149
  fieldIndex: _fi,
150
+ _isNewActionListRow: _inalr,
137
151
  ...rowData
138
152
  } = fields.value[index];
139
153
  if (createCallback) {
140
154
  createCallback(rowData);
141
155
  }
142
156
  };
143
- const handleClickCreate = () => {
144
- toggleEditing('NEW_ROW');
145
- fields.unshift(defaultNewObject);
146
- };
157
+ const handleClickCreate = (0, _react.useCallback)(() => {
158
+ toggleEditing(NEW_ROW);
159
+ fields.unshift({
160
+ ...defaultNewObject,
161
+ _isNewActionListRow: true
162
+ });
163
+ }, [defaultNewObject, fields, toggleEditing]);
147
164
 
148
165
  // Way to go into create mode from external component, and way to tell internal editing state
149
166
  (0, _react.useImperativeHandle)(ref, () => ({
150
167
  create: handleClickCreate,
151
168
  editing
152
- }));
169
+ }), [editing, handleClickCreate]);
153
170
  const getColumnWidths = () => {
154
171
  const widthNotInUseByActions = editing ? TOTAL_WIDTH - EDITING_ACTIONS_WIDTH : TOTAL_WIDTH - NON_EDITING_ACTIONS_WIDTH;
155
172
  const staticWidth = widthNotInUseByActions / visibleFields.length;
156
173
  const widthsObject = {};
157
174
  visibleFields.forEach(f => {
158
175
  if (f !== 'actionListActions') {
159
- widthsObject[f] = `${staticWidth}%`;
176
+ widthsObject[f] = "".concat(staticWidth, "%");
160
177
  }
161
178
  });
162
- widthsObject.actionListActions = editing ? `${EDITING_ACTIONS_WIDTH}%` : `${NON_EDITING_ACTIONS_WIDTH}%`;
179
+ widthsObject.actionListActions = editing ? "".concat(EDITING_ACTIONS_WIDTH, "%") : "".concat(NON_EDITING_ACTIONS_WIDTH, "%");
163
180
  return widthsObject;
164
181
  };
165
182
  const renderActionButtons = data => {
166
- const fieldName = `contentData[${data.rowIndex}]`;
183
+ const fieldName = "contentData[".concat(data.rowIndex, "]");
167
184
  const {
168
185
  actionListActions: actions,
169
186
  ...rest
170
187
  } = data;
171
- if (data.id === editing || !data.id && editing === 'NEW_ROW') {
188
+ if (data.id === editing || !data.id && editing === NEW_ROW) {
172
189
  // Render the save/cancel buttons
173
190
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
174
- id: `action-button-parent-${data.rowIndex + 1}`,
191
+ id: "action-button-parent-".concat(data.rowIndex + 1),
175
192
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
176
193
  buttonStyle: "primary",
177
194
  disabled: hasValidationErrors || submitting || pristine,
@@ -180,26 +197,26 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
180
197
  triggerFormSubmit(); // This is set up as () => null in ActionList, so essentially only acts here to force validation
181
198
 
182
199
  if (!hasValidationErrors) {
183
- if (!data.id && editing === 'NEW_ROW') {
200
+ if (!data.id && editing === NEW_ROW) {
184
201
  handleCreate(data.rowIndex);
185
202
  } else {
186
203
  handleSave(data.rowIndex);
187
204
  }
188
- toggleEditing(data.id);
205
+ toggleEditing();
189
206
  }
190
207
  },
191
208
  type: "submit",
192
209
  children: kintIntl.formatKintMessage({
193
210
  id: 'save',
194
- overrideValue: labelOverrides?.save
211
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.save
195
212
  })
196
- }, `save[${data.rowIndex}]`), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
213
+ }, "save[".concat(data.rowIndex, "]")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
197
214
  "data-type-button": "cancel",
198
215
  marginBottom0: true,
199
216
  onClick: () => {
200
- if (!data.id && editing === 'NEW_ROW') {
217
+ if (!data.id && editing === NEW_ROW) {
201
218
  fields.remove(data.rowIndex);
202
- toggleEditing('NEW_ROW');
219
+ toggleEditing(NEW_ROW);
203
220
  } else {
204
221
  change(fieldName, (0, _get.default)(initialValues, fieldName));
205
222
  toggleEditing(data.id);
@@ -207,14 +224,14 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
207
224
  },
208
225
  children: kintIntl.formatKintMessage({
209
226
  id: 'cancel',
210
- overrideValue: labelOverrides?.cancel
227
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.cancel
211
228
  })
212
- }, `cancel[${data.rowIndex}]`)]
229
+ }, "cancel[".concat(data.rowIndex, "]"))]
213
230
  });
214
231
  }
215
232
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
216
- id: `action-button-parent-${data.rowIndex + 1}`,
217
- children: actions?.map(action => {
233
+ id: "action-button-parent-".concat(data.rowIndex + 1),
234
+ children: actions === null || actions === void 0 ? void 0 : actions.map(action => {
218
235
  let actionFunction;
219
236
  if (action.callback) {
220
237
  actionFunction = () => action.callback(rest);
@@ -224,25 +241,25 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
224
241
  if (action.name === 'edit') {
225
242
  actionFunction = () => toggleEditing(data.id);
226
243
  }
227
- let ariaLabel = `action-${action.name}[${data.rowIndex}]`;
228
- if (action?.ariaLabel) {
244
+ let ariaLabel = "action-".concat(action.name, "[").concat(data.rowIndex, "]");
245
+ if (action !== null && action !== void 0 && action.ariaLabel) {
229
246
  if (typeof action.ariaLabel === 'function') {
230
247
  ariaLabel = action.ariaLabel(data);
231
248
  } else if (typeof action.ariaLabel === 'string') {
232
249
  ariaLabel = action.ariaLabel;
233
250
  } else {
234
- throw new Error(`Provided ariaLabel for action "${action.name}" must be a function or a string.`);
251
+ throw new Error("Provided ariaLabel for action \"".concat(action.name, "\" must be a function or a string."));
235
252
  }
236
253
  }
237
254
  let tooltip;
238
255
  let tooltipSub;
239
- if (action?.tooltip) {
256
+ if (action !== null && action !== void 0 && action.tooltip) {
240
257
  if (typeof action.tooltip === 'function') {
241
258
  tooltip = action.tooltip(data);
242
259
  } else {
243
260
  tooltip = action.tooltip;
244
261
  }
245
- if (action?.tooltipSub) {
262
+ if (action !== null && action !== void 0 && action.tooltipSub) {
246
263
  if (typeof action.tooltipSub === 'function') {
247
264
  tooltipSub = action.tooltipSub(data);
248
265
  } else {
@@ -254,7 +271,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
254
271
  // If a tooltip is declared, render that around the actionButton
255
272
  if (tooltip) {
256
273
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
257
- id: `action-${action.name}[${data.rowIndex}]-tooltip`,
274
+ id: "action-".concat(action.name, "[").concat(data.rowIndex, "]-tooltip"),
258
275
  sub: tooltipSub,
259
276
  text: tooltip,
260
277
  children: _ref3 => {
@@ -276,7 +293,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
276
293
  return null;
277
294
  },
278
295
  to: action.to
279
- }, `action-${action.name}[${data.rowIndex}]`);
296
+ }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
280
297
  }
281
298
  });
282
299
  }
@@ -294,7 +311,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
294
311
  return null;
295
312
  },
296
313
  to: action.to
297
- }, `action-${action.name}[${data.rowIndex}]`);
314
+ }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
298
315
  })
299
316
  });
300
317
  };
@@ -326,16 +343,17 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
326
343
  const editingRow = cd.id === editing || !cd.id;
327
344
 
328
345
  // Default to the passed formatter values
329
- let returnValue = formatter?.[key] ? formatter[key](cd) : cd[key];
346
+ let returnValue = formatter !== null && formatter !== void 0 && formatter[key] ? formatter[key](cd) : cd[key];
330
347
 
331
348
  // If editing, replace values with fields
332
349
  if (editingRow) {
350
+ var _editableFields$key, _creatableFields$key;
333
351
  /*
334
352
  Check if the property is a visible field.
335
353
  If it is not then we don't allow editing in this component.
336
354
  */
337
- const editFunction = editableFields[key] ?? (() => true);
338
- const createFunction = creatableFields[key] ?? (() => true);
355
+ const editFunction = (_editableFields$key = editableFields[key]) !== null && _editableFields$key !== void 0 ? _editableFields$key : () => true;
356
+ const createFunction = (_creatableFields$key = creatableFields[key]) !== null && _creatableFields$key !== void 0 ? _creatableFields$key : () => true;
339
357
  /*
340
358
  Next check if this is a new row, if so we should run the createableField function with the data.
341
359
  If it is not a new row, then we run the editableField function with the data,
@@ -346,19 +364,19 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
346
364
  if (!cd.id && createFunction(cd) || !!cd.id && editFunction(cd)) {
347
365
  const passedObject = {
348
366
  allValues: values,
349
- index: cd?.fieldIndex,
367
+ index: cd === null || cd === void 0 ? void 0 : cd.fieldIndex,
350
368
  key,
351
- name: `${cd.fieldName}.${key}`,
369
+ name: "".concat(cd.fieldName, ".").concat(key),
352
370
  rowFieldName: cd.fieldName
353
371
  };
354
- const validateFunction = validateFields?.[key] ? validateFields?.[key](passedObject) : null;
372
+ const validateFunction = validateFields !== null && validateFields !== void 0 && validateFields[key] ? validateFields === null || validateFields === void 0 ? void 0 : validateFields[key](passedObject) : null;
355
373
  returnValue = fieldComponents[key] ? fieldComponents[key](passedObject) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
356
374
  ariaLabel: key // TODO at the moment the only way to override this is passing in an entire fieldComponent.
357
375
  ,
358
376
  autoFocus: autoFocus,
359
377
  component: _components.TextField,
360
378
  marginBottom0: true,
361
- name: `${cd.fieldName}.${key}`,
379
+ name: "".concat(cd.fieldName, ".").concat(key),
362
380
  parse: v => v,
363
381
  validate: validateFunction
364
382
  });
@@ -383,7 +401,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
383
401
  onClick: handleClickCreate,
384
402
  children: kintIntl.formatKintMessage({
385
403
  id: 'new',
386
- overrideValue: labelOverrides?.new
404
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
387
405
  })
388
406
  })]
389
407
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, {
@@ -391,7 +409,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
391
409
  ...columnMapping,
392
410
  actionListActions: kintIntl.formatKintMessage({
393
411
  id: 'actions',
394
- overrideValue: labelOverrides?.actions
412
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.actions
395
413
  })
396
414
  },
397
415
  columnWidths: getColumnWidths(),
@@ -34,7 +34,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
34
34
  const onToggle = (0, _react.useCallback)(() => setOpen(!open), [open, setOpen]);
35
35
 
36
36
  // FIXME a lot of this is shared with ResponsiveButtonGroup
37
- const styledDropdownButtons = (0, _react.useMemo)(() => dropdownButtons?.map(button => {
37
+ const styledDropdownButtons = (0, _react.useMemo)(() => dropdownButtons === null || dropdownButtons === void 0 ? void 0 : dropdownButtons.map(button => {
38
38
  return /*#__PURE__*/(0, _react.cloneElement)(button, {
39
39
  buttonStyle: 'dropdownItem'
40
40
  });
@@ -45,6 +45,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
45
45
  children: [...styledDropdownButtons]
46
46
  }), [styledDropdownButtons]);
47
47
  const renderTrigger = (0, _react.useCallback)(_ref2 => {
48
+ var _buttonProps$buttonSt;
48
49
  let {
49
50
  onToggle: toggleFunc,
50
51
  triggerRef,
@@ -57,11 +58,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
57
58
  ref: triggerRef,
58
59
  "aria-label": "menu",
59
60
  buttonClass: (0, _classnames.default)(_ResponsiveButtonGroup.default.width100, _ResponsiveButtonGroup.default.dropdownButtonClass, {
60
- [`${_ResponsiveButtonGroup.default.marginBottom}`]: !marginBottom0
61
+ ["".concat(_ResponsiveButtonGroup.default.marginBottom)]: !marginBottom0
61
62
  }, {
62
- [`${_ResponsiveButtonGroup.default.marginBottom0}`]: marginBottom0
63
+ ["".concat(_ResponsiveButtonGroup.default.marginBottom0)]: marginBottom0
63
64
  }),
64
- buttonStyle: buttonProps?.buttonStyle ?? 'default',
65
+ buttonStyle: (_buttonProps$buttonSt = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.buttonStyle) !== null && _buttonProps$buttonSt !== void 0 ? _buttonProps$buttonSt : 'default',
65
66
  onClick: toggleFunc,
66
67
  onKeyDown: keyHandler,
67
68
  type: "button",
@@ -73,7 +74,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
73
74
  iconPosition: "end"
74
75
  })
75
76
  });
76
- }, [buttonProps?.buttonStyle, triggerProps, marginBottom0]);
77
+ }, [buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.buttonStyle, triggerProps, marginBottom0]);
77
78
  let comboTrigger;
78
79
  if (dropdownButtons.length > 0) {
79
80
  comboTrigger = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
@@ -133,7 +133,7 @@ const CustomPropertiesLookup = _ref => {
133
133
  contentData: custprops,
134
134
  formatter: {
135
135
  primary: data => {
136
- if (data?.primary) {
136
+ if (data !== null && data !== void 0 && data.primary) {
137
137
  return kintIntl.formatKintMessage({
138
138
  id: 'yes',
139
139
  overrideValue: labelOverrides.yes
@@ -146,10 +146,13 @@ const CustomPropertiesLookup = _ref => {
146
146
  }
147
147
  },
148
148
  type: data => kintIntl.formatKintMessage({
149
- id: `customProperties.type.${data?.type}`,
150
- overrideValue: labelOverrides?.[data?.type]
149
+ id: "customProperties.type.".concat(data === null || data === void 0 ? void 0 : data.type),
150
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides[data === null || data === void 0 ? void 0 : data.type]
151
151
  }),
152
- category: data => data?.category?.desc
152
+ category: data => {
153
+ var _data$category;
154
+ return data === null || data === void 0 || (_data$category = data.category) === null || _data$category === void 0 ? void 0 : _data$category.desc;
155
+ }
153
156
  },
154
157
  onRowClick: onSelectCustomProperty,
155
158
  visibleColumns: ['label', 'primary', 'ctx', 'weight', 'type', 'category'],
@@ -24,6 +24,7 @@ const VIEWING = 'view';
24
24
 
25
25
  // A default option for setting up panes manually
26
26
  const CustomPropertiesSettings = _ref => {
27
+ var _customProperty$label, _customProperty$label2, _customProperty$categ, _customProperty$label3, _customProperty$label4;
27
28
  let {
28
29
  afterQueryCalls,
29
30
  catchQueryCalls,
@@ -68,7 +69,7 @@ const CustomPropertiesSettings = _ref => {
68
69
  // empty string is all custoprop contexts
69
70
  label: kintIntl.formatKintMessage({
70
71
  id: 'customProperties.config.all',
71
- overrideValue: labelOverrides?.all
72
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.all
72
73
  })
73
74
  }];
74
75
  }
@@ -82,7 +83,7 @@ const CustomPropertiesSettings = _ref => {
82
83
  setMode(VIEWING);
83
84
  queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
84
85
  setCustomProperty(res);
85
- if (afterQueryCalls?.put) {
86
+ if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.put) {
86
87
  afterQueryCalls.put(res);
87
88
  }
88
89
  },
@@ -90,7 +91,7 @@ const CustomPropertiesSettings = _ref => {
90
91
  setMode(VIEWING);
91
92
  queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
92
93
  setCustomProperty(res);
93
- if (afterQueryCalls?.post) {
94
+ if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.post) {
94
95
  afterQueryCalls.post(res);
95
96
  }
96
97
  },
@@ -98,7 +99,7 @@ const CustomPropertiesSettings = _ref => {
98
99
  setMode(VIEWING);
99
100
  queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
100
101
  setCustomProperty();
101
- if (afterQueryCalls?.delete) {
102
+ if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.delete) {
102
103
  afterQueryCalls.delete(res);
103
104
  }
104
105
  }
@@ -111,32 +112,33 @@ const CustomPropertiesSettings = _ref => {
111
112
  callout.sendCallout({
112
113
  message: kintIntl.formatKintMessage({
113
114
  id: 'customProperties.config.delete.errorMessage',
114
- overrideValue: labelOverrides?.deleteError
115
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteError
115
116
  }, {
116
- error: errorResp?.message,
117
- label: customProperty?.label
117
+ error: errorResp === null || errorResp === void 0 ? void 0 : errorResp.message,
118
+ label: customProperty === null || customProperty === void 0 ? void 0 : customProperty.label
118
119
  }),
119
120
  type: 'error'
120
121
  });
121
122
  },
122
123
  ...catchQueryCalls // Override defaults here
123
124
  },
124
-
125
125
  endpoint: customPropertiesEndpoint,
126
- id: customProperty?.id
126
+ id: customProperty === null || customProperty === void 0 ? void 0 : customProperty.id
127
127
  });
128
128
  const handeContextSubmit = submitData => {
129
+ var _submitData$ctx$0$val, _submitData$ctx;
129
130
  return {
130
131
  ...submitData,
131
- ctx: submitData?.ctx?.[0]?.value ?? ''
132
+ ctx: (_submitData$ctx$0$val = submitData === null || submitData === void 0 || (_submitData$ctx = submitData.ctx) === null || _submitData$ctx === void 0 || (_submitData$ctx = _submitData$ctx[0]) === null || _submitData$ctx === void 0 ? void 0 : _submitData$ctx.value) !== null && _submitData$ctx$0$val !== void 0 ? _submitData$ctx$0$val : ''
132
133
  };
133
134
  };
134
135
 
135
136
  // When POSTing a custom property, the backend expects a shorthand "Integer" or "LocalDate"
136
137
  // When PUTing a custom property, the backend needs the full class name
137
138
  const handleType = submitData => {
139
+ var _typeRegex$exec;
138
140
  const typeRegex = /(com\.k_int\.web\.toolkit\.custprops\.types\.CustomProperty)(.*)/g;
139
- const typeMatch = typeRegex.exec(submitData?.type) ?? [];
141
+ const typeMatch = (_typeRegex$exec = typeRegex.exec(submitData === null || submitData === void 0 ? void 0 : submitData.type)) !== null && _typeRegex$exec !== void 0 ? _typeRegex$exec : [];
140
142
  return {
141
143
  ...submitData,
142
144
  type: typeMatch[2]
@@ -153,7 +155,7 @@ const CustomPropertiesSettings = _ref => {
153
155
  ,
154
156
  children: kintIntl.formatKintMessage({
155
157
  id: 'new',
156
- overrideValue: labelOverrides?.new
158
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
157
159
  })
158
160
  }),
159
161
  paneTitle: kintIntl.formatKintMessage({
@@ -183,10 +185,10 @@ const CustomPropertiesSettings = _ref => {
183
185
  icon: "edit",
184
186
  children: kintIntl.formatKintMessage({
185
187
  id: 'edit',
186
- overrideValue: labelOverrides?.edit
188
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.edit
187
189
  })
188
190
  })
189
- }, `${customProperty.name}-action-edit`));
191
+ }, "".concat(customProperty.name, "-action-edit")));
190
192
  }
191
193
  if (deleteCondition) {
192
194
  actionsArray.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
@@ -200,12 +202,12 @@ const CustomPropertiesSettings = _ref => {
200
202
  icon: "trash",
201
203
  children: kintIntl.formatKintMessage({
202
204
  id: 'delete',
203
- overrideValue: labelOverrides?.delete
205
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
204
206
  })
205
207
  })
206
- }, `${customProperty.name}-action-delete`));
208
+ }, "".concat(customProperty.name, "-action-delete")));
207
209
  }
208
- return actionsArray?.length ? actionsArray : null;
210
+ return actionsArray !== null && actionsArray !== void 0 && actionsArray.length ? actionsArray : null;
209
211
  },
210
212
  defaultWidth: "fill",
211
213
  dismissible: true,
@@ -213,10 +215,10 @@ const CustomPropertiesSettings = _ref => {
213
215
  onClose: () => setCustomProperty(),
214
216
  paneTitle: kintIntl.formatKintMessage({
215
217
  id: 'customProperties.config.viewPaneTitle',
216
- overrideValue: labelOverrides?.viewPaneTitle,
217
- fallbackMessage: customProperty?.label ?? customProperty?.name
218
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.viewPaneTitle,
219
+ fallbackMessage: (_customProperty$label = customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _customProperty$label !== void 0 ? _customProperty$label : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
218
220
  }, {
219
- name: customProperty?.label ?? customProperty?.name
221
+ name: (_customProperty$label2 = customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _customProperty$label2 !== void 0 ? _customProperty$label2 : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
220
222
  }),
221
223
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyView.default, {
222
224
  customProperty: customProperty,
@@ -233,22 +235,22 @@ const CustomPropertiesSettings = _ref => {
233
235
  defaultInternal: true
234
236
  } : {
235
237
  ...customProperty,
236
- ctx: customProperty?.ctx ? [{
238
+ ctx: customProperty !== null && customProperty !== void 0 && customProperty.ctx ? [{
237
239
  value: customProperty.ctx,
238
240
  label: customProperty.ctx
239
241
  }] : null,
240
- category: customProperty?.category ? customProperty?.category?.id : null
242
+ category: customProperty !== null && customProperty !== void 0 && customProperty.category ? customProperty === null || customProperty === void 0 || (_customProperty$categ = customProperty.category) === null || _customProperty$categ === void 0 ? void 0 : _customProperty$categ.id : null
241
243
  },
242
244
  modalProps: {
243
245
  dismissible: true,
244
246
  label: mode === CREATING ? kintIntl.formatKintMessage({
245
247
  id: 'customProperties.config.newModal',
246
- overrideValue: labelOverrides?.newModalTitle
248
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.newModalTitle
247
249
  }) : kintIntl.formatKintMessage({
248
250
  id: 'customProperties.config.editModal',
249
- overrideValue: labelOverrides?.editModalTitle
251
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.editModalTitle
250
252
  }, {
251
- name: customProperty?.label ?? customProperty?.name
253
+ name: (_customProperty$label3 = customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _customProperty$label3 !== void 0 ? _customProperty$label3 : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
252
254
  }),
253
255
  onClose: () => setMode(VIEWING),
254
256
  open: mode === CREATING || mode === EDITING
@@ -269,22 +271,22 @@ const CustomPropertiesSettings = _ref => {
269
271
  buttonStyle: "danger",
270
272
  confirmLabel: kintIntl.formatKintMessage({
271
273
  id: 'delete',
272
- overrideValue: labelOverrides?.delete
274
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
273
275
  }),
274
276
  heading: kintIntl.formatKintMessage({
275
277
  id: 'customProperties.config.delete.confirmHeading',
276
- overrideValue: labelOverrides?.confirmHeading
278
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmHeading
277
279
  }),
278
280
  id: "delete-custprop-confirmation",
279
281
  message: kintIntl.formatKintMessage({
280
282
  id: 'customProperties.config.delete.confirmMessage',
281
- overrideValue: labelOverrides?.confirmMessage
283
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmMessage
282
284
  }, {
283
- name: customProperty?.label ?? customProperty?.name
285
+ name: (_customProperty$label4 = customProperty === null || customProperty === void 0 ? void 0 : customProperty.label) !== null && _customProperty$label4 !== void 0 ? _customProperty$label4 : customProperty === null || customProperty === void 0 ? void 0 : customProperty.name
284
286
  }),
285
287
  onCancel: () => setDeleteModal(false),
286
288
  onConfirm: () => {
287
- deleteCustProp(customProperty?.id);
289
+ deleteCustProp(customProperty === null || customProperty === void 0 ? void 0 : customProperty.id);
288
290
  setCustomProperty();
289
291
  setDeleteModal(false);
290
292
  },