@k-int/stripes-kint-components 5.32.0 → 5.33.1

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 (420) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +1 -1
  3. package/es/__mocks__/@folio/stripes/components.js +3 -7
  4. package/es/__mocks__/@folio/stripes/core.js +4 -6
  5. package/es/__mocks__/@folio/stripes/smart-components.js +4 -6
  6. package/es/__mocks__/react-query.js +4 -6
  7. package/es/__mocks__/react-router-dom.js +6 -6
  8. package/es/lib/ActionList/ActionList.js +26 -33
  9. package/es/lib/ActionList/ActionListFieldArray.js +103 -119
  10. package/es/lib/ButtonTypedown/ButtonTypedown.js +25 -33
  11. package/es/lib/ComboButton/ComboButton.js +42 -47
  12. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +11 -17
  13. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +42 -46
  14. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +58 -58
  15. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +4 -8
  16. package/es/lib/CustomProperties/Config/CustomPropertyView.js +32 -33
  17. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
  18. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +1 -1
  19. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +3 -3
  20. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +29 -35
  21. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +61 -59
  22. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +20 -20
  23. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +2 -2
  24. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +1 -1
  25. package/es/lib/CustomProperties/Edit/testResources.js +11 -12
  26. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +22 -33
  27. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +24 -37
  28. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +1 -1
  29. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +6 -6
  30. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +3 -6
  31. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +4 -8
  32. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +15 -19
  33. package/es/lib/CustomProperties/Filter/testResources.js +1 -2
  34. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +1 -2
  35. package/es/lib/CustomProperties/View/CustomPropertiesView.js +1 -1
  36. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +17 -25
  37. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +3 -6
  38. package/es/lib/CustomProperties/View/CustomPropertyCard.js +7 -11
  39. package/es/lib/CycleButton/CycleButton.js +9 -17
  40. package/es/lib/FormModal/FormModal.js +24 -32
  41. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +23 -30
  42. package/es/lib/IconSelect/IconSelect.js +22 -32
  43. package/es/lib/NoResultsMessage/NoResultsMessage.js +4 -5
  44. package/es/lib/NumberField/NumberField.js +17 -25
  45. package/es/lib/NumberField/NumberField.test.js +6 -7
  46. package/es/lib/QueryTypedown/QueryTypedown.js +8 -15
  47. package/es/lib/RefdataButtons/RefdataButtons.js +6 -9
  48. package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +48 -60
  49. package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +5 -6
  50. package/es/lib/RichSelect/RichSelect.js +31 -36
  51. package/es/lib/RichSelect/useSelectedOption.js +1 -2
  52. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +91 -94
  53. package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +44 -36
  54. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +42 -53
  55. package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +19 -23
  56. package/es/lib/SASQRoute/SASQRoute.js +25 -29
  57. package/es/lib/SASQRoute/SASQRoute.test.js +11 -13
  58. package/es/lib/SASQViewComponent/SASQViewComponent.js +68 -76
  59. package/es/lib/SASQViewComponent/SASQViewComponent.test.js +4 -8
  60. package/es/lib/SearchField/SearchField.js +7 -13
  61. package/es/lib/SearchKeyControl/SearchKeyControl.js +8 -13
  62. package/es/lib/SearchKeyControl/SearchKeyControl.test.js +2 -6
  63. package/es/lib/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js +30 -46
  64. package/es/lib/Settings/EditableRefdataList/EditableRefdataList.js +33 -43
  65. package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +7 -11
  66. package/es/lib/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js +13 -20
  67. package/es/lib/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js +10 -12
  68. package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.js +10 -15
  69. package/es/lib/Settings/EditableSettingsList/SettingField/SettingField.test.js +3 -3
  70. package/es/lib/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js +19 -26
  71. package/es/lib/Settings/SettingPage/SettingPagePane/SettingPagePane.js +2 -2
  72. package/es/lib/Settings/Settings/Settings.js +31 -13
  73. package/es/lib/Settings/SettingsFormContainer/SettingsFormContainer.js +30 -35
  74. package/es/lib/Settings/StaticSettingsField/StaticSettingsField.js +5 -8
  75. package/es/lib/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js +18 -22
  76. package/es/lib/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js +2 -2
  77. package/es/lib/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js +1 -1
  78. package/es/lib/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js +3 -7
  79. package/es/lib/Settings/hooks/useAppSettings/useAppSettings.js +7 -11
  80. package/es/lib/Settings/hooks/useSettingSection/useSettingSection.js +16 -22
  81. package/es/lib/Settings/hooks/useSettings/useSettings.js +104 -88
  82. package/es/lib/Settings/index.js +8 -0
  83. package/es/lib/Tags/Tags.js +5 -8
  84. package/es/lib/Tags/hooks/useTags.js +1 -1
  85. package/es/lib/Tags/hooks/useTagsEnabled.js +2 -3
  86. package/es/lib/Tags/tagsConfig.js +1 -1
  87. package/es/lib/Typedown/Typedown.js +21 -28
  88. package/es/lib/hooks/__mocks__/index.js +3 -7
  89. package/es/lib/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js +20 -26
  90. package/es/lib/hooks/intlHooks/useKintIntl/useKintIntl.js +24 -34
  91. package/es/lib/hooks/typedownHooks/useTypedown.js +11 -12
  92. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +2 -2
  93. package/es/lib/hooks/useActionListRef.js +1 -1
  94. package/es/lib/hooks/useActiveElement.js +1 -1
  95. package/es/lib/hooks/useCustomProperties.js +6 -10
  96. package/es/lib/hooks/useHelperApp.js +13 -16
  97. package/es/lib/hooks/useKiwtFieldArray.js +7 -8
  98. package/es/lib/hooks/useKiwtSASQuery.js +15 -19
  99. package/es/lib/hooks/useLocalPageStore.js +7 -10
  100. package/es/lib/hooks/useModConfigEntries.js +2 -2
  101. package/es/lib/hooks/useMutateCustomProperties/useMutateCustomProperties.js +10 -17
  102. package/es/lib/hooks/useMutateGeneric/useMutateGeneric.js +2 -2
  103. package/es/lib/hooks/useMutateModConfigEntry.js +2 -2
  104. package/es/lib/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js +15 -21
  105. package/es/lib/hooks/useMutateRefdataValue/useMutateRefdataValue.js +16 -23
  106. package/es/lib/hooks/usePrevNextPagination.js +17 -19
  107. package/es/lib/hooks/useQIndex.js +11 -14
  108. package/es/lib/hooks/useRefdata.js +3 -3
  109. package/es/lib/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js +9 -13
  110. package/es/lib/hooks/useTemplates.js +4 -4
  111. package/es/lib/utils/buildUrl.js +2 -3
  112. package/es/lib/utils/filterParsers/deparseKiwtQueryFilters.js +5 -5
  113. package/es/lib/utils/filterParsers/parseKiwtQueryFilters.js +2 -2
  114. package/es/lib/utils/filterParsers/parseKiwtQueryGroups.js +4 -5
  115. package/es/lib/utils/filterParsers/parseKiwtQueryString.js +1 -1
  116. package/es/lib/utils/generateKiwtQueryParams/generateKiwtQueryParams.js +94 -107
  117. package/es/lib/utils/groupCustomPropertiesByCtx.js +5 -9
  118. package/es/lib/utils/index.js +34 -13
  119. package/es/lib/utils/matchString/index.js +13 -0
  120. package/es/lib/utils/{matchString.js → matchString/matchString.js} +8 -9
  121. package/es/lib/utils/matchString/matchString.test.js +40 -0
  122. package/es/lib/utils/parseErrorResponse.js +3 -7
  123. package/es/lib/utils/selectorSafe.js +2 -3
  124. package/es/lib/utils/sortByLabel.js +2 -3
  125. package/es/lib/utils/stringStyling/boldString.js +30 -0
  126. package/es/lib/utils/stringStyling/boldString.test.js +47 -0
  127. package/es/lib/utils/stringStyling/highlightString.js +30 -0
  128. package/es/lib/utils/stringStyling/highlightString.test.js +51 -0
  129. package/es/lib/utils/stringStyling/index.js +20 -0
  130. package/es/lib/validators/validators.js +6 -9
  131. package/package.json +1 -1
  132. package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +1 -1
  133. package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +1 -1
  134. package/src/artifacts/coverage-jest/ActionList/index.html +1 -1
  135. package/src/artifacts/coverage-jest/ActionList/index.js.html +1 -1
  136. package/src/artifacts/coverage-jest/ButtonTypedown/ButtonTypedown.js.html +1 -1
  137. package/src/artifacts/coverage-jest/ButtonTypedown/index.html +1 -1
  138. package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +1 -1
  139. package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +1 -1
  140. package/src/artifacts/coverage-jest/ComboButton/index.html +1 -1
  141. package/src/artifacts/coverage-jest/ComboButton/index.js.html +1 -1
  142. package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
  143. package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
  144. package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
  145. package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +1 -1
  146. package/src/artifacts/coverage-jest/CustomProperties/Config/index.html +1 -1
  147. package/src/artifacts/coverage-jest/CustomProperties/Config/index.js.html +1 -1
  148. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
  149. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
  150. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
  151. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
  152. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
  153. package/src/artifacts/coverage-jest/CustomProperties/Edit/index.html +1 -1
  154. package/src/artifacts/coverage-jest/CustomProperties/Edit/index.js.html +1 -1
  155. package/src/artifacts/coverage-jest/CustomProperties/Edit/testResources.js.html +1 -1
  156. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
  157. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
  158. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
  159. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
  160. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
  161. package/src/artifacts/coverage-jest/CustomProperties/Filter/index.html +1 -1
  162. package/src/artifacts/coverage-jest/CustomProperties/Filter/index.js.html +1 -1
  163. package/src/artifacts/coverage-jest/CustomProperties/Filter/testResources.js.html +1 -1
  164. package/src/artifacts/coverage-jest/CustomProperties/Filter/useOperators.js.html +1 -1
  165. package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
  166. package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +1 -1
  167. package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +1 -1
  168. package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
  169. package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +1 -1
  170. package/src/artifacts/coverage-jest/CustomProperties/View/index.html +1 -1
  171. package/src/artifacts/coverage-jest/CustomProperties/View/index.js.html +1 -1
  172. package/src/artifacts/coverage-jest/CustomProperties/View/testResources.js.html +1 -1
  173. package/src/artifacts/coverage-jest/CustomProperties/index.html +1 -1
  174. package/src/artifacts/coverage-jest/CustomProperties/index.js.html +1 -1
  175. package/src/artifacts/coverage-jest/CycleButton/CycleButton.js.html +1 -1
  176. package/src/artifacts/coverage-jest/CycleButton/index.html +1 -1
  177. package/src/artifacts/coverage-jest/CycleButton/index.js.html +1 -1
  178. package/src/artifacts/coverage-jest/FieldLabel/FieldLabel.js.html +1 -1
  179. package/src/artifacts/coverage-jest/FieldLabel/index.html +1 -1
  180. package/src/artifacts/coverage-jest/FieldLabel/index.js.html +1 -1
  181. package/src/artifacts/coverage-jest/FormModal/FormModal.js.html +1 -1
  182. package/src/artifacts/coverage-jest/FormModal/index.html +1 -1
  183. package/src/artifacts/coverage-jest/FormModal/index.js.html +1 -1
  184. package/src/artifacts/coverage-jest/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
  185. package/src/artifacts/coverage-jest/FormattedKintMessage/index.html +1 -1
  186. package/src/artifacts/coverage-jest/FormattedKintMessage/index.js.html +1 -1
  187. package/src/artifacts/coverage-jest/IconSelect/IconSelect.js.html +1 -1
  188. package/src/artifacts/coverage-jest/IconSelect/index.html +1 -1
  189. package/src/artifacts/coverage-jest/IconSelect/index.js.html +1 -1
  190. package/src/artifacts/coverage-jest/NoResultsMessage/NoResultsMessage.js.html +1 -1
  191. package/src/artifacts/coverage-jest/NoResultsMessage/index.html +1 -1
  192. package/src/artifacts/coverage-jest/NoResultsMessage/index.js.html +1 -1
  193. package/src/artifacts/coverage-jest/NumberField/NumberField.js.html +15 -15
  194. package/src/artifacts/coverage-jest/NumberField/index.html +1 -1
  195. package/src/artifacts/coverage-jest/NumberField/index.js.html +1 -1
  196. package/src/artifacts/coverage-jest/QueryTypedown/QueryTypedown.js.html +1 -1
  197. package/src/artifacts/coverage-jest/QueryTypedown/index.html +1 -1
  198. package/src/artifacts/coverage-jest/QueryTypedown/index.js.html +1 -1
  199. package/src/artifacts/coverage-jest/RefdataButtons/RefdataButtons.js.html +1 -1
  200. package/src/artifacts/coverage-jest/RefdataButtons/index.html +1 -1
  201. package/src/artifacts/coverage-jest/RefdataButtons/index.js.html +1 -1
  202. package/src/artifacts/coverage-jest/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +1 -1
  203. package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.html +1 -1
  204. package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.js.html +1 -1
  205. package/src/artifacts/coverage-jest/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
  206. package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +1 -1
  207. package/src/artifacts/coverage-jest/RichSelect/index.html +1 -1
  208. package/src/artifacts/coverage-jest/RichSelect/index.js.html +1 -1
  209. package/src/artifacts/coverage-jest/RichSelect/useSelectedOption.js.html +1 -1
  210. package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +31 -31
  211. package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
  212. package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +1 -1
  213. package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
  214. package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +1 -1
  215. package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
  216. package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +1 -1
  217. package/src/artifacts/coverage-jest/SASQRoute/index.html +1 -1
  218. package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
  219. package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +1 -1
  220. package/src/artifacts/coverage-jest/SASQViewComponent/index.html +1 -1
  221. package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
  222. package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +1 -1
  223. package/src/artifacts/coverage-jest/SearchField/index.html +1 -1
  224. package/src/artifacts/coverage-jest/SearchField/index.js.html +1 -1
  225. package/src/artifacts/coverage-jest/SearchKeyControl/SearchKeyControl.js.html +1 -1
  226. package/src/artifacts/coverage-jest/SearchKeyControl/index.html +1 -1
  227. package/src/artifacts/coverage-jest/SearchKeyControl/index.js.html +1 -1
  228. package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
  229. package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.html +1 -1
  230. package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.js.html +1 -1
  231. package/src/artifacts/coverage-jest/Settings/EditableRefdataList/EditableRefdataList.js.html +1 -1
  232. package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.html +1 -1
  233. package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.js.html +1 -1
  234. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsList.js.html +1 -1
  235. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +1 -1
  236. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +1 -1
  237. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.js.html +1 -1
  238. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js.html +1 -1
  239. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +1 -1
  240. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.js.html +1 -1
  241. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js.html +1 -1
  242. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.html +1 -1
  243. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.js.html +1 -1
  244. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/SettingField.js.html +1 -1
  245. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +1 -1
  246. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
  247. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +1 -1
  248. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.js.html +1 -1
  249. package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js.html +1 -1
  250. package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.html +1 -1
  251. package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.js.html +1 -1
  252. package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPage.js.html +1 -1
  253. package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +1 -1
  254. package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.html +1 -1
  255. package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.js.html +1 -1
  256. package/src/artifacts/coverage-jest/Settings/SettingPage/index.html +1 -1
  257. package/src/artifacts/coverage-jest/Settings/SettingPage/index.js.html +1 -1
  258. package/src/artifacts/coverage-jest/Settings/Settings/Settings.js.html +96 -9
  259. package/src/artifacts/coverage-jest/Settings/Settings/index.html +14 -14
  260. package/src/artifacts/coverage-jest/Settings/Settings/index.js.html +1 -1
  261. package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
  262. package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
  263. package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
  264. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +1 -1
  265. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +1 -1
  266. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +1 -1
  267. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
  268. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +1 -1
  269. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +1 -1
  270. package/src/artifacts/coverage-jest/Settings/constants/index.html +1 -1
  271. package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
  272. package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +1 -1
  273. package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +1 -1
  274. package/src/artifacts/coverage-jest/Settings/contexts/index.html +1 -1
  275. package/src/artifacts/coverage-jest/Settings/contexts/index.js.html +1 -1
  276. package/src/artifacts/coverage-jest/Settings/hooks/index.html +1 -1
  277. package/src/artifacts/coverage-jest/Settings/hooks/index.js.html +1 -1
  278. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.html +1 -1
  279. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.js.html +1 -1
  280. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.html +1 -1
  281. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.js.html +1 -1
  282. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js.html +1 -1
  283. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.html +1 -1
  284. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.js.html +1 -1
  285. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js.html +1 -1
  286. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +1 -1
  287. package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.html +1 -1
  288. package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.js.html +1 -1
  289. package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/useAppSettings.js.html +1 -1
  290. package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.html +1 -1
  291. package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
  292. package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +1 -1
  293. package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +13 -13
  294. package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
  295. package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +105 -69
  296. package/src/artifacts/coverage-jest/Settings/index.html +1 -1
  297. package/src/artifacts/coverage-jest/Settings/index.js.html +11 -2
  298. package/src/artifacts/coverage-jest/Tags/Tags.js.html +1 -1
  299. package/src/artifacts/coverage-jest/Tags/hooks/index.html +1 -1
  300. package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
  301. package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +1 -1
  302. package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +1 -1
  303. package/src/artifacts/coverage-jest/Tags/index.html +1 -1
  304. package/src/artifacts/coverage-jest/Tags/index.js.html +1 -1
  305. package/src/artifacts/coverage-jest/Tags/tagsConfig.js.html +1 -1
  306. package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +1 -1
  307. package/src/artifacts/coverage-jest/Typedown/index.html +1 -1
  308. package/src/artifacts/coverage-jest/Typedown/index.js.html +1 -1
  309. package/src/artifacts/coverage-jest/cobertura-coverage.xml +371 -334
  310. package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
  311. package/src/artifacts/coverage-jest/constants/customProperties.js.html +1 -1
  312. package/src/artifacts/coverage-jest/constants/endpoints.js.html +1 -1
  313. package/src/artifacts/coverage-jest/constants/eventCodes.js.html +1 -1
  314. package/src/artifacts/coverage-jest/constants/index.html +1 -1
  315. package/src/artifacts/coverage-jest/constants/pagination.js.html +1 -1
  316. package/src/artifacts/coverage-jest/hooks/index.html +1 -1
  317. package/src/artifacts/coverage-jest/hooks/index.js.html +1 -1
  318. package/src/artifacts/coverage-jest/hooks/intlHooks/index.html +1 -1
  319. package/src/artifacts/coverage-jest/hooks/intlHooks/index.js.html +1 -1
  320. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.html +1 -1
  321. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.js.html +1 -1
  322. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/useIntlKey.js.html +7 -7
  323. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.html +1 -1
  324. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.js.html +1 -1
  325. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js.html +6 -6
  326. package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.html +1 -1
  327. package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.js.html +1 -1
  328. package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/useKintIntl.js.html +6 -6
  329. package/src/artifacts/coverage-jest/hooks/typedownHooks/index.html +1 -1
  330. package/src/artifacts/coverage-jest/hooks/typedownHooks/index.js.html +1 -1
  331. package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedown.js.html +1 -1
  332. package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +1 -1
  333. package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
  334. package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +1 -1
  335. package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +1 -1
  336. package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +1 -1
  337. package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +1 -1
  338. package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.html +1 -1
  339. package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.js.html +1 -1
  340. package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/useInvalidateRefdata.js.html +1 -1
  341. package/src/artifacts/coverage-jest/hooks/useKiwtFieldArray.js.html +1 -1
  342. package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +9 -9
  343. package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +1 -1
  344. package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +5 -5
  345. package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +1 -1
  346. package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.html +1 -1
  347. package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
  348. package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +1 -1
  349. package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +1 -1
  350. package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +1 -1
  351. package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +1 -1
  352. package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +1 -1
  353. package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +1 -1
  354. package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
  355. package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +1 -1
  356. package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +1 -1
  357. package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
  358. package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.js.html +1 -1
  359. package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +20 -20
  360. package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +8 -8
  361. package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +1 -1
  362. package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +1 -1
  363. package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.html +1 -1
  364. package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.js.html +1 -1
  365. package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js.html +1 -1
  366. package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +1 -1
  367. package/src/artifacts/coverage-jest/index.html +63 -33
  368. package/src/artifacts/coverage-jest/utils/buildUrl.js.html +1 -1
  369. package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +1 -1
  370. package/src/artifacts/coverage-jest/utils/filterParsers/index.html +1 -1
  371. package/src/artifacts/coverage-jest/utils/filterParsers/index.js.html +1 -1
  372. package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryFilters.js.html +1 -1
  373. package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +1 -1
  374. package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +1 -1
  375. package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +1 -1
  376. package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +1 -1
  377. package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +1 -1
  378. package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
  379. package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +1 -1
  380. package/src/artifacts/coverage-jest/utils/index.html +9 -39
  381. package/src/artifacts/coverage-jest/utils/index.js.html +2 -2
  382. package/src/artifacts/coverage-jest/utils/matchString/index.html +131 -0
  383. package/src/artifacts/coverage-jest/utils/matchString/index.js.html +88 -0
  384. package/src/artifacts/coverage-jest/utils/{matchString.js.html → matchString/matchString.js.html} +82 -55
  385. package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +1 -1
  386. package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +1 -1
  387. package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +1 -1
  388. package/src/artifacts/coverage-jest/utils/refdataOptions.js.html +1 -1
  389. package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.html +1 -1
  390. package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.js.html +1 -1
  391. package/src/artifacts/coverage-jest/utils/refdataQueryKey/refdataQueryKey.js.html +1 -1
  392. package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +1 -1
  393. package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +1 -1
  394. package/src/artifacts/coverage-jest/utils/stringStyling/boldString.js.html +190 -0
  395. package/src/artifacts/coverage-jest/utils/stringStyling/highlightString.js.html +190 -0
  396. package/src/artifacts/coverage-jest/utils/stringStyling/index.html +146 -0
  397. package/src/artifacts/coverage-jest/utils/stringStyling/index.js.html +91 -0
  398. package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +1 -1
  399. package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +1 -1
  400. package/src/artifacts/coverage-jest/validators/index.html +1 -1
  401. package/src/artifacts/coverage-jest/validators/index.js.html +1 -1
  402. package/src/artifacts/coverage-jest/validators/validators.js.html +1 -1
  403. package/src/lib/Settings/Settings/Settings.js +30 -1
  404. package/src/lib/Settings/hooks/useSettings/README.md +49 -19
  405. package/src/lib/Settings/hooks/useSettings/useSettings.js +60 -48
  406. package/src/lib/Settings/index.js +3 -0
  407. package/src/lib/utils/index.js +1 -1
  408. package/src/lib/utils/matchString/index.js +1 -0
  409. package/src/lib/utils/matchString/matchString.js +44 -0
  410. package/src/lib/utils/matchString/matchString.test.js +68 -0
  411. package/src/lib/utils/stringStyling/boldString.js +35 -0
  412. package/src/lib/utils/stringStyling/boldString.test.js +59 -0
  413. package/src/lib/utils/stringStyling/highlightString.js +35 -0
  414. package/src/lib/utils/stringStyling/highlightString.test.js +67 -0
  415. package/src/lib/utils/stringStyling/index.js +2 -0
  416. package/styles/stringMatchStyles.css +3 -0
  417. package/es/lib/utils/highlightString.js +0 -45
  418. package/src/artifacts/coverage-jest/utils/highlightString.js.html +0 -259
  419. package/src/lib/utils/highlightString.js +0 -58
  420. package/src/lib/utils/matchString.js +0 -35
@@ -8,7 +8,6 @@ var _reactQuery = require("react-query");
8
8
  var _core = require("@folio/stripes/core");
9
9
  var _utils = require("../../../utils");
10
10
  const useAppSettings = _ref => {
11
- var _ref2, _ref3, _queryObject$data2;
12
11
  let {
13
12
  endpoint,
14
13
  keyName,
@@ -24,32 +23,29 @@ const useAppSettings = _ref => {
24
23
  };
25
24
  const namespaceArray = [endpoint];
26
25
  if (sectionName) {
27
- var _defaultQueryParamObj;
28
- defaultQueryParamObject.filters = [...((_defaultQueryParamObj = defaultQueryParamObject.filters) !== null && _defaultQueryParamObj !== void 0 ? _defaultQueryParamObj : []), {
26
+ defaultQueryParamObject.filters = [...(defaultQueryParamObject.filters ?? []), {
29
27
  path: 'section',
30
28
  value: sectionName
31
29
  }];
32
30
  namespaceArray.push(sectionName);
33
31
  }
34
32
  if (keyName) {
35
- var _defaultQueryParamObj2;
36
- defaultQueryParamObject.filters = [...((_defaultQueryParamObj2 = defaultQueryParamObject.filters) !== null && _defaultQueryParamObj2 !== void 0 ? _defaultQueryParamObj2 : []), {
33
+ defaultQueryParamObject.filters = [...(defaultQueryParamObject.filters ?? []), {
37
34
  path: 'key',
38
35
  value: keyName
39
36
  }];
40
37
  defaultQueryParamObject.perPage = 1;
41
38
  namespaceArray.push(keyName);
42
39
  }
43
- const queryParamArray = (0, _utils.generateKiwtQueryParams)(options !== null && options !== void 0 ? options : defaultQueryParamObject, {});
40
+ const queryParamArray = (0, _utils.generateKiwtQueryParams)(options ?? defaultQueryParamObject, {});
44
41
  namespaceArray.push(queryParamArray);
45
- const queryObject = (0, _reactQuery.useQuery)(namespaceArray, () => ky("".concat(endpoint, "?").concat(queryParamArray === null || queryParamArray === void 0 ? void 0 : queryParamArray.join('&'))).json(), queryParams);
42
+ const queryObject = (0, _reactQuery.useQuery)(namespaceArray, () => ky(`${endpoint}?${queryParamArray?.join('&')}`).json(), queryParams);
46
43
  if (returnQueryObject) {
47
44
  return queryObject;
48
45
  }
49
- if ((_ref2 = queryParams !== null && queryParams !== void 0 ? queryParams : defaultQueryParamObject) !== null && _ref2 !== void 0 && _ref2.perPage && ((_ref3 = queryParams !== null && queryParams !== void 0 ? queryParams : defaultQueryParamObject) === null || _ref3 === void 0 ? void 0 : _ref3.perPage) === 1) {
50
- var _queryObject$data$, _queryObject$data;
51
- return (_queryObject$data$ = queryObject === null || queryObject === void 0 || (_queryObject$data = queryObject.data) === null || _queryObject$data === void 0 ? void 0 : _queryObject$data[0]) !== null && _queryObject$data$ !== void 0 ? _queryObject$data$ : {};
46
+ if ((queryParams ?? defaultQueryParamObject)?.perPage && (queryParams ?? defaultQueryParamObject)?.perPage === 1) {
47
+ return queryObject?.data?.[0] ?? {};
52
48
  }
53
- return (_queryObject$data2 = queryObject === null || queryObject === void 0 ? void 0 : queryObject.data) !== null && _queryObject$data2 !== void 0 ? _queryObject$data2 : [];
49
+ return queryObject?.data ?? [];
54
50
  };
55
51
  var _default = exports.default = useAppSettings;
@@ -8,10 +8,6 @@ var _reactQuery = require("react-query");
8
8
  var _core = require("@folio/stripes/core");
9
9
  var _utils = require("../../../utils");
10
10
  var _constants = require("../../constants");
11
- const _excluded = ["data"],
12
- _excluded2 = ["mutateAsync"];
13
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
14
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
15
11
  const useSettingSection = _ref => {
16
12
  let {
17
13
  sectionName,
@@ -37,25 +33,23 @@ const useSettingSection = _ref => {
37
33
  perPage: 100,
38
34
  stats: false
39
35
  }, {});
40
- const _useQuery = (0, _reactQuery.useQuery)(getQueryNamespaceGenerator({
36
+ const {
37
+ data: settings = [],
38
+ ...settingsQuery
39
+ } = (0, _reactQuery.useQuery)(getQueryNamespaceGenerator({
40
+ queryParams
41
+ }), () => ky(`${settingEndpoint}?${queryParams?.join('&')}`).json());
42
+ const {
43
+ mutateAsync: putSetting,
44
+ ...settingsMutate
45
+ } = (0, _reactQuery.useMutation)(getMutateNamespaceGenerator(), data => ky.put(`${settingEndpoint}${data.id ? '/' + data.id : ''}`, {
46
+ json: data
47
+ }).then(async res => {
48
+ await queryClient.invalidateQueries(getQueryNamespaceGenerator({
41
49
  queryParams
42
- }), () => ky("".concat(settingEndpoint, "?").concat(queryParams === null || queryParams === void 0 ? void 0 : queryParams.join('&'))).json()),
43
- {
44
- data: settings = []
45
- } = _useQuery,
46
- settingsQuery = _objectWithoutProperties(_useQuery, _excluded);
47
- const _useMutation = (0, _reactQuery.useMutation)(getMutateNamespaceGenerator(), data => ky.put("".concat(settingEndpoint).concat(data.id ? '/' + data.id : ''), {
48
- json: data
49
- }).then(async res => {
50
- await queryClient.invalidateQueries(getQueryNamespaceGenerator({
51
- queryParams
52
- }));
53
- return res;
54
- })),
55
- {
56
- mutateAsync: putSetting
57
- } = _useMutation,
58
- settingsMutate = _objectWithoutProperties(_useMutation, _excluded2);
50
+ }));
51
+ return res;
52
+ }));
59
53
  return {
60
54
  handleSubmit: putSetting,
61
55
  settings,
@@ -15,18 +15,37 @@ var _utils = require("../../../utils");
15
15
  var _hooks = require("../../../hooks");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
21
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // We have swapped from the stripes-smart components settings page to our own internal one.
18
+ // We have swapped from the stripes-smart components settings page to our own internal one.
23
19
  // I'd honestly prefer to redo it all but at least this way we're in control
24
20
  // import { Settings } from '@folio/stripes/smart-components';
21
+
22
+ const InternalSettingsContextProvider = _ref => {
23
+ let {
24
+ children,
25
+ contextValue
26
+ } = _ref;
27
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_contexts.SettingsContext.Provider, {
28
+ value: contextValue,
29
+ children: children
30
+ });
31
+ };
32
+ InternalSettingsContextProvider.propTypes = {
33
+ children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
34
+ contextValue: _propTypes.default.object
35
+ };
36
+
25
37
  // TODO work underway to make the settings hook more useful when trying to render multiple sections at a time
26
38
  const useSettings = function () {
27
39
  let settingsProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
28
40
  const {
29
41
  allowGlobalEdit = true,
42
+ // DEPRECATED This prop will eventually be set to FALSE in a breaking change.
43
+ // This is a LEGACY prop, which ensured each page had context pre-wrapped.
44
+ // This is NOT required while using Settings component within kint-components
45
+ // to render dynamic pages, but the dynamic pages break if context is missing with
46
+ // the stripes smart components model
47
+ // Turn this OFF if having difficulties with settings page redraws (When using SASQ in particular)
48
+ contextPerPage = true,
30
49
  dynamicPageExclusions,
31
50
  intlKey: passedIntlKey,
32
51
  intlNS: passedIntlNS,
@@ -51,17 +70,16 @@ const useSettings = function () {
51
70
  const ky = (0, _core.useOkapiKy)();
52
71
  const stripes = (0, _core.useStripes)();
53
72
  const kintIntl = (0, _hooks.useKintIntl)(passedIntlKey, passedIntlNS);
73
+ const intlKey = (0, _hooks.useIntlKey)(passedIntlKey, passedIntlNS);
54
74
 
55
75
  // Set up array of queryParams, pageLists etc etc ready for us to do all the work in a single place
56
76
 
57
77
  const sectionMetaArray = (0, _react.useMemo)(() => {
58
- var _sections$length;
59
78
  const array = [];
60
79
  const getSectionQueryProps = sectionProps => {
61
- var _sectionProps$dynamic, _sectionProps$setting;
62
- const dqp = (_sectionProps$dynamic = sectionProps.dynamicPageExclusions) !== null && _sectionProps$dynamic !== void 0 ? _sectionProps$dynamic : dynamicPageExclusions;
80
+ const dqp = sectionProps.dynamicPageExclusions ?? dynamicPageExclusions;
63
81
  const queryParams = (0, _utils.generateKiwtQueryParams)({
64
- filters: dqp === null || dqp === void 0 ? void 0 : dqp.map(dpe => ({
82
+ filters: dqp?.map(dpe => ({
65
83
  path: 'section',
66
84
  comparator: '!=',
67
85
  value: dpe
@@ -69,68 +87,72 @@ const useSettings = function () {
69
87
  perPage: 100,
70
88
  stats: false
71
89
  }, {});
72
- const finalSettingEndpoint = (_sectionProps$setting = sectionProps.settingEndpoint) !== null && _sectionProps$setting !== void 0 ? _sectionProps$setting : settingEndpoint;
90
+ const finalSettingEndpoint = sectionProps.settingEndpoint ?? settingEndpoint;
73
91
  const queryKey = ['stripes-kint-components', 'useSettings', 'appSettings', finalSettingEndpoint, queryParams];
74
- const queryFn = () => ky("".concat(finalSettingEndpoint, "?").concat(queryParams === null || queryParams === void 0 ? void 0 : queryParams.join('&'))).json();
92
+ const queryFn = () => ky(`${finalSettingEndpoint}?${queryParams?.join('&')}`).json();
75
93
  return {
76
94
  queryParams,
77
95
  queryKey,
78
96
  queryFn
79
97
  };
80
98
  };
81
- if (((_sections$length = sections === null || sections === void 0 ? void 0 : sections.length) !== null && _sections$length !== void 0 ? _sections$length : 0) > 0) {
99
+ if ((sections?.length ?? 0) > 0) {
82
100
  array.push(...sections.map(section => {
83
101
  const querySectionProps = getSectionQueryProps(section);
84
- return _objectSpread(_objectSpread(_objectSpread({}, settingsProps), querySectionProps), section);
102
+ return {
103
+ ...settingsProps,
104
+ // ensure these fall through to section based props
105
+ ...querySectionProps,
106
+ ...section // return original section object
107
+ };
85
108
  }));
86
109
  } else {
87
110
  const querySectionProps = getSectionQueryProps(settingsProps);
88
- array.push(_objectSpread(_objectSpread({}, settingsProps), querySectionProps));
111
+ array.push({
112
+ ...settingsProps,
113
+ ...querySectionProps
114
+ });
89
115
  }
90
116
  return array;
91
117
  }, [dynamicPageExclusions, ky, sections, settingEndpoint, settingsProps]);
92
- const queries = (0, _react.useMemo)(() => {
93
- var _sectionMetaArray$map;
94
- return (_sectionMetaArray$map = sectionMetaArray.map(sma => {
95
- let enabled = true;
96
- if (sma.pages || sma.preventQueries || pages || preventQueries) {
97
- enabled = false;
98
- }
99
- return {
100
- queryKey: sma.queryKey,
101
- queryFn: sma.queryFn,
102
- enabled
103
- };
104
- })) !== null && _sectionMetaArray$map !== void 0 ? _sectionMetaArray$map : [];
105
- }, [pages, preventQueries, sectionMetaArray]);
118
+ const queries = (0, _react.useMemo)(() => sectionMetaArray.map(sma => {
119
+ let enabled = true;
120
+ if (sma.pages || sma.preventQueries || pages || preventQueries) {
121
+ enabled = false;
122
+ }
123
+ return {
124
+ queryKey: sma.queryKey,
125
+ queryFn: sma.queryFn,
126
+ enabled
127
+ };
128
+ }) ?? [], [pages, preventQueries, sectionMetaArray]);
106
129
  const queryReturnArray = (0, _reactQuery.useQueries)(queries);
107
130
  const [isLoading, setIsLoading] = (0, _react.useState)(true);
108
131
  const getDynamicPages = (0, _react.useCallback)((qra, sma) => {
109
- var _qra$data;
110
- const pagesFromQueryReturn = [...new Set((_qra$data = qra.data) === null || _qra$data === void 0 ? void 0 : _qra$data.map(s => s.section))];
132
+ const pagesFromQueryReturn = [...new Set(qra.data?.map(s => s.section))];
111
133
  const dynamic = pagesFromQueryReturn.map(page => {
112
- var _sma$render, _sma$sectionRoute;
113
- const finalRender = (_sma$render = sma.render) !== null && _sma$render !== void 0 ? _sma$render : render;
114
- const finalSectionRoute = (_sma$sectionRoute = sma.sectionRoute) !== null && _sma$sectionRoute !== void 0 ? _sma$sectionRoute : sectionRoute;
115
- const pageRoute = (finalSectionRoute ? "".concat(finalSectionRoute, "/") : '') + page;
134
+ const finalRender = sma.render ?? render;
135
+ const finalSectionRoute = sma.sectionRoute ?? sectionRoute;
136
+ const pageRoute = (finalSectionRoute ? `${finalSectionRoute}/` : '') + page;
116
137
  return {
117
138
  route: pageRoute,
118
139
  label: kintIntl.formatKintMessage({
119
- id: "settings.settingsSection.".concat((0, _utils.toCamelCase)(page)),
140
+ id: `settings.settingsSection.${(0, _utils.toCamelCase)(page)}`,
120
141
  fallbackMessage: page
121
142
  }),
122
143
  component: props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingPage.SettingPagePane, {
123
144
  intlKey: passedIntlKey,
124
145
  intlNS: passedIntlNS,
125
146
  sectionName: page,
126
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingPage.SettingPage, _objectSpread({
147
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingPage.SettingPage, {
127
148
  allowEdit: allowGlobalEdit,
128
149
  intlKey: passedIntlKey,
129
150
  intlNS: passedIntlNS,
130
151
  labelOverrides: labelOverrides,
131
152
  render: finalRender,
132
- sectionName: page
133
- }, props))
153
+ sectionName: page,
154
+ ...props
155
+ })
134
156
  })
135
157
  };
136
158
  });
@@ -147,84 +169,78 @@ const useSettings = function () {
147
169
  }, [isLoading, queryReturnArray]);
148
170
  const finalSections = (0, _react.useMemo)(() => {
149
171
  return sectionMetaArray.map((sma, idx) => {
150
- var _sma$sectionPermissio;
151
- const SettingsContextProvider = _ref => {
152
- let {
153
- children
154
- } = _ref;
155
- const intlKey = (0, _hooks.useIntlKey)(passedIntlKey, passedIntlNS);
156
- const contextValue = (0, _react.useMemo)(() => {
157
- var _sma$intlKey, _sma$refdataEndpoint, _sma$settingEndpoint, _sma$templateEndpoint;
158
- return {
159
- intlKey: (_sma$intlKey = sma.intlKey) !== null && _sma$intlKey !== void 0 ? _sma$intlKey : intlKey,
160
- // This is only here for backwards compatibility... is now grabbed from useIntlKey instead of what's passed in directly
161
- refdataEndpoint: (_sma$refdataEndpoint = sma.refdataEndpoint) !== null && _sma$refdataEndpoint !== void 0 ? _sma$refdataEndpoint : refdataEndpoint,
162
- settingEndpoint: (_sma$settingEndpoint = sma.settingEndpoint) !== null && _sma$settingEndpoint !== void 0 ? _sma$settingEndpoint : settingEndpoint,
163
- templateEndpoint: (_sma$templateEndpoint = sma.templateEndpoint) !== null && _sma$templateEndpoint !== void 0 ? _sma$templateEndpoint : templateEndpoint
164
- };
165
- }, [intlKey]);
166
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_contexts.SettingsContext.Provider, {
167
- value: contextValue,
168
- children: children
169
- });
170
- };
171
- SettingsContextProvider.propTypes = {
172
- children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node])
172
+ const contextValue = {
173
+ intlKey: sma.intlKey ?? intlKey,
174
+ // This is only here for backwards compatibility... is now grabbed from useIntlKey instead of what's passed in directly
175
+ refdataEndpoint: sma.refdataEndpoint ?? refdataEndpoint,
176
+ settingEndpoint: sma.settingEndpoint ?? settingEndpoint,
177
+ templateEndpoint: sma.templateEndpoint ?? templateEndpoint
173
178
  };
174
- const finalPermission = (_sma$sectionPermissio = sma.sectionPermission) !== null && _sma$sectionPermissio !== void 0 ? _sma$sectionPermissio : sectionPermission;
179
+ const finalPermission = sma.sectionPermission ?? sectionPermission;
175
180
  if (!finalPermission || stripes.hasPerm(finalPermission)) {
176
- var _ref2, _sma$pages, _sma$persistentPages;
177
181
  const dynamicPagesFromQueryReturn = getDynamicPages(queryReturnArray[idx], sma);
178
- const finalPages = (_ref2 = (_sma$pages = sma.pages) !== null && _sma$pages !== void 0 ? _sma$pages : pages) !== null && _ref2 !== void 0 ? _ref2 : ((_sma$persistentPages = sma.persistentPages) !== null && _sma$persistentPages !== void 0 ? _sma$persistentPages : persistentPages).concat(dynamicPagesFromQueryReturn.dynamic).sort(_utils.sortByLabel).map(p => {
179
- return _objectSpread(_objectSpread({}, p), {}, {
180
- component: pCProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(SettingsContextProvider, {
181
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(p.component, _objectSpread({}, pCProps))
182
- })
183
- });
182
+ const finalPages = sma.pages ?? pages ?? (sma.persistentPages ?? persistentPages).concat(dynamicPagesFromQueryReturn.dynamic).sort(_utils.sortByLabel).map(p => {
183
+ let component = p.component;
184
+ if (contextPerPage) {
185
+ component = cprops => /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalSettingsContextProvider, {
186
+ contextValue: contextValue,
187
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(p.component, {
188
+ ...cprops
189
+ })
190
+ });
191
+ }
192
+ return {
193
+ ...p,
194
+ component,
195
+ Provider: InternalSettingsContextProvider,
196
+ contextValue
197
+ };
184
198
  });
185
- return _objectSpread(_objectSpread(_objectSpread({}, sma), {}, {
186
- SettingsContextProvider
187
- }, dynamicPagesFromQueryReturn), {}, {
199
+ return {
200
+ ...sma,
201
+ SettingsContextProvider: InternalSettingsContextProvider,
202
+ ...dynamicPagesFromQueryReturn,
188
203
  pageList: finalPages,
189
204
  // DEPRECATED Here for backwards compatibility
190
205
  pages: finalPages // ASSUMPTION MADE THAT INDICES REMAIN THE SAME
191
- });
206
+ };
192
207
  }
193
208
  return null;
194
209
  }).filter(Boolean);
195
- }, [getDynamicPages, pages, passedIntlKey, passedIntlNS, persistentPages, queryReturnArray, refdataEndpoint, sectionMetaArray, sectionPermission, settingEndpoint, stripes, templateEndpoint]);
196
- const pageList = (0, _react.useMemo)(() => {
210
+ }, [contextPerPage, getDynamicPages, intlKey, pages, persistentPages, queryReturnArray, refdataEndpoint, sectionMetaArray, sectionPermission, settingEndpoint, stripes, templateEndpoint]);
211
+ const outputPages = (0, _react.useMemo)(() => {
197
212
  let finalPages = null;
198
- if (finalSections && finalSections.length === 1 && !renderSingleSection) {
199
- finalPages = pages !== null && pages !== void 0 ? pages : finalSections[0].pages;
213
+ if (finalSections?.length === 1 && !renderSingleSection) {
214
+ finalPages = pages ?? finalSections[0].pages;
200
215
  }
201
216
  return finalPages;
202
217
  }, [finalSections, pages, renderSingleSection]);
203
- const passedSections = (0, _react.useMemo)(() => {
218
+ const outputSections = (0, _react.useMemo)(() => {
204
219
  if (finalSections.length > 1 || finalSections.length === 1 && renderSingleSection) {
205
220
  return finalSections;
206
221
  }
207
222
  return null;
208
223
  }, [finalSections, renderSingleSection]);
209
- const SettingsComponent = props => {
210
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Settings.default, _objectSpread({
211
- pages: pageList,
224
+ const SettingsComponent = (0, _react.useCallback)(props => {
225
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Settings.default, {
226
+ pages: outputPages,
212
227
  paneTitle: kintIntl.formatKintMessage({
213
228
  id: 'meta.title'
214
229
  }),
215
- sections: passedSections
216
- }, props));
217
- };
230
+ sections: outputSections,
231
+ ...props
232
+ });
233
+ }, [kintIntl, outputPages, outputSections]);
218
234
  return {
219
235
  isLoading,
220
- pageList,
221
- sections: finalSections,
236
+ pageList: outputPages,
237
+ sections: outputSections,
222
238
  SettingsComponent,
223
239
  // This doesn't make much sense if there is more than one section, here to avoid breaking changes
224
- SettingsContextProvider: finalSections && finalSections.length === 1 ? finalSections[0].SettingsContextProvider : _ref3 => {
240
+ SettingsContextProvider: finalSections?.length === 1 ? finalSections[0].SettingsContextProvider : _ref2 => {
225
241
  let {
226
242
  children
227
- } = _ref3;
243
+ } = _ref2;
228
244
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
229
245
  children: [" ", children, " "]
230
246
  });
@@ -7,6 +7,7 @@ var _exportNames = {
7
7
  SettingsFormContainer: true,
8
8
  SettingPage: true,
9
9
  SettingPagePane: true,
10
+ Settings: true,
10
11
  RefdataCategoriesSettings: true,
11
12
  EditableRefdataList: true,
12
13
  EditableRefdataCategoryList: true,
@@ -44,6 +45,12 @@ Object.defineProperty(exports, "SettingPagePane", {
44
45
  return _SettingPage.SettingPagePane;
45
46
  }
46
47
  });
48
+ Object.defineProperty(exports, "Settings", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _Settings.default;
52
+ }
53
+ });
47
54
  Object.defineProperty(exports, "SettingsContext", {
48
55
  enumerable: true,
49
56
  get: function () {
@@ -82,6 +89,7 @@ Object.keys(_hooks).forEach(function (key) {
82
89
  });
83
90
  });
84
91
  var _SettingPage = require("./SettingPage");
92
+ var _Settings = _interopRequireDefault(require("./Settings"));
85
93
  var _EditableSettingsList = require("./EditableSettingsList");
86
94
  Object.keys(_EditableSettingsList).forEach(function (key) {
87
95
  if (key === "default" || key === "__esModule") return;
@@ -17,7 +17,6 @@ var _hooks2 = require("../hooks");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
19
  const Tags = _ref => {
20
- var _entity$tags3, _entity$tags$length, _entity$tags4;
21
20
  let {
22
21
  invalidateLinks = [],
23
22
  // If there are other queries that need invalidating, pass those here
@@ -60,7 +59,7 @@ const Tags = _ref => {
60
59
  json: data
61
60
  }).then(() => {
62
61
  queryClient.invalidateQueries(link);
63
- if (invalidateLinks !== null && invalidateLinks !== void 0 && invalidateLinks.length) {
62
+ if (invalidateLinks?.length) {
64
63
  invalidateLinks.forEach(il => queryClient.invalidateQueries(il));
65
64
  }
66
65
  }));
@@ -85,8 +84,7 @@ const Tags = _ref => {
85
84
  // add tag to the list of entity tags
86
85
  // istanbul ignore next
87
86
  const saveEntityTags = tagsToSave => {
88
- var _entity$tags;
89
- const tagListMap = ((_entity$tags = entity === null || entity === void 0 ? void 0 : entity.tags) !== null && _entity$tags !== void 0 ? _entity$tags : []).map(tag => ({
87
+ const tagListMap = (entity?.tags ?? []).map(tag => ({
90
88
  'value': tag.value
91
89
  }));
92
90
  const tagsMap = tagsToSave.map(tag => ({
@@ -102,8 +100,7 @@ const Tags = _ref => {
102
100
  saveTags(addTags);
103
101
  };
104
102
  const onRemove = tag => {
105
- var _entity$tags2;
106
- const tagToDelete = ((_entity$tags2 = entity === null || entity === void 0 ? void 0 : entity.tags) !== null && _entity$tags2 !== void 0 ? _entity$tags2 : []).filter(t => t.value.toLowerCase() === tag.toLowerCase());
103
+ const tagToDelete = (entity?.tags ?? []).filter(t => t.value.toLowerCase() === tag.toLowerCase());
107
104
  putEntity({
108
105
  tags: [{
109
106
  id: tagToDelete[0].id,
@@ -111,7 +108,7 @@ const Tags = _ref => {
111
108
  }]
112
109
  });
113
110
  };
114
- const entityTags = ((_entity$tags3 = entity === null || entity === void 0 ? void 0 : entity.tags) !== null && _entity$tags3 !== void 0 ? _entity$tags3 : []).map(tag => tag.value.toLowerCase());
111
+ const entityTags = (entity?.tags ?? []).map(tag => tag.value.toLowerCase());
115
112
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pane, {
116
113
  defaultWidth: "20%",
117
114
  dismissible: true,
@@ -121,7 +118,7 @@ const Tags = _ref => {
121
118
  id: 'numberOfTags',
122
119
  overrideValue: labelOverrides.numberOfTags
123
120
  }, {
124
- count: (_entity$tags$length = entity === null || entity === void 0 || (_entity$tags4 = entity.tags) === null || _entity$tags4 === void 0 ? void 0 : _entity$tags4.length) !== null && _entity$tags$length !== void 0 ? _entity$tags$length : 0
121
+ count: entity?.tags?.length ?? 0
125
122
  }),
126
123
  paneTitle: kintIntl.formatKintMessage({
127
124
  id: 'tags',
@@ -9,7 +9,7 @@ var _core = require("@folio/stripes/core");
9
9
  var _tagsConfig = require("../tagsConfig");
10
10
  const useTags = (namespaceArray, options) => {
11
11
  const ky = (0, _core.useOkapiKy)();
12
- const nsArray = namespaceArray !== null && namespaceArray !== void 0 ? namespaceArray : _tagsConfig.tagNamespaceArray;
12
+ const nsArray = namespaceArray ?? _tagsConfig.tagNamespaceArray;
13
13
  return (0, _reactQuery.useQuery)(nsArray, () => ky.get(_tagsConfig.defaultTagQuery).json(), options);
14
14
  };
15
15
  var _default = exports.default = useTags;
@@ -35,11 +35,10 @@ const useTagsEnabled = function () {
35
35
  const endpoint = useSettings ? _endpoints.SETTINGS_ENDPOINT : _endpoints.CONFIG_ENDPOINT;
36
36
  const query = useSettings ? TAGS_SETTINGS_QUERY : TAGS_CONFIG_QUERY;
37
37
  const queryKey = useSettings ? TAGS_ENABLED_QUERY_KEY : TAGS_ENABLED_CONFIG_QUERY_KEY;
38
- const queryObject = (0, _reactQuery.useQuery)(queryKey, () => ky.get("".concat(endpoint, "?").concat(query)).json());
38
+ const queryObject = (0, _reactQuery.useQuery)(queryKey, () => ky.get(`${endpoint}?${query}`).json());
39
39
  if (useSettings) {
40
- var _queryObject$data;
41
40
  // mod-settings returns this value as a boolean instead of as a string, so the below approach !value is not applicable.
42
- const value = queryObject === null || queryObject === void 0 || (_queryObject$data = queryObject.data) === null || _queryObject$data === void 0 || (_queryObject$data = _queryObject$data.items) === null || _queryObject$data === void 0 || (_queryObject$data = _queryObject$data[0]) === null || _queryObject$data === void 0 ? void 0 : _queryObject$data.value;
41
+ const value = queryObject?.data?.items?.[0]?.value;
43
42
  return value === undefined || value === null || value;
44
43
  }
45
44
  const {
@@ -7,4 +7,4 @@ exports.tagsPath = exports.tagNamespaceArray = exports.defaultTagsParams = expor
7
7
  const tagNamespaceArray = exports.tagNamespaceArray = ['tags', 'stripes-kint-components', 'Tags'];
8
8
  const tagsPath = exports.tagsPath = 'tags';
9
9
  const defaultTagsParams = exports.defaultTagsParams = ['limit=1000', 'query=cql.allRecords%3D1%20sortby%20label'];
10
- const defaultTagQuery = exports.defaultTagQuery = "".concat(tagsPath, "?").concat(defaultTagsParams === null || defaultTagsParams === void 0 ? void 0 : defaultTagsParams.join('&'));
10
+ const defaultTagQuery = exports.defaultTagQuery = `${tagsPath}?${defaultTagsParams?.join('&')}`;
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  var _react = require("react");
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
- var _get3 = _interopRequireDefault(require("lodash/get"));
10
+ var _get = _interopRequireDefault(require("lodash/get"));
11
11
  var _components = require("@folio/stripes/components");
12
12
  var _SearchField = _interopRequireDefault(require("../SearchField"));
13
13
  var _TypeDown = _interopRequireDefault(require("../../../styles/TypeDown.css"));
@@ -44,7 +44,7 @@ const Typedown = _ref => {
44
44
  // A way to pass any styles that need to be applied globally on selection
45
45
  uniqueIdentificationPath = 'id'
46
46
  } = _ref;
47
- const selectedUniqueId = (0, _get3.default)(input.value, uniqueIdentificationPath);
47
+ const selectedUniqueId = (0, _get.default)(input.value, uniqueIdentificationPath);
48
48
  const [selectedValue, setSelectedValue] = (0, _react.useState)(input.value); // Track what's been selected in state as well
49
49
 
50
50
  // Display data needs to be in line with data options but also able to react to default handleType
@@ -59,25 +59,18 @@ const Typedown = _ref => {
59
59
 
60
60
  // Setup default handleType
61
61
  const handleType = (0, _react.useCallback)(e => {
62
- var _e$target, _e$target2;
63
- const regex = new RegExp("".concat(e.target.value.toLowerCase()));
62
+ const regex = new RegExp(`${e.target.value.toLowerCase()}`);
64
63
  if (onType) {
65
64
  onType(e);
66
- } else if (filterPath && e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.value) {
67
- setDisplayData(dataOptions.filter(item => {
68
- var _get;
69
- return (_get = (0, _get3.default)(item, filterPath)) === null || _get === void 0 || (_get = _get.toLowerCase()) === null || _get === void 0 ? void 0 : _get.match(regex);
70
- }));
71
- } else if (e !== null && e !== void 0 && (_e$target2 = e.target) !== null && _e$target2 !== void 0 && _e$target2.value) {
72
- setDisplayData(dataOptions.filter(item => {
73
- var _get2;
74
- return (_get2 = (0, _get3.default)(item, uniqueIdentificationPath)) === null || _get2 === void 0 || (_get2 = _get2.toLowerCase()) === null || _get2 === void 0 ? void 0 : _get2.match(regex);
75
- }));
65
+ } else if (filterPath && e?.target?.value) {
66
+ setDisplayData(dataOptions.filter(item => (0, _get.default)(item, filterPath)?.toLowerCase()?.match(regex)));
67
+ } else if (e?.target?.value) {
68
+ setDisplayData(dataOptions.filter(item => (0, _get.default)(item, uniqueIdentificationPath)?.toLowerCase()?.match(regex)));
76
69
  } else {
77
70
  setDisplayData(dataOptions);
78
71
  }
79
72
  setCurrentlyTyped(e.target.value);
80
- if (displayData.length === 1 && (0, _get3.default)(displayData[0], filterPath) === e.target.value) {
73
+ if (displayData.length === 1 && (0, _get.default)(displayData[0], filterPath) === e.target.value) {
81
74
  setExactMatch(true);
82
75
  } else {
83
76
  setExactMatch(false);
@@ -111,7 +104,7 @@ const Typedown = _ref => {
111
104
  let optionIsSelected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
112
105
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
113
106
  className: _TypeDown.default.listItem,
114
- children: renderListItem ? renderListItem(option, currentlyTyped, exactMatch, optionIsSelected, selectedValue) : (0, _get3.default)(option, uniqueIdentificationPath)
107
+ children: renderListItem ? renderListItem(option, currentlyTyped, exactMatch, optionIsSelected, selectedValue) : (0, _get.default)(option, uniqueIdentificationPath)
115
108
  });
116
109
  }, [currentlyTyped, exactMatch, renderListItem, selectedValue, uniqueIdentificationPath]);
117
110
  const handleChange = (0, _react.useCallback)(value => {
@@ -122,10 +115,10 @@ const Typedown = _ref => {
122
115
  }
123
116
  }, [input, onChange]);
124
117
  const renderTypedownTrigger = () => {
125
- const triggerComponentId = "typedown-trigger-".concat((0, _selectorSafe.default)(input.name));
118
+ const triggerComponentId = `typedown-trigger-${(0, _selectorSafe.default)(input.name)}`;
126
119
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
127
120
  ref: triggerRef,
128
- id: "typedown-parent-".concat((0, _selectorSafe.default)(input.name), "-trigger"),
121
+ id: `typedown-parent-${(0, _selectorSafe.default)(input.name)}-trigger`,
129
122
  children: renderTrigger ? renderTrigger({
130
123
  // Pass all props in that searchfield uses.
131
124
  handleType,
@@ -152,14 +145,14 @@ const Typedown = _ref => {
152
145
  const dropDown = (0, _react.useCallback)(() => {
153
146
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
154
147
  className: _TypeDown.default.dropdownMenu,
155
- id: "typedown-parent-".concat((0, _selectorSafe.default)(input.name), "-menu"),
148
+ id: `typedown-parent-${(0, _selectorSafe.default)(input.name)}-menu`,
156
149
  style: {
157
- '--searchWidth': "".concat(searchWidth, "px")
150
+ '--searchWidth': `${searchWidth}px`
158
151
  },
159
152
  children: [renderHeader && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
160
153
  ref: headerRef,
161
154
  className: _TypeDown.default.header,
162
- id: "typedown-header-".concat((0, _selectorSafe.default)(input.name)),
155
+ id: `typedown-header-${(0, _selectorSafe.default)(input.name)}`,
163
156
  children: renderHeader({
164
157
  currentlyTyped,
165
158
  displayData,
@@ -176,13 +169,13 @@ const Typedown = _ref => {
176
169
  * This does NOT prevent item click, as e.propagation is not prevented.
177
170
  */,
178
171
  onMouseDown: e => e.preventDefault(),
179
- children: displayData !== null && displayData !== void 0 && displayData.length ? displayData === null || displayData === void 0 ? void 0 : displayData.map((d, _index) => {
180
- const isSelectedEval = isSelected ? isSelected(input.value, d) : (0, _get3.default)(input.value, uniqueIdentificationPath) === (0, _get3.default)(d, uniqueIdentificationPath);
181
- const selectedCSS = selectedStyles !== null && selectedStyles !== void 0 ? selectedStyles : _TypeDown.default.selectedMenuButton;
182
- const uniqueButtonKey = "typedown-button-[".concat((0, _get3.default)(d, uniqueIdentificationPath), "]");
172
+ children: displayData?.length ? displayData?.map((d, _index) => {
173
+ const isSelectedEval = isSelected ? isSelected(input.value, d) : (0, _get.default)(input.value, uniqueIdentificationPath) === (0, _get.default)(d, uniqueIdentificationPath);
174
+ const selectedCSS = selectedStyles ?? _TypeDown.default.selectedMenuButton;
175
+ const uniqueButtonKey = `typedown-button-[${(0, _get.default)(d, uniqueIdentificationPath)}]`;
183
176
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
184
177
  className: (0, _classnames.default)(_TypeDown.default.fullWidth, _TypeDown.default.menuButton, {
185
- ["".concat(selectedCSS)]: isSelectedEval
178
+ [`${selectedCSS}`]: isSelectedEval
186
179
  }),
187
180
  "data-selected": isSelectedEval,
188
181
  id: uniqueButtonKey,
@@ -197,7 +190,7 @@ const Typedown = _ref => {
197
190
  }), renderFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
198
191
  ref: footerRef,
199
192
  className: _TypeDown.default.footer,
200
- id: "typedown-footer-".concat((0, _selectorSafe.default)(input.name)),
193
+ id: `typedown-footer-${(0, _selectorSafe.default)(input.name)}`,
201
194
  children: renderFooter(displayData, currentlyTyped, exactMatch)
202
195
  })]
203
196
  });
@@ -226,7 +219,7 @@ const Typedown = _ref => {
226
219
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
227
220
  ref: resizeRef,
228
221
  className: (0, _classnames.default)(_TypeDown.default.typedown, className),
229
- id: "typedown-id-".concat(id),
222
+ id: `typedown-id-${id}`,
230
223
  children: [renderTypedownTrigger(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Popper, {
231
224
  anchorRef: triggerRef,
232
225
  className: (0, _classnames.default)(_TypeDown.default.dropdown, _TypeDown.default.fullWidth),