@k-int/stripes-kint-components 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/es/__mocks__/@folio/stripes/components.js +10 -21
  3. package/es/__mocks__/@folio/stripes/core.js +4 -7
  4. package/es/__mocks__/@folio/stripes/smart-components.js +4 -7
  5. package/es/__mocks__/react-query.js +4 -7
  6. package/es/__mocks__/react-router-dom.js +6 -7
  7. package/es/artifacts/coverage-jest/lcov-report/prettify.js +2 -2
  8. package/es/artifacts/coverage-jest/lcov-report/sorter.js +6 -6
  9. package/es/index.js +56 -49
  10. package/es/lib/ActionList/ActionList.js +39 -53
  11. package/es/lib/ActionList/ActionListFieldArray.js +144 -169
  12. package/es/lib/ActionList/index.js +1 -1
  13. package/es/lib/ComboButton/ComboButton.js +73 -91
  14. package/es/lib/ComboButton/index.js +1 -1
  15. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +58 -79
  16. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +15 -19
  17. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +112 -162
  18. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +30 -67
  19. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +37 -50
  20. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +83 -121
  21. package/es/lib/CustomProperties/Config/CustomPropertyView.js +10 -10
  22. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +48 -135
  23. package/es/lib/CustomProperties/Config/index.js +4 -4
  24. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +20 -23
  25. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +11 -16
  26. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +30 -29
  27. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +11 -16
  28. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +87 -105
  29. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +26 -63
  30. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +124 -117
  31. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +101 -179
  32. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +44 -46
  33. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +23 -27
  34. package/es/lib/CustomProperties/Edit/index.js +5 -5
  35. package/es/lib/CustomProperties/Edit/testResources.js +14 -38
  36. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +61 -83
  37. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +23 -57
  38. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +40 -56
  39. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +17 -16
  40. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +28 -25
  41. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +19 -47
  42. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +19 -22
  43. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +23 -52
  44. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +38 -43
  45. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +94 -226
  46. package/es/lib/CustomProperties/Filter/index.js +6 -6
  47. package/es/lib/CustomProperties/Filter/testResources.js +13 -36
  48. package/es/lib/CustomProperties/Filter/useOperators.js +18 -18
  49. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +18 -32
  50. package/es/lib/CustomProperties/Filter/useValueProps.js +23 -29
  51. package/es/lib/CustomProperties/View/CustomPropertiesView.js +20 -23
  52. package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +11 -16
  53. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +50 -59
  54. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +14 -23
  55. package/es/lib/CustomProperties/View/CustomPropertyCard.js +18 -20
  56. package/es/lib/CustomProperties/View/index.js +3 -3
  57. package/es/lib/CustomProperties/View/testResources.js +5 -9
  58. package/es/lib/CustomProperties/index.js +18 -18
  59. package/es/lib/CycleButton/CycleButton.js +18 -34
  60. package/es/lib/CycleButton/index.js +1 -1
  61. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +109 -152
  62. package/es/lib/EditableRefdataCategoryList/index.js +1 -1
  63. package/es/lib/EditableRefdataList/EditableRefdataList.js +128 -172
  64. package/es/lib/EditableRefdataList/index.js +1 -1
  65. package/es/lib/EditableSettingsList/EditableSettingsList.js +17 -15
  66. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +19 -27
  67. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +61 -90
  68. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +22 -36
  69. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +99 -83
  70. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +18 -21
  71. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +187 -275
  72. package/es/lib/EditableSettingsList/SettingField/SettingField.js +75 -111
  73. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +55 -168
  74. package/es/lib/EditableSettingsList/SettingField/index.js +3 -3
  75. package/es/lib/EditableSettingsList/index.js +3 -3
  76. package/es/lib/FormModal/FormModal.js +44 -48
  77. package/es/lib/FormModal/index.js +1 -1
  78. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +25 -29
  79. package/es/lib/FormattedKintMessage/index.js +1 -1
  80. package/es/lib/IconSelect/IconSelect.js +50 -70
  81. package/es/lib/IconSelect/index.js +1 -1
  82. package/es/lib/NoResultsMessage/NoResultsMessage.js +19 -19
  83. package/es/lib/NoResultsMessage/index.js +1 -1
  84. package/es/lib/QueryTypedown/QueryTypedown.js +18 -40
  85. package/es/lib/QueryTypedown/index.js +1 -1
  86. package/es/lib/RefdataButtons/RefdataButtons.js +27 -31
  87. package/es/lib/RefdataButtons/index.js +1 -1
  88. package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +84 -90
  89. package/es/lib/ResponsiveButtonGroup/index.js +1 -1
  90. package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +28 -42
  91. package/es/lib/RichSelect/RichSelect.js +71 -88
  92. package/es/lib/RichSelect/index.js +2 -2
  93. package/es/lib/RichSelect/useSelectedOption.js +4 -14
  94. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +116 -139
  95. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +40 -47
  96. package/es/lib/SASQLookupComponent/TableBody/index.js +1 -1
  97. package/es/lib/SASQLookupComponent/index.js +2 -2
  98. package/es/lib/SASQRoute/SASQRoute.js +32 -39
  99. package/es/lib/SASQRoute/index.js +1 -1
  100. package/es/lib/SASQViewComponent/SASQViewComponent.js +39 -47
  101. package/es/lib/SASQViewComponent/index.js +1 -1
  102. package/es/lib/SearchField/SearchField.js +12 -18
  103. package/es/lib/SearchField/index.js +1 -1
  104. package/es/lib/SettingPage/SettingPage.js +22 -22
  105. package/es/lib/SettingPage/SettingPagePane.js +9 -8
  106. package/es/lib/SettingPage/index.js +2 -2
  107. package/es/lib/SettingsFormContainer/SettingsFormContainer.js +51 -55
  108. package/es/lib/SettingsFormContainer/index.js +1 -1
  109. package/es/lib/Typedown/Typedown.js +62 -81
  110. package/es/lib/Typedown/index.js +1 -1
  111. package/es/lib/constants/comparators.js +7 -0
  112. package/es/lib/constants/customProperties.js +11 -22
  113. package/es/lib/constants/endpoints.js +1 -2
  114. package/es/lib/constants/eventCodes.js +3 -6
  115. package/es/lib/contexts/SettingsContext.js +2 -3
  116. package/es/lib/contexts/index.js +1 -1
  117. package/es/lib/hooks/__mocks__/index.js +9 -29
  118. package/es/lib/hooks/index.js +19 -19
  119. package/es/lib/hooks/typedownHooks/index.js +3 -3
  120. package/es/lib/hooks/typedownHooks/useTypedown.js +49 -50
  121. package/es/lib/hooks/typedownHooks/useTypedownData.js +12 -23
  122. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +13 -22
  123. package/es/lib/hooks/useActiveElement.js +9 -19
  124. package/es/lib/hooks/useCustomProperties.js +23 -32
  125. package/es/lib/hooks/useHelperApp.js +31 -51
  126. package/es/lib/hooks/useIntlKey.js +4 -7
  127. package/es/lib/hooks/useIntlKeyStore.js +44 -51
  128. package/es/lib/hooks/useInvalidateRefdata.js +4 -7
  129. package/es/lib/hooks/useKintIntl.js +29 -33
  130. package/es/lib/hooks/useKiwtFieldArray.js +35 -47
  131. package/es/lib/hooks/useKiwtSASQuery.js +38 -51
  132. package/es/lib/hooks/useLocalStorageState.js +7 -20
  133. package/es/lib/hooks/useModConfigEntries.js +27 -27
  134. package/es/lib/hooks/useMutateCustomProperties.js +20 -64
  135. package/es/lib/hooks/useMutateModConfigEntry.js +22 -61
  136. package/es/lib/hooks/useMutateRefdataCategory.js +20 -62
  137. package/es/lib/hooks/useMutateRefdataValue.js +29 -67
  138. package/es/lib/hooks/useQIndex.js +13 -28
  139. package/es/lib/hooks/useRefdata.js +18 -21
  140. package/es/lib/hooks/useSASQQueryMeta.js +14 -22
  141. package/es/lib/hooks/useTemplates.js +14 -14
  142. package/es/lib/settingsHooks/index.js +3 -3
  143. package/es/lib/settingsHooks/useAppSettings.js +19 -27
  144. package/es/lib/settingsHooks/useSettingSection.js +17 -19
  145. package/es/lib/settingsHooks/useSettings.js +59 -74
  146. package/es/lib/utils/buildUrl.js +6 -8
  147. package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +36 -0
  148. package/es/lib/utils/filterParsers/index.js +48 -0
  149. package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +47 -0
  150. package/es/lib/utils/{parseKiwtQueryGroups.js → filterParsers/parseKiwtQueryGroups.js} +12 -13
  151. package/es/lib/utils/{parseKiwtQueryGroups.test.js → filterParsers/parseKiwtQueryGroups.test.js} +15 -15
  152. package/es/lib/utils/filterParsers/parseKiwtQueryString.js +34 -0
  153. package/es/lib/utils/generateKiwtQuery.js +4 -5
  154. package/es/lib/utils/generateKiwtQueryParams.js +93 -99
  155. package/es/lib/utils/groupCustomPropertiesByCtx.js +9 -20
  156. package/es/lib/utils/highlightString.js +17 -37
  157. package/es/lib/utils/index.js +49 -19
  158. package/es/lib/utils/matchString.js +5 -10
  159. package/es/lib/utils/modConfigEntriesQueryKey.js +9 -9
  160. package/es/lib/utils/parseErrorResponse.js +23 -65
  161. package/es/lib/utils/parseModConfigEntry.js +3 -4
  162. package/es/lib/utils/refdataOptions.js +2 -3
  163. package/es/lib/utils/refdataQueryKey.js +3 -4
  164. package/es/lib/utils/selectorSafe.js +5 -6
  165. package/es/lib/utils/sortByLabel.js +4 -5
  166. package/es/lib/utils/toCamelCase.js +8 -14
  167. package/es/lib/utils/typedownQueryKey.js +3 -4
  168. package/es/lib/validators/index.js +1 -1
  169. package/es/lib/validators/validators.js +22 -29
  170. package/junit.xml +161 -161
  171. package/package.json +5 -5
  172. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +1 -1
  173. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +1 -1
  174. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionTrigger.js.html +418 -0
  175. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +1 -1
  176. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
  177. package/src/artifacts/coverage-jest/lcov-report/ComboButton/ComboButton.js.html +1 -1
  178. package/src/artifacts/coverage-jest/lcov-report/ComboButton/index.html +1 -1
  179. package/src/artifacts/coverage-jest/lcov-report/ComboButton/index.js.html +1 -1
  180. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
  181. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
  182. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
  183. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +1 -1
  184. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +1 -1
  185. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
  186. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
  187. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
  188. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
  189. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +10 -10
  190. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
  191. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +15 -15
  192. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
  193. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +1 -1
  194. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
  195. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
  196. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
  197. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
  198. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
  199. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +1 -1
  200. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
  201. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +1 -1
  202. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +1 -1
  203. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
  204. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +1 -1
  205. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +1 -1
  206. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
  207. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +1 -1
  208. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +1 -1
  209. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
  210. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
  211. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
  212. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
  213. package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +1 -1
  214. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +1 -1
  215. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +1 -1
  216. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
  217. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +1 -1
  218. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +1 -1
  219. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +1 -1
  220. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +1 -1
  221. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
  222. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +1 -1
  223. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +1 -1
  224. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +1 -1
  225. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +1 -1
  226. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +1 -1
  227. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +1 -1
  228. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
  229. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +1 -1
  230. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
  231. package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +1 -1
  232. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +1 -1
  233. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
  234. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
  235. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +1 -1
  236. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +1 -1
  237. package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +1 -1
  238. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +1 -1
  239. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +1 -1
  240. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
  241. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
  242. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
  243. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
  244. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
  245. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
  246. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +1 -1
  247. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
  248. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
  249. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +1 -1
  250. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +1 -1
  251. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +1 -1
  252. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
  253. package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +1 -1
  254. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +1 -1
  255. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +1 -1
  256. package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +1 -1
  257. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +1 -1
  258. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
  259. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +1 -1
  260. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
  261. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +1 -1
  262. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
  263. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
  264. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
  265. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
  266. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
  267. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
  268. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
  269. package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
  270. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
  271. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
  272. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +1 -1
  273. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
  274. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +1 -1
  275. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
  276. package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/EditSettingValue.js.html +514 -0
  277. package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/RenderSettingValue.js.html +358 -0
  278. package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/SettingsActionList.js.html +736 -0
  279. package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/index.html +161 -0
  280. package/src/artifacts/coverage-jest/lcov-report/SettingsActionList/index.js.html +88 -0
  281. package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
  282. package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/index.html +1 -1
  283. package/src/artifacts/coverage-jest/lcov-report/SettingsFormContainer/index.js.html +1 -1
  284. package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
  285. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
  286. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
  287. package/src/artifacts/coverage-jest/lcov-report/constants/comparators.js.html +121 -0
  288. package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
  289. package/src/artifacts/coverage-jest/lcov-report/constants/endpoints.js.html +1 -1
  290. package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
  291. package/src/artifacts/coverage-jest/lcov-report/constants/index.html +16 -1
  292. package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +1 -1
  293. package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
  294. package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
  295. package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +1 -1
  296. package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +1 -1
  297. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +161 -0
  298. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +94 -0
  299. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +292 -0
  300. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +214 -0
  301. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +463 -0
  302. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
  303. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
  304. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
  305. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
  306. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
  307. package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
  308. package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
  309. package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +1 -1
  310. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +1 -1
  311. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +1 -1
  312. package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +1 -1
  313. package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +1 -1
  314. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
  315. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +2 -2
  316. package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
  317. package/src/artifacts/coverage-jest/lcov-report/hooks/useModConfigEntries.js.html +1 -1
  318. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
  319. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateModConfigEntry.js.html +1 -1
  320. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +1 -1
  321. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +1 -1
  322. package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
  323. package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +1 -1
  324. package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +1 -1
  325. package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
  326. package/src/artifacts/coverage-jest/lcov-report/index.html +41 -26
  327. package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.html +1 -1
  328. package/src/artifacts/coverage-jest/lcov-report/settingsHooks/index.js.html +1 -1
  329. package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useAppSettings.js.html +1 -1
  330. package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettingSection.js.html +1 -1
  331. package/src/artifacts/coverage-jest/lcov-report/settingsHooks/useSettings.js.html +1 -1
  332. package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +6 -18
  333. package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/deparseKiwtQueryFilters.js.html +181 -0
  334. package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/index.html +176 -0
  335. package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/index.js.html +124 -0
  336. package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/parseKiwtQueryFilters.js.html +211 -0
  337. package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/parseKiwtQueryGroups.js.html +367 -0
  338. package/src/artifacts/coverage-jest/lcov-report/utils/filterParsers/parseKiwtQueryString.js.html +184 -0
  339. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +1 -1
  340. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +13 -7
  341. package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +1 -1
  342. package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +1 -1
  343. package/src/artifacts/coverage-jest/lcov-report/utils/index.html +13 -28
  344. package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +24 -3
  345. package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +1 -1
  346. package/src/artifacts/coverage-jest/lcov-report/utils/modConfigEntriesQueryKey.js.html +1 -1
  347. package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +1 -1
  348. package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +1 -1
  349. package/src/artifacts/coverage-jest/lcov-report/utils/parseModConfigEntry.js.html +1 -1
  350. package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
  351. package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +1 -1
  352. package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +1 -1
  353. package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +1 -1
  354. package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +1 -1
  355. package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +1 -1
  356. package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +370 -0
  357. package/src/artifacts/coverage-jest/lcov-report/validators/index.html +1 -1
  358. package/src/artifacts/coverage-jest/lcov-report/validators/index.js.html +1 -1
  359. package/src/artifacts/coverage-jest/lcov-report/validators/validators.js.html +1 -1
  360. package/src/artifacts/coverage-jest/lcov.info +352 -228
  361. package/src/index.js +1 -0
  362. package/src/lib/CustomProperties/Edit/CustomPropertyField.test.js +9 -5
  363. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +1 -4
  364. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +26 -10
  365. package/src/lib/constants/comparators.js +12 -0
  366. package/src/lib/hooks/useKiwtSASQuery.js +1 -1
  367. package/src/lib/utils/buildUrl.js +1 -5
  368. package/src/lib/utils/filterParsers/deparseKiwtQueryFilters.js +32 -0
  369. package/src/lib/utils/filterParsers/index.js +13 -0
  370. package/src/lib/utils/filterParsers/parseKiwtQueryFilters.js +42 -0
  371. package/src/lib/utils/{parseKiwtQueryGroups.js → filterParsers/parseKiwtQueryGroups.js} +3 -1
  372. package/src/lib/utils/filterParsers/parseKiwtQueryString.js +33 -0
  373. package/src/lib/utils/generateKiwtQueryParams.js +6 -4
  374. package/src/lib/utils/index.js +8 -1
  375. /package/src/lib/utils/{parseKiwtQueryGroups.test.js → filterParsers/parseKiwtQueryGroups.test.js} +0 -0
@@ -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,43 +10,34 @@ var _components = require("@folio/stripes/components");
11
10
  var CUSTOM_PROPERTY_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(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
+ 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; }
16
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
- 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; }
18
- 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; }
19
- 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; }
20
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
21
- 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); }
22
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
23
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
- 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); }
25
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
26
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
27
- 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; }
28
- var CustomPropertyField = function CustomPropertyField(_ref) {
29
- var availableCustomProperties = _ref.availableCustomProperties,
30
- customProperty = _ref.customProperty,
31
- customPropertyType = _ref.customPropertyType,
32
- customProperties = _ref.customProperties,
33
- index = _ref.index,
34
- passedIntlKey = _ref.intlKey,
35
- passedIntlNS = _ref.intlNS,
36
- _ref$labelOverrides = _ref.labelOverrides,
37
- labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
38
- name = _ref.name,
39
- _onChange = _ref.onChange,
40
- value = _ref.value,
41
- setCustomProperties = _ref.setCustomProperties;
42
- var kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
16
+ const CustomPropertyField = _ref => {
17
+ let {
18
+ availableCustomProperties,
19
+ customProperty,
20
+ customPropertyType,
21
+ customProperties,
22
+ index,
23
+ intlKey: passedIntlKey,
24
+ intlNS: passedIntlNS,
25
+ labelOverrides = {},
26
+ name,
27
+ onChange,
28
+ value,
29
+ setCustomProperties
30
+ } = _ref;
31
+ const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
43
32
 
44
33
  // Set up the validator for the customProperty
45
- var customPropertyValidator = function customPropertyValidator(fieldValue, allValues) {
34
+ const customPropertyValidator = (fieldValue, allValues) => {
46
35
  var _allValues$customProp, _allValues$customProp2;
47
- var _ref2 = (_allValues$customProp = allValues === null || allValues === void 0 || (_allValues$customProp2 = allValues.customProperties) === null || _allValues$customProp2 === void 0 || (_allValues$customProp2 = _allValues$customProp2[customProperty === null || customProperty === void 0 ? void 0 : customProperty.value]) === null || _allValues$customProp2 === void 0 ? void 0 : _allValues$customProp2[0]) !== null && _allValues$customProp !== void 0 ? _allValues$customProp : {},
48
- note = _ref2.note,
49
- publicNote = _ref2.publicNote,
50
- currentValue = _ref2.value;
36
+ const {
37
+ note,
38
+ publicNote,
39
+ value: currentValue
40
+ } = (_allValues$customProp = allValues === null || allValues === void 0 || (_allValues$customProp2 = allValues.customProperties) === null || _allValues$customProp2 === void 0 || (_allValues$customProp2 = _allValues$customProp2[customProperty === null || customProperty === void 0 ? void 0 : customProperty.value]) === null || _allValues$customProp2 === void 0 ? void 0 : _allValues$customProp2[0]) !== null && _allValues$customProp !== void 0 ? _allValues$customProp : {};
51
41
  if (note && !currentValue || publicNote && !currentValue) {
52
42
  if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME || customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
53
43
  return kintIntl.formatKintMessage({
@@ -62,21 +52,21 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
62
52
  }
63
53
  }
64
54
  if (customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME) {
65
- var regexp = /^-?[\d]*(\.[\d]{0,2})?$/;
55
+ const regexp = /^-?[\d]*(\.[\d]{0,2})?$/;
66
56
  return fieldValue && !regexp.test(fieldValue) ? kintIntl.formatKintMessage({
67
57
  id: 'errors.maxTwoDecimals',
68
58
  overrideValue: labelOverrides.maxTwoDecimalsError
69
59
  }) : undefined;
70
60
  }
71
61
  if (customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
72
- var min = Number.MIN_SAFE_INTEGER;
73
- var max = Number.MAX_SAFE_INTEGER;
62
+ const min = Number.MIN_SAFE_INTEGER;
63
+ const max = Number.MAX_SAFE_INTEGER;
74
64
  return fieldValue && (fieldValue > max || fieldValue < min) ? kintIntl.formatKintMessage({
75
65
  id: 'errors.valueNotInRange',
76
66
  overrideValue: labelOverrides.valueNotInRangeError
77
67
  }, {
78
- min: min,
79
- max: max
68
+ min,
69
+ max
80
70
  }) : undefined;
81
71
  }
82
72
  if (!customProperty.primary && !currentValue) {
@@ -86,18 +76,16 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
86
76
  }
87
77
  return undefined;
88
78
  };
89
- var getCustomProperty = function getCustomProperty(customPropertyValue) {
90
- return availableCustomProperties.find(function (cp) {
91
- return cp.value === customPropertyValue;
92
- });
79
+ const getCustomProperty = customPropertyValue => {
80
+ return availableCustomProperties.find(cp => cp.value === customPropertyValue);
93
81
  };
94
- var renderCustomPropertyName = function renderCustomPropertyName() {
82
+ const renderCustomPropertyName = () => {
95
83
  var _customPropertyValue$;
96
- var unsetCustomProperties = availableCustomProperties.filter(function (t) {
84
+ const unsetCustomProperties = availableCustomProperties.filter(t => {
97
85
  var _custPropValue$;
98
86
  // Only optional properties can be set
99
87
  if (t.primary) return false;
100
- var custPropValue = value[t.value];
88
+ const custPropValue = value[t.value];
101
89
 
102
90
  // The customProperty is unset and has no value.
103
91
  if (custPropValue === undefined) return true;
@@ -106,23 +94,22 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
106
94
  if ((_custPropValue$ = custPropValue[0]) !== null && _custPropValue$ !== void 0 && _custPropValue$._delete) return true;
107
95
  return false;
108
96
  });
109
- var customPropertyValue = value[customProperty.value];
110
- var id = customPropertyValue === null || customPropertyValue === void 0 || (_customPropertyValue$ = customPropertyValue[0]) === null || _customPropertyValue$ === void 0 ? void 0 : _customPropertyValue$.id;
97
+ const customPropertyValue = value[customProperty.value];
98
+ const id = customPropertyValue === null || customPropertyValue === void 0 || (_customPropertyValue$ = customPropertyValue[0]) === null || _customPropertyValue$ === void 0 ? void 0 : _customPropertyValue$.id;
111
99
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
112
100
  autoFocus: !id,
113
- dataOptions: [customProperty].concat(_toConsumableArray(unsetCustomProperties)) // The selected customProperty, and the available unset customProperties
101
+ dataOptions: [customProperty, ...unsetCustomProperties] // The selected customProperty, and the available unset customProperties
114
102
  ,
115
103
  id: "edit-customproperty-".concat(index, "-name"),
116
104
  label: kintIntl.formatKintMessage({
117
105
  id: 'customProperties.name',
118
106
  overrideValue: labelOverrides.name
119
107
  }),
120
- onChange: function onChange(e) {
121
- var _objectSpread2;
122
- var newValue = e.target.value;
108
+ onChange: e => {
109
+ const newValue = e.target.value;
123
110
 
124
111
  // Update `state.customProperties` which controls what customProperties are being edited.
125
- var newCustomProperties = _toConsumableArray(customProperties);
112
+ const newCustomProperties = [...customProperties];
126
113
  newCustomProperties[index] = getCustomProperty(newValue);
127
114
  setCustomProperties(newCustomProperties);
128
115
 
@@ -130,83 +117,93 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
130
117
  // in essence we're deleting a customProperty and creating a new customProperty.
131
118
  // We do this by 1) marking the current customProperty for deletion and 2) initing
132
119
  // the new customProperty to an empty object.
133
- var currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
134
- _onChange(_objectSpread(_objectSpread({}, value), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, customProperty.value, [{
135
- id: currentValue.id,
136
- _delete: true
137
- }]), _defineProperty(_objectSpread2, newValue, [{}]), _objectSpread2)));
120
+ const currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
121
+ onChange({
122
+ ...value,
123
+ [customProperty.value]: [{
124
+ id: currentValue.id,
125
+ _delete: true
126
+ }],
127
+ [newValue]: [{}]
128
+ });
138
129
  },
139
130
  required: true,
140
131
  value: customProperty.value
141
132
  });
142
133
  };
143
- var renderCustomPropertyValue = function renderCustomPropertyValue() {
134
+ const renderCustomPropertyValue = () => {
144
135
  var _customProperty$optio;
145
- var currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
146
- var min = Number.MIN_SAFE_INTEGER;
147
- var max = Number.MAX_SAFE_INTEGER;
136
+ const currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
137
+ const min = Number.MIN_SAFE_INTEGER;
138
+ const max = Number.MAX_SAFE_INTEGER;
148
139
 
149
140
  // Default change handler
150
- var handleChange = function handleChange(e) {
151
- _onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, currentValue), {}, {
152
- _delete: e.target.value === '',
153
- // Delete customProperty if removing the value.
154
- value: e.target.value // send down the number for integers and decimal types
155
- })])));
141
+ let handleChange = e => {
142
+ onChange({
143
+ ...value,
144
+ [customProperty.value]: [{
145
+ ...currentValue,
146
+ _delete: e.target.value === '',
147
+ // Delete customProperty if removing the value.
148
+ value: e.target.value // send down the number for integers and decimal types
149
+ }]
150
+ });
156
151
  };
157
152
  // Figure out which component we're rendering and specify its unique props.
158
- var fieldProps;
153
+ let fieldProps;
159
154
  switch (customProperty.type) {
160
155
  case CUSTOM_PROPERTY_TYPES.REFDATA_CLASS_NAME:
161
156
  fieldProps = {
162
157
  component: _components.Select,
163
158
  dataOptions: customProperty.options,
164
- format: function format(v) {
165
- return v === null || v === void 0 ? void 0 : v.value;
166
- }
159
+ format: v => v === null || v === void 0 ? void 0 : v.value
167
160
  };
168
161
  break;
169
162
  case CUSTOM_PROPERTY_TYPES.MULTI_REFDATA_CLASS_NAME:
170
163
  fieldProps = {
171
164
  component: _components.MultiSelection,
172
165
  // The "not set" value is not relevant for a multi select
173
- dataOptions: (_customProperty$optio = customProperty.options) === null || _customProperty$optio === void 0 ? void 0 : _customProperty$optio.filter(function (opt) {
174
- return !!(opt !== null && opt !== void 0 && opt.value);
175
- }),
166
+ dataOptions: (_customProperty$optio = customProperty.options) === null || _customProperty$optio === void 0 ? void 0 : _customProperty$optio.filter(opt => !!(opt !== null && opt !== void 0 && opt.value)),
176
167
  renderToOverlay: true
177
168
  };
178
169
  // MultiSelection passes the changed array as a value not an event
179
- handleChange = function handleChange(refdataArray) {
180
- _onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, currentValue), {}, {
181
- _delete: (refdataArray === null || refdataArray === void 0 ? void 0 : refdataArray.length) === 0 ? true : undefined,
182
- // Delete customProperty if removing all values.
183
- value: refdataArray
184
- })])));
170
+ handleChange = refdataArray => {
171
+ onChange({
172
+ ...value,
173
+ [customProperty.value]: [{
174
+ ...currentValue,
175
+ _delete: (refdataArray === null || refdataArray === void 0 ? void 0 : refdataArray.length) === 0 ? true : undefined,
176
+ // Delete customProperty if removing all values.
177
+ value: refdataArray
178
+ }]
179
+ });
185
180
  };
186
181
  break;
187
182
  case CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME:
188
183
  case CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME:
189
184
  fieldProps = {
190
185
  component: _components.TextField,
191
- max: max,
192
- min: min,
186
+ max,
187
+ min,
193
188
  step: 'any',
194
189
  type: 'number'
195
190
  };
196
- handleChange = function handleChange(e) {
197
- _onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, currentValue), {}, {
198
- _delete: e.target.value === '' ? true : undefined,
199
- // Delete customProperty if removing the value.
200
- value: parseFloat(e.target.value)
201
- })])));
191
+ handleChange = e => {
192
+ onChange({
193
+ ...value,
194
+ [customProperty.value]: [{
195
+ ...currentValue,
196
+ _delete: e.target.value === '' ? true : undefined,
197
+ // Delete customProperty if removing the value.
198
+ value: parseFloat(e.target.value)
199
+ }]
200
+ });
202
201
  };
203
202
  break;
204
203
  case CUSTOM_PROPERTY_TYPES.TEXT_CLASS_NAME:
205
204
  fieldProps = {
206
205
  component: _components.TextArea,
207
- parse: function parse(v) {
208
- return v;
209
- } // Lets us send an empty string instead of `undefined`
206
+ parse: v => v // Lets us send an empty string instead of `undefined`
210
207
  };
211
208
 
212
209
  break;
@@ -224,7 +221,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
224
221
  };
225
222
  break;
226
223
  }
227
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, _objectSpread({
224
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
228
225
  "data-test-customproperty-value": true,
229
226
  id: "edit-customproperty-".concat(index, "-value"),
230
227
  label: kintIntl.formatKintMessage({
@@ -234,18 +231,21 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
234
231
  name: "".concat(name, ".").concat(customProperty.value, "[0].value"),
235
232
  onChange: handleChange,
236
233
  required: !customProperty.primary,
237
- validate: function validate(fieldValue, allValues) {
238
- return customPropertyValidator(fieldValue, allValues);
239
- }
240
- }, fieldProps));
234
+ validate: (fieldValue, allValues) => customPropertyValidator(fieldValue, allValues),
235
+ ...fieldProps
236
+ });
241
237
  };
242
- var renderCustomPropertyVisibility = function renderCustomPropertyVisibility() {
238
+ const renderCustomPropertyVisibility = () => {
243
239
  var _value$customProperty, _value$customProperty2, _customPropertyObject;
244
- var customPropertyObject = (_value$customProperty = (_value$customProperty2 = value[customProperty.value]) === null || _value$customProperty2 === void 0 ? void 0 : _value$customProperty2[0]) !== null && _value$customProperty !== void 0 ? _value$customProperty : {};
245
- var handleChange = function handleChange(e) {
246
- _onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
247
- internal: e.target.value
248
- })])));
240
+ const customPropertyObject = (_value$customProperty = (_value$customProperty2 = value[customProperty.value]) === null || _value$customProperty2 === void 0 ? void 0 : _value$customProperty2[0]) !== null && _value$customProperty !== void 0 ? _value$customProperty : {};
241
+ const handleChange = e => {
242
+ onChange({
243
+ ...value,
244
+ [customProperty.value]: [{
245
+ ...customPropertyObject,
246
+ internal: e.target.value
247
+ }]
248
+ });
249
249
  };
250
250
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
251
251
  "data-test-customproperty-visibility": true,
@@ -271,13 +271,17 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
271
271
  value: (_customPropertyObject = customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.internal) !== null && _customPropertyObject !== void 0 ? _customPropertyObject : customProperty.defaultInternal
272
272
  });
273
273
  };
274
- var renderCustomPropertyNoteInternal = function renderCustomPropertyNoteInternal() {
274
+ const renderCustomPropertyNoteInternal = () => {
275
275
  var _value$customProperty3, _value$customProperty4;
276
- var customPropertyObject = (_value$customProperty3 = (_value$customProperty4 = value[customProperty.value]) === null || _value$customProperty4 === void 0 ? void 0 : _value$customProperty4[0]) !== null && _value$customProperty3 !== void 0 ? _value$customProperty3 : {};
277
- var handleChange = function handleChange(e) {
278
- _onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
279
- note: e.target.value
280
- })])));
276
+ const customPropertyObject = (_value$customProperty3 = (_value$customProperty4 = value[customProperty.value]) === null || _value$customProperty4 === void 0 ? void 0 : _value$customProperty4[0]) !== null && _value$customProperty3 !== void 0 ? _value$customProperty3 : {};
277
+ const handleChange = e => {
278
+ onChange({
279
+ ...value,
280
+ [customProperty.value]: [{
281
+ ...customPropertyObject,
282
+ note: e.target.value
283
+ }]
284
+ });
281
285
  };
282
286
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
283
287
  "data-test-customproperty-note": true,
@@ -290,13 +294,17 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
290
294
  value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.note
291
295
  });
292
296
  };
293
- var renderCustomPropertyNotePublic = function renderCustomPropertyNotePublic() {
297
+ const renderCustomPropertyNotePublic = () => {
294
298
  var _value$customProperty5, _value$customProperty6;
295
- var customPropertyObject = (_value$customProperty5 = (_value$customProperty6 = value[customProperty.value]) === null || _value$customProperty6 === void 0 ? void 0 : _value$customProperty6[0]) !== null && _value$customProperty5 !== void 0 ? _value$customProperty5 : {};
296
- var handleChange = function handleChange(e) {
297
- _onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
298
- publicNote: e.target.value
299
- })])));
299
+ const customPropertyObject = (_value$customProperty5 = (_value$customProperty6 = value[customProperty.value]) === null || _value$customProperty6 === void 0 ? void 0 : _value$customProperty6[0]) !== null && _value$customProperty5 !== void 0 ? _value$customProperty5 : {};
300
+ const handleChange = e => {
301
+ onChange({
302
+ ...value,
303
+ [customProperty.value]: [{
304
+ ...customPropertyObject,
305
+ publicNote: e.target.value
306
+ }]
307
+ });
300
308
  };
301
309
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
302
310
  "data-test-customproperty-public-note": true,
@@ -355,5 +363,4 @@ CustomPropertyField.propTypes = {
355
363
  setCustomProperties: _propTypes.default.func,
356
364
  value: _propTypes.default.object
357
365
  };
358
- var _default = CustomPropertyField;
359
- exports.default = _default;
366
+ var _default = exports.default = CustomPropertyField;