@oracle/oraclejet-core-pack 14.0.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 (517) hide show
  1. package/oj-c/Avatar.json +458 -0
  2. package/oj-c/Button.json +536 -0
  3. package/oj-c/Collapsible.json +396 -0
  4. package/oj-c/FilePicker.json +555 -0
  5. package/oj-c/InputNumber.json +1321 -0
  6. package/oj-c/InputPassword.json +1164 -0
  7. package/oj-c/InputText.json +1411 -0
  8. package/oj-c/ListItemLayout.json +313 -0
  9. package/oj-c/MessageToast.json +334 -0
  10. package/oj-c/MeterBar.json +735 -0
  11. package/oj-c/MeterCircle.json +797 -0
  12. package/oj-c/ProgressBar.json +212 -0
  13. package/oj-c/ProgressCircle.json +223 -0
  14. package/oj-c/RatingGauge.json +495 -0
  15. package/oj-c/SelectMultiple.json +1143 -0
  16. package/oj-c/SelectSingle.json +1450 -0
  17. package/oj-c/SplitMenuButton.json +495 -0
  18. package/oj-c/TextArea.json +1283 -0
  19. package/oj-c/avatar/__webdriver__/AvatarWebElement.js +32 -0
  20. package/oj-c/avatar/__webdriver__/AvatarWebElementBase.js +87 -0
  21. package/oj-c/avatar/__webdriver__/index.js +74 -0
  22. package/oj-c/avatar/avatar-styles.css +10 -0
  23. package/oj-c/avatar/avatar.js +27 -0
  24. package/oj-c/avatar/component.json +227 -0
  25. package/oj-c/avatar/index.js +6 -0
  26. package/oj-c/avatar.js +6 -0
  27. package/oj-c/button/__tests__/button.test.js +20 -0
  28. package/oj-c/button/__webdriver__/ButtonWebElement.js +96 -0
  29. package/oj-c/button/__webdriver__/ButtonWebElementBase.js +96 -0
  30. package/oj-c/button/__webdriver__/index.js +74 -0
  31. package/oj-c/button/button-styles.css +11 -0
  32. package/oj-c/button/button.js +71 -0
  33. package/oj-c/button/component.json +243 -0
  34. package/oj-c/button/index.js +6 -0
  35. package/oj-c/button.js +6 -0
  36. package/oj-c/collapsible/__webdriver__/CollapsibleWebElement.js +116 -0
  37. package/oj-c/collapsible/__webdriver__/CollapsibleWebElementBase.js +60 -0
  38. package/oj-c/collapsible/__webdriver__/index.js +74 -0
  39. package/oj-c/collapsible/collapsible-styles.css +11 -0
  40. package/oj-c/collapsible/collapsible.js +69 -0
  41. package/oj-c/collapsible/component.json +184 -0
  42. package/oj-c/collapsible/index.js +6 -0
  43. package/oj-c/collapsible.js +6 -0
  44. package/oj-c/component.json +104 -0
  45. package/oj-c/corepackbundle.js +4049 -0
  46. package/oj-c/docs/avatar.html +149 -0
  47. package/oj-c/docs/button.html +149 -0
  48. package/oj-c/docs/collapsible.html +149 -0
  49. package/oj-c/docs/file-picker.html +149 -0
  50. package/oj-c/docs/index.html +168 -0
  51. package/oj-c/docs/input-number.html +149 -0
  52. package/oj-c/docs/input-password.html +149 -0
  53. package/oj-c/docs/input-text.html +149 -0
  54. package/oj-c/docs/jsDocMd.json +1 -0
  55. package/oj-c/docs/list-item-layout.html +149 -0
  56. package/oj-c/docs/message-toast.html +149 -0
  57. package/oj-c/docs/meter-bar.html +149 -0
  58. package/oj-c/docs/meter-circle.html +149 -0
  59. package/oj-c/docs/oj-c.Avatar.html +1778 -0
  60. package/oj-c/docs/oj-c.Button.html +2065 -0
  61. package/oj-c/docs/oj-c.Collapsible.html +1990 -0
  62. package/oj-c/docs/oj-c.FilePicker.html +2380 -0
  63. package/oj-c/docs/oj-c.InputNumber.html +5850 -0
  64. package/oj-c/docs/oj-c.InputPassword.html +4891 -0
  65. package/oj-c/docs/oj-c.InputText.html +5772 -0
  66. package/oj-c/docs/oj-c.ListItemLayout.html +1549 -0
  67. package/oj-c/docs/oj-c.MessageToast.html +1574 -0
  68. package/oj-c/docs/oj-c.MeterBar.html +3193 -0
  69. package/oj-c/docs/oj-c.MeterCircle.html +3502 -0
  70. package/oj-c/docs/oj-c.ProgressBar.html +1122 -0
  71. package/oj-c/docs/oj-c.ProgressCircle.html +1138 -0
  72. package/oj-c/docs/oj-c.RatingGauge.html +2320 -0
  73. package/oj-c/docs/oj-c.SelectMultiple.html +4720 -0
  74. package/oj-c/docs/oj-c.SelectSingle.html +5920 -0
  75. package/oj-c/docs/oj-c.SplitMenuButton.html +1891 -0
  76. package/oj-c/docs/oj-c.TextArea.html +5447 -0
  77. package/oj-c/docs/progress-bar.html +149 -0
  78. package/oj-c/docs/progress-circle.html +149 -0
  79. package/oj-c/docs/rating-gauge.html +149 -0
  80. package/oj-c/docs/scripts/deprecated.js +268 -0
  81. package/oj-c/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  82. package/oj-c/docs/scripts/prettify/lang-css.js +9 -0
  83. package/oj-c/docs/scripts/prettify/prettify.js +35 -0
  84. package/oj-c/docs/select-multiple.html +149 -0
  85. package/oj-c/docs/select-single.html +149 -0
  86. package/oj-c/docs/split-menu-button.html +149 -0
  87. package/oj-c/docs/styles/images/bookmark.png +0 -0
  88. package/oj-c/docs/styles/images/linesarrowup.png +0 -0
  89. package/oj-c/docs/styles/images/linesarrowup_blue.png +0 -0
  90. package/oj-c/docs/styles/images/linesarrowup_hov.png +0 -0
  91. package/oj-c/docs/styles/images/linesarrowup_white.png +0 -0
  92. package/oj-c/docs/styles/images/oracle_logo_sm.png +0 -0
  93. package/oj-c/docs/styles/jsdoc-default.css +851 -0
  94. package/oj-c/docs/styles/prettify-jsdoc.css +111 -0
  95. package/oj-c/docs/styles/prettify-tomorrow.css +132 -0
  96. package/oj-c/docs/text-area.html +149 -0
  97. package/oj-c/editable-value/UNSAFE_useAssistiveText/useAssistiveText.js +57 -0
  98. package/oj-c/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.js +80 -0
  99. package/oj-c/editable-value/UNSAFE_useConverter/useConverter.js +56 -0
  100. package/oj-c/editable-value/UNSAFE_useConverterLifecycle/useConverterLifecycle.js +26 -0
  101. package/oj-c/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators.js +22 -0
  102. package/oj-c/editable-value/UNSAFE_useEditableValue/useEditableValue.js +154 -0
  103. package/oj-c/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity.js +17 -0
  104. package/oj-c/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle.js +118 -0
  105. package/oj-c/editable-value/UNSAFE_useValidators/useValidators.js +153 -0
  106. package/oj-c/editable-value/UNSAFE_useValue/useValue.js +42 -0
  107. package/oj-c/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.js +27 -0
  108. package/oj-c/editable-value/component.json +9 -0
  109. package/oj-c/editable-value/utils/utils.js +31 -0
  110. package/oj-c/file-picker/__webdriver__/FilePickerWebElement.js +32 -0
  111. package/oj-c/file-picker/__webdriver__/FilePickerWebElementBase.js +87 -0
  112. package/oj-c/file-picker/__webdriver__/index.js +74 -0
  113. package/oj-c/file-picker/component.json +209 -0
  114. package/oj-c/file-picker/file-picker-styles.css +17 -0
  115. package/oj-c/file-picker/file-picker.js +59 -0
  116. package/oj-c/file-picker/index.js +6 -0
  117. package/oj-c/file-picker.js +6 -0
  118. package/oj-c/hooks/UNSAFE_useDataProvider/DataProviderHandler.js +89 -0
  119. package/oj-c/hooks/UNSAFE_useDataProvider/useDataProvider.js +25 -0
  120. package/oj-c/hooks/UNSAFE_useDataProvider/utils.js +202 -0
  121. package/oj-c/hooks/UNSAFE_useListData/__tests__/useListData.test.js +124 -0
  122. package/oj-c/hooks/UNSAFE_useListData/useListData.js +297 -0
  123. package/oj-c/hooks/UNSAFE_useTreeData/__tests__/useTreeData.test.js +62 -0
  124. package/oj-c/hooks/UNSAFE_useTreeData/useTreeData.js +130 -0
  125. package/oj-c/hooks/component.json +9 -0
  126. package/oj-c/input-number/__dev__/input-number.doc.mdx +31 -0
  127. package/oj-c/input-number/__webdriver__/InputNumberWebElement.js +32 -0
  128. package/oj-c/input-number/__webdriver__/InputNumberWebElementBase.js +339 -0
  129. package/oj-c/input-number/__webdriver__/index.js +74 -0
  130. package/oj-c/input-number/component.json +536 -0
  131. package/oj-c/input-number/index.js +6 -0
  132. package/oj-c/input-number/input-number-styles.css +13 -0
  133. package/oj-c/input-number/input-number.js +119 -0
  134. package/oj-c/input-number/stepBasisUtils.js +76 -0
  135. package/oj-c/input-number/useImplicitNumberConverter.js +12 -0
  136. package/oj-c/input-number/useImplicitNumberRangeValidator.js +28 -0
  137. package/oj-c/input-number/useNumberInputTextPreact.js +153 -0
  138. package/oj-c/input-number.js +6 -0
  139. package/oj-c/input-password/__webdriver__/InputPasswordWebElement.js +32 -0
  140. package/oj-c/input-password/__webdriver__/InputPasswordWebElementBase.js +258 -0
  141. package/oj-c/input-password/__webdriver__/index.js +74 -0
  142. package/oj-c/input-password/component.json +488 -0
  143. package/oj-c/input-password/index.js +6 -0
  144. package/oj-c/input-password/input-password-styles.css +13 -0
  145. package/oj-c/input-password/input-password.js +112 -0
  146. package/oj-c/input-password/useInputPasswordPreact.js +46 -0
  147. package/oj-c/input-password.js +6 -0
  148. package/oj-c/input-text/__dev__/input-text.doc.mdx +30 -0
  149. package/oj-c/input-text/__tests__/input-text.test.js +70 -0
  150. package/oj-c/input-text/__webdriver__/InputTextWebElement.js +32 -0
  151. package/oj-c/input-text/__webdriver__/InputTextWebElementBase.js +294 -0
  152. package/oj-c/input-text/__webdriver__/index.js +74 -0
  153. package/oj-c/input-text/component.json +580 -0
  154. package/oj-c/input-text/index.js +6 -0
  155. package/oj-c/input-text/input-text-styles.css +13 -0
  156. package/oj-c/input-text/input-text.js +118 -0
  157. package/oj-c/input-text/useInputTextPreact.js +46 -0
  158. package/oj-c/input-text.js +6 -0
  159. package/oj-c/list-item-layout/__webdriver__/ListItemLayoutWebElement.js +32 -0
  160. package/oj-c/list-item-layout/__webdriver__/ListItemLayoutWebElementBase.js +42 -0
  161. package/oj-c/list-item-layout/__webdriver__/index.js +74 -0
  162. package/oj-c/list-item-layout/component.json +139 -0
  163. package/oj-c/list-item-layout/index.js +6 -0
  164. package/oj-c/list-item-layout/list-item-layout-styles.css +12 -0
  165. package/oj-c/list-item-layout/list-item-layout.js +30 -0
  166. package/oj-c/list-item-layout.js +6 -0
  167. package/oj-c/message-toast/__webdriver__/MessageToastWebElement.js +32 -0
  168. package/oj-c/message-toast/__webdriver__/MessageToastWebElementBase.js +78 -0
  169. package/oj-c/message-toast/__webdriver__/index.js +74 -0
  170. package/oj-c/message-toast/component.json +244 -0
  171. package/oj-c/message-toast/index.js +6 -0
  172. package/oj-c/message-toast/message-toast-styles.css +8 -0
  173. package/oj-c/message-toast/message-toast.js +35 -0
  174. package/oj-c/message-toast.js +6 -0
  175. package/oj-c/metadata/allComponents.json +5552 -0
  176. package/oj-c/meter-bar/__webdriver__/MeterBarWebElement.js +32 -0
  177. package/oj-c/meter-bar/__webdriver__/MeterBarWebElementBase.js +195 -0
  178. package/oj-c/meter-bar/__webdriver__/index.js +74 -0
  179. package/oj-c/meter-bar/component.json +246 -0
  180. package/oj-c/meter-bar/index.js +6 -0
  181. package/oj-c/meter-bar/meter-bar-styles.css +21 -0
  182. package/oj-c/meter-bar/meter-bar.js +44 -0
  183. package/oj-c/meter-bar.js +6 -0
  184. package/oj-c/meter-circle/__webdriver__/MeterCircleWebElement.js +32 -0
  185. package/oj-c/meter-circle/__webdriver__/MeterCircleWebElementBase.js +213 -0
  186. package/oj-c/meter-circle/__webdriver__/index.js +74 -0
  187. package/oj-c/meter-circle/component.json +289 -0
  188. package/oj-c/meter-circle/index.js +6 -0
  189. package/oj-c/meter-circle/meter-circle-styles.css +14 -0
  190. package/oj-c/meter-circle/meter-circle.js +47 -0
  191. package/oj-c/meter-circle.js +6 -0
  192. package/oj-c/min/avatar/avatar-styles.css +10 -0
  193. package/oj-c/min/avatar.js +2 -0
  194. package/oj-c/min/avatar.js.map +1 -0
  195. package/oj-c/min/button/button-styles.css +11 -0
  196. package/oj-c/min/button.js +2 -0
  197. package/oj-c/min/button.js.map +1 -0
  198. package/oj-c/min/collapsible/collapsible-styles.css +11 -0
  199. package/oj-c/min/collapsible.js +2 -0
  200. package/oj-c/min/collapsible.js.map +1 -0
  201. package/oj-c/min/corepackbundle.css +226 -0
  202. package/oj-c/min/corepackbundle.js +6 -0
  203. package/oj-c/min/corepackbundle.js.map +1 -0
  204. package/oj-c/min/editable-value/UNSAFE_useAssistiveText/useAssistiveText.d.ts +32 -0
  205. package/oj-c/min/editable-value/UNSAFE_useAssistiveText/useAssistiveText.js +57 -0
  206. package/oj-c/min/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.d.ts +24 -0
  207. package/oj-c/min/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.js +80 -0
  208. package/oj-c/min/editable-value/UNSAFE_useConverter/useConverter.d.ts +14 -0
  209. package/oj-c/min/editable-value/UNSAFE_useConverter/useConverter.js +56 -0
  210. package/oj-c/min/editable-value/UNSAFE_useConverterLifecycle/useConverterLifecycle.d.ts +11 -0
  211. package/oj-c/min/editable-value/UNSAFE_useConverterLifecycle/useConverterLifecycle.js +26 -0
  212. package/oj-c/min/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators.d.ts +8 -0
  213. package/oj-c/min/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators.js +22 -0
  214. package/oj-c/min/editable-value/UNSAFE_useEditableValue/useEditableValue.d.ts +47 -0
  215. package/oj-c/min/editable-value/UNSAFE_useEditableValue/useEditableValue.js +154 -0
  216. package/oj-c/min/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity.d.ts +5 -0
  217. package/oj-c/min/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity.js +17 -0
  218. package/oj-c/min/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle.d.ts +15 -0
  219. package/oj-c/min/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle.js +118 -0
  220. package/oj-c/min/editable-value/UNSAFE_useValidators/useValidators.d.ts +35 -0
  221. package/oj-c/min/editable-value/UNSAFE_useValidators/useValidators.js +153 -0
  222. package/oj-c/min/editable-value/UNSAFE_useValue/useValue.d.ts +23 -0
  223. package/oj-c/min/editable-value/UNSAFE_useValue/useValue.js +42 -0
  224. package/oj-c/min/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.d.ts +9 -0
  225. package/oj-c/min/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.js +27 -0
  226. package/oj-c/min/editable-value/component.json +9 -0
  227. package/oj-c/min/editable-value/utils/utils.d.ts +6 -0
  228. package/oj-c/min/editable-value/utils/utils.js +31 -0
  229. package/oj-c/min/file-picker/file-picker-styles.css +17 -0
  230. package/oj-c/min/file-picker.js +2 -0
  231. package/oj-c/min/file-picker.js.map +1 -0
  232. package/oj-c/min/hooks/UNSAFE_useDataProvider/DataProviderHandler.d.ts +18 -0
  233. package/oj-c/min/hooks/UNSAFE_useDataProvider/DataProviderHandler.js +89 -0
  234. package/oj-c/min/hooks/UNSAFE_useDataProvider/useDataProvider.d.ts +10 -0
  235. package/oj-c/min/hooks/UNSAFE_useDataProvider/useDataProvider.js +25 -0
  236. package/oj-c/min/hooks/UNSAFE_useDataProvider/utils.d.ts +3 -0
  237. package/oj-c/min/hooks/UNSAFE_useDataProvider/utils.js +202 -0
  238. package/oj-c/min/hooks/UNSAFE_useListData/__tests__/useListData.test.d.ts +1 -0
  239. package/oj-c/min/hooks/UNSAFE_useListData/__tests__/useListData.test.js +124 -0
  240. package/oj-c/min/hooks/UNSAFE_useListData/useListData.d.ts +21 -0
  241. package/oj-c/min/hooks/UNSAFE_useListData/useListData.js +297 -0
  242. package/oj-c/min/hooks/UNSAFE_useTreeData/__tests__/useTreeData.test.d.ts +1 -0
  243. package/oj-c/min/hooks/UNSAFE_useTreeData/__tests__/useTreeData.test.js +62 -0
  244. package/oj-c/min/hooks/UNSAFE_useTreeData/useTreeData.d.ts +27 -0
  245. package/oj-c/min/hooks/UNSAFE_useTreeData/useTreeData.js +130 -0
  246. package/oj-c/min/hooks/component.json +9 -0
  247. package/oj-c/min/input-number/input-number-styles.css +13 -0
  248. package/oj-c/min/input-number.js +2 -0
  249. package/oj-c/min/input-number.js.map +1 -0
  250. package/oj-c/min/input-password/input-password-styles.css +13 -0
  251. package/oj-c/min/input-password.js +2 -0
  252. package/oj-c/min/input-password.js.map +1 -0
  253. package/oj-c/min/input-text/input-text-styles.css +13 -0
  254. package/oj-c/min/input-text.js +2 -0
  255. package/oj-c/min/input-text.js.map +1 -0
  256. package/oj-c/min/list-item-layout/list-item-layout-styles.css +12 -0
  257. package/oj-c/min/list-item-layout.js +2 -0
  258. package/oj-c/min/list-item-layout.js.map +1 -0
  259. package/oj-c/min/message-toast/message-toast-styles.css +8 -0
  260. package/oj-c/min/message-toast.js +2 -0
  261. package/oj-c/min/message-toast.js.map +1 -0
  262. package/oj-c/min/meter-bar/meter-bar-styles.css +21 -0
  263. package/oj-c/min/meter-bar.js +2 -0
  264. package/oj-c/min/meter-bar.js.map +1 -0
  265. package/oj-c/min/meter-circle/meter-circle-styles.css +14 -0
  266. package/oj-c/min/meter-circle.js +2 -0
  267. package/oj-c/min/meter-circle.js.map +1 -0
  268. package/oj-c/min/progress-bar/progress-bar-styles.css +11 -0
  269. package/oj-c/min/progress-bar.js +2 -0
  270. package/oj-c/min/progress-bar.js.map +1 -0
  271. package/oj-c/min/progress-circle/progress-circle-styles.css +14 -0
  272. package/oj-c/min/progress-circle.js +2 -0
  273. package/oj-c/min/progress-circle.js.map +1 -0
  274. package/oj-c/min/rating-gauge/rating-gauge-styles.css +12 -0
  275. package/oj-c/min/rating-gauge.js +2 -0
  276. package/oj-c/min/rating-gauge.js.map +1 -0
  277. package/oj-c/min/select-common/UNSAFE_useDataProviderListeners/index.d.ts +2 -0
  278. package/oj-c/min/select-common/UNSAFE_useDataProviderListeners/index.js +6 -0
  279. package/oj-c/min/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.d.ts +13 -0
  280. package/oj-c/min/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.js +96 -0
  281. package/oj-c/min/select-common/UNSAFE_useWrapDataProvider/index.d.ts +1 -0
  282. package/oj-c/min/select-common/UNSAFE_useWrapDataProvider/index.js +6 -0
  283. package/oj-c/min/select-common/UNSAFE_useWrapDataProvider/useWrapDataProvider.d.ts +3 -0
  284. package/oj-c/min/select-common/UNSAFE_useWrapDataProvider/useWrapDataProvider.js +16 -0
  285. package/oj-c/min/select-common/UNSAFE_useWrapValueState/index.d.ts +1 -0
  286. package/oj-c/min/select-common/UNSAFE_useWrapValueState/index.js +6 -0
  287. package/oj-c/min/select-common/UNSAFE_useWrapValueState/useWrapValueState.d.ts +23 -0
  288. package/oj-c/min/select-common/UNSAFE_useWrapValueState/useWrapValueState.js +23 -0
  289. package/oj-c/min/select-common/component.json +9 -0
  290. package/oj-c/min/select-common/utils/utils.d.ts +10 -0
  291. package/oj-c/min/select-common/utils/utils.js +19 -0
  292. package/oj-c/min/select-multiple/select-multiple-styles.css +13 -0
  293. package/oj-c/min/select-multiple.js +3 -0
  294. package/oj-c/min/select-multiple.js.map +1 -0
  295. package/oj-c/min/select-single/select-single-styles.css +22 -0
  296. package/oj-c/min/select-single.js +3 -0
  297. package/oj-c/min/select-single.js.map +1 -0
  298. package/oj-c/min/split-menu-button/split-menu-button-styles.css +11 -0
  299. package/oj-c/min/split-menu-button.js +2 -0
  300. package/oj-c/min/split-menu-button.js.map +1 -0
  301. package/oj-c/min/text-area/text-area-styles.css +13 -0
  302. package/oj-c/min/text-area.js +2 -0
  303. package/oj-c/min/text-area.js.map +1 -0
  304. package/oj-c/min/utils/UNSAFE_focusTabUtils/focusUtils.d.ts +2 -0
  305. package/oj-c/min/utils/UNSAFE_focusTabUtils/focusUtils.js +23 -0
  306. package/oj-c/min/utils/UNSAFE_focusTabUtils/index.d.ts +1 -0
  307. package/oj-c/min/utils/UNSAFE_focusTabUtils/index.js +6 -0
  308. package/oj-c/min/utils/UNSAFE_keyUtils/index.d.ts +1 -0
  309. package/oj-c/min/utils/UNSAFE_keyUtils/index.js +19 -0
  310. package/oj-c/min/utils/UNSAFE_keyUtils/keySetUtils.d.ts +4 -0
  311. package/oj-c/min/utils/UNSAFE_keyUtils/keySetUtils.js +33 -0
  312. package/oj-c/min/utils/UNSAFE_meterUtils/index.d.ts +1 -0
  313. package/oj-c/min/utils/UNSAFE_meterUtils/index.js +6 -0
  314. package/oj-c/min/utils/UNSAFE_meterUtils/meterUtils.d.ts +2 -0
  315. package/oj-c/min/utils/UNSAFE_meterUtils/meterUtils.js +12 -0
  316. package/oj-c/min/utils/component.json +9 -0
  317. package/oj-c/progress-bar/__webdriver__/ProgressBarWebElement.js +32 -0
  318. package/oj-c/progress-bar/__webdriver__/ProgressBarWebElementBase.js +60 -0
  319. package/oj-c/progress-bar/__webdriver__/index.js +74 -0
  320. package/oj-c/progress-bar/component.json +123 -0
  321. package/oj-c/progress-bar/index.js +6 -0
  322. package/oj-c/progress-bar/progress-bar-styles.css +11 -0
  323. package/oj-c/progress-bar/progress-bar.js +26 -0
  324. package/oj-c/progress-bar.js +6 -0
  325. package/oj-c/progress-circle/__webdriver__/ProgressCircleWebElement.js +32 -0
  326. package/oj-c/progress-circle/__webdriver__/ProgressCircleWebElementBase.js +60 -0
  327. package/oj-c/progress-circle/__webdriver__/index.js +74 -0
  328. package/oj-c/progress-circle/component.json +128 -0
  329. package/oj-c/progress-circle/index.js +6 -0
  330. package/oj-c/progress-circle/progress-circle-styles.css +14 -0
  331. package/oj-c/progress-circle/progress-circle.js +26 -0
  332. package/oj-c/progress-circle.js +6 -0
  333. package/oj-c/rating-gauge/__webdriver__/RatingGaugeWebElement.js +32 -0
  334. package/oj-c/rating-gauge/__webdriver__/RatingGaugeWebElementBase.js +168 -0
  335. package/oj-c/rating-gauge/__webdriver__/index.js +74 -0
  336. package/oj-c/rating-gauge/component.json +188 -0
  337. package/oj-c/rating-gauge/index.js +6 -0
  338. package/oj-c/rating-gauge/rating-gauge-styles.css +12 -0
  339. package/oj-c/rating-gauge/rating-gauge.js +44 -0
  340. package/oj-c/rating-gauge.js +6 -0
  341. package/oj-c/select-common/UNSAFE_useDataProviderListeners/index.js +6 -0
  342. package/oj-c/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.js +96 -0
  343. package/oj-c/select-common/UNSAFE_useWrapDataProvider/index.js +6 -0
  344. package/oj-c/select-common/UNSAFE_useWrapDataProvider/useWrapDataProvider.js +16 -0
  345. package/oj-c/select-common/UNSAFE_useWrapValueState/index.js +6 -0
  346. package/oj-c/select-common/UNSAFE_useWrapValueState/useWrapValueState.js +23 -0
  347. package/oj-c/select-common/component.json +9 -0
  348. package/oj-c/select-common/utils/utils.js +19 -0
  349. package/oj-c/select-multiple/__dev__/select-multiple.doc.mdx +30 -0
  350. package/oj-c/select-multiple/__webdriver__/SelectMultipleWebElement.js +32 -0
  351. package/oj-c/select-multiple/__webdriver__/SelectMultipleWebElementBase.js +258 -0
  352. package/oj-c/select-multiple/__webdriver__/index.js +74 -0
  353. package/oj-c/select-multiple/component.json +475 -0
  354. package/oj-c/select-multiple/index.js +6 -0
  355. package/oj-c/select-multiple/select-multiple-styles.css +13 -0
  356. package/oj-c/select-multiple/select-multiple.js +108 -0
  357. package/oj-c/select-multiple/useSelectMultiplePreact.js +123 -0
  358. package/oj-c/select-multiple/useSyncValueAndValueItems.js +125 -0
  359. package/oj-c/select-multiple/useValueItems.js +22 -0
  360. package/oj-c/select-multiple.js +6 -0
  361. package/oj-c/select-single/__dev__/select-single.doc.mdx +30 -0
  362. package/oj-c/select-single/__webdriver__/SelectSingleWebElement.js +32 -0
  363. package/oj-c/select-single/__webdriver__/SelectSingleWebElementBase.js +258 -0
  364. package/oj-c/select-single/__webdriver__/index.js +74 -0
  365. package/oj-c/select-single/component.json +545 -0
  366. package/oj-c/select-single/index.js +6 -0
  367. package/oj-c/select-single/select-single-styles.css +22 -0
  368. package/oj-c/select-single/select-single.js +108 -0
  369. package/oj-c/select-single/useSelectSinglePreact.js +157 -0
  370. package/oj-c/select-single/useSyncValueAndValueItem.js +110 -0
  371. package/oj-c/select-single/useValueItem.js +18 -0
  372. package/oj-c/select-single.js +6 -0
  373. package/oj-c/split-menu-button/__dev__/split-menu-button.doc.mdx +32 -0
  374. package/oj-c/split-menu-button/__tests__/split-menu-button.test.js +17 -0
  375. package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElement.js +32 -0
  376. package/oj-c/split-menu-button/__webdriver__/SplitMenuButtonWebElementBase.js +87 -0
  377. package/oj-c/split-menu-button/__webdriver__/index.js +74 -0
  378. package/oj-c/split-menu-button/component.json +205 -0
  379. package/oj-c/split-menu-button/index.js +6 -0
  380. package/oj-c/split-menu-button/split-menu-button-styles.css +11 -0
  381. package/oj-c/split-menu-button/split-menu-button.js +76 -0
  382. package/oj-c/split-menu-button.js +6 -0
  383. package/oj-c/text-area/__webdriver__/TextAreaWebElement.js +32 -0
  384. package/oj-c/text-area/__webdriver__/TextAreaWebElementBase.js +285 -0
  385. package/oj-c/text-area/__webdriver__/index.js +74 -0
  386. package/oj-c/text-area/component.json +497 -0
  387. package/oj-c/text-area/index.js +6 -0
  388. package/oj-c/text-area/text-area-styles.css +13 -0
  389. package/oj-c/text-area/text-area.js +138 -0
  390. package/oj-c/text-area/useTextAreaAutosizePreact.js +44 -0
  391. package/oj-c/text-area/useTextAreaPreact.js +46 -0
  392. package/oj-c/text-area.js +6 -0
  393. package/oj-c/types/avatar/avatar.d.ts +68 -0
  394. package/oj-c/types/avatar/index.d.ts +2 -0
  395. package/oj-c/types/button/__tests__/button.test.d.ts +1 -0
  396. package/oj-c/types/button/button.d.ts +91 -0
  397. package/oj-c/types/button/index.d.ts +2 -0
  398. package/oj-c/types/collapsible/collapsible.d.ts +88 -0
  399. package/oj-c/types/collapsible/index.d.ts +2 -0
  400. package/oj-c/types/editable-value/UNSAFE_useAssistiveText/useAssistiveText.d.ts +32 -0
  401. package/oj-c/types/editable-value/UNSAFE_useComponentMessaging/useComponentMessaging.d.ts +24 -0
  402. package/oj-c/types/editable-value/UNSAFE_useConverter/useConverter.d.ts +14 -0
  403. package/oj-c/types/editable-value/UNSAFE_useConverterLifecycle/useConverterLifecycle.d.ts +11 -0
  404. package/oj-c/types/editable-value/UNSAFE_useDeferredValidators/useDeferredValidators.d.ts +8 -0
  405. package/oj-c/types/editable-value/UNSAFE_useEditableValue/useEditableValue.d.ts +47 -0
  406. package/oj-c/types/editable-value/UNSAFE_useStaleIdentity/useStaleIdentity.d.ts +5 -0
  407. package/oj-c/types/editable-value/UNSAFE_useValidationLifecycle/useValidationLifecycle.d.ts +15 -0
  408. package/oj-c/types/editable-value/UNSAFE_useValidators/useValidators.d.ts +35 -0
  409. package/oj-c/types/editable-value/UNSAFE_useValue/useValue.d.ts +23 -0
  410. package/oj-c/types/editable-value/UNSAFE_useValueLifecycle/useValueLifecycle.d.ts +9 -0
  411. package/oj-c/types/editable-value/utils/utils.d.ts +6 -0
  412. package/oj-c/types/file-picker/file-picker.d.ts +103 -0
  413. package/oj-c/types/file-picker/index.d.ts +2 -0
  414. package/oj-c/types/hooks/UNSAFE_useDataProvider/DataProviderHandler.d.ts +18 -0
  415. package/oj-c/types/hooks/UNSAFE_useDataProvider/useDataProvider.d.ts +10 -0
  416. package/oj-c/types/hooks/UNSAFE_useDataProvider/utils.d.ts +3 -0
  417. package/oj-c/types/hooks/UNSAFE_useListData/__tests__/useListData.test.d.ts +1 -0
  418. package/oj-c/types/hooks/UNSAFE_useListData/useListData.d.ts +21 -0
  419. package/oj-c/types/hooks/UNSAFE_useTreeData/__tests__/useTreeData.test.d.ts +1 -0
  420. package/oj-c/types/hooks/UNSAFE_useTreeData/useTreeData.d.ts +27 -0
  421. package/oj-c/types/input-number/index.d.ts +2 -0
  422. package/oj-c/types/input-number/input-number.d.ts +231 -0
  423. package/oj-c/types/input-number/stepBasisUtils.d.ts +1 -0
  424. package/oj-c/types/input-number/useImplicitNumberConverter.d.ts +10 -0
  425. package/oj-c/types/input-number/useImplicitNumberRangeValidator.d.ts +17 -0
  426. package/oj-c/types/input-number/useNumberInputTextPreact.d.ts +54 -0
  427. package/oj-c/types/input-password/index.d.ts +2 -0
  428. package/oj-c/types/input-password/input-password.d.ts +183 -0
  429. package/oj-c/types/input-password/useInputPasswordPreact.d.ts +40 -0
  430. package/oj-c/types/input-text/__tests__/input-text.test.d.ts +1 -0
  431. package/oj-c/types/input-text/index.d.ts +2 -0
  432. package/oj-c/types/input-text/input-text.d.ts +212 -0
  433. package/oj-c/types/input-text/useInputTextPreact.d.ts +47 -0
  434. package/oj-c/types/list-item-layout/index.d.ts +2 -0
  435. package/oj-c/types/list-item-layout/list-item-layout.d.ts +53 -0
  436. package/oj-c/types/message-toast/index.d.ts +2 -0
  437. package/oj-c/types/message-toast/message-toast.d.ts +83 -0
  438. package/oj-c/types/meter-bar/index.d.ts +2 -0
  439. package/oj-c/types/meter-bar/meter-bar.d.ts +133 -0
  440. package/oj-c/types/meter-circle/index.d.ts +2 -0
  441. package/oj-c/types/meter-circle/meter-circle.d.ts +148 -0
  442. package/oj-c/types/progress-bar/index.d.ts +2 -0
  443. package/oj-c/types/progress-bar/progress-bar.d.ts +53 -0
  444. package/oj-c/types/progress-circle/index.d.ts +2 -0
  445. package/oj-c/types/progress-circle/progress-circle.d.ts +53 -0
  446. package/oj-c/types/rating-gauge/index.d.ts +2 -0
  447. package/oj-c/types/rating-gauge/rating-gauge.d.ts +109 -0
  448. package/oj-c/types/select-common/UNSAFE_useDataProviderListeners/index.d.ts +2 -0
  449. package/oj-c/types/select-common/UNSAFE_useDataProviderListeners/useDataProviderListeners.d.ts +13 -0
  450. package/oj-c/types/select-common/UNSAFE_useWrapDataProvider/index.d.ts +1 -0
  451. package/oj-c/types/select-common/UNSAFE_useWrapDataProvider/useWrapDataProvider.d.ts +3 -0
  452. package/oj-c/types/select-common/UNSAFE_useWrapValueState/index.d.ts +1 -0
  453. package/oj-c/types/select-common/UNSAFE_useWrapValueState/useWrapValueState.d.ts +23 -0
  454. package/oj-c/types/select-common/utils/utils.d.ts +10 -0
  455. package/oj-c/types/select-multiple/index.d.ts +2 -0
  456. package/oj-c/types/select-multiple/select-multiple.d.ts +176 -0
  457. package/oj-c/types/select-multiple/useSelectMultiplePreact.d.ts +42 -0
  458. package/oj-c/types/select-multiple/useSyncValueAndValueItems.d.ts +17 -0
  459. package/oj-c/types/select-multiple/useValueItems.d.ts +6 -0
  460. package/oj-c/types/select-single/index.d.ts +2 -0
  461. package/oj-c/types/select-single/select-single.d.ts +186 -0
  462. package/oj-c/types/select-single/useSelectSinglePreact.d.ts +42 -0
  463. package/oj-c/types/select-single/useSyncValueAndValueItem.d.ts +17 -0
  464. package/oj-c/types/select-single/useValueItem.d.ts +5 -0
  465. package/oj-c/types/split-menu-button/__tests__/split-menu-button.test.d.ts +1 -0
  466. package/oj-c/types/split-menu-button/index.d.ts +2 -0
  467. package/oj-c/types/split-menu-button/split-menu-button.d.ts +93 -0
  468. package/oj-c/types/text-area/index.d.ts +2 -0
  469. package/oj-c/types/text-area/text-area.d.ts +209 -0
  470. package/oj-c/types/text-area/useTextAreaAutosizePreact.d.ts +44 -0
  471. package/oj-c/types/text-area/useTextAreaPreact.d.ts +44 -0
  472. package/oj-c/types/utils/UNSAFE_focusTabUtils/focusUtils.d.ts +2 -0
  473. package/oj-c/types/utils/UNSAFE_focusTabUtils/index.d.ts +1 -0
  474. package/oj-c/types/utils/UNSAFE_keyUtils/index.d.ts +1 -0
  475. package/oj-c/types/utils/UNSAFE_keyUtils/keySetUtils.d.ts +4 -0
  476. package/oj-c/types/utils/UNSAFE_meterUtils/index.d.ts +1 -0
  477. package/oj-c/types/utils/UNSAFE_meterUtils/meterUtils.d.ts +2 -0
  478. package/oj-c/utils/UNSAFE_focusTabUtils/focusUtils.js +23 -0
  479. package/oj-c/utils/UNSAFE_focusTabUtils/index.js +6 -0
  480. package/oj-c/utils/UNSAFE_keyUtils/index.js +19 -0
  481. package/oj-c/utils/UNSAFE_keyUtils/keySetUtils.js +33 -0
  482. package/oj-c/utils/UNSAFE_meterUtils/index.js +6 -0
  483. package/oj-c/utils/UNSAFE_meterUtils/meterUtils.js +12 -0
  484. package/oj-c/utils/component.json +9 -0
  485. package/package.json +22 -0
  486. package/webdriver/docs/.nojekyll +1 -0
  487. package/webdriver/docs/assets/highlight.css +78 -0
  488. package/webdriver/docs/assets/icons.css +1043 -0
  489. package/webdriver/docs/assets/icons.png +0 -0
  490. package/webdriver/docs/assets/icons@2x.png +0 -0
  491. package/webdriver/docs/assets/main.js +52 -0
  492. package/webdriver/docs/assets/search.js +1 -0
  493. package/webdriver/docs/assets/style.css +1414 -0
  494. package/webdriver/docs/assets/widgets.png +0 -0
  495. package/webdriver/docs/assets/widgets@2x.png +0 -0
  496. package/webdriver/docs/classes/AvatarWebElement.html +117 -0
  497. package/webdriver/docs/classes/ButtonWebElement.html +163 -0
  498. package/webdriver/docs/classes/CollapsibleWebElement.html +111 -0
  499. package/webdriver/docs/classes/FilePickerWebElement.html +117 -0
  500. package/webdriver/docs/classes/InputNumberWebElement.html +231 -0
  501. package/webdriver/docs/classes/InputPasswordWebElement.html +195 -0
  502. package/webdriver/docs/classes/InputTextWebElement.html +211 -0
  503. package/webdriver/docs/classes/ListItemLayoutWebElement.html +97 -0
  504. package/webdriver/docs/classes/MessageToastWebElement.html +113 -0
  505. package/webdriver/docs/classes/MeterBarWebElement.html +153 -0
  506. package/webdriver/docs/classes/MeterCircleWebElement.html +159 -0
  507. package/webdriver/docs/classes/ProgressBarWebElement.html +105 -0
  508. package/webdriver/docs/classes/ProgressCircleWebElement.html +105 -0
  509. package/webdriver/docs/classes/RatingGaugeWebElement.html +147 -0
  510. package/webdriver/docs/classes/SelectMultipleWebElement.html +196 -0
  511. package/webdriver/docs/classes/SelectSingleWebElement.html +196 -0
  512. package/webdriver/docs/classes/SplitMenuButtonWebElement.html +117 -0
  513. package/webdriver/docs/classes/TextAreaWebElement.html +207 -0
  514. package/webdriver/docs/index.html +16 -0
  515. package/webdriver/docs/modules.html +181 -0
  516. package/webdriver/index.js +34 -0
  517. package/webdriver/index.ts +18 -0
@@ -0,0 +1,11 @@
1
+ /// <reference types="ojconverter" />
2
+ import Converter from 'ojs/ojconverter';
3
+ import { ValidationState } from '../UNSAFE_useValidators/useValidators';
4
+ declare type UseConverterLifecycleProps<V> = {
5
+ converter?: Converter<V>;
6
+ validationState: ValidationState<V>;
7
+ refreshDisplayValue: () => void;
8
+ runFullValidationAndUpdateValue: () => Promise<void>;
9
+ };
10
+ export declare function useConverterLifecycle<V>({ converter, validationState, refreshDisplayValue, runFullValidationAndUpdateValue }: UseConverterLifecycleProps<V>): void;
11
+ export {};
@@ -0,0 +1,26 @@
1
+ define(["require", "exports", "preact/hooks"], function (require, exports, hooks_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useConverterLifecycle = void 0;
5
+ function useConverterLifecycle({ converter, validationState, refreshDisplayValue, runFullValidationAndUpdateValue }) {
6
+ const prevConverterRef = (0, hooks_1.useRef)(converter);
7
+ (0, hooks_1.useEffect)(() => {
8
+ if (prevConverterRef.current === converter) {
9
+ return;
10
+ }
11
+ prevConverterRef.current = converter;
12
+ const { valid } = validationState;
13
+ switch (valid) {
14
+ case 'invalidShown':
15
+ runFullValidationAndUpdateValue();
16
+ break;
17
+ case 'valid':
18
+ case 'invalidHidden':
19
+ default:
20
+ refreshDisplayValue();
21
+ break;
22
+ }
23
+ }, [converter, validationState, refreshDisplayValue, runFullValidationAndUpdateValue]);
24
+ }
25
+ exports.useConverterLifecycle = useConverterLifecycle;
26
+ });
@@ -0,0 +1,8 @@
1
+ import { ValidatorLike } from '../UNSAFE_useValidators/useValidators';
2
+ declare type UseDeferredValidatorsProps = {
3
+ labelHint?: string;
4
+ required?: boolean;
5
+ requiredMessageDetail?: string;
6
+ };
7
+ export declare function useDeferredValidators<V>({ labelHint, required, requiredMessageDetail }: UseDeferredValidatorsProps): ValidatorLike<V>[];
8
+ export {};
@@ -0,0 +1,22 @@
1
+ var __importDefault = (this && this.__importDefault) || function (mod) {
2
+ return (mod && mod.__esModule) ? mod : { "default": mod };
3
+ };
4
+ define(["require", "exports", "ojs/ojvalidator-required", "preact/hooks"], function (require, exports, ojvalidator_required_1, hooks_1) {
5
+ "use strict";
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.useDeferredValidators = void 0;
8
+ ojvalidator_required_1 = __importDefault(ojvalidator_required_1);
9
+ function useDeferredValidators({ labelHint, required, requiredMessageDetail }) {
10
+ const requiredValidator = (0, hooks_1.useMemo)(() => {
11
+ if (required) {
12
+ return new ojvalidator_required_1.default({
13
+ label: labelHint,
14
+ messageDetail: requiredMessageDetail
15
+ });
16
+ }
17
+ return null;
18
+ }, [required]);
19
+ return (0, hooks_1.useMemo)(() => [requiredValidator].filter(Boolean), [requiredValidator]);
20
+ }
21
+ exports.useDeferredValidators = useDeferredValidators;
22
+ });
@@ -0,0 +1,47 @@
1
+ import { ValueUpdateDetail } from '@oracle/oraclejet-preact/utils/UNSAFE_valueUpdateDetail';
2
+ import { UseComponentMessagingProps } from '../UNSAFE_useComponentMessaging/useComponentMessaging';
3
+ import { ConverterErrorSymbol, UseConverterProps } from '../UNSAFE_useConverter/useConverter';
4
+ import { UseValidatorsProps, ValidationResult } from '../UNSAFE_useValidators/useValidators';
5
+ import { UseValueProps, ValueState } from '../UNSAFE_useValue/useValue';
6
+ import { ValidatorLike } from '../UNSAFE_useValidators/useValidators';
7
+ declare type PickedComponentMessagingProps = Pick<UseComponentMessagingProps, 'messagesCustom' | 'onMessagesCustomChanged'>;
8
+ declare type PickedConverterProps<V> = Pick<UseConverterProps<V>, 'converter'>;
9
+ declare type PickedValidatorsProps<V> = Pick<UseValidatorsProps<V>, 'validators' | 'addBusyState' | 'onValidChanged'>;
10
+ declare type PickedValueProps<V> = Pick<UseValueProps<V>, 'onRawValueChanged' | 'onTransientValueChanged' | 'onValueChanged' | 'value'>;
11
+ declare type AriaProps = {
12
+ ariaDescribedBy?: string;
13
+ };
14
+ export declare type UseEditableValueProps<V> = PickedComponentMessagingProps & PickedConverterProps<V> & PickedValidatorsProps<V> & PickedValueProps<V> & AriaProps & {
15
+ displayOptions?: {
16
+ messages?: 'display' | 'none';
17
+ };
18
+ implicitComponentValidator?: ValidatorLike<V>;
19
+ labelHint?: string;
20
+ required?: boolean;
21
+ requiredMessageDetail?: string;
22
+ shouldNormalizeValueOnCommit?: boolean;
23
+ wrapValueState?: (valueState: ValueState<V>) => ValueState<V>;
24
+ };
25
+ export declare function useEditableValue<V>({ ariaDescribedBy, converter, displayOptions, implicitComponentValidator, labelHint, messagesCustom, required, requiredMessageDetail, shouldNormalizeValueOnCommit, validators, value: valueProp, addBusyState, onMessagesCustomChanged, onRawValueChanged, onValidChanged, onValueChanged, onTransientValueChanged, wrapValueState }: UseEditableValueProps<V>): {
26
+ value: V;
27
+ setValue: import("preact/hooks").StateUpdater<V>;
28
+ displayValue: string;
29
+ setDisplayValue: import("preact/hooks").StateUpdater<string>;
30
+ setTransientValue: import("preact/hooks").StateUpdater<V>;
31
+ methods: {
32
+ reset: () => void;
33
+ validate: () => Promise<'valid' | 'invalid'>;
34
+ showMessages: () => void;
35
+ };
36
+ textFieldProps: {
37
+ messages: import("@oracle/oraclejet-preact/UNSAFE_ComponentMessage").ComponentMessageItem[] | undefined;
38
+ value: string;
39
+ ariaDescribedBy: string | undefined;
40
+ onCommit: ({ value }: ValueUpdateDetail<string>) => Promise<void>;
41
+ onInput: ({ value }: ValueUpdateDetail<string>) => void;
42
+ };
43
+ onCommitValue: (value: V, doCommitOnValid?: boolean) => Promise<ValidationResult>;
44
+ format: (value: V, shouldSuppressError?: boolean) => string | null | undefined;
45
+ normalizeAndParseValue: (value: string) => typeof ConverterErrorSymbol | V | null;
46
+ };
47
+ export {};
@@ -0,0 +1,154 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ define(["require", "exports", "preact/hooks", "../UNSAFE_useComponentMessaging/useComponentMessaging", "../UNSAFE_useConverter/useConverter", "../UNSAFE_useConverterLifecycle/useConverterLifecycle", "../UNSAFE_useDeferredValidators/useDeferredValidators", "../UNSAFE_useValidationLifecycle/useValidationLifecycle", "../UNSAFE_useValidators/useValidators", "../UNSAFE_useValue/useValue", "../UNSAFE_useValueLifecycle/useValueLifecycle", "../utils/utils"], function (require, exports, hooks_1, useComponentMessaging_1, useConverter_1, useConverterLifecycle_1, useDeferredValidators_1, useValidationLifecycle_1, useValidators_1, useValue_1, useValueLifecycle_1, utils_1) {
11
+ "use strict";
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.useEditableValue = void 0;
14
+ function useEditableValue({ ariaDescribedBy, converter, displayOptions, implicitComponentValidator, labelHint, messagesCustom, required, requiredMessageDetail, shouldNormalizeValueOnCommit = true, validators, value: valueProp, addBusyState, onMessagesCustomChanged, onRawValueChanged, onValidChanged, onValueChanged, onTransientValueChanged, wrapValueState }) {
15
+ const componentMessagingState = (0, useComponentMessaging_1.useComponentMessaging)({
16
+ messagesCustom,
17
+ onMessagesCustomChanged
18
+ });
19
+ const { clearAllMessages, visibleMessages } = componentMessagingState;
20
+ const deferredValidators = (0, useDeferredValidators_1.useDeferredValidators)({
21
+ labelHint,
22
+ required,
23
+ requiredMessageDetail
24
+ });
25
+ const combinedValidators = !implicitComponentValidator
26
+ ? validators
27
+ : validators
28
+ ? [implicitComponentValidator, ...validators]
29
+ : [implicitComponentValidator];
30
+ const validationState = (0, useValidators_1.useValidators)({
31
+ componentMessagingState,
32
+ defaultValidState: 'valid',
33
+ deferredValidators,
34
+ validators: combinedValidators,
35
+ addBusyState,
36
+ onValidChanged
37
+ });
38
+ const { validateValueOnExternalChange, validateValueOnInternalChange } = validationState;
39
+ const { format, parse } = (0, useConverter_1.useConverter)({
40
+ componentMessagingState,
41
+ converter,
42
+ validationState
43
+ });
44
+ const defaultValueState = (0, useValue_1.useValue)({
45
+ value: valueProp,
46
+ format,
47
+ parse,
48
+ onRawValueChanged,
49
+ onTransientValueChanged,
50
+ onValueChanged
51
+ });
52
+ const valueState = wrapValueState ? wrapValueState(defaultValueState) : defaultValueState;
53
+ const { displayValue, value, getValueForValidation, setValueAfterValidation, refreshDisplayValue, setDisplayValue, setTransientValue, setValue } = valueState;
54
+ const { runFullValidationAndUpdateValue } = (0, useValidationLifecycle_1.useValidationLifecycle)({
55
+ componentMessagingState,
56
+ validationState,
57
+ deferredValidators,
58
+ validators,
59
+ getValueForValidation,
60
+ setValueAfterValidation
61
+ });
62
+ (0, useConverterLifecycle_1.useConverterLifecycle)({
63
+ converter,
64
+ validationState,
65
+ refreshDisplayValue,
66
+ runFullValidationAndUpdateValue
67
+ });
68
+ (0, useValueLifecycle_1.useValueLifecycle)({
69
+ value: valueProp,
70
+ valueState,
71
+ format,
72
+ validateValueOnExternalChange
73
+ });
74
+ const normalizeAndParseValue = (0, hooks_1.useCallback)((value) => {
75
+ return parse(shouldNormalizeValueOnCommit ? (0, utils_1.normalizeValue)(value) : value);
76
+ }, [shouldNormalizeValueOnCommit, parse]);
77
+ const onCommitValue = (0, hooks_1.useCallback)((value, doCommitOnValid = true) => __awaiter(this, void 0, void 0, function* () {
78
+ const validationResult = yield validateValueOnInternalChange(value);
79
+ if (validationResult === useValidators_1.ValidationResult.VALID && doCommitOnValid) {
80
+ setValue(value);
81
+ }
82
+ return validationResult;
83
+ }), [validateValueOnInternalChange]);
84
+ const onCommit = (0, hooks_1.useCallback)(({ value }) => __awaiter(this, void 0, void 0, function* () {
85
+ const parsedValueOrSymbol = normalizeAndParseValue(value);
86
+ if (parsedValueOrSymbol === useConverter_1.ConverterErrorSymbol) {
87
+ return;
88
+ }
89
+ const parsedValue = parsedValueOrSymbol;
90
+ const validationResult = yield onCommitValue(parsedValue);
91
+ if (validationResult === useValidators_1.ValidationResult.VALID) {
92
+ setDisplayValue(format(parsedValue));
93
+ }
94
+ }), [format, onCommitValue, normalizeAndParseValue]);
95
+ const onInput = (0, hooks_1.useCallback)(({ value }) => {
96
+ setDisplayValue(value !== null && value !== void 0 ? value : '');
97
+ }, []);
98
+ const reset = (0, hooks_1.useCallback)(() => {
99
+ clearAllMessages();
100
+ validateValueOnExternalChange(value);
101
+ refreshDisplayValue();
102
+ }, [value, clearAllMessages, refreshDisplayValue, validateValueOnExternalChange]);
103
+ const validate = (0, hooks_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
104
+ const { fullValidate } = validationState;
105
+ const { displayValue, value, setValueAfterValidation } = valueState;
106
+ const newValueOrSymbol = normalizeAndParseValue(displayValue);
107
+ if (newValueOrSymbol === useConverter_1.ConverterErrorSymbol) {
108
+ return 'invalid';
109
+ }
110
+ const newValue = newValueOrSymbol;
111
+ const resolver = addBusyState === null || addBusyState === void 0 ? void 0 : addBusyState('running component method validate');
112
+ const validateResult = yield fullValidate(newValue);
113
+ resolver === null || resolver === void 0 ? void 0 : resolver();
114
+ if (validateResult) {
115
+ if (newValue !== value) {
116
+ setValueAfterValidation(newValue);
117
+ }
118
+ return 'valid';
119
+ }
120
+ return 'invalid';
121
+ }), [validationState, valueState, addBusyState, normalizeAndParseValue]);
122
+ const showMessages = (0, hooks_1.useCallback)(() => {
123
+ const { hasHiddenMessages, showHiddenMessages } = componentMessagingState;
124
+ const { setValid } = validationState;
125
+ if (hasHiddenMessages()) {
126
+ showHiddenMessages();
127
+ setValid('invalidShown');
128
+ }
129
+ }, [componentMessagingState, validationState]);
130
+ return {
131
+ value,
132
+ setValue,
133
+ displayValue,
134
+ setDisplayValue,
135
+ setTransientValue,
136
+ methods: {
137
+ reset,
138
+ validate,
139
+ showMessages
140
+ },
141
+ textFieldProps: {
142
+ messages: (displayOptions === null || displayOptions === void 0 ? void 0 : displayOptions.messages) !== 'none' ? visibleMessages : undefined,
143
+ value: displayValue,
144
+ ariaDescribedBy,
145
+ onCommit,
146
+ onInput
147
+ },
148
+ onCommitValue,
149
+ format,
150
+ normalizeAndParseValue
151
+ };
152
+ }
153
+ exports.useEditableValue = useEditableValue;
154
+ });
@@ -0,0 +1,5 @@
1
+ export declare function useStaleIdentity(): {
2
+ setStaleIdentity: (id: `use${string}`) => {
3
+ isStale: () => boolean;
4
+ };
5
+ };
@@ -0,0 +1,17 @@
1
+ define(["require", "exports", "preact/hooks"], function (require, exports, hooks_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useStaleIdentity = void 0;
5
+ function useStaleIdentity() {
6
+ const staleIdentityMap = (0, hooks_1.useRef)(new Map());
7
+ const setStaleIdentity = (0, hooks_1.useCallback)((id) => {
8
+ const localStaleIdentity = Symbol();
9
+ staleIdentityMap.current.set(id, localStaleIdentity);
10
+ return {
11
+ isStale: () => localStaleIdentity !== staleIdentityMap.current.get(id)
12
+ };
13
+ }, []);
14
+ return { setStaleIdentity };
15
+ }
16
+ exports.useStaleIdentity = useStaleIdentity;
17
+ });
@@ -0,0 +1,15 @@
1
+ import { ComponentMessagingState } from '../UNSAFE_useComponentMessaging/useComponentMessaging';
2
+ import { ConverterErrorSymbol } from '../UNSAFE_useConverter/useConverter';
3
+ import { UseValidatorsProps, ValidationState, ValidState } from '../UNSAFE_useValidators/useValidators';
4
+ declare type PickedUseValidatorsProps<V> = Pick<UseValidatorsProps<V>, 'deferredValidators' | 'validators'>;
5
+ declare type UseValidationLifecycleProps<V> = PickedUseValidatorsProps<V> & {
6
+ componentMessagingState: ComponentMessagingState;
7
+ validationState: ValidationState<V>;
8
+ addBusyState?: (desc?: string) => () => void;
9
+ getValueForValidation: (valid: ValidState) => V | typeof ConverterErrorSymbol;
10
+ setValueAfterValidation: (value: V) => void;
11
+ };
12
+ export declare function useValidationLifecycle<V>({ componentMessagingState, deferredValidators, validationState, validators, getValueForValidation, setValueAfterValidation }: UseValidationLifecycleProps<V>): {
13
+ runFullValidationAndUpdateValue: () => Promise<void>;
14
+ };
15
+ export {};
@@ -0,0 +1,118 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ define(["require", "exports", "preact/hooks", "../UNSAFE_useConverter/useConverter", "../UNSAFE_useValidators/useValidators", "../utils/utils"], function (require, exports, hooks_1, useConverter_1, useValidators_1, utils_1) {
11
+ "use strict";
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.useValidationLifecycle = void 0;
14
+ function useValidationLifecycle({ componentMessagingState, deferredValidators, validationState, validators, getValueForValidation, setValueAfterValidation }) {
15
+ const prevDeferredValidatorsRef = (0, hooks_1.useRef)(deferredValidators);
16
+ const prevValidatorsRef = (0, hooks_1.useRef)(validators);
17
+ const prevMessagesCustomRef = (0, hooks_1.useRef)(componentMessagingState.messagesCustom);
18
+ const runFullValidationAndUpdateValue = (0, hooks_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
19
+ const { valid, validateValueOnInternalChange } = validationState;
20
+ const value = getValueForValidation(valid);
21
+ if (value === useConverter_1.ConverterErrorSymbol) {
22
+ return;
23
+ }
24
+ const validationResult = yield validateValueOnInternalChange(value, {
25
+ doNotClearMessagesCustom: true
26
+ });
27
+ if (validationResult === useValidators_1.ValidationResult.VALID) {
28
+ setValueAfterValidation(value);
29
+ }
30
+ }), [validationState, getValueForValidation, setValueAfterValidation]);
31
+ (0, hooks_1.useEffect)(() => {
32
+ const value = getValueForValidation('valid');
33
+ if (value === useConverter_1.ConverterErrorSymbol) {
34
+ return;
35
+ }
36
+ const { deferredValidate, setValid } = validationState;
37
+ const { hasCustomErrorMessages, setDeferredComponentMessages } = componentMessagingState;
38
+ const maybeErrors = deferredValidate(value);
39
+ if (maybeErrors) {
40
+ setDeferredComponentMessages(maybeErrors);
41
+ setValid('invalidHidden');
42
+ }
43
+ if (hasCustomErrorMessages()) {
44
+ setValid('invalidShown');
45
+ }
46
+ }, []);
47
+ (0, hooks_1.useEffect)(() => {
48
+ if (prevDeferredValidatorsRef.current === deferredValidators) {
49
+ return;
50
+ }
51
+ const { valid, deferredValidate, setValid } = validationState;
52
+ const { clearDeferredComponentMessages, setDeferredComponentMessages } = componentMessagingState;
53
+ prevDeferredValidatorsRef.current = deferredValidators;
54
+ switch (valid) {
55
+ case 'valid':
56
+ const value = getValueForValidation(valid);
57
+ if (value !== useConverter_1.ConverterErrorSymbol) {
58
+ const maybeErrors = deferredValidate(value);
59
+ if (maybeErrors) {
60
+ setDeferredComponentMessages(maybeErrors);
61
+ setValid('invalidHidden');
62
+ }
63
+ }
64
+ break;
65
+ case 'invalidHidden':
66
+ if (deferredValidators.length === 0) {
67
+ setValid('valid');
68
+ clearDeferredComponentMessages();
69
+ }
70
+ break;
71
+ case 'invalidShown':
72
+ runFullValidationAndUpdateValue();
73
+ break;
74
+ }
75
+ }, [
76
+ deferredValidators,
77
+ componentMessagingState,
78
+ validationState,
79
+ getValueForValidation,
80
+ runFullValidationAndUpdateValue
81
+ ]);
82
+ (0, hooks_1.useEffect)(() => {
83
+ if (prevValidatorsRef.current === validators) {
84
+ return;
85
+ }
86
+ prevValidatorsRef.current = validators;
87
+ switch (validationState.valid) {
88
+ case 'invalidShown':
89
+ runFullValidationAndUpdateValue();
90
+ break;
91
+ }
92
+ }, [validators, validationState]);
93
+ (0, hooks_1.useEffect)(() => {
94
+ if ((0, utils_1.isShallowEqual)(prevMessagesCustomRef.current, componentMessagingState.messagesCustom)) {
95
+ return;
96
+ }
97
+ const { messagesCustom, hasCustomErrorMessages, hasHiddenMessages, hasNoErrorMessages } = componentMessagingState;
98
+ const { valid, setValid } = validationState;
99
+ prevMessagesCustomRef.current = messagesCustom;
100
+ if (hasCustomErrorMessages()) {
101
+ setValid('invalidShown');
102
+ }
103
+ else if (valid === 'pending') {
104
+ return;
105
+ }
106
+ else if (hasNoErrorMessages()) {
107
+ setValid('valid');
108
+ }
109
+ else if (hasHiddenMessages()) {
110
+ setValid('invalidHidden');
111
+ }
112
+ }, [componentMessagingState, validationState]);
113
+ return {
114
+ runFullValidationAndUpdateValue
115
+ };
116
+ }
117
+ exports.useValidationLifecycle = useValidationLifecycle;
118
+ });
@@ -0,0 +1,35 @@
1
+ /// <reference types="ojvalidator" />
2
+ /// <reference types="ojvalidator-async" />
3
+ import { ComponentMessageItem } from '@oracle/oraclejet-preact/UNSAFE_ComponentMessage';
4
+ import Validator from 'ojs/ojvalidator';
5
+ import AsyncValidator from 'ojs/ojvalidator-async';
6
+ import { StateUpdater } from 'preact/hooks';
7
+ import { ComponentMessagingState } from '../UNSAFE_useComponentMessaging/useComponentMessaging';
8
+ export declare const ValidationResult: {
9
+ readonly VALID: "VALID";
10
+ readonly INVALID: "INVALID";
11
+ readonly STALE: "STALE";
12
+ };
13
+ export declare type ValidationResult = typeof ValidationResult[keyof typeof ValidationResult];
14
+ export declare type ValidState = 'valid' | 'pending' | 'invalidHidden' | 'invalidShown';
15
+ export declare type ValidatorLike<V> = Validator<V> | AsyncValidator<V>;
16
+ export declare type ValidationOptions = {
17
+ doNotClearMessagesCustom?: boolean;
18
+ };
19
+ export declare type ValidationState<V> = {
20
+ valid: ValidState;
21
+ setValid: StateUpdater<ValidState>;
22
+ deferredValidate: (value: V) => void | ComponentMessageItem[];
23
+ fullValidate: (value: V, options?: ValidationOptions) => Promise<boolean>;
24
+ validateValueOnInternalChange: (value: V, options?: ValidationOptions) => Promise<ValidationResult>;
25
+ validateValueOnExternalChange: (value: V) => ValidationResult;
26
+ };
27
+ export declare type UseValidatorsProps<V> = {
28
+ componentMessagingState: ComponentMessagingState;
29
+ defaultValidState?: ValidState;
30
+ deferredValidators?: ValidatorLike<V>[];
31
+ validators?: ValidatorLike<V>[];
32
+ addBusyState?: (desc?: string) => () => void;
33
+ onValidChanged?: (valid: ValidState) => void;
34
+ };
35
+ export declare function useValidators<V>({ componentMessagingState, defaultValidState, deferredValidators, validators, addBusyState, onValidChanged }: UseValidatorsProps<V>): ValidationState<V>;
@@ -0,0 +1,153 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ define(["require", "exports", "@oracle/oraclejet-preact/hooks/UNSAFE_useUncontrolledState", "preact/hooks", "../UNSAFE_useStaleIdentity/useStaleIdentity", "../utils/utils"], function (require, exports, UNSAFE_useUncontrolledState_1, hooks_1, useStaleIdentity_1, utils_1) {
11
+ "use strict";
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.useValidators = exports.ValidationResult = void 0;
14
+ exports.ValidationResult = {
15
+ VALID: 'VALID',
16
+ INVALID: 'INVALID',
17
+ STALE: 'STALE'
18
+ };
19
+ function useValidators({ componentMessagingState, defaultValidState, deferredValidators = [], validators = [], addBusyState, onValidChanged }) {
20
+ const [valid, setValid] = (0, UNSAFE_useUncontrolledState_1.useUncontrolledState)(defaultValidState, onValidChanged);
21
+ const { setStaleIdentity } = (0, useStaleIdentity_1.useStaleIdentity)();
22
+ (0, hooks_1.useLayoutEffect)(() => {
23
+ if (defaultValidState !== undefined) {
24
+ onValidChanged === null || onValidChanged === void 0 ? void 0 : onValidChanged(defaultValidState);
25
+ }
26
+ }, []);
27
+ const fullValidate = (0, hooks_1.useCallback)((value, options = {}) => __awaiter(this, void 0, void 0, function* () {
28
+ const { addComponentMessage, clearAllComponentMessages, clearAllMessages, hasCustomErrorMessages, setComponentMessages } = componentMessagingState;
29
+ const { doNotClearMessagesCustom = false } = options;
30
+ const hadCustomErrorMessages = hasCustomErrorMessages();
31
+ setValid('pending');
32
+ if (doNotClearMessagesCustom) {
33
+ clearAllComponentMessages();
34
+ }
35
+ else {
36
+ clearAllMessages();
37
+ }
38
+ if (validators.length === 0 && deferredValidators.length === 0) {
39
+ if (hadCustomErrorMessages && doNotClearMessagesCustom) {
40
+ setValid('invalidShown');
41
+ }
42
+ else {
43
+ setValid('valid');
44
+ }
45
+ return true;
46
+ }
47
+ const errors = [];
48
+ const maybeErrorsPromise = [];
49
+ for (const validator of [...deferredValidators, ...validators]) {
50
+ try {
51
+ const validateResult = validator.validate(value);
52
+ if (validateResult instanceof Promise) {
53
+ maybeErrorsPromise.push(validateResult.then(() => { }, (error) => (0, utils_1.createMessageFromError)(error)));
54
+ }
55
+ }
56
+ catch (error) {
57
+ errors.push((0, utils_1.createMessageFromError)(error));
58
+ }
59
+ }
60
+ if (!errors.length && !maybeErrorsPromise.length) {
61
+ if (hadCustomErrorMessages && doNotClearMessagesCustom) {
62
+ setValid('invalidShown');
63
+ }
64
+ else {
65
+ setValid('valid');
66
+ }
67
+ return true;
68
+ }
69
+ const hasSyncError = errors.length !== 0;
70
+ if (hasSyncError) {
71
+ setComponentMessages(errors);
72
+ setValid('invalidShown');
73
+ }
74
+ if (!maybeErrorsPromise.length) {
75
+ return !hasSyncError;
76
+ }
77
+ const resolver = addBusyState === null || addBusyState === void 0 ? void 0 : addBusyState('running validation');
78
+ const { isStale } = setStaleIdentity('useValidators-validate');
79
+ let hasAsyncError = false;
80
+ for (const asyncValidationResult of maybeErrorsPromise) {
81
+ const maybeValidationError = yield asyncValidationResult;
82
+ if (maybeValidationError && !isStale()) {
83
+ addComponentMessage(maybeValidationError);
84
+ setValid('invalidShown');
85
+ hasAsyncError = true;
86
+ }
87
+ }
88
+ if (!hasSyncError && !hasAsyncError && !isStale()) {
89
+ if (hadCustomErrorMessages && doNotClearMessagesCustom) {
90
+ setValid('invalidShown');
91
+ }
92
+ else {
93
+ setValid('valid');
94
+ }
95
+ }
96
+ resolver === null || resolver === void 0 ? void 0 : resolver();
97
+ return !hasSyncError && !hasAsyncError;
98
+ }), [componentMessagingState, deferredValidators, validators]);
99
+ const deferredValidate = (0, hooks_1.useCallback)((value) => {
100
+ const errors = [];
101
+ for (const validator of deferredValidators) {
102
+ try {
103
+ validator.validate(value);
104
+ }
105
+ catch (error) {
106
+ errors.push((0, utils_1.createMessageFromError)(error));
107
+ }
108
+ }
109
+ if (errors.length) {
110
+ return errors;
111
+ }
112
+ return undefined;
113
+ }, [deferredValidators]);
114
+ const validateValueOnInternalChange = (0, hooks_1.useCallback)((value, options = {}) => __awaiter(this, void 0, void 0, function* () {
115
+ const { isStale } = setStaleIdentity('useValidationLifeCycle-validateValueOnInternalChange');
116
+ const resolver = addBusyState === null || addBusyState === void 0 ? void 0 : addBusyState('running validateValueOnInternalChange');
117
+ const validationResult = yield fullValidate(value, options);
118
+ resolver === null || resolver === void 0 ? void 0 : resolver();
119
+ if (isStale()) {
120
+ return exports.ValidationResult.STALE;
121
+ }
122
+ return validationResult ? exports.ValidationResult.VALID : exports.ValidationResult.INVALID;
123
+ }), [addBusyState, fullValidate]);
124
+ const validateValueOnExternalChange = (0, hooks_1.useCallback)((value) => {
125
+ const { clearAllMessages, setDeferredComponentMessages } = componentMessagingState;
126
+ clearAllMessages();
127
+ const maybeErrors = deferredValidate(value);
128
+ if (maybeErrors) {
129
+ setDeferredComponentMessages(maybeErrors);
130
+ setValid('invalidHidden');
131
+ }
132
+ else {
133
+ setValid('valid');
134
+ }
135
+ return exports.ValidationResult.VALID;
136
+ }, [componentMessagingState, deferredValidate]);
137
+ return (0, hooks_1.useMemo)(() => ({
138
+ valid,
139
+ setValid,
140
+ deferredValidate,
141
+ fullValidate,
142
+ validateValueOnExternalChange,
143
+ validateValueOnInternalChange
144
+ }), [
145
+ valid,
146
+ deferredValidate,
147
+ fullValidate,
148
+ validateValueOnExternalChange,
149
+ validateValueOnInternalChange
150
+ ]);
151
+ }
152
+ exports.useValidators = useValidators;
153
+ });
@@ -0,0 +1,23 @@
1
+ import { StateUpdater } from 'preact/hooks';
2
+ import { ConverterErrorSymbol } from '../UNSAFE_useConverter/useConverter';
3
+ import { ValidState } from '../UNSAFE_useValidators/useValidators';
4
+ export declare type ValueState<V> = {
5
+ displayValue: string;
6
+ transientValue: V;
7
+ value: V;
8
+ getValueForValidation: (valid: ValidState) => V | typeof ConverterErrorSymbol;
9
+ setValueAfterValidation: (value: V) => void;
10
+ setDisplayValue: StateUpdater<string>;
11
+ setTransientValue: StateUpdater<V>;
12
+ setValue: StateUpdater<V>;
13
+ refreshDisplayValue: () => void;
14
+ };
15
+ export declare type UseValueProps<V> = {
16
+ value?: V;
17
+ format: (value: V, shouldSuppressError?: boolean) => string;
18
+ parse: (value: string) => V | typeof ConverterErrorSymbol;
19
+ onRawValueChanged?: (rawValue: string) => void;
20
+ onTransientValueChanged?: (transientValue: V | null | undefined) => void;
21
+ onValueChanged?: (value: V | null | undefined) => void;
22
+ };
23
+ export declare function useValue<V>({ value: valueProp, format, parse, onRawValueChanged, onTransientValueChanged, onValueChanged }: UseValueProps<V>): ValueState<V>;