@k-int/stripes-kint-components 4.1.0 → 4.3.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 (293) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/es/__mocks__/@folio/stripes/components.js +26 -0
  3. package/es/__mocks__/@folio/stripes/core.js +10 -0
  4. package/es/__mocks__/@folio/stripes/smart-components.js +10 -0
  5. package/es/__mocks__/currency-codes/data.js +6 -0
  6. package/es/__mocks__/react-query.js +10 -0
  7. package/es/__mocks__/react-router-dom.js +10 -0
  8. package/es/__mocks__/stripes-config.js +4 -0
  9. package/es/index.js +72 -108
  10. package/es/lib/ActionList/ActionList.js +7 -2
  11. package/es/lib/ActionList/ActionListFieldArray.js +28 -17
  12. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +5 -2
  13. package/es/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +0 -1
  14. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +6 -4
  15. package/es/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +1 -2
  16. package/es/lib/CustomProperties/Config/CustomPropertyForm.js +1 -1
  17. package/es/lib/CustomProperties/Config/CustomPropertyForm.test.js +7 -6
  18. package/es/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -2
  19. package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +0 -1
  20. package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +0 -1
  21. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +5 -3
  22. package/es/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +3 -4
  23. package/es/lib/CustomProperties/Edit/CustomPropertyField.js +3 -1
  24. package/es/lib/CustomProperties/Edit/CustomPropertyField.test.js +11 -10
  25. package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +0 -1
  26. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +5 -2
  27. package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +1 -2
  28. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +5 -2
  29. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +2 -3
  30. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +3 -4
  31. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +4 -1
  32. package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +5 -4
  33. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +4 -1
  34. package/es/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +3 -4
  35. package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +1 -1
  36. package/es/lib/CustomProperties/View/CustomPropertiesView.test.js +0 -1
  37. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +1 -1
  38. package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +4 -2
  39. package/es/lib/CycleButton/CycleButton.js +5 -2
  40. package/es/lib/EditableRefdataCategoryList/EditableRefdataCategoryList.js +6 -4
  41. package/es/lib/EditableRefdataList/EditableRefdataList.js +19 -8
  42. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +4 -1
  43. package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +6 -7
  44. package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +10 -11
  45. package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -2
  46. package/es/lib/EditableSettingsList/SettingField/SettingField.js +4 -2
  47. package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +4 -5
  48. package/es/lib/FormModal/FormModal.js +4 -1
  49. package/es/lib/FormattedKintMessage/FormattedKintMessage.js +4 -1
  50. package/es/lib/IconSelect/IconSelect.js +4 -2
  51. package/es/lib/QueryTypedown/QueryTypedown.js +4 -2
  52. package/es/lib/RefdataButtons/RefdataButtons.js +4 -1
  53. package/es/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +25 -11
  54. package/es/lib/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js +1 -1
  55. package/es/lib/RichSelect/RichSelect.js +5 -2
  56. package/es/lib/RichSelect/useSelectedOption.js +1 -1
  57. package/es/lib/SASQLookupComponent/SASQLookupComponent.js +34 -18
  58. package/es/lib/SASQLookupComponent/TableBody/TableBody.js +4 -1
  59. package/es/lib/SASQRoute/SASQRoute.js +4 -1
  60. package/es/lib/SASQViewComponent/SASQViewComponent.js +4 -1
  61. package/es/lib/SearchField/SearchField.js +4 -1
  62. package/es/lib/Typedown/Typedown.js +1 -1
  63. package/es/lib/hooks/settingsHooks/useSettings.js +4 -1
  64. package/es/lib/hooks/typedownHooks/useTypedownData.js +1 -1
  65. package/es/lib/hooks/typedownHooks/useTypedownToggle.js +1 -1
  66. package/es/lib/hooks/useActiveElement.js +1 -1
  67. package/es/lib/hooks/useCustomProperties.js +4 -1
  68. package/es/lib/hooks/useHelperApp.js +4 -2
  69. package/es/lib/hooks/useIntlKeyStore.js +6 -7
  70. package/es/lib/hooks/useKintIntl.js +4 -1
  71. package/es/lib/hooks/useKiwtFieldArray.js +5 -2
  72. package/es/lib/hooks/useKiwtSASQuery.js +4 -2
  73. package/es/lib/hooks/useLocalStorageState.js +1 -1
  74. package/es/lib/hooks/useMutateCustomProperties.js +1 -1
  75. package/es/lib/hooks/useMutateRefdataCategory.js +4 -2
  76. package/es/lib/hooks/useMutateRefdataValue.js +1 -1
  77. package/es/lib/hooks/useQIndex.js +4 -2
  78. package/es/lib/utils/generateKiwtQueryParams.js +71 -37
  79. package/es/lib/utils/groupCustomPropertiesByCtx.js +4 -1
  80. package/es/lib/utils/highlightString.js +1 -1
  81. package/es/lib/utils/index.js +7 -0
  82. package/es/lib/utils/parseErrorResponse.js +23 -19
  83. package/es/lib/utils/parseKiwtQueryGroups.js +66 -0
  84. package/jest.config.js +1 -1
  85. package/junit.xml +146 -146
  86. package/package.json +4 -4
  87. package/src/__mocks__/@folio/stripes/components.js +11 -0
  88. package/src/__mocks__/@folio/stripes/core.js +6 -0
  89. package/src/__mocks__/@folio/stripes/smart-components.js +6 -0
  90. package/src/__mocks__/currency-codes/data.js +4 -0
  91. package/src/__mocks__/react-query.js +6 -0
  92. package/src/__mocks__/react-router-dom.js +7 -0
  93. package/src/__mocks__/stripes-config.js +3 -0
  94. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +1 -1
  95. package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +49 -7
  96. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +7 -7
  97. package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
  98. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
  99. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
  100. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
  101. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyView.js.html +1 -1
  102. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +1 -1
  103. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
  104. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/testResources.js.html +793 -0
  105. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
  106. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
  107. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertiesListField.js.html +6 -9
  108. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
  109. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
  110. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.html +10 -10
  111. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/index.js.html +1 -1
  112. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Edit/testResources.js.html +1 -1
  113. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
  114. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
  115. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
  116. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
  117. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
  118. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.html +1 -1
  119. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/index.js.html +1 -1
  120. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/testResources.js.html +1 -1
  121. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useOperators.js.html +1 -1
  122. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
  123. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Filter/useValueProps.js.html +1 -1
  124. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesView.js.html +1 -1
  125. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
  126. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/CustomPropertyCard.js.html +1 -1
  127. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.html +1 -1
  128. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/index.js.html +1 -1
  129. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/View/testResources.js.html +1 -1
  130. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.html +1 -1
  131. package/src/artifacts/coverage-jest/lcov-report/CustomProperties/index.js.html +1 -1
  132. package/src/artifacts/coverage-jest/lcov-report/CycleButton/CycleButton.js.html +1 -1
  133. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.html +1 -1
  134. package/src/artifacts/coverage-jest/lcov-report/CycleButton/index.js.html +1 -1
  135. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
  136. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.html +1 -1
  137. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataCategoryList/index.js.html +1 -1
  138. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +1 -1
  139. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +1 -1
  140. package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
  141. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +1 -1
  142. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +1 -1
  143. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +1 -1
  144. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +1 -1
  145. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +1 -1
  146. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +1 -1
  147. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
  148. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +1 -1
  149. package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
  150. package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +1 -1
  151. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +1 -1
  152. package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
  153. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
  154. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.html +1 -1
  155. package/src/artifacts/coverage-jest/lcov-report/FormattedKintMessage/index.js.html +1 -1
  156. package/src/artifacts/coverage-jest/lcov-report/IconSelect/IconSelect.js.html +28 -22
  157. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.html +1 -1
  158. package/src/artifacts/coverage-jest/lcov-report/IconSelect/index.js.html +1 -1
  159. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
  160. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
  161. package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
  162. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
  163. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
  164. package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
  165. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +1 -1
  166. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
  167. package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
  168. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +48 -12
  169. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.html +9 -9
  170. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/index.js.html +1 -1
  171. package/src/artifacts/coverage-jest/lcov-report/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
  172. package/src/artifacts/coverage-jest/lcov-report/RichSelect/RichSelect.js.html +5 -2
  173. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.html +1 -1
  174. package/src/artifacts/coverage-jest/lcov-report/RichSelect/index.js.html +1 -1
  175. package/src/artifacts/coverage-jest/lcov-report/RichSelect/useSelectedOption.js.html +1 -1
  176. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +103 -25
  177. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
  178. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.html +1 -1
  179. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/TableBody/index.js.html +1 -1
  180. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +9 -9
  181. package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
  182. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
  183. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
  184. package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
  185. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
  186. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
  187. package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
  188. package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
  189. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
  190. package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
  191. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +1 -1
  192. package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
  193. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +1 -1
  194. package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
  195. package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
  196. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
  197. package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
  198. package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
  199. package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
  200. package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
  201. package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +1 -1
  202. package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
  203. package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
  204. package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +1 -1
  205. package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +1 -1
  206. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +1 -1
  207. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +1 -1
  208. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useAppSettings.js.html +1 -1
  209. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +1 -1
  210. package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +1 -1
  211. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
  212. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
  213. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
  214. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
  215. package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
  216. package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
  217. package/src/artifacts/coverage-jest/lcov-report/hooks/useAvailableCustomProperties.js.html +205 -0
  218. package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
  219. package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +1 -1
  220. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKey.js.html +1 -1
  221. package/src/artifacts/coverage-jest/lcov-report/hooks/useIntlKeyStore.js.html +2 -2
  222. package/src/artifacts/coverage-jest/lcov-report/hooks/useInvalidateRefdata.js.html +1 -1
  223. package/src/artifacts/coverage-jest/lcov-report/hooks/useKintIntl.js.html +1 -1
  224. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
  225. package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +1 -1
  226. package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
  227. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
  228. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataCategory.js.html +1 -1
  229. package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +1 -1
  230. package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
  231. package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +1 -1
  232. package/src/artifacts/coverage-jest/lcov-report/hooks/useSASQQueryMeta.js.html +1 -1
  233. package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
  234. package/src/artifacts/coverage-jest/lcov-report/index.html +35 -35
  235. package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
  236. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +8 -8
  237. package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +196 -46
  238. package/src/artifacts/coverage-jest/lcov-report/utils/groupCustomPropertiesByCtx.js.html +1 -1
  239. package/src/artifacts/coverage-jest/lcov-report/utils/highlightString.js.html +1 -1
  240. package/src/artifacts/coverage-jest/lcov-report/utils/index.html +44 -29
  241. package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +8 -2
  242. package/src/artifacts/coverage-jest/lcov-report/utils/matchString.js.html +1 -1
  243. package/src/artifacts/coverage-jest/lcov-report/utils/parseErrorResponse.js.html +11 -8
  244. package/src/artifacts/coverage-jest/lcov-report/utils/parseKiwtQueryGroups.js.html +280 -0
  245. package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
  246. package/src/artifacts/coverage-jest/lcov-report/utils/refdataQueryKey.js.html +1 -1
  247. package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +166 -0
  248. package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +1 -1
  249. package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +1 -1
  250. package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +1 -1
  251. package/src/artifacts/coverage-jest/lcov-report/utils/typedownQueryKey.js.html +1 -1
  252. package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +1 -1
  253. package/src/artifacts/coverage-jest/lcov.info +562 -425
  254. package/src/index.js +2 -25
  255. package/src/lib/ActionList/ActionList.js +2 -0
  256. package/src/lib/ActionList/ActionListFieldArray.js +29 -10
  257. package/src/lib/ActionList/README.md +2 -2
  258. package/src/lib/CustomProperties/Config/CustomPropertiesLookup.test.js +1 -1
  259. package/src/lib/CustomProperties/Config/CustomPropertiesSettings.test.js +1 -1
  260. package/src/lib/CustomProperties/Config/CustomPropertyForm.test.js +2 -2
  261. package/src/lib/CustomProperties/Config/CustomPropertyView.test.js +1 -1
  262. package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.test.js +1 -1
  263. package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.test.js +1 -1
  264. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +0 -1
  265. package/src/lib/CustomProperties/Edit/CustomPropertiesListField.test.js +2 -2
  266. package/src/lib/CustomProperties/Edit/CustomPropertyField.test.js +2 -2
  267. package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.test.js +1 -1
  268. package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.test.js +1 -1
  269. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.test.js +2 -2
  270. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.test.js +2 -2
  271. package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.test.js +1 -1
  272. package/src/lib/CustomProperties/Filter/CustomPropertiesRule.test.js +2 -2
  273. package/src/lib/CustomProperties/View/CustomPropertiesView.test.js +1 -1
  274. package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.test.js +1 -1
  275. package/src/lib/EditableRefdataList/EditableRefdataList.js +16 -3
  276. package/src/lib/EditableRefdataList/README.md +1 -0
  277. package/src/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +2 -2
  278. package/src/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +2 -2
  279. package/src/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -1
  280. package/src/lib/EditableSettingsList/SettingField/SettingField.test.js +2 -2
  281. package/src/lib/ResponsiveButtonGroup/README.md +1 -0
  282. package/src/lib/ResponsiveButtonGroup/ResponsiveButtonGroup.js +17 -5
  283. package/src/lib/SASQLookupComponent/SASQLookupComponent.js +44 -18
  284. package/src/lib/hooks/useIntlKeyStore.js +1 -1
  285. package/src/lib/utils/generateKiwtQueryParams.js +74 -38
  286. package/src/lib/utils/index.js +2 -0
  287. package/src/lib/utils/parseErrorResponse.js +3 -2
  288. package/src/lib/utils/parseKiwtQueryGroups.js +65 -0
  289. package/styles/ResponsiveButtonGroup.css +12 -1
  290. package/styles/TypeDown.css +37 -2
  291. package/test/helpers/translationsProperties.js +3 -34
  292. package/test/jest/helpers/KintHarness.js +1 -1
  293. package/yarn-error.log +0 -147
package/src/index.js CHANGED
@@ -20,31 +20,8 @@ export {
20
20
  useSASQQueryMeta
21
21
  } from './lib/hooks';
22
22
 
23
- // Useful utility functions
24
- export {
25
- boldString,
26
- generateKiwtQuery,
27
- generateKiwtQueryParams,
28
- groupCustomPropertiesByCtx,
29
- highlightString,
30
- matchString,
31
- refdataOptions,
32
- refdataQueryKey,
33
- selectorSafe,
34
- typedownQueryKey,
35
- parseErrorResponse,
36
- } from './lib/utils';
37
-
38
- // Validators
39
- export {
40
- composeValidators,
41
- composeValidatorsWithArgs,
42
- invalidNumber,
43
- rangeOverflow,
44
- rangeUnderflow,
45
- required,
46
- requiredObject,
47
- } from './lib/utils';
23
+ // Useful utility stuff
24
+ export * from './lib/utils';
48
25
 
49
26
  // Contexts
50
27
  export {
@@ -16,6 +16,7 @@ const propTypes = {
16
16
  defaultNewObject: PropTypes.object,
17
17
  editableFields: PropTypes.object,
18
18
  fieldComponents: PropTypes.object,
19
+ fieldProps: PropTypes.object,
19
20
  hideCreateButton: PropTypes.bool,
20
21
  intlKey: PropTypes.string,
21
22
  intlNS: PropTypes.string,
@@ -37,6 +38,7 @@ const ActionList = forwardRef(({
37
38
  defaultNewObject = {},
38
39
  editableFields = {},
39
40
  fieldComponents = {},
41
+ fieldProps = {},
40
42
  hideCreateButton,
41
43
  intlKey: passedIntlKey,
42
44
  intlNS: passedIntlNS,
@@ -279,8 +279,15 @@ const ActionListFieldArray = forwardRef(({
279
279
  action={action}
280
280
  aria-describedby={ariaIds.sub}
281
281
  aria-labelledby={ariaIds.text}
282
- disabled={editing}
283
- onClick={() => (actionFunction ? actionFunction() : () => null)}
282
+ disabled={!!editing}
283
+ onClick={e => {
284
+ e.stopPropagation();
285
+ if (actionFunction) {
286
+ return actionFunction();
287
+ }
288
+
289
+ return null;
290
+ }}
284
291
  to={action.to}
285
292
  />
286
293
  )}
@@ -294,8 +301,15 @@ const ActionListFieldArray = forwardRef(({
294
301
  key={`action-${action.name}[${data.rowIndex}]`}
295
302
  action={action}
296
303
  ariaLabel={ariaLabel}
297
- disabled={editing}
298
- onClick={() => (actionFunction ? actionFunction() : () => null)}
304
+ disabled={!!editing}
305
+ onClick={e => {
306
+ e.stopPropagation();
307
+ if (actionFunction) {
308
+ return actionFunction();
309
+ }
310
+
311
+ return null;
312
+ }}
299
313
  to={action.to}
300
314
  />
301
315
  );
@@ -350,13 +364,18 @@ const ActionListFieldArray = forwardRef(({
350
364
  (!cd.id && createFunction(cd)) ||
351
365
  (!!cd.id && editFunction(cd))
352
366
  ) {
353
- const validateFunction = validateFields?.[key] ? validateFields?.[key](cd) : null;
354
-
367
+ const passedObject = {
368
+ allValues: values,
369
+ index: cd?.fieldIndex,
370
+ key,
371
+ name: `${cd.fieldName}.${key}`,
372
+ rowFieldName: cd.fieldName
373
+ };
374
+
375
+ const validateFunction = validateFields?.[key] ? validateFields?.[key](passedObject) : null;
355
376
  returnValue =
356
377
  fieldComponents[key] ?
357
- fieldComponents[key]({
358
- name: `${cd.fieldName}.${key}`
359
- }) :
378
+ fieldComponents[key](passedObject) :
360
379
  <Field
361
380
  autoFocus={autoFocus}
362
381
  component={TextField}
@@ -386,7 +405,7 @@ const ActionListFieldArray = forwardRef(({
386
405
  </Headline>
387
406
  {!hideCreateButton &&
388
407
  <Button
389
- disabled={editing || !createCallback}
408
+ disabled={!!editing || !createCallback}
390
409
  marginBottom0
391
410
  onClick={handleClickCreate}
392
411
  >
@@ -99,10 +99,10 @@ creatableFields | object\<function> | An object with keys from the `visibleField
99
99
  createCallback | function | A callback to be used for the built in "create" action (ie "save" on a new row). Will be prioritised ahead of a `create` entry in the deprecated actionCalls prop. | {} | ✕ |
100
100
  defaultNewObject | object | An object to use when pushing a new entry into the ActionList fields, acting as a way to bootstrap defaults into new items | {} | ✕ |
101
101
  editableFields | object\<function> | An object with keys from the `visibleFields` array, and values of functions which take the entire row object and return a boolean indicating whether that field is editable or not. No key for a given field will be interpreted as () => true, so a field is editable by default. | | ✕ |
102
- fieldComponents | object\<function> | An object with keys from the `visibleFields` array, and values of functions which take some `fieldProps` (currently only the name of the field `name`), and returns a Field component to be used in "edit mode" for the visible field specified. | | ✕ |
102
+ fieldComponents | object\<function> | An object with keys from the `visibleFields` array, and values of functions which take some `fieldProps` (`allValues`: The full form values, `index`: The current fieldIndex of the editing row, `key`: The object property in question, `name`: The field name for the Field component to glue properly into final-form, `rowFieldName`: The field name in final-form for the whole row object.), and returns a Field component to be used in "edit mode" for the visible field specified. | | ✕ |
103
103
  formatter | object\<function> | A "formatter" object that takes the same shape as an MCL formatter, and is used in the same way whilst a row is NOT being edited. While editing a given row, this formatter entry is ignored. | | ✕ |
104
104
  hideCreateButton | boolean | A simple bool to hide the create button. Default behaviour without create action is disabled. | false | ✕ |
105
105
  onRowClick | function | A function accepting an event and the row data, fired on row click. The presence of this prop will cause the MCL to take on the interactive styling | | ✕ |
106
- validateFields | object\<function> | An object with keys from the `visibleFields` array, and values of functions which take the entire row object and either return a validate function for final-form, or null | | ✕ |
106
+ validateFields | object\<function> | An object with keys from the `visibleFields` array, and values of functions which take the entire row object and either return a validate function for final-form, or null. The validate function will be passed the same properties as fieldComponents, above. THESE WILL NOT BE USED if fieldComponents are defined for the same key. | | ✕ |
107
107
  visibleFields | array\<String> | An array of strings corresponding to those fields to be displayed in the rendered MultiColumnList | | ✓ |
108
108
  ...mclProps | any | Any other props supplied to ActionList will be applied to the MCL directly. *WARNING* Some MCL props may override important functionality within ActionList | | ✕ |
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { MemoryRouter } from 'react-router-dom';
4
4
 
5
5
  import CustomPropertiesLookup from './CustomPropertiesLookup';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { Button, Pane, PaneHeader } from '@folio/stripes-testing';
4
4
  import { MemoryRouter } from 'react-router-dom';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { TextArea, TextField } from '@folio/stripes-testing';
4
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
4
+ import { TestForm } from '@folio/stripes-erm-testing';
5
5
 
6
6
  import refdata from '../../../../test/jest/refdata';
7
7
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { MemoryRouter } from 'react-router-dom';
4
4
  import { KeyValue } from '@folio/stripes-testing';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { waitFor } from '@testing-library/react';
4
4
 
5
5
  import { MemoryRouter } from 'react-router-dom';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { waitFor } from '@testing-library/react';
4
4
 
5
5
  import { MemoryRouter } from 'react-router-dom';
@@ -41,7 +41,6 @@ const CustomPropertiesList = ({
41
41
  customProperty => value[customProperty.value] !== undefined
42
42
  ));
43
43
  }
44
- return null;
45
44
  }, [availableCustomProperties, dirtying, pristine, value]);
46
45
 
47
46
  const handleDeleteCustomProperty = (customProperty, i) => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { Button, KeyValue } from '@folio/stripes-testing';
4
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
4
+ import { TestForm } from '@folio/stripes-erm-testing';
5
5
  import { waitFor } from '@testing-library/react';
6
6
 
7
7
  import { initialValues } from './testResources';
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { TextArea, MultiSelect, TextInput, Datepicker } from '@folio/stripes-testing';
4
4
 
5
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
5
+ import { TestForm } from '@folio/stripes-erm-testing';
6
6
  import CustomPropertyField from './CustomPropertyField';
7
7
 
8
8
  import { availableCustomProperties, customProperties, renderWithKintHarness } from '../../../../test/jest';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
 
4
4
  import CustomPropertyFormCard from './CustomPropertyFormCard';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { MemoryRouter } from 'react-router-dom';
4
4
  import { Accordion, Button } from '@folio/stripes-testing';
5
5
 
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { FieldArray } from 'react-final-form-arrays';
3
3
 
4
- import '@folio/stripes-erm-components/test/jest/__mock__';
5
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
4
+
5
+ import { TestForm } from '@folio/stripes-erm-testing';
6
6
  import { MemoryRouter } from 'react-router-dom';
7
7
 
8
8
  import CustomPropertiesFilterField from './CustomPropertiesFilterField';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
3
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
2
+
3
+ import { TestForm } from '@folio/stripes-erm-testing';
4
4
  import { waitFor } from '@testing-library/react';
5
5
  import { Button } from '@folio/stripes-testing';
6
6
  import { FieldArray } from 'react-final-form-arrays';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { Button } from '@folio/stripes-testing';
4
4
  import CustomPropertyFiltersForm from './CustomPropertiesFilterForm';
5
5
 
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { MemoryRouter } from 'react-router-dom';
4
4
  import { Select } from '@folio/stripes-testing';
5
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
5
+ import { TestForm } from '@folio/stripes-erm-testing';
6
6
 
7
7
  import CustomPropertiesRule from './CustomPropertiesRule';
8
8
  import { renderWithKintHarness } from '../../../../test/jest';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { waitFor } from '@testing-library/react';
4
4
  import { MemoryRouter } from 'react-router-dom';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import { MemoryRouter } from 'react-router-dom';
4
4
  import { waitFor } from '@testing-library/react';
5
5
 
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useState, useContext } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import get from 'lodash/get';
3
4
 
4
5
  import { ConfirmationModal } from '@folio/stripes/components';
5
6
  import { CalloutContext } from '@folio/stripes/core';
@@ -8,10 +9,11 @@ import { useKintIntl, useMutateRefdataValue, useRefdata } from '../hooks';
8
9
 
9
10
  import ActionList from '../ActionList';
10
11
  import { required } from '../utils/validators';
11
- import { parseErrorResponse } from '../utils';
12
+ import { parseErrorResponse, selectorSafe } from '../utils';
12
13
 
13
14
  const propTypes = {
14
15
  afterQueryCalls: PropTypes.object,
16
+ allowSpecial: PropTypes.bool,
15
17
  catchQueryCalls: PropTypes.object,
16
18
  desc: PropTypes.string,
17
19
  intlKey: PropTypes.string,
@@ -26,6 +28,7 @@ const propTypes = {
26
28
 
27
29
  const EditableRefdataList = ({
28
30
  afterQueryCalls,
31
+ allowSpecial = false, // special characters will be directly stripped out of the value before it is sent to the backend
29
32
  catchQueryCalls,
30
33
  desc,
31
34
  intlKey: passedIntlKey,
@@ -170,13 +173,23 @@ const EditableRefdataList = ({
170
173
  creatableFields={{
171
174
  value: () => false
172
175
  }}
173
- createCallback={refdata?.internal ? null : (data) => editRefdataValue(data)}
176
+ createCallback={
177
+ refdata?.internal ?
178
+ null :
179
+ (data) => {
180
+ if (allowSpecial) {
181
+ editRefdataValue(data);
182
+ } else {
183
+ editRefdataValue({ ...data, value: selectorSafe(data?.label)?.replaceAll('%20', ' ') });
184
+ }
185
+ }
186
+ }
174
187
  editableFields={{
175
188
  value: () => false
176
189
  }}
177
190
  label={label}
178
191
  validateFields={{
179
- label: () => required
192
+ label: required
180
193
  }}
181
194
  visibleFields={['label', 'value']}
182
195
  />
@@ -18,6 +18,7 @@ import { EditableRefdataList } from '@k-int/stripes-kint-components';
18
18
  Name | Type | Description | default | required
19
19
  --- | --- | --- | --- | ---
20
20
  afterQueryCalls | object | An object of the form `{delete: func1, put: func2}` where `func1`/`func2` are functions to be called after the `delete`/`put`. | | ✕ |
21
+ allowSpecial | boolean | A boolean to turn off/on the stripping out of special characters and replacing them with `_`. Generally turning this on will cause problems with queries to KIWT endpoints and internally with Stripes filters, where a refdata value includes `&&`, `||`, `\` or `"`. | false | ✕ |
21
22
  catchQueryCalls | object | An object of the form `{delete: func1, put: func2}` where `func1`/`func2` are functions to be called with a HTTPError object when the `delete`/`put` calls fail. | `{delete: <Fires a callout of the format "<strong>Error: {label}</strong> was not deleted. {error}">}` | | ✕ |
22
23
  labelOverrides | object | An object containing translation overrides. Currently accepts: `deleteError: (err, object) => { ... output a callout message }`. | | ✕ |
23
24
  desc | String | A string corresponding to the refdataValue category, usually of the form `DomainClass.Field`. See `useRefdata` for more information. | | ✕ |
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
3
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
2
+
3
+ import { TestForm } from '@folio/stripes-erm-testing';
4
4
  import { FieldArray } from 'react-final-form-arrays';
5
5
  import EditableSettingsListFieldArray from './EditableSettingsListFieldArray';
6
6
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
- import '@folio/stripes-erm-components/test/jest/__mock__';
4
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
3
+
4
+ import { TestForm } from '@folio/stripes-erm-testing';
5
5
 
6
6
  import EditSettingValue from './EditSettingValue';
7
7
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
  import RenderSettingValue from './RenderSettingValue';
4
4
 
5
5
  import { renderWithKintHarness } from '../../../../test/jest/helpers';
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import '@folio/stripes-erm-components/test/jest/__mock__';
2
+
3
3
 
4
4
  import { waitFor } from '@testing-library/react';
5
5
 
6
- import { TestForm } from '@folio/stripes-erm-components/test/jest/helpers';
6
+ import { TestForm } from '@folio/stripes-erm-testing';
7
7
  import { Button } from '@folio/stripes-testing';
8
8
  import { Field } from 'react-final-form';
9
9
  import SettingField from './SettingField';
@@ -26,6 +26,7 @@ Name | type | description | default | required
26
26
  --- | --- | --- | --- | ---
27
27
  children | | Set of `<Button>`s. | |
28
28
  className | string | Add a custom className to ButtonGroup | |
29
+ dropdownTriggerProps | object | Extra props to pass to the Stripes Button which triggers the dropdown menu. | |
29
30
  fullWidth | bool | Forces the button group width to 100% |
30
31
  selectedIndex | integer | Allows the implementor to pass off "primary" style management to the component. This will style the requisite index as 'primary', if that index is not hidden, or the dropdown menu if it is. |
31
32
  tagName | string | Set the HTML tag used to wrap the button set. | 'div' |
@@ -17,7 +17,9 @@ import useResponsiveButtonGroupSizing from './useResponsiveButtonGroupSizing';
17
17
  const propTypes = {
18
18
  children: PropTypes.node,
19
19
  className: PropTypes.string,
20
+ dropdownTriggerProps: PropTypes.object,
20
21
  fullWidth: PropTypes.bool,
22
+ marginBottom0: PropTypes.bool,
21
23
  selectedIndex: PropTypes.number,
22
24
  tagName: PropTypes.string,
23
25
  };
@@ -43,7 +45,9 @@ const ResponsiveButtonGroup = (props) => {
43
45
  const {
44
46
  children: childButtons, // These MUST consist only of Button components
45
47
  className,
48
+ dropdownTriggerProps = {},
46
49
  fullWidth = false, // Only bother with this when buttonGroupWidth < ContainerWidth
50
+ marginBottom0, // Will ONLL control the margin of the dropdown button
47
51
  selectedIndex,
48
52
  tagName: Tag = 'div',
49
53
  ...rest
@@ -61,21 +65,29 @@ const ResponsiveButtonGroup = (props) => {
61
65
 
62
66
  const buttonThreshold = calculateCumulativeThreshold(cachedSizeArray, containerWidth);
63
67
 
64
- const renderActionMenuToggle = useCallback(({ onToggle, triggerRef, keyHandler, open, ariaProps, getTriggerProps }) => (
68
+ const renderActionMenuToggle = useCallback(({ displayButtons, onToggle, triggerRef, keyHandler, open, ariaProps, getTriggerProps }) => (
65
69
  <Button
66
70
  ref={triggerRef}
67
- buttonClass={css.dropdownButtonClass}
71
+ aria-label="menu"
72
+ buttonClass={
73
+ classnames(
74
+ css.width100,
75
+ { [`${css.dropdownButtonClass}`]: (displayButtons?.length ?? 0) > 0 },
76
+ { [`${css.marginBottom}`]: !marginBottom0 },
77
+ { [`${css.marginBottom0}`]: marginBottom0 }
78
+ )
79
+ }
68
80
  buttonStyle={selectedIndex > buttonThreshold ? 'primary' : 'default'}
69
- marginBottom0
70
81
  onClick={onToggle}
71
82
  onKeyDown={keyHandler}
72
83
  type="button"
73
84
  {...getTriggerProps()}
74
85
  {...ariaProps}
86
+ {...dropdownTriggerProps}
75
87
  >
76
88
  <Icon icon={open ? 'triangle-up' : 'triangle-down'} iconPosition="end" />
77
89
  </Button>
78
- ), [buttonThreshold, selectedIndex]);
90
+ ), [buttonThreshold, dropdownTriggerProps, marginBottom0, selectedIndex]);
79
91
 
80
92
  const displayButtons = useMemo(() => (
81
93
  buttons?.slice(0, buttonThreshold + 1)?.map((button, index) => {
@@ -110,7 +122,7 @@ const ResponsiveButtonGroup = (props) => {
110
122
  key="responsiveButtonGroup-dropdown-toggle"
111
123
  className={css.dropdownClass}
112
124
  renderMenu={renderActionMenuContent}
113
- renderTrigger={renderActionMenuToggle}
125
+ renderTrigger={(triggerProps) => renderActionMenuToggle({ displayButtons, ...triggerProps })}
114
126
  />
115
127
  ]
116
128
  ), [displayButtons, renderActionMenuContent, renderActionMenuToggle]);
@@ -10,13 +10,14 @@ import {
10
10
  } from '@folio/stripes/core';
11
11
 
12
12
  import {
13
+ CollapseFilterPaneButton,
14
+ ExpandFilterPaneButton,
13
15
  SearchAndSortQuery,
14
16
  PersistedPaneset,
15
17
  } from '@folio/stripes/smart-components';
16
18
 
17
19
  import {
18
20
  Button,
19
- IconButton,
20
21
  Icon,
21
22
  Pane,
22
23
  PaneMenu,
@@ -137,6 +138,27 @@ const SASQLookupComponent = forwardRef((props, ref) => {
137
138
 
138
139
  const Body = RenderBody ?? TableBody;
139
140
 
141
+ const {
142
+ filterPaneFirstMenu,
143
+ filterPaneLastMenu,
144
+ ...restOfFilterPaneProps
145
+ } = filterPaneProps;
146
+ const {
147
+ mainPaneFirstMenu,
148
+ mainPaneLastMenu,
149
+ ...restOfMainPaneProps
150
+ } = mainPaneProps;
151
+
152
+ const internalStateProps = {
153
+ activeFilters,
154
+ filterCount,
155
+ filterPaneVisible,
156
+ searchChanged,
157
+ searchValue,
158
+ setFilterPaneVisible,
159
+ toggleFilterPane
160
+ };
161
+
140
162
  return (
141
163
  <PersistedPaneset
142
164
  appId={namespace}
@@ -146,17 +168,19 @@ const SASQLookupComponent = forwardRef((props, ref) => {
146
168
  {filterPaneVisible &&
147
169
  <Pane
148
170
  defaultWidth="20%"
171
+ firstMenu={filterPaneFirstMenu ?
172
+ filterPaneFirstMenu(internalStateProps) :
173
+ null
174
+ }
149
175
  id={`${id}-filter-pane`}
150
- lastMenu={
176
+ lastMenu={filterPaneLastMenu ?
177
+ filterPaneLastMenu(internalStateProps) :
151
178
  <PaneMenu>
152
- <IconButton
153
- icon="caret-left"
154
- onClick={() => setFilterPaneVisible(false)}
155
- />
179
+ <CollapseFilterPaneButton onClick={toggleFilterPane} />
156
180
  </PaneMenu>
157
181
  }
158
182
  paneTitle={<FormattedMessage id="stripes-smart-components.searchAndFilter" />}
159
- {...filterPaneProps}
183
+ {...restOfFilterPaneProps}
160
184
  >
161
185
  <form onSubmit={onSubmitSearch}>
162
186
  <FilterPaneHeaderComponent />
@@ -212,17 +236,19 @@ const SASQLookupComponent = forwardRef((props, ref) => {
212
236
  }
213
237
  <Pane
214
238
  defaultWidth="fill"
215
- firstMenu={!filterPaneVisible ?
216
- <PaneMenu>
217
- <IconButton
218
- badgeCount={filterCount}
219
- icon="caret-right"
220
- onClick={() => setFilterPaneVisible(true)}
221
- />
222
- </PaneMenu>
223
- :
224
- null}
239
+ firstMenu={mainPaneFirstMenu ?
240
+ mainPaneFirstMenu(internalStateProps) :
241
+ !filterPaneVisible ?
242
+ <PaneMenu>
243
+ <ExpandFilterPaneButton filterCount={filterCount} onClick={toggleFilterPane} />
244
+ </PaneMenu> :
245
+ null
246
+ }
225
247
  id={`${id}-main-pane`}
248
+ lastMenu={mainPaneLastMenu ?
249
+ mainPaneLastMenu(internalStateProps) :
250
+ null
251
+ }
226
252
  noOverflow
227
253
  padContent={false}
228
254
  paneSub={
@@ -231,7 +257,7 @@ const SASQLookupComponent = forwardRef((props, ref) => {
231
257
  overrideValue: labelOverrides?.foundValues
232
258
  }, { total: data?.total })
233
259
  }
234
- {...mainPaneProps}
260
+ {...restOfMainPaneProps}
235
261
  >
236
262
  <Body
237
263
  data={data}
@@ -1,7 +1,7 @@
1
1
  // We can use hooks within zustand store functions without violating the laws of hooks
2
2
  /* eslint-disable react-hooks/rules-of-hooks */
3
3
  import { useNamespace } from '@folio/stripes/core';
4
- import create from 'zustand';
4
+ import { create } from 'zustand';
5
5
 
6
6
  const useIntlKeyStore = create((set, get) => ({
7
7
  intlKeys: {},