@k-int/stripes-kint-components 2.2.0 → 2.3.2

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 (274) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/es/index.js +125 -9
  3. package/es/lib/ActionList/ActionList.js +8 -33
  4. package/es/lib/ActionList/ActionListFieldArray.js +50 -49
  5. package/es/lib/ActionList/index.js +1 -5
  6. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +1 -35
  7. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +3 -39
  8. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +1 -34
  9. package/es/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +4 -33
  10. package/es/lib/CustomProperties/Config/index.js +7 -9
  11. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +43 -0
  12. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +100 -0
  13. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +243 -0
  14. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +337 -0
  15. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +127 -0
  16. package/es/lib/CustomProperties/Edit/index.js +47 -0
  17. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +183 -0
  18. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +204 -0
  19. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +126 -0
  20. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +90 -0
  21. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +139 -0
  22. package/es/lib/CustomProperties/Filter/index.js +55 -0
  23. package/es/lib/CustomProperties/Filter/useOperators.js +100 -0
  24. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +64 -0
  25. package/es/lib/CustomProperties/Filter/useValueProps.js +67 -0
  26. package/es/lib/CustomProperties/View/CustomPropertiesView.js +44 -0
  27. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +155 -0
  28. package/es/lib/CustomProperties/View/CustomPropertyCard.js +175 -0
  29. package/es/lib/CustomProperties/View/index.js +31 -0
  30. package/es/lib/CustomProperties/index.js +121 -0
  31. package/es/lib/EditableRefdataList/EditableRefdataList.js +13 -51
  32. package/es/lib/EditableRefdataList/index.js +1 -5
  33. package/es/lib/EditableSettingsList/EditableSettingsList.js +1 -30
  34. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +1 -30
  35. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +1 -30
  36. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +1 -34
  37. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +1 -34
  38. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +1 -34
  39. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -41
  40. package/es/lib/EditableSettingsList/SettingField/SettingField.js +1 -34
  41. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +1 -30
  42. package/es/lib/EditableSettingsList/SettingField/index.js +1 -5
  43. package/es/lib/EditableSettingsList/index.js +1 -5
  44. package/es/lib/FormModal/FormModal.js +21 -34
  45. package/es/lib/FormModal/index.js +1 -5
  46. package/es/lib/NoResultsMessage/NoResultsMessage.js +1 -30
  47. package/es/lib/NoResultsMessage/index.js +1 -5
  48. package/es/lib/QueryTypedown/QueryTypedown.js +9 -37
  49. package/es/lib/QueryTypedown/index.js +1 -5
  50. package/es/lib/RefdataButtons/RefdataButtons.js +1 -34
  51. package/es/lib/RefdataButtons/index.js +1 -5
  52. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +1 -34
  53. package/es/lib/SASQLookupComponent/index.js +1 -5
  54. package/es/lib/SASQRoute/SASQRoute.js +1 -30
  55. package/es/lib/SASQRoute/index.js +1 -5
  56. package/es/lib/SASQViewComponent/SASQViewComponent.js +1 -34
  57. package/es/lib/SASQViewComponent/index.js +1 -5
  58. package/es/lib/SearchField/SearchField.js +1 -31
  59. package/es/lib/SearchField/index.js +1 -5
  60. package/es/lib/SettingPage/SettingPage.js +1 -34
  61. package/es/lib/SettingPage/SettingPagePane.js +1 -32
  62. package/es/lib/SettingPage/index.js +1 -5
  63. package/es/lib/Typedown/Typedown.js +1 -34
  64. package/es/lib/Typedown/index.js +1 -5
  65. package/es/lib/constants/customProperties.js +3 -37
  66. package/es/lib/constants/eventCodes.js +1 -31
  67. package/es/lib/contexts/SettingsContext.js +1 -30
  68. package/es/lib/contexts/index.js +1 -5
  69. package/es/lib/hooks/index.js +16 -4
  70. package/es/lib/hooks/settingsHooks/index.js +1 -5
  71. package/es/lib/hooks/settingsHooks/useSettingSection.js +1 -34
  72. package/es/lib/hooks/settingsHooks/useSettings.js +1 -36
  73. package/es/lib/hooks/typedownHooks/index.js +1 -5
  74. package/es/lib/hooks/typedownHooks/useTypedown.js +1 -34
  75. package/es/lib/hooks/typedownHooks/useTypedownData.js +9 -35
  76. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +1 -34
  77. package/es/lib/hooks/useActiveElement.js +1 -32
  78. package/es/lib/hooks/useAvailableCustomProperties.js +73 -0
  79. package/es/lib/hooks/useCustomProperties.js +1 -34
  80. package/es/lib/hooks/useHelperApp.js +1 -34
  81. package/es/lib/hooks/useInvalidateRefdata.js +20 -0
  82. package/es/lib/hooks/useKiwtFieldArray.js +1 -34
  83. package/es/lib/hooks/useKiwtSASQuery.js +1 -35
  84. package/es/lib/hooks/useLocalStorageState.js +1 -34
  85. package/es/lib/hooks/useMutateCustomProperties.js +1 -34
  86. package/es/lib/hooks/useMutateRefdataValue.js +10 -38
  87. package/es/lib/hooks/useQIndex.js +1 -34
  88. package/es/lib/hooks/useRefdata.js +2 -37
  89. package/es/lib/hooks/useTemplates.js +1 -34
  90. package/es/lib/utils/buildUrl.js +2 -31
  91. package/es/lib/utils/generateKiwtQuery.js +1 -30
  92. package/es/lib/utils/generateKiwtQueryParams.js +1 -30
  93. package/es/lib/utils/groupCustomPropertiesByCtx.js +41 -0
  94. package/es/lib/utils/index.js +25 -5
  95. package/es/lib/utils/refdataOptions.js +1 -30
  96. package/es/lib/utils/refdataQueryKey.js +19 -0
  97. package/es/lib/utils/renderHelpText.js +1 -30
  98. package/es/lib/utils/selectorSafe.js +1 -30
  99. package/es/lib/utils/sortByLabel.js +1 -30
  100. package/es/lib/utils/toCamelCase.js +1 -30
  101. package/es/lib/utils/typedownQueryKey.js +19 -0
  102. package/es/lib/utils/validators.js +59 -31
  103. package/git_translate.sh +8 -0
  104. package/package.json +1 -1
  105. package/src/index.js +27 -3
  106. package/src/lib/ActionList/ActionList.js +5 -2
  107. package/src/lib/ActionList/ActionListFieldArray.js +31 -9
  108. package/src/lib/ActionList/README.md +23 -20
  109. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +2 -2
  110. package/src/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +3 -3
  111. package/src/lib/CustomProperties/Config/index.js +1 -1
  112. package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +35 -0
  113. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +85 -0
  114. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +194 -0
  115. package/src/lib/CustomProperties/Edit/CustomPropertyField.js +299 -0
  116. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +131 -0
  117. package/src/lib/CustomProperties/Edit/index.js +5 -0
  118. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +125 -0
  119. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +148 -0
  120. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +113 -0
  121. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +74 -0
  122. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +122 -0
  123. package/src/lib/CustomProperties/Filter/index.js +6 -0
  124. package/src/lib/CustomProperties/Filter/useOperators.js +55 -0
  125. package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +35 -0
  126. package/src/lib/CustomProperties/Filter/useValueProps.js +45 -0
  127. package/src/lib/CustomProperties/View/CustomPropertiesView.js +36 -0
  128. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +112 -0
  129. package/src/lib/CustomProperties/View/CustomPropertyCard.js +177 -0
  130. package/src/lib/CustomProperties/View/index.js +3 -0
  131. package/src/lib/CustomProperties/index.js +30 -0
  132. package/src/lib/EditableRefdataList/EditableRefdataList.js +13 -10
  133. package/src/lib/FormModal/FormModal.js +39 -17
  134. package/src/lib/QueryTypedown/QueryTypedown.js +3 -1
  135. package/src/lib/constants/customProperties.js +1 -0
  136. package/src/lib/hooks/index.js +2 -0
  137. package/src/lib/hooks/typedownHooks/useTypedownData.js +9 -3
  138. package/src/lib/hooks/useAvailableCustomProperties.js +40 -0
  139. package/src/lib/hooks/useInvalidateRefdata.js +11 -0
  140. package/src/lib/hooks/useMutateRefdataValue.js +7 -3
  141. package/src/lib/hooks/useRefdata.js +2 -3
  142. package/src/lib/utils/groupCustomPropertiesByCtx.js +13 -0
  143. package/src/lib/utils/index.js +5 -0
  144. package/src/lib/utils/refdataQueryKey.js +9 -0
  145. package/src/lib/utils/typedownQueryKey.js +9 -0
  146. package/src/lib/utils/validators.js +40 -0
  147. package/translate.sh +63 -0
  148. package/translations/stripes-kint-components/ar.json +105 -0
  149. package/translations/stripes-kint-components/ca.json +1 -0
  150. package/translations/stripes-kint-components/cs_CZ.json +105 -0
  151. package/translations/stripes-kint-components/da.json +1 -0
  152. package/translations/stripes-kint-components/de.json +105 -0
  153. package/translations/stripes-kint-components/en.json +54 -2
  154. package/translations/stripes-kint-components/es.json +105 -0
  155. package/translations/stripes-kint-components/fr.json +105 -0
  156. package/translations/stripes-kint-components/he.json +1 -0
  157. package/translations/stripes-kint-components/hi_IN.json +105 -0
  158. package/translations/stripes-kint-components/hu.json +105 -0
  159. package/translations/stripes-kint-components/it_IT.json +105 -0
  160. package/translations/stripes-kint-components/ja.json +105 -0
  161. package/translations/stripes-kint-components/ko.json +105 -0
  162. package/translations/stripes-kint-components/nb.json +1 -0
  163. package/translations/stripes-kint-components/nn.json +1 -0
  164. package/translations/stripes-kint-components/pl.json +105 -0
  165. package/translations/stripes-kint-components/pt_PT.json +105 -0
  166. package/translations/stripes-kint-components/ru.json +105 -0
  167. package/translations/stripes-kint-components/sv.json +105 -0
  168. package/translations/stripes-kint-components/ur.json +1 -0
  169. package/translations/stripes-kint-components/zh_CN.json +105 -0
  170. package/es/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -109
  171. package/es/artifacts/coverage-jest/lcov-report/prettify.js +0 -998
  172. package/es/artifacts/coverage-jest/lcov-report/sorter.js +0 -238
  173. package/junit.xml +0 -79
  174. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +0 -286
  175. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +0 -925
  176. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +0 -146
  177. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +0 -88
  178. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +0 -418
  179. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +0 -808
  180. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesView.js.html +0 -601
  181. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +0 -1135
  182. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +0 -176
  183. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +0 -97
  184. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +0 -373
  185. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +0 -131
  186. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +0 -88
  187. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +0 -223
  188. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +0 -211
  189. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +0 -376
  190. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +0 -262
  191. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +0 -436
  192. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +0 -161
  193. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +0 -94
  194. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +0 -146
  195. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +0 -94
  196. package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +0 -283
  197. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +0 -131
  198. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +0 -88
  199. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +0 -319
  200. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +0 -131
  201. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +0 -88
  202. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +0 -184
  203. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +0 -131
  204. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +0 -88
  205. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +0 -370
  206. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +0 -131
  207. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +0 -88
  208. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +0 -949
  209. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +0 -131
  210. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +0 -88
  211. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +0 -301
  212. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +0 -131
  213. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +0 -88
  214. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +0 -253
  215. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +0 -131
  216. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +0 -88
  217. package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +0 -214
  218. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +0 -131
  219. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +0 -88
  220. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +0 -211
  221. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +0 -178
  222. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +0 -146
  223. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +0 -91
  224. package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +0 -919
  225. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +0 -131
  226. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +0 -88
  227. package/src/artifacts/coverage-jest/lcov-report/base.css +0 -224
  228. package/src/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -87
  229. package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +0 -112
  230. package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +0 -94
  231. package/src/artifacts/coverage-jest/lcov-report/constants/index.html +0 -131
  232. package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +0 -97
  233. package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +0 -131
  234. package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +0 -91
  235. package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
  236. package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +0 -281
  237. package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +0 -121
  238. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +0 -146
  239. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +0 -91
  240. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +0 -163
  241. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +0 -403
  242. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +0 -161
  243. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +0 -94
  244. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +0 -520
  245. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +0 -163
  246. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +0 -163
  247. package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +0 -157
  248. package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +0 -313
  249. package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +0 -283
  250. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +0 -274
  251. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +0 -178
  252. package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +0 -136
  253. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +0 -271
  254. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +0 -301
  255. package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +0 -208
  256. package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +0 -268
  257. package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +0 -166
  258. package/src/artifacts/coverage-jest/lcov-report/index.html +0 -416
  259. package/src/artifacts/coverage-jest/lcov-report/prettify.css +0 -1
  260. package/src/artifacts/coverage-jest/lcov-report/prettify.js +0 -2
  261. package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
  262. package/src/artifacts/coverage-jest/lcov-report/sorter.js +0 -196
  263. package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +0 -193
  264. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +0 -109
  265. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +0 -454
  266. package/src/artifacts/coverage-jest/lcov-report/utils/index.html +0 -251
  267. package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +0 -121
  268. package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +0 -106
  269. package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +0 -166
  270. package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +0 -103
  271. package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +0 -130
  272. package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +0 -127
  273. package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +0 -202
  274. package/src/artifacts/coverage-jest/lcov.info +0 -2562
@@ -15,15 +15,6 @@ var _jsxRuntime = require("react/jsx-runtime");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
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
18
  var renderHelpText = function renderHelpText(id) {
28
19
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
29
20
  className: _renderHelpText.default.help,
@@ -86,24 +77,4 @@ var renderHelpText = function renderHelpText(id) {
86
77
  };
87
78
 
88
79
  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
- })();
80
+ exports.default = _default;
@@ -5,38 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
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
8
  var selectorSafe = function selectorSafe(string) {
18
9
  return string.replaceAll(/[^a-zA-Z0-9\-_]/g, '_');
19
10
  };
20
11
 
21
12
  var _default = selectorSafe;
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
- })();
13
+ exports.default = _default;
@@ -5,15 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
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
8
  var sortByLabel = function sortByLabel(a, b) {
18
9
  var _a$label$toLowerCase, _a$label, _a$id, _b$label$toLowerCase, _b$label, _b$id;
19
10
 
@@ -32,24 +23,4 @@ var sortByLabel = function sortByLabel(a, b) {
32
23
  };
33
24
 
34
25
  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
- })();
26
+ exports.default = _default;
@@ -5,15 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
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
8
  var toCamelCase = function toCamelCase(str) {
18
9
  return (// First split string on any capital letters
19
10
  str.split(/(?=[A-Z])/).join(' ') // Remove all non alpha-numeric chars, and replace _ with ' '
@@ -25,24 +16,4 @@ var toCamelCase = function toCamelCase(str) {
25
16
  };
26
17
 
27
18
  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
- })();
19
+ exports.default = _default;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var typedownQueryKey = function typedownQueryKey(path) {
9
+ var keyArray = ['stripes-kint-components', 'typedown'];
10
+
11
+ if (path) {
12
+ keyArray.push(path);
13
+ }
14
+
15
+ return keyArray;
16
+ };
17
+
18
+ var _default = typedownQueryKey;
19
+ exports.default = _default;
@@ -1,29 +1,28 @@
1
1
  "use strict";
2
2
 
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports.requiredObject = exports.required = exports.invalidNumber = exports.composeValidators = void 0;
8
+ exports.requiredObject = exports.required = exports.invalidNumber = exports.customPropertyValidator = exports.composeValidators = void 0;
7
9
 
8
10
  var _reactIntl = require("react-intl");
9
11
 
12
+ var CUSTOM_PROPERTY_TYPES = _interopRequireWildcard(require("../constants/customProperties"));
13
+
10
14
  var _jsxRuntime = require("react/jsx-runtime");
11
15
 
12
16
  var _excluded = ["_delete"];
13
17
 
14
- (function () {
15
- var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
16
- enterModule && enterModule(module);
17
- })();
18
+ 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); }
19
+
20
+ 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; }
18
21
 
19
22
  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; }
20
23
 
21
24
  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; }
22
25
 
23
- var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
24
- return a;
25
- };
26
-
27
26
  var invalidNumber = function invalidNumber(value) {
28
27
  return value || value === 0 ? undefined : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
29
28
  id: "stripes-kint-components.errors.invalidNumber"
@@ -65,6 +64,56 @@ var requiredObject = function requiredObject() {
65
64
 
66
65
  exports.requiredObject = requiredObject;
67
66
 
67
+ var customPropertyValidator = function customPropertyValidator(fieldValue, allValues, customProperty) {
68
+ var _allValues$customProp, _allValues$customProp2, _allValues$customProp3;
69
+
70
+ var _ref = (_allValues$customProp = allValues === null || allValues === void 0 ? void 0 : (_allValues$customProp2 = allValues.customProperties) === null || _allValues$customProp2 === void 0 ? void 0 : (_allValues$customProp3 = _allValues$customProp2[customProperty === null || customProperty === void 0 ? void 0 : customProperty.value]) === null || _allValues$customProp3 === void 0 ? void 0 : _allValues$customProp3[0]) !== null && _allValues$customProp !== void 0 ? _allValues$customProp : {},
71
+ note = _ref.note,
72
+ publicNote = _ref.publicNote,
73
+ currentValue = _ref.value;
74
+
75
+ if (note && !currentValue || publicNote && !currentValue) {
76
+ if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME || customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
77
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
78
+ id: "stripes-kint-components.errors.customPropertyNoteInvalidNumber"
79
+ });
80
+ } else {
81
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
82
+ id: "stripes-kint-components.errors.customPropertyNoteWithoutValue"
83
+ });
84
+ }
85
+ }
86
+
87
+ if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME) {
88
+ var regexp = /^-?[\d]*(\.[\d]{0,2})?$/;
89
+ return fieldValue && !regexp.test(fieldValue) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
90
+ id: "stripes-kint-components.errors.customPropertyMaxTwoDecimals"
91
+ }) : undefined;
92
+ }
93
+
94
+ if (customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
95
+ var min = Number.MIN_SAFE_INTEGER;
96
+ var max = Number.MAX_SAFE_INTEGER;
97
+ return fieldValue && !Number.isInteger(+fieldValue) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
98
+ id: "stripes-kint-components.errors.customPropertyValueNotInRange",
99
+ values: {
100
+ min: min,
101
+ max: max
102
+ }
103
+ }) : undefined;
104
+ }
105
+
106
+ if (!customProperty.primary && !currentValue) {
107
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
108
+ id: "stripes-core.label.missingRequiredField"
109
+ });
110
+ }
111
+
112
+ return undefined;
113
+ };
114
+
115
+ exports.customPropertyValidator = customPropertyValidator;
116
+
68
117
  var composeValidators = function composeValidators() {
69
118
  for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
70
119
  validators[_key] = arguments[_key];
@@ -77,25 +126,4 @@ var composeValidators = function composeValidators() {
77
126
  };
78
127
  };
79
128
 
80
- exports.composeValidators = composeValidators;
81
- ;
82
-
83
- (function () {
84
- var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
85
-
86
- if (!reactHotLoader) {
87
- return;
88
- }
89
-
90
- reactHotLoader.register(invalidNumber, "invalidNumber", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/validators.js");
91
- reactHotLoader.register(required, "required", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/validators.js");
92
- reactHotLoader.register(requiredObject, "requiredObject", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/validators.js");
93
- reactHotLoader.register(composeValidators, "composeValidators", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/validators.js");
94
- })();
95
-
96
- ;
97
-
98
- (function () {
99
- var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
100
- leaveModule && leaveModule(module);
101
- })();
129
+ exports.composeValidators = composeValidators;
@@ -0,0 +1,8 @@
1
+ git stash
2
+
3
+ ./translate.sh
4
+
5
+ git add ./translations
6
+ git commit -m "chore: translations"
7
+ git push
8
+ git stash pop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "2.2.0",
3
+ "version": "2.3.2",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
package/src/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  // Useful hooks
2
2
  export {
3
3
  useActiveElement,
4
+ useAvailableCustomProperties,
4
5
  useCustomProperties,
5
6
  useHelperApp,
7
+ useInvalidateRefdata,
6
8
  useKiwtFieldArray,
7
9
  useKiwtSASQuery,
8
10
  useLocalStorageState,
@@ -18,8 +20,11 @@ export {
18
20
  export {
19
21
  generateKiwtQuery,
20
22
  generateKiwtQueryParams,
23
+ groupCustomPropertiesByCtx,
21
24
  refdataOptions,
22
- selectorSafe
25
+ refdataQueryKey,
26
+ selectorSafe,
27
+ typedownQueryKey,
23
28
  } from './lib/utils';
24
29
 
25
30
  // Validators (Some/all copied from stripes-erm-components but this gives another way to acquire them)
@@ -85,9 +90,28 @@ export { default as FormModal } from './lib/FormModal';
85
90
 
86
91
  // Custom properties
87
92
  export {
93
+ // Config
88
94
  CustomPropertiesLookup,
89
95
  CustomPropertiesSettings,
90
- CustomPropertiesView
91
- } from './lib/CustomProperties/Config';
96
+ CustomPropertyView,
97
+ CustomPropertyForm,
98
+ // Edit
99
+ CustomPropertiesEdit,
100
+ CustomPropertiesEditCtx,
101
+ CustomPropertiesListField,
102
+ CustomPropertyFormCard,
103
+ CustomPropertyField,
104
+ // View
105
+ CustomPropertiesView,
106
+ CustomPropertiesViewCtx,
107
+ CustomPropertyCard,
108
+ // Filter
109
+ CustomPropertiesFilter,
110
+ CustomPropertiesFilterForm,
111
+ CustomPropertiesFilterField,
112
+ CustomPropertiesFilterFieldArray,
113
+ useOperators,
114
+ useParseActiveFilterStrings
115
+ } from './lib/CustomProperties';
92
116
 
93
117
  export * as customPropertyContants from './lib/constants/customProperties';
@@ -13,6 +13,7 @@ const propTypes = {
13
13
  columnMapping: PropTypes.object,
14
14
  contentData: PropTypes.arrayOf(PropTypes.object),
15
15
  creatableFields: PropTypes.object,
16
+ createCallback: PropTypes.func,
16
17
  editableFields: PropTypes.object,
17
18
  fieldComponents: PropTypes.object,
18
19
  hideCreateButton: PropTypes.bool,
@@ -21,10 +22,11 @@ const propTypes = {
21
22
 
22
23
  const ActionList = ({
23
24
  actionAssigner,
24
- actionCalls = {},
25
+ actionCalls = {}, // DEPRECATED
25
26
  columnMapping,
26
27
  contentData,
27
28
  creatableFields = {},
29
+ createCallback,
28
30
  editableFields = {},
29
31
  fieldComponents = {},
30
32
  hideCreateButton,
@@ -37,7 +39,7 @@ const ActionList = ({
37
39
  enableReinitialize
38
40
  initialValues={{ contentData }}
39
41
  mutators={arrayMutators}
40
- onSubmit={actionCalls.edit}
42
+ onSubmit={() => null}
41
43
  subscription={{ contentData: true }}
42
44
  >
43
45
  {() => (
@@ -48,6 +50,7 @@ const ActionList = ({
48
50
  columnMapping={columnMapping}
49
51
  component={ActionListFieldArray}
50
52
  creatableFields={creatableFields}
53
+ createCallback={createCallback}
51
54
  editableFields={editableFields}
52
55
  fieldComponents={fieldComponents}
53
56
  hideCreateButton={hideCreateButton}
@@ -16,6 +16,7 @@ const propTypes = {
16
16
  actionCalls: PropTypes.object,
17
17
  columnMapping: PropTypes.object,
18
18
  creatableFields: PropTypes.object,
19
+ createCallback: PropTypes.func,
19
20
  editableFields: PropTypes.object,
20
21
  fields: PropTypes.object,
21
22
  fieldComponents: PropTypes.object,
@@ -26,9 +27,10 @@ const propTypes = {
26
27
 
27
28
  const ActionListFieldArray = ({
28
29
  actionAssigner,
29
- actionCalls,
30
+ actionCalls, // DEPRECATED
30
31
  columnMapping,
31
32
  creatableFields,
33
+ createCallback,
32
34
  editableFields,
33
35
  fields,
34
36
  fieldComponents,
@@ -55,15 +57,26 @@ const ActionListFieldArray = ({
55
57
  }
56
58
  };
57
59
 
58
-
59
60
  const handleSave = (index) => {
60
61
  const { actionListActions: _a, ...rowData } = fields.value[index];
61
- actionCalls.edit(rowData);
62
+
63
+ // Find "edit" entry in actionAssigner
64
+ const editCallback = actionAssigner(rowData)?.find(act => act.name === 'edit')?.callback;
65
+ if (editCallback) {
66
+ editCallback(rowData);
67
+ } else {
68
+ actionCalls.edit(rowData); // DEPRECATED
69
+ }
62
70
  };
63
71
 
64
72
  const handleCreate = (index) => {
65
73
  const { actionListActions: _a, ...rowData } = fields.value[index];
66
- actionCalls.create(rowData);
74
+
75
+ if (createCallback) {
76
+ createCallback(rowData);
77
+ } else {
78
+ actionCalls.create(rowData); // DEPRECATED
79
+ }
67
80
  };
68
81
 
69
82
  const getColumnWidths = () => {
@@ -133,7 +146,15 @@ const ActionListFieldArray = ({
133
146
  return (
134
147
  <div>
135
148
  {actions?.map(action => {
136
- let actionFunction = () => actionCalls[action.name](rest);
149
+ let actionFunction;
150
+ if (action.callback) {
151
+ actionFunction = () => action.callback(rest);
152
+ }
153
+
154
+ if (!actionFunction && actionCalls[action.name]) {
155
+ actionFunction = () => actionCalls[action.name](rest); // DEPRECATED
156
+ }
157
+
137
158
  // Edit has special action functionality, revealing fields etc.
138
159
  if (action.name === 'edit') {
139
160
  actionFunction = () => toggleEditing(data.id);
@@ -146,8 +167,8 @@ const ActionListFieldArray = ({
146
167
  key={`action-${action.name}[${data.rowIndex}]`}
147
168
  disabled={editing}
148
169
  icon={action.icon}
149
- marginBottom0
150
- onClick={actionFunction}
170
+ onClick={() => (actionFunction ? actionFunction() : () => null)}
171
+ to={action.to}
151
172
  />
152
173
  );
153
174
  }
@@ -158,7 +179,8 @@ const ActionListFieldArray = ({
158
179
  key={`action-${action.name}[${data.rowIndex}]`}
159
180
  disabled={editing}
160
181
  marginBottom0
161
- onClick={actionFunction}
182
+ onClick={() => (actionFunction ? actionFunction() : () => null)}
183
+ to={action.to}
162
184
  >
163
185
  {action.label ?? action.name}
164
186
  </Button>
@@ -247,7 +269,7 @@ const ActionListFieldArray = ({
247
269
  {!hideCreateButton &&
248
270
  <Button
249
271
  buttonClass={css.buttonRight}
250
- disabled={!actionCalls.create}
272
+ disabled={(!actionCalls.create && !createCallback)} // DEPRECATED actionCalls
251
273
  onClick={() => {
252
274
  toggleEditing('NEW_ROW');
253
275
  fields.push({});
@@ -23,32 +23,34 @@ const [contentData, setContentData] = useState({
23
23
 
24
24
  const actionAssigner = () => {
25
25
  return [
26
- { name: 'edit' },
27
- { name: 'delete' }
26
+ {
27
+ name: 'edit',
28
+ callback: (data) => setContentData({
29
+ ...contentData,
30
+ data
31
+ )}
32
+ },
33
+ {
34
+ name: 'delete',
35
+ callback: (data) => {
36
+ setContentData(contentData.filter(cd => cd.id !== data.id))
37
+ }
38
+ }
28
39
  ];
29
40
  };
30
41
 
31
- const actionCalls = {
32
- create: (data) => setContentData({
33
- ...contentData,
34
- {
35
- id: generateUUID(),
36
- ...data
37
- }
38
- }),
39
- edit: (data) => setContentData({
40
- ...contentData,
41
- data
42
- ),
43
- delete: (data) => {
44
- setContentData(contentData.filter(cd => cd.id !== data.id))
42
+ createCallback = (data) => setContentData({
43
+ ...contentData,
44
+ {
45
+ id: generateUUID(),
46
+ ...data
45
47
  }
46
- };
48
+ });
47
49
 
48
50
  <ActionList
49
51
  actionAssigner={actionAssigner}
50
- actionCalls={actionCalls}
51
52
  contentData={contentData}
53
+ createCallback={createCallback}
52
54
  visibleFields={['name', 'occupation']}
53
55
  />
54
56
  ```
@@ -57,11 +59,12 @@ const actionCalls = {
57
59
 
58
60
  Name | Type | Description | default | required
59
61
  --- | --- | --- | --- | ---
60
- actionAssigner | function | A function which will be passed the entire row object, and can use that to assign an array of actions valid for that row, in the form `{ name: 'actionName', label: "Action Label", icon: 'someIcon' }`. The prop `name` is required, but `label` and `icon` are optional props. | | ✓ |
61
- actionCalls | object<function> | An object with keys matching any "actions" the `actionAssigner` may have assigned (In addition to special case `create`, if relevant), and values which are functions. These functions will be handed the row as a parameter. | {} | ✕ |
62
+ actionAssigner | function | A function which will be passed the entire row object, and can use that to assign an array of actions valid for that row, in the form `{ name: 'actionName', label: "Action Label", icon: 'someIcon', callback: () => null, to: toObject }`. The prop `name` is required, but `label` and `icon` are optional props. The `callback` prop will be prioritised ahead of the deprecated actionCalls prop. If a `to` prop is passed, then the resulting button will be rendered as a <Link/> element, as per Stripes Button/IconButton.| | ✓ |
63
+ actionCalls (DEPRECATED) | object<function> | An object with keys matching any "actions" the `actionAssigner` may have assigned (In addition to special case `create`, if relevant), and values which are functions. These functions will be handed the row as a parameter. THESE CAN NOW BE PASSED AS "callback" in the actionAssigner. | {} | ✕ |
62
64
  columnMapping | object | An object which will act on the rendered MultiColumnList headers to map the labels for each `visibleField` | | ✕ |
63
65
  contentData | array | An array of objects to render along with their actions | | ✓ |
64
66
  creatableFields | object<function> | An object with keys from the `visibleFields` array, and values of functions which take the entire row object and return a boolean indicating whether that field is fillable on create or not. | | ✕ |
67
+ createCallback | <function> | A callback to be used for the built in "create" action (ie "save" on a new row). Will be prioritised ahead of a `create` entry in the deprecated actionCalls prop. | {} | ✕ |
65
68
  editableFields | object<function> | An object with keys from the `visibleFields` array, and values of functions which take the entire row object and return a boolean indicating whether that field is editable or not. No key for a given field will be interpreted as () => true, so a field is editable by default. | | ✕ |
66
69
  fieldComponents | object<function> | An object with keys from the `visibleFields` array, and values of functions which take some `fieldProps` (currently only the name of the field `name`), and returns a Field component to be used in "edit mode" for the visible field specified. | | ✕ |
67
70
  formatter | object<function> | A "formatter" object that takes the same shape as an MCL formatter, and is used in the same way whilst a row is NOT being edited. While editing a given row, this formatter entry is ignored. | | ✕ |
@@ -14,7 +14,7 @@ import { Button, ConfirmationModal, Pane } from '@folio/stripes/components';
14
14
  import FormModal from '../../FormModal/FormModal';
15
15
 
16
16
  import CustomPropertiesLookup from './CustomPropertiesLookup';
17
- import CustomPropertiesView from './CustomPropertiesView';
17
+ import CustomPropertyView from './CustomPropertyView';
18
18
  import CustomPropertiesForm from './CustomPropertyForm';
19
19
  import { useMutateCustomProperties, useRefdata } from '../../hooks';
20
20
 
@@ -160,7 +160,7 @@ const CustomPropertiesSettings = ({
160
160
  renderViewPaneTitle ?? customProperty?.label ?? customProperty?.name
161
161
  }
162
162
  >
163
- <CustomPropertiesView
163
+ <CustomPropertyView
164
164
  customProperty={customProperty}
165
165
  labelOverrides={labelOverrides}
166
166
  />
@@ -5,7 +5,7 @@ import { Col, KeyValue, NoValue, Row } from '@folio/stripes/components';
5
5
  import { REFDATA_CLASS_NAME } from '../../constants/customProperties';
6
6
 
7
7
  // A default option for CustProp view pane, with the ability to override labels for fields
8
- const CustomPropertiesView = ({
8
+ const CustomPropertyView = ({
9
9
  customProperty,
10
10
  labelOverrides
11
11
  }) => {
@@ -149,7 +149,7 @@ const CustomPropertiesView = ({
149
149
  );
150
150
  };
151
151
 
152
- CustomPropertiesView.propTypes = {
152
+ CustomPropertyView.propTypes = {
153
153
  customProperty: PropTypes.shape({
154
154
  id: PropTypes.string,
155
155
  label: PropTypes.string,
@@ -169,4 +169,4 @@ CustomPropertiesView.propTypes = {
169
169
  labelOverrides: PropTypes.object
170
170
  };
171
171
 
172
- export default CustomPropertiesView;
172
+ export default CustomPropertyView;
@@ -1,4 +1,4 @@
1
1
  export { default as CustomPropertiesLookup } from './CustomPropertiesLookup';
2
- export { default as CustomPropertiesView } from './CustomPropertiesLookup';
2
+ export { default as CustomPropertyView } from './CustomPropertyView';
3
3
  export { default as CustomPropertiesSettings } from './CustomPropertiesSettings';
4
4
  export { default as CustomPropertyForm } from './CustomPropertyForm';
@@ -0,0 +1,35 @@
1
+ import PropTypes from 'prop-types';
2
+ import CustomPropertiesEditCtx from './CustomPropertiesEditCtx';
3
+
4
+ const CustomPropertiesEdit = ({
5
+ contexts = [],
6
+ customPropertiesEndpoint,
7
+ id,
8
+ labelOverrides = {},
9
+ nameOverride
10
+ }) => {
11
+ return (
12
+ contexts.map(ctx => (
13
+ <CustomPropertiesEditCtx
14
+ key={`customPropertiesEdit-${ctx}`}
15
+ {...{
16
+ ctx,
17
+ customPropertiesEndpoint,
18
+ id,
19
+ labelOverrides,
20
+ nameOverride
21
+ }}
22
+ />
23
+ ))
24
+ );
25
+ };
26
+
27
+ CustomPropertiesEdit.propTypes = {
28
+ contexts: PropTypes.arrayOf(PropTypes.string),
29
+ customPropertiesEndpoint: PropTypes.string,
30
+ id: PropTypes.string,
31
+ labelOverrides: PropTypes.object,
32
+ nameOverride: PropTypes.string
33
+ };
34
+
35
+ export default CustomPropertiesEdit;