@k-int/stripes-kint-components 1.5.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/es/index.js +80 -25
  3. package/es/lib/ActionList/ActionList.js +92 -33
  4. package/es/lib/ActionList/ActionListFieldArray.js +202 -104
  5. package/es/lib/ActionList/index.js +7 -3
  6. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +198 -0
  7. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +321 -0
  8. package/es/lib/CustomProperties/Config/CustomPropertiesView.js +166 -0
  9. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +357 -0
  10. package/es/lib/CustomProperties/Config/index.js +41 -0
  11. package/es/lib/EditableRefdataList/EditableRefdataList.js +69 -24
  12. package/es/lib/EditableRefdataList/index.js +7 -3
  13. package/es/lib/EditableSettingsList/EditableSettingsList.js +90 -0
  14. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +90 -0
  15. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +181 -0
  16. package/es/lib/{Settings → EditableSettingsList/SettingField}/EditSettingValue.js +72 -9
  17. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +447 -0
  18. package/es/lib/{Settings → EditableSettingsList/SettingField}/RenderSettingValue.js +45 -7
  19. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +495 -0
  20. package/es/lib/EditableSettingsList/SettingField/SettingField.js +187 -0
  21. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +180 -0
  22. package/es/lib/EditableSettingsList/SettingField/index.js +35 -0
  23. package/es/lib/EditableSettingsList/index.js +35 -0
  24. package/es/lib/FormModal/FormModal.js +126 -0
  25. package/es/lib/FormModal/index.js +19 -0
  26. package/es/lib/NoResultsMessage/NoResultsMessage.js +65 -32
  27. package/es/lib/NoResultsMessage/index.js +7 -3
  28. package/es/lib/QueryTypedown/QueryTypedown.js +48 -9
  29. package/es/lib/QueryTypedown/index.js +6 -2
  30. package/es/lib/RefdataButtons/RefdataButtons.js +143 -0
  31. package/es/lib/RefdataButtons/index.js +19 -0
  32. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +194 -140
  33. package/es/lib/SASQLookupComponent/index.js +6 -2
  34. package/es/lib/SASQRoute/SASQRoute.js +55 -18
  35. package/es/lib/SASQRoute/index.js +6 -2
  36. package/es/lib/SASQViewComponent/SASQViewComponent.js +50 -11
  37. package/es/lib/SASQViewComponent/index.js +6 -2
  38. package/es/lib/SearchField/SearchField.js +48 -13
  39. package/es/lib/SearchField/index.js +6 -2
  40. package/es/lib/SettingPage/SettingPage.js +99 -0
  41. package/es/lib/SettingPage/SettingPagePane.js +83 -0
  42. package/es/lib/SettingPage/index.js +27 -0
  43. package/es/lib/Typedown/Typedown.js +174 -99
  44. package/es/lib/Typedown/index.js +6 -2
  45. package/es/lib/constants/customProperties.js +60 -0
  46. package/es/lib/constants/eventCodes.js +31 -1
  47. package/es/lib/contexts/SettingsContext.js +41 -0
  48. package/es/lib/contexts/index.js +19 -0
  49. package/es/lib/hooks/index.js +44 -10
  50. package/es/lib/hooks/settingsHooks/index.js +27 -0
  51. package/es/lib/hooks/settingsHooks/useSettingSection.js +74 -0
  52. package/es/lib/hooks/settingsHooks/useSettings.js +175 -0
  53. package/es/lib/hooks/typedownHooks/index.js +8 -28
  54. package/es/lib/hooks/typedownHooks/useTypedown.js +129 -12
  55. package/es/lib/hooks/typedownHooks/useTypedownData.js +35 -2
  56. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +39 -6
  57. package/es/lib/hooks/useActiveElement.js +33 -2
  58. package/es/lib/hooks/useCustomProperties.js +112 -0
  59. package/es/lib/hooks/useHelperApp.js +44 -11
  60. package/es/lib/hooks/useKiwtFieldArray.js +37 -4
  61. package/es/lib/hooks/useKiwtSASQuery.js +43 -9
  62. package/es/lib/hooks/useLocalStorageState.js +37 -4
  63. package/es/lib/hooks/useMutateCustomProperties.js +143 -0
  64. package/es/lib/hooks/useMutateRefdataValue.js +42 -9
  65. package/es/lib/hooks/useQIndex.js +42 -9
  66. package/es/lib/hooks/useRefdata.js +43 -16
  67. package/es/lib/hooks/useTemplates.js +36 -3
  68. package/es/lib/utils/buildUrl.js +43 -10
  69. package/es/lib/utils/generateKiwtQuery.js +33 -4
  70. package/es/lib/utils/generateKiwtQueryParams.js +31 -2
  71. package/es/lib/utils/index.js +41 -5
  72. package/es/lib/utils/refdataOptions.js +43 -0
  73. package/es/lib/utils/renderHelpText.js +109 -0
  74. package/es/lib/utils/selectorSafe.js +31 -2
  75. package/es/lib/utils/sortByLabel.js +55 -0
  76. package/es/lib/utils/toCamelCase.js +48 -0
  77. package/jest.config.js +15 -1
  78. package/package.json +19 -10
  79. package/src/index.js +25 -10
  80. package/src/lib/ActionList/ActionList.js +32 -22
  81. package/src/lib/ActionList/ActionListFieldArray.js +56 -10
  82. package/src/lib/ActionList/README.md +5 -1
  83. package/src/lib/ActionList/index.js +1 -1
  84. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +111 -0
  85. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +237 -0
  86. package/src/lib/CustomProperties/Config/CustomPropertiesView.js +150 -0
  87. package/src/lib/CustomProperties/Config/CustomPropertyForm.js +295 -0
  88. package/src/lib/CustomProperties/Config/index.js +4 -0
  89. package/src/lib/EditableRefdataList/EditableRefdataList.js +10 -5
  90. package/src/lib/EditableRefdataList/index.js +1 -1
  91. package/src/lib/{Settings → EditableSettingsList}/EditableSettingsList.js +0 -0
  92. package/src/lib/{Settings → EditableSettingsList}/EditableSettingsListFieldArray.js +2 -2
  93. package/src/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +111 -0
  94. package/src/lib/{Settings → EditableSettingsList/SettingField}/EditSettingValue.js +24 -1
  95. package/src/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +379 -0
  96. package/src/lib/{Settings → EditableSettingsList/SettingField}/RenderSettingValue.js +2 -1
  97. package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +368 -0
  98. package/src/lib/{Settings → EditableSettingsList/SettingField}/SettingField.js +7 -7
  99. package/src/lib/EditableSettingsList/SettingField/SettingField.test.js +80 -0
  100. package/src/lib/EditableSettingsList/SettingField/index.js +3 -0
  101. package/src/lib/EditableSettingsList/index.js +3 -0
  102. package/src/lib/FormModal/FormModal.js +71 -0
  103. package/src/lib/FormModal/index.js +1 -0
  104. package/src/lib/NoResultsMessage/NoResultsMessage.js +2 -2
  105. package/src/lib/NoResultsMessage/index.js +1 -1
  106. package/src/lib/{Settings → RefdataButtons}/RefdataButtons.js +1 -1
  107. package/src/lib/RefdataButtons/index.js +1 -0
  108. package/src/lib/SASQLookupComponent/SASQLookupComponent.js +7 -1
  109. package/src/lib/{Settings → SettingPage}/SettingPage.js +5 -5
  110. package/src/lib/{Settings → SettingPage}/SettingPagePane.js +12 -2
  111. package/src/lib/SettingPage/index.js +2 -0
  112. package/src/lib/Typedown/Typedown.js +52 -9
  113. package/src/lib/constants/customProperties.js +9 -0
  114. package/src/lib/{Settings → contexts}/SettingsContext.js +1 -1
  115. package/src/lib/contexts/index.js +2 -0
  116. package/src/lib/hooks/index.js +3 -0
  117. package/src/lib/hooks/settingsHooks/index.js +2 -0
  118. package/src/lib/{Settings → hooks/settingsHooks}/useSettingSection.js +0 -0
  119. package/src/lib/{Settings → hooks/settingsHooks}/useSettings.js +14 -6
  120. package/src/lib/hooks/typedownHooks/index.js +0 -3
  121. package/src/lib/hooks/typedownHooks/useTypedown.js +93 -11
  122. package/src/lib/hooks/useCustomProperties.js +73 -0
  123. package/src/lib/hooks/useMutateCustomProperties.js +62 -0
  124. package/src/lib/hooks/useRefdata.js +2 -8
  125. package/src/lib/utils/index.js +7 -0
  126. package/src/lib/utils/refdataOptions.js +7 -0
  127. package/src/lib/{Settings/utils → utils}/renderHelpText.js +1 -1
  128. package/src/lib/{Settings/utils → utils}/sortByLabel.js +1 -1
  129. package/src/lib/{Settings/utils → utils}/toCamelCase.js +0 -0
  130. package/test/helpers/index.js +1 -0
  131. package/test/helpers/translationsProperties.js +40 -0
  132. package/test/jest/helpers/KintHarness.js +36 -0
  133. package/test/jest/helpers/index.js +2 -0
  134. package/test/jest/helpers/renderWithKintHarness.js +15 -0
  135. package/test/jest/jest-transformer.js +4 -0
  136. package/test/jest/setupTests.js +1 -0
  137. package/translations/stripes-kint-components/en.json +48 -1
  138. package/yarn-error.log +14118 -0
  139. package/babelOptions.js +0 -30
  140. package/es/lib/Settings/EditableSettingsList.js +0 -57
  141. package/es/lib/Settings/EditableSettingsListFieldArray.js +0 -59
  142. package/es/lib/Settings/RefdataButtons.js +0 -100
  143. package/es/lib/Settings/SettingField.js +0 -144
  144. package/es/lib/Settings/SettingPage.js +0 -64
  145. package/es/lib/Settings/SettingPagePane.js +0 -43
  146. package/es/lib/Settings/SettingsContext.js +0 -18
  147. package/es/lib/Settings/index.js +0 -71
  148. package/es/lib/Settings/useSettingSection.js +0 -41
  149. package/es/lib/Settings/useSettings.js +0 -126
  150. package/es/lib/Settings/utils/index.js +0 -31
  151. package/es/lib/Settings/utils/renderHelpText.js +0 -57
  152. package/es/lib/Settings/utils/sortByLabel.js +0 -26
  153. package/es/lib/Settings/utils/toCamelCase.js +0 -19
  154. package/es/lib/TypeDown/TypeDown.js +0 -209
  155. package/es/lib/TypeDown/index.js +0 -15
  156. package/es/lib/hooks/typedownHooks/useTypedownFooter.js +0 -47
  157. package/es/lib/hooks/typedownHooks/useTypedownList.js +0 -45
  158. package/es/lib/hooks/typedownHooks/useTypedownSearchField.js +0 -47
  159. package/es/lib/utils/getFocusableElements.js +0 -132
  160. package/src/lib/Settings/index.js +0 -8
  161. package/src/lib/Settings/utils/index.js +0 -3
  162. package/src/lib/TypeDown/README.md +0 -1
  163. package/src/lib/TypeDown/TypeDown.js +0 -226
  164. package/src/lib/TypeDown/index.js +0 -1
  165. package/src/lib/hooks/typedownHooks/useTypedownFooter.js +0 -43
  166. package/src/lib/hooks/typedownHooks/useTypedownList.js +0 -36
  167. package/src/lib/hooks/typedownHooks/useTypedownSearchField.js +0 -39
  168. package/src/lib/utils/getFocusableElements.js +0 -99
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = void 0;
8
+ exports.default = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -21,14 +21,24 @@ var _components = require("@folio/stripes/components");
21
21
 
22
22
  var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/ActionListFieldArray.css"));
23
23
 
24
- var _excluded = ["actionListActions"],
25
- _excluded2 = ["actionListActions"];
24
+ var _jsxRuntime = require("react/jsx-runtime");
26
25
 
27
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
26
+ var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "editableFields", "fields", "fieldComponents", "visibleFields"],
27
+ _excluded2 = ["actionListActions"],
28
+ _excluded3 = ["actionListActions"],
29
+ _excluded4 = ["actionListActions"],
30
+ _excluded5 = ["formatter"];
31
+
32
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
33
 
29
34
  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); }
30
35
 
31
- 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; }
36
+ 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; }
37
+
38
+ (function () {
39
+ var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
40
+ enterModule && enterModule(module);
41
+ })();
32
42
 
33
43
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
34
44
 
@@ -38,18 +48,14 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
38
48
 
39
49
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
40
50
 
41
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
51
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
42
52
 
43
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
53
+ 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; }
44
54
 
45
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
55
+ 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; }
46
56
 
47
57
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
48
58
 
49
- 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; }
50
-
51
- 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; }
52
-
53
59
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
54
60
 
55
61
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -62,25 +68,39 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
62
68
 
63
69
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
64
70
 
71
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
72
+
73
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
74
+
75
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
76
+ return a;
77
+ };
78
+
65
79
  var EDITING_ACTIONS_WIDTH = 25;
66
80
  var NON_EDITING_ACTIONS_WIDTH = 20;
67
81
  var TOTAL_WIDTH = 100;
68
82
  var propTypes = {
69
- actionAssigner: _propTypes["default"].func,
70
- actionCalls: _propTypes["default"].object,
71
- columnMapping: _propTypes["default"].object,
72
- editableFields: _propTypes["default"].object,
73
- fields: _propTypes["default"].object,
74
- visibleFields: _propTypes["default"].arrayOf(_propTypes["default"].string)
83
+ actionAssigner: _propTypes.default.func,
84
+ actionCalls: _propTypes.default.object,
85
+ columnMapping: _propTypes.default.object,
86
+ creatableFields: _propTypes.default.object,
87
+ editableFields: _propTypes.default.object,
88
+ fields: _propTypes.default.object,
89
+ fieldComponents: _propTypes.default.object,
90
+ formatter: _propTypes.default.object,
91
+ visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
75
92
  };
76
93
 
77
94
  var ActionListFieldArray = function ActionListFieldArray(_ref) {
78
95
  var actionAssigner = _ref.actionAssigner,
79
96
  actionCalls = _ref.actionCalls,
80
97
  columnMapping = _ref.columnMapping,
98
+ creatableFields = _ref.creatableFields,
81
99
  editableFields = _ref.editableFields,
82
100
  fields = _ref.fields,
83
- visibleFields = _ref.visibleFields;
101
+ fieldComponents = _ref.fieldComponents,
102
+ visibleFields = _ref.visibleFields,
103
+ mclProps = _objectWithoutProperties(_ref, _excluded);
84
104
 
85
105
  // Grab finalForm functions/values from form hooks
86
106
  var _useForm = (0, _reactFinalForm.useForm)(),
@@ -114,13 +134,16 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
114
134
  var handleSave = function handleSave(index) {
115
135
  var _fields$value$index = fields.value[index],
116
136
  _a = _fields$value$index.actionListActions,
117
- rowData = _objectWithoutProperties(_fields$value$index, _excluded);
137
+ rowData = _objectWithoutProperties(_fields$value$index, _excluded2);
118
138
 
119
139
  actionCalls.edit(rowData);
120
140
  };
121
141
 
122
142
  var handleCreate = function handleCreate(index) {
123
- var rowData = fields.value[index];
143
+ var _fields$value$index2 = fields.value[index],
144
+ _a = _fields$value$index2.actionListActions,
145
+ rowData = _objectWithoutProperties(_fields$value$index2, _excluded3);
146
+
124
147
  actionCalls.create(rowData);
125
148
  };
126
149
 
@@ -141,74 +164,82 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
141
164
  var fieldName = "contentData[".concat(data.rowIndex, "]");
142
165
 
143
166
  var actions = data.actionListActions,
144
- rest = _objectWithoutProperties(data, _excluded2);
167
+ rest = _objectWithoutProperties(data, _excluded4);
145
168
 
146
169
  if (data.id === editing || !data.id && editing === 'NEW_ROW') {
147
170
  // Render the save/cancel buttons
148
- return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_components.Button, {
149
- key: "save[".concat(data.rowIndex, "]"),
150
- buttonStyle: "primary",
151
- disabled: submitting || pristine,
152
- onClick: function onClick() {
153
- if (!data.id && editing === 'NEW_ROW') {
154
- handleCreate(data.rowIndex);
155
- } else {
156
- handleSave(data.rowIndex);
157
- }
171
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
172
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
173
+ buttonStyle: "primary",
174
+ disabled: submitting || pristine,
175
+ onClick: function onClick() {
176
+ if (!data.id && editing === 'NEW_ROW') {
177
+ handleCreate(data.rowIndex);
178
+ } else {
179
+ handleSave(data.rowIndex);
180
+ }
158
181
 
159
- toggleEditing(data.id);
160
- }
161
- }, /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
162
- id: "stripes-kint-components.actionList.save"
163
- })), /*#__PURE__*/_react["default"].createElement(_components.Button, {
164
- key: "cancel[".concat(data.rowIndex, "]"),
165
- "data-type-button": "cancel",
166
- onClick: function onClick() {
167
- change(fieldName, (0, _get["default"])(initialValues, fieldName));
168
- toggleEditing(data.id);
169
- }
170
- }, /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
171
- id: "stripes-kint-components.actionList.cancel"
172
- })));
182
+ toggleEditing(data.id);
183
+ },
184
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
185
+ id: "stripes-kint-components.actionList.save"
186
+ })
187
+ }, "save[".concat(data.rowIndex, "]")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
188
+ "data-type-button": "cancel",
189
+ onClick: function onClick() {
190
+ if (!data.id && editing === 'NEW_ROW') {
191
+ fields.remove(data.rowIndex);
192
+ toggleEditing('NEW_ROW');
193
+ } else {
194
+ change(fieldName, (0, _get.default)(initialValues, fieldName));
195
+ toggleEditing(data.id);
196
+ }
197
+ },
198
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
199
+ id: "stripes-kint-components.actionList.cancel"
200
+ })
201
+ }, "cancel[".concat(data.rowIndex, "]"))]
202
+ });
173
203
  }
174
204
 
175
- return /*#__PURE__*/_react["default"].createElement("div", null, actions === null || actions === void 0 ? void 0 : actions.map(function (action) {
176
- var _action$label;
205
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
206
+ children: actions === null || actions === void 0 ? void 0 : actions.map(function (action) {
207
+ var _action$label;
208
+
209
+ var actionFunction = function actionFunction() {
210
+ return actionCalls[action.name](rest);
211
+ }; // Edit has special action functionality, revealing fields etc.
212
+
177
213
 
178
- var actionFunction = function actionFunction() {
179
- return actionCalls[action.name](rest);
180
- }; // Edit has special action functionality, revealing fields etc.
214
+ if (action.name === 'edit') {
215
+ actionFunction = function actionFunction() {
216
+ return toggleEditing(data.id);
217
+ };
218
+ } // If we're handed an icon, use that for the action button
181
219
 
182
220
 
183
- if (action.name === 'edit') {
184
- actionFunction = function actionFunction() {
185
- return toggleEditing(data.id);
186
- };
187
- } // If we're handed an icon, use that for the action button
221
+ if (action.icon) {
222
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
223
+ disabled: editing,
224
+ icon: action.icon,
225
+ onClick: actionFunction
226
+ }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
227
+ } // Else return a button with the label, or failing that the name of the action
188
228
 
189
229
 
190
- if (action.icon) {
191
- return /*#__PURE__*/_react["default"].createElement(_components.IconButton, {
192
- key: "action-".concat(action.name, "[").concat(data.rowIndex, "]"),
230
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
193
231
  disabled: editing,
194
- icon: action.icon,
195
- onClick: actionFunction
196
- });
197
- } // Else return a button with the label, or failing that the name of the action
198
-
199
-
200
- return /*#__PURE__*/_react["default"].createElement(_components.Button, {
201
- key: "action-".concat(action.name, "[").concat(data.rowIndex, "]"),
202
- disabled: editing,
203
- onClick: actionFunction
204
- }, (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name);
205
- }));
232
+ onClick: actionFunction,
233
+ children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
234
+ }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
235
+ })
236
+ });
206
237
  };
207
238
 
208
239
  var formatContent = function formatContent() {
209
- return fields.map(function (fieldName) {
240
+ return fields.map(function (fieldName, fieldIndex) {
210
241
  // Fetch the content from the field Values
211
- var cd = (0, _get["default"])(values, fieldName);
242
+ var cd = (0, _get.default)(values, fieldName);
212
243
  cd.actionListActions = actionAssigner(cd); // Row is being edited if it has no id, or its id is in the editing string
213
244
 
214
245
  var editingRow = cd.id === editing || !cd.id;
@@ -226,22 +257,34 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
226
257
 
227
258
  try {
228
259
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
229
- var _editableFields$key;
260
+ var _editableFields$key, _creatableFields$key;
230
261
 
231
262
  var key = _step.value;
232
263
  var editFunction = (_editableFields$key = editableFields[key]) !== null && _editableFields$key !== void 0 ? _editableFields$key : function () {
233
264
  return true;
234
265
  };
266
+ var createFunction = (_creatableFields$key = creatableFields[key]) !== null && _creatableFields$key !== void 0 ? _creatableFields$key : function () {
267
+ return true;
268
+ };
235
269
  /*
236
- Next check if this is a new row, if so we should edit it in a Field
237
- If it does, then we check if the property has an editableField function,
238
- if it does we run it with the data. If not then we just return the Field
270
+ Next check if this is a new row, if so we should run the createableField function with the data.
271
+ If it is not a new row, then we run the editableField function with the data,
272
+ and it should return true/false
273
+ For both checks
274
+ true => Field, false => display value
239
275
  */
240
276
 
241
- if (!cd.id || editFunction(cd)) {
242
- returnObj[key] = /*#__PURE__*/_react["default"].createElement(_reactFinalForm.Field, {
243
- component: _components.TextField,
277
+ if (!cd.id && createFunction(cd) || editFunction(cd)) {
278
+ returnObj[key] = fieldComponents[key] ? fieldComponents[key]({
244
279
  name: "".concat(fieldName, ".").concat(key)
280
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
281
+ autofocus: fieldIndex === 0,
282
+ component: _components.TextField,
283
+ marginBottom0: true,
284
+ name: "".concat(fieldName, ".").concat(key),
285
+ parse: function parse(v) {
286
+ return v;
287
+ }
245
288
  });
246
289
  }
247
290
  }
@@ -256,31 +299,86 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
256
299
  });
257
300
  };
258
301
 
259
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_components.Button, {
260
- buttonClass: _ActionListFieldArray["default"].buttonRight,
261
- disabled: !actionCalls.create,
262
- onClick: function onClick() {
263
- toggleEditing('NEW_ROW');
264
- fields.push({});
265
- }
266
- }, /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
267
- id: "stripes-kint-components.actionList.create"
268
- })), /*#__PURE__*/_react["default"].createElement(_components.MultiColumnList, {
269
- columnMapping: _objectSpread(_objectSpread({}, columnMapping), {}, {
270
- actionListActions: /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
271
- id: "stripes-kint-components.actionList.actions"
302
+ var formatter = mclProps.formatter,
303
+ restOfMclProps = _objectWithoutProperties(mclProps, _excluded5); // Destructure formatter part of mclProps
304
+
305
+
306
+ var fieldAwareFormatter = function fieldAwareFormatter() {
307
+ var returnObj = {}; // For each visible field, if it's being edited then ignore passed formatters, else use them
308
+
309
+ visibleFields.forEach(function (key) {
310
+ returnObj[key] = function (cd) {
311
+ // Row is being edited if it has no id, or its id is in the editing string
312
+ var editingRow = cd.id === editing || !cd.id; // If not editing, use the passed formatter values
313
+
314
+ var returnValue = cd[key];
315
+
316
+ if (!editingRow && formatter[key]) {
317
+ returnValue = formatter[key](cd);
318
+ }
319
+
320
+ return returnValue;
321
+ };
322
+ });
323
+ return returnObj;
324
+ };
325
+
326
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
327
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
328
+ buttonClass: _ActionListFieldArray.default.buttonRight,
329
+ disabled: !actionCalls.create,
330
+ onClick: function onClick() {
331
+ toggleEditing('NEW_ROW');
332
+ fields.push({});
333
+ },
334
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
335
+ id: "stripes-kint-components.actionList.create"
272
336
  })
273
- }),
274
- columnWidths: getColumnWidths(),
275
- contentData: formatContent(),
276
- formatter: {
277
- actionListActions: renderActionButtons
278
- },
279
- interactive: false,
280
- visibleColumns: [].concat(_toConsumableArray(visibleFields), ['actionListActions'])
281
- }));
337
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
338
+ columnMapping: _objectSpread(_objectSpread({}, columnMapping), {}, {
339
+ actionListActions: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
340
+ id: "stripes-kint-components.actionList.actions"
341
+ })
342
+ }),
343
+ columnWidths: getColumnWidths(),
344
+ contentData: formatContent(),
345
+ formatter: _objectSpread({
346
+ actionListActions: renderActionButtons
347
+ }, fieldAwareFormatter()),
348
+ interactive: false,
349
+ visibleColumns: [].concat(_toConsumableArray(visibleFields), ['actionListActions'])
350
+ }, restOfMclProps))]
351
+ });
282
352
  };
283
353
 
354
+ __signature__(ActionListFieldArray, "useForm{{ change }}\nuseFormState{{ initialValues, pristine, submitting, values }}\nuseState{[editing, setEditing](null)}", function () {
355
+ return [_reactFinalForm.useForm, _reactFinalForm.useFormState];
356
+ });
357
+
284
358
  ActionListFieldArray.propTypes = propTypes;
285
359
  var _default = ActionListFieldArray;
286
- exports["default"] = _default;
360
+ var _default2 = _default;
361
+ exports.default = _default2;
362
+ ;
363
+
364
+ (function () {
365
+ var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
366
+
367
+ if (!reactHotLoader) {
368
+ return;
369
+ }
370
+
371
+ reactHotLoader.register(EDITING_ACTIONS_WIDTH, "EDITING_ACTIONS_WIDTH", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionListFieldArray.js");
372
+ reactHotLoader.register(NON_EDITING_ACTIONS_WIDTH, "NON_EDITING_ACTIONS_WIDTH", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionListFieldArray.js");
373
+ reactHotLoader.register(TOTAL_WIDTH, "TOTAL_WIDTH", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionListFieldArray.js");
374
+ reactHotLoader.register(propTypes, "propTypes", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionListFieldArray.js");
375
+ reactHotLoader.register(ActionListFieldArray, "ActionListFieldArray", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionListFieldArray.js");
376
+ reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/ActionList/ActionListFieldArray.js");
377
+ })();
378
+
379
+ ;
380
+
381
+ (function () {
382
+ var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
383
+ leaveModule && leaveModule(module);
384
+ })();
@@ -3,13 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "ActionList", {
6
+ Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function get() {
9
- return _ActionList["default"];
9
+ return _ActionList.default;
10
10
  }
11
11
  });
12
12
 
13
13
  var _ActionList = _interopRequireDefault(require("./ActionList"));
14
14
 
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+
17
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
18
+ return a;
19
+ };
@@ -0,0 +1,198 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _reactIntl = require("react-intl");
13
+
14
+ var _debounce = _interopRequireDefault(require("lodash/debounce"));
15
+
16
+ var _components = require("@folio/stripes/components");
17
+
18
+ var _SearchField = _interopRequireDefault(require("../../SearchField"));
19
+
20
+ var _hooks = require("../../hooks");
21
+
22
+ var _jsxRuntime = require("react/jsx-runtime");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
26
+ (function () {
27
+ var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
28
+ enterModule && enterModule(module);
29
+ })();
30
+
31
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
+
33
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
34
+
35
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
36
+
37
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
38
+
39
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
40
+
41
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
42
+
43
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
44
+
45
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
46
+
47
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
48
+
49
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
50
+ return a;
51
+ };
52
+
53
+ var DEBOUNCE_TIME = 500;
54
+
55
+ var CustomPropertiesLookup = function CustomPropertiesLookup(_ref) {
56
+ var _labelOverrides$label, _labelOverrides$prima, _labelOverrides$ctx, _labelOverrides$weigh, _labelOverrides$type, _labelOverrides$categ;
57
+
58
+ var contextFilterOptions = _ref.contextFilterOptions,
59
+ endpoint = _ref.customPropertiesEndpoint,
60
+ labelOverrides = _ref.labelOverrides,
61
+ mclProps = _ref.mclProps,
62
+ onSelectCustomProperty = _ref.onSelectCustomProperty,
63
+ queryParams = _ref.queryParams;
64
+
65
+ var _useState = (0, _react.useState)({
66
+ sort: 'id'
67
+ }),
68
+ _useState2 = _slicedToArray(_useState, 2),
69
+ nsValues = _useState2[0],
70
+ setNsValues = _useState2[1];
71
+
72
+ var _useState3 = (0, _react.useState)(),
73
+ _useState4 = _slicedToArray(_useState3, 2),
74
+ selectedContext = _useState4[0],
75
+ setSelectedContext = _useState4[1];
76
+
77
+ var _useCustomProperties = (0, _hooks.useCustomProperties)({
78
+ endpoint: endpoint,
79
+ nsValues: nsValues,
80
+ queryParams: queryParams,
81
+ returnQueryObject: true,
82
+ ctx: selectedContext
83
+ }),
84
+ custprops = _useCustomProperties.data,
85
+ isLoading = _useCustomProperties.isLoading;
86
+
87
+ var handleSearch = (0, _debounce.default)(function (query) {
88
+ setNsValues(_objectSpread(_objectSpread({}, nsValues), {}, {
89
+ query: query
90
+ }));
91
+ }, DEBOUNCE_TIME);
92
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
93
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchField.default, {
94
+ fullWidth: true,
95
+ onChange: function onChange(e) {
96
+ return handleSearch(e.target.value);
97
+ }
98
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Row, {
99
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
100
+ xs: 6,
101
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
102
+ dataOptions: contextFilterOptions,
103
+ onChange: function onChange(e) {
104
+ setSelectedContext(e.target.value);
105
+ },
106
+ value: selectedContext
107
+ })
108
+ })
109
+ }), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
110
+ columnMapping: {
111
+ 'label': (_labelOverrides$label = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.label) !== null && _labelOverrides$label !== void 0 ? _labelOverrides$label : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
112
+ id: "stripes-kint-components.customProperties.label"
113
+ }),
114
+ 'primary': (_labelOverrides$prima = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primary) !== null && _labelOverrides$prima !== void 0 ? _labelOverrides$prima : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
115
+ id: "stripes-kint-components.customProperties.primary"
116
+ }),
117
+ 'ctx': (_labelOverrides$ctx = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx) !== null && _labelOverrides$ctx !== void 0 ? _labelOverrides$ctx : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
118
+ id: "stripes-kint-components.customProperties.ctx"
119
+ }),
120
+ 'weight': (_labelOverrides$weigh = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.weight) !== null && _labelOverrides$weigh !== void 0 ? _labelOverrides$weigh : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
121
+ id: "stripes-kint-components.customProperties.weight"
122
+ }),
123
+ 'type': (_labelOverrides$type = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.type) !== null && _labelOverrides$type !== void 0 ? _labelOverrides$type : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
124
+ id: "stripes-kint-components.customProperties.type"
125
+ }),
126
+ 'category': (_labelOverrides$categ = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.category) !== null && _labelOverrides$categ !== void 0 ? _labelOverrides$categ : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
127
+ id: "stripes-kint-components.customProperties.category"
128
+ })
129
+ },
130
+ contentData: custprops,
131
+ formatter: {
132
+ primary: function primary(data) {
133
+ if (data !== null && data !== void 0 && data.primary) {
134
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
135
+ id: "stripes-kint-components.yes"
136
+ });
137
+ } else {
138
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
139
+ id: "stripes-kint-components.no"
140
+ });
141
+ }
142
+ },
143
+ type: function type(data) {
144
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
145
+ id: "stripes-kint-components.customProperties.type.".concat(data === null || data === void 0 ? void 0 : data.type)
146
+ });
147
+ },
148
+ category: function category(data) {
149
+ var _data$category;
150
+
151
+ return data === null || data === void 0 ? void 0 : (_data$category = data.category) === null || _data$category === void 0 ? void 0 : _data$category.desc;
152
+ }
153
+ },
154
+ onRowClick: onSelectCustomProperty,
155
+ visibleColumns: ['label', 'primary', 'ctx', 'weight', 'type', 'category']
156
+ }, mclProps))]
157
+ });
158
+ };
159
+
160
+ __signature__(CustomPropertiesLookup, "useState{[nsValues, setNsValues]({\n sort: 'id'\n })}\nuseState{[selectedContext, setSelectedContext]}\nuseCustomProperties{{ data: custprops, isLoading }}", function () {
161
+ return [_hooks.useCustomProperties];
162
+ });
163
+
164
+ CustomPropertiesLookup.propTypes = {
165
+ contextFilterOptions: _propTypes.default.arrayOf(_propTypes.default.shape({
166
+ value: _propTypes.default.string,
167
+ label: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.string])
168
+ })),
169
+ customPropertiesEndpoint: _propTypes.default.string,
170
+ labelOverrides: _propTypes.default.object,
171
+ mclProps: _propTypes.default.object,
172
+ onSelectCustomProperty: _propTypes.default.func,
173
+ queryParams: _propTypes.default.object,
174
+ refdataEndpoint: _propTypes.default.string
175
+ };
176
+ var _default = CustomPropertiesLookup;
177
+ var _default2 = _default;
178
+ exports.default = _default2;
179
+ ;
180
+
181
+ (function () {
182
+ var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
183
+
184
+ if (!reactHotLoader) {
185
+ return;
186
+ }
187
+
188
+ reactHotLoader.register(DEBOUNCE_TIME, "DEBOUNCE_TIME", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertiesLookup.js");
189
+ reactHotLoader.register(CustomPropertiesLookup, "CustomPropertiesLookup", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertiesLookup.js");
190
+ reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertiesLookup.js");
191
+ })();
192
+
193
+ ;
194
+
195
+ (function () {
196
+ var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
197
+ leaveModule && leaveModule(module);
198
+ })();