@k-int/stripes-kint-components 3.2.2 → 3.2.4

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 (318) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/es/index.js +78 -79
  3. package/es/lib/ActionList/ActionList.js +38 -51
  4. package/es/lib/ActionList/ActionListFieldArray.js +159 -194
  5. package/es/lib/ActionList/index.js +1 -1
  6. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +59 -83
  7. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +15 -19
  8. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +124 -177
  9. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +30 -73
  10. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +93 -106
  11. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +83 -129
  12. package/es/lib/CustomProperties/Config/CustomPropertyView.js +42 -43
  13. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +48 -153
  14. package/es/lib/CustomProperties/Config/index.js +4 -4
  15. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +20 -23
  16. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +11 -16
  17. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +33 -32
  18. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +11 -16
  19. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +88 -111
  20. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +26 -69
  21. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +134 -134
  22. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +95 -192
  23. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +46 -48
  24. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +23 -27
  25. package/es/lib/CustomProperties/Edit/index.js +5 -5
  26. package/es/lib/CustomProperties/Edit/testResources.js +14 -39
  27. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +64 -91
  28. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -63
  29. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +53 -77
  30. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +17 -16
  31. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +34 -31
  32. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +18 -49
  33. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -22
  34. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +23 -56
  35. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +44 -49
  36. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +77 -257
  37. package/es/lib/CustomProperties/Filter/index.js +6 -6
  38. package/es/lib/CustomProperties/Filter/testResources.js +13 -37
  39. package/es/lib/CustomProperties/Filter/useOperators.js +18 -18
  40. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +18 -33
  41. package/es/lib/CustomProperties/Filter/useValueProps.js +23 -29
  42. package/es/lib/CustomProperties/View/CustomPropertiesView.js +20 -23
  43. package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +11 -16
  44. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +63 -80
  45. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +14 -23
  46. package/es/lib/CustomProperties/View/CustomPropertyCard.js +25 -31
  47. package/es/lib/CustomProperties/View/index.js +3 -3
  48. package/es/lib/CustomProperties/View/testResources.js +5 -9
  49. package/es/lib/CustomProperties/index.js +18 -18
  50. package/es/lib/CycleButton/CycleButton.js +19 -35
  51. package/es/lib/CycleButton/index.js +1 -1
  52. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +105 -164
  53. package/es/lib/EditableRefdataCategoryList/index.js +1 -1
  54. package/es/lib/EditableRefdataList/EditableRefdataList.js +119 -181
  55. package/es/lib/EditableRefdataList/index.js +1 -1
  56. package/es/lib/EditableSettingsList/EditableSettingsList.js +15 -13
  57. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +19 -26
  58. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +61 -96
  59. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +27 -41
  60. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +99 -83
  61. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +25 -30
  62. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +187 -299
  63. package/es/lib/EditableSettingsList/SettingField/SettingField.js +76 -111
  64. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +51 -172
  65. package/es/lib/EditableSettingsList/SettingField/index.js +3 -3
  66. package/es/lib/EditableSettingsList/index.js +3 -3
  67. package/es/lib/FormModal/FormModal.js +44 -48
  68. package/es/lib/FormModal/index.js +1 -1
  69. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +27 -35
  70. package/es/lib/FormattedKintMessage/index.js +1 -1
  71. package/es/lib/IconSelect/IconSelect.js +52 -77
  72. package/es/lib/IconSelect/index.js +1 -1
  73. package/es/lib/NoResultsMessage/NoResultsMessage.js +23 -23
  74. package/es/lib/NoResultsMessage/index.js +1 -1
  75. package/es/lib/QueryTypedown/QueryTypedown.js +16 -35
  76. package/es/lib/QueryTypedown/index.js +1 -1
  77. package/es/lib/RefdataButtons/RefdataButtons.js +30 -34
  78. package/es/lib/RefdataButtons/index.js +1 -1
  79. package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +77 -95
  80. package/es/lib/ResponsiveButtonGroup/index.js +1 -1
  81. package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +24 -39
  82. package/es/lib/RichSelect/RichSelect.js +78 -100
  83. package/es/lib/RichSelect/index.js +2 -2
  84. package/es/lib/RichSelect/useSelectedOption.js +5 -16
  85. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +107 -139
  86. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +43 -52
  87. package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
  88. package/es/lib/SASQLookupComponent/index.js +2 -2
  89. package/es/lib/SASQRoute/SASQRoute.js +34 -41
  90. package/es/lib/SASQRoute/index.js +1 -1
  91. package/es/lib/SASQViewComponent/SASQViewComponent.js +37 -49
  92. package/es/lib/SASQViewComponent/index.js +1 -1
  93. package/es/lib/SearchField/SearchField.js +11 -18
  94. package/es/lib/SearchField/index.js +1 -1
  95. package/es/lib/SettingPage/SettingPage.js +20 -19
  96. package/es/lib/SettingPage/SettingPagePane.js +11 -10
  97. package/es/lib/SettingPage/index.js +2 -2
  98. package/es/lib/Typedown/Typedown.js +73 -98
  99. package/es/lib/Typedown/index.js +1 -1
  100. package/es/lib/constants/customProperties.js +11 -22
  101. package/es/lib/constants/eventCodes.js +3 -6
  102. package/es/lib/contexts/SettingsContext.js +2 -3
  103. package/es/lib/contexts/index.js +1 -1
  104. package/es/lib/hooks/__mocks__/index.js +9 -29
  105. package/es/lib/hooks/index.js +20 -20
  106. package/es/lib/hooks/settingsHooks/index.js +3 -3
  107. package/es/lib/hooks/settingsHooks/useAppSettings.js +22 -34
  108. package/es/lib/hooks/settingsHooks/useSettingSection.js +17 -19
  109. package/es/lib/hooks/settingsHooks/useSettings.js +58 -72
  110. package/es/lib/hooks/typedownHooks/index.js +3 -3
  111. package/es/lib/hooks/typedownHooks/useTypedown.js +49 -50
  112. package/es/lib/hooks/typedownHooks/useTypedownData.js +12 -23
  113. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +13 -22
  114. package/es/lib/hooks/useActiveElement.js +10 -20
  115. package/es/lib/hooks/useCustomProperties.js +23 -32
  116. package/es/lib/hooks/useHelperApp.js +31 -51
  117. package/es/lib/hooks/useIntlKey.js +4 -7
  118. package/es/lib/hooks/useIntlKeyStore.js +42 -51
  119. package/es/lib/hooks/useInvalidateRefdata.js +4 -7
  120. package/es/lib/hooks/useKintIntl.js +31 -41
  121. package/es/lib/hooks/useKiwtFieldArray.js +35 -47
  122. package/es/lib/hooks/useKiwtSASQuery.js +40 -51
  123. package/es/lib/hooks/useLocalStorageState.js +7 -20
  124. package/es/lib/hooks/useMutateCustomProperties.js +23 -73
  125. package/es/lib/hooks/useMutateRefdataCategory.js +22 -68
  126. package/es/lib/hooks/useMutateRefdataValue.js +31 -73
  127. package/es/lib/hooks/useQIndex.js +17 -32
  128. package/es/lib/hooks/useRefdata.js +19 -22
  129. package/es/lib/hooks/useSASQQueryMeta.js +14 -22
  130. package/es/lib/hooks/useTemplates.js +16 -16
  131. package/es/lib/utils/buildUrl.js +6 -6
  132. package/es/lib/utils/generateKiwtQuery.js +4 -7
  133. package/es/lib/utils/generateKiwtQueryParams.js +77 -96
  134. package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -21
  135. package/es/lib/utils/highlightString.js +17 -37
  136. package/es/lib/utils/index.js +21 -21
  137. package/es/lib/utils/matchString.js +5 -10
  138. package/es/lib/utils/parseErrorResponse.js +22 -67
  139. package/es/lib/utils/refdataOptions.js +2 -3
  140. package/es/lib/utils/refdataQueryKey.js +3 -4
  141. package/es/lib/utils/selectorSafe.js +2 -3
  142. package/es/lib/utils/sortByLabel.js +4 -6
  143. package/es/lib/utils/toCamelCase.js +8 -14
  144. package/es/lib/utils/typedownQueryKey.js +3 -4
  145. package/es/lib/utils/validators.js +25 -32
  146. package/package.json +12 -2
  147. package/src/lib/CustomProperties/View/CustomPropertyCard.js +3 -3
  148. package/es/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -69
  149. package/es/artifacts/coverage-jest/lcov-report/prettify.js +0 -814
  150. package/es/artifacts/coverage-jest/lcov-report/sorter.js +0 -181
  151. package/junit.xml +0 -273
  152. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +0 -364
  153. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +0 -1426
  154. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +0 -146
  155. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +0 -88
  156. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +0 -667
  157. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +0 -1162
  158. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +0 -1474
  159. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +0 -733
  160. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +0 -176
  161. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +0 -97
  162. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/testResources.js.html +0 -793
  163. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +0 -208
  164. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +0 -352
  165. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +0 -826
  166. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +0 -1297
  167. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +0 -454
  168. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +0 -206
  169. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +0 -100
  170. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +0 -271
  171. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +0 -499
  172. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +0 -568
  173. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +0 -415
  174. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +0 -340
  175. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +0 -502
  176. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +0 -251
  177. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +0 -103
  178. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +0 -223
  179. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +0 -271
  180. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +0 -199
  181. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +0 -253
  182. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +0 -211
  183. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +0 -445
  184. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +0 -619
  185. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +0 -176
  186. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +0 -94
  187. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +0 -571
  188. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +0 -116
  189. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +0 -175
  190. package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +0 -217
  191. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +0 -131
  192. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +0 -88
  193. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +0 -664
  194. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +0 -131
  195. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +0 -88
  196. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +0 -730
  197. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +0 -131
  198. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +0 -88
  199. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +0 -271
  200. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +0 -250
  201. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +0 -412
  202. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +0 -313
  203. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +0 -559
  204. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +0 -161
  205. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +0 -94
  206. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +0 -146
  207. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +0 -94
  208. package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +0 -379
  209. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +0 -131
  210. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +0 -88
  211. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +0 -247
  212. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +0 -131
  213. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +0 -88
  214. package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +0 -508
  215. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +0 -131
  216. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +0 -88
  217. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +0 -361
  218. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +0 -131
  219. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +0 -88
  220. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +0 -190
  221. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +0 -131
  222. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +0 -88
  223. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +0 -370
  224. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +0 -131
  225. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +0 -88
  226. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +0 -571
  227. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +0 -146
  228. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +0 -88
  229. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +0 -253
  230. package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +0 -718
  231. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +0 -146
  232. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +0 -91
  233. package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +0 -127
  234. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +0 -1069
  235. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +0 -400
  236. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +0 -131
  237. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +0 -88
  238. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +0 -131
  239. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +0 -91
  240. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +0 -346
  241. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +0 -131
  242. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +0 -88
  243. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +0 -307
  244. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +0 -131
  245. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +0 -88
  246. package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +0 -214
  247. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +0 -131
  248. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +0 -88
  249. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +0 -208
  250. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +0 -208
  251. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +0 -146
  252. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +0 -91
  253. package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +0 -901
  254. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +0 -131
  255. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +0 -88
  256. package/src/artifacts/coverage-jest/lcov-report/base.css +0 -224
  257. package/src/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -87
  258. package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +0 -121
  259. package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +0 -94
  260. package/src/artifacts/coverage-jest/lcov-report/constants/index.html +0 -131
  261. package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +0 -97
  262. package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +0 -131
  263. package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +0 -91
  264. package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
  265. package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +0 -371
  266. package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +0 -139
  267. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +0 -161
  268. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +0 -94
  269. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +0 -292
  270. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +0 -214
  271. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +0 -463
  272. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +0 -161
  273. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +0 -94
  274. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +0 -520
  275. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +0 -181
  276. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +0 -163
  277. package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +0 -157
  278. package/src/artifacts/coverage-jest/lcov-report/hooks/useAvailableCustomProperties.js.html +0 -205
  279. package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +0 -325
  280. package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +0 -283
  281. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +0 -151
  282. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +0 -199
  283. package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +0 -118
  284. package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +0 -238
  285. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +0 -274
  286. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +0 -196
  287. package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +0 -136
  288. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +0 -283
  289. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +0 -274
  290. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +0 -322
  291. package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +0 -208
  292. package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +0 -265
  293. package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +0 -187
  294. package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +0 -166
  295. package/src/artifacts/coverage-jest/lcov-report/index.html +0 -581
  296. package/src/artifacts/coverage-jest/lcov-report/prettify.css +0 -1
  297. package/src/artifacts/coverage-jest/lcov-report/prettify.js +0 -2
  298. package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
  299. package/src/artifacts/coverage-jest/lcov-report/sorter.js +0 -196
  300. package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +0 -193
  301. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +0 -109
  302. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +0 -631
  303. package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +0 -124
  304. package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +0 -211
  305. package/src/artifacts/coverage-jest/lcov-report/utils/index.html +0 -341
  306. package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +0 -193
  307. package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +0 -127
  308. package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +0 -142
  309. package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +0 -280
  310. package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +0 -109
  311. package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +0 -112
  312. package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +0 -166
  313. package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +0 -103
  314. package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +0 -130
  315. package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +0 -127
  316. package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +0 -112
  317. package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +0 -370
  318. package/src/artifacts/coverage-jest/lcov.info +0 -4957
@@ -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,17 +7,19 @@ 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, intlKey, intlNS) {
20
- var labelOverrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
21
- 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 = function (custPropDefinition, intlKey, intlNS) {
21
+ let labelOverrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
22
+ const props = {
22
23
  validate: _validators.required
23
24
  };
24
25
  switch (custPropDefinition.type) {
@@ -26,28 +27,22 @@ var useValueProps = function useValueProps(custPropDefinition, intlKey, intlNS)
26
27
  case DECIMAL:
27
28
  props.component = _components.TextField;
28
29
  props.type = 'number';
29
- props.validate = function (value) {
30
- return (0, _validators.invalidNumber)(value, intlKey, intlNS, labelOverrides);
31
- };
30
+ props.validate = value => (0, _validators.invalidNumber)(value, intlKey, intlNS, labelOverrides);
32
31
  break;
33
32
  case REFDATA:
34
33
  props.component = _components.Select;
35
- props.dataOptions = custPropDefinition.category.values.map(function (rdv) {
36
- return {
37
- label: rdv.label,
38
- value: rdv.id
39
- };
40
- });
34
+ props.dataOptions = custPropDefinition.category.values.map(rdv => ({
35
+ label: rdv.label,
36
+ value: rdv.id
37
+ }));
41
38
  props.placeholder = ' ';
42
39
  break;
43
40
  case MULTIREFDATA:
44
41
  props.component = _components.Select;
45
- props.dataOptions = custPropDefinition.category.values.map(function (mrdv) {
46
- return {
47
- label: mrdv.label,
48
- value: mrdv.id
49
- };
50
- });
42
+ props.dataOptions = custPropDefinition.category.values.map(mrdv => ({
43
+ label: mrdv.label,
44
+ value: mrdv.id
45
+ }));
51
46
  props.placeholder = ' ';
52
47
  break;
53
48
  case DATE:
@@ -63,5 +58,4 @@ var useValueProps = function useValueProps(custPropDefinition, intlKey, intlNS)
63
58
  }
64
59
  return props;
65
60
  };
66
- var _default = useValueProps;
67
- exports.default = _default;
61
+ var _default = exports.default = useValueProps;
@@ -8,27 +8,25 @@ 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
- passedIntlKey = _ref.intlKey,
18
- passedIntlNS = _ref.intlNS,
19
- _ref$labelOverrides = _ref.labelOverrides,
20
- labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
21
- return contexts.map(function (ctx) {
22
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
23
- ctx: ctx,
24
- customProperties: customProperties,
25
- customPropertiesEndpoint: customPropertiesEndpoint,
26
- id: id,
27
- intlKey: passedIntlKey,
28
- intlNS: passedIntlNS,
29
- labelOverrides: labelOverrides
30
- }, "customPropertiesView-".concat(ctx));
31
- });
11
+ const CustomPropertiesView = _ref => {
12
+ let {
13
+ contexts = [],
14
+ customProperties,
15
+ customPropertiesEndpoint,
16
+ id,
17
+ intlKey: passedIntlKey,
18
+ intlNS: passedIntlNS,
19
+ labelOverrides = {}
20
+ } = _ref;
21
+ return contexts.map(ctx => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
22
+ ctx,
23
+ customProperties,
24
+ customPropertiesEndpoint,
25
+ id,
26
+ intlKey: passedIntlKey,
27
+ intlNS: passedIntlNS,
28
+ labelOverrides
29
+ }, `customPropertiesView-${ctx}`));
32
30
  };
33
31
  CustomPropertiesView.propTypes = {
34
32
  contexts: _propTypes.default.arrayOf(_propTypes.default.string),
@@ -40,5 +38,4 @@ CustomPropertiesView.propTypes = {
40
38
  labelOverrides: _propTypes.default.object,
41
39
  nameOverride: _propTypes.default.string
42
40
  };
43
- var _default = CustomPropertiesView;
44
- exports.default = _default;
41
+ var _default = exports.default = CustomPropertiesView;
@@ -10,16 +10,12 @@ var _jest = require("../../../../test/jest");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  jest.mock('../../hooks');
13
- jest.mock('./CustomPropertiesViewCtx', function () {
14
- return function () {
15
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
16
- children: "CustomPropertiesViewCtx"
17
- });
18
- };
19
- });
20
- describe('CustomPropertiesView', function () {
21
- var renderComponent;
22
- beforeEach(function () {
13
+ jest.mock('./CustomPropertiesViewCtx', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
14
+ children: "CustomPropertiesViewCtx"
15
+ }));
16
+ describe('CustomPropertiesView', () => {
17
+ let renderComponent;
18
+ beforeEach(() => {
23
19
  renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
24
20
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesView.default, {
25
21
  contexts: _testResources.contexts,
@@ -30,11 +26,10 @@ describe('CustomPropertiesView', function () {
30
26
  })
31
27
  }));
32
28
  });
33
- it('renders CustomPropertiesViewCtx component ', function () {
34
- var _renderComponent = renderComponent,
35
- getByText = _renderComponent.getByText;
36
- (0, _react2.waitFor)(function () {
37
- return expect(getByText('CustomPropertiesViewCtx')).toBeInTheDocument();
38
- });
29
+ it('renders CustomPropertiesViewCtx component ', () => {
30
+ const {
31
+ getByText
32
+ } = renderComponent;
33
+ (0, _react2.waitFor)(() => expect(getByText('CustomPropertiesViewCtx')).toBeInTheDocument());
39
34
  });
40
35
  });
@@ -10,27 +10,20 @@ var _hooks = require("../../hooks");
10
10
  var _CustomPropertyCard = _interopRequireDefault(require("./CustomPropertyCard"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
- 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."); }
15
- 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); }
16
- 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; }
17
- 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; } }
18
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
- var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
20
- var _custprops$filter$len, _custprops$filter;
21
- var ctx = _ref.ctx,
22
- _ref$customProperties = _ref.customProperties,
23
- customProperties = _ref$customProperties === void 0 ? [] : _ref$customProperties,
24
- customPropertiesEndpoint = _ref.customPropertiesEndpoint,
25
- id = _ref.id,
26
- passedIntlKey = _ref.intlKey,
27
- passedIntlNS = _ref.intlNS,
28
- _ref$labelOverrides = _ref.labelOverrides,
29
- labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
30
- var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
13
+ const CustomPropertiesViewCtx = _ref => {
14
+ let {
15
+ ctx,
16
+ customProperties = [],
17
+ customPropertiesEndpoint,
18
+ id,
19
+ intlKey: passedIntlKey,
20
+ intlNS: passedIntlNS,
21
+ labelOverrides = {}
22
+ } = _ref;
23
+ const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
31
24
 
32
25
  // Deal with all the possible label override options
33
- var getAccordionLabel = function getAccordionLabel() {
26
+ const getAccordionLabel = () => {
34
27
  // Special case for null context
35
28
  if (ctx === 'isNull') {
36
29
  return kintIntl.formatKintMessage({
@@ -42,74 +35,68 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
42
35
  // Chain formatKintMessages together using provided fallbackMessage to
43
36
  // allow for "If override or translation exists, use it, else use default"
44
37
  return kintIntl.formatKintMessage({
45
- id: "customProperties.ctx.".concat(ctx),
38
+ id: `customProperties.ctx.${ctx}`,
46
39
  overrideValue: labelOverrides[ctx],
47
40
  fallbackMessage: kintIntl.formatKintMessage({
48
41
  id: 'customProperties.defaultTitle',
49
42
  overrideValue: labelOverrides.defaultTitle
50
43
  }, {
51
- ctx: ctx
44
+ ctx
52
45
  })
53
46
  }, {
54
- ctx: ctx
47
+ ctx
55
48
  });
56
49
  };
57
- var _useCustomProperties = (0, _hooks.useCustomProperties)({
58
- ctx: ctx,
59
- endpoint: customPropertiesEndpoint,
60
- returnQueryObject: true,
61
- options: {
62
- sort: [{
63
- path: 'retired'
64
- },
65
- // Place retired custprops at the end
66
- {
67
- path: 'primary',
68
- direction: 'desc'
69
- },
70
- // Primary properties should display before optional
71
- {
72
- path: 'weight'
73
- },
74
- // Within those groups, sort by weight
75
- {
76
- path: 'label'
77
- } // For those with the same weight, sort by label
78
- ]
79
- }
80
- }),
81
- custprops = _useCustomProperties.data,
82
- isLoading = _useCustomProperties.isLoading;
50
+ const {
51
+ data: custprops,
52
+ isLoading
53
+ } = (0, _hooks.useCustomProperties)({
54
+ ctx,
55
+ endpoint: customPropertiesEndpoint,
56
+ returnQueryObject: true,
57
+ options: {
58
+ sort: [{
59
+ path: 'retired'
60
+ },
61
+ // Place retired custprops at the end
62
+ {
63
+ path: 'primary',
64
+ direction: 'desc'
65
+ },
66
+ // Primary properties should display before optional
67
+ {
68
+ path: 'weight'
69
+ },
70
+ // Within those groups, sort by weight
71
+ {
72
+ path: 'label'
73
+ } // For those with the same weight, sort by label
74
+ ]
75
+ }
76
+ });
77
+
83
78
  if (isLoading) {
84
79
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
85
80
  closedByDefault: true,
86
81
  displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
87
82
  displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}),
88
- id: "".concat(id, "-accordion-").concat(ctx),
83
+ id: `${id}-accordion-${ctx}`,
89
84
  label: getAccordionLabel(),
90
85
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {})
91
86
  });
92
87
  }
93
- var countSetProperties = function countSetProperties(primary) {
94
- var _Object$entries$filte, _Object$entries, _Object$entries$filte2;
95
- return (_Object$entries$filte = (_Object$entries = Object.entries(customProperties)) === null || _Object$entries === void 0 ? void 0 : (_Object$entries$filte2 = _Object$entries.filter(function (_ref2) {
96
- var _cp$, _cp$$type, _cp$2, _cp$2$type, _cp$3, _cp$3$type;
97
- var _ref3 = _slicedToArray(_ref2, 2),
98
- _key = _ref3[0],
99
- cp = _ref3[1];
100
- 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)) &&
101
- // Either the ctx string matches, or isNull matches blank
102
- ((_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
103
- ;
104
- })) === null || _Object$entries$filte2 === void 0 ? void 0 : _Object$entries$filte2.length) !== null && _Object$entries$filte !== void 0 ? _Object$entries$filte : 0;
105
- };
88
+ const countSetProperties = primary => Object.entries(customProperties)?.filter(_ref2 => {
89
+ let [_key, cp] = _ref2;
90
+ return (cp[0]?.type?.ctx === ctx || ctx === 'isNull' && !cp[0]?.type?.ctx) &&
91
+ // Either the ctx string matches, or isNull matches blank
92
+ cp[0]?.type?.primary === primary // Only count non-primary set custprops
93
+ ;
94
+ })?.length ?? 0;
106
95
 
107
96
  // We need to display any set properties, along with any non-set primary properties
108
- var primaryCount = (_custprops$filter$len = custprops === null || custprops === void 0 ? void 0 : (_custprops$filter = custprops.filter(function (cp) {
109
- return cp.primary === true;
110
- })) === null || _custprops$filter === void 0 ? void 0 : _custprops$filter.length) !== null && _custprops$filter$len !== void 0 ? _custprops$filter$len : 0;
111
- var optionalCount = countSetProperties(false);
112
- var setPrimaryCount = countSetProperties(true);
97
+ const primaryCount = custprops?.filter(cp => cp.primary === true)?.length ?? 0;
98
+ const optionalCount = countSetProperties(false);
99
+ const setPrimaryCount = countSetProperties(true);
113
100
  return primaryCount + optionalCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
114
101
  closedByDefault: true,
115
102
  displayWhenClosed: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
@@ -118,18 +105,15 @@ var CustomPropertiesViewCtx = function CustomPropertiesViewCtx(_ref) {
118
105
  displayWhenOpen: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Badge, {
119
106
  children: setPrimaryCount + optionalCount
120
107
  }),
121
- id: "".concat(id, "-accordion-").concat(ctx),
108
+ id: `${id}-accordion-${ctx}`,
122
109
  label: getAccordionLabel(),
123
- children: custprops.map(function (cp, index) {
124
- var _customProperties$cp$;
125
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyCard.default, {
126
- ctx: ctx,
127
- customProperty: customProperties === null || customProperties === void 0 ? void 0 : (_customProperties$cp$ = customProperties[cp.name]) === null || _customProperties$cp$ === void 0 ? void 0 : _customProperties$cp$[0],
128
- customPropertyDefinition: cp,
129
- index: index,
130
- labelOverrides: labelOverrides
131
- }, "custom-property-card-".concat(ctx, "[").concat(index, "]"));
132
- })
110
+ children: custprops.map((cp, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyCard.default, {
111
+ ctx: ctx,
112
+ customProperty: customProperties?.[cp.name]?.[0],
113
+ customPropertyDefinition: cp,
114
+ index: index,
115
+ labelOverrides: labelOverrides
116
+ }, `custom-property-card-${ctx}[${index}]`))
133
117
  });
134
118
  };
135
119
  CustomPropertiesViewCtx.propTypes = {
@@ -141,5 +125,4 @@ CustomPropertiesViewCtx.propTypes = {
141
125
  intlNS: _propTypes.default.string,
142
126
  labelOverrides: _propTypes.default.object
143
127
  };
144
- var _default = CustomPropertiesViewCtx;
145
- exports.default = _default;
128
+ var _default = exports.default = CustomPropertiesViewCtx;
@@ -9,32 +9,23 @@ var _CustomPropertiesViewCtx = _interopRequireDefault(require("./CustomPropertie
9
9
  var _jest = require("../../../../test/jest");
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
12
  jest.mock('../../hooks');
19
- jest.mock('./CustomPropertyCard', function () {
20
- return function () {
21
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
22
- children: "CustomPropertyCard"
23
- });
24
- };
25
- });
26
- describe('CustomPropertiesViewCtx', function () {
27
- var renderComponent;
28
- beforeEach(function () {
13
+ jest.mock('./CustomPropertyCard', () => () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
14
+ children: "CustomPropertyCard"
15
+ }));
16
+ describe('CustomPropertiesViewCtx', () => {
17
+ let renderComponent;
18
+ beforeEach(() => {
29
19
  renderComponent = (0, _jest.renderWithKintHarness)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
30
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, _objectSpread({}, _testResources.data))
20
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesViewCtx.default, {
21
+ ..._testResources.data
22
+ })
31
23
  }));
32
24
  });
33
- it('renders CustomPropertyCard component ', function () {
34
- var _renderComponent = renderComponent,
35
- getByText = _renderComponent.getByText;
36
- (0, _react2.waitFor)(function () {
37
- return expect(getByText('CustomPropertyCard')).toBeInTheDocument();
38
- });
25
+ it('renders CustomPropertyCard component ', () => {
26
+ const {
27
+ getByText
28
+ } = renderComponent;
29
+ (0, _react2.waitFor)(() => expect(getByText('CustomPropertyCard')).toBeInTheDocument());
39
30
  });
40
31
  });
@@ -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
  });
@@ -11,29 +10,28 @@ var _components = require("@folio/stripes/components");
11
10
  var CUSTPROP_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
12
11
  var _hooks = require("../../hooks");
13
12
  var _jsxRuntime = require("react/jsx-runtime");
14
- 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); }
15
- 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
+ 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); }
14
+ 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; }
16
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- var CustomPropertyCard = function CustomPropertyCard(_ref) {
18
- var ctx = _ref.ctx,
19
- customProperty = _ref.customProperty,
20
- _ref$customPropertyDe = _ref.customPropertyDefinition,
21
- customPropertyDefinition = _ref$customPropertyDe === void 0 ? {} : _ref$customPropertyDe,
22
- index = _ref.index,
23
- passedIntlKey = _ref.intlKey,
24
- passedIntlNS = _ref.intlNS,
25
- _ref$labelOverrides = _ref.labelOverrides,
26
- labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides;
27
- var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
16
+ const CustomPropertyCard = _ref => {
17
+ let {
18
+ ctx,
19
+ customProperty,
20
+ customPropertyDefinition = {},
21
+ index,
22
+ intlKey: passedIntlKey,
23
+ intlNS: passedIntlNS,
24
+ labelOverrides = {}
25
+ } = _ref;
26
+ const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
28
27
 
29
28
  // We only need to display primary and set properties
30
- var toDisplay = !!(customPropertyDefinition.primary || customProperty);
29
+ const toDisplay = !!(customPropertyDefinition.primary || customProperty);
31
30
  if (!toDisplay) {
32
31
  return null;
33
32
  }
34
- var internalFalse = (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === false || (customProperty === null || customProperty === void 0 ? void 0 : customProperty.internal) === undefined && customPropertyDefinition.defaultInternal === false;
35
- var renderValue = function renderValue() {
36
- var _customProperty$value, _customProperty$value2, _customProperty$value3, _customProperty$value4;
33
+ const internalFalse = customProperty?.internal === false || customProperty?.internal === undefined && customPropertyDefinition.defaultInternal === false;
34
+ const renderValue = () => {
37
35
  if (!customProperty) {
38
36
  return kintIntl.formatKintMessage({
39
37
  id: 'notSet',
@@ -43,14 +41,11 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
43
41
  switch (customPropertyDefinition.type) {
44
42
  case CUSTPROP_TYPES.MULTI_REFDATA_CLASS_NAME:
45
43
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.List, {
46
- items: (_customProperty$value = customProperty.value) === null || _customProperty$value === void 0 ? void 0 : _customProperty$value.map(function (item) {
47
- var _item$label;
48
- return (_item$label = item === null || item === void 0 ? void 0 : item.label) !== null && _item$label !== void 0 ? _item$label : item === null || item === void 0 ? void 0 : item.value;
49
- }),
44
+ items: customProperty.value?.map(item => item?.label ?? item?.value),
50
45
  listStyle: "bullets"
51
46
  });
52
47
  case CUSTPROP_TYPES.REFDATA_CLASS_NAME:
53
- return (_customProperty$value2 = (_customProperty$value3 = customProperty.value) === null || _customProperty$value3 === void 0 ? void 0 : _customProperty$value3.label) !== null && _customProperty$value2 !== void 0 ? _customProperty$value2 : (_customProperty$value4 = customProperty.value) === null || _customProperty$value4 === void 0 ? void 0 : _customProperty$value4.value;
48
+ return customProperty.value?.label ?? customProperty.value?.value;
54
49
  case CUSTPROP_TYPES.DECIMAL_CLASS_NAME:
55
50
  case CUSTPROP_TYPES.INTEGER_CLASS_NAME:
56
51
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedNumber, {
@@ -78,7 +73,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
78
73
  content: customPropertyDefinition.description
79
74
  }) : null]
80
75
  }),
81
- id: "customproperty-card-".concat(index),
76
+ id: `customproperty-card-${index}`,
82
77
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
83
78
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
84
79
  xs: 6,
@@ -89,7 +84,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
89
84
  }),
90
85
  children: renderValue()
91
86
  })
92
- }), customProperty !== null && customProperty !== void 0 && customProperty.note ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
87
+ }), customProperty?.note ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
93
88
  xs: 6,
94
89
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
95
90
  label: kintIntl.formatKintMessage({
@@ -113,8 +108,8 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
113
108
  overrideValue: labelOverrides.visibility
114
109
  }),
115
110
  children: kintIntl.formatKintMessage({
116
- id: 'customProperties.internalFalse',
117
- overrideValue: labelOverrides.internalFalse
111
+ id: internalFalse ? 'customProperties.internalFalse' : 'customProperties.internalTrue',
112
+ overrideValue: internalFalse ? labelOverrides.internalFalse : labelOverrides.internalTrue
118
113
  })
119
114
  })
120
115
  }), internalFalse && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
@@ -124,7 +119,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
124
119
  id: 'customProperties.publicNote',
125
120
  overrideValue: labelOverrides.publicNote
126
121
  }),
127
- children: customProperty !== null && customProperty !== void 0 && customProperty.publicNote ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
122
+ children: customProperty?.publicNote ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
128
123
  style: {
129
124
  whiteSpace: 'pre-wrap'
130
125
  },
@@ -133,7 +128,7 @@ var CustomPropertyCard = function CustomPropertyCard(_ref) {
133
128
  })
134
129
  })]
135
130
  })]
136
- }, "customPropertyCard-".concat(ctx, "[").concat(index, "]"));
131
+ }, `customPropertyCard-${ctx}[${index}]`);
137
132
  };
138
133
  CustomPropertyCard.propTypes = {
139
134
  ctx: _propTypes.default.string,
@@ -144,5 +139,4 @@ CustomPropertyCard.propTypes = {
144
139
  intlNS: _propTypes.default.string,
145
140
  labelOverrides: _propTypes.default.object
146
141
  };
147
- var _default = CustomPropertyCard;
148
- exports.default = _default;
142
+ var _default = exports.default = CustomPropertyCard;
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "CustomPropertiesView", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _CustomPropertiesView.default;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "CustomPropertiesViewCtx", {
13
13
  enumerable: true,
14
- get: function get() {
14
+ get: function () {
15
15
  return _CustomPropertiesViewCtx.default;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "CustomPropertyCard", {
19
19
  enumerable: true,
20
- get: function get() {
20
+ get: function () {
21
21
  return _CustomPropertyCard.default;
22
22
  }
23
23
  });
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.labelOverrides = exports.data = exports.customProperties = exports.contexts = void 0;
7
- var contexts = ['isNull', 'OpenAccess'];
8
- exports.contexts = contexts;
9
- var customProperties = {
7
+ const contexts = exports.contexts = ['isNull', 'OpenAccess'];
8
+ const customProperties = exports.customProperties = {
10
9
  'AuthorIdentification': [{
11
10
  'id': 2,
12
11
  'publicNote': 'public note',
@@ -65,15 +64,13 @@ var customProperties = {
65
64
  }
66
65
  }]
67
66
  };
68
- exports.customProperties = customProperties;
69
- var labelOverrides = {
67
+ const labelOverrides = exports.labelOverrides = {
70
68
  'defaultTitle': 'ƒ defaultTitle() {}',
71
69
  'noContext': '<Memo />',
72
70
  'OpenAccess': '<Memo />',
73
71
  'retiredName': 'ƒ retiredName() {}'
74
72
  };
75
- exports.labelOverrides = labelOverrides;
76
- var data = {
73
+ const data = exports.data = {
77
74
  'ctx': 'isNull',
78
75
  'customProperties': {
79
76
  'AuthorIdentification': [{
@@ -140,5 +137,4 @@ var data = {
140
137
  'OpenAccess': '<Memo />',
141
138
  'retiredName': 'ƒ retiredName() {}'
142
139
  }
143
- };
144
- exports.data = data;
140
+ };