@k-int/stripes-kint-components 5.6.1 → 5.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 (148) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/es/index.js +1 -1
  3. package/es/lib/ActionList/ActionList.js +1 -1
  4. package/es/lib/ActionList/ActionListFieldArray.js +33 -38
  5. package/es/lib/ActionList/index.js +1 -1
  6. package/es/lib/ComboButton/ComboButton.js +6 -7
  7. package/es/lib/ComboButton/index.js +1 -1
  8. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +5 -8
  9. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +1 -1
  10. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +30 -33
  11. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +1 -1
  12. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +59 -59
  13. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +3 -3
  14. package/es/lib/CustomProperties/Config/CustomPropertyView.js +33 -34
  15. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +2 -2
  16. package/es/lib/CustomProperties/Config/index.js +1 -1
  17. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +2 -2
  18. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +1 -1
  19. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +4 -4
  20. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +1 -1
  21. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +6 -11
  22. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +1 -1
  23. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +19 -26
  24. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +6 -6
  25. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +3 -3
  26. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +2 -2
  27. package/es/lib/CustomProperties/Edit/index.js +1 -1
  28. package/es/lib/CustomProperties/Edit/testResources.js +11 -12
  29. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +7 -12
  30. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +1 -1
  31. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +21 -29
  32. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +2 -2
  33. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +7 -7
  34. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +1 -1
  35. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +1 -1
  36. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +1 -1
  37. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +9 -9
  38. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +1 -1
  39. package/es/lib/CustomProperties/Filter/index.js +1 -1
  40. package/es/lib/CustomProperties/Filter/testResources.js +1 -2
  41. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -3
  42. package/es/lib/CustomProperties/View/CustomPropertiesView.js +2 -2
  43. package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +1 -1
  44. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +19 -27
  45. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +1 -1
  46. package/es/lib/CustomProperties/View/CustomPropertyCard.js +8 -12
  47. package/es/lib/CustomProperties/View/index.js +1 -1
  48. package/es/lib/CycleButton/CycleButton.js +2 -2
  49. package/es/lib/CycleButton/index.js +1 -1
  50. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +27 -39
  51. package/es/lib/EditableRefdataCategoryList/index.js +1 -1
  52. package/es/lib/EditableRefdataList/EditableRefdataList.js +27 -34
  53. package/es/lib/EditableRefdataList/index.js +1 -1
  54. package/es/lib/EditableSettingsList/EditableSettingsList.js +1 -1
  55. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +2 -2
  56. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +1 -1
  57. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +6 -6
  58. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +1 -1
  59. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +11 -13
  60. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -1
  61. package/es/lib/EditableSettingsList/SettingField/SettingField.js +5 -5
  62. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +1 -1
  63. package/es/lib/EditableSettingsList/SettingField/index.js +1 -1
  64. package/es/lib/EditableSettingsList/index.js +1 -1
  65. package/es/lib/FormModal/FormModal.js +1 -1
  66. package/es/lib/FormModal/index.js +1 -1
  67. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +5 -8
  68. package/es/lib/FormattedKintMessage/index.js +1 -1
  69. package/es/lib/IconSelect/IconSelect.js +6 -10
  70. package/es/lib/IconSelect/index.js +1 -1
  71. package/es/lib/NoResultsMessage/NoResultsMessage.js +5 -5
  72. package/es/lib/NoResultsMessage/index.js +1 -1
  73. package/es/lib/QueryTypedown/QueryTypedown.js +1 -1
  74. package/es/lib/QueryTypedown/index.js +1 -1
  75. package/es/lib/RefdataButtons/RefdataButtons.js +4 -4
  76. package/es/lib/RefdataButtons/index.js +1 -1
  77. package/es/lib/RefdataCategoriesSettings/RefdataCategoriesSettings.js +14 -18
  78. package/es/lib/RefdataCategoriesSettings/index.js +1 -1
  79. package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +22 -29
  80. package/es/lib/ResponsiveButtonGroup/index.js +1 -1
  81. package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +6 -7
  82. package/es/lib/RichSelect/RichSelect.js +15 -20
  83. package/es/lib/RichSelect/index.js +1 -1
  84. package/es/lib/RichSelect/useSelectedOption.js +1 -2
  85. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +15 -18
  86. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +8 -10
  87. package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
  88. package/es/lib/SASQLookupComponent/index.js +1 -1
  89. package/es/lib/SASQRoute/SASQRoute.js +3 -3
  90. package/es/lib/SASQRoute/index.js +1 -1
  91. package/es/lib/SASQViewComponent/SASQViewComponent.js +6 -10
  92. package/es/lib/SASQViewComponent/index.js +1 -1
  93. package/es/lib/SearchField/SearchField.js +1 -1
  94. package/es/lib/SearchField/index.js +1 -1
  95. package/es/lib/SettingPage/SettingPage.js +1 -1
  96. package/es/lib/SettingPage/SettingPagePane.js +3 -3
  97. package/es/lib/SettingPage/index.js +1 -1
  98. package/es/lib/SettingsFormContainer/SettingsFormContainer.js +3 -3
  99. package/es/lib/SettingsFormContainer/index.js +1 -1
  100. package/es/lib/Typedown/Typedown.js +35 -33
  101. package/es/lib/Typedown/index.js +1 -1
  102. package/es/lib/contexts/index.js +1 -1
  103. package/es/lib/hooks/__mocks__/index.js +1 -1
  104. package/es/lib/hooks/index.js +1 -1
  105. package/es/lib/hooks/typedownHooks/index.js +1 -1
  106. package/es/lib/hooks/typedownHooks/useTypedown.js +3 -3
  107. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +3 -3
  108. package/es/lib/hooks/useActionListRef.js +1 -1
  109. package/es/lib/hooks/useActiveElement.js +1 -1
  110. package/es/lib/hooks/useCustomProperties.js +3 -3
  111. package/es/lib/hooks/useHelperApp.js +7 -7
  112. package/es/lib/hooks/useIntlKey.js +1 -1
  113. package/es/lib/hooks/useIntlKeyStore.js +4 -7
  114. package/es/lib/hooks/useKintIntl.js +6 -12
  115. package/es/lib/hooks/useKiwtSASQuery.js +2 -2
  116. package/es/lib/hooks/useModConfigEntries.js +3 -3
  117. package/es/lib/hooks/useMutateCustomProperties.js +8 -8
  118. package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
  119. package/es/lib/hooks/useMutateRefdataCategory.js +5 -5
  120. package/es/lib/hooks/useMutateRefdataValue.js +7 -7
  121. package/es/lib/hooks/useQIndex.js +6 -6
  122. package/es/lib/hooks/useRefdata.js +4 -4
  123. package/es/lib/hooks/useTemplates.js +5 -5
  124. package/es/lib/settingsHooks/index.js +1 -1
  125. package/es/lib/settingsHooks/useAppSettings.js +7 -11
  126. package/es/lib/settingsHooks/useSettingSection.js +2 -2
  127. package/es/lib/settingsHooks/useSettings.js +4 -4
  128. package/es/lib/utils/buildUrl.js +3 -4
  129. package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
  130. package/es/lib/utils/filterParsers/index.js +1 -1
  131. package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +3 -3
  132. package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +4 -5
  133. package/es/lib/utils/filterParsers/parseKiwtQueryGroups.test.js +1 -1
  134. package/es/lib/utils/filterParsers/parseKiwtQueryString.js +2 -2
  135. package/es/lib/utils/generateKiwtQuery.js +1 -1
  136. package/es/lib/utils/generateKiwtQueryParams.js +28 -37
  137. package/es/lib/utils/groupCustomPropertiesByCtx.js +2 -3
  138. package/es/lib/utils/highlightString.js +1 -1
  139. package/es/lib/utils/index.js +1 -1
  140. package/es/lib/utils/matchString.js +6 -8
  141. package/es/lib/utils/parseErrorResponse.js +2 -3
  142. package/es/lib/utils/selectorSafe.js +2 -3
  143. package/es/lib/utils/sortByLabel.js +2 -3
  144. package/es/lib/validators/validators.js +4 -4
  145. package/package.json +2 -4
  146. package/src/lib/SASQLookupComponent/TableBody/TableBody.js +1 -1
  147. package/src/lib/Typedown/Typedown.js +12 -5
  148. package/styles/TypeDown.css +6 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [5.7.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.7.0...v5.7.1) (2024-06-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Add default MCLProps to TableBody to fix issue with SASQRoute (or below) not being passed mclProps ([30b2984](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/30b2984b8ad73bfd8a30107d400b4c87f07f72b5))
7
+
8
+ # [5.7.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.6.1...v5.7.0) (2024-05-07)
9
+
10
+
11
+ ### Features
12
+
13
+ * Typedown selected styling ([79c2eb3](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/79c2eb32c12bbf7d61db28d5f138946a7fa12ded))
14
+
1
15
  ## [5.6.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.6.0...v5.6.1) (2024-04-16)
2
16
 
3
17
 
package/es/index.js CHANGED
@@ -394,4 +394,4 @@ var _SettingsFormContainer = _interopRequireDefault(require("./lib/SettingsFormC
394
394
  var _ComboButton = _interopRequireDefault(require("./lib/ComboButton"));
395
395
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
396
396
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
397
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
397
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -11,7 +11,7 @@ var _reactFinalFormArrays = require("react-final-form-arrays");
11
11
  var _finalFormArrays = _interopRequireDefault(require("final-form-arrays"));
12
12
  var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArray"));
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  const propTypes = {
@@ -13,7 +13,7 @@ var _components = require("@folio/stripes/components");
13
13
  var _hooks = require("../hooks");
14
14
  var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/ActionListFieldArray.css"));
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
19
  const EDITING_ACTIONS_WIDTH = 25;
@@ -43,7 +43,6 @@ 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;
47
46
  let {
48
47
  action,
49
48
  ...actionTriggerProps
@@ -59,7 +58,7 @@ const ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
59
58
  ref: ref,
60
59
  marginBottom0: true,
61
60
  ...actionTriggerProps,
62
- children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
61
+ children: action.label ?? action.name
63
62
  });
64
63
  });
65
64
  ActionTrigger.propTypes = {
@@ -71,7 +70,6 @@ ActionTrigger.propTypes = {
71
70
  };
72
71
  const NEW_ROW = 'NEW_ROW';
73
72
  const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
74
- var _fields$value$filter$, _fields$value;
75
73
  let {
76
74
  actionAssigner,
77
75
  columnMapping,
@@ -110,7 +108,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
110
108
  null for no field, string id if we are editing an existing field and
111
109
  'NEW_ROW' for a new row
112
110
  */
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);
111
+ const [editing, setEditing] = (0, _react.useState)((fields?.value?.filter(f => f._isNewActionListRow)?.length ?? 0) > 0 ? NEW_ROW : undefined);
114
112
  const toggleEditing = (0, _react.useCallback)(id => {
115
113
  if (editing) {
116
114
  setEditing();
@@ -121,13 +119,11 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
121
119
 
122
120
  // Ensure editing doesn't get stuck in "NEW_ROW" state;
123
121
  (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) {
122
+ if (editing === NEW_ROW && (fields?.value?.filter(f => f._isNewActionListRow)?.length ?? 0) === 0) {
126
123
  setEditing();
127
124
  }
128
- }, [editing, fields === null || fields === void 0 ? void 0 : fields.value]);
125
+ }, [editing, fields?.value]);
129
126
  const handleSave = index => {
130
- var _actionAssigner;
131
127
  const {
132
128
  actionListActions: _a,
133
129
  fieldName: _fn,
@@ -137,7 +133,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
137
133
  } = fields.value[index];
138
134
 
139
135
  // Find "edit" entry in actionAssigner
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;
136
+ const editCallback = actionAssigner(rowData)?.find(act => act.name === 'edit')?.callback;
141
137
  if (editCallback) {
142
138
  editCallback(rowData);
143
139
  }
@@ -173,14 +169,14 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
173
169
  const widthsObject = {};
174
170
  visibleFields.forEach(f => {
175
171
  if (f !== 'actionListActions') {
176
- widthsObject[f] = "".concat(staticWidth, "%");
172
+ widthsObject[f] = `${staticWidth}%`;
177
173
  }
178
174
  });
179
- widthsObject.actionListActions = editing ? "".concat(EDITING_ACTIONS_WIDTH, "%") : "".concat(NON_EDITING_ACTIONS_WIDTH, "%");
175
+ widthsObject.actionListActions = editing ? `${EDITING_ACTIONS_WIDTH}%` : `${NON_EDITING_ACTIONS_WIDTH}%`;
180
176
  return widthsObject;
181
177
  };
182
178
  const renderActionButtons = data => {
183
- const fieldName = "contentData[".concat(data.rowIndex, "]");
179
+ const fieldName = `contentData[${data.rowIndex}]`;
184
180
  const {
185
181
  actionListActions: actions,
186
182
  ...rest
@@ -188,7 +184,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
188
184
  if (data.id === editing || !data.id && editing === NEW_ROW) {
189
185
  // Render the save/cancel buttons
190
186
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
191
- id: "action-button-parent-".concat(data.rowIndex + 1),
187
+ id: `action-button-parent-${data.rowIndex + 1}`,
192
188
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
193
189
  buttonStyle: "primary",
194
190
  disabled: hasValidationErrors || submitting || pristine,
@@ -208,9 +204,9 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
208
204
  type: "submit",
209
205
  children: kintIntl.formatKintMessage({
210
206
  id: 'save',
211
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.save
207
+ overrideValue: labelOverrides?.save
212
208
  })
213
- }, "save[".concat(data.rowIndex, "]")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
209
+ }, `save[${data.rowIndex}]`), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
214
210
  "data-type-button": "cancel",
215
211
  marginBottom0: true,
216
212
  onClick: () => {
@@ -224,14 +220,14 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
224
220
  },
225
221
  children: kintIntl.formatKintMessage({
226
222
  id: 'cancel',
227
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.cancel
223
+ overrideValue: labelOverrides?.cancel
228
224
  })
229
- }, "cancel[".concat(data.rowIndex, "]"))]
225
+ }, `cancel[${data.rowIndex}]`)]
230
226
  });
231
227
  }
232
228
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
233
- id: "action-button-parent-".concat(data.rowIndex + 1),
234
- children: actions === null || actions === void 0 ? void 0 : actions.map(action => {
229
+ id: `action-button-parent-${data.rowIndex + 1}`,
230
+ children: actions?.map(action => {
235
231
  let actionFunction;
236
232
  if (action.callback) {
237
233
  actionFunction = () => action.callback(rest);
@@ -241,25 +237,25 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
241
237
  if (action.name === 'edit') {
242
238
  actionFunction = () => toggleEditing(data.id);
243
239
  }
244
- let ariaLabel = "action-".concat(action.name, "[").concat(data.rowIndex, "]");
245
- if (action !== null && action !== void 0 && action.ariaLabel) {
240
+ let ariaLabel = `action-${action.name}[${data.rowIndex}]`;
241
+ if (action?.ariaLabel) {
246
242
  if (typeof action.ariaLabel === 'function') {
247
243
  ariaLabel = action.ariaLabel(data);
248
244
  } else if (typeof action.ariaLabel === 'string') {
249
245
  ariaLabel = action.ariaLabel;
250
246
  } else {
251
- throw new Error("Provided ariaLabel for action \"".concat(action.name, "\" must be a function or a string."));
247
+ throw new Error(`Provided ariaLabel for action "${action.name}" must be a function or a string.`);
252
248
  }
253
249
  }
254
250
  let tooltip;
255
251
  let tooltipSub;
256
- if (action !== null && action !== void 0 && action.tooltip) {
252
+ if (action?.tooltip) {
257
253
  if (typeof action.tooltip === 'function') {
258
254
  tooltip = action.tooltip(data);
259
255
  } else {
260
256
  tooltip = action.tooltip;
261
257
  }
262
- if (action !== null && action !== void 0 && action.tooltipSub) {
258
+ if (action?.tooltipSub) {
263
259
  if (typeof action.tooltipSub === 'function') {
264
260
  tooltipSub = action.tooltipSub(data);
265
261
  } else {
@@ -271,7 +267,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
271
267
  // If a tooltip is declared, render that around the actionButton
272
268
  if (tooltip) {
273
269
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
274
- id: "action-".concat(action.name, "[").concat(data.rowIndex, "]-tooltip"),
270
+ id: `action-${action.name}[${data.rowIndex}]-tooltip`,
275
271
  sub: tooltipSub,
276
272
  text: tooltip,
277
273
  children: _ref3 => {
@@ -293,7 +289,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
293
289
  return null;
294
290
  },
295
291
  to: action.to
296
- }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
292
+ }, `action-${action.name}[${data.rowIndex}]`);
297
293
  }
298
294
  });
299
295
  }
@@ -311,7 +307,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
311
307
  return null;
312
308
  },
313
309
  to: action.to
314
- }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
310
+ }, `action-${action.name}[${data.rowIndex}]`);
315
311
  })
316
312
  });
317
313
  };
@@ -343,17 +339,16 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
343
339
  const editingRow = cd.id === editing || !cd.id;
344
340
 
345
341
  // Default to the passed formatter values
346
- let returnValue = formatter !== null && formatter !== void 0 && formatter[key] ? formatter[key](cd) : cd[key];
342
+ let returnValue = formatter?.[key] ? formatter[key](cd) : cd[key];
347
343
 
348
344
  // If editing, replace values with fields
349
345
  if (editingRow) {
350
- var _editableFields$key, _creatableFields$key;
351
346
  /*
352
347
  Check if the property is a visible field.
353
348
  If it is not then we don't allow editing in this component.
354
349
  */
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;
350
+ const editFunction = editableFields[key] ?? (() => true);
351
+ const createFunction = creatableFields[key] ?? (() => true);
357
352
  /*
358
353
  Next check if this is a new row, if so we should run the createableField function with the data.
359
354
  If it is not a new row, then we run the editableField function with the data,
@@ -364,19 +359,19 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
364
359
  if (!cd.id && createFunction(cd) || !!cd.id && editFunction(cd)) {
365
360
  const passedObject = {
366
361
  allValues: values,
367
- index: cd === null || cd === void 0 ? void 0 : cd.fieldIndex,
362
+ index: cd?.fieldIndex,
368
363
  key,
369
- name: "".concat(cd.fieldName, ".").concat(key),
364
+ name: `${cd.fieldName}.${key}`,
370
365
  rowFieldName: cd.fieldName
371
366
  };
372
- const validateFunction = validateFields !== null && validateFields !== void 0 && validateFields[key] ? validateFields === null || validateFields === void 0 ? void 0 : validateFields[key](passedObject) : null;
367
+ const validateFunction = validateFields?.[key] ? validateFields?.[key](passedObject) : null;
373
368
  returnValue = fieldComponents[key] ? fieldComponents[key](passedObject) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
374
369
  ariaLabel: key // TODO at the moment the only way to override this is passing in an entire fieldComponent.
375
370
  ,
376
371
  autoFocus: autoFocus,
377
372
  component: _components.TextField,
378
373
  marginBottom0: true,
379
- name: "".concat(cd.fieldName, ".").concat(key),
374
+ name: `${cd.fieldName}.${key}`,
380
375
  parse: v => v,
381
376
  validate: validateFunction
382
377
  });
@@ -401,7 +396,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
401
396
  onClick: handleClickCreate,
402
397
  children: kintIntl.formatKintMessage({
403
398
  id: 'new',
404
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
399
+ overrideValue: labelOverrides?.new
405
400
  })
406
401
  })]
407
402
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, {
@@ -409,7 +404,7 @@ const ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
409
404
  ...columnMapping,
410
405
  actionListActions: kintIntl.formatKintMessage({
411
406
  id: 'actions',
412
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.actions
407
+ overrideValue: labelOverrides?.actions
413
408
  })
414
409
  },
415
410
  columnWidths: getColumnWidths(),
@@ -10,4 +10,4 @@ Object.defineProperty(exports, "default", {
10
10
  }
11
11
  });
12
12
  var _ActionList = _interopRequireDefault(require("./ActionList"));
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -10,7 +10,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _components = require("@folio/stripes/components");
11
11
  var _ResponsiveButtonGroup = _interopRequireDefault(require("../../../styles/ResponsiveButtonGroup.css"));
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  // FIXME we should probably store the shared styles in a more aptly named file
15
15
 
16
16
  /*
@@ -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 === null || dropdownButtons === void 0 ? void 0 : dropdownButtons.map(button => {
37
+ const styledDropdownButtons = (0, _react.useMemo)(() => dropdownButtons?.map(button => {
38
38
  return /*#__PURE__*/(0, _react.cloneElement)(button, {
39
39
  buttonStyle: 'dropdownItem'
40
40
  });
@@ -45,7 +45,6 @@ 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;
49
48
  let {
50
49
  onToggle: toggleFunc,
51
50
  triggerRef,
@@ -58,11 +57,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
58
57
  ref: triggerRef,
59
58
  "aria-label": "menu",
60
59
  buttonClass: (0, _classnames.default)(_ResponsiveButtonGroup.default.width100, _ResponsiveButtonGroup.default.dropdownButtonClass, {
61
- ["".concat(_ResponsiveButtonGroup.default.marginBottom)]: !marginBottom0
60
+ [`${_ResponsiveButtonGroup.default.marginBottom}`]: !marginBottom0
62
61
  }, {
63
- ["".concat(_ResponsiveButtonGroup.default.marginBottom0)]: marginBottom0
62
+ [`${_ResponsiveButtonGroup.default.marginBottom0}`]: marginBottom0
64
63
  }),
65
- buttonStyle: (_buttonProps$buttonSt = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.buttonStyle) !== null && _buttonProps$buttonSt !== void 0 ? _buttonProps$buttonSt : 'default',
64
+ buttonStyle: buttonProps?.buttonStyle ?? 'default',
66
65
  onClick: toggleFunc,
67
66
  onKeyDown: keyHandler,
68
67
  type: "button",
@@ -74,7 +73,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
74
73
  iconPosition: "end"
75
74
  })
76
75
  });
77
- }, [buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.buttonStyle, triggerProps, marginBottom0]);
76
+ }, [buttonProps?.buttonStyle, triggerProps, marginBottom0]);
78
77
  let comboTrigger;
79
78
  if (dropdownButtons.length > 0) {
80
79
  comboTrigger = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
@@ -10,4 +10,4 @@ Object.defineProperty(exports, "default", {
10
10
  }
11
11
  });
12
12
  var _ComboButton = _interopRequireDefault(require("./ComboButton"));
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -12,7 +12,7 @@ var _SearchField = _interopRequireDefault(require("../../SearchField"));
12
12
  var _hooks = require("../../hooks");
13
13
  var _CustomProperties = _interopRequireDefault(require("../../../../styles/CustomProperties.css"));
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  const CustomPropertiesLookup = _ref => {
17
17
  let {
18
18
  contextFilterOptions,
@@ -133,7 +133,7 @@ const CustomPropertiesLookup = _ref => {
133
133
  contentData: custprops,
134
134
  formatter: {
135
135
  primary: data => {
136
- if (data !== null && data !== void 0 && data.primary) {
136
+ if (data?.primary) {
137
137
  return kintIntl.formatKintMessage({
138
138
  id: 'yes',
139
139
  overrideValue: labelOverrides.yes
@@ -146,13 +146,10 @@ const CustomPropertiesLookup = _ref => {
146
146
  }
147
147
  },
148
148
  type: data => kintIntl.formatKintMessage({
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]
149
+ id: `customProperties.type.${data?.type}`,
150
+ overrideValue: labelOverrides?.[data?.type]
151
151
  }),
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
- }
152
+ category: data => data?.category?.desc
156
153
  },
157
154
  onRowClick: onSelectCustomProperty,
158
155
  visibleColumns: ['label', 'primary', 'ctx', 'weight', 'type', 'category'],
@@ -5,7 +5,7 @@ var _reactRouterDom = require("react-router-dom");
5
5
  var _CustomPropertiesLookup = _interopRequireDefault(require("./CustomPropertiesLookup"));
6
6
  var _renderWithKintHarness = _interopRequireDefault(require("../../../../test/jest/helpers/renderWithKintHarness"));
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
9
  jest.mock('../../hooks');
10
10
  jest.mock('../../SearchField', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
11
11
  children: "SearchField"
@@ -17,14 +17,13 @@ var _CustomPropertyForm = _interopRequireDefault(require("./CustomPropertyForm")
17
17
  var _hooks = require("../../hooks");
18
18
  var _utils = require("../../utils");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
21
  const EDITING = 'edit';
22
22
  const CREATING = 'create';
23
23
  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;
28
27
  let {
29
28
  afterQueryCalls,
30
29
  catchQueryCalls,
@@ -69,7 +68,7 @@ const CustomPropertiesSettings = _ref => {
69
68
  // empty string is all custoprop contexts
70
69
  label: kintIntl.formatKintMessage({
71
70
  id: 'customProperties.config.all',
72
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.all
71
+ overrideValue: labelOverrides?.all
73
72
  })
74
73
  }];
75
74
  }
@@ -83,7 +82,7 @@ const CustomPropertiesSettings = _ref => {
83
82
  setMode(VIEWING);
84
83
  queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
85
84
  setCustomProperty(res);
86
- if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.put) {
85
+ if (afterQueryCalls?.put) {
87
86
  afterQueryCalls.put(res);
88
87
  }
89
88
  },
@@ -91,7 +90,7 @@ const CustomPropertiesSettings = _ref => {
91
90
  setMode(VIEWING);
92
91
  queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
93
92
  setCustomProperty(res);
94
- if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.post) {
93
+ if (afterQueryCalls?.post) {
95
94
  afterQueryCalls.post(res);
96
95
  }
97
96
  },
@@ -99,7 +98,7 @@ const CustomPropertiesSettings = _ref => {
99
98
  setMode(VIEWING);
100
99
  queryClient.invalidateQueries(['stripes-kint-components', 'useCustomProperties', 'custprops']);
101
100
  setCustomProperty();
102
- if (afterQueryCalls !== null && afterQueryCalls !== void 0 && afterQueryCalls.delete) {
101
+ if (afterQueryCalls?.delete) {
103
102
  afterQueryCalls.delete(res);
104
103
  }
105
104
  }
@@ -112,10 +111,10 @@ const CustomPropertiesSettings = _ref => {
112
111
  callout.sendCallout({
113
112
  message: kintIntl.formatKintMessage({
114
113
  id: 'customProperties.config.delete.errorMessage',
115
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.deleteError
114
+ overrideValue: labelOverrides?.deleteError
116
115
  }, {
117
- error: errorResp === null || errorResp === void 0 ? void 0 : errorResp.message,
118
- label: customProperty === null || customProperty === void 0 ? void 0 : customProperty.label
116
+ error: errorResp?.message,
117
+ label: customProperty?.label
119
118
  }),
120
119
  type: 'error'
121
120
  });
@@ -123,22 +122,20 @@ const CustomPropertiesSettings = _ref => {
123
122
  ...catchQueryCalls // Override defaults here
124
123
  },
125
124
  endpoint: customPropertiesEndpoint,
126
- id: customProperty === null || customProperty === void 0 ? void 0 : customProperty.id
125
+ id: customProperty?.id
127
126
  });
128
127
  const handeContextSubmit = submitData => {
129
- var _submitData$ctx$0$val, _submitData$ctx;
130
128
  return {
131
129
  ...submitData,
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 : ''
130
+ ctx: submitData?.ctx?.[0]?.value ?? ''
133
131
  };
134
132
  };
135
133
 
136
134
  // When POSTing a custom property, the backend expects a shorthand "Integer" or "LocalDate"
137
135
  // When PUTing a custom property, the backend needs the full class name
138
136
  const handleType = submitData => {
139
- var _typeRegex$exec;
140
137
  const typeRegex = /(com\.k_int\.web\.toolkit\.custprops\.types\.CustomProperty)(.*)/g;
141
- const typeMatch = (_typeRegex$exec = typeRegex.exec(submitData === null || submitData === void 0 ? void 0 : submitData.type)) !== null && _typeRegex$exec !== void 0 ? _typeRegex$exec : [];
138
+ const typeMatch = typeRegex.exec(submitData?.type) ?? [];
142
139
  return {
143
140
  ...submitData,
144
141
  type: typeMatch[2]
@@ -155,7 +152,7 @@ const CustomPropertiesSettings = _ref => {
155
152
  ,
156
153
  children: kintIntl.formatKintMessage({
157
154
  id: 'new',
158
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
155
+ overrideValue: labelOverrides?.new
159
156
  })
160
157
  }),
161
158
  paneTitle: kintIntl.formatKintMessage({
@@ -185,10 +182,10 @@ const CustomPropertiesSettings = _ref => {
185
182
  icon: "edit",
186
183
  children: kintIntl.formatKintMessage({
187
184
  id: 'edit',
188
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.edit
185
+ overrideValue: labelOverrides?.edit
189
186
  })
190
187
  })
191
- }, "".concat(customProperty.name, "-action-edit")));
188
+ }, `${customProperty.name}-action-edit`));
192
189
  }
193
190
  if (deleteCondition) {
194
191
  actionsArray.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
@@ -202,12 +199,12 @@ const CustomPropertiesSettings = _ref => {
202
199
  icon: "trash",
203
200
  children: kintIntl.formatKintMessage({
204
201
  id: 'delete',
205
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
202
+ overrideValue: labelOverrides?.delete
206
203
  })
207
204
  })
208
- }, "".concat(customProperty.name, "-action-delete")));
205
+ }, `${customProperty.name}-action-delete`));
209
206
  }
210
- return actionsArray !== null && actionsArray !== void 0 && actionsArray.length ? actionsArray : null;
207
+ return actionsArray?.length ? actionsArray : null;
211
208
  },
212
209
  defaultWidth: "fill",
213
210
  dismissible: true,
@@ -215,10 +212,10 @@ const CustomPropertiesSettings = _ref => {
215
212
  onClose: () => setCustomProperty(),
216
213
  paneTitle: kintIntl.formatKintMessage({
217
214
  id: 'customProperties.config.viewPaneTitle',
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
215
+ overrideValue: labelOverrides?.viewPaneTitle,
216
+ fallbackMessage: customProperty?.label ?? customProperty?.name
220
217
  }, {
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
218
+ name: customProperty?.label ?? customProperty?.name
222
219
  }),
223
220
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyView.default, {
224
221
  customProperty: customProperty,
@@ -235,22 +232,22 @@ const CustomPropertiesSettings = _ref => {
235
232
  defaultInternal: true
236
233
  } : {
237
234
  ...customProperty,
238
- ctx: customProperty !== null && customProperty !== void 0 && customProperty.ctx ? [{
235
+ ctx: customProperty?.ctx ? [{
239
236
  value: customProperty.ctx,
240
237
  label: customProperty.ctx
241
238
  }] : 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
239
+ category: customProperty?.category ? customProperty?.category?.id : null
243
240
  },
244
241
  modalProps: {
245
242
  dismissible: true,
246
243
  label: mode === CREATING ? kintIntl.formatKintMessage({
247
244
  id: 'customProperties.config.newModal',
248
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.newModalTitle
245
+ overrideValue: labelOverrides?.newModalTitle
249
246
  }) : kintIntl.formatKintMessage({
250
247
  id: 'customProperties.config.editModal',
251
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.editModalTitle
248
+ overrideValue: labelOverrides?.editModalTitle
252
249
  }, {
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
250
+ name: customProperty?.label ?? customProperty?.name
254
251
  }),
255
252
  onClose: () => setMode(VIEWING),
256
253
  open: mode === CREATING || mode === EDITING
@@ -271,22 +268,22 @@ const CustomPropertiesSettings = _ref => {
271
268
  buttonStyle: "danger",
272
269
  confirmLabel: kintIntl.formatKintMessage({
273
270
  id: 'delete',
274
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.delete
271
+ overrideValue: labelOverrides?.delete
275
272
  }),
276
273
  heading: kintIntl.formatKintMessage({
277
274
  id: 'customProperties.config.delete.confirmHeading',
278
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmHeading
275
+ overrideValue: labelOverrides?.confirmHeading
279
276
  }),
280
277
  id: "delete-custprop-confirmation",
281
278
  message: kintIntl.formatKintMessage({
282
279
  id: 'customProperties.config.delete.confirmMessage',
283
- overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.confirmMessage
280
+ overrideValue: labelOverrides?.confirmMessage
284
281
  }, {
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
282
+ name: customProperty?.label ?? customProperty?.name
286
283
  }),
287
284
  onCancel: () => setDeleteModal(false),
288
285
  onConfirm: () => {
289
- deleteCustProp(customProperty === null || customProperty === void 0 ? void 0 : customProperty.id);
286
+ deleteCustProp(customProperty?.id);
290
287
  setCustomProperty();
291
288
  setDeleteModal(false);
292
289
  },
@@ -6,7 +6,7 @@ var _reactRouterDom = require("react-router-dom");
6
6
  var _CustomPropertiesSettings = _interopRequireDefault(require("./CustomPropertiesSettings"));
7
7
  var _jest = require("../../../../test/jest");
8
8
  var _jsxRuntime = require("react/jsx-runtime");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  jest.mock('../../hooks');
11
11
  jest.mock('../../FormModal/FormModal', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
12
12
  children: "FormModal"