@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
@@ -3,9 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.default = void 0;
7
7
  var _excluded = ["searchKey", "filterKeys", "sortKeys", "stats"];
8
8
 
9
+ (function () {
10
+ var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
11
+ enterModule && enterModule(module);
12
+ })();
13
+
9
14
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
15
 
11
16
  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; }
@@ -32,6 +37,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
32
37
 
33
38
  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; }
34
39
 
40
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
41
+ return a;
42
+ };
43
+
35
44
  var generateKiwtQueryParams = function generateKiwtQueryParams(options, nsValues) {
36
45
  var qindex = nsValues.qindex,
37
46
  query = nsValues.query,
@@ -122,4 +131,24 @@ var generateKiwtQueryParams = function generateKiwtQueryParams(options, nsValues
122
131
  };
123
132
 
124
133
  var _default = generateKiwtQueryParams;
125
- exports["default"] = _default;
134
+ var _default2 = _default;
135
+ exports.default = _default2;
136
+ ;
137
+
138
+ (function () {
139
+ var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
140
+
141
+ if (!reactHotLoader) {
142
+ return;
143
+ }
144
+
145
+ reactHotLoader.register(generateKiwtQueryParams, "generateKiwtQueryParams", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/generateKiwtQueryParams.js");
146
+ reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/generateKiwtQueryParams.js");
147
+ })();
148
+
149
+ ;
150
+
151
+ (function () {
152
+ var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
153
+ leaveModule && leaveModule(module);
154
+ })();
@@ -6,25 +6,49 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "buildUrl", {
7
7
  enumerable: true,
8
8
  get: function get() {
9
- return _buildUrl["default"];
9
+ return _buildUrl.default;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "generateKiwtQuery", {
13
13
  enumerable: true,
14
14
  get: function get() {
15
- return _generateKiwtQuery["default"];
15
+ return _generateKiwtQuery.default;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "generateKiwtQueryParams", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _generateKiwtQueryParams["default"];
21
+ return _generateKiwtQueryParams.default;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "refdataOptions", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _refdataOptions.default;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "renderHelpText", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _renderHelpText.default;
22
34
  }
23
35
  });
24
36
  Object.defineProperty(exports, "selectorSafe", {
25
37
  enumerable: true,
26
38
  get: function get() {
27
- return _selectorSafe["default"];
39
+ return _selectorSafe.default;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "sortByLabel", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _sortByLabel.default;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "toCamelCase", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _toCamelCase.default;
28
52
  }
29
53
  });
30
54
 
@@ -36,4 +60,16 @@ var _selectorSafe = _interopRequireDefault(require("./selectorSafe"));
36
60
 
37
61
  var _buildUrl = _interopRequireDefault(require("./buildUrl"));
38
62
 
39
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
63
+ var _refdataOptions = _interopRequireDefault(require("./refdataOptions"));
64
+
65
+ var _renderHelpText = _interopRequireDefault(require("./renderHelpText"));
66
+
67
+ var _sortByLabel = _interopRequireDefault(require("./sortByLabel"));
68
+
69
+ var _toCamelCase = _interopRequireDefault(require("./toCamelCase"));
70
+
71
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
72
+
73
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
74
+ return a;
75
+ }; // I hate that this exists
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ (function () {
9
+ var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
10
+ enterModule && enterModule(module);
11
+ })();
12
+
13
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
14
+ return a;
15
+ };
16
+
17
+ var _default = {
18
+ filterKeys: {
19
+ DescKey: 'desc'
20
+ },
21
+ stats: false,
22
+ max: 100
23
+ };
24
+ var _default2 = _default;
25
+ exports.default = _default2;
26
+ ;
27
+
28
+ (function () {
29
+ var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
30
+
31
+ if (!reactHotLoader) {
32
+ return;
33
+ }
34
+
35
+ reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/refdataOptions.js");
36
+ })();
37
+
38
+ ;
39
+
40
+ (function () {
41
+ var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
42
+ leaveModule && leaveModule(module);
43
+ })();
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactIntl = require("react-intl");
11
+
12
+ var _renderHelpText = _interopRequireDefault(require("../../../styles/renderHelpText.css"));
13
+
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ (function () {
19
+ var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
20
+ enterModule && enterModule(module);
21
+ })();
22
+
23
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
24
+ return a;
25
+ };
26
+
27
+ var renderHelpText = function renderHelpText(id) {
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
29
+ className: _renderHelpText.default.help,
30
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
31
+ id: id,
32
+ values: {
33
+ b: function b(chunks) {
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("b", {
35
+ children: chunks
36
+ });
37
+ },
38
+ i: function i(chunks) {
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
40
+ children: chunks
41
+ });
42
+ },
43
+ em: function em(chunks) {
44
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("em", {
45
+ children: chunks
46
+ });
47
+ },
48
+ strong: function strong(chunks) {
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
50
+ children: chunks
51
+ });
52
+ },
53
+ span: function span(chunks) {
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
55
+ children: chunks
56
+ });
57
+ },
58
+ div: function div(chunks) {
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
60
+ children: chunks
61
+ });
62
+ },
63
+ p: function p(chunks) {
64
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
65
+ children: chunks
66
+ });
67
+ },
68
+ ul: function ul(chunks) {
69
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
70
+ children: chunks
71
+ });
72
+ },
73
+ ol: function ol(chunks) {
74
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("ol", {
75
+ children: chunks
76
+ });
77
+ },
78
+ li: function li(chunks) {
79
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
80
+ children: chunks
81
+ });
82
+ }
83
+ }
84
+ })
85
+ });
86
+ };
87
+
88
+ var _default = renderHelpText;
89
+ var _default2 = _default;
90
+ exports.default = _default2;
91
+ ;
92
+
93
+ (function () {
94
+ var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
95
+
96
+ if (!reactHotLoader) {
97
+ return;
98
+ }
99
+
100
+ reactHotLoader.register(renderHelpText, "renderHelpText", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/renderHelpText.js");
101
+ reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/renderHelpText.js");
102
+ })();
103
+
104
+ ;
105
+
106
+ (function () {
107
+ var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
108
+ leaveModule && leaveModule(module);
109
+ })();
@@ -3,11 +3,40 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.default = void 0;
7
+
8
+ (function () {
9
+ var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
10
+ enterModule && enterModule(module);
11
+ })();
12
+
13
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
14
+ return a;
15
+ };
7
16
 
8
17
  var selectorSafe = function selectorSafe(string) {
9
18
  return string.replaceAll(/[^a-zA-Z0-9\-_]/g, '_');
10
19
  };
11
20
 
12
21
  var _default = selectorSafe;
13
- exports["default"] = _default;
22
+ var _default2 = _default;
23
+ exports.default = _default2;
24
+ ;
25
+
26
+ (function () {
27
+ var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
28
+
29
+ if (!reactHotLoader) {
30
+ return;
31
+ }
32
+
33
+ reactHotLoader.register(selectorSafe, "selectorSafe", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/selectorSafe.js");
34
+ reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/selectorSafe.js");
35
+ })();
36
+
37
+ ;
38
+
39
+ (function () {
40
+ var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
41
+ leaveModule && leaveModule(module);
42
+ })();
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ (function () {
9
+ var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
10
+ enterModule && enterModule(module);
11
+ })();
12
+
13
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
14
+ return a;
15
+ };
16
+
17
+ var sortByLabel = function sortByLabel(a, b) {
18
+ var _a$label$toLowerCase, _a$label, _a$id, _b$label$toLowerCase, _b$label, _b$id;
19
+
20
+ var al = (_a$label$toLowerCase = (_a$label = a.label) === null || _a$label === void 0 ? void 0 : _a$label.toLowerCase()) !== null && _a$label$toLowerCase !== void 0 ? _a$label$toLowerCase : (_a$id = a.id) === null || _a$id === void 0 ? void 0 : _a$id.toLowerCase();
21
+ var bl = (_b$label$toLowerCase = (_b$label = b.label) === null || _b$label === void 0 ? void 0 : _b$label.toLowerCase()) !== null && _b$label$toLowerCase !== void 0 ? _b$label$toLowerCase : (_b$id = b.id) === null || _b$id === void 0 ? void 0 : _b$id.toLowerCase();
22
+
23
+ if (al < bl) {
24
+ return -1;
25
+ }
26
+
27
+ if (al > bl) {
28
+ return 1;
29
+ }
30
+
31
+ return 0;
32
+ };
33
+
34
+ var _default = sortByLabel;
35
+ var _default2 = _default;
36
+ exports.default = _default2;
37
+ ;
38
+
39
+ (function () {
40
+ var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
41
+
42
+ if (!reactHotLoader) {
43
+ return;
44
+ }
45
+
46
+ reactHotLoader.register(sortByLabel, "sortByLabel", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/sortByLabel.js");
47
+ reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/sortByLabel.js");
48
+ })();
49
+
50
+ ;
51
+
52
+ (function () {
53
+ var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
54
+ leaveModule && leaveModule(module);
55
+ })();
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ (function () {
9
+ var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
10
+ enterModule && enterModule(module);
11
+ })();
12
+
13
+ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
14
+ return a;
15
+ };
16
+
17
+ var toCamelCase = function toCamelCase(str) {
18
+ return (// First split string on any capital letters
19
+ str.split(/(?=[A-Z])/).join(' ') // Remove all non alpha-numeric chars, and replace _ with ' '
20
+ .replace(/[_]/gi, ' ').replace(/[^0-9a-zA-Z\s]/gi, '') // CamelCase the remains
21
+ .replace(/(?:^\w|[A-Z]|\b\w)/g, function (ltr, idx) {
22
+ return idx === 0 ? ltr.toLowerCase() : ltr.toUpperCase();
23
+ }).replace(/\s+/g, '')
24
+ );
25
+ };
26
+
27
+ var _default = toCamelCase;
28
+ var _default2 = _default;
29
+ exports.default = _default2;
30
+ ;
31
+
32
+ (function () {
33
+ var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
34
+
35
+ if (!reactHotLoader) {
36
+ return;
37
+ }
38
+
39
+ reactHotLoader.register(toCamelCase, "toCamelCase", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/toCamelCase.js");
40
+ reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/toCamelCase.js");
41
+ })();
42
+
43
+ ;
44
+
45
+ (function () {
46
+ var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
47
+ leaveModule && leaveModule(module);
48
+ })();
package/jest.config.js CHANGED
@@ -1 +1,15 @@
1
- module.exports = require('@folio/stripes-erm-components/jest.config');
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+ const path = require('path');
3
+ const jestConfig = require('@folio/stripes-erm-components/jest.config');
4
+
5
+ const thisConfig = {
6
+ ...jestConfig,
7
+ rootDir: 'src',
8
+ transform: { '^.+\\.(js|jsx)$': path.join(__dirname, './test/jest/jest-transformer.js') },
9
+ moduleDirectories: ['node_modules'],
10
+ setupFiles: [
11
+ path.join(__dirname, './test/jest/setupTests.js')
12
+ ]
13
+ };
14
+
15
+ module.exports = thisConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "1.5.0",
3
+ "version": "2.0.0",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -10,7 +10,7 @@
10
10
  "node": ">=10.0.0"
11
11
  },
12
12
  "scripts": {
13
- "lint": "eslint lib",
13
+ "lint": "eslint src",
14
14
  "test": "yarn run test:jest",
15
15
  "test:jest": "jest --ci --coverage",
16
16
  "build:es": "rm -rf ./es && babel --extensions .js --ignore ./src/**/tests/**/* ./src --out-dir es",
@@ -20,7 +20,10 @@
20
20
  "prepare": "yarn build"
21
21
  },
22
22
  "dependencies": {
23
- "react-resize-detector": "^6.7.6"
23
+ "react-resize-detector": "^6.7.6",
24
+ "@rehooks/local-storage": "2.4.0",
25
+ "@folio/react-intl-safe-html": "^3.1.0",
26
+ "compose-function": "^3.0.3"
24
27
  },
25
28
  "devDependencies": {
26
29
  "@babel/cli": "^7.11.6",
@@ -29,13 +32,17 @@
29
32
  "@babel/plugin-proposal-decorators": "^7.12.1",
30
33
  "@babel/plugin-proposal-function-sent": "^7.14.5",
31
34
  "@babel/plugin-proposal-throw-expressions": "^7.14.5",
35
+ "@babel/plugin-transform-runtime": "^7.16.4",
32
36
  "@babel/preset-env": "^7.11.5",
33
37
  "@babel/preset-react": "^7.12.5",
34
- "@folio/eslint-config-stripes": "^5.1.0",
38
+ "@folio/eslint-config-stripes": "^6.0.0",
39
+ "@folio/stripes-erm-components": "^6.0.0",
40
+ "@folio/stripes-testing": "^4.0.0",
35
41
  "@testing-library/dom": "^7.26.5",
36
42
  "@testing-library/jest-dom": "^5.11.5",
37
43
  "@testing-library/react": "^11.1.1",
38
44
  "@testing-library/user-event": "^12.2.0",
45
+ "@folio/stripes-cli": ">=2.4.0",
39
46
  "babel-eslint": "^10.1.0",
40
47
  "babel-jest": "^26.6.3",
41
48
  "babel-plugin-const-enum": "^1.0.1",
@@ -45,7 +52,7 @@
45
52
  "babel-polyfill": "^6.26.0",
46
53
  "eslint": "^6.2.1",
47
54
  "eslint-plugin-import": "^2.22.1",
48
- "eslint-plugin-jest": "^24.1.0",
55
+ "eslint-plugin-jest": "^24.1.3",
49
56
  "eslint-plugin-jest-dom": "^3.2.4",
50
57
  "eslint-plugin-testing-library": "^3.10.0",
51
58
  "jest": "^26.6.3",
@@ -54,18 +61,20 @@
54
61
  "jest-junit": "^12.0.0",
55
62
  "react": "^16.6.3",
56
63
  "react-dom": "^16.6.3",
57
- "react-router-dom": "^5.2.0"
64
+ "react-router-dom": "^5.2.0",
65
+ "@folio/stripes": ">=7.0.3",
66
+ "react-intl": ">=5.8.1",
67
+ "regenerator-runtime": "^0.13.9"
58
68
  },
59
69
  "peerDependencies": {
60
- "@folio/stripes": ">=6.1.4",
61
- "@folio/stripes-cli": ">=2.1.1",
70
+ "@folio/stripes": ">=7.0.3",
71
+ "classnames": ">=2.2.6",
62
72
  "final-form": ">=4.18.4",
63
73
  "final-form-arrays": ">=3.0.1",
74
+ "lodash": ">=4.17.0",
64
75
  "prop-types": ">=15.6.0",
65
76
  "prop-types-extra": ">=1.1.0",
66
- "lodash": ">=4.17.0",
67
77
  "query-string": ">=6.6.0",
68
- "classnames": ">=2.2.6",
69
78
  "react": "*",
70
79
  "react-final-form": ">=6.3.0",
71
80
  "react-final-form-arrays": ">=3.1.0",
package/src/index.js CHANGED
@@ -1,40 +1,43 @@
1
1
  // Useful hooks
2
2
  export {
3
3
  useActiveElement,
4
+ useCustomProperties,
4
5
  useHelperApp,
5
6
  useKiwtFieldArray,
6
7
  useKiwtSASQuery,
7
8
  useLocalStorageState,
9
+ useMutateCustomProperties,
8
10
  useMutateRefdataValue,
9
11
  useQIndex,
10
12
  useRefdata,
11
13
  useTemplates,
14
+ useSettings
12
15
  } from './lib/hooks';
13
16
 
14
17
  // Useful utility functions
15
18
  export {
16
19
  generateKiwtQuery,
17
20
  generateKiwtQueryParams,
21
+ refdataOptions,
18
22
  selectorSafe
19
23
  } from './lib/utils';
20
24
 
21
- // Settings Components
25
+ // Contexts
22
26
  export {
23
27
  SettingsContext,
28
+ } from './lib/contexts';
29
+
30
+ // Setting Page Components
31
+ export {
24
32
  SettingPage,
25
33
  SettingPagePane,
26
- useSettings
27
- } from './lib/Settings';
34
+ } from './lib/SettingPage';
28
35
 
29
36
  // ActionList & RefdataEditor components
30
- export { ActionList } from './lib/ActionList';
31
- export { EditableRefdataList } from './lib/EditableRefdataList';
37
+ export { default as ActionList } from './lib/ActionList';
38
+ export { default as EditableRefdataList } from './lib/EditableRefdataList';
32
39
 
33
40
  // Typedown
34
- export {
35
- default as TypeDown
36
- } from './lib/TypeDown';
37
-
38
41
  export {
39
42
  default as Typedown
40
43
  } from './lib/Typedown';
@@ -64,4 +67,16 @@ export {
64
67
  } from './lib/SASQViewComponent';
65
68
 
66
69
  // NoResultsMessage
67
- export { NoResultsMessage } from './lib/NoResultsMessage';
70
+ export { default as NoResultsMessage } from './lib/NoResultsMessage';
71
+
72
+ // RefdataButtons
73
+ export { default as RefdataButtons } from './lib/RefdataButtons';
74
+
75
+ // Custom properties
76
+ export {
77
+ CustomPropertiesLookup,
78
+ CustomPropertiesSettings,
79
+ CustomPropertiesView
80
+ } from './lib/CustomProperties/Config';
81
+
82
+ export * as customPropertyContants from './lib/constants/customProperties';
@@ -12,7 +12,9 @@ const propTypes = {
12
12
  actionCalls: PropTypes.object,
13
13
  columnMapping: PropTypes.object,
14
14
  contentData: PropTypes.arrayOf(PropTypes.object),
15
+ creatableFields: PropTypes.object,
15
16
  editableFields: PropTypes.object,
17
+ fieldComponents: PropTypes.object,
16
18
  visibleFields: PropTypes.arrayOf(PropTypes.string)
17
19
  };
18
20
 
@@ -21,31 +23,39 @@ const ActionList = ({
21
23
  actionCalls = {},
22
24
  columnMapping,
23
25
  contentData,
26
+ creatableFields = {},
24
27
  editableFields = {},
25
- visibleFields
28
+ fieldComponents = {},
29
+ visibleFields,
30
+ ...mclProps // Assume anything left over is to directly apply to the MCL
26
31
  }) => {
27
32
  return (
28
- <Form
29
- enableReinitialize
30
- initialValues={{ contentData }}
31
- mutators={arrayMutators}
32
- onSubmit={actionCalls.edit}
33
- subscription={{ contentData: true }}
34
- >
35
- {({ handleSubmit }) => (
36
- <form onSubmit={handleSubmit}>
37
- <FieldArray
38
- actionAssigner={actionAssigner}
39
- actionCalls={actionCalls}
40
- columnMapping={columnMapping}
41
- component={ActionListFieldArray}
42
- editableFields={editableFields}
43
- name="contentData"
44
- visibleFields={visibleFields}
45
- />
46
- </form>
47
- )}
48
- </Form>
33
+ <>
34
+ <Form
35
+ enableReinitialize
36
+ initialValues={{ contentData }}
37
+ mutators={arrayMutators}
38
+ onSubmit={actionCalls.edit}
39
+ subscription={{ contentData: true }}
40
+ >
41
+ {() => (
42
+ <form onSubmit={e => { e.preventDefault(); }}>
43
+ <FieldArray
44
+ actionAssigner={actionAssigner}
45
+ actionCalls={actionCalls}
46
+ columnMapping={columnMapping}
47
+ component={ActionListFieldArray}
48
+ creatableFields={creatableFields}
49
+ editableFields={editableFields}
50
+ fieldComponents={fieldComponents}
51
+ name="contentData"
52
+ visibleFields={visibleFields}
53
+ {...mclProps}
54
+ />
55
+ </form>
56
+ )}
57
+ </Form>
58
+ </>
49
59
  );
50
60
  };
51
61