@k-int/stripes-kint-components 2.8.2 → 3.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 (328) hide show
  1. package/CHANGELOG.md +15 -3
  2. package/es/index.js +48 -12
  3. package/es/lib/ActionList/ActionList.js +11 -5
  4. package/es/lib/ActionList/ActionListFieldArray.js +147 -77
  5. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +43 -31
  6. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +17 -14
  7. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +64 -46
  8. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +17 -24
  9. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +91 -70
  10. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +53 -36
  11. package/es/lib/CustomProperties/Config/CustomPropertyView.js +50 -31
  12. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +13 -14
  13. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
  14. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +8 -12
  15. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +22 -24
  16. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +9 -12
  17. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +62 -13
  18. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +12 -13
  19. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +91 -44
  20. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +80 -73
  21. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +31 -32
  22. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +26 -24
  23. package/es/lib/CustomProperties/Edit/testResources.js +73 -908
  24. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +21 -29
  25. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -10
  26. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +38 -39
  27. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +28 -13
  28. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +29 -44
  29. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +6 -6
  30. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +16 -10
  31. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +12 -12
  32. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +20 -11
  33. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +4 -3
  34. package/es/lib/CustomProperties/Filter/testResources.js +37 -233
  35. package/es/lib/CustomProperties/Filter/useOperators.js +69 -27
  36. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +3 -2
  37. package/es/lib/CustomProperties/Filter/useValueProps.js +7 -2
  38. package/es/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
  39. package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +4 -3
  40. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +13 -19
  41. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +4 -10
  42. package/es/lib/CustomProperties/View/CustomPropertyCard.js +34 -51
  43. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +35 -27
  44. package/es/lib/EditableRefdataList/EditableRefdataList.js +41 -31
  45. package/es/lib/EditableSettingsList/EditableSettingsList.js +11 -1
  46. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +10 -0
  47. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +19 -11
  48. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
  49. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +21 -9
  50. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
  51. package/es/lib/EditableSettingsList/SettingField/SettingField.js +83 -16
  52. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +138 -65
  53. package/es/lib/FormModal/FormModal.js +14 -9
  54. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +91 -0
  55. package/es/lib/FormattedKintMessage/index.js +15 -0
  56. package/es/lib/IconSelect/IconSelect.js +18 -12
  57. package/es/lib/NoResultsMessage/NoResultsMessage.js +13 -2
  58. package/es/lib/RichSelect/RichSelect.js +13 -34
  59. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +16 -5
  60. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +11 -1
  61. package/es/lib/SettingPage/SettingPage.js +12 -13
  62. package/es/lib/SettingPage/SettingPagePane.js +12 -20
  63. package/es/lib/hooks/__mocks__/index.js +46 -0
  64. package/es/lib/hooks/index.js +24 -8
  65. package/es/lib/hooks/settingsHooks/useSettings.js +22 -17
  66. package/es/lib/hooks/useIntlKey.js +34 -0
  67. package/es/lib/hooks/useIntlKeyStore.js +84 -0
  68. package/es/lib/hooks/useKintIntl.js +93 -0
  69. package/es/lib/utils/index.js +40 -4
  70. package/es/lib/utils/parseErrorResponse.js +1 -1
  71. package/es/lib/utils/validators.js +76 -59
  72. package/jest.config.js +4 -1
  73. package/junit.xml +157 -656
  74. package/package.json +54 -33
  75. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +56 -8
  76. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +394 -64
  77. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +10 -10
  78. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
  79. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +187 -52
  80. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +372 -87
  81. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +293 -74
  82. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +126 -54
  83. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +45 -60
  84. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
  85. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +23 -5
  86. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +59 -47
  87. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +259 -97
  88. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +399 -105
  89. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +41 -68
  90. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +57 -57
  91. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
  92. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +67 -688
  93. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +92 -53
  94. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +103 -64
  95. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +54 -63
  96. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +49 -16
  97. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +69 -18
  98. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +89 -89
  99. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
  100. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +33 -786
  101. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +46 -46
  102. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +45 -36
  103. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +43 -28
  104. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +20 -2
  105. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +50 -41
  106. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +54 -75
  107. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +24 -24
  108. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
  109. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
  110. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
  111. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
  112. package/src/artifacts/coverage-jest/lcov-report/{hooks/useAvailableCustomProperties.js.html → CycleButton/CycleButton.js.html} +62 -50
  113. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +131 -0
  114. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +88 -0
  115. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +664 -0
  116. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +131 -0
  117. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +88 -0
  118. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +264 -39
  119. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +9 -9
  120. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
  121. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +41 -14
  122. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +45 -6
  123. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +47 -11
  124. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +65 -14
  125. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +154 -31
  126. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +26 -26
  127. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
  128. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +18 -18
  129. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
  130. package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +35 -17
  131. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +15 -15
  132. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
  133. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +247 -0
  134. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +131 -0
  135. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +88 -0
  136. package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/CustomPropertiesView.js.html → IconSelect/IconSelect.js.html} +158 -257
  137. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +131 -0
  138. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +88 -0
  139. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +48 -6
  140. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +7 -7
  141. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
  142. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
  143. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
  144. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
  145. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +3 -3
  146. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
  147. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
  148. package/src/artifacts/coverage-jest/lcov-report/{CustomProperties/Config/testResources.js.html → RichSelect/RichSelect.js.html} +256 -334
  149. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +146 -0
  150. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +91 -0
  151. package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +127 -0
  152. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +52 -7
  153. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +31 -4
  154. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +3 -3
  155. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
  156. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +7 -7
  157. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
  158. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
  159. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
  160. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
  161. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
  162. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
  163. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
  164. package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
  165. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
  166. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
  167. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +24 -27
  168. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +47 -17
  169. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +22 -22
  170. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
  171. package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
  172. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
  173. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
  174. package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
  175. package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
  176. package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
  177. package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +2 -2
  178. package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
  179. package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
  180. package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
  181. package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +142 -97
  182. package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +13 -4
  183. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +35 -20
  184. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +5 -2
  185. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +7 -7
  186. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +7 -7
  187. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +61 -22
  188. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
  189. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
  190. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
  191. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
  192. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
  193. package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +7 -7
  194. package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +19 -22
  195. package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +7 -7
  196. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +151 -0
  197. package/src/artifacts/coverage-jest/lcov-report/{utils/renderHelpText.js.html → hooks/useIntlKeyStore.js.html} +71 -38
  198. package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +7 -7
  199. package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +238 -0
  200. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +7 -7
  201. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +9 -9
  202. package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +7 -7
  203. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +23 -11
  204. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +274 -0
  205. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +19 -10
  206. package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +7 -7
  207. package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +9 -9
  208. package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +7 -7
  209. package/src/artifacts/coverage-jest/lcov-report/index.html +205 -130
  210. package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
  211. package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
  212. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +2 -2
  213. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +2 -2
  214. package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +7 -7
  215. package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +3 -3
  216. package/src/artifacts/coverage-jest/lcov-report/utils/index.html +34 -34
  217. package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +42 -3
  218. package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +2 -2
  219. package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +139 -0
  220. package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +5 -2
  221. package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +2 -2
  222. package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +2 -2
  223. package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +2 -2
  224. package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +2 -2
  225. package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +2 -2
  226. package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +128 -80
  227. package/src/artifacts/coverage-jest/lcov.info +2603 -2086
  228. package/src/index.js +11 -4
  229. package/src/lib/ActionList/ActionList.js +9 -3
  230. package/src/lib/ActionList/ActionListFieldArray.js +115 -37
  231. package/src/lib/ActionList/README.md +2 -1
  232. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.js +60 -16
  233. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +14 -4
  234. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +106 -33
  235. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +16 -9
  236. package/src/lib/CustomProperties/Config/CustomPropertyForm.js +131 -58
  237. package/src/lib/CustomProperties/Config/CustomPropertyForm.test.js +52 -33
  238. package/src/lib/CustomProperties/Config/CustomPropertyView.js +71 -47
  239. package/src/lib/CustomProperties/Config/CustomPropertyView.test.js +8 -6
  240. package/src/lib/CustomProperties/Config/README.md +33 -28
  241. package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +6 -0
  242. package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +7 -3
  243. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +23 -19
  244. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +5 -3
  245. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +65 -11
  246. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +10 -8
  247. package/src/lib/CustomProperties/Edit/CustomPropertyField.js +115 -21
  248. package/src/lib/CustomProperties/Edit/CustomPropertyField.test.js +59 -60
  249. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +24 -33
  250. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +20 -27
  251. package/src/lib/CustomProperties/Edit/testResources.js +46 -1047
  252. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +22 -22
  253. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +12 -8
  254. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +44 -31
  255. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +26 -13
  256. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +33 -36
  257. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +3 -3
  258. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -8
  259. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +9 -12
  260. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +22 -5
  261. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +3 -1
  262. package/src/lib/CustomProperties/Filter/testResources.js +14 -265
  263. package/src/lib/CustomProperties/Filter/useOperators.js +20 -20
  264. package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +2 -2
  265. package/src/lib/CustomProperties/Filter/useValueProps.js +8 -3
  266. package/src/lib/CustomProperties/View/CustomPropertiesView.js +6 -0
  267. package/src/lib/CustomProperties/View/CustomPropertiesView.test.js +2 -1
  268. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +15 -13
  269. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +2 -5
  270. package/src/lib/CustomProperties/View/CustomPropertyCard.js +36 -43
  271. package/src/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +45 -27
  272. package/src/lib/EditableRefdataList/EditableRefdataList.js +56 -32
  273. package/src/lib/EditableSettingsList/EditableSettingsList.js +10 -1
  274. package/src/lib/EditableSettingsList/EditableSettingsListFieldArray.js +14 -1
  275. package/src/lib/EditableSettingsList/SettingField/EditSettingValue.js +17 -5
  276. package/src/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +9 -8
  277. package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.js +24 -7
  278. package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -0
  279. package/src/lib/EditableSettingsList/SettingField/SettingField.js +57 -16
  280. package/src/lib/EditableSettingsList/SettingField/SettingField.test.js +14 -19
  281. package/src/lib/FormModal/FormModal.js +15 -9
  282. package/src/lib/FormattedKintMessage/FormattedKintMessage.js +54 -0
  283. package/src/lib/FormattedKintMessage/index.js +1 -0
  284. package/src/lib/IconSelect/IconSelect.js +17 -8
  285. package/src/lib/NoResultsMessage/NoResultsMessage.js +15 -1
  286. package/src/lib/RichSelect/RichSelect.js +16 -36
  287. package/src/lib/SASQLookupComponent/SASQLookupComponent.js +17 -2
  288. package/src/lib/SASQLookupComponent/TableBody/TableBody.js +10 -1
  289. package/src/lib/SettingPage/SettingPage.js +12 -13
  290. package/src/lib/SettingPage/SettingPagePane.js +16 -6
  291. package/src/lib/hooks/__mocks__/index.js +17 -0
  292. package/src/lib/hooks/index.js +3 -1
  293. package/src/lib/hooks/settingsHooks/useSettings.js +25 -12
  294. package/src/lib/hooks/useIntlKey.js +22 -0
  295. package/src/lib/hooks/useIntlKeyStore.js +38 -0
  296. package/src/lib/hooks/useKintIntl.js +51 -0
  297. package/src/lib/utils/index.js +11 -1
  298. package/src/lib/utils/parseErrorResponse.js +1 -1
  299. package/src/lib/utils/validators.js +57 -41
  300. package/styles/RichSelect.css +7 -4
  301. package/test/helpers/test-implementor-translations.json +80 -0
  302. package/test/helpers/translationsProperties.js +6 -1
  303. package/test/jest/customProperties.js +166 -0
  304. package/test/jest/helpers/KintHarness.js +1 -1
  305. package/test/jest/helpers/renderWithKintHarness.js +2 -1
  306. package/test/jest/index.js +8 -0
  307. package/test/jest/refdata.js +471 -0
  308. package/test/jest/resolver.js +29 -0
  309. package/translations/stripes-kint-components/ar.json +1 -122
  310. package/translations/stripes-kint-components/cs_CZ.json +1 -122
  311. package/translations/stripes-kint-components/de.json +1 -122
  312. package/translations/stripes-kint-components/en.json +1 -148
  313. package/translations/stripes-kint-components/es.json +1 -122
  314. package/translations/stripes-kint-components/hi_IN.json +1 -122
  315. package/translations/stripes-kint-components/hu.json +1 -122
  316. package/translations/stripes-kint-components/it_IT.json +1 -122
  317. package/translations/stripes-kint-components/ja.json +1 -122
  318. package/translations/stripes-kint-components/ko.json +1 -122
  319. package/translations/stripes-kint-components/pt_PT.json +1 -122
  320. package/translations/stripes-kint-components/ru.json +1 -122
  321. package/translations/stripes-kint-components/sv.json +1 -122
  322. package/translations/stripes-kint-components/zh_CN.json +1 -122
  323. package/es/lib/CustomProperties/Config/testResources.js +0 -198
  324. package/es/lib/hooks/useAvailableCustomProperties.js +0 -73
  325. package/es/lib/utils/renderHelpText.js +0 -80
  326. package/src/lib/CustomProperties/Config/testResources.js +0 -236
  327. package/src/lib/hooks/useAvailableCustomProperties.js +0 -40
  328. package/src/lib/utils/renderHelpText.js +0 -27
package/CHANGELOG.md CHANGED
@@ -1,8 +1,20 @@
1
- ## 2.8.2 2022-07-25
1
+ ## 3.0.0 In progress
2
+ * RichSelect default trigger now uses DropdownButton under the hood -- changed styling
3
+ * ActionList previously added actionListItems directly to cached object--sometimes this caused the react-query cache ITSELF to update, although I'm not sure why here and not anywhere else. Fixed by creating a clone internally in ActionListFieldArray and assigning actionListActions on that.
2
4
  * New util function `parseErrorResponse`, used in places where we catch http errors, allows for text only response bodies
5
+ * onRowClick supplied to ActionList now controls whether or not the underlying MCL is considered "interactive"
6
+ * ActionList actions now accept `tooltip` and `tooltipSub` props to control a wrapper Tooltip on the action
7
+ * Complete overhaul of translations and labelOverrides. Not backwards compatible, hence major version bump.
8
+ * Translations now require a setup hook "useIntlKeyStore" to set up a favoured intl key, then use that throughout:
3
9
 
4
- ## 2.8.1 2022-07-21
5
- * ActionList previously added actionListItems directly to cached object--sometimes this caused the react-query cache ITSELF to update, although I'm not sure why here and not anywhere else. Fixed by creating a clone internally in ActionListFieldArray and assigning actionListActions on that.
10
+ ```
11
+ const addKey = useIntlKeyStore(state => state.addKey);
12
+ addKey('ui-agreements');
13
+ ```
14
+
15
+ * Translations can be overridden by labelOverrides, but these must now ALWAYS be a String, either direct translated string value, or an intl key that can then be passed certain values where applicable
16
+ * Removed deprecated "actionCalls" prop from ActionList
17
+ * Removed `useAvailableCustomProperties`
6
18
 
7
19
  ## 2.8.0 2022-07-15
8
20
  * Fixed bug where non-createable fields which were editable would display a field on creation.
package/es/index.js CHANGED
@@ -131,6 +131,12 @@ Object.defineProperty(exports, "FormModal", {
131
131
  return _FormModal.default;
132
132
  }
133
133
  });
134
+ Object.defineProperty(exports, "FormattedKintMessage", {
135
+ enumerable: true,
136
+ get: function get() {
137
+ return _FormattedKintMessage.default;
138
+ }
139
+ });
134
140
  Object.defineProperty(exports, "IconSelect", {
135
141
  enumerable: true,
136
142
  get: function get() {
@@ -224,7 +230,13 @@ Object.defineProperty(exports, "boldString", {
224
230
  Object.defineProperty(exports, "composeValidators", {
225
231
  enumerable: true,
226
232
  get: function get() {
227
- return _validators.composeValidators;
233
+ return _utils.composeValidators;
234
+ }
235
+ });
236
+ Object.defineProperty(exports, "composeValidatorsWithArgs", {
237
+ enumerable: true,
238
+ get: function get() {
239
+ return _utils.composeValidatorsWithArgs;
228
240
  }
229
241
  });
230
242
  exports.customPropertyContants = void 0;
@@ -255,7 +267,7 @@ Object.defineProperty(exports, "highlightString", {
255
267
  Object.defineProperty(exports, "invalidNumber", {
256
268
  enumerable: true,
257
269
  get: function get() {
258
- return _validators.invalidNumber;
270
+ return _utils.invalidNumber;
259
271
  }
260
272
  });
261
273
  Object.defineProperty(exports, "matchString", {
@@ -270,6 +282,18 @@ Object.defineProperty(exports, "parseErrorResponse", {
270
282
  return _utils.parseErrorResponse;
271
283
  }
272
284
  });
285
+ Object.defineProperty(exports, "rangeOverflow", {
286
+ enumerable: true,
287
+ get: function get() {
288
+ return _utils.rangeOverflow;
289
+ }
290
+ });
291
+ Object.defineProperty(exports, "rangeUnderflow", {
292
+ enumerable: true,
293
+ get: function get() {
294
+ return _utils.rangeUnderflow;
295
+ }
296
+ });
273
297
  Object.defineProperty(exports, "refdataOptions", {
274
298
  enumerable: true,
275
299
  get: function get() {
@@ -285,13 +309,13 @@ Object.defineProperty(exports, "refdataQueryKey", {
285
309
  Object.defineProperty(exports, "required", {
286
310
  enumerable: true,
287
311
  get: function get() {
288
- return _validators.required;
312
+ return _utils.required;
289
313
  }
290
314
  });
291
315
  Object.defineProperty(exports, "requiredObject", {
292
316
  enumerable: true,
293
317
  get: function get() {
294
- return _validators.requiredObject;
318
+ return _utils.requiredObject;
295
319
  }
296
320
  });
297
321
  Object.defineProperty(exports, "selectorSafe", {
@@ -318,12 +342,6 @@ Object.defineProperty(exports, "useAppSettings", {
318
342
  return _hooks.useAppSettings;
319
343
  }
320
344
  });
321
- Object.defineProperty(exports, "useAvailableCustomProperties", {
322
- enumerable: true,
323
- get: function get() {
324
- return _hooks.useAvailableCustomProperties;
325
- }
326
- });
327
345
  Object.defineProperty(exports, "useCustomProperties", {
328
346
  enumerable: true,
329
347
  get: function get() {
@@ -336,12 +354,30 @@ Object.defineProperty(exports, "useHelperApp", {
336
354
  return _hooks.useHelperApp;
337
355
  }
338
356
  });
357
+ Object.defineProperty(exports, "useIntlKey", {
358
+ enumerable: true,
359
+ get: function get() {
360
+ return _hooks.useIntlKey;
361
+ }
362
+ });
363
+ Object.defineProperty(exports, "useIntlKeyStore", {
364
+ enumerable: true,
365
+ get: function get() {
366
+ return _hooks.useIntlKeyStore;
367
+ }
368
+ });
339
369
  Object.defineProperty(exports, "useInvalidateRefdata", {
340
370
  enumerable: true,
341
371
  get: function get() {
342
372
  return _hooks.useInvalidateRefdata;
343
373
  }
344
374
  });
375
+ Object.defineProperty(exports, "useKintIntl", {
376
+ enumerable: true,
377
+ get: function get() {
378
+ return _hooks.useKintIntl;
379
+ }
380
+ });
345
381
  Object.defineProperty(exports, "useKiwtFieldArray", {
346
382
  enumerable: true,
347
383
  get: function get() {
@@ -419,8 +455,6 @@ var _hooks = require("./lib/hooks");
419
455
 
420
456
  var _utils = require("./lib/utils");
421
457
 
422
- var _validators = require("./lib/utils/validators");
423
-
424
458
  var _contexts = require("./lib/contexts");
425
459
 
426
460
  var _SettingPage = require("./lib/SettingPage");
@@ -461,6 +495,8 @@ var _IconSelect = _interopRequireDefault(require("./lib/IconSelect"));
461
495
 
462
496
  var _RichSelect = _interopRequireWildcard(require("./lib/RichSelect"));
463
497
 
498
+ var _FormattedKintMessage = _interopRequireDefault(require("./lib/FormattedKintMessage"));
499
+
464
500
  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); }
465
501
 
466
502
  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; }
@@ -21,7 +21,7 @@ var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArr
21
21
 
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
 
24
- var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fieldComponents", "hideCreateButton", "label", "validateFields", "visibleFields"];
24
+ var _excluded = ["actionAssigner", "columnMapping", "contentData", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fieldComponents", "hideCreateButton", "intlKey", "intlNS", "label", "labelOverrides", "validateFields", "visibleFields"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
@@ -41,7 +41,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
41
41
 
42
42
  var propTypes = {
43
43
  actionAssigner: _propTypes.default.func,
44
- actionCalls: _propTypes.default.object,
45
44
  columnMapping: _propTypes.default.object,
46
45
  contentData: _propTypes.default.arrayOf(_propTypes.default.object),
47
46
  creatableFields: _propTypes.default.object,
@@ -50,14 +49,15 @@ var propTypes = {
50
49
  editableFields: _propTypes.default.object,
51
50
  fieldComponents: _propTypes.default.object,
52
51
  hideCreateButton: _propTypes.default.bool,
52
+ intlKey: _propTypes.default.string,
53
+ intlNS: _propTypes.default.string,
53
54
  label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
55
+ labelOverrides: _propTypes.default.object,
54
56
  validateFields: _propTypes.default.object,
55
57
  visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
56
58
  };
57
59
  var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
58
60
  var actionAssigner = _ref.actionAssigner,
59
- _ref$actionCalls = _ref.actionCalls,
60
- actionCalls = _ref$actionCalls === void 0 ? {} : _ref$actionCalls,
61
61
  columnMapping = _ref.columnMapping,
62
62
  contentData = _ref.contentData,
63
63
  _ref$creatableFields = _ref.creatableFields,
@@ -70,7 +70,11 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
70
70
  _ref$fieldComponents = _ref.fieldComponents,
71
71
  fieldComponents = _ref$fieldComponents === void 0 ? {} : _ref$fieldComponents,
72
72
  hideCreateButton = _ref.hideCreateButton,
73
+ passedIntlKey = _ref.intlKey,
74
+ passedIntlNS = _ref.intlNS,
73
75
  label = _ref.label,
76
+ _ref$labelOverrides = _ref.labelOverrides,
77
+ labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
74
78
  validateFields = _ref.validateFields,
75
79
  visibleFields = _ref.visibleFields,
76
80
  mclProps = _objectWithoutProperties(_ref, _excluded);
@@ -102,7 +106,6 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
102
106
  },
103
107
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalFormArrays.FieldArray, _objectSpread({
104
108
  actionAssigner: actionAssigner,
105
- actionCalls: actionCalls,
106
109
  columnMapping: columnMapping,
107
110
  component: ActionListFieldArrayWithRef,
108
111
  creatableFields: creatableFields,
@@ -111,7 +114,10 @@ var ActionList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
111
114
  editableFields: editableFields,
112
115
  fieldComponents: fieldComponents,
113
116
  hideCreateButton: hideCreateButton,
117
+ intlKey: passedIntlKey,
118
+ intlNS: passedIntlNS,
114
119
  label: label,
120
+ labelOverrides: labelOverrides,
115
121
  name: "contentData",
116
122
  triggerFormSubmit: handleSubmit,
117
123
  validateFields: validateFields,
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
- var _reactIntl = require("react-intl");
15
-
16
14
  var _get = _interopRequireDefault(require("lodash/get"));
17
15
 
18
16
  var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
@@ -21,15 +19,19 @@ var _reactFinalForm = require("react-final-form");
21
19
 
22
20
  var _components = require("@folio/stripes/components");
23
21
 
22
+ var _hooks = require("../hooks");
23
+
24
24
  var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/ActionListFieldArray.css"));
25
25
 
26
26
  var _jsxRuntime = require("react/jsx-runtime");
27
27
 
28
- var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fields", "fieldComponents", "hideCreateButton", "label", "validateFields", "visibleFields", "triggerFormSubmit"],
29
- _excluded2 = ["actionListActions", "fieldName", "fieldIndex"],
28
+ var _excluded = ["action"],
29
+ _excluded2 = ["actionAssigner", "columnMapping", "creatableFields", "createCallback", "defaultNewObject", "editableFields", "fields", "fieldComponents", "hideCreateButton", "intlKey", "intlNS", "label", "labelOverrides", "onRowClick", "validateFields", "visibleFields", "triggerFormSubmit"],
30
30
  _excluded3 = ["actionListActions", "fieldName", "fieldIndex"],
31
- _excluded4 = ["actionListActions"],
32
- _excluded5 = ["formatter"];
31
+ _excluded4 = ["actionListActions", "fieldName", "fieldIndex"],
32
+ _excluded5 = ["actionListActions"],
33
+ _excluded6 = ["formatter"],
34
+ _excluded7 = ["actionListActions"];
33
35
 
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
37
 
@@ -45,12 +47,6 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
45
47
 
46
48
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
47
49
 
48
- 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; }
49
-
50
- 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; }
51
-
52
- 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; }
53
-
54
50
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
55
51
 
56
52
  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."); }
@@ -63,6 +59,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
63
59
 
64
60
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
65
61
 
62
+ 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; }
63
+
64
+ 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; }
65
+
66
+ 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; }
67
+
66
68
  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; }
67
69
 
68
70
  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; }
@@ -72,7 +74,6 @@ var NON_EDITING_ACTIONS_WIDTH = 20;
72
74
  var TOTAL_WIDTH = 100;
73
75
  var propTypes = {
74
76
  actionAssigner: _propTypes.default.func,
75
- actionCalls: _propTypes.default.object,
76
77
  columnMapping: _propTypes.default.object,
77
78
  creatableFields: _propTypes.default.object,
78
79
  createCallback: _propTypes.default.func,
@@ -82,28 +83,64 @@ var propTypes = {
82
83
  fieldComponents: _propTypes.default.object,
83
84
  formatter: _propTypes.default.object,
84
85
  hideCreateButton: _propTypes.default.bool,
86
+ intlKey: _propTypes.default.string,
87
+ intlNS: _propTypes.default.string,
85
88
  label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
89
+ labelOverrides: _propTypes.default.object,
90
+ onRowClick: _propTypes.default.func,
86
91
  triggerFormSubmit: _propTypes.default.func.isRequired,
87
92
  validateFields: _propTypes.default.object,
88
93
  visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
94
+ }; // This needs to be outside of the main component for forwardRef to work properly it seems.
95
+
96
+ var ActionTrigger = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
97
+ var _action$label;
98
+
99
+ var action = _ref.action,
100
+ actionTriggerProps = _objectWithoutProperties(_ref, _excluded);
101
+
102
+ if (action.icon) {
103
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, _objectSpread({
104
+ ref: ref,
105
+ icon: action.icon
106
+ }, actionTriggerProps));
107
+ }
108
+
109
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, _objectSpread(_objectSpread({
110
+ ref: ref,
111
+ marginBottom0: true
112
+ }, actionTriggerProps), {}, {
113
+ children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
114
+ }));
115
+ });
116
+ ActionTrigger.propTypes = {
117
+ action: _propTypes.default.shape({
118
+ icon: _propTypes.default.string,
119
+ label: _propTypes.default.string,
120
+ name: _propTypes.default.string
121
+ })
89
122
  };
90
- var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
91
- var actionAssigner = _ref.actionAssigner,
92
- actionCalls = _ref.actionCalls,
93
- columnMapping = _ref.columnMapping,
94
- creatableFields = _ref.creatableFields,
95
- createCallback = _ref.createCallback,
96
- defaultNewObject = _ref.defaultNewObject,
97
- editableFields = _ref.editableFields,
98
- fields = _ref.fields,
99
- fieldComponents = _ref.fieldComponents,
100
- _ref$hideCreateButton = _ref.hideCreateButton,
101
- hideCreateButton = _ref$hideCreateButton === void 0 ? false : _ref$hideCreateButton,
102
- label = _ref.label,
103
- validateFields = _ref.validateFields,
104
- visibleFields = _ref.visibleFields,
105
- triggerFormSubmit = _ref.triggerFormSubmit,
106
- mclProps = _objectWithoutProperties(_ref, _excluded);
123
+ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
124
+ var actionAssigner = _ref2.actionAssigner,
125
+ columnMapping = _ref2.columnMapping,
126
+ creatableFields = _ref2.creatableFields,
127
+ createCallback = _ref2.createCallback,
128
+ defaultNewObject = _ref2.defaultNewObject,
129
+ editableFields = _ref2.editableFields,
130
+ fields = _ref2.fields,
131
+ fieldComponents = _ref2.fieldComponents,
132
+ _ref2$hideCreateButto = _ref2.hideCreateButton,
133
+ hideCreateButton = _ref2$hideCreateButto === void 0 ? false : _ref2$hideCreateButto,
134
+ passedIntlKey = _ref2.intlKey,
135
+ passedIntlNS = _ref2.intlNS,
136
+ label = _ref2.label,
137
+ _ref2$labelOverrides = _ref2.labelOverrides,
138
+ labelOverrides = _ref2$labelOverrides === void 0 ? {} : _ref2$labelOverrides,
139
+ onRowClick = _ref2.onRowClick,
140
+ validateFields = _ref2.validateFields,
141
+ visibleFields = _ref2.visibleFields,
142
+ triggerFormSubmit = _ref2.triggerFormSubmit,
143
+ mclProps = _objectWithoutProperties(_ref2, _excluded2);
107
144
 
108
145
  // Grab finalForm functions/values from form hooks
109
146
  var _useForm = (0, _reactFinalForm.useForm)(),
@@ -115,13 +152,14 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
115
152
  pristine = _useFormState.pristine,
116
153
  submitting = _useFormState.submitting,
117
154
  values = _useFormState.values;
155
+
156
+ var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
118
157
  /*
119
158
  Keep track of which field we are editing.
120
159
  null for no field, string id if we are editing an existing field and
121
160
  'NEW_ROW' for a new row
122
161
  */
123
162
 
124
-
125
163
  var _useState = (0, _react.useState)(null),
126
164
  _useState2 = _slicedToArray(_useState, 2),
127
165
  editing = _useState2[0],
@@ -142,7 +180,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
142
180
  _a = _fields$value$index.actionListActions,
143
181
  _fn = _fields$value$index.fieldName,
144
182
  _fi = _fields$value$index.fieldIndex,
145
- rowData = _objectWithoutProperties(_fields$value$index, _excluded2); // Find "edit" entry in actionAssigner
183
+ rowData = _objectWithoutProperties(_fields$value$index, _excluded3); // Find "edit" entry in actionAssigner
146
184
 
147
185
 
148
186
  var editCallback = (_actionAssigner = actionAssigner(rowData)) === null || _actionAssigner === void 0 ? void 0 : (_actionAssigner$find = _actionAssigner.find(function (act) {
@@ -151,8 +189,6 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
151
189
 
152
190
  if (editCallback) {
153
191
  editCallback(rowData);
154
- } else {
155
- actionCalls.edit(rowData); // DEPRECATED
156
192
  }
157
193
  };
158
194
 
@@ -161,12 +197,10 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
161
197
  _a = _fields$value$index2.actionListActions,
162
198
  _fn = _fields$value$index2.fieldName,
163
199
  _fi = _fields$value$index2.fieldIndex,
164
- rowData = _objectWithoutProperties(_fields$value$index2, _excluded3);
200
+ rowData = _objectWithoutProperties(_fields$value$index2, _excluded4);
165
201
 
166
202
  if (createCallback) {
167
203
  createCallback(rowData);
168
- } else {
169
- actionCalls.create(rowData); // DEPRECATED
170
204
  }
171
205
  };
172
206
 
@@ -200,11 +234,12 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
200
234
  var fieldName = "contentData[".concat(data.rowIndex, "]");
201
235
 
202
236
  var actions = data.actionListActions,
203
- rest = _objectWithoutProperties(data, _excluded4);
237
+ rest = _objectWithoutProperties(data, _excluded5);
204
238
 
205
239
  if (data.id === editing || !data.id && editing === 'NEW_ROW') {
206
240
  // Render the save/cancel buttons
207
241
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
242
+ id: "action-button-parent",
208
243
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
209
244
  buttonStyle: "primary",
210
245
  disabled: hasValidationErrors || submitting || pristine,
@@ -223,8 +258,9 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
223
258
  }
224
259
  },
225
260
  type: "submit",
226
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
227
- id: "stripes-kint-components.actionList.save"
261
+ children: kintIntl.formatKintMessage({
262
+ id: 'save',
263
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.save
228
264
  })
229
265
  }, "save[".concat(data.rowIndex, "]")), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
230
266
  "data-type-button": "cancel",
@@ -238,30 +274,23 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
238
274
  toggleEditing(data.id);
239
275
  }
240
276
  },
241
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
242
- id: "stripes-kint-components.actionList.cancel"
277
+ children: kintIntl.formatKintMessage({
278
+ id: 'cancel',
279
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.cancel
243
280
  })
244
281
  }, "cancel[".concat(data.rowIndex, "]"))]
245
282
  });
246
283
  }
247
284
 
248
285
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
286
+ id: "action-button-parent",
249
287
  children: actions === null || actions === void 0 ? void 0 : actions.map(function (action) {
250
- var _action$label;
251
-
252
288
  var actionFunction;
253
289
 
254
290
  if (action.callback) {
255
291
  actionFunction = function actionFunction() {
256
292
  return action.callback(rest);
257
293
  };
258
- }
259
-
260
- if (!actionFunction && actionCalls[action.name]) {
261
- actionFunction = function actionFunction() {
262
- return actionCalls[action.name](rest);
263
- }; // DEPRECATED
264
-
265
294
  } // Edit has special action functionality, revealing fields etc.
266
295
 
267
296
 
@@ -281,35 +310,64 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
281
310
  } else {
282
311
  throw new Error("Provided ariaLabel for action \"".concat(action.name, "\" must be a function or a string."));
283
312
  }
284
- } // If we're handed an icon, use that for the action button
313
+ }
285
314
 
315
+ var tooltip;
316
+ var tooltipSub;
317
+
318
+ if (action !== null && action !== void 0 && action.tooltip) {
319
+ if (typeof action.tooltip === 'function') {
320
+ tooltip = action.tooltip(data);
321
+ } else {
322
+ tooltip = action.tooltip;
323
+ }
286
324
 
287
- if (action.icon) {
288
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
289
- ariaLabel: ariaLabel,
290
- disabled: editing,
291
- icon: action.icon,
292
- onClick: function onClick() {
293
- return actionFunction ? actionFunction() : function () {
294
- return null;
295
- };
296
- },
297
- to: action.to
298
- }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
299
- } // Else return a button with the label, or failing that the name of the action
325
+ if (action !== null && action !== void 0 && action.tooltipSub) {
326
+ if (typeof action.tooltipSub === 'function') {
327
+ tooltipSub = action.tooltipSub(data);
328
+ } else {
329
+ tooltipSub = action.tooltipSub;
330
+ }
331
+ }
332
+ } // If a tooltip is declared, render that around the actionButton
333
+
334
+
335
+ if (tooltip) {
336
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
337
+ id: "action-".concat(action.name, "[").concat(data.rowIndex, "]-tooltip"),
338
+ sub: tooltipSub,
339
+ text: tooltip,
340
+ children: function children(_ref3) {
341
+ var actionTriggerRef = _ref3.ref,
342
+ ariaIds = _ref3.ariaIds;
343
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionTrigger, {
344
+ ref: actionTriggerRef,
345
+ action: action,
346
+ "aria-describedby": ariaIds.sub,
347
+ "aria-labelledby": ariaIds.text,
348
+ disabled: editing,
349
+ onClick: function onClick() {
350
+ return actionFunction ? actionFunction() : function () {
351
+ return null;
352
+ };
353
+ },
354
+ to: action.to
355
+ }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
356
+ }
357
+ });
358
+ } // Finally, render the action button itself
300
359
 
301
360
 
302
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
361
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionTrigger, {
362
+ action: action,
303
363
  ariaLabel: ariaLabel,
304
364
  disabled: editing,
305
- marginBottom0: true,
306
365
  onClick: function onClick() {
307
366
  return actionFunction ? actionFunction() : function () {
308
367
  return null;
309
368
  };
310
369
  },
311
- to: action.to,
312
- children: (_action$label = action.label) !== null && _action$label !== void 0 ? _action$label : action.name
370
+ to: action.to
313
371
  }, "action-".concat(action.name, "[").concat(data.rowIndex, "]"));
314
372
  })
315
373
  });
@@ -328,7 +386,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
328
386
  };
329
387
 
330
388
  var formatter = mclProps.formatter,
331
- restOfMclProps = _objectWithoutProperties(mclProps, _excluded5); // Destructure formatter part of mclProps
389
+ restOfMclProps = _objectWithoutProperties(mclProps, _excluded6); // Destructure formatter part of mclProps
332
390
 
333
391
 
334
392
  var fieldAwareFormatter = function fieldAwareFormatter() {
@@ -396,18 +454,19 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
396
454
  className: _ActionListFieldArray.default.headerText,
397
455
  children: label
398
456
  }), !hideCreateButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
399
- disabled: editing || !actionCalls.create && !createCallback // DEPRECATED actionCalls
400
- ,
457
+ disabled: editing || !createCallback,
401
458
  marginBottom0: true,
402
459
  onClick: handleClickCreate,
403
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
404
- id: "stripes-kint-components.new"
460
+ children: kintIntl.formatKintMessage({
461
+ id: 'new',
462
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.new
405
463
  })
406
464
  })]
407
465
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MultiColumnList, _objectSpread({
408
466
  columnMapping: _objectSpread(_objectSpread({}, columnMapping), {}, {
409
- actionListActions: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
410
- id: "stripes-kint-components.actionList.actions"
467
+ actionListActions: kintIntl.formatKintMessage({
468
+ id: 'actions',
469
+ overrideValue: labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.actions
411
470
  })
412
471
  }),
413
472
  columnWidths: getColumnWidths(),
@@ -415,7 +474,18 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
415
474
  formatter: _objectSpread({
416
475
  actionListActions: renderActionButtons
417
476
  }, fieldAwareFormatter()),
418
- interactive: false,
477
+ interactive: !!onRowClick,
478
+ onRowClick: onRowClick ? function (e, row) {
479
+ // Make sure we ONLY fire row click from row, and not from action buttons.
480
+ var targetIsAction = e.target.closest('[id^=action-button-parent]') !== null;
481
+
482
+ if (!targetIsAction) {
483
+ var _ala = row.actionListActions,
484
+ rowWithoutActions = _objectWithoutProperties(row, _excluded7);
485
+
486
+ onRowClick(e, rowWithoutActions);
487
+ }
488
+ } : null,
419
489
  visibleColumns: [].concat(_toConsumableArray(visibleFields), ['actionListActions'])
420
490
  }, restOfMclProps))]
421
491
  });