@k-int/stripes-kint-components 2.8.6 → 2.8.7

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 (310) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/es/index.js +70 -71
  3. package/es/lib/ActionList/ActionList.js +37 -49
  4. package/es/lib/ActionList/ActionListFieldArray.js +124 -164
  5. package/es/lib/ActionList/index.js +1 -1
  6. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +62 -89
  7. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +17 -24
  8. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +114 -167
  9. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +37 -89
  10. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +85 -102
  11. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +90 -122
  12. package/es/lib/CustomProperties/Config/CustomPropertyView.js +36 -37
  13. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +50 -156
  14. package/es/lib/CustomProperties/Config/index.js +4 -4
  15. package/es/lib/CustomProperties/Config/testResources.js +13 -21
  16. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +16 -19
  17. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +14 -23
  18. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +30 -31
  19. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +14 -23
  20. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +82 -104
  21. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +29 -75
  22. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +131 -131
  23. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +90 -178
  24. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +40 -43
  25. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +20 -21
  26. package/es/lib/CustomProperties/Edit/index.js +5 -5
  27. package/es/lib/CustomProperties/Edit/testResources.js +15 -29
  28. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +66 -96
  29. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -63
  30. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +50 -75
  31. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +7 -6
  32. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +33 -33
  33. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +18 -49
  34. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +18 -22
  35. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +20 -52
  36. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +42 -46
  37. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +77 -257
  38. package/es/lib/CustomProperties/Filter/index.js +6 -6
  39. package/es/lib/CustomProperties/Filter/testResources.js +36 -42
  40. package/es/lib/CustomProperties/Filter/useOperators.js +17 -19
  41. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +17 -32
  42. package/es/lib/CustomProperties/Filter/useValueProps.js +21 -25
  43. package/es/lib/CustomProperties/View/CustomPropertiesView.js +16 -19
  44. package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +11 -16
  45. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +60 -79
  46. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +17 -30
  47. package/es/lib/CustomProperties/View/CustomPropertyCard.js +30 -41
  48. package/es/lib/CustomProperties/View/index.js +3 -3
  49. package/es/lib/CustomProperties/View/testResources.js +5 -9
  50. package/es/lib/CustomProperties/index.js +18 -18
  51. package/es/lib/CycleButton/CycleButton.js +19 -35
  52. package/es/lib/CycleButton/index.js +1 -1
  53. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +98 -157
  54. package/es/lib/EditableRefdataCategoryList/index.js +1 -1
  55. package/es/lib/EditableRefdataList/EditableRefdataList.js +110 -172
  56. package/es/lib/EditableRefdataList/index.js +1 -1
  57. package/es/lib/EditableSettingsList/EditableSettingsList.js +12 -9
  58. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +16 -22
  59. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +61 -96
  60. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +23 -36
  61. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +99 -83
  62. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +19 -24
  63. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +187 -299
  64. package/es/lib/EditableSettingsList/SettingField/SettingField.js +43 -57
  65. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +60 -106
  66. package/es/lib/EditableSettingsList/SettingField/index.js +3 -3
  67. package/es/lib/EditableSettingsList/index.js +3 -3
  68. package/es/lib/FormModal/FormModal.js +43 -48
  69. package/es/lib/FormModal/index.js +1 -1
  70. package/es/lib/IconSelect/IconSelect.js +50 -76
  71. package/es/lib/IconSelect/index.js +1 -1
  72. package/es/lib/NoResultsMessage/NoResultsMessage.js +18 -17
  73. package/es/lib/NoResultsMessage/index.js +1 -1
  74. package/es/lib/QueryTypedown/QueryTypedown.js +16 -35
  75. package/es/lib/QueryTypedown/index.js +1 -1
  76. package/es/lib/RefdataButtons/RefdataButtons.js +30 -34
  77. package/es/lib/RefdataButtons/index.js +1 -1
  78. package/es/lib/RichSelect/RichSelect.js +77 -99
  79. package/es/lib/RichSelect/index.js +2 -2
  80. package/es/lib/RichSelect/useSelectedOption.js +5 -16
  81. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +84 -113
  82. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +39 -47
  83. package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
  84. package/es/lib/SASQLookupComponent/index.js +2 -2
  85. package/es/lib/SASQRoute/SASQRoute.js +26 -32
  86. package/es/lib/SASQRoute/index.js +1 -1
  87. package/es/lib/SASQViewComponent/SASQViewComponent.js +29 -40
  88. package/es/lib/SASQViewComponent/index.js +1 -1
  89. package/es/lib/SearchField/SearchField.js +11 -18
  90. package/es/lib/SearchField/index.js +1 -1
  91. package/es/lib/SettingPage/SettingPage.js +17 -15
  92. package/es/lib/SettingPage/SettingPagePane.js +13 -12
  93. package/es/lib/SettingPage/index.js +2 -2
  94. package/es/lib/Typedown/Typedown.js +73 -98
  95. package/es/lib/Typedown/index.js +1 -1
  96. package/es/lib/constants/customProperties.js +11 -22
  97. package/es/lib/constants/eventCodes.js +3 -6
  98. package/es/lib/contexts/SettingsContext.js +2 -3
  99. package/es/lib/contexts/index.js +1 -1
  100. package/es/lib/hooks/index.js +17 -17
  101. package/es/lib/hooks/settingsHooks/index.js +3 -3
  102. package/es/lib/hooks/settingsHooks/useAppSettings.js +22 -34
  103. package/es/lib/hooks/settingsHooks/useSettingSection.js +17 -19
  104. package/es/lib/hooks/settingsHooks/useSettings.js +56 -69
  105. package/es/lib/hooks/typedownHooks/index.js +3 -3
  106. package/es/lib/hooks/typedownHooks/useTypedown.js +49 -50
  107. package/es/lib/hooks/typedownHooks/useTypedownData.js +12 -23
  108. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +13 -22
  109. package/es/lib/hooks/useActiveElement.js +10 -20
  110. package/es/lib/hooks/useAvailableCustomProperties.js +10 -25
  111. package/es/lib/hooks/useCustomProperties.js +23 -32
  112. package/es/lib/hooks/useHelperApp.js +31 -51
  113. package/es/lib/hooks/useInvalidateRefdata.js +4 -7
  114. package/es/lib/hooks/useKiwtFieldArray.js +35 -47
  115. package/es/lib/hooks/useKiwtSASQuery.js +40 -51
  116. package/es/lib/hooks/useLocalStorageState.js +7 -20
  117. package/es/lib/hooks/useMutateCustomProperties.js +23 -73
  118. package/es/lib/hooks/useMutateRefdataCategory.js +22 -68
  119. package/es/lib/hooks/useMutateRefdataValue.js +31 -73
  120. package/es/lib/hooks/useQIndex.js +17 -32
  121. package/es/lib/hooks/useRefdata.js +19 -22
  122. package/es/lib/hooks/useTemplates.js +16 -16
  123. package/es/lib/utils/buildUrl.js +9 -11
  124. package/es/lib/utils/generateKiwtQuery.js +4 -7
  125. package/es/lib/utils/generateKiwtQueryParams.js +77 -96
  126. package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -21
  127. package/es/lib/utils/highlightString.js +17 -37
  128. package/es/lib/utils/index.js +15 -15
  129. package/es/lib/utils/matchString.js +5 -10
  130. package/es/lib/utils/parseErrorResponse.js +22 -67
  131. package/es/lib/utils/refdataOptions.js +2 -3
  132. package/es/lib/utils/refdataQueryKey.js +3 -4
  133. package/es/lib/utils/renderHelpText.js +32 -53
  134. package/es/lib/utils/selectorSafe.js +2 -3
  135. package/es/lib/utils/sortByLabel.js +4 -6
  136. package/es/lib/utils/toCamelCase.js +8 -14
  137. package/es/lib/utils/typedownQueryKey.js +3 -4
  138. package/es/lib/utils/validators.js +28 -34
  139. package/package.json +24 -9
  140. package/es/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -69
  141. package/es/artifacts/coverage-jest/lcov-report/prettify.js +0 -814
  142. package/es/artifacts/coverage-jest/lcov-report/sorter.js +0 -181
  143. package/junit.xml +0 -273
  144. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +0 -364
  145. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +0 -1426
  146. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +0 -146
  147. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +0 -88
  148. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +0 -667
  149. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +0 -1162
  150. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +0 -1474
  151. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +0 -733
  152. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +0 -176
  153. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +0 -97
  154. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/testResources.js.html +0 -793
  155. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +0 -208
  156. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +0 -352
  157. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +0 -826
  158. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +0 -1297
  159. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +0 -454
  160. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +0 -206
  161. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +0 -100
  162. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +0 -271
  163. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +0 -499
  164. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +0 -568
  165. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +0 -415
  166. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +0 -340
  167. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +0 -502
  168. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +0 -251
  169. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +0 -103
  170. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +0 -223
  171. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +0 -271
  172. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +0 -199
  173. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +0 -253
  174. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +0 -211
  175. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +0 -445
  176. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +0 -619
  177. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +0 -176
  178. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +0 -94
  179. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +0 -571
  180. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +0 -116
  181. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +0 -175
  182. package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +0 -217
  183. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +0 -131
  184. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +0 -88
  185. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +0 -664
  186. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +0 -131
  187. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +0 -88
  188. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +0 -730
  189. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +0 -131
  190. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +0 -88
  191. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +0 -271
  192. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +0 -250
  193. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +0 -412
  194. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +0 -313
  195. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +0 -559
  196. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +0 -161
  197. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +0 -94
  198. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +0 -146
  199. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +0 -94
  200. package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +0 -379
  201. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +0 -131
  202. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +0 -88
  203. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +0 -247
  204. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +0 -131
  205. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +0 -88
  206. package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +0 -508
  207. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +0 -131
  208. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +0 -88
  209. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +0 -361
  210. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +0 -131
  211. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +0 -88
  212. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +0 -190
  213. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +0 -131
  214. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +0 -88
  215. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +0 -370
  216. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +0 -131
  217. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +0 -88
  218. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +0 -559
  219. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +0 -146
  220. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +0 -88
  221. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +0 -253
  222. package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +0 -718
  223. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +0 -146
  224. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +0 -91
  225. package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +0 -127
  226. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +0 -991
  227. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +0 -400
  228. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +0 -131
  229. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +0 -88
  230. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +0 -131
  231. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +0 -91
  232. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +0 -346
  233. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +0 -131
  234. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +0 -88
  235. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +0 -307
  236. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +0 -131
  237. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +0 -88
  238. package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +0 -214
  239. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +0 -131
  240. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +0 -88
  241. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +0 -208
  242. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +0 -208
  243. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +0 -146
  244. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +0 -91
  245. package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +0 -901
  246. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +0 -131
  247. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +0 -88
  248. package/src/artifacts/coverage-jest/lcov-report/base.css +0 -224
  249. package/src/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -87
  250. package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +0 -121
  251. package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +0 -94
  252. package/src/artifacts/coverage-jest/lcov-report/constants/index.html +0 -131
  253. package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +0 -97
  254. package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +0 -131
  255. package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +0 -91
  256. package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
  257. package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +0 -371
  258. package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +0 -139
  259. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +0 -161
  260. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +0 -94
  261. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +0 -292
  262. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +0 -214
  263. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +0 -463
  264. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +0 -161
  265. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +0 -94
  266. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +0 -520
  267. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +0 -181
  268. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +0 -163
  269. package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +0 -157
  270. package/src/artifacts/coverage-jest/lcov-report/hooks/useAvailableCustomProperties.js.html +0 -205
  271. package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +0 -325
  272. package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +0 -283
  273. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +0 -151
  274. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +0 -199
  275. package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +0 -118
  276. package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +0 -238
  277. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +0 -274
  278. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +0 -196
  279. package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +0 -136
  280. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +0 -283
  281. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +0 -274
  282. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +0 -322
  283. package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +0 -208
  284. package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +0 -265
  285. package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +0 -187
  286. package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +0 -166
  287. package/src/artifacts/coverage-jest/lcov-report/index.html +0 -581
  288. package/src/artifacts/coverage-jest/lcov-report/prettify.css +0 -1
  289. package/src/artifacts/coverage-jest/lcov-report/prettify.js +0 -2
  290. package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
  291. package/src/artifacts/coverage-jest/lcov-report/sorter.js +0 -196
  292. package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +0 -193
  293. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +0 -109
  294. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +0 -631
  295. package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +0 -124
  296. package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +0 -211
  297. package/src/artifacts/coverage-jest/lcov-report/utils/index.html +0 -341
  298. package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +0 -193
  299. package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +0 -127
  300. package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +0 -142
  301. package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +0 -280
  302. package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +0 -109
  303. package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +0 -112
  304. package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +0 -166
  305. package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +0 -103
  306. package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +0 -130
  307. package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +0 -127
  308. package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +0 -112
  309. package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +0 -370
  310. package/src/artifacts/coverage-jest/lcov.info +0 -4951
@@ -6,49 +6,34 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _useOperators = _interopRequireDefault(require("./useOperators"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
- 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."); }
11
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
13
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
14
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
- var useParseActiveFilterStrings = function useParseActiveFilterStrings(filterStrings) {
16
- var operators = (0, _useOperators.default)().map(function (o) {
17
- return o.value;
18
- });
19
- var numberOfFilters = 0;
20
- var filters = filterStrings.map(function (filter) {
21
- var customProperty;
22
- var rules = filter.split('||').map(function (ruleString) {
23
- var _operators$find;
9
+ const useParseActiveFilterStrings = filterStrings => {
10
+ const operators = (0, _useOperators.default)().map(o => o.value);
11
+ let numberOfFilters = 0;
12
+ const filters = filterStrings.map(filter => {
13
+ let customProperty;
14
+ const rules = filter.split('||').map(ruleString => {
24
15
  // ruleString is constructed in this.handleSubmit passed to CustomPropertyFiltersForm
25
16
  // and has shape "customProperties.foo.value!=42"
26
17
  // OR customProperties.foo.value.id==1234, so make sure to disregard the .id
27
- var _ruleString$split = ruleString.split('.value'),
28
- _ruleString$split2 = _slicedToArray(_ruleString$split, 2),
29
- customPropertyPath = _ruleString$split2[0],
30
- rule = _ruleString$split2[1];
31
- var idSafeRule = rule.replace('.id', '');
18
+ const [customPropertyPath, rule] = ruleString.split('.value');
19
+ const idSafeRule = rule.replace('.id', '');
32
20
  customProperty = customPropertyPath.replace('customProperties.', '');
33
- var operator = (_operators$find = operators.find(function (o) {
34
- return idSafeRule.startsWith(o);
35
- })) !== null && _operators$find !== void 0 ? _operators$find : '';
36
- var value = idSafeRule.substring(operator.length);
21
+ const operator = operators.find(o => idSafeRule.startsWith(o)) ?? '';
22
+ const value = idSafeRule.substring(operator.length);
37
23
  numberOfFilters += 1;
38
24
  return {
39
- operator: operator,
40
- value: value
25
+ operator,
26
+ value
41
27
  };
42
28
  });
43
29
  return {
44
- customProperty: customProperty,
45
- rules: rules
30
+ customProperty,
31
+ rules
46
32
  };
47
33
  });
48
34
  return {
49
- filters: filters,
50
- numberOfFilters: numberOfFilters
35
+ filters,
36
+ numberOfFilters
51
37
  };
52
38
  };
53
- var _default = useParseActiveFilterStrings;
54
- exports.default = _default;
39
+ var _default = exports.default = useParseActiveFilterStrings;
@@ -1,6 +1,5 @@
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
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -8,16 +7,18 @@ exports.default = void 0;
8
7
  var _components = require("@folio/stripes/components");
9
8
  var CUSTPROP_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
10
9
  var _validators = require("../../utils/validators");
11
- 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); }
12
- 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; }
13
- var REFDATA = CUSTPROP_TYPES.REFDATA_CLASS_NAME,
14
- MULTIREFDATA = CUSTPROP_TYPES.MULTI_REFDATA_CLASS_NAME,
15
- DECIMAL = CUSTPROP_TYPES.DECIMAL_CLASS_NAME,
16
- INTEGER = CUSTPROP_TYPES.INTEGER_CLASS_NAME,
17
- DATE = CUSTPROP_TYPES.DATE_CLASS_NAME,
18
- TEXT = CUSTPROP_TYPES.TEXT_CLASS_NAME;
19
- var useValueProps = function useValueProps(custPropDefinition) {
20
- var props = {
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ const {
13
+ REFDATA_CLASS_NAME: REFDATA,
14
+ MULTI_REFDATA_CLASS_NAME: MULTIREFDATA,
15
+ DECIMAL_CLASS_NAME: DECIMAL,
16
+ INTEGER_CLASS_NAME: INTEGER,
17
+ DATE_CLASS_NAME: DATE,
18
+ TEXT_CLASS_NAME: TEXT
19
+ } = CUSTPROP_TYPES;
20
+ const useValueProps = custPropDefinition => {
21
+ const props = {
21
22
  validate: _validators.required
22
23
  };
23
24
  switch (custPropDefinition.type) {
@@ -29,22 +30,18 @@ var useValueProps = function useValueProps(custPropDefinition) {
29
30
  break;
30
31
  case REFDATA:
31
32
  props.component = _components.Select;
32
- props.dataOptions = custPropDefinition.category.values.map(function (rdv) {
33
- return {
34
- label: rdv.label,
35
- value: rdv.id
36
- };
37
- });
33
+ props.dataOptions = custPropDefinition.category.values.map(rdv => ({
34
+ label: rdv.label,
35
+ value: rdv.id
36
+ }));
38
37
  props.placeholder = ' ';
39
38
  break;
40
39
  case MULTIREFDATA:
41
40
  props.component = _components.Select;
42
- props.dataOptions = custPropDefinition.category.values.map(function (mrdv) {
43
- return {
44
- label: mrdv.label,
45
- value: mrdv.id
46
- };
47
- });
41
+ props.dataOptions = custPropDefinition.category.values.map(mrdv => ({
42
+ label: mrdv.label,
43
+ value: mrdv.id
44
+ }));
48
45
  props.placeholder = ' ';
49
46
  break;
50
47
  case DATE:
@@ -60,5 +57,4 @@ var useValueProps = function useValueProps(custPropDefinition) {
60
57
  }
61
58
  return props;
62
59
  };
63
- var _default = useValueProps;
64
- exports.default = _default;
60
+ var _default = exports.default = useValueProps;
@@ -8,23 +8,21 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
8
8
  var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertiesViewCtx"));
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- var CustomPropertiesView = function CustomPropertiesView(_ref) {
12
- var _ref$contexts = _ref.contexts,
13
- contexts = _ref$contexts === void 0 ? [] : _ref$contexts,
14
- customProperties = _ref.customProperties,
15
- customPropertiesEndpoint = _ref.customPropertiesEndpoint,
16
- id = _ref.id,
17
- _ref$labelOverrides = _ref.labelOverrides,
18
- labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
19
- return contexts.map(function (ctx) {
20
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
21
- ctx: ctx,
22
- customProperties: customProperties,
23
- customPropertiesEndpoint: customPropertiesEndpoint,
24
- id: id,
25
- labelOverrides: labelOverrides
26
- }, "customPropertiesView-".concat(ctx));
27
- });
11
+ const CustomPropertiesView = _ref => {
12
+ let {
13
+ contexts = [],
14
+ customProperties,
15
+ customPropertiesEndpoint,
16
+ id,
17
+ labelOverrides = {}
18
+ } = _ref;
19
+ return contexts.map(ctx => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
20
+ ctx,
21
+ customProperties,
22
+ customPropertiesEndpoint,
23
+ id,
24
+ labelOverrides
25
+ }, `customPropertiesView-${ctx}`));
28
26
  };
29
27
  CustomPropertiesView.propTypes = {
30
28
  contexts: _propTypes.default.arrayOf(_propTypes.default.string),
@@ -34,5 +32,4 @@ CustomPropertiesView.propTypes = {
34
32
  labelOverrides: _propTypes.default.object,
35
33
  nameOverride: _propTypes.default.string
36
34
  };
37
- var _default = CustomPropertiesView;
38
- exports.default = _default;
35
+ var _default = exports.default = CustomPropertiesView;
@@ -9,16 +9,12 @@ var _testResources = require("./testResources");
9
9
  var _CustomPropertiesView = _interopRequireDefault(require("./CustomPropertiesView"));
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- jest.mock('./CustomPropertiesViewCtx', function () {
13
- return function () {
14
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
15
- children: "CustomPropertiesViewCtx"
16
- });
17
- };
18
- });
19
- describe('CustomPropertiesView', function () {
20
- var renderComponent;
21
- beforeEach(function () {
12
+ jest.mock('./CustomPropertiesViewCtx', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
13
+ children: "CustomPropertiesViewCtx"
14
+ }));
15
+ describe('CustomPropertiesView', () => {
16
+ let renderComponent;
17
+ beforeEach(() => {
22
18
  renderComponent = (0, _helpers.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
23
19
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesView.default, {
24
20
  contexts: _testResources.contexts,
@@ -29,11 +25,10 @@ describe('CustomPropertiesView', function () {
29
25
  })
30
26
  }));
31
27
  });
32
- it('renders CustomPropertiesViewCtx component ', function () {
33
- var _renderComponent = renderComponent,
34
- getByText = _renderComponent.getByText;
35
- (0, _react2.waitFor)(function () {
36
- return expect(getByText('CustomPropertiesViewCtx')).toBeInTheDocument();
37
- });
28
+ it('renders CustomPropertiesViewCtx component ', () => {
29
+ const {
30
+ getByText
31
+ } = renderComponent;
32
+ (0, _react2.waitFor)(() => expect(getByText('CustomPropertiesViewCtx')).toBeInTheDocument());
38
33
  });
39
34
  });
@@ -11,28 +11,19 @@ var _hooks = require("../../hooks");
11
11
  var _CustomPropertyCard = _interopRequireDefault(require("./CustomPropertyCard"));
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
- 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."); }
16
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
18
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
19
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
- var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
21
- var _custprops$filter$len, _custprops$filter;
22
- var ctx = _ref.ctx,
23
- _ref$customProperties = _ref.customProperties,
24
- customProperties = _ref$customProperties === void 0 ? [] : _ref$customProperties,
25
- customPropertiesEndpoint = _ref.customPropertiesEndpoint,
26
- id = _ref.id,
27
- _ref$labelOverrides = _ref.labelOverrides,
28
- labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
14
+ const CustomPropertiesViewCtx = _ref => {
15
+ let {
16
+ ctx,
17
+ customProperties = [],
18
+ customPropertiesEndpoint,
19
+ id,
20
+ labelOverrides = {}
21
+ } = _ref;
29
22
  // Deal with all the possible label override options
30
- var getAccordionLabel = function getAccordionLabel() {
31
- var _labelOverrides$defau;
23
+ const getAccordionLabel = () => {
32
24
  // Special case for null context
33
25
  if (ctx === 'isNull') {
34
- var _labelOverrides$noCon;
35
- return (_labelOverrides$noCon = labelOverrides.noContext) !== null && _labelOverrides$noCon !== void 0 ? _labelOverrides$noCon : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
26
+ return labelOverrides.noContext ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
36
27
  id: "stripes-kint-components.customProperties"
37
28
  });
38
29
  }
@@ -48,69 +39,63 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
48
39
  }
49
40
 
50
41
  // Label override for default title or finally built in default
51
- return (_labelOverrides$defau = labelOverrides.defaultTitle) !== null && _labelOverrides$defau !== void 0 ? _labelOverrides$defau : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
42
+ return labelOverrides.defaultTitle ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
52
43
  id: "stripes-kint-components.customProperties.ctx.title",
53
44
  values: {
54
- ctx: ctx
45
+ ctx
55
46
  }
56
47
  });
57
48
  };
58
- var _useCustomProperties = (0, _hooks.useCustomProperties)({
59
- ctx: ctx,
60
- endpoint: customPropertiesEndpoint,
61
- returnQueryObject: true,
62
- options: {
63
- sort: [{
64
- path: 'retired'
65
- },
66
- // Place retired custprops at the end
67
- {
68
- path: 'primary',
69
- direction: 'desc'
70
- },
71
- // Primary properties should display before optional
72
- {
73
- path: 'weight'
74
- },
75
- // Within those groups, sort by weight
76
- {
77
- path: 'label'
78
- } // For those with the same weight, sort by label
79
- ]
80
- }
81
- }),
82
- custprops = _useCustomProperties.data,
83
- isLoading = _useCustomProperties.isLoading;
49
+ const {
50
+ data: custprops,
51
+ isLoading
52
+ } = (0, _hooks.useCustomProperties)({
53
+ ctx,
54
+ endpoint: customPropertiesEndpoint,
55
+ returnQueryObject: true,
56
+ options: {
57
+ sort: [{
58
+ path: 'retired'
59
+ },
60
+ // Place retired custprops at the end
61
+ {
62
+ path: 'primary',
63
+ direction: 'desc'
64
+ },
65
+ // Primary properties should display before optional
66
+ {
67
+ path: 'weight'
68
+ },
69
+ // Within those groups, sort by weight
70
+ {
71
+ path: 'label'
72
+ } // For those with the same weight, sort by label
73
+ ]
74
+ }
75
+ });
76
+
84
77
  if (isLoading) {
85
78
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
86
79
  closedByDefault: true,
87
80
  displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
88
81
  displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
89
- id: "".concat(id, "-accordion-").concat(ctx),
82
+ id: `${id}-accordion-${ctx}`,
90
83
  label: getAccordionLabel(),
91
84
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {})
92
85
  });
93
86
  }
94
- var countSetProperties = function countSetProperties(primary) {
95
- var _Object$entries$filte, _Object$entries, _Object$entries$filte2;
96
- return (_Object$entries$filte = (_Object$entries = Object.entries(customProperties)) === null || _Object$entries === void 0 ? void 0 : (_Object$entries$filte2 = _Object$entries.filter(function (_ref2) {
97
- var _cp$, _cp$$type, _cp$2, _cp$2$type, _cp$3, _cp$3$type;
98
- var _ref3 = _slicedToArray(_ref2, 2),
99
- _key = _ref3[0],
100
- cp = _ref3[1];
101
- return (((_cp$ = cp[0]) === null || _cp$ === void 0 ? void 0 : (_cp$$type = _cp$.type) === null || _cp$$type === void 0 ? void 0 : _cp$$type.ctx) === ctx || ctx === 'isNull' && !((_cp$2 = cp[0]) !== null && _cp$2 !== void 0 && (_cp$2$type = _cp$2.type) !== null && _cp$2$type !== void 0 && _cp$2$type.ctx)) &&
102
- // Either the ctx string matches, or isNull matches blank
103
- ((_cp$3 = cp[0]) === null || _cp$3 === void 0 ? void 0 : (_cp$3$type = _cp$3.type) === null || _cp$3$type === void 0 ? void 0 : _cp$3$type.primary) === primary // Only count non-primary set custprops
104
- ;
105
- })) === null || _Object$entries$filte2 === void 0 ? void 0 : _Object$entries$filte2.length) !== null && _Object$entries$filte !== void 0 ? _Object$entries$filte : 0;
106
- };
87
+ const countSetProperties = primary => Object.entries(customProperties)?.filter(_ref2 => {
88
+ let [_key, cp] = _ref2;
89
+ return (cp[0]?.type?.ctx === ctx || ctx === 'isNull' && !cp[0]?.type?.ctx) &&
90
+ // Either the ctx string matches, or isNull matches blank
91
+ cp[0]?.type?.primary === primary // Only count non-primary set custprops
92
+ ;
93
+ })?.length ?? 0;
107
94
 
108
95
  // We need to display any set properties, along with any non-set primary properties
109
- var primaryCount = (_custprops$filter$len = custprops === null || custprops === void 0 ? void 0 : (_custprops$filter = custprops.filter(function (cp) {
110
- return cp.primary === true;
111
- })) === null || _custprops$filter === void 0 ? void 0 : _custprops$filter.length) !== null && _custprops$filter$len !== void 0 ? _custprops$filter$len : 0;
112
- var optionalCount = countSetProperties(false);
113
- var setPrimaryCount = countSetProperties(true);
96
+ const primaryCount = custprops?.filter(cp => cp.primary === true)?.length ?? 0;
97
+ const optionalCount = countSetProperties(false);
98
+ const setPrimaryCount = countSetProperties(true);
114
99
  return primaryCount + optionalCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
115
100
  closedByDefault: true,
116
101
  displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
@@ -119,18 +104,15 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
119
104
  displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
120
105
  children: setPrimaryCount + optionalCount
121
106
  }),
122
- id: "".concat(id, "-accordion-").concat(ctx),
107
+ id: `${id}-accordion-${ctx}`,
123
108
  label: getAccordionLabel(),
124
- children: custprops.map(function (cp, index) {
125
- var _customProperties$cp$;
126
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyCard.default, {
127
- ctx: ctx,
128
- customProperty: customProperties === null || customProperties === void 0 ? void 0 : (_customProperties$cp$ = customProperties[cp.name]) === null || _customProperties$cp$ === void 0 ? void 0 : _customProperties$cp$[0],
129
- customPropertyDefinition: cp,
130
- index: index,
131
- labelOverrides: labelOverrides
132
- }, "custom-property-card-".concat(ctx, "[").concat(index, "]"));
133
- })
109
+ children: custprops.map((cp, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyCard.default, {
110
+ ctx: ctx,
111
+ customProperty: customProperties?.[cp.name]?.[0],
112
+ customPropertyDefinition: cp,
113
+ index: index,
114
+ labelOverrides: labelOverrides
115
+ }, `custom-property-card-${ctx}[${index}]`))
134
116
  });
135
117
  };
136
118
  CustomPropertiesViewCtx.propTypes = {
@@ -140,5 +122,4 @@ CustomPropertiesViewCtx.propTypes = {
140
122
  id: _propTypes.default.string,
141
123
  labelOverrides: _propTypes.default.object
142
124
  };
143
- var _default = CustomPropertiesViewCtx;
144
- exports.default = _default;
125
+ var _default = exports.default = CustomPropertiesViewCtx;
@@ -9,38 +9,25 @@ var _testResources = require("./testResources");
9
9
  var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertiesViewCtx"));
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- 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); }
13
- 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; }
14
- 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; }
15
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
- jest.mock('../../hooks', function () {
19
- return {
20
- useCustomProperties: function useCustomProperties() {
21
- return [];
22
- }
23
- };
24
- });
25
- jest.mock('./CustomPropertyCard', function () {
26
- return function () {
27
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
28
- children: "CustomPropertyCard"
29
- });
30
- };
31
- });
32
- describe('CustomPropertiesViewCtx', function () {
33
- var renderComponent;
34
- beforeEach(function () {
12
+ jest.mock('../../hooks', () => ({
13
+ useCustomProperties: () => []
14
+ }));
15
+ jest.mock('./CustomPropertyCard', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
16
+ children: "CustomPropertyCard"
17
+ }));
18
+ describe('CustomPropertiesViewCtx', () => {
19
+ let renderComponent;
20
+ beforeEach(() => {
35
21
  renderComponent = (0, _helpers.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
36
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, _objectSpread({}, _testResources.data))
22
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
23
+ ..._testResources.data
24
+ })
37
25
  }));
38
26
  });
39
- it('renders CustomPropertyCard component ', function () {
40
- var _renderComponent = renderComponent,
41
- getByText = _renderComponent.getByText;
42
- (0, _react2.waitFor)(function () {
43
- return expect(getByText('CustomPropertyCard')).toBeInTheDocument();
44
- });
27
+ it('renders CustomPropertyCard component ', () => {
28
+ const {
29
+ getByText
30
+ } = renderComponent;
31
+ (0, _react2.waitFor)(() => expect(getByText('CustomPropertyCard')).toBeInTheDocument());
45
32
  });
46
33
  });