@plitzi/sdk-elements 0.38.24 → 0.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/CHANGELOG.md +170 -1
  2. package/dist/Element/RootElement.d.ts +1 -1
  3. package/dist/Element/RootElement.mjs +62 -61
  4. package/dist/Element/RowAnchor.d.ts +15 -0
  5. package/dist/Element/RowAnchor.mjs +8 -0
  6. package/dist/Element/helpers/elementConstants.mjs +12 -0
  7. package/dist/Element/hocs/withElement.d.ts +1 -1
  8. package/dist/Element/hocs/withElement.mjs +96 -88
  9. package/dist/Element/hooks/useEditableContent.d.ts +11 -0
  10. package/dist/Element/hooks/useEditableContent.mjs +11 -10
  11. package/dist/Element/hooks/useElement.mjs +1 -1
  12. package/dist/Element/hooks/useElementDataSource.mjs +11 -10
  13. package/dist/Element/hooks/useFocusInteractions.d.ts +12 -0
  14. package/dist/Element/hooks/useFocusInteractions.mjs +9 -0
  15. package/dist/Element/hooks/useInternalClassName.mjs +22 -21
  16. package/dist/Element/hooks/useRootElementInteractions.mjs +48 -42
  17. package/dist/Element/hooks/useScrollInteractions.d.ts +1 -1
  18. package/dist/Element/hooks/useScrollInteractions.mjs +61 -30
  19. package/dist/dataSource/PluginSource.d.ts +22 -0
  20. package/dist/dataSource/PluginSource.mjs +27 -0
  21. package/dist/dataSource/index.d.ts +2 -0
  22. package/dist/dataSource/index.mjs +5 -4
  23. package/dist/elements/advanced/BlockHtml/BlockHtml.d.ts +1 -1
  24. package/dist/elements/advanced/BlockHtml/index.d.ts +1 -1
  25. package/dist/elements/advanced/BlockJsx/BlockJsx.d.ts +1 -1
  26. package/dist/elements/advanced/BlockJsx/index.d.ts +1 -1
  27. package/dist/elements/advanced/Custom/Custom.d.ts +1 -1
  28. package/dist/elements/advanced/Custom/index.d.ts +1 -1
  29. package/dist/elements/advanced/NodeHtml/NodeHtml.d.ts +1 -1
  30. package/dist/elements/advanced/NodeHtml/declaration.d.ts +3 -3
  31. package/dist/elements/advanced/NodeHtml/index.d.ts +4 -4
  32. package/dist/elements/advanced/Reference/Reference.d.ts +2 -2
  33. package/dist/elements/advanced/Reference/Reference.mjs +1 -1
  34. package/dist/elements/advanced/Reference/index.d.ts +1 -1
  35. package/dist/elements/basic/Button/Button.d.ts +7 -2
  36. package/dist/elements/basic/Button/Button.mjs +27 -25
  37. package/dist/elements/basic/Button/Settings.mjs +1 -1
  38. package/dist/elements/basic/Button/declaration.d.ts +8 -1
  39. package/dist/elements/basic/Button/declaration.mjs +3 -0
  40. package/dist/elements/basic/Button/index.d.ts +9 -2
  41. package/dist/elements/basic/Dropdown/Dropdown.d.ts +9 -2
  42. package/dist/elements/basic/Dropdown/Dropdown.mjs +93 -74
  43. package/dist/elements/basic/Dropdown/DropdownPopup/DropdownPopup.d.ts +1 -1
  44. package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +1 -1
  45. package/dist/elements/basic/Dropdown/declaration.d.ts +31 -0
  46. package/dist/elements/basic/Dropdown/declaration.mjs +38 -6
  47. package/dist/elements/basic/Dropdown/index.d.ts +33 -2
  48. package/dist/elements/basic/Dropdown/useDropdown.d.ts +2 -0
  49. package/dist/elements/basic/Heading/Heading.d.ts +1 -1
  50. package/dist/elements/basic/Heading/Heading.mjs +3 -2
  51. package/dist/elements/basic/Heading/declaration.d.ts +2 -0
  52. package/dist/elements/basic/Heading/declaration.mjs +2 -0
  53. package/dist/elements/basic/Heading/index.d.ts +3 -1
  54. package/dist/elements/basic/Link/Link.d.ts +1 -1
  55. package/dist/elements/basic/Link/Link.mjs +46 -45
  56. package/dist/elements/basic/Link/declaration.d.ts +1 -0
  57. package/dist/elements/basic/Link/declaration.mjs +5 -0
  58. package/dist/elements/basic/Link/index.d.ts +2 -1
  59. package/dist/elements/basic/Markdown/Markdown.d.ts +1 -1
  60. package/dist/elements/basic/Markdown/declaration.d.ts +2 -0
  61. package/dist/elements/basic/Markdown/declaration.mjs +2 -0
  62. package/dist/elements/basic/Markdown/index.d.ts +3 -1
  63. package/dist/elements/basic/Paragraph/Paragraph.d.ts +1 -1
  64. package/dist/elements/basic/Paragraph/Paragraph.mjs +3 -2
  65. package/dist/elements/basic/Paragraph/Settings.mjs +1 -1
  66. package/dist/elements/basic/Paragraph/declaration.d.ts +2 -0
  67. package/dist/elements/basic/Paragraph/declaration.mjs +2 -0
  68. package/dist/elements/basic/Paragraph/index.d.ts +3 -1
  69. package/dist/elements/basic/RichText/RichText.d.ts +1 -1
  70. package/dist/elements/basic/RichText/declaration.d.ts +1 -0
  71. package/dist/elements/basic/RichText/declaration.mjs +1 -0
  72. package/dist/elements/basic/RichText/index.d.ts +2 -1
  73. package/dist/elements/basic/Text/Settings.mjs +1 -1
  74. package/dist/elements/basic/Text/Text.d.ts +1 -1
  75. package/dist/elements/basic/Text/Text.mjs +3 -2
  76. package/dist/elements/basic/Text/declaration.d.ts +2 -0
  77. package/dist/elements/basic/Text/declaration.mjs +2 -0
  78. package/dist/elements/basic/Text/index.d.ts +3 -1
  79. package/dist/elements/basic/ThemeToggle/ThemeToggle.d.ts +2 -2
  80. package/dist/elements/basic/ThemeToggle/declaration.d.ts +1 -0
  81. package/dist/elements/basic/ThemeToggle/declaration.mjs +5 -0
  82. package/dist/elements/basic/ThemeToggle/index.d.ts +2 -1
  83. package/dist/elements/declarations/index.d.ts +399 -13
  84. package/dist/elements/declarations/index.mjs +48 -44
  85. package/dist/elements/form/Form/Form.d.ts +10 -3
  86. package/dist/elements/form/Form/Form.mjs +102 -79
  87. package/dist/elements/form/Form/declaration.d.ts +21 -3
  88. package/dist/elements/form/Form/declaration.mjs +28 -11
  89. package/dist/elements/form/Form/index.d.ts +17 -2
  90. package/dist/elements/form/FormControl/FormControl.d.ts +14 -10
  91. package/dist/elements/form/FormControl/FormControl.mjs +114 -104
  92. package/dist/elements/form/FormControl/Settings.d.ts +9 -2
  93. package/dist/elements/form/FormControl/Settings.mjs +132 -159
  94. package/dist/elements/form/FormControl/declaration.d.ts +52 -1
  95. package/dist/elements/form/FormControl/declaration.mjs +27 -20
  96. package/dist/elements/form/FormControl/helpers/useBlurValidation.d.ts +12 -0
  97. package/dist/elements/form/FormControl/helpers/useBlurValidation.mjs +20 -0
  98. package/dist/elements/form/FormControl/helpers/validateField.d.ts +8 -0
  99. package/dist/elements/form/FormControl/helpers/validateField.mjs +8 -2
  100. package/dist/elements/form/FormControl/hocs/withFieldValue.d.ts +6 -1
  101. package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +52 -41
  102. package/dist/elements/form/FormControl/index.d.ts +53 -2
  103. package/dist/elements/form/FormControl/inputs/Checkbox.mjs +2 -2
  104. package/dist/elements/form/FormControl/inputs/FileInput.d.ts +21 -0
  105. package/dist/elements/form/FormControl/inputs/FileInput.mjs +29 -0
  106. package/dist/elements/form/FormControl/inputs/Input.d.ts +5 -1
  107. package/dist/elements/form/FormControl/inputs/Input.mjs +42 -38
  108. package/dist/elements/form/FormControl/inputs/Select.d.ts +5 -1
  109. package/dist/elements/form/FormControl/inputs/Select.mjs +33 -28
  110. package/dist/elements/form/FormControl/inputs/Textarea.mjs +27 -26
  111. package/dist/elements/form/FormControl/inputs/useFocusWhenShown.d.ts +1 -1
  112. package/dist/elements/form/FormControl/subTypes.d.ts +17 -0
  113. package/dist/elements/form/FormControl/subTypes.mjs +58 -0
  114. package/dist/elements/index.d.ts +5 -1
  115. package/dist/elements/index.mjs +34 -30
  116. package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +1 -1
  117. package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +30 -30
  118. package/dist/elements/internal/LayoutContainer/index.d.ts +1 -1
  119. package/dist/elements/internal/LayoutContainer/mask.d.ts +13 -0
  120. package/dist/elements/internal/LayoutContainer/mask.mjs +16 -1
  121. package/dist/elements/internal/Loading/Loading.d.ts +1 -1
  122. package/dist/elements/internal/Loading/index.d.ts +1 -1
  123. package/dist/elements/internal/NotFound/NotFound.d.ts +1 -1
  124. package/dist/elements/internal/NotFound/index.d.ts +1 -1
  125. package/dist/elements/internal/Page/Page.d.ts +17 -3
  126. package/dist/elements/internal/Page/Page.mjs +32 -25
  127. package/dist/elements/internal/Page/PageHead.d.ts +11 -4
  128. package/dist/elements/internal/Page/PageHead.mjs +41 -19
  129. package/dist/elements/internal/Page/PageWithheld.d.ts +3 -2
  130. package/dist/elements/internal/Page/PageWithheld.mjs +41 -18
  131. package/dist/elements/internal/Page/Settings.d.ts +5 -1
  132. package/dist/elements/internal/Page/Settings.mjs +160 -121
  133. package/dist/elements/internal/Page/SharePreview.d.ts +13 -0
  134. package/dist/elements/internal/Page/SharePreview.mjs +53 -0
  135. package/dist/elements/internal/Page/declaration.d.ts +9 -1
  136. package/dist/elements/internal/Page/declaration.mjs +11 -4
  137. package/dist/elements/internal/Page/index.d.ts +9 -2
  138. package/dist/elements/media/Chart/Chart.d.ts +33 -0
  139. package/dist/elements/media/Chart/Chart.mjs +195 -0
  140. package/dist/elements/media/Chart/Settings.d.ts +6 -0
  141. package/dist/elements/media/Chart/Settings.mjs +92 -0
  142. package/dist/elements/media/Chart/chartGeometry.d.ts +37 -0
  143. package/dist/elements/media/Chart/chartGeometry.mjs +47 -0
  144. package/dist/elements/media/Chart/declaration.d.ts +144 -0
  145. package/dist/elements/media/Chart/declaration.mjs +107 -0
  146. package/dist/elements/media/Chart/index.d.ts +145 -0
  147. package/dist/elements/media/Chart/index.mjs +6 -0
  148. package/dist/elements/media/Embed/Embed.d.ts +1 -1
  149. package/dist/elements/media/Embed/Embed.mjs +25 -21
  150. package/dist/elements/media/Embed/declaration.d.ts +1 -0
  151. package/dist/elements/media/Embed/declaration.mjs +1 -0
  152. package/dist/elements/media/Embed/index.d.ts +2 -1
  153. package/dist/elements/media/FontAwesome/FontAwesome.d.ts +1 -1
  154. package/dist/elements/media/FontAwesome/index.d.ts +1 -1
  155. package/dist/elements/media/Image/Image.d.ts +1 -1
  156. package/dist/elements/media/Image/Image.mjs +35 -34
  157. package/dist/elements/media/Image/declaration.d.ts +2 -1
  158. package/dist/elements/media/Image/declaration.mjs +1 -0
  159. package/dist/elements/media/Image/index.d.ts +3 -2
  160. package/dist/elements/media/Svg/Svg.d.ts +1 -1
  161. package/dist/elements/media/Svg/declaration.d.ts +1 -0
  162. package/dist/elements/media/Svg/declaration.mjs +1 -0
  163. package/dist/elements/media/Svg/index.d.ts +2 -1
  164. package/dist/elements/media/Video/Video.d.ts +1 -1
  165. package/dist/elements/media/Video/declaration.d.ts +1 -0
  166. package/dist/elements/media/Video/declaration.mjs +1 -0
  167. package/dist/elements/media/Video/index.d.ts +2 -1
  168. package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +1 -1
  169. package/dist/elements/provider/ApiContainer/ApiContainer.mjs +215 -185
  170. package/dist/elements/provider/ApiContainer/declaration.d.ts +9 -0
  171. package/dist/elements/provider/ApiContainer/declaration.mjs +10 -1
  172. package/dist/elements/provider/ApiContainer/hooks/useInputRefresh.d.ts +4 -4
  173. package/dist/elements/provider/ApiContainer/hooks/useProviderPagination.d.ts +2 -1
  174. package/dist/elements/provider/ApiContainer/index.d.ts +10 -1
  175. package/dist/elements/provider/Channel/Channel.d.ts +1 -1
  176. package/dist/elements/provider/Channel/declaration.d.ts +9 -0
  177. package/dist/elements/provider/Channel/declaration.mjs +11 -2
  178. package/dist/elements/provider/Channel/index.d.ts +10 -1
  179. package/dist/elements/settings.mjs +44 -40
  180. package/dist/elements/structure/Carousel/Carousel.d.ts +1 -1
  181. package/dist/elements/structure/Carousel/Carousel.mjs +147 -130
  182. package/dist/elements/structure/Carousel/CarouselContext.d.ts +3 -3
  183. package/dist/elements/structure/Carousel/CarouselTrack/CarouselTrack.d.ts +1 -1
  184. package/dist/elements/structure/Carousel/CarouselTrack/components/ScrollTrack/ScrollTrack.d.ts +6 -2
  185. package/dist/elements/structure/Carousel/CarouselTrack/components/ScrollTrack/ScrollTrack.mjs +32 -20
  186. package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +1 -1
  187. package/dist/elements/structure/Carousel/carouselIndex.d.ts +17 -0
  188. package/dist/elements/structure/Carousel/carouselIndex.mjs +17 -5
  189. package/dist/elements/structure/Carousel/declaration.d.ts +49 -2
  190. package/dist/elements/structure/Carousel/declaration.mjs +26 -4
  191. package/dist/elements/structure/Carousel/index.d.ts +51 -4
  192. package/dist/elements/structure/Container/Container.d.ts +5 -3
  193. package/dist/elements/structure/Container/Container.mjs +6 -5
  194. package/dist/elements/structure/Container/Settings.d.ts +4 -2
  195. package/dist/elements/structure/Container/Settings.mjs +19 -5
  196. package/dist/elements/structure/Container/declaration.d.ts +3 -2
  197. package/dist/elements/structure/Container/declaration.mjs +3 -1
  198. package/dist/elements/structure/Container/index.d.ts +4 -3
  199. package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +1 -1
  200. package/dist/elements/structure/DialogContainer/declaration.d.ts +1 -0
  201. package/dist/elements/structure/DialogContainer/declaration.mjs +5 -0
  202. package/dist/elements/structure/DialogContainer/index.d.ts +2 -1
  203. package/dist/elements/structure/FocusGroup/FocusGroup.d.ts +24 -0
  204. package/dist/elements/structure/FocusGroup/FocusGroup.mjs +27 -0
  205. package/dist/elements/structure/FocusGroup/Settings.d.ts +8 -0
  206. package/dist/elements/structure/FocusGroup/Settings.mjs +39 -0
  207. package/dist/elements/structure/FocusGroup/arrowFocus.d.ts +12 -0
  208. package/dist/elements/structure/FocusGroup/arrowFocus.mjs +30 -0
  209. package/dist/elements/structure/FocusGroup/declaration.d.ts +36 -0
  210. package/dist/elements/structure/FocusGroup/declaration.mjs +28 -0
  211. package/dist/elements/structure/FocusGroup/index.d.ts +37 -0
  212. package/dist/elements/structure/FocusGroup/index.mjs +6 -0
  213. package/dist/elements/structure/List/List.d.ts +1 -1
  214. package/dist/elements/structure/List/ListItem/ListItem.d.ts +1 -1
  215. package/dist/elements/structure/List/ListItem/index.d.ts +1 -1
  216. package/dist/elements/structure/List/declaration.d.ts +5 -0
  217. package/dist/elements/structure/List/declaration.mjs +5 -0
  218. package/dist/elements/structure/List/index.d.ts +7 -2
  219. package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +1 -0
  220. package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.d.ts +3 -1
  221. package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.mjs +33 -25
  222. package/dist/elements/structure/ModalContainer/ModalContainer.d.ts +1 -1
  223. package/dist/elements/structure/ModalContainer/declaration.d.ts +2 -0
  224. package/dist/elements/structure/ModalContainer/declaration.mjs +2 -0
  225. package/dist/elements/structure/ModalContainer/index.d.ts +3 -1
  226. package/dist/elements/structure/Pagination/Pagination.d.ts +1 -1
  227. package/dist/elements/structure/Pagination/declaration.d.ts +1 -0
  228. package/dist/elements/structure/Pagination/declaration.mjs +5 -0
  229. package/dist/elements/structure/Pagination/index.d.ts +2 -1
  230. package/dist/elements/structure/TabContainer/TabContainer.d.ts +1 -1
  231. package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +1 -1
  232. package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +1 -1
  233. package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +1 -1
  234. package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +1 -1
  235. package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +1 -1
  236. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +6 -0
  237. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +6 -0
  238. package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +7 -1
  239. package/dist/elements/structure/TabContainer/index.d.ts +10 -4
  240. package/dist/index.d.ts +297 -52
  241. package/dist/index.mjs +41 -37
  242. package/package.json +8 -8
  243. package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.d.ts +0 -16
  244. package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.mjs +0 -4
@@ -20,71 +20,75 @@ import v from "../internal/LayoutContainer/declaration.mjs";
20
20
  import y from "../internal/Loading/declaration.mjs";
21
21
  import b from "../internal/NotFound/declaration.mjs";
22
22
  import x, { DOCUMENT_SCROLLS as S, isDocumentScroll as C } from "../internal/Page/declaration.mjs";
23
- import w from "../media/Embed/declaration.mjs";
24
- import T from "../media/FontAwesome/declaration.mjs";
25
- import E from "../media/Image/declaration.mjs";
26
- import D from "../media/Svg/declaration.mjs";
27
- import O from "../media/Video/declaration.mjs";
28
- import k from "../provider/ApiContainer/declaration.mjs";
29
- import A from "../provider/Channel/declaration.mjs";
30
- import j from "../structure/Carousel/CarouselTrack/declaration.mjs";
31
- import M from "../structure/Carousel/declaration.mjs";
32
- import N, { NAMEABLE_CONTAINER_TAGS as P } from "../structure/Container/declaration.mjs";
33
- import F from "../structure/DialogContainer/declaration.mjs";
34
- import I from "../structure/List/declaration.mjs";
35
- import L from "../structure/List/ListItem/declaration.mjs";
36
- import R from "../structure/ModalContainer/declaration.mjs";
37
- import z from "../structure/Pagination/declaration.mjs";
38
- import B from "../structure/TabContainer/declaration.mjs";
39
- import V from "../structure/TabContainer/TabContainerBody/declaration.mjs";
40
- import H from "../structure/TabContainer/TabContainerHeader/declaration.mjs";
41
- import U from "../structure/TabContainer/TabContainerItem/declaration.mjs";
42
- import { interactionBasicTriggers as W } from "../../Element/helpers/elementConstants.mjs";
43
- import { HTML_TAG_PARTS as G } from "../basic/RichText/classHtmlParts.mjs";
44
- import { isSvgMarkup as K } from "../media/Svg/sanitizeSvg.mjs";
23
+ import w from "../media/Chart/declaration.mjs";
24
+ import T from "../media/Embed/declaration.mjs";
25
+ import E from "../media/FontAwesome/declaration.mjs";
26
+ import D from "../media/Image/declaration.mjs";
27
+ import O from "../media/Svg/declaration.mjs";
28
+ import k from "../media/Video/declaration.mjs";
29
+ import A from "../provider/ApiContainer/declaration.mjs";
30
+ import j from "../provider/Channel/declaration.mjs";
31
+ import M from "../structure/Carousel/CarouselTrack/declaration.mjs";
32
+ import N from "../structure/Carousel/declaration.mjs";
33
+ import P, { NAMEABLE_CONTAINER_TAGS as F } from "../structure/Container/declaration.mjs";
34
+ import I from "../structure/DialogContainer/declaration.mjs";
35
+ import L from "../structure/FocusGroup/declaration.mjs";
36
+ import R from "../structure/List/declaration.mjs";
37
+ import z from "../structure/List/ListItem/declaration.mjs";
38
+ import B from "../structure/ModalContainer/declaration.mjs";
39
+ import V from "../structure/Pagination/declaration.mjs";
40
+ import H from "../structure/TabContainer/declaration.mjs";
41
+ import U from "../structure/TabContainer/TabContainerBody/declaration.mjs";
42
+ import W from "../structure/TabContainer/TabContainerHeader/declaration.mjs";
43
+ import G from "../structure/TabContainer/TabContainerItem/declaration.mjs";
44
+ import { interactionBasicTriggers as K } from "../../Element/helpers/elementConstants.mjs";
45
+ import { HTML_TAG_PARTS as q } from "../basic/RichText/classHtmlParts.mjs";
46
+ import { isSvgMarkup as J } from "../media/Svg/sanitizeSvg.mjs";
45
47
  //#region src/elements/declarations/index.ts
46
- var q = {
47
- ApiContainer: k,
48
+ var Y = {
49
+ ApiContainer: A,
48
50
  BlockHtml: e,
49
51
  BlockJsx: t,
50
52
  Button: o,
51
- Carousel: M,
52
- CarouselTrack: j,
53
- Channel: A,
54
- Container: N,
53
+ Carousel: N,
54
+ CarouselTrack: M,
55
+ Channel: j,
56
+ Container: P,
55
57
  Custom: n,
56
- DialogContainer: F,
58
+ DialogContainer: I,
59
+ FocusGroup: L,
57
60
  Dropdown: s,
58
61
  DropdownPopup: c,
59
- Embed: w,
60
- FontAwesome: T,
62
+ Embed: T,
63
+ FontAwesome: E,
61
64
  Form: g,
62
65
  FormControl: _,
63
66
  Heading: l,
64
- Image: E,
67
+ Image: D,
65
68
  LayoutContainer: v,
66
69
  Link: u,
67
- List: I,
68
- ListItem: L,
70
+ List: R,
71
+ ListItem: z,
69
72
  Loading: y,
70
73
  Markdown: d,
71
- ModalContainer: R,
74
+ ModalContainer: B,
72
75
  NodeHtml: r,
73
76
  NotFound: b,
74
77
  Page: x,
75
- Pagination: z,
78
+ Pagination: V,
76
79
  Paragraph: f,
77
80
  PlitziSdk: i,
78
81
  Reference: a,
79
82
  RichText: p,
80
- Svg: D,
81
- TabContainer: B,
82
- TabContainerBody: V,
83
- TabContainerHeader: H,
84
- TabContainerItem: U,
83
+ Chart: w,
84
+ Svg: O,
85
+ TabContainer: H,
86
+ TabContainerBody: U,
87
+ TabContainerHeader: W,
88
+ TabContainerItem: G,
85
89
  Text: m,
86
90
  ThemeToggle: h,
87
- Video: O
88
- }, J = Object.fromEntries(Object.values(q).flatMap((e) => "serverTemplates" in e ? [[e.type, e.serverTemplates]] : []));
91
+ Video: k
92
+ }, X = Object.fromEntries(Object.values(Y).flatMap((e) => "serverTemplates" in e ? [[e.type, e.serverTemplates]] : [])), Z = Object.fromEntries(Object.values(Y).flatMap((e) => "contentAttributes" in e ? [[e.type, e.contentAttributes]] : [])), Q = (e) => Z[e] ?? [];
89
93
  //#endregion
90
- export { k as ApiContainerDeclaration, e as BlockHtmlDeclaration, t as BlockJsxDeclaration, o as ButtonDeclaration, M as CarouselDeclaration, j as CarouselTrackDeclaration, A as ChannelDeclaration, N as ContainerDeclaration, n as CustomDeclaration, S as DOCUMENT_SCROLLS, F as DialogContainerDeclaration, s as DropdownDeclaration, c as DropdownPopupDeclaration, w as EmbedDeclaration, T as FontAwesomeDeclaration, _ as FormControlDeclaration, g as FormDeclaration, G as HTML_TAG_PARTS, l as HeadingDeclaration, E as ImageDeclaration, v as LayoutContainerDeclaration, u as LinkDeclaration, I as ListDeclaration, L as ListItemDeclaration, y as LoadingDeclaration, d as MarkdownDeclaration, R as ModalContainerDeclaration, P as NAMEABLE_CONTAINER_TAGS, r as NodeHtmlDeclaration, b as NotFoundDeclaration, x as PageDeclaration, z as PaginationDeclaration, f as ParagraphDeclaration, i as PlitziSdkDeclaration, a as ReferenceDeclaration, p as RichTextDeclaration, D as SvgDeclaration, V as TabContainerBodyDeclaration, B as TabContainerDeclaration, H as TabContainerHeaderDeclaration, U as TabContainerItemDeclaration, m as TextDeclaration, h as ThemeToggleDeclaration, O as VideoDeclaration, q as elementDeclarations, W as interactionBasicTriggers, C as isDocumentScroll, K as isSvgMarkup, J as serverTemplatesByType };
94
+ export { A as ApiContainerDeclaration, e as BlockHtmlDeclaration, t as BlockJsxDeclaration, o as ButtonDeclaration, N as CarouselDeclaration, M as CarouselTrackDeclaration, j as ChannelDeclaration, w as ChartDeclaration, P as ContainerDeclaration, n as CustomDeclaration, S as DOCUMENT_SCROLLS, I as DialogContainerDeclaration, s as DropdownDeclaration, c as DropdownPopupDeclaration, T as EmbedDeclaration, L as FocusGroupDeclaration, E as FontAwesomeDeclaration, _ as FormControlDeclaration, g as FormDeclaration, q as HTML_TAG_PARTS, l as HeadingDeclaration, D as ImageDeclaration, v as LayoutContainerDeclaration, u as LinkDeclaration, R as ListDeclaration, z as ListItemDeclaration, y as LoadingDeclaration, d as MarkdownDeclaration, B as ModalContainerDeclaration, F as NAMEABLE_CONTAINER_TAGS, r as NodeHtmlDeclaration, b as NotFoundDeclaration, x as PageDeclaration, V as PaginationDeclaration, f as ParagraphDeclaration, i as PlitziSdkDeclaration, a as ReferenceDeclaration, p as RichTextDeclaration, O as SvgDeclaration, U as TabContainerBodyDeclaration, H as TabContainerDeclaration, W as TabContainerHeaderDeclaration, G as TabContainerItemDeclaration, m as TextDeclaration, h as ThemeToggleDeclaration, k as VideoDeclaration, Z as contentAttributesByType, Q as contentAttributesOf, Y as elementDeclarations, K as interactionBasicTriggers, C as isDocumentScroll, J as isSvgMarkup, X as serverTemplatesByType };
@@ -17,12 +17,19 @@ export type FormProps = {
17
17
  noValidate: boolean;
18
18
  errors: Record<string, string>;
19
19
  values: Record<string, unknown>;
20
+ /**
21
+ * Whether a submit was tried since the form was shown or reset — valid or not. What a hint under a field steps aside
22
+ * by once the field's own error speaks: a sign-up's "8 characters" line and its "At least 8 characters." showed
23
+ * together, and nothing an author could write noticed an invalid Enter.
24
+ */
25
+ submitted: boolean;
20
26
  };
21
27
  export type Field = {
22
28
  id: string;
23
29
  name: string;
24
30
  };
25
- export type FieldValue = string | boolean | number;
31
+ /** A `file` control holds the `File` picked; every other control text, a number or a checkbox's state. */
32
+ export type FieldValue = string | boolean | number | File;
26
33
  /** What a control says about the form's values as they stand: the sentence to show under it, or `''`. */
27
34
  export type FieldValidator = (values: Record<string, unknown>) => string;
28
35
  export type FormContextValue = {
@@ -35,9 +42,9 @@ export type FormContextValue = {
35
42
  setFieldValue: (name: string, value: FieldValue | null) => void;
36
43
  setFieldError: (name: string, error: string) => void;
37
44
  };
38
- declare const Form: ({ ref, className, children, method, actionUrl, managedByInteractions, noValidate, errors, values }: FormProps) => import('react').JSX.Element;
45
+ declare const Form: ({ ref, className, children, method, actionUrl, managedByInteractions, noValidate, errors, values, submitted }: FormProps) => import('react').JSX.Element;
39
46
  declare const _default: {
40
- (props: import('../../..').WithElementProps<FormProps>): import('react').JSX.Element;
47
+ (props: import('../../..').WithElementProps<FormProps>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
41
48
  displayName: string;
42
49
  };
43
50
  export default _default;
@@ -14,28 +14,28 @@ import { InteractionsContext as v } from "@plitzi/sdk-interactions";
14
14
  import { produce as y } from "immer";
15
15
  import { getSourceName as b } from "@plitzi/sdk-shared/dataSource/helpers";
16
16
  //#region src/elements/form/Form/Form.tsx
17
- var x = ({ ref: t, className: x = "", children: S, method: C = "get", actionUrl: w = "", managedByInteractions: T = !1, noValidate: E = !1, errors: D = f, values: O = f }) => {
18
- let [k, A] = u({}), j = l(/* @__PURE__ */ new Map()), M = l(!1), { id: N, definition: { label: P = "Form" }, setElementState: F } = n(), I = b(e.sourceType, N), { settings: { previewMode: L } } = d(), { interactionsManager: R } = a(v), z = o((e) => A((t) => ({
17
+ var x = ({ ref: t, className: x = "", children: S, method: C = "get", actionUrl: w = "", managedByInteractions: T = !1, noValidate: E = !1, errors: D = f, values: O = f, submitted: k = !1 }) => {
18
+ let [A, j] = u({}), M = l(/* @__PURE__ */ new Map()), N = l(!1), { id: P, definition: { label: F = "Form" }, setElementState: I } = n(), L = b(e.sourceType, P), { settings: { previewMode: R } } = d(), { interactionsManager: z } = a(v), B = o((e) => j((t) => ({
19
19
  ...t,
20
20
  [e.name]: e
21
- })), [A]);
22
- s(() => (M.current = !1, () => {
23
- M.current = !0;
21
+ })), [j]);
22
+ s(() => (N.current = !1, () => {
23
+ N.current = !0;
24
24
  }), []);
25
- let B = o((e) => {
26
- M.current || (A((t) => y(t, (t) => {
25
+ let V = o((e) => {
26
+ N.current || (j((t) => y(t, (t) => {
27
27
  t[e] && delete t[e];
28
- })), e && F((t) => ({
28
+ })), e && I((t) => ({
29
29
  ...t,
30
30
  values: m(t, `values.${e}`),
31
31
  errors: m(t, `errors.${e}`)
32
32
  })));
33
- }, [F]), V = o((e, t) => {
34
- j.current.set(e, t);
35
- }, []), H = o((e) => {
36
- j.current.delete(e);
37
- }, []), U = o((e, t = "") => {
38
- e && (t === null && (t = ""), F((n) => n.errors && n.errors[e] ? {
33
+ }, [I]), H = o((e, t) => {
34
+ M.current.set(e, t);
35
+ }, []), U = o((e) => {
36
+ M.current.delete(e);
37
+ }, []), W = o((e, t = "") => {
38
+ e && (t === null && (t = ""), I((n) => n.errors && n.errors[e] ? {
39
39
  ...n,
40
40
  values: {
41
41
  ...n.values,
@@ -49,8 +49,8 @@ var x = ({ ref: t, className: x = "", children: S, method: C = "get", actionUrl:
49
49
  [e]: t
50
50
  }
51
51
  }));
52
- }, [F]), W = o((e, t) => {
53
- e && F((n) => !t && !p(n, `errors.${e}`) ? n : !t && n.errors && n.errors[e] ? {
52
+ }, [I]), G = o((e, t) => {
53
+ e && I((n) => !t && !p(n, `errors.${e}`) ? n : !t && n.errors && n.errors[e] ? {
54
54
  ...n,
55
55
  errors: m(n, [`errors.${e}`])
56
56
  } : {
@@ -60,7 +60,7 @@ var x = ({ ref: t, className: x = "", children: S, method: C = "get", actionUrl:
60
60
  [e]: t
61
61
  }
62
62
  });
63
- }, [F]), G = o(() => Object.values(k).filter((e) => !!e.name).reduce((e, t) => [
63
+ }, [I]), K = o(() => Object.values(A).filter((e) => !!e.name).reduce((e, t) => [
64
64
  ...e,
65
65
  {
66
66
  path: `fields.${t.name}.id`,
@@ -74,109 +74,132 @@ var x = ({ ref: t, className: x = "", children: S, method: C = "get", actionUrl:
74
74
  path: `errors.${t.name}`,
75
75
  name: `${t.name} Error Message`
76
76
  }
77
- ], []), [k]), K = c(() => ({ runtime: { sources: {
77
+ ], [{
78
+ path: "submitted",
79
+ name: "Submitted"
80
+ }]), [A]), q = c(() => ({ runtime: { sources: {
78
81
  form: {
79
82
  errors: D,
80
83
  values: O,
81
- registerField: z,
82
- unregisterField: B,
83
- registerValidator: V,
84
- unregisterValidator: H,
85
- setFieldValue: U,
86
- setFieldError: W
84
+ registerField: B,
85
+ unregisterField: V,
86
+ registerValidator: H,
87
+ unregisterValidator: U,
88
+ setFieldValue: W,
89
+ setFieldError: G
87
90
  },
88
- [I]: {
91
+ [L]: {
89
92
  values: O,
90
- errors: D
93
+ errors: D,
94
+ submitted: k
91
95
  }
92
96
  } } }), [
93
- I,
97
+ L,
94
98
  D,
95
99
  O,
96
- z,
100
+ k,
97
101
  B,
98
102
  V,
99
103
  H,
100
104
  U,
101
- W
105
+ W,
106
+ G
102
107
  ]);
103
108
  i({
104
- id: N,
105
- source: I,
106
- name: P || `Form - ${N}`,
107
- fields: G
109
+ id: P,
110
+ source: L,
111
+ name: F || `Form - ${P}`,
112
+ fields: K
108
113
  });
109
- let q = c(() => ({ onSubmit: {
110
- ...e.triggers.onSubmit,
111
- preview: {
112
- ...e.triggers.onSubmit.preview,
113
- values: Object.values(k).reduce((e, t) => ({
114
- ...e,
115
- [t.name]: ""
116
- }), {})
117
- }
118
- } }), [k]), J = o((e) => {
119
- let t = [...j.current].reduce((e, [t, n]) => {
114
+ let J = c(() => {
115
+ let t = Object.values(A).reduce((e, t) => ({
116
+ ...e,
117
+ [t.name]: ""
118
+ }), {});
119
+ return {
120
+ onSubmit: {
121
+ ...e.triggers.onSubmit,
122
+ preview: {
123
+ ...e.triggers.onSubmit.preview,
124
+ values: t
125
+ }
126
+ },
127
+ onInvalid: {
128
+ ...e.triggers.onInvalid,
129
+ preview: {
130
+ ...e.triggers.onInvalid.preview,
131
+ errors: t,
132
+ values: t
133
+ }
134
+ }
135
+ };
136
+ }, [A]), Y = o((e) => {
137
+ let t = [...M.current].reduce((e, [t, n]) => {
120
138
  let r = n(O);
121
139
  return r ? {
122
140
  ...e,
123
141
  [t]: r
124
142
  } : e;
125
143
  }, {});
126
- if (F((e) => ({
144
+ if (I((e) => ({
127
145
  ...e,
128
- errors: t
146
+ errors: t,
147
+ submitted: !0
129
148
  })), Object.keys(t).length > 0) {
130
- e.stopPropagation(), e.preventDefault();
149
+ e.stopPropagation(), e.preventDefault(), R && z.interactionTrigger(P, "onInvalid", {
150
+ errors: t,
151
+ values: O
152
+ });
131
153
  return;
132
154
  }
133
- if (!T || (e.stopPropagation(), e.preventDefault(), !L)) return;
134
- let n = Object.values(k).reduce((e, { name: t }) => ({
155
+ if (!T || (e.stopPropagation(), e.preventDefault(), !R)) return;
156
+ let n = Object.values(A).reduce((e, { name: t }) => ({
135
157
  ...e,
136
158
  [t]: O[t]
137
159
  }), {});
138
- R.interactionTrigger(N, "onSubmit", {
160
+ z.interactionTrigger(P, "onSubmit", {
139
161
  values: n,
140
162
  actionUrl: w,
141
163
  method: C
142
164
  });
143
165
  }, [
144
- F,
166
+ I,
145
167
  T,
146
- L,
147
- k,
148
168
  R,
149
- N,
169
+ A,
170
+ z,
171
+ P,
150
172
  w,
151
173
  C,
152
174
  O
153
- ]), Y = o((e) => {
154
- T && (e instanceof Event && (e.stopPropagation(), e.preventDefault()), F((e) => ({
175
+ ]), X = o((e) => {
176
+ T && (e instanceof Event && (e.stopPropagation(), e.preventDefault()), I((e) => ({
155
177
  ...e,
156
178
  values: {},
157
- errors: {}
179
+ errors: {},
180
+ submitted: !1
158
181
  })));
159
- }, [F, T]), X = o((e) => {
182
+ }, [I, T]), Z = o((e) => {
160
183
  let { name: t, value: n } = e;
161
- U(t, n);
162
- }, [U]), Z = o((e) => {
163
- let { name: t, error: n } = e;
164
184
  W(t, n);
165
- }, [W]), Q = c(() => {
166
- let { performReset: t, setFieldValue: n, setFieldError: r } = e.callbacks, i = Object.values(k).map((e) => ({
185
+ }, [W]), Q = o((e) => {
186
+ let { name: t, error: n } = e;
187
+ G(t, n);
188
+ }, [G]), $ = c(() => {
189
+ let { performReset: t, setFieldValue: n, setFieldError: r } = e.callbacks, i = Object.values(A).map((e) => ({
167
190
  value: e.name,
168
191
  label: e.name
169
192
  }));
170
193
  return {
171
194
  performReset: {
172
195
  ...t,
173
- title: `Reset ${P}`,
174
- callback: Y
196
+ title: `Reset ${F}`,
197
+ callback: X
175
198
  },
176
199
  setFieldValue: {
177
200
  ...n,
178
- title: `Set Field Value ${P}`,
179
- callback: X,
201
+ title: `Set Field Value ${F}`,
202
+ callback: Z,
180
203
  params: {
181
204
  ...n.params,
182
205
  name: {
@@ -187,8 +210,8 @@ var x = ({ ref: t, className: x = "", children: S, method: C = "get", actionUrl:
187
210
  },
188
211
  setFieldError: {
189
212
  ...r,
190
- title: `Set Field Error ${P}`,
191
- callback: Z,
213
+ title: `Set Field Error ${F}`,
214
+ callback: Q,
192
215
  params: {
193
216
  ...r.params,
194
217
  name: {
@@ -199,11 +222,11 @@ var x = ({ ref: t, className: x = "", children: S, method: C = "get", actionUrl:
199
222
  }
200
223
  };
201
224
  }, [
202
- P,
203
- Y,
225
+ F,
204
226
  X,
205
- k,
206
- Z
227
+ Z,
228
+ A,
229
+ Q
207
230
  ]);
208
231
  return /* @__PURE__ */ g(r, {
209
232
  tag: "form",
@@ -211,15 +234,15 @@ var x = ({ ref: t, className: x = "", children: S, method: C = "get", actionUrl:
211
234
  noValidate: E,
212
235
  method: C,
213
236
  className: _("plitzi-component__form", x),
214
- interactionTriggers: q,
215
- interactionCallbacks: Q,
216
- onSubmit: J,
217
- onReset: Y,
237
+ interactionTriggers: J,
238
+ interactionCallbacks: $,
239
+ onSubmit: Y,
240
+ onReset: X,
218
241
  action: w,
219
242
  children: /* @__PURE__ */ g(h, {
220
243
  inherit: "live",
221
- name: `Form:${N}`,
222
- value: K,
244
+ name: `Form:${P}`,
245
+ value: q,
223
246
  children: S
224
247
  })
225
248
  });
@@ -1,13 +1,21 @@
1
1
  import { FormProps } from './Form';
2
2
  import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
3
- /** What this element can be authored with — its component's own props, minus what the runtime supplies. */
4
- export type FormAttributes = AuthorableAttributes<FormProps>;
3
+ /**
4
+ * What this element can be authored with — its component's own props, minus what the runtime supplies: `submitted` is
5
+ * what a visitor did, never a starting value.
6
+ */
7
+ export type FormAttributes = AuthorableAttributes<FormProps, 'submitted'>;
5
8
  declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
6
9
  readonly type: "form";
7
10
  readonly attributeValues: {
8
11
  readonly method: readonly string[];
9
12
  };
10
13
  readonly sourceType: "apiContainer";
14
+ readonly publishes: {
15
+ readonly values: "Each field's value, by its name";
16
+ readonly errors: "Each field's error, by its name — none while it is valid";
17
+ readonly submitted: "Whether a submit was tried — valid or not — since the form was shown or reset: what shows an error only after a submit, or hides a field's hint once one was tried (no `touched`: a field's own error shows once the field is left)";
18
+ };
11
19
  readonly triggers: {
12
20
  readonly onSubmit: {
13
21
  readonly action: "onSubmit";
@@ -20,6 +28,16 @@ declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElemen
20
28
  readonly method: "";
21
29
  };
22
30
  };
31
+ readonly onInvalid: {
32
+ readonly action: "onInvalid";
33
+ readonly title: "On Form Refused";
34
+ readonly type: "trigger";
35
+ readonly params: {};
36
+ readonly preview: {
37
+ readonly errors: {};
38
+ readonly values: {};
39
+ };
40
+ };
23
41
  };
24
42
  readonly callbacks: {
25
43
  readonly performReset: {
@@ -76,7 +94,7 @@ declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElemen
76
94
  };
77
95
  readonly definition: {
78
96
  readonly label: "Form";
79
- readonly description: "A <form> that groups form controls and handles submission; wire its submit through an interaction flow.";
97
+ readonly description: "A <form> that groups form controls and handles submission; wire its submit through an interaction flow. Left as it is, the browser answers first for a blank required field and a malformed address, in a bubble no style reaches and in the browser's language; `noValidate: true` turns its checks off, and every rule answers under its control in the words of its `…Message` (`requiredMessage`).";
80
98
  readonly items: [];
81
99
  };
82
100
  readonly market: {
@@ -4,17 +4,34 @@ var n = e()({
4
4
  type: "form",
5
5
  attributeValues: { method: t()(["get", "post"]) },
6
6
  sourceType: "apiContainer",
7
- triggers: { onSubmit: {
8
- action: "onSubmit",
9
- title: "On Form Submit",
10
- type: "trigger",
11
- params: {},
12
- preview: {
13
- values: {},
14
- actionUrl: "",
15
- method: ""
7
+ publishes: {
8
+ values: "Each field's value, by its name",
9
+ errors: "Each field's error, by its name — none while it is valid",
10
+ submitted: "Whether a submit was tried — valid or not — since the form was shown or reset: what shows an error only after a submit, or hides a field's hint once one was tried (no `touched`: a field's own error shows once the field is left)"
11
+ },
12
+ triggers: {
13
+ onSubmit: {
14
+ action: "onSubmit",
15
+ title: "On Form Submit",
16
+ type: "trigger",
17
+ params: {},
18
+ preview: {
19
+ values: {},
20
+ actionUrl: "",
21
+ method: ""
22
+ }
23
+ },
24
+ onInvalid: {
25
+ action: "onInvalid",
26
+ title: "On Form Refused",
27
+ type: "trigger",
28
+ params: {},
29
+ preview: {
30
+ errors: {},
31
+ values: {}
32
+ }
16
33
  }
17
- } },
34
+ },
18
35
  callbacks: {
19
36
  performReset: {
20
37
  action: "performReset",
@@ -70,7 +87,7 @@ var n = e()({
70
87
  },
71
88
  definition: {
72
89
  label: "Form",
73
- description: "A <form> that groups form controls and handles submission; wire its submit through an interaction flow.",
90
+ description: "A <form> that groups form controls and handles submission; wire its submit through an interaction flow. Left as it is, the browser answers first for a blank required field and a malformed address, in a bubble no style reaches and in the browser's language; `noValidate: true` turns its checks off, and every rule answers under its control in the words of its `…Message` (`requiredMessage`).",
74
91
  items: []
75
92
  },
76
93
  market: {
@@ -1,5 +1,5 @@
1
1
  declare const Form: {
2
- (props: import('../../..').WithElementProps<import('./Form').FormProps>): import('react').JSX.Element;
2
+ (props: import('../../..').WithElementProps<import('./Form').FormProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
3
3
  displayName: string;
4
4
  } & {
5
5
  content: {
@@ -22,7 +22,7 @@ declare const Form: {
22
22
  };
23
23
  definition: {
24
24
  readonly label: "Form";
25
- readonly description: "A <form> that groups form controls and handles submission; wire its submit through an interaction flow.";
25
+ readonly description: "A <form> that groups form controls and handles submission; wire its submit through an interaction flow. Left as it is, the browser answers first for a blank required field and a malformed address, in a bubble no style reaches and in the browser's language; `noValidate: true` turns its checks off, and every rule answers under its control in the words of its `…Message` (`requiredMessage`).";
26
26
  readonly items: [];
27
27
  } & {
28
28
  type: string;
@@ -50,6 +50,11 @@ declare const Form: {
50
50
  readonly method: readonly string[];
51
51
  };
52
52
  sourceType: "apiContainer";
53
+ publishes: {
54
+ readonly values: "Each field's value, by its name";
55
+ readonly errors: "Each field's error, by its name — none while it is valid";
56
+ readonly submitted: "Whether a submit was tried — valid or not — since the form was shown or reset: what shows an error only after a submit, or hides a field's hint once one was tried (no `touched`: a field's own error shows once the field is left)";
57
+ };
53
58
  triggers: {
54
59
  readonly onSubmit: {
55
60
  readonly action: "onSubmit";
@@ -62,6 +67,16 @@ declare const Form: {
62
67
  readonly method: "";
63
68
  };
64
69
  };
70
+ readonly onInvalid: {
71
+ readonly action: "onInvalid";
72
+ readonly title: "On Form Refused";
73
+ readonly type: "trigger";
74
+ readonly params: {};
75
+ readonly preview: {
76
+ readonly errors: {};
77
+ readonly values: {};
78
+ };
79
+ };
65
80
  };
66
81
  callbacks: {
67
82
  readonly performReset: {
@@ -1,14 +1,9 @@
1
+ import { FormControlSubType } from './subTypes';
1
2
  import { ChangeEvent, RefObject } from 'react';
2
3
  export type FormControlProps = {
3
4
  ref: RefObject<HTMLElement>;
4
5
  className: string;
5
- subType: 'text' | 'number' | 'email' | 'password'
6
- /** A search box: the browser draws its clear button, and a phone shows its search key. */
7
- | 'search' | 'url'
8
- /** A phone number: a phone shows its dial pad. */
9
- | 'tel' | 'date' | 'time' | 'checkbox' | 'switch' | 'select' | 'textarea' | 'hidden'
10
- /** The browser's own colour picker: its value is `#rrggbb`. */
11
- | 'color';
6
+ subType: FormControlSubType;
12
7
  name: string;
13
8
  label: string;
14
9
  /**
@@ -18,6 +13,8 @@ export type FormControlProps = {
18
13
  */
19
14
  hideLabel: boolean;
20
15
  placeholder: string;
16
+ /** A `file` field's offer, as the browser reads `accept`: `image/png,image/jpeg`, `.pdf`. `''` for any file. */
17
+ accept: string;
21
18
  autoComplete: boolean;
22
19
  /**
23
20
  * Takes the focus as it appears — a search box opened by a shortcut is typed into at once. With the control's
@@ -44,6 +41,12 @@ export type FormControlProps = {
44
41
  minLengthMessage: string;
45
42
  maxLength: number;
46
43
  maxLengthMessage: string;
44
+ /** A `number` field's least and greatest value and its step, as numbers are written: `''` for none. */
45
+ min: string;
46
+ minMessage: string;
47
+ max: string;
48
+ maxMessage: string;
49
+ step: string;
47
50
  formatMessage: string;
48
51
  pattern: string;
49
52
  patternMessage: string;
@@ -51,7 +54,8 @@ export type FormControlProps = {
51
54
  matches: string;
52
55
  matchesMessage: string;
53
56
  readOnly: boolean;
54
- value: string;
57
+ /** Text for every type but `file`, whose value is the `File` picked. */
58
+ value: string | File;
55
59
  error: string;
56
60
  /**
57
61
  * Supplied by `withFieldValue`, with or without a form around the control.
@@ -62,9 +66,9 @@ export type FormControlProps = {
62
66
  handleChange?: (e: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement> | ChangeEvent<HTMLTextAreaElement>) => void;
63
67
  handleValidate?: () => void;
64
68
  };
65
- declare const FormControl: ({ ref, className, subType, name, label, hideLabel, placeholder, autoComplete, autoFocus, disabled, options, required, maxLength, readOnly, value, error, handleChange, handleValidate }: FormControlProps) => import('react').JSX.Element;
69
+ declare const FormControl: ({ ref, className, subType, name, label, hideLabel, placeholder, accept, autoComplete, autoFocus, disabled, options, required, maxLength, min, max, step, readOnly, value, error, handleChange, handleValidate }: FormControlProps) => import('react').JSX.Element;
66
70
  declare const _default: {
67
- (props: import('../../..').WithElementProps<import('./hocs/withFieldValue').WithFieldValueProps<FormControlProps>>): import('react').JSX.Element;
71
+ (props: import('../../..').WithElementProps<import('./hocs/withFieldValue').WithFieldValueProps<FormControlProps>>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
68
72
  displayName: string;
69
73
  };
70
74
  export default _default;