@k-int/stripes-kint-components 5.30.0 → 5.31.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 (278) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/es/index.js +8 -0
  3. package/es/lib/ButtonTypedown/ButtonTypedown.js +58 -0
  4. package/es/lib/ButtonTypedown/index.js +13 -0
  5. package/es/lib/Typedown/Typedown.js +85 -44
  6. package/es/lib/hooks/typedownHooks/useTypedown.js +104 -81
  7. package/package.json +1 -1
  8. package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +1 -1
  9. package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +1 -1
  10. package/src/artifacts/coverage-jest/ActionList/index.html +1 -1
  11. package/src/artifacts/coverage-jest/ActionList/index.js.html +1 -1
  12. package/src/artifacts/coverage-jest/ButtonTypedown/ButtonTypedown.js.html +241 -0
  13. package/src/artifacts/coverage-jest/ButtonTypedown/index.html +131 -0
  14. package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +88 -0
  15. package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +1 -1
  16. package/src/artifacts/coverage-jest/ComboButton/index.html +1 -1
  17. package/src/artifacts/coverage-jest/ComboButton/index.js.html +1 -1
  18. package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
  19. package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +1 -1
  20. package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +1 -1
  21. package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +1 -1
  22. package/src/artifacts/coverage-jest/CustomProperties/Config/index.html +1 -1
  23. package/src/artifacts/coverage-jest/CustomProperties/Config/index.js.html +1 -1
  24. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEdit.js.html +1 -1
  25. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +1 -1
  26. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +1 -1
  27. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +1 -1
  28. package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +1 -1
  29. package/src/artifacts/coverage-jest/CustomProperties/Edit/index.html +1 -1
  30. package/src/artifacts/coverage-jest/CustomProperties/Edit/index.js.html +1 -1
  31. package/src/artifacts/coverage-jest/CustomProperties/Edit/testResources.js.html +1 -1
  32. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilter.js.html +1 -1
  33. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +1 -1
  34. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +1 -1
  35. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +1 -1
  36. package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +1 -1
  37. package/src/artifacts/coverage-jest/CustomProperties/Filter/index.html +1 -1
  38. package/src/artifacts/coverage-jest/CustomProperties/Filter/index.js.html +1 -1
  39. package/src/artifacts/coverage-jest/CustomProperties/Filter/testResources.js.html +1 -1
  40. package/src/artifacts/coverage-jest/CustomProperties/Filter/useOperators.js.html +1 -1
  41. package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +1 -1
  42. package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +1 -1
  43. package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +1 -1
  44. package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +1 -1
  45. package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +1 -1
  46. package/src/artifacts/coverage-jest/CustomProperties/View/index.html +1 -1
  47. package/src/artifacts/coverage-jest/CustomProperties/View/index.js.html +1 -1
  48. package/src/artifacts/coverage-jest/CustomProperties/View/testResources.js.html +1 -1
  49. package/src/artifacts/coverage-jest/CustomProperties/index.html +1 -1
  50. package/src/artifacts/coverage-jest/CustomProperties/index.js.html +1 -1
  51. package/src/artifacts/coverage-jest/CycleButton/CycleButton.js.html +1 -1
  52. package/src/artifacts/coverage-jest/CycleButton/index.html +1 -1
  53. package/src/artifacts/coverage-jest/CycleButton/index.js.html +1 -1
  54. package/src/artifacts/coverage-jest/FieldLabel/FieldLabel.js.html +1 -1
  55. package/src/artifacts/coverage-jest/FieldLabel/index.html +1 -1
  56. package/src/artifacts/coverage-jest/FieldLabel/index.js.html +1 -1
  57. package/src/artifacts/coverage-jest/FormModal/FormModal.js.html +1 -1
  58. package/src/artifacts/coverage-jest/FormModal/index.html +1 -1
  59. package/src/artifacts/coverage-jest/FormModal/index.js.html +1 -1
  60. package/src/artifacts/coverage-jest/FormattedKintMessage/FormattedKintMessage.js.html +1 -1
  61. package/src/artifacts/coverage-jest/FormattedKintMessage/index.html +1 -1
  62. package/src/artifacts/coverage-jest/FormattedKintMessage/index.js.html +1 -1
  63. package/src/artifacts/coverage-jest/IconSelect/IconSelect.js.html +1 -1
  64. package/src/artifacts/coverage-jest/IconSelect/index.html +1 -1
  65. package/src/artifacts/coverage-jest/IconSelect/index.js.html +1 -1
  66. package/src/artifacts/coverage-jest/NoResultsMessage/NoResultsMessage.js.html +1 -1
  67. package/src/artifacts/coverage-jest/NoResultsMessage/index.html +1 -1
  68. package/src/artifacts/coverage-jest/NoResultsMessage/index.js.html +1 -1
  69. package/src/artifacts/coverage-jest/NumberField/NumberField.js.html +1 -1
  70. package/src/artifacts/coverage-jest/NumberField/index.html +1 -1
  71. package/src/artifacts/coverage-jest/NumberField/index.js.html +1 -1
  72. package/src/artifacts/coverage-jest/QueryTypedown/QueryTypedown.js.html +1 -1
  73. package/src/artifacts/coverage-jest/QueryTypedown/index.html +1 -1
  74. package/src/artifacts/coverage-jest/QueryTypedown/index.js.html +1 -1
  75. package/src/artifacts/coverage-jest/RefdataButtons/RefdataButtons.js.html +1 -1
  76. package/src/artifacts/coverage-jest/RefdataButtons/index.html +1 -1
  77. package/src/artifacts/coverage-jest/RefdataButtons/index.js.html +1 -1
  78. package/src/artifacts/coverage-jest/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +1 -1
  79. package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.html +1 -1
  80. package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.js.html +1 -1
  81. package/src/artifacts/coverage-jest/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +1 -1
  82. package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +1 -1
  83. package/src/artifacts/coverage-jest/RichSelect/index.html +1 -1
  84. package/src/artifacts/coverage-jest/RichSelect/index.js.html +1 -1
  85. package/src/artifacts/coverage-jest/RichSelect/useSelectedOption.js.html +1 -1
  86. package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +1 -1
  87. package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +1 -1
  88. package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +1 -1
  89. package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
  90. package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +1 -1
  91. package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
  92. package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +1 -1
  93. package/src/artifacts/coverage-jest/SASQRoute/index.html +1 -1
  94. package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
  95. package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +1 -1
  96. package/src/artifacts/coverage-jest/SASQViewComponent/index.html +1 -1
  97. package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
  98. package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +1 -1
  99. package/src/artifacts/coverage-jest/SearchField/index.html +1 -1
  100. package/src/artifacts/coverage-jest/SearchField/index.js.html +1 -1
  101. package/src/artifacts/coverage-jest/SearchKeyControl/SearchKeyControl.js.html +1 -1
  102. package/src/artifacts/coverage-jest/SearchKeyControl/index.html +1 -1
  103. package/src/artifacts/coverage-jest/SearchKeyControl/index.js.html +1 -1
  104. package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +1 -1
  105. package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.html +1 -1
  106. package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.js.html +1 -1
  107. package/src/artifacts/coverage-jest/Settings/EditableRefdataList/EditableRefdataList.js.html +1 -1
  108. package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.html +1 -1
  109. package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.js.html +1 -1
  110. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsList.js.html +1 -1
  111. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +1 -1
  112. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +1 -1
  113. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.js.html +1 -1
  114. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js.html +1 -1
  115. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +1 -1
  116. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.js.html +1 -1
  117. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js.html +1 -1
  118. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.html +1 -1
  119. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.js.html +1 -1
  120. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/SettingField.js.html +1 -1
  121. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +1 -1
  122. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
  123. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +1 -1
  124. package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.js.html +1 -1
  125. package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js.html +1 -1
  126. package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.html +1 -1
  127. package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.js.html +1 -1
  128. package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPage.js.html +1 -1
  129. package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +1 -1
  130. package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.html +1 -1
  131. package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.js.html +1 -1
  132. package/src/artifacts/coverage-jest/Settings/SettingPage/index.html +1 -1
  133. package/src/artifacts/coverage-jest/Settings/SettingPage/index.js.html +1 -1
  134. package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +1 -1
  135. package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
  136. package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
  137. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +1 -1
  138. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +1 -1
  139. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +1 -1
  140. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
  141. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +1 -1
  142. package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +1 -1
  143. package/src/artifacts/coverage-jest/Settings/constants/index.html +1 -1
  144. package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
  145. package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +1 -1
  146. package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +1 -1
  147. package/src/artifacts/coverage-jest/Settings/contexts/index.html +1 -1
  148. package/src/artifacts/coverage-jest/Settings/contexts/index.js.html +1 -1
  149. package/src/artifacts/coverage-jest/Settings/hooks/index.html +1 -1
  150. package/src/artifacts/coverage-jest/Settings/hooks/index.js.html +1 -1
  151. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.html +1 -1
  152. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.js.html +1 -1
  153. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.html +1 -1
  154. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.js.html +1 -1
  155. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js.html +1 -1
  156. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.html +1 -1
  157. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.js.html +1 -1
  158. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js.html +1 -1
  159. package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +1 -1
  160. package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.html +1 -1
  161. package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.js.html +1 -1
  162. package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/useAppSettings.js.html +1 -1
  163. package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.html +1 -1
  164. package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
  165. package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +1 -1
  166. package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +1 -1
  167. package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
  168. package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +1 -1
  169. package/src/artifacts/coverage-jest/Settings/index.html +1 -1
  170. package/src/artifacts/coverage-jest/Settings/index.js.html +1 -1
  171. package/src/artifacts/coverage-jest/Tags/Tags.js.html +1 -1
  172. package/src/artifacts/coverage-jest/Tags/hooks/index.html +1 -1
  173. package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
  174. package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +1 -1
  175. package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +1 -1
  176. package/src/artifacts/coverage-jest/Tags/index.html +1 -1
  177. package/src/artifacts/coverage-jest/Tags/index.js.html +1 -1
  178. package/src/artifacts/coverage-jest/Tags/tagsConfig.js.html +1 -1
  179. package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +219 -60
  180. package/src/artifacts/coverage-jest/Typedown/index.html +15 -15
  181. package/src/artifacts/coverage-jest/Typedown/index.js.html +1 -1
  182. package/src/artifacts/coverage-jest/cobertura-coverage.xml +196 -99
  183. package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
  184. package/src/artifacts/coverage-jest/constants/customProperties.js.html +1 -1
  185. package/src/artifacts/coverage-jest/constants/endpoints.js.html +1 -1
  186. package/src/artifacts/coverage-jest/constants/eventCodes.js.html +1 -1
  187. package/src/artifacts/coverage-jest/constants/index.html +1 -1
  188. package/src/artifacts/coverage-jest/constants/pagination.js.html +1 -1
  189. package/src/artifacts/coverage-jest/hooks/index.html +1 -1
  190. package/src/artifacts/coverage-jest/hooks/index.js.html +1 -1
  191. package/src/artifacts/coverage-jest/hooks/intlHooks/index.html +1 -1
  192. package/src/artifacts/coverage-jest/hooks/intlHooks/index.js.html +1 -1
  193. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.html +1 -1
  194. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.js.html +1 -1
  195. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/useIntlKey.js.html +1 -1
  196. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.html +1 -1
  197. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.js.html +1 -1
  198. package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js.html +1 -1
  199. package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.html +1 -1
  200. package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.js.html +1 -1
  201. package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/useKintIntl.js.html +1 -1
  202. package/src/artifacts/coverage-jest/hooks/typedownHooks/index.html +14 -14
  203. package/src/artifacts/coverage-jest/hooks/typedownHooks/index.js.html +1 -1
  204. package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedown.js.html +170 -116
  205. package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +1 -1
  206. package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
  207. package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +1 -1
  208. package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +1 -1
  209. package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +1 -1
  210. package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +1 -1
  211. package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.html +1 -1
  212. package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.js.html +1 -1
  213. package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/useInvalidateRefdata.js.html +1 -1
  214. package/src/artifacts/coverage-jest/hooks/useKiwtFieldArray.js.html +1 -1
  215. package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +1 -1
  216. package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +1 -1
  217. package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +1 -1
  218. package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +1 -1
  219. package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.html +1 -1
  220. package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
  221. package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +1 -1
  222. package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +1 -1
  223. package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +1 -1
  224. package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +1 -1
  225. package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +1 -1
  226. package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +1 -1
  227. package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
  228. package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +1 -1
  229. package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +1 -1
  230. package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
  231. package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.js.html +1 -1
  232. package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +1 -1
  233. package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +1 -1
  234. package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +1 -1
  235. package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +1 -1
  236. package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.html +1 -1
  237. package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.js.html +1 -1
  238. package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js.html +1 -1
  239. package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +1 -1
  240. package/src/artifacts/coverage-jest/index.html +39 -24
  241. package/src/artifacts/coverage-jest/utils/buildUrl.js.html +1 -1
  242. package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +1 -1
  243. package/src/artifacts/coverage-jest/utils/filterParsers/index.html +1 -1
  244. package/src/artifacts/coverage-jest/utils/filterParsers/index.js.html +1 -1
  245. package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryFilters.js.html +1 -1
  246. package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +1 -1
  247. package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +1 -1
  248. package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +1 -1
  249. package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +1 -1
  250. package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +1 -1
  251. package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
  252. package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +1 -1
  253. package/src/artifacts/coverage-jest/utils/highlightString.js.html +1 -1
  254. package/src/artifacts/coverage-jest/utils/index.html +1 -1
  255. package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
  256. package/src/artifacts/coverage-jest/utils/matchString.js.html +1 -1
  257. package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +1 -1
  258. package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +1 -1
  259. package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +1 -1
  260. package/src/artifacts/coverage-jest/utils/refdataOptions.js.html +1 -1
  261. package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.html +1 -1
  262. package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.js.html +1 -1
  263. package/src/artifacts/coverage-jest/utils/refdataQueryKey/refdataQueryKey.js.html +1 -1
  264. package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +1 -1
  265. package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +1 -1
  266. package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +1 -1
  267. package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +1 -1
  268. package/src/artifacts/coverage-jest/validators/index.html +1 -1
  269. package/src/artifacts/coverage-jest/validators/index.js.html +1 -1
  270. package/src/artifacts/coverage-jest/validators/validators.js.html +1 -1
  271. package/src/index.js +4 -0
  272. package/src/lib/ButtonTypedown/ButtonTypedown.js +52 -0
  273. package/src/lib/ButtonTypedown/README.md +53 -0
  274. package/src/lib/ButtonTypedown/index.js +1 -0
  275. package/src/lib/Typedown/README.md +24 -21
  276. package/src/lib/Typedown/Typedown.js +101 -48
  277. package/src/lib/hooks/typedownHooks/useTypedown.js +105 -87
  278. package/styles/TypeDown.css +4 -0
@@ -175,7 +175,7 @@ export default matchString;
175
175
  <div class='footer quiet pad2 space-top1 center small'>
176
176
  Code coverage generated by
177
177
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
178
- at 2025-12-10T12:12:10.913Z
178
+ at 2025-12-12T16:39:50.848Z
179
179
  </div>
180
180
  <script src="../prettify.js"></script>
181
181
  <script>
@@ -127,7 +127,7 @@ export default modConfigEntriesQueryKey;
127
127
  <div class='footer quiet pad2 space-top1 center small'>
128
128
  Code coverage generated by
129
129
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
130
- at 2025-12-10T12:12:10.913Z
130
+ at 2025-12-12T16:39:50.848Z
131
131
  </div>
132
132
  <script src="../prettify.js"></script>
133
133
  <script>
@@ -142,7 +142,7 @@ export default parseErrorResponse;
142
142
  <div class='footer quiet pad2 space-top1 center small'>
143
143
  Code coverage generated by
144
144
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
145
- at 2025-12-10T12:12:10.913Z
145
+ at 2025-12-12T16:39:50.848Z
146
146
  </div>
147
147
  <script src="../prettify.js"></script>
148
148
  <script>
@@ -115,7 +115,7 @@ export default parseModConfigEntry;
115
115
  <div class='footer quiet pad2 space-top1 center small'>
116
116
  Code coverage generated by
117
117
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
118
- at 2025-12-10T12:12:10.913Z
118
+ at 2025-12-12T16:39:50.848Z
119
119
  </div>
120
120
  <script src="../prettify.js"></script>
121
121
  <script>
@@ -94,7 +94,7 @@
94
94
  <div class='footer quiet pad2 space-top1 center small'>
95
95
  Code coverage generated by
96
96
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
97
- at 2025-12-10T12:12:10.913Z
97
+ at 2025-12-12T16:39:50.848Z
98
98
  </div>
99
99
  <script src="../prettify.js"></script>
100
100
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2025-12-10T12:12:10.913Z
119
+ at 2025-12-12T16:39:50.848Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -73,7 +73,7 @@
73
73
  <div class='footer quiet pad2 space-top1 center small'>
74
74
  Code coverage generated by
75
75
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
76
- at 2025-12-10T12:12:10.913Z
76
+ at 2025-12-12T16:39:50.848Z
77
77
  </div>
78
78
  <script src="../../prettify.js"></script>
79
79
  <script>
@@ -97,7 +97,7 @@ export default refdataQueryKey;
97
97
  <div class='footer quiet pad2 space-top1 center small'>
98
98
  Code coverage generated by
99
99
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
100
- at 2025-12-10T12:12:10.913Z
100
+ at 2025-12-12T16:39:50.848Z
101
101
  </div>
102
102
  <script src="../../prettify.js"></script>
103
103
  <script>
@@ -130,7 +130,7 @@ export default selectorSafe;
130
130
  <div class='footer quiet pad2 space-top1 center small'>
131
131
  Code coverage generated by
132
132
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
133
- at 2025-12-10T12:12:10.913Z
133
+ at 2025-12-12T16:39:50.848Z
134
134
  </div>
135
135
  <script src="../prettify.js"></script>
136
136
  <script>
@@ -115,7 +115,7 @@ export default sortByLabel;
115
115
  <div class='footer quiet pad2 space-top1 center small'>
116
116
  Code coverage generated by
117
117
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
118
- at 2025-12-10T12:12:10.913Z
118
+ at 2025-12-12T16:39:50.848Z
119
119
  </div>
120
120
  <script src="../prettify.js"></script>
121
121
  <script>
@@ -112,7 +112,7 @@ export default toCamelCase;
112
112
  <div class='footer quiet pad2 space-top1 center small'>
113
113
  Code coverage generated by
114
114
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
115
- at 2025-12-10T12:12:10.913Z
115
+ at 2025-12-12T16:39:50.848Z
116
116
  </div>
117
117
  <script src="../prettify.js"></script>
118
118
  <script>
@@ -97,7 +97,7 @@ export default typedownQueryKey;
97
97
  <div class='footer quiet pad2 space-top1 center small'>
98
98
  Code coverage generated by
99
99
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
100
- at 2025-12-10T12:12:10.913Z
100
+ at 2025-12-12T16:39:50.848Z
101
101
  </div>
102
102
  <script src="../prettify.js"></script>
103
103
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2025-12-10T12:12:10.913Z
119
+ at 2025-12-12T16:39:50.848Z
120
120
  </div>
121
121
  <script src="../prettify.js"></script>
122
122
  <script>
@@ -73,7 +73,7 @@
73
73
  <div class='footer quiet pad2 space-top1 center small'>
74
74
  Code coverage generated by
75
75
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
76
- at 2025-12-10T12:12:10.913Z
76
+ at 2025-12-12T16:39:50.848Z
77
77
  </div>
78
78
  <script src="../prettify.js"></script>
79
79
  <script>
@@ -355,7 +355,7 @@ export {
355
355
  <div class='footer quiet pad2 space-top1 center small'>
356
356
  Code coverage generated by
357
357
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
358
- at 2025-12-10T12:12:10.913Z
358
+ at 2025-12-12T16:39:50.848Z
359
359
  </div>
360
360
  <script src="../prettify.js"></script>
361
361
  <script>
package/src/index.js CHANGED
@@ -22,6 +22,10 @@ export {
22
22
  default as QueryTypedown
23
23
  } from './lib/QueryTypedown';
24
24
 
25
+ export {
26
+ default as ButtonTypedown
27
+ } from './lib/ButtonTypedown';
28
+
25
29
  /* SASQ Stuff */
26
30
  // SearchField
27
31
  export {
@@ -0,0 +1,52 @@
1
+ import PropTypes from 'prop-types';
2
+
3
+ import { DropdownButton } from '@folio/stripes/components';
4
+
5
+ import SearchField from '../SearchField';
6
+ import Typedown from '../Typedown';
7
+
8
+ const ButtonTypedown = ({
9
+ onType, // We need these manually
10
+ renderListItem,
11
+ ...typedownProps
12
+ }) => {
13
+ return (
14
+ <Typedown
15
+ getDisplayValue={() => false}
16
+ renderHeader={({ currentlyTyped }) => (
17
+ <SearchField
18
+ marginBottom0
19
+ onChange={onType}
20
+ value={currentlyTyped}
21
+ />
22
+ )}
23
+ renderListItem={renderListItem}
24
+ renderTrigger={({
25
+ selectedValue,
26
+ triggerComponentRef,
27
+ triggerId,
28
+ typedownTriggerKeyDownHandler
29
+ }) => (
30
+ <DropdownButton
31
+ ref={triggerComponentRef}
32
+ buttonStyle="dropdownItem"
33
+ fullWidth
34
+ id={triggerId}
35
+ marginBottom0
36
+ onKeyDown={typedownTriggerKeyDownHandler}
37
+ >
38
+ {renderListItem(selectedValue)}
39
+ </DropdownButton>
40
+ )}
41
+ {...typedownProps}
42
+ />
43
+ );
44
+ };
45
+
46
+ export default ButtonTypedown;
47
+
48
+ ButtonTypedown.propTypes = {
49
+ onType: PropTypes.func.isRequired,
50
+ renderListItem: PropTypes.func.isRequired,
51
+ // REST OF TYPEDOWN PROPS
52
+ };
@@ -0,0 +1,53 @@
1
+ # ButtonTypedown
2
+
3
+ The `ButtonTypedown` component is a variant of the `Typedown` component that utilizes a **DropdownButton** as the primary trigger element. When the button is clicked, a dropdown list appears, with a **SearchField** rendered in the header for typing and filtering the options.
4
+
5
+ It is ideal for scenarios where the selected value needs to be prominently displayed within a button context, and the search functionality is secondary, appearing only when the dropdown is active.
6
+
7
+ ## Basic Usage
8
+
9
+ The component is a wrapper around `Typedown`, configuring the `renderTrigger` and `renderHeader` props internally.
10
+
11
+ ```javascript
12
+ import { ButtonTypedown } from './ButtonTypedown'; // Adjust import path
13
+
14
+ <ButtonTypedown
15
+ label="Select a User"
16
+ dataOptions={[
17
+ { id: 'u1', name: 'John Doe' },
18
+ { id: 'u2', name: 'Jane Smith' },
19
+ { id: 'u3', name: 'Alice Johnson' },
20
+ ]}
21
+ input={{
22
+ name: 'userField',
23
+ value: { id: 'u1', name: 'John Doe' }, // Example selected value
24
+ onChange: (value) => console.log('Selected:', value),
25
+ }}
26
+ // Custom function to render the option inside the button and in the list
27
+ renderListItem={(option) => option ? option.name : 'Select user...'}
28
+ // Custom function for fetching/filtering data when the user types
29
+ onType={(e) => {
30
+ // Implement custom filtering or data fetching based on e.target.value
31
+ console.log('User typed:', e.target.value);
32
+ }}
33
+ // All other standard Typedown props are supported
34
+ />
35
+ ```
36
+
37
+ ## How it Works
38
+
39
+ The `ButtonTypedown` component passes the following predefined props to the underlying `Typedown`:
40
+
41
+ * `renderTrigger`: Renders a `DropdownButton` (from `@folio/stripes/components`) that displays the selected value (via `renderListItem`) and acts as the open/close trigger.
42
+ * `renderHeader`: Renders a `SearchField` (from `../SearchField`) inside the dropdown's menu. This is where the user types to filter the list.
43
+ * `getDisplayValue`: Set to `() => false` to prevent the selected item from being rendered *below* the typedown, as the selected value is already displayed *inside* the trigger button.
44
+
45
+ ## Props
46
+
47
+ Since `ButtonTypedown` is a wrapper around `Typedown`, it accepts **all** props of the base `Typedown` component. However, it specifically requires or overrides the above two props
48
+
49
+ | Name | Type | Description | Required |
50
+ |-----------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
51
+ | **onType** | func | **Required.** A callback function `(event)` that is called when the user types in the search field (which appears in the dropdown header). You **must** use this to filter the `dataOptions` or fetch new data and update the `dataOptions` prop. | ✓ |
52
+ | **renderListItem** | func | **Required.** A function `(option, currentlyTyped, exactMatch, optionIsSelected)` that renders each item in the dropdown list. In `ButtonTypedown`, this function is **also** used to render the content *inside* the `DropdownButton` when an item is selected. | ✓ |
53
+ | *...rest of Typedown props* | *...* | All other props supported by the base `Typedown` component (e.g., `dataOptions`, `input`, `filterPath`, `uniqueIdentificationPath`, etc.) are supported. Note that `renderTrigger` and `renderHeader` are overridden internally. | ✕ |
@@ -0,0 +1 @@
1
+ export { default } from './ButtonTypedown';
@@ -24,24 +24,27 @@ import Typedown from '@k-int/stripes-kint-components';
24
24
 
25
25
  ### Props
26
26
 
27
- | Name | Type | Description | Default | Required |
28
- |--------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|---|
29
- | className | string | CSS class name to apply to the component's outer div. | | ✕ |
30
- | dataOptions | array | An array of objects representing the dropdown options. Each object should have a property (specified by `uniqueIdentificationPath`) that serves as a unique identifier. | | ✓ |
31
- | displayClearItem | bool | Whether to display a clear icon when an item is selected. | `true` | ✕ |
32
- | displayValueWhileOpen | bool | Whether or not to display the "value" underneath the typedown search while the dropdown is open. Defaults to true to avoid size changing onClick. | `true` | ✕ |
33
- | endOfList | node/func | Component or function to render when the dropdown list is empty. Defaults to `<EndOfList />` from `@folio/stripes/components`. | `<EndOfList />` | ✕ |
34
- | filterPath | string | Path to the property in `dataOptions` objects to use for filtering. If not provided, filtering is done on the property specified by `uniqueIdentificationPath`. | | ✕ |
35
- | id | string | Id to apply to the component's outer div. | | ✕ |
36
- | initialTimeoutDelay | number | Delay applied to `open` occurring on first render. Set to 800ms to avoid any stripes animations, such as being the first element focused in an opening modal. | 800 | ✕ |
37
- | input | object | An object containing the input props typically provided by a form library like `react-final-form` or `redux-form`. Should include `name`, `value`, and `onChange`. | | |
38
- | isSelected | func | A function `(inputValue, dataOption)` that determines if a given `dataOption` is currently selected. Useful when selected values are complex objects. If not provided, selection is determined by comparing the value of the `uniqueIdentificationPath` property of the `input.value` and the `dataOption`. | | |
39
- | label | string/element | Label for the input field. | | ✕ |
40
- | meta | object | Meta information about the field, typically provided by a form library. Useful for displaying error messages etc. | | ✕ |
41
- | onChange | func | A callback function `(value)` that is called when a value is selected from the dropdown. This is in addition to the `input.onChange` provided. | | ✕ |
42
- | onType | func | A callback function `(event)` that is called when the user types in the search field. Allows for custom filtering or data fetching based on user input. | | ✕ |
43
- | renderFooter | func | A function `(displayData, currentlyTyped, exactMatch)` that renders a footer below the dropdown list. Receives the currently filtered `displayData`, what the user has typed, and whether it is an exact match. | | ✕ |
44
- | renderListItem | func | A function `(option, currentlyTyped, exactMatch, optionIsSelected)` that renders each item in the dropdown list. Receives the current option, what the user has typed, whether there is an exact match, and if the option is selected. If not provided, the value of the `uniqueIdentificationPath` property of the option is displayed. | | ✕ |
45
- | required | bool | Whether the input is required. | | ✕ |
46
- | selectedStyles | string | CSS class name to apply to the selected item display. | | ✕ |
47
- | uniqueIdentificationPath | string | Path to the property in `dataOptions` objects that serves as a unique identifier for each option and is used to determine if an option is selected. | `'id'` | ✕ |
27
+ | Name | Type | Description | Default | Required |
28
+ |--------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|----------|
29
+ | className | string | CSS class name to apply to the component's outer div. | | ✕ |
30
+ | dataOptions | array | An array of objects representing the dropdown options. Each object should have a property (specified by `uniqueIdentificationPath`) that serves as a unique identifier. | | ✓ |
31
+ | displayClearItem | bool | Whether to display a clear icon when an item is selected. | `true` | ✕ |
32
+ | displayValueWhileOpen | bool | Whether or not to display the "value" underneath the typedown search while the dropdown is open. Defaults to true to avoid size changing onClick. | `true` | ✕ |
33
+ | endOfList | node/func | Component or function to render when the dropdown list is empty. Defaults to `<EndOfList />` from `@folio/stripes/components`. | `<EndOfList />` | ✕ |
34
+ | filterPath | string | Path to the property in `dataOptions` objects to use for filtering. If not provided, filtering is done on the property specified by `uniqueIdentificationPath`. | | ✕ |
35
+ | getDisplayValue | func | a function `({ selectedUniqueId, open })` used to override the displayValue logic entirely. Must return a boolean, which will determine whether the selected item renders below the trigger element. | | ✕ |
36
+ | id | string | Id to apply to the component's outer div. | | ✕ |
37
+ | initialTimeoutDelay | number | Delay applied to `open` occurring on first render. Set to 800ms to avoid any stripes animations, such as being the first element focused in an opening modal. | 800 | |
38
+ | input | object | An object containing the input props typically provided by a form library like `react-final-form` or `redux-form`. Should include `name`, `value`, and `onChange`. | | |
39
+ | isSelected | func | A function `(inputValue, dataOption)` that determines if a given `dataOption` is currently selected. Useful when selected values are complex objects. If not provided, selection is determined by comparing the value of the `uniqueIdentificationPath` property of the `input.value` and the `dataOption`. | | ✕ |
40
+ | label | string/element | Label for the input field. | | ✕ |
41
+ | meta | object | Meta information about the field, typically provided by a form library. Useful for displaying error messages etc. | | ✕ |
42
+ | onChange | func | A callback function `(value)` that is called when a value is selected from the dropdown. This is in addition to the `input.onChange` provided. | | ✕ |
43
+ | onType | func | A callback function `(event)` that is called when the user types in the search field. Allows for custom filtering or data fetching based on user input. | | ✕ |
44
+ | renderHeader | func | A function `({ currentlyTyped, displayData, handleType, exactMatch })` that renders a header above the dropdown list. Receives an object with some internal typedown state. Note the difference with renderFooter, in future renderFooter will be brought in line | | ✕ |
45
+ | renderFooter | func | A function `(displayData, currentlyTyped, exactMatch)` that renders a footer below the dropdown list. Receives the currently filtered `displayData`, what the user has typed, and whether it is an exact match. | | ✕ |
46
+ | renderListItem | func | A function `(option, currentlyTyped, exactMatch, optionIsSelected)` that renders each item in the dropdown list. Receives the current option, what the user has typed, whether there is an exact match, and if the option is selected. If not provided, the value of the `uniqueIdentificationPath` property of the option is displayed. | | ✕ |
47
+ | renderTrigger | func | A function `({ handleType, input, meta, triggerComponentRef, triggerComponentId, typedownTriggerKeyDownHandler })` that renders an alternative trigger to the default SearchField. This component MUST set the triggerComponentRef on the focusable element for keyboard handling to work currently. | | ✕ |
48
+ | required | bool | Whether the input is required. | | ✕ |
49
+ | selectedStyles | string | CSS class name to apply to the selected item display. | | ✕ |
50
+ | uniqueIdentificationPath | string | Path to the property in `dataOptions` objects that serves as a unique identifier for each option and is used to determine if an option is selected. | `'id'` | ✕ |
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
1
+ import { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classnames from 'classnames';
4
4
 
@@ -18,6 +18,7 @@ const Typedown = ({
18
18
  displayClearItem = true,
19
19
  displayValueWhileOpen = true,
20
20
  endOfList,
21
+ getDisplayValue, // Can overrule displayValue entirely
21
22
  id,
22
23
  initialOpenDelay = 800, // Initial opening delay of 800ms (handles any stripes animations)
23
24
  input,
@@ -28,12 +29,15 @@ const Typedown = ({
28
29
  onChange,
29
30
  onType,
30
31
  renderFooter = null,
32
+ renderHeader = null,
31
33
  renderListItem = null,
34
+ renderTrigger = null,
32
35
  required,
33
36
  selectedStyles, // A way to pass any styles that need to be applied globally on selection
34
37
  uniqueIdentificationPath = 'id'
35
38
  }) => {
36
39
  const selectedUniqueId = get(input.value, uniqueIdentificationPath);
40
+ const [selectedValue, setSelectedValue] = useState(input.value); // Track what's been selected in state as well
37
41
 
38
42
  // Display data needs to be in line with data options but also able to react to default handleType
39
43
  const [displayData, setDisplayData] = useState(dataOptions);
@@ -47,7 +51,7 @@ const Typedown = ({
47
51
  }, [dataOptions]);
48
52
 
49
53
  // Setup default handleType
50
- const handleType = (e) => {
54
+ const handleType = useCallback((e) => {
51
55
  const regex = new RegExp(`${e.target.value.toLowerCase()}`);
52
56
  if (onType) {
53
57
  onType(e);
@@ -66,20 +70,20 @@ const Typedown = ({
66
70
  } else {
67
71
  setExactMatch(false);
68
72
  }
69
- };
73
+ }, [dataOptions, displayData, filterPath, onType, uniqueIdentificationPath]);
70
74
 
71
75
  // Hook to set up all the essentials
72
76
  const {
73
77
  refs: {
74
78
  listRef,
75
79
  triggerRef,
80
+ triggerComponentRef,
76
81
  overlayRef,
77
- footerRef
82
+ footerRef,
83
+ headerRef
78
84
  },
79
85
  handlers: {
80
86
  handleNextFocus,
81
- listKeyDownHandler,
82
- searchFieldKeyDownHandler
83
87
  },
84
88
  variables: {
85
89
  open,
@@ -99,20 +103,53 @@ const Typedown = ({
99
103
  className={css.listItem}
100
104
  >
101
105
  {renderListItem ?
102
- renderListItem(option, currentlyTyped, exactMatch, optionIsSelected) :
106
+ renderListItem(option, currentlyTyped, exactMatch, optionIsSelected, selectedValue) :
103
107
  get(option, uniqueIdentificationPath)
104
108
  }
105
109
  </div>
106
- ), [currentlyTyped, exactMatch, renderListItem, uniqueIdentificationPath]);
110
+ ), [currentlyTyped, exactMatch, renderListItem, selectedValue, uniqueIdentificationPath]);
107
111
 
108
112
  const handleChange = useCallback(value => {
109
113
  input.onChange(value);
114
+ setSelectedValue(value);
110
115
 
111
116
  if (typeof onChange === 'function') {
112
117
  onChange(value);
113
118
  }
114
119
  }, [input, onChange]);
115
120
 
121
+ const renderTypedownTrigger = () => {
122
+ const triggerComponentId = `typedown-trigger-${selectorSafe(input.name)}`;
123
+ return (
124
+ <div
125
+ ref={triggerRef}
126
+ id={`typedown-parent-${selectorSafe(input.name)}-trigger`}
127
+ >
128
+ {renderTrigger ?
129
+ renderTrigger({ // Pass all props in that searchfield uses.
130
+ handleType,
131
+ input, // Pass input? Useful when not controlled I guess
132
+ meta,
133
+ selectedValue,
134
+ triggerComponentId,
135
+ triggerComponentRef,
136
+ })
137
+ :
138
+ <SearchField
139
+ ref={triggerComponentRef}
140
+ // Pass meta through so correct styling gets applied to the TextField
141
+ id={triggerComponentId}
142
+ label={label}
143
+ marginBottom0
144
+ meta={meta}
145
+ onChange={handleType}
146
+ required={required}
147
+ />
148
+ }
149
+ </div>
150
+ );
151
+ };
152
+
116
153
  const dropDown = useCallback(() => {
117
154
  return (
118
155
  <div
@@ -120,10 +157,32 @@ const Typedown = ({
120
157
  id={`typedown-parent-${selectorSafe(input.name)}-menu`}
121
158
  style={{ '--searchWidth': `${searchWidth}px` }}
122
159
  >
160
+ {renderHeader &&
161
+ <div
162
+ ref={headerRef}
163
+ className={css.header}
164
+ id={`typedown-header-${selectorSafe(input.name)}`}
165
+ >
166
+ {/* Adopt a more extensible pattern for renderHeader, renderFooter will eventually follow */}
167
+ {renderHeader({
168
+ currentlyTyped,
169
+ displayData,
170
+ handleType,
171
+ exactMatch
172
+ })}
173
+ </div>
174
+ }
175
+ {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
123
176
  <div
124
177
  ref={listRef}
125
178
  className={css.listContainer}
126
179
  id="typedown-list"
180
+ /* This is an acceptable exception to the no-static-element-interactions
181
+ * as we are only PREVENTING interactions, namely focus change on scrollbar click
182
+ * Without this, the typedown closes instantly when the scrollbar is clicked or dragged.
183
+ * This does NOT prevent item click, as e.propagation is not prevented.
184
+ */
185
+ onMouseDown={(e) => e.preventDefault()}
127
186
  >
128
187
  {displayData?.length ? displayData?.map((d, index) => {
129
188
  const isSelectedEval = isSelected ? isSelected(input.value, d) : get(input.value, uniqueIdentificationPath) === get(d, uniqueIdentificationPath);
@@ -143,7 +202,6 @@ const Typedown = ({
143
202
  handleChange(d);
144
203
  handleNextFocus();
145
204
  }}
146
- onKeyDown={listKeyDownHandler}
147
205
  type="button"
148
206
  >
149
207
  {renderItem(d, isSelectedEval)}
@@ -172,41 +230,52 @@ const Typedown = ({
172
230
  footerRef,
173
231
  handleChange,
174
232
  handleNextFocus,
233
+ handleType,
234
+ headerRef,
175
235
  input.name,
176
236
  input.value,
177
237
  isSelected,
178
- listKeyDownHandler,
179
238
  listRef,
180
239
  renderFooter,
240
+ renderHeader,
181
241
  renderItem,
182
242
  searchWidth,
183
243
  selectedStyles,
184
244
  uniqueIdentificationPath
185
245
  ]);
186
246
 
187
- const renderSearchField = () => {
188
- return (
247
+ const renderSelectedItem = useCallback(() => (
248
+ <div
249
+ className={classnames(
250
+ css.selectedDisplay
251
+ )}
252
+ >
189
253
  <div
190
- ref={triggerRef}
191
- id={`typedown-parent-${selectorSafe(input.name)}-searchField`}
254
+ className={css.selectedItem}
192
255
  >
193
- <SearchField
194
- // Pass meta through so correct styling gets applied to the TextField
195
- id={`typedown-searchField-${selectorSafe(input.name)}`}
196
- label={label}
197
- marginBottom0
198
- meta={meta}
199
- onChange={handleType}
200
- onKeyDown={searchFieldKeyDownHandler}
201
- required={required}
202
- />
256
+ {renderItem(input.value)}
203
257
  </div>
204
- );
205
- };
258
+ {displayClearItem &&
259
+ <IconButton
260
+ className={css.clearItem}
261
+ icon="times-circle-solid"
262
+ onClick={() => handleChange()}
263
+ />
264
+ }
265
+ </div>
266
+ ), [displayClearItem, handleChange, input.value, renderItem]);
206
267
 
207
268
  const displayValue = useMemo(() => {
269
+ // Allow full control over whether to display the value
270
+ if (getDisplayValue) {
271
+ return getDisplayValue({
272
+ selectedUniqueId,
273
+ open
274
+ });
275
+ }
276
+
208
277
  return !!selectedUniqueId && (!open || displayValueWhileOpen);
209
- }, [displayValueWhileOpen, open, selectedUniqueId]);
278
+ }, [displayValueWhileOpen, getDisplayValue, open, selectedUniqueId]);
210
279
 
211
280
  return (
212
281
  <div
@@ -217,7 +286,7 @@ const Typedown = ({
217
286
  )}
218
287
  id={`typedown-id-${id}`}
219
288
  >
220
- {renderSearchField()}
289
+ {renderTypedownTrigger()}
221
290
  <Popper
222
291
  key="typedown-menu-toggle"
223
292
  anchorRef={triggerRef}
@@ -240,26 +309,7 @@ const Typedown = ({
240
309
  >
241
310
  {dropDown()}
242
311
  </Popper>
243
- {displayValue &&
244
- <div
245
- className={classnames(
246
- css.selectedDisplay
247
- )}
248
- >
249
- <div
250
- className={css.selectedItem}
251
- >
252
- {renderItem(input.value)}
253
- </div>
254
- {displayClearItem &&
255
- <IconButton
256
- className={css.clearItem}
257
- icon="times-circle-solid"
258
- onClick={() => handleChange()}
259
- />
260
- }
261
- </div>
262
- }
312
+ {displayValue && renderSelectedItem()}
263
313
  </div>
264
314
  );
265
315
  };
@@ -275,6 +325,7 @@ Typedown.propTypes = {
275
325
  PropTypes.element
276
326
  ]),
277
327
  filterPath: PropTypes.string,
328
+ getDisplayValue: PropTypes.func,
278
329
  id: PropTypes.string,
279
330
  initialOpenDelay: PropTypes.number,
280
331
  input: PropTypes.object,
@@ -286,8 +337,10 @@ Typedown.propTypes = {
286
337
  meta: PropTypes.object,
287
338
  onChange: PropTypes.func,
288
339
  onType: PropTypes.func,
340
+ renderHeader: PropTypes.func,
289
341
  renderFooter: PropTypes.func,
290
342
  renderListItem: PropTypes.func,
343
+ renderTrigger: PropTypes.func,
291
344
  required: PropTypes.bool,
292
345
  selectedStyles: PropTypes.string,
293
346
  uniqueIdentificationPath: PropTypes.string