@eos-ui/vue 0.1.1 → 0.2.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 (407) hide show
  1. package/THIRD_PARTY.md +1 -1
  2. package/dist/component-names.js +1 -1
  3. package/dist/component-names.js.map +1 -1
  4. package/dist/components/Actions/EActions.js.map +1 -1
  5. package/dist/components/Actions/EActions.vue.d.ts +3 -1
  6. package/dist/components/Actions/EActions.vue_vue_type_script_setup_true_lang.js +12 -3
  7. package/dist/components/Actions/EActions.vue_vue_type_script_setup_true_lang.js.map +1 -1
  8. package/dist/components/AppHeader/EAppHeader.js.map +1 -1
  9. package/dist/components/AppHeader/EAppHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/components/AppShell/EAppShell.js.map +1 -1
  11. package/dist/components/AppShell/EAppShell.vue.d.ts +2 -2
  12. package/dist/components/AppShell/EAppShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/components/Avatar/EAvatar.js.map +1 -1
  14. package/dist/components/Avatar/EAvatar.vue.d.ts +4 -4
  15. package/dist/components/Avatar/EAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/components/Breadcrumb/EBreadcrumb.js.map +1 -1
  17. package/dist/components/Breadcrumb/EBreadcrumb.vue.d.ts +2 -2
  18. package/dist/components/Breadcrumb/EBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/Button/EButton.js.map +1 -1
  20. package/dist/components/Button/EButton.vue.d.ts +5 -3
  21. package/dist/components/Button/EButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/components/Calendar/ECalendar.js.map +1 -1
  23. package/dist/components/Calendar/ECalendar.vue.d.ts +12 -9
  24. package/dist/components/Calendar/ECalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/Checkbox/ECheckbox.js.map +1 -1
  26. package/dist/components/Checkbox/ECheckbox.vue.d.ts +6 -3
  27. package/dist/components/Checkbox/ECheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/CodeBlock/ECodeBlock.js.map +1 -1
  29. package/dist/components/CodeBlock/ECodeBlock.vue.d.ts +2 -2
  30. package/dist/components/CodeBlock/ECodeBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  31. package/dist/components/ColorField/EColorField.js.map +1 -1
  32. package/dist/components/ColorField/EColorField.vue.d.ts +5 -3
  33. package/dist/components/ColorField/EColorField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/Combobox/ECombobox.js.map +1 -1
  35. package/dist/components/Combobox/ECombobox.vue.d.ts +7 -5
  36. package/dist/components/Combobox/ECombobox.vue_vue_type_script_setup_true_lang.js +3 -2
  37. package/dist/components/Combobox/ECombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/components/Combobox/EComboboxBase.js.map +1 -1
  39. package/dist/components/Combobox/EComboboxBase.vue.d.ts +6 -14
  40. package/dist/components/Combobox/EComboboxBase.vue_vue_type_script_setup_true_lang.js +9 -8
  41. package/dist/components/Combobox/EComboboxBase.vue_vue_type_script_setup_true_lang.js.map +1 -1
  42. package/dist/components/Combobox/EComboboxOption.js.map +1 -1
  43. package/dist/components/Combobox/EComboboxOption.vue_vue_type_script_setup_true_lang.js +1 -1
  44. package/dist/components/Combobox/EComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/Combobox/{EHighlight.js → matchHighlight.js} +3 -3
  46. package/dist/components/Combobox/matchHighlight.js.map +1 -0
  47. package/dist/components/Combobox/types.d.ts +13 -8
  48. package/dist/components/CurrencyField/ECurrencyField.js.map +1 -1
  49. package/dist/components/CurrencyField/ECurrencyField.vue.d.ts +8 -6
  50. package/dist/components/CurrencyField/ECurrencyField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  51. package/dist/components/DataGrid/EDataGrid.js.map +1 -1
  52. package/dist/components/DataGrid/EDataGrid.vue.d.ts +20 -15
  53. package/dist/components/DataGrid/EDataGrid.vue_vue_type_script_setup_true_lang.js +213 -213
  54. package/dist/components/DataGrid/EDataGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  55. package/dist/components/DatePicker/EDatePicker.js.map +1 -1
  56. package/dist/components/DatePicker/EDatePicker.vue.d.ts +9 -6
  57. package/dist/components/DatePicker/EDatePicker.vue_vue_type_script_setup_true_lang.js +10 -10
  58. package/dist/components/DatePicker/EDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/Definition/EDefinition.js +8 -0
  60. package/dist/components/Definition/EDefinition.js.map +1 -0
  61. package/dist/components/{Popover/EPopover.vue.d.ts → Definition/EDefinition.vue.d.ts} +2 -1
  62. package/dist/components/{Popover/EPopover.vue_vue_type_script_setup_true_lang.js → Definition/EDefinition.vue_vue_type_script_setup_true_lang.js} +4 -4
  63. package/dist/components/Definition/EDefinition.vue_vue_type_script_setup_true_lang.js.map +1 -0
  64. package/dist/components/Definition/index.d.ts +1 -0
  65. package/dist/components/DescriptionList/EDescriptionList.js.map +1 -1
  66. package/dist/components/DescriptionList/EDescriptionList.vue.d.ts +32 -5
  67. package/dist/components/DescriptionList/EDescriptionList.vue_vue_type_script_setup_true_lang.js +70 -8
  68. package/dist/components/DescriptionList/EDescriptionList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/components/Dialog/DialogFrame.js.map +1 -1
  70. package/dist/components/Dialog/DialogFrame.vue.d.ts +1 -0
  71. package/dist/components/Dialog/DialogFrame.vue_vue_type_script_setup_true_lang.js +19 -18
  72. package/dist/components/Dialog/DialogFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  73. package/dist/components/Dialog/EDialog.js.map +1 -1
  74. package/dist/components/Dialog/EDialog.vue.d.ts +4 -1
  75. package/dist/components/Dialog/EDialog.vue_vue_type_script_setup_true_lang.js +3 -0
  76. package/dist/components/Dialog/EDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  77. package/dist/components/Disclosure/EDisclosure.js.map +1 -1
  78. package/dist/components/Disclosure/EDisclosure.vue.d.ts +6 -9
  79. package/dist/components/Disclosure/EDisclosure.vue_vue_type_script_setup_true_lang.js +14 -19
  80. package/dist/components/Disclosure/EDisclosure.vue_vue_type_script_setup_true_lang.js.map +1 -1
  81. package/dist/components/Drawer/EDrawer.js.map +1 -1
  82. package/dist/components/Drawer/EDrawer.vue.d.ts +4 -1
  83. package/dist/components/Drawer/EDrawer.vue_vue_type_script_setup_true_lang.js +3 -0
  84. package/dist/components/Drawer/EDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
  85. package/dist/components/EmptyState/EEmptyState.js.map +1 -1
  86. package/dist/components/EmptyState/EEmptyState.vue.d.ts +1 -1
  87. package/dist/components/EmptyState/EEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/components/ExpandableRow/EExpandableRow.js +8 -0
  89. package/dist/components/ExpandableRow/EExpandableRow.js.map +1 -0
  90. package/dist/components/{ButtonGroup/EButtonGroup.vue.d.ts → ExpandableRow/EExpandableRow.vue.d.ts} +12 -4
  91. package/dist/components/ExpandableRow/EExpandableRow.vue_vue_type_script_setup_true_lang.js +40 -0
  92. package/dist/components/ExpandableRow/EExpandableRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
  93. package/dist/components/ExpandableRow/index.d.ts +1 -0
  94. package/dist/components/Field/EField.js.map +1 -1
  95. package/dist/components/Field/EField.vue.d.ts +1 -1
  96. package/dist/components/Field/EField.vue_vue_type_script_setup_true_lang.js +4 -4
  97. package/dist/components/Field/EField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  98. package/dist/components/Field/labelProps.d.ts +2 -2
  99. package/dist/components/Fieldset/EFieldset.js.map +1 -1
  100. package/dist/components/Fieldset/EFieldset.vue.d.ts +5 -3
  101. package/dist/components/Fieldset/EFieldset.vue_vue_type_script_setup_true_lang.js +54 -35
  102. package/dist/components/Fieldset/EFieldset.vue_vue_type_script_setup_true_lang.js.map +1 -1
  103. package/dist/components/Grid/EGrid.js.map +1 -1
  104. package/dist/components/Grid/EGrid.vue.d.ts +5 -2
  105. package/dist/components/Grid/EGrid.vue_vue_type_script_setup_true_lang.js +15 -11
  106. package/dist/components/Grid/EGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  107. package/dist/components/Heading/EHeading.js.map +1 -1
  108. package/dist/components/Heading/EHeading.vue.d.ts +1 -1
  109. package/dist/components/Heading/EHeading.vue_vue_type_script_setup_true_lang.js +10 -10
  110. package/dist/components/Heading/EHeading.vue_vue_type_script_setup_true_lang.js.map +1 -1
  111. package/dist/components/Highlight/EHighlight.js.map +1 -1
  112. package/dist/components/Highlight/EHighlight.vue_vue_type_script_setup_true_lang.js.map +1 -1
  113. package/dist/components/IconButton/EIconButton.js.map +1 -1
  114. package/dist/components/IconButton/EIconButton.vue.d.ts +1 -0
  115. package/dist/components/IconButton/EIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  116. package/dist/components/Inline/EInline.js.map +1 -1
  117. package/dist/components/Inline/EInline.vue.d.ts +3 -3
  118. package/dist/components/Inline/EInline.vue_vue_type_script_setup_true_lang.js.map +1 -1
  119. package/dist/components/Kbd/EKbd.js.map +1 -1
  120. package/dist/components/Kbd/EKbd.vue_vue_type_script_setup_true_lang.js.map +1 -1
  121. package/dist/components/Link/ELink.js.map +1 -1
  122. package/dist/components/Link/ELink.vue.d.ts +2 -2
  123. package/dist/components/Link/ELink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  124. package/dist/components/Menu/EMenu.js.map +1 -1
  125. package/dist/components/Menu/EMenu.vue.d.ts +4 -3
  126. package/dist/components/Menu/EMenu.vue_vue_type_script_setup_true_lang.js +1 -1
  127. package/dist/components/Menu/EMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  128. package/dist/components/NavList/ENavList.js.map +1 -1
  129. package/dist/components/NavList/ENavList.vue.d.ts +7 -9
  130. package/dist/components/NavList/ENavList.vue_vue_type_script_setup_true_lang.js +2 -3
  131. package/dist/components/NavList/ENavList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  132. package/dist/components/{Tabs → NavList}/LinkNav.js +1 -1
  133. package/dist/components/NavList/LinkNav.js.map +1 -0
  134. package/dist/components/{Tabs → NavList}/LinkNav.vue_vue_type_script_setup_true_lang.js +1 -1
  135. package/dist/components/NavList/LinkNav.vue_vue_type_script_setup_true_lang.js.map +1 -0
  136. package/dist/components/Notice/ENotice.js.map +1 -1
  137. package/dist/components/Notice/ENotice.vue.d.ts +2 -2
  138. package/dist/components/Notice/ENotice.vue_vue_type_script_setup_true_lang.js.map +1 -1
  139. package/dist/components/NumberField/ENumberField.js.map +1 -1
  140. package/dist/components/NumberField/ENumberField.vue.d.ts +5 -3
  141. package/dist/components/NumberField/ENumberField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  142. package/dist/components/OtpField/EOtpField.js.map +1 -1
  143. package/dist/components/OtpField/EOtpField.vue.d.ts +10 -8
  144. package/dist/components/OtpField/EOtpField.vue_vue_type_script_setup_true_lang.js +2 -2
  145. package/dist/components/OtpField/EOtpField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  146. package/dist/components/PageHeader/EPageHeader.js.map +1 -1
  147. package/dist/components/PageHeader/EPageHeader.vue.d.ts +1 -1
  148. package/dist/components/PageHeader/EPageHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  149. package/dist/components/Pagination/EPagination.js.map +1 -1
  150. package/dist/components/Pagination/EPagination.vue.d.ts +1 -0
  151. package/dist/components/Pagination/EPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  152. package/dist/components/PasswordField/EPasswordField.js.map +1 -1
  153. package/dist/components/PasswordField/EPasswordField.vue.d.ts +14 -10
  154. package/dist/components/PasswordField/EPasswordField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/components/PhoneField/EPhoneField.js.map +1 -1
  156. package/dist/components/PhoneField/EPhoneField.vue.d.ts +6 -4
  157. package/dist/components/PhoneField/EPhoneField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  158. package/dist/components/Progress/EProgress.js.map +1 -1
  159. package/dist/components/Progress/EProgress.vue.d.ts +5 -5
  160. package/dist/components/Progress/EProgress.vue_vue_type_script_setup_true_lang.js +20 -14
  161. package/dist/components/Progress/EProgress.vue_vue_type_script_setup_true_lang.js.map +1 -1
  162. package/dist/components/RadioGroup/ERadioGroup.js.map +1 -1
  163. package/dist/components/RadioGroup/ERadioGroup.vue.d.ts +8 -4
  164. package/dist/components/RadioGroup/ERadioGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  165. package/dist/components/RadioGroup/ERadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  166. package/dist/components/RangePicker/ERangePicker.js.map +1 -1
  167. package/dist/components/RangePicker/ERangePicker.vue.d.ts +12 -8
  168. package/dist/components/RangePicker/ERangePicker.vue_vue_type_script_setup_true_lang.js +65 -65
  169. package/dist/components/RangePicker/ERangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  170. package/dist/components/SearchBar/ESearchBar.js.map +1 -1
  171. package/dist/components/SearchBar/ESearchBar.vue.d.ts +8 -7
  172. package/dist/components/SearchBar/ESearchBar.vue_vue_type_script_setup_true_lang.js +1 -1
  173. package/dist/components/SearchBar/ESearchBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  174. package/dist/components/SearchResults/ESearchResults.js.map +1 -1
  175. package/dist/components/SearchResults/ESearchResults.vue.d.ts +3 -3
  176. package/dist/components/SearchResults/ESearchResults.vue_vue_type_script_setup_true_lang.js +1 -1
  177. package/dist/components/SearchResults/ESearchResults.vue_vue_type_script_setup_true_lang.js.map +1 -1
  178. package/dist/components/Segmented/ESegmented.js.map +1 -1
  179. package/dist/components/Segmented/ESegmented.vue.d.ts +10 -6
  180. package/dist/components/Segmented/ESegmented.vue_vue_type_script_setup_true_lang.js.map +1 -1
  181. package/dist/components/Select/ESelect.js.map +1 -1
  182. package/dist/components/Select/ESelect.vue.d.ts +9 -6
  183. package/dist/components/Select/ESelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  184. package/dist/components/Select/ESelectControl.vue.d.ts +2 -2
  185. package/dist/components/Select/ESelectControl.vue_vue_type_script_setup_true_lang.js +6 -6
  186. package/dist/components/Select/options.d.ts +1 -1
  187. package/dist/components/Select/options.js.map +1 -1
  188. package/dist/components/SignatureField/ESignatureField.js.map +1 -1
  189. package/dist/components/SignatureField/ESignatureField.vue.d.ts +14 -10
  190. package/dist/components/SignatureField/ESignatureField.vue_vue_type_script_setup_true_lang.js +4 -4
  191. package/dist/components/SignatureField/ESignatureField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  192. package/dist/components/SignaturePad/ESignaturePad.js.map +1 -1
  193. package/dist/components/SignaturePad/ESignaturePad.vue.d.ts +3 -1
  194. package/dist/components/SignaturePad/ESignaturePad.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/components/Skeleton/ESkeleton.js.map +1 -1
  196. package/dist/components/Skeleton/ESkeleton.vue.d.ts +3 -3
  197. package/dist/components/Skeleton/ESkeleton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  198. package/dist/components/Stack/EStack.js.map +1 -1
  199. package/dist/components/Stack/EStack.vue.d.ts +2 -2
  200. package/dist/components/Stack/EStack.vue_vue_type_script_setup_true_lang.js.map +1 -1
  201. package/dist/components/Stamp/EStamp.js.map +1 -1
  202. package/dist/components/Stamp/EStamp.vue.d.ts +18 -12
  203. package/dist/components/Stamp/EStamp.vue_vue_type_script_setup_true_lang.js +27 -40
  204. package/dist/components/Stamp/EStamp.vue_vue_type_script_setup_true_lang.js.map +1 -1
  205. package/dist/components/Stepper/EStepper.js.map +1 -1
  206. package/dist/components/Stepper/EStepper.vue.d.ts +2 -2
  207. package/dist/components/Stepper/EStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  208. package/dist/components/Surface/ESurface.js.map +1 -1
  209. package/dist/components/Surface/ESurface.vue.d.ts +5 -5
  210. package/dist/components/Surface/ESurface.vue_vue_type_script_setup_true_lang.js +5 -5
  211. package/dist/components/Surface/ESurface.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/Switch/ESwitch.js.map +1 -1
  213. package/dist/components/Switch/ESwitch.vue.d.ts +3 -1
  214. package/dist/components/Switch/ESwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  215. package/dist/components/Tabs/ETabs.js.map +1 -1
  216. package/dist/components/Tabs/ETabs.vue.d.ts +10 -32
  217. package/dist/components/Tabs/ETabs.vue_vue_type_script_setup_true_lang.js +21 -50
  218. package/dist/components/Tabs/ETabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  219. package/dist/components/Tabs/index.d.ts +1 -1
  220. package/dist/components/Text/EText.js.map +1 -1
  221. package/dist/components/Text/EText.vue.d.ts +4 -3
  222. package/dist/components/Text/EText.vue_vue_type_script_setup_true_lang.js +7 -2
  223. package/dist/components/Text/EText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  224. package/dist/components/TextField/ETextField.js.map +1 -1
  225. package/dist/components/TextField/ETextField.vue.d.ts +8 -6
  226. package/dist/components/TextField/ETextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  227. package/dist/components/Textarea/ETextarea.js.map +1 -1
  228. package/dist/components/Textarea/ETextarea.vue.d.ts +4 -2
  229. package/dist/components/Textarea/ETextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  230. package/dist/components/Toast/EToast.js.map +1 -1
  231. package/dist/components/Toast/EToast.vue_vue_type_script_setup_true_lang.js +5 -5
  232. package/dist/components/Toast/EToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/components/ToastProvider/EToastProvider.js.map +1 -1
  234. package/dist/components/ToastProvider/EToastProvider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  235. package/dist/components/Tooltip/ETooltip.js.map +1 -1
  236. package/dist/components/Tooltip/ETooltip.vue.d.ts +1 -0
  237. package/dist/components/Tooltip/ETooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  238. package/dist/components/Upload/EUpload.js.map +1 -1
  239. package/dist/components/Upload/EUpload.vue.d.ts +5 -3
  240. package/dist/components/Upload/EUpload.vue_vue_type_script_setup_true_lang.js.map +1 -1
  241. package/dist/fonts.css +1 -1
  242. package/dist/index.d.ts +2 -25
  243. package/dist/index.js +71 -94
  244. package/dist/messages.d.ts +0 -13
  245. package/dist/messages.js +0 -13
  246. package/dist/messages.js.map +1 -1
  247. package/dist/style.css +2667 -3127
  248. package/package.json +4 -2
  249. package/dist/components/Accordion/EAccordion.js +0 -8
  250. package/dist/components/Accordion/EAccordion.js.map +0 -1
  251. package/dist/components/Accordion/EAccordion.vue.d.ts +0 -32
  252. package/dist/components/Accordion/EAccordion.vue_vue_type_script_setup_true_lang.js +0 -35
  253. package/dist/components/Accordion/EAccordion.vue_vue_type_script_setup_true_lang.js.map +0 -1
  254. package/dist/components/Accordion/index.d.ts +0 -2
  255. package/dist/components/AddressField/EAddressField.js +0 -8
  256. package/dist/components/AddressField/EAddressField.js.map +0 -1
  257. package/dist/components/AddressField/EAddressField.vue.d.ts +0 -39
  258. package/dist/components/AddressField/EAddressField.vue_vue_type_script_setup_true_lang.js +0 -119
  259. package/dist/components/AddressField/EAddressField.vue_vue_type_script_setup_true_lang.js.map +0 -1
  260. package/dist/components/AddressField/index.d.ts +0 -2
  261. package/dist/components/AddressField/usStates.d.ts +0 -5
  262. package/dist/components/AddressField/usStates.js +0 -211
  263. package/dist/components/AddressField/usStates.js.map +0 -1
  264. package/dist/components/Amount/EAmount.js +0 -8
  265. package/dist/components/Amount/EAmount.js.map +0 -1
  266. package/dist/components/Amount/EAmount.vue.d.ts +0 -21
  267. package/dist/components/Amount/EAmount.vue_vue_type_script_setup_true_lang.js +0 -38
  268. package/dist/components/Amount/EAmount.vue_vue_type_script_setup_true_lang.js.map +0 -1
  269. package/dist/components/Amount/index.d.ts +0 -2
  270. package/dist/components/Autocomplete/EAutocomplete.js +0 -7
  271. package/dist/components/Autocomplete/EAutocomplete.js.map +0 -1
  272. package/dist/components/Autocomplete/EAutocomplete.vue.d.ts +0 -44
  273. package/dist/components/Autocomplete/EAutocomplete.vue_vue_type_script_setup_true_lang.js +0 -58
  274. package/dist/components/Autocomplete/EAutocomplete.vue_vue_type_script_setup_true_lang.js.map +0 -1
  275. package/dist/components/Autocomplete/index.d.ts +0 -1
  276. package/dist/components/BackLink/EBackLink.js +0 -8
  277. package/dist/components/BackLink/EBackLink.js.map +0 -1
  278. package/dist/components/BackLink/EBackLink.vue.d.ts +0 -23
  279. package/dist/components/BackLink/EBackLink.vue_vue_type_script_setup_true_lang.js +0 -27
  280. package/dist/components/BackLink/EBackLink.vue_vue_type_script_setup_true_lang.js.map +0 -1
  281. package/dist/components/BackLink/index.d.ts +0 -1
  282. package/dist/components/BookingCard/EBookingCard.js +0 -8
  283. package/dist/components/BookingCard/EBookingCard.js.map +0 -1
  284. package/dist/components/BookingCard/EBookingCard.vue.d.ts +0 -46
  285. package/dist/components/BookingCard/EBookingCard.vue_vue_type_script_setup_true_lang.js +0 -86
  286. package/dist/components/BookingCard/EBookingCard.vue_vue_type_script_setup_true_lang.js.map +0 -1
  287. package/dist/components/BookingCard/index.d.ts +0 -2
  288. package/dist/components/ButtonGroup/EButtonGroup.js +0 -8
  289. package/dist/components/ButtonGroup/EButtonGroup.js.map +0 -1
  290. package/dist/components/ButtonGroup/EButtonGroup.vue_vue_type_script_setup_true_lang.js +0 -18
  291. package/dist/components/ButtonGroup/EButtonGroup.vue_vue_type_script_setup_true_lang.js.map +0 -1
  292. package/dist/components/ButtonGroup/index.d.ts +0 -1
  293. package/dist/components/CardField/ECardField.js +0 -8
  294. package/dist/components/CardField/ECardField.js.map +0 -1
  295. package/dist/components/CardField/ECardField.vue.d.ts +0 -31
  296. package/dist/components/CardField/ECardField.vue_vue_type_script_setup_true_lang.js +0 -65
  297. package/dist/components/CardField/ECardField.vue_vue_type_script_setup_true_lang.js.map +0 -1
  298. package/dist/components/CardField/index.d.ts +0 -1
  299. package/dist/components/Chip/EChip.js +0 -8
  300. package/dist/components/Chip/EChip.js.map +0 -1
  301. package/dist/components/Chip/EChip.vue.d.ts +0 -22
  302. package/dist/components/Chip/EChip.vue_vue_type_script_setup_true_lang.js +0 -18
  303. package/dist/components/Chip/EChip.vue_vue_type_script_setup_true_lang.js.map +0 -1
  304. package/dist/components/Chip/index.d.ts +0 -2
  305. package/dist/components/Combobox/EHighlight.js.map +0 -1
  306. package/dist/components/DetailRow/EDetailRow.js +0 -8
  307. package/dist/components/DetailRow/EDetailRow.js.map +0 -1
  308. package/dist/components/DetailRow/EDetailRow.vue.d.ts +0 -30
  309. package/dist/components/DetailRow/EDetailRow.vue_vue_type_script_setup_true_lang.js +0 -53
  310. package/dist/components/DetailRow/EDetailRow.vue_vue_type_script_setup_true_lang.js.map +0 -1
  311. package/dist/components/DetailRow/index.d.ts +0 -1
  312. package/dist/components/ErrorSummary/EErrorSummary.js +0 -8
  313. package/dist/components/ErrorSummary/EErrorSummary.js.map +0 -1
  314. package/dist/components/ErrorSummary/EErrorSummary.vue.d.ts +0 -30
  315. package/dist/components/ErrorSummary/EErrorSummary.vue_vue_type_script_setup_true_lang.js +0 -52
  316. package/dist/components/ErrorSummary/EErrorSummary.vue_vue_type_script_setup_true_lang.js.map +0 -1
  317. package/dist/components/ErrorSummary/index.d.ts +0 -2
  318. package/dist/components/FormSection/EFormSection.js +0 -8
  319. package/dist/components/FormSection/EFormSection.js.map +0 -1
  320. package/dist/components/FormSection/EFormSection.vue.d.ts +0 -28
  321. package/dist/components/FormSection/EFormSection.vue_vue_type_script_setup_true_lang.js +0 -38
  322. package/dist/components/FormSection/EFormSection.vue_vue_type_script_setup_true_lang.js.map +0 -1
  323. package/dist/components/FormSection/index.d.ts +0 -1
  324. package/dist/components/ItemList/EItemList.js +0 -8
  325. package/dist/components/ItemList/EItemList.js.map +0 -1
  326. package/dist/components/ItemList/EItemList.vue.d.ts +0 -13
  327. package/dist/components/ItemList/EItemList.vue_vue_type_script_setup_true_lang.js +0 -17
  328. package/dist/components/ItemList/EItemList.vue_vue_type_script_setup_true_lang.js.map +0 -1
  329. package/dist/components/ItemList/context.d.ts +0 -3
  330. package/dist/components/ItemList/context.js +0 -6
  331. package/dist/components/ItemList/context.js.map +0 -1
  332. package/dist/components/ItemList/index.d.ts +0 -1
  333. package/dist/components/ItemRow/EItemRow.js +0 -8
  334. package/dist/components/ItemRow/EItemRow.js.map +0 -1
  335. package/dist/components/ItemRow/EItemRow.vue.d.ts +0 -29
  336. package/dist/components/ItemRow/EItemRow.vue_vue_type_script_setup_true_lang.js +0 -54
  337. package/dist/components/ItemRow/EItemRow.vue_vue_type_script_setup_true_lang.js.map +0 -1
  338. package/dist/components/ItemRow/index.d.ts +0 -1
  339. package/dist/components/LinkCard/ELinkCard.js +0 -8
  340. package/dist/components/LinkCard/ELinkCard.js.map +0 -1
  341. package/dist/components/LinkCard/ELinkCard.vue.d.ts +0 -39
  342. package/dist/components/LinkCard/ELinkCard.vue_vue_type_script_setup_true_lang.js +0 -61
  343. package/dist/components/LinkCard/ELinkCard.vue_vue_type_script_setup_true_lang.js.map +0 -1
  344. package/dist/components/LinkCard/index.d.ts +0 -1
  345. package/dist/components/LoadingBar/ELoadingBar.js +0 -8
  346. package/dist/components/LoadingBar/ELoadingBar.js.map +0 -1
  347. package/dist/components/LoadingBar/ELoadingBar.vue.d.ts +0 -7
  348. package/dist/components/LoadingBar/ELoadingBar.vue_vue_type_script_setup_true_lang.js +0 -21
  349. package/dist/components/LoadingBar/ELoadingBar.vue_vue_type_script_setup_true_lang.js.map +0 -1
  350. package/dist/components/LoadingBar/index.d.ts +0 -1
  351. package/dist/components/MetaList/EMetaList.js +0 -8
  352. package/dist/components/MetaList/EMetaList.js.map +0 -1
  353. package/dist/components/MetaList/EMetaList.vue.d.ts +0 -15
  354. package/dist/components/MetaList/EMetaList.vue_vue_type_script_setup_true_lang.js +0 -19
  355. package/dist/components/MetaList/EMetaList.vue_vue_type_script_setup_true_lang.js.map +0 -1
  356. package/dist/components/MetaList/index.d.ts +0 -2
  357. package/dist/components/MultiSelect/EMultiSelect.js +0 -7
  358. package/dist/components/MultiSelect/EMultiSelect.js.map +0 -1
  359. package/dist/components/MultiSelect/EMultiSelect.vue.d.ts +0 -44
  360. package/dist/components/MultiSelect/EMultiSelect.vue_vue_type_script_setup_true_lang.js +0 -58
  361. package/dist/components/MultiSelect/EMultiSelect.vue_vue_type_script_setup_true_lang.js.map +0 -1
  362. package/dist/components/MultiSelect/index.d.ts +0 -1
  363. package/dist/components/Panel/EPanel.js +0 -8
  364. package/dist/components/Panel/EPanel.js.map +0 -1
  365. package/dist/components/Panel/EPanel.vue.d.ts +0 -25
  366. package/dist/components/Panel/EPanel.vue_vue_type_script_setup_true_lang.js +0 -38
  367. package/dist/components/Panel/EPanel.vue_vue_type_script_setup_true_lang.js.map +0 -1
  368. package/dist/components/Panel/index.d.ts +0 -1
  369. package/dist/components/Popover/EPopover.js +0 -8
  370. package/dist/components/Popover/EPopover.js.map +0 -1
  371. package/dist/components/Popover/EPopover.vue_vue_type_script_setup_true_lang.js.map +0 -1
  372. package/dist/components/Popover/index.d.ts +0 -1
  373. package/dist/components/SlotPicker/ESlotPicker.js +0 -8
  374. package/dist/components/SlotPicker/ESlotPicker.js.map +0 -1
  375. package/dist/components/SlotPicker/ESlotPicker.vue.d.ts +0 -55
  376. package/dist/components/SlotPicker/ESlotPicker.vue_vue_type_script_setup_true_lang.js +0 -82
  377. package/dist/components/SlotPicker/ESlotPicker.vue_vue_type_script_setup_true_lang.js.map +0 -1
  378. package/dist/components/SlotPicker/index.d.ts +0 -2
  379. package/dist/components/StatementCard/EStatementCard.js +0 -8
  380. package/dist/components/StatementCard/EStatementCard.js.map +0 -1
  381. package/dist/components/StatementCard/EStatementCard.vue.d.ts +0 -20
  382. package/dist/components/StatementCard/EStatementCard.vue_vue_type_script_setup_true_lang.js +0 -96
  383. package/dist/components/StatementCard/EStatementCard.vue_vue_type_script_setup_true_lang.js.map +0 -1
  384. package/dist/components/StatementCard/index.d.ts +0 -2
  385. package/dist/components/StatementCard/types.d.ts +0 -37
  386. package/dist/components/StatementRow/EStatementRow.js +0 -8
  387. package/dist/components/StatementRow/EStatementRow.js.map +0 -1
  388. package/dist/components/StatementRow/EStatementRow.vue.d.ts +0 -14
  389. package/dist/components/StatementRow/EStatementRow.vue_vue_type_script_setup_true_lang.js +0 -96
  390. package/dist/components/StatementRow/EStatementRow.vue_vue_type_script_setup_true_lang.js.map +0 -1
  391. package/dist/components/StatementRow/index.d.ts +0 -1
  392. package/dist/components/Tabs/LinkNav.js.map +0 -1
  393. package/dist/components/Tabs/LinkNav.vue_vue_type_script_setup_true_lang.js.map +0 -1
  394. package/dist/components/Timeline/ETimeline.js +0 -8
  395. package/dist/components/Timeline/ETimeline.js.map +0 -1
  396. package/dist/components/Timeline/ETimeline.vue.d.ts +0 -15
  397. package/dist/components/Timeline/ETimeline.vue_vue_type_script_setup_true_lang.js +0 -43
  398. package/dist/components/Timeline/ETimeline.vue_vue_type_script_setup_true_lang.js.map +0 -1
  399. package/dist/components/Timeline/index.d.ts +0 -2
  400. package/dist/components/Toggle/EToggle.js +0 -8
  401. package/dist/components/Toggle/EToggle.js.map +0 -1
  402. package/dist/components/Toggle/EToggle.vue.d.ts +0 -27
  403. package/dist/components/Toggle/EToggle.vue_vue_type_script_setup_true_lang.js +0 -40
  404. package/dist/components/Toggle/EToggle.vue_vue_type_script_setup_true_lang.js.map +0 -1
  405. package/dist/components/Toggle/index.d.ts +0 -1
  406. /package/dist/components/Combobox/{EHighlight.d.ts → matchHighlight.d.ts} +0 -0
  407. /package/dist/components/{Tabs → NavList}/LinkNav.vue.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import { Component } from 'vue';
2
- import { LinkItem, LinkSection } from '../Tabs/LinkNav.vue.js';
2
+ import { LinkItem, LinkSection } from './LinkNav.vue.js';
3
3
  import { IconProp } from '../../icons/types.js';
4
4
  export interface NavItem extends LinkItem {
5
5
  /** An icon before the label. */
@@ -9,22 +9,20 @@ export interface NavItem extends LinkItem {
9
9
  }
10
10
  export type NavSection = LinkSection<NavItem>;
11
11
  type __VLS_Props = {
12
- /** The destinations, in order. */
12
+ /** The destinations, in order: `{ label, href?, to?, icon?, count?, current? }`. With no `href` or `to` a link goes to `#`. Set `current` yourself. */
13
13
  items?: NavItem[];
14
- /** Destinations in labelled groups, instead of `items`. Give a heading only when there is more than one section. */
14
+ /** Destinations in labelled groups, instead of `items`: `{ label?, items }`. Give a label only when there is more than one section. */
15
15
  sections?: NavSection[];
16
- /** Shorter rows and smaller words, for a long list such as the pages of a documentation site. */
17
- dense?: boolean;
18
- /** `vertical` stacks the links, for a sidebar or a menu. `horizontal` lays them in a row, for a header: muted words, a bar under each, a heavier bar under the current page. */
16
+ /** `vertical` stacks the links, for a sidebar or a menu. `horizontal` lays them in a row, for a header, with a hairline between each. Items look the same as in the vertical list: a tint on hover, and a primary outline with a heavier bottom edge on the current page. */
19
17
  orientation?: "vertical" | "horizontal";
20
- /** The landmark's name, so a page with two navigations tells them apart. Defaults to "Main". */
18
+ /** The landmark's name; give each navigation on a page its own. @default "Main" */
21
19
  label?: string;
22
- /** What renders each link: `"a"` by default, or `RouterLink` (or any component that takes `href` or `to` and a default slot). */
20
+ /** What renders each link: `"a"` by default, or `RouterLink` (or any component that takes `href` or `to` and a default slot). Give items `to`; it receives `to` or `href`, the class `e-nav-item` and `aria-current`. */
23
21
  linkComponent?: string | Component;
24
22
  };
25
23
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
26
- orientation: "vertical" | "horizontal";
27
24
  linkComponent: string | Component;
25
+ orientation: "vertical" | "horizontal";
28
26
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
27
  declare const _default: typeof __VLS_export;
30
28
  export default _default;
@@ -1,6 +1,6 @@
1
1
  /* empty css */
2
2
  import e from "../Icon/EIcon.js";
3
- import t from "../Tabs/LinkNav.js";
3
+ import t from "./LinkNav.js";
4
4
  import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, toDisplayString as u, withCtx as d } from "vue";
5
5
  //#region src/components/NavList/ENavList.vue?vue&type=script&setup=true&lang.ts
6
6
  var f = { class: "e-nav-label" }, p = {
@@ -11,7 +11,6 @@ var f = { class: "e-nav-label" }, p = {
11
11
  props: {
12
12
  items: {},
13
13
  sections: {},
14
- dense: { type: Boolean },
15
14
  orientation: { default: "vertical" },
16
15
  label: {},
17
16
  linkComponent: { default: "a" }
@@ -19,7 +18,7 @@ var f = { class: "e-nav-label" }, p = {
19
18
  setup(s) {
20
19
  let m = s, h = n(() => m.sections ?? [{ items: m.items ?? [] }]);
21
20
  return (n, m) => (l(), r(t, {
22
- class: c(["e-nav", [s.dense && "e-nav--dense", s.orientation === "horizontal" && "e-nav--horizontal"]]),
21
+ class: c(["e-nav", s.orientation === "horizontal" && "e-nav--horizontal"]),
23
22
  groups: h.value,
24
23
  label: s.label,
25
24
  "link-component": s.linkComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"ENavList.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","LinkNav","_normalizeClass","_withCtx","EIcon","_createCommentVNode","_createElementVNode","_toDisplayString","_createElementBlock","EIcon_default","LinkNav_default","_hoisted_1","_hoisted_2","ENavList_vue_vue_type_script_setup_true_lang_default","props","__props","groups","computed","openBlock","createBlock","normalizeClass","withCtx","item","createCommentVNode","createElementVNode","toDisplayString","createElementBlock"],"sources":["../../../src/components/NavList/ENavList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, type Component } from \"vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport LinkNav, { type LinkItem, type LinkSection } from \"../Tabs/LinkNav.vue\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\n\nexport interface NavItem extends LinkItem {\n /** An icon before the label. */\n icon?: IconProp;\n /** A count of things waiting on the person (bills to pay, forms to sign). */\n count?: number;\n}\n\nexport type NavSection = LinkSection<NavItem>;\n\nconst props = withDefaults(\n defineProps<{\n /** The destinations, in order. */\n items?: NavItem[];\n /** Destinations in labelled groups, instead of `items`. Give a heading only when there is more than one section. */\n sections?: NavSection[];\n /** Shorter rows and smaller words, for a long list such as the pages of a documentation site. */\n dense?: boolean;\n /** `vertical` stacks the links, for a sidebar or a menu. `horizontal` lays them in a row, for a header: muted words, a bar under each, a heavier bar under the current page. */\n orientation?: \"vertical\" | \"horizontal\";\n /** The landmark's name, so a page with two navigations tells them apart. Defaults to \"Main\". */\n label?: string;\n /** What renders each link: `\"a\"` by default, or `RouterLink` (or any component that takes `href` or `to` and a default slot). */\n linkComponent?: string | Component;\n }>(),\n { orientation: \"vertical\", linkComponent: \"a\" },\n);\n\nconst groups = computed<NavSection[]>(() => props.sections ?? [{ items: props.items ?? [] }]);\n</script>\n\n<template>\n <LinkNav\n class=\"e-nav\"\n :class=\"[dense && 'e-nav--dense', orientation === 'horizontal' && 'e-nav--horizontal']\"\n :groups=\"groups\"\n :label=\"label\"\n :link-component=\"linkComponent\"\n item-class=\"e-nav-item\"\n heading-class=\"e-nav-heading\"\n >\n <template #item=\"{ item }\">\n <EIcon v-if=\"item.icon\" :name=\"item.icon\" />\n <span class=\"e-nav-label\">{{ item.label }}</span>\n <span v-if=\"item.count != null\" class=\"e-nav-count\">{{ item.count }}</span>\n </template>\n </LinkNav>\n</template>\n\n<style>\n@layer e.page {\n .e-nav ul {\n display: grid;\n gap: 2px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .e-nav-item {\n display: flex;\n align-items: center;\n gap: var(--e-space-3);\n height: var(--e-control-height);\n padding: 0 var(--e-space-3);\n border-radius: var(--e-radius-md);\n color: var(--e-ink);\n font: 400 var(--e-text-md) / 1 var(--e-font-sans);\n text-decoration: none;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-nav-item:hover {\n background: var(--e-surface-tint);\n }\n\n .e-nav-item:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n .e-nav:not(.e-nav--dense, .e-nav--horizontal) .e-nav-item {\n box-sizing: border-box;\n border: var(--e-stroke-edge) solid transparent;\n }\n\n .e-nav-item[aria-current=\"page\"] {\n background: color-mix(in srgb, var(--e-surface-tint), var(--e-ink) 3%);\n font-weight: 600;\n }\n\n .e-nav:not(.e-nav--dense, .e-nav--horizontal) .e-nav-item[aria-current=\"page\"] {\n border-color: var(--e-border-strong);\n border-top-width: calc(var(--e-stroke-edge) + var(--e-depth));\n }\n\n .e-nav-label {\n flex: 1;\n min-width: 0;\n }\n\n .e-nav--dense .e-nav-item {\n position: relative;\n height: 2.25rem;\n gap: var(--e-space-2);\n border-radius: 0;\n box-shadow: inset 2px 0 0 transparent;\n color: var(--e-muted);\n font-size: var(--e-text-sm);\n }\n\n .e-nav--dense .e-nav-item::after {\n content: \"\";\n position: absolute;\n inset-block: -4px;\n inset-inline: 0;\n }\n\n .e-nav--dense .e-nav-item:hover {\n background: transparent;\n box-shadow: inset 2px 0 0 var(--e-border-strong);\n color: var(--e-ink);\n }\n\n .e-nav--dense .e-nav-item[aria-current=\"page\"] {\n background: var(--e-surface-tint);\n box-shadow: inset 3px 0 0 var(--e-primary);\n color: var(--e-primary);\n font-weight: 600;\n }\n\n .e-nav--dense .e-nav-heading {\n margin-top: var(--e-space-4);\n padding-top: var(--e-space-4);\n border-top: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-nav--dense > .e-nav-heading:first-child {\n padding-top: 0;\n border-top: 0;\n }\n\n .e-nav--horizontal {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--e-space-2) var(--e-space-4);\n }\n\n .e-nav--horizontal ul {\n display: flex;\n flex-wrap: wrap;\n gap: var(--e-space-2);\n }\n\n .e-nav--horizontal .e-nav-heading {\n margin: 0;\n padding-inline: 0;\n }\n\n .e-nav--horizontal .e-nav-item {\n height: 2.5rem;\n border-radius: 0;\n background: transparent;\n box-shadow: inset 0 -2px 0 transparent;\n color: var(--e-muted);\n font-size: var(--e-text-sm);\n }\n\n .e-nav--horizontal .e-nav-item:hover {\n background: transparent;\n box-shadow: inset 0 -2px 0 var(--e-border-strong);\n color: var(--e-ink);\n }\n\n .e-nav--horizontal .e-nav-item[aria-current=\"page\"] {\n background: var(--e-surface-tint);\n box-shadow: inset 0 -3px 0 var(--e-primary);\n color: var(--e-primary);\n font-weight: 600;\n }\n\n .e-nav--horizontal.e-nav--dense .e-nav-item {\n height: 2.25rem;\n }\n\n .e-nav-count {\n min-width: 22px;\n padding: 0 6px;\n border-radius: var(--e-radius-pill);\n background: var(--e-surface);\n box-shadow: inset 0 0 0 1px var(--e-border-strong);\n font: 600 var(--e-text-xs) / 20px var(--e-font-mono);\n text-align: center;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-nav-item {\n transition: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-nav--horizontal .e-nav-item[aria-current=\"page\"] {\n border-block-end: 3px solid Highlight;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAgBA,IAAMe,IAAQC,GAkBRC,IAASC,QAA6BH,EAAM,YAAY,CAAC,EAAE,OAAOA,EAAM,SAAS,CAAC,EAAE,CAAC,CAAC;E,kBAI1Ff,EAAA,GAAAC,EAcUC,GAAA;GAbR,OAAKC,EAAA,CAAC,SAAO,CACJa,EAAA,SAAK,gBAAoBA,EAAA,gBAAW,gBAAA,mBAAA,CAAA,CAAA;GAC5C,QAAQC,EAAA;GACR,OAAOD,EAAA;GACP,kBAAgBA,EAAA;GACjB,cAAW;GACX,iBAAc;;GAEH,MAAIZ,GAC+B,EAD3B,cAAI;IACRmB,EAAK,QAAlBvB,EAAA,GAAAC,EAA4CI,GAAA;;KAAnB,MAAMkB,EAAK;;IACpChB,EAAiD,QAAjDK,GAAiDJ,EAApBe,EAAK,KAAK,GAAA,CAAA;IAC3BA,EAAK,SAAK,O,aAAtBvB,EAAA,GAAAS,EAA2E,QAA3EI,GAA2EL,EAApBe,EAAK,KAAK,GAAA,CAAA"}
1
+ {"version":3,"file":"ENavList.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","LinkNav","_normalizeClass","_withCtx","EIcon","_createCommentVNode","_createElementVNode","_toDisplayString","_createElementBlock","EIcon_default","LinkNav_default","_hoisted_1","_hoisted_2","ENavList_vue_vue_type_script_setup_true_lang_default","props","__props","groups","computed","openBlock","createBlock","normalizeClass","withCtx","item","createCommentVNode","createElementVNode","toDisplayString","createElementBlock"],"sources":["../../../src/components/NavList/ENavList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, type Component } from \"vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport LinkNav, { type LinkItem, type LinkSection } from \"./LinkNav.vue\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\n\nexport interface NavItem extends LinkItem {\n /** An icon before the label. */\n icon?: IconProp;\n /** A count of things waiting on the person (bills to pay, forms to sign). */\n count?: number;\n}\n\nexport type NavSection = LinkSection<NavItem>;\n\nconst props = withDefaults(\n defineProps<{\n /** The destinations, in order: `{ label, href?, to?, icon?, count?, current? }`. With no `href` or `to` a link goes to `#`. Set `current` yourself. */\n items?: NavItem[];\n /** Destinations in labelled groups, instead of `items`: `{ label?, items }`. Give a label only when there is more than one section. */\n sections?: NavSection[];\n /** `vertical` stacks the links, for a sidebar or a menu. `horizontal` lays them in a row, for a header, with a hairline between each. Items look the same as in the vertical list: a tint on hover, and a primary outline with a heavier bottom edge on the current page. */\n orientation?: \"vertical\" | \"horizontal\";\n /** The landmark's name; give each navigation on a page its own. @default \"Main\" */\n label?: string;\n /** What renders each link: `\"a\"` by default, or `RouterLink` (or any component that takes `href` or `to` and a default slot). Give items `to`; it receives `to` or `href`, the class `e-nav-item` and `aria-current`. */\n linkComponent?: string | Component;\n }>(),\n { orientation: \"vertical\", linkComponent: \"a\" },\n);\n\nconst groups = computed<NavSection[]>(() => props.sections ?? [{ items: props.items ?? [] }]);\n</script>\n\n<template>\n <LinkNav\n class=\"e-nav\"\n :class=\"orientation === 'horizontal' && 'e-nav--horizontal'\"\n :groups=\"groups\"\n :label=\"label\"\n :link-component=\"linkComponent\"\n item-class=\"e-nav-item\"\n heading-class=\"e-nav-heading\"\n >\n <template #item=\"{ item }\">\n <EIcon v-if=\"item.icon\" :name=\"item.icon\" />\n <span class=\"e-nav-label\">{{ item.label }}</span>\n <span v-if=\"item.count != null\" class=\"e-nav-count\">{{ item.count }}</span>\n </template>\n </LinkNav>\n</template>\n\n<style>\n@layer e.page {\n .e-nav ul {\n display: grid;\n gap: calc(var(--e-space-1) / 2);\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .e-nav:not(.e-nav--horizontal) ul {\n gap: 0;\n }\n\n .e-nav:not(.e-nav--horizontal) li + li::before {\n content: \"\";\n display: block;\n height: var(--e-stroke-hair);\n margin-block: var(--e-space-2);\n background: color-mix(in srgb, var(--e-border) 60%, transparent);\n }\n\n .e-nav-item {\n display: flex;\n align-items: center;\n gap: var(--e-space-3);\n height: var(--e-control-height);\n box-sizing: border-box;\n padding: 0 var(--e-space-3);\n border: var(--e-stroke-edge) solid transparent;\n border-radius: var(--e-radius-md);\n color: var(--e-ink);\n font: 400 var(--e-text-md) / 1 var(--e-font-sans);\n text-decoration: none;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-nav-item:hover {\n background: var(--e-surface-hover);\n }\n\n .e-nav-item:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n .e-nav-item[aria-current=\"page\"] {\n background: color-mix(in srgb, var(--e-surface-tint), var(--e-ink) 3%);\n font-weight: 600;\n border-color: var(--e-primary);\n border-bottom-width: calc(var(--e-stroke-edge) + var(--e-depth));\n }\n\n .e-nav-label {\n flex: 1;\n min-width: 0;\n }\n\n .e-nav--horizontal {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--e-space-2) var(--e-space-4);\n }\n\n /* The separator sits inside the next item's li, so the list has no gap of its own: the margins on the separator space both sides equally. */\n .e-nav--horizontal ul {\n display: flex;\n flex-wrap: wrap;\n gap: 0;\n }\n\n .e-nav--horizontal li {\n display: flex;\n align-items: center;\n }\n\n .e-nav--horizontal li + li::before {\n content: \"\";\n width: var(--e-stroke-hair);\n height: 1.75rem;\n margin-inline: var(--e-space-2);\n background: color-mix(in srgb, var(--e-border) 60%, transparent);\n }\n\n .e-nav--horizontal .e-nav-heading {\n margin: 0;\n padding-inline: 0;\n }\n\n .e-nav-count {\n min-width: var(--e-space-6);\n padding: 0 var(--e-space-2);\n border-radius: var(--e-radius-pill);\n background: color-mix(in srgb, var(--e-primary) 12%, var(--e-surface));\n box-shadow: inset 0 0 0 var(--e-stroke-hair) var(--e-primary);\n outline: var(--e-stroke-hair) solid var(--e-primary);\n outline-offset: calc(-1 * var(--e-stroke-hair));\n font: 600 var(--e-text-xs) / 20px var(--e-font-mono);\n text-align: center;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-nav-item {\n transition: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-nav-item[aria-current=\"page\"] {\n border-color: Highlight;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAgBA,IAAMe,IAAQC,GAgBRC,IAASC,QAA6BH,EAAM,YAAY,CAAC,EAAE,OAAOA,EAAM,SAAS,CAAC,EAAE,CAAC,CAAC;E,kBAI1Ff,EAAA,GAAAC,EAcUC,GAAA;GAbR,OAAKC,EAAA,CAAC,SACEa,EAAA,gBAAW,gBAAA,mBAAA,CAAA;GAClB,QAAQC,EAAA;GACR,OAAOD,EAAA;GACP,kBAAgBA,EAAA;GACjB,cAAW;GACX,iBAAc;;GAEH,MAAIZ,GAC+B,EAD3B,cAAI;IACRmB,EAAK,QAAlBvB,EAAA,GAAAC,EAA4CI,GAAA;;KAAnB,MAAMkB,EAAK;;IACpChB,EAAiD,QAAjDK,GAAiDJ,EAApBe,EAAK,KAAK,GAAA,CAAA;IAC3BA,EAAK,SAAK,O,aAAtBvB,EAAA,GAAAS,EAA2E,QAA3EI,GAA2EL,EAApBe,EAAK,KAAK,GAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import e, { linkAttrs as t } from "./LinkNav.vue_vue_type_script_setup_true_lang.js";
2
2
  /* empty css */
3
- //#region src/components/Tabs/LinkNav.vue
3
+ //#region src/components/NavList/LinkNav.vue
4
4
  var n = e;
5
5
  //#endregion
6
6
  export { n as default, t as linkAttrs };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkNav.js","names":["_sfc_main","LinkNav_vue_vue_type_script_setup_true_lang_default","LinkNav_default","linkAttrs"],"sources":["../../../src/components/NavList/LinkNav.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface LinkItem {\n /** The words for this destination. */\n label: string;\n /** Where it goes. Defaults to `#`. */\n href?: string;\n /** A router location, passed to `linkComponent` as `to` (for `RouterLink`). */\n to?: unknown;\n /** The page the person is on. */\n current?: boolean;\n}\n\nexport interface LinkSection<T extends LinkItem = LinkItem> {\n /** A small heading over the section. Leave it out for a section that needs none. */\n label?: string;\n /** The destinations of the section, in order. */\n items: T[];\n}\n\nexport const linkAttrs = (item: LinkItem) => ({\n ...(item.to !== undefined ? { to: item.to } : { href: item.href ?? \"#\" }),\n ...(item.current && { \"aria-current\": \"page\" }),\n});\n</script>\n\n<script setup lang=\"ts\" generic=\"T extends LinkItem\">\nimport type { Component } from \"vue\";\nimport { useMessages } from \"../../config.js\";\nimport { useUid } from \"../../composables/useUid.js\";\nimport \"../../styles/base.css\";\n\ndefineProps<{\n groups: LinkSection<T>[];\n label?: string;\n linkComponent: string | Component;\n itemClass: string;\n headingClass: string;\n listClass?: string;\n}>();\n\ndefineSlots<{\n item(props: { item: T }): unknown;\n}>();\n\nconst t = useMessages();\nconst uid = useUid();\n</script>\n\n<template>\n <nav :aria-label=\"label || t('mainNav')\">\n <template v-for=\"(group, g) in groups\" :key=\"g\">\n <p v-if=\"group.label\" :id=\"`${uid}-${g}`\" :class=\"headingClass\">{{ group.label }}</p>\n <ul :class=\"listClass\" :aria-labelledby=\"group.label ? `${uid}-${g}` : undefined\">\n <li v-for=\"(item, i) in group.items\" :key=\"i\">\n <component :is=\"linkComponent\" :class=\"itemClass\" v-bind=\"linkAttrs(item)\">\n <slot name=\"item\" :item=\"item\" />\n </component>\n </li>\n </ul>\n </template>\n </nav>\n</template>\n\n<style>\n@layer e.containers {\n .e-nav-heading {\n margin: var(--e-space-6) 0 var(--e-space-2);\n padding-inline: var(--e-space-3);\n font: 600 var(--e-text-sm) / 1.2 var(--e-font-mono);\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--e-ink);\n }\n\n .e-nav > :first-child {\n margin-top: 0;\n }\n}\n</style>\n"],"mappings":""}
@@ -2,7 +2,7 @@
2
2
  import { useMessages as e } from "../../config.js";
3
3
  import { useUid as t } from "../../composables/useUid.js";
4
4
  import { Fragment as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, mergeProps as c, normalizeClass as l, openBlock as u, renderList as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
5
- //#region src/components/Tabs/LinkNav.vue?vue&type=script&setup=true&lang.ts
5
+ //#region src/components/NavList/LinkNav.vue?vue&type=script&setup=true&lang.ts
6
6
  var _ = ["aria-label"], v = ["id"], y = ["aria-labelledby"], b = (e) => ({
7
7
  ...e.to === void 0 ? { href: e.href ?? "#" } : { to: e.to },
8
8
  ...e.current && { "aria-current": "page" }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkNav.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_unref","_Fragment","_renderList","_normalizeClass","_toDisplayString","_createCommentVNode","_createElementVNode","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot","_hoisted_1","_hoisted_2","_hoisted_3","linkAttrs","item","LinkNav_vue_vue_type_script_setup_true_lang_default","t","useMessages","uid","useUid","openBlock","createElementBlock","__props","unref","Fragment","renderList","g","group","normalizeClass","toDisplayString","createCommentVNode","createElementVNode","i","createBlock","resolveDynamicComponent","mergeProps","withCtx","renderSlot","_ctx"],"sources":["../../../src/components/NavList/LinkNav.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface LinkItem {\n /** The words for this destination. */\n label: string;\n /** Where it goes. Defaults to `#`. */\n href?: string;\n /** A router location, passed to `linkComponent` as `to` (for `RouterLink`). */\n to?: unknown;\n /** The page the person is on. */\n current?: boolean;\n}\n\nexport interface LinkSection<T extends LinkItem = LinkItem> {\n /** A small heading over the section. Leave it out for a section that needs none. */\n label?: string;\n /** The destinations of the section, in order. */\n items: T[];\n}\n\nexport const linkAttrs = (item: LinkItem) => ({\n ...(item.to !== undefined ? { to: item.to } : { href: item.href ?? \"#\" }),\n ...(item.current && { \"aria-current\": \"page\" }),\n});\n</script>\n\n<script setup lang=\"ts\" generic=\"T extends LinkItem\">\nimport type { Component } from \"vue\";\nimport { useMessages } from \"../../config.js\";\nimport { useUid } from \"../../composables/useUid.js\";\nimport \"../../styles/base.css\";\n\ndefineProps<{\n groups: LinkSection<T>[];\n label?: string;\n linkComponent: string | Component;\n itemClass: string;\n headingClass: string;\n listClass?: string;\n}>();\n\ndefineSlots<{\n item(props: { item: T }): unknown;\n}>();\n\nconst t = useMessages();\nconst uid = useUid();\n</script>\n\n<template>\n <nav :aria-label=\"label || t('mainNav')\">\n <template v-for=\"(group, g) in groups\" :key=\"g\">\n <p v-if=\"group.label\" :id=\"`${uid}-${g}`\" :class=\"headingClass\">{{ group.label }}</p>\n <ul :class=\"listClass\" :aria-labelledby=\"group.label ? `${uid}-${g}` : undefined\">\n <li v-for=\"(item, i) in group.items\" :key=\"i\">\n <component :is=\"linkComponent\" :class=\"itemClass\" v-bind=\"linkAttrs(item)\">\n <slot name=\"item\" :item=\"item\" />\n </component>\n </li>\n </ul>\n </template>\n </nav>\n</template>\n\n<style>\n@layer e.containers {\n .e-nav-heading {\n margin: var(--e-space-6) 0 var(--e-space-2);\n padding-inline: var(--e-space-3);\n font: 600 var(--e-text-sm) / 1.2 var(--e-font-mono);\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--e-ink);\n }\n\n .e-nav > :first-child {\n margin-top: 0;\n }\n}\n</style>\n"],"mappings":";;;;;A,6DAmBaiB,KAAa,OAAoB;CAC5C,GAAIC,EAAK,OAAO,KAAA,IAA8B,EAAE,MAAMA,EAAK,QAAQ,IAAI,IAA3C,EAAE,IAAIA,EAAK,GAAG;CAC1C,GAAIA,EAAK,WAAW,EAAE,gBAAgB,OAAO;AAC/C,I;;;;;;;;;;;EAsBA,IAAME,IAAIC,EAAY,GAChBC,IAAMC,EAAO;E,kBAIjBvB,EAAA,GAAAC,EAWM,OAAA,EAXA,cAAYyB,EAAA,SAASxB,EAAAkB,CAAA,CAAC,CAAA,SAAA,E,KAC1BpB,EAAA,EAAA,GAAAC,EASWE,GAAA,MAAAC,EAToBsB,EAAA,SAAb,GAAO,OAAoB1B,EAAA,GAAAC,EAAAE,GAAA,EAAA,KAAA2B,EAAC,GAAA,CACnCC,EAAM,SAAf/B,EAAA,GAAAC,EAAqF,KAAA;;GAA9D,IAAE,GAAKC,EAAAoB,CAAA,EAAG,GAAIQ;GAAM,OAAKzB,EAAEqB,EAAA,YAAY;EAAK,GAAApB,EAAAyB,EAAM,KAAK,GAAA,IAAAhB,CAAA,K,WAC9EP,EAMK,MAAA;GANA,OAAKH,EAAEqB,EAAA,SAAS;GAAG,mBAAiBK,EAAM,QAAK,GAAM7B,EAAAoB,CAAA,EAAG,GAAIQ,MAAM,KAAA;E,KACrE9B,EAAA,EAAA,GAAAC,EAIKE,GAAA,MAAAC,EAJmB2B,EAAM,QAAlB,GAAM,OAAlB/B,EAAA,GAAAC,EAIK,MAAA,EAJiC,KAAKmC,EAAC,GAAA,EAC1CpC,EAAA,GAAAS,EAEYC,EAFIgB,EAAA,aAAa,GAA7Bf,EAEY,EAFoB,OAAOe,EAAA,UAAS,GAAA,EAAA,SAAA,GAAA,GAAUT,EAAUC,CAAI,CAAA,GAAA;GACtE,SAAAN,QAAiC,CAAjCC,EAAiC6B,EAAA,QAAA,QAAA,EAAR,QAAI,CAAA,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"ENotice.js","names":["_sfc_main","ENotice_vue_vue_type_script_setup_true_lang_default","ENotice_default"],"sources":["../../../src/components/Notice/ENotice.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type NoticeTone = \"info\" | \"success\" | \"warning\" | \"danger\";\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance } from \"vue\";\nimport EActions from \"../Actions/EActions.vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport { useMessages } from \"../../config.js\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\nimport \"./notice.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** `info` is the default; `success` confirms; `warning` needs attention; `danger` is an error and is announced at once. */\n tone?: NoticeTone;\n /** What happened, in one short line. */\n title: string;\n /** Renders the title as a heading of this level (1 to 6) so the notice is findable by heading. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** The id of the title element, for a parent that labels itself by it. */\n titleId?: string;\n /** The ARIA role. `danger` uses `alert`, the others `status`. `false` removes it, for a parent that announces the notice. */\n role?: string | false;\n /** Replaces the icon of the tone. */\n icon?: IconProp;\n /** Forces the close button on or off. Left out, it shows when a `@close` listener is attached. */\n closable?: boolean;\n }>(),\n { tone: \"info\", role: undefined, closable: undefined },\n);\n\nconst emit = defineEmits<{\n /** The close button was pressed. The button only shows when a listener is attached. */\n close: [];\n}>();\n\ndefineSlots<{\n /** One sentence of detail under the title. */\n default?(): unknown;\n /** Buttons for the next step; `outline` and `quiet` suit best. At the end of the row when the notice is 36rem wide or more, under the text when narrower. */\n actions?(): unknown;\n}>();\n\nconst t = useMessages();\nconst instance = getCurrentInstance();\nconst TONE_ICON: Record<NoticeTone, string> = { info: \"info\", success: \"check\", warning: \"alert\", danger: \"alert\" };\nconst role = computed(() =>\n props.role === false ? undefined : props.role || (props.tone === \"danger\" ? \"alert\" : \"status\"),\n);\nconst hasClose = () => props.closable ?? !!instance?.vnode.props?.onClose;\n</script>\n\n<template>\n <div\n class=\"e-notice\"\n :class=\"[tone !== 'info' && `e-notice--${tone}`, $slots.actions && 'e-notice--actions']\"\n :role=\"role\"\n >\n <div class=\"e-notice-grid\">\n <span class=\"e-notice-icon\"><EIcon :name=\"icon ?? TONE_ICON[tone]\" /></span>\n <div class=\"e-notice-body\">\n <component :is=\"headingLevel ? `h${headingLevel}` : 'p'\" :id=\"titleId\" class=\"e-notice-title\">\n {{ title }}\n </component>\n <div v-if=\"$slots.default\" class=\"e-notice-text\"><slot /></div>\n </div>\n <EActions v-if=\"$slots.actions\" class=\"e-notice-actions\"><slot name=\"actions\" /></EActions>\n <span v-if=\"hasClose()\" class=\"e-notice-close\">\n <EIconButton icon=\"x\" :label=\"t('dismiss')\" @click=\"emit('close')\" />\n </span>\n </div>\n </div>\n</template>\n\n<style>\n@layer e.containers {\n .e-notice {\n --e-tone: var(--e-primary);\n --e-bg: var(--e-surface-tint);\n\n container-type: inline-size;\n padding: var(--e-space-3) var(--e-space-4);\n border: var(--e-stroke-edge) solid var(--e-tone);\n border-top-width: calc(var(--e-stroke-edge) + var(--e-depth));\n border-radius: var(--e-radius-md);\n background: var(--e-bg);\n color: var(--e-ink);\n }\n\n .e-notice--success {\n --e-tone: var(--e-secondary);\n --e-bg: var(--e-secondary-soft);\n }\n\n .e-notice--warning {\n --e-tone: var(--e-warning-strong);\n --e-bg: var(--e-warning-soft);\n }\n\n .e-notice--danger {\n --e-tone: var(--e-danger);\n --e-bg: var(--e-danger-soft);\n }\n\n .e-notice-title {\n margin: 0;\n font: 500 var(--e-text-lg) / 24px var(--e-font-sans);\n }\n\n .e-notice-text {\n margin: 0;\n font: 400 var(--e-text-sm) / 1.45 var(--e-font-sans);\n color: var(--e-ink);\n }\n\n @media (forced-colors: active) {\n .e-notice {\n border: 1px solid CanvasText;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ENotice.js","names":["_sfc_main","ENotice_vue_vue_type_script_setup_true_lang_default","ENotice_default"],"sources":["../../../src/components/Notice/ENotice.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type NoticeTone = \"info\" | \"success\" | \"warning\" | \"danger\";\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance } from \"vue\";\nimport EActions from \"../Actions/EActions.vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport { useMessages } from \"../../config.js\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\nimport \"./notice.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** `info` is the default; `success` confirms; `warning` needs attention; `danger` is an error and is announced at once. */\n tone?: NoticeTone;\n /** What happened, in one short line. */\n title: string;\n /** Renders the title as a heading of this level (1 to 6) so the notice is findable by heading; without it the title is a paragraph. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** The id of the title element, for a parent that labels itself by it. */\n titleId?: string;\n /** The ARIA role. `danger` uses `alert`, the others `status`. `false` removes it, for a parent that announces the notice. */\n role?: string | false;\n /** Replaces the icon of the tone. */\n icon?: IconProp;\n /** Forces the close button on or off. Left out, it shows when a `@close` listener is attached. */\n closable?: boolean;\n }>(),\n { tone: \"info\", role: undefined, closable: undefined },\n);\n\nconst emit = defineEmits<{\n /** The close button was pressed. The button only shows when a listener is attached. */\n close: [];\n}>();\n\ndefineSlots<{\n /** One sentence of detail under the title. */\n default?(): unknown;\n /** Buttons for the next step; `outline` and `quiet` suit best. At the end of the row when the notice is 36rem wide or more, under the text when narrower. */\n actions?(): unknown;\n}>();\n\nconst t = useMessages();\nconst instance = getCurrentInstance();\nconst TONE_ICON: Record<NoticeTone, string> = { info: \"info\", success: \"check\", warning: \"alert\", danger: \"alert\" };\nconst role = computed(() =>\n props.role === false ? undefined : props.role || (props.tone === \"danger\" ? \"alert\" : \"status\"),\n);\nconst hasClose = () => props.closable ?? !!instance?.vnode.props?.onClose;\n</script>\n\n<template>\n <div\n class=\"e-notice\"\n :class=\"[tone !== 'info' && `e-notice--${tone}`, $slots.actions && 'e-notice--actions']\"\n :role=\"role\"\n >\n <div class=\"e-notice-grid\">\n <span class=\"e-notice-icon\"><EIcon :name=\"icon ?? TONE_ICON[tone]\" /></span>\n <div class=\"e-notice-body\">\n <component :is=\"headingLevel ? `h${headingLevel}` : 'p'\" :id=\"titleId\" class=\"e-notice-title\">\n {{ title }}\n </component>\n <div v-if=\"$slots.default\" class=\"e-notice-text\"><slot /></div>\n </div>\n <EActions v-if=\"$slots.actions\" class=\"e-notice-actions\"><slot name=\"actions\" /></EActions>\n <span v-if=\"hasClose()\" class=\"e-notice-close\">\n <EIconButton icon=\"x\" :label=\"t('dismiss')\" @click=\"emit('close')\" />\n </span>\n </div>\n </div>\n</template>\n\n<style>\n@layer e.containers {\n .e-notice {\n --e-tone: var(--e-primary);\n --e-bg: var(--e-surface-tint);\n\n container-type: inline-size;\n padding: var(--e-space-3) var(--e-space-4);\n border: var(--e-stroke-edge) solid var(--e-tone);\n\n --e-bc: var(--e-tone);\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-left-width: calc(var(--e-stroke-edge) + 2 * var(--e-depth));\n border-radius: var(--e-radius-md);\n background: var(--e-bg);\n color: var(--e-ink);\n }\n\n .e-notice--success {\n --e-tone: var(--e-secondary);\n --e-bg: var(--e-secondary-soft);\n }\n\n .e-notice--warning {\n --e-tone: var(--e-warning-strong);\n --e-bg: var(--e-warning-soft);\n }\n\n .e-notice--danger {\n --e-tone: var(--e-danger);\n --e-bg: var(--e-danger-soft);\n }\n\n .e-notice-title {\n margin: 0;\n font: 500 var(--e-text-lg) / 24px var(--e-font-sans);\n }\n\n .e-notice-text {\n margin: 0;\n font: 400 var(--e-text-sm) / 1.45 var(--e-font-sans);\n color: var(--e-ink);\n }\n\n @media (forced-colors: active) {\n .e-notice {\n border: var(--e-stroke-edge) solid CanvasText;\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -7,7 +7,7 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
7
7
  tone?: NoticeTone;
8
8
  /** What happened, in one short line. */
9
9
  title: string;
10
- /** Renders the title as a heading of this level (1 to 6) so the notice is findable by heading. */
10
+ /** Renders the title as a heading of this level (1 to 6) so the notice is findable by heading; without it the title is a paragraph. */
11
11
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
12
12
  /** The id of the title element, for a parent that labels itself by it. */
13
13
  titleId?: string;
@@ -24,7 +24,7 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
24
24
  tone?: NoticeTone;
25
25
  /** What happened, in one short line. */
26
26
  title: string;
27
- /** Renders the title as a heading of this level (1 to 6) so the notice is findable by heading. */
27
+ /** Renders the title as a heading of this level (1 to 6) so the notice is findable by heading; without it the title is a paragraph. */
28
28
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
29
29
  /** The id of the title element, for a parent that labels itself by it. */
30
30
  titleId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ENotice.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_createVNode","EIcon","_createBlock","_resolveDynamicComponent","_withCtx","_createTextVNode","_toDisplayString","_renderSlot","_createCommentVNode","EActions","EIconButton","_unref","EActions_default","EIcon_default","EIconButton_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","ENotice_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","t","useMessages","instance","getCurrentInstance","TONE_ICON","role","computed","hasClose","openBlock","createElementBlock","normalizeClass","_ctx","createElementVNode","createVNode","createBlock","resolveDynamicComponent","withCtx","createTextVNode","toDisplayString","renderSlot","createCommentVNode","unref","_cache"],"sources":["../../../src/components/Notice/ENotice.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type NoticeTone = \"info\" | \"success\" | \"warning\" | \"danger\";\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance } from \"vue\";\nimport EActions from \"../Actions/EActions.vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport { useMessages } from \"../../config.js\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\nimport \"./notice.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** `info` is the default; `success` confirms; `warning` needs attention; `danger` is an error and is announced at once. */\n tone?: NoticeTone;\n /** What happened, in one short line. */\n title: string;\n /** Renders the title as a heading of this level (1 to 6) so the notice is findable by heading. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** The id of the title element, for a parent that labels itself by it. */\n titleId?: string;\n /** The ARIA role. `danger` uses `alert`, the others `status`. `false` removes it, for a parent that announces the notice. */\n role?: string | false;\n /** Replaces the icon of the tone. */\n icon?: IconProp;\n /** Forces the close button on or off. Left out, it shows when a `@close` listener is attached. */\n closable?: boolean;\n }>(),\n { tone: \"info\", role: undefined, closable: undefined },\n);\n\nconst emit = defineEmits<{\n /** The close button was pressed. The button only shows when a listener is attached. */\n close: [];\n}>();\n\ndefineSlots<{\n /** One sentence of detail under the title. */\n default?(): unknown;\n /** Buttons for the next step; `outline` and `quiet` suit best. At the end of the row when the notice is 36rem wide or more, under the text when narrower. */\n actions?(): unknown;\n}>();\n\nconst t = useMessages();\nconst instance = getCurrentInstance();\nconst TONE_ICON: Record<NoticeTone, string> = { info: \"info\", success: \"check\", warning: \"alert\", danger: \"alert\" };\nconst role = computed(() =>\n props.role === false ? undefined : props.role || (props.tone === \"danger\" ? \"alert\" : \"status\"),\n);\nconst hasClose = () => props.closable ?? !!instance?.vnode.props?.onClose;\n</script>\n\n<template>\n <div\n class=\"e-notice\"\n :class=\"[tone !== 'info' && `e-notice--${tone}`, $slots.actions && 'e-notice--actions']\"\n :role=\"role\"\n >\n <div class=\"e-notice-grid\">\n <span class=\"e-notice-icon\"><EIcon :name=\"icon ?? TONE_ICON[tone]\" /></span>\n <div class=\"e-notice-body\">\n <component :is=\"headingLevel ? `h${headingLevel}` : 'p'\" :id=\"titleId\" class=\"e-notice-title\">\n {{ title }}\n </component>\n <div v-if=\"$slots.default\" class=\"e-notice-text\"><slot /></div>\n </div>\n <EActions v-if=\"$slots.actions\" class=\"e-notice-actions\"><slot name=\"actions\" /></EActions>\n <span v-if=\"hasClose()\" class=\"e-notice-close\">\n <EIconButton icon=\"x\" :label=\"t('dismiss')\" @click=\"emit('close')\" />\n </span>\n </div>\n </div>\n</template>\n\n<style>\n@layer e.containers {\n .e-notice {\n --e-tone: var(--e-primary);\n --e-bg: var(--e-surface-tint);\n\n container-type: inline-size;\n padding: var(--e-space-3) var(--e-space-4);\n border: var(--e-stroke-edge) solid var(--e-tone);\n border-top-width: calc(var(--e-stroke-edge) + var(--e-depth));\n border-radius: var(--e-radius-md);\n background: var(--e-bg);\n color: var(--e-ink);\n }\n\n .e-notice--success {\n --e-tone: var(--e-secondary);\n --e-bg: var(--e-secondary-soft);\n }\n\n .e-notice--warning {\n --e-tone: var(--e-warning-strong);\n --e-bg: var(--e-warning-soft);\n }\n\n .e-notice--danger {\n --e-tone: var(--e-danger);\n --e-bg: var(--e-danger-soft);\n }\n\n .e-notice-title {\n margin: 0;\n font: 500 var(--e-text-lg) / 24px var(--e-font-sans);\n }\n\n .e-notice-text {\n margin: 0;\n font: 400 var(--e-text-sm) / 1.45 var(--e-font-sans);\n color: var(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AA,GAAAC,EAEO,QAFPuB,GAEO,CADLpB,EAAqEU,GAAA;IAAxD,MAAK;IAAK,OAAOC,EAAAe,CAAA,CAAC,CAAA,SAAA;IAAc,SAAK,AAAAsB,EAAA,QAAA,MAAEvB,EAAI,OAAA"}
1
+ {"version":3,"file":"ENotice.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_createVNode","EIcon","_createBlock","_resolveDynamicComponent","_withCtx","_createTextVNode","_toDisplayString","_renderSlot","_createCommentVNode","EActions","EIconButton","_unref","EActions_default","EIcon_default","EIconButton_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","ENotice_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","t","useMessages","instance","getCurrentInstance","TONE_ICON","role","computed","hasClose","openBlock","createElementBlock","normalizeClass","_ctx","createElementVNode","createVNode","createBlock","resolveDynamicComponent","withCtx","createTextVNode","toDisplayString","renderSlot","createCommentVNode","unref","_cache"],"sources":["../../../src/components/Notice/ENotice.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type NoticeTone = \"info\" | \"success\" | \"warning\" | \"danger\";\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance } from \"vue\";\nimport EActions from \"../Actions/EActions.vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport { useMessages } from \"../../config.js\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\nimport \"./notice.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** `info` is the default; `success` confirms; `warning` needs attention; `danger` is an error and is announced at once. */\n tone?: NoticeTone;\n /** What happened, in one short line. */\n title: string;\n /** Renders the title as a heading of this level (1 to 6) so the notice is findable by heading; without it the title is a paragraph. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** The id of the title element, for a parent that labels itself by it. */\n titleId?: string;\n /** The ARIA role. `danger` uses `alert`, the others `status`. `false` removes it, for a parent that announces the notice. */\n role?: string | false;\n /** Replaces the icon of the tone. */\n icon?: IconProp;\n /** Forces the close button on or off. Left out, it shows when a `@close` listener is attached. */\n closable?: boolean;\n }>(),\n { tone: \"info\", role: undefined, closable: undefined },\n);\n\nconst emit = defineEmits<{\n /** The close button was pressed. The button only shows when a listener is attached. */\n close: [];\n}>();\n\ndefineSlots<{\n /** One sentence of detail under the title. */\n default?(): unknown;\n /** Buttons for the next step; `outline` and `quiet` suit best. At the end of the row when the notice is 36rem wide or more, under the text when narrower. */\n actions?(): unknown;\n}>();\n\nconst t = useMessages();\nconst instance = getCurrentInstance();\nconst TONE_ICON: Record<NoticeTone, string> = { info: \"info\", success: \"check\", warning: \"alert\", danger: \"alert\" };\nconst role = computed(() =>\n props.role === false ? undefined : props.role || (props.tone === \"danger\" ? \"alert\" : \"status\"),\n);\nconst hasClose = () => props.closable ?? !!instance?.vnode.props?.onClose;\n</script>\n\n<template>\n <div\n class=\"e-notice\"\n :class=\"[tone !== 'info' && `e-notice--${tone}`, $slots.actions && 'e-notice--actions']\"\n :role=\"role\"\n >\n <div class=\"e-notice-grid\">\n <span class=\"e-notice-icon\"><EIcon :name=\"icon ?? TONE_ICON[tone]\" /></span>\n <div class=\"e-notice-body\">\n <component :is=\"headingLevel ? `h${headingLevel}` : 'p'\" :id=\"titleId\" class=\"e-notice-title\">\n {{ title }}\n </component>\n <div v-if=\"$slots.default\" class=\"e-notice-text\"><slot /></div>\n </div>\n <EActions v-if=\"$slots.actions\" class=\"e-notice-actions\"><slot name=\"actions\" /></EActions>\n <span v-if=\"hasClose()\" class=\"e-notice-close\">\n <EIconButton icon=\"x\" :label=\"t('dismiss')\" @click=\"emit('close')\" />\n </span>\n </div>\n </div>\n</template>\n\n<style>\n@layer e.containers {\n .e-notice {\n --e-tone: var(--e-primary);\n --e-bg: var(--e-surface-tint);\n\n container-type: inline-size;\n padding: var(--e-space-3) var(--e-space-4);\n border: var(--e-stroke-edge) solid var(--e-tone);\n\n --e-bc: var(--e-tone);\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-left-width: calc(var(--e-stroke-edge) + 2 * var(--e-depth));\n border-radius: var(--e-radius-md);\n background: var(--e-bg);\n color: var(--e-ink);\n }\n\n .e-notice--success {\n --e-tone: var(--e-secondary);\n --e-bg: var(--e-secondary-soft);\n }\n\n .e-notice--warning {\n --e-tone: var(--e-warning-strong);\n --e-bg: var(--e-warning-soft);\n }\n\n .e-notice--danger {\n --e-tone: var(--e-danger);\n --e-bg: var(--e-danger-soft);\n }\n\n .e-notice-title {\n margin: 0;\n font: 500 var(--e-text-lg) / 24px var(--e-font-sans);\n }\n\n .e-notice-text {\n margin: 0;\n font: 400 var(--e-text-sm) / 1.45 var(--e-font-sans);\n color: var(--e-ink);\n }\n\n @media (forced-colors: active) {\n .e-notice {\n border: var(--e-stroke-edge) solid CanvasText;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,IAAM4B,IAAQC,GAoBRC,IAAOH,GAYPI,IAAIC,EAAY,GAChBC,IAAWC,EAAmB,GAC9BC,IAAwC;GAAE,MAAM;GAAQ,SAAS;GAAS,SAAS;GAAS,QAAQ;EAAQ,GAC5GC,IAAOC,QACXT,EAAM,SAAS,KAAQ,KAAA,IAAYA,EAAM,SAASA,EAAM,SAAS,WAAW,UAAU,SACxF,GACMU,UAAiBV,EAAM,YAAY,CAAC,CAACK,GAAU,MAAM,OAAO;E,kBAIhEhC,EAAA,GAAAC,EAkBM,OAAA;GAjBJ,OAAKC,EAAA,CAAC,YAAU,CACP0B,EAAA,SAAI,UAAA,aAA4BA,EAAA,QAAQ7B,EAAAA,OAAO,WAAO,mBAAA,CAAA,CAAA;GAC9D,MAAMoC,EAAA;E,IAEPhC,EAYM,OAZNiB,GAYM;GAXJjB,EAA4E,QAA5EkB,GAA4E,CAAhDjB,EAAyCC,GAAA,EAAjC,MAAMuB,EAAA,QAAQM,EAAUN,EAAA,M;GAC5DzB,EAKM,OALNmB,GAKM,EAJJtB,EAAA,GAAAM,EAEYC,EAFIqB,EAAA,eAAY,IAAOA,EAAA,iBAAY,GAAA,GAAA;IAAW,IAAIA,EAAA;IAAS,OAAM;;IAC3E,SAAApB,QAAW,CAARC,EAAAC,EAAAkB,EAAA,KAAK,GAAA,CAAA,C;;G,gBAEC7B,EAAAA,OAAO,WAAlBC,EAAA,GAAAC,EAA+D,OAA/DsB,GAA+D,CAAdZ,EAAQ8B,EAAA,QAAA,SAAA,C;GAE3C1C,EAAAA,OAAO,WAAvBC,EAAA,GAAAM,EAA2FO,GAAA;;IAA3D,OAAM;;IAAmB,SAAAL,QAAuB,CAAvBG,EAAuB8B,EAAA,QAAA,SAAA,C;;;GACpEJ,EAAQ,KAApBrC,EAAA,GAAAC,EAEO,QAFPuB,GAEO,CADLpB,EAAqEU,GAAA;IAAxD,MAAK;IAAK,OAAOC,EAAAe,CAAA,CAAC,CAAA,SAAA;IAAc,SAAK,AAAAsB,EAAA,QAAA,MAAEvB,EAAI,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ENumberField.js","names":["_sfc_main","ENumberField_vue_vue_type_script_setup_true_lang_default","ENumberField_default"],"sources":["../../../src/components/NumberField/ENumberField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EField from \"../Field/EField.vue\";\nimport { useMessages } from \"../../config.js\";\nimport { focusInside } from \"../../composables/focusInside.js\";\nimport { useFieldAttrs } from \"../../composables/useFieldAttrs.js\";\nimport \"../../styles/base.css\";\nimport \"../TextField/input.css\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** The visible label, a mono kicker above the field. */\n label: string;\n /** Keep the label for screen readers and remove it from the page. */\n hideLabel?: boolean;\n /** The lowest value. The value clamps to it and the decrease button disables there. */\n min?: number;\n /** The highest value. The value clamps to it and the increase button disables there. */\n max?: number;\n /** How far a button or arrow key moves the value. Decimals shown follow the step. */\n step?: number;\n /** A unit before the value. */\n prefix?: string;\n /** A unit after the value, such as visits. */\n suffix?: string;\n /** The name submitted with a form (the number, or empty). */\n name?: string;\n /** Help that stays under the field. */\n hint?: string;\n /** What to fix. Replaces the hint, marks the field invalid and is announced. */\n error?: string;\n /** A word beside the label. */\n required?: boolean;\n /** A word beside the label. Flag whichever is rarer. */\n optional?: boolean;\n disabled?: boolean;\n /** The id of the input; the label points at it. Generated when left out. */\n id?: string;\n}>();\n\nconst model = defineModel<number | null>({ default: null });\n\nconst t = useMessages();\nconst attrs = useFieldAttrs();\nconst input = ref<HTMLInputElement | null>(null);\n\nconst stepBy = computed(() => props.step || 1);\nconst decimals = computed(() => (String(stepBy.value).split(\".\")[1] || \"\").length);\nconst format = (n: number | null | undefined) => (n == null ? \"\" : Number(n).toFixed(decimals.value));\nconst text = ref(format(model.value));\nwatch(model, (v) => (text.value = format(v)));\n\nconst num = computed(() => (model.value == null ? undefined : Number(model.value)));\n\nfunction clamp(n: number): number {\n if (props.min != null && n < props.min) n = props.min;\n if (props.max != null && n > props.max) n = props.max;\n return n;\n}\nfunction set(n: number) {\n n = clamp(n);\n model.value = n;\n text.value = n.toFixed(decimals.value);\n}\nfunction bump(dir: 1 | -1, mult = 1) {\n const base = num.value == null ? (props.min != null ? props.min - stepBy.value * (dir > 0 ? 1 : 0) : 0) : num.value;\n set(Math.round((base + dir * stepBy.value * mult) * 1e6) / 1e6);\n}\nfunction commit() {\n const n = parseFloat(text.value.replace(/,/g, \"\"));\n if (isNaN(n)) {\n if (text.value === \"\") model.value = null;\n else text.value = format(model.value);\n } else set(n);\n}\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n bump(1, e.shiftKey ? 10 : 1);\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n bump(-1, e.shiftKey ? 10 : 1);\n } else if (e.key === \"Enter\") commit();\n}\n\nfunction inputBind(field: { id: string; ariaInvalid: \"true\" | undefined; ariaDescribedby: string | undefined }) {\n return {\n id: field.id,\n class: [\"e-input\", \"e-numinput\", !props.prefix && \"e-numfield-first\", !props.suffix && \"e-numfield-last\"],\n style: { \"--e-chars\": Math.max(text.value.length, 1) },\n type: \"text\" as const,\n inputmode: \"decimal\" as const,\n role: \"spinbutton\",\n autocomplete: \"off\",\n value: text.value,\n disabled: props.disabled,\n required: props.required,\n \"aria-valuenow\": num.value,\n \"aria-valuemin\": props.min,\n \"aria-valuemax\": props.max,\n \"aria-invalid\": field.ariaInvalid,\n ...attrs.input(field.ariaDescribedby),\n };\n}\n\ndefineExpose({\n input,\n focus: () => input.value?.focus(),\n});\n</script>\n\n<template>\n <EField\n v-bind=\"attrs.wrapper()\"\n :id=\"id\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :optional=\"optional\"\n >\n <template #default=\"field\">\n <!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->\n <div\n class=\"e-input-wrap e-numfield\"\n :class=\"{ 'e-numfield--affix': prefix || suffix }\"\n :data-invalid=\"error ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n @click=\"focusInside\"\n >\n <button\n type=\"button\"\n class=\"e-numbtn\"\n :aria-label=\"t('decrease')\"\n :disabled=\"disabled || (min != null && num != null && num <= min)\"\n @click=\"bump(-1)\"\n >\n <EIcon name=\"minus\" bold />\n </button>\n <span v-if=\"prefix\" class=\"e-affix e-affix--pre e-numfield-first\" aria-hidden=\"true\">{{ prefix }}</span>\n <input\n ref=\"input\"\n v-bind=\"inputBind(field)\"\n @input=\"text = ($event.target as HTMLInputElement).value\"\n @blur=\"commit\"\n @keydown=\"onKeydown\"\n />\n <span v-if=\"suffix\" class=\"e-affix e-affix--post e-numfield-last\" aria-hidden=\"true\">{{ suffix }}</span>\n <button\n type=\"button\"\n class=\"e-numbtn\"\n :aria-label=\"t('increase')\"\n :disabled=\"disabled || (max != null && num != null && num >= max)\"\n @click=\"bump(1)\"\n >\n <EIcon name=\"plus\" bold />\n </button>\n </div>\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"num == null ? '' : num\" />\n </template>\n </EField>\n</template>\n\n<style>\n@layer e.controls {\n .e-numfield {\n align-items: stretch;\n container-type: inline-size;\n }\n\n .e-numfield .e-numinput {\n text-align: center;\n font: 500 var(--e-text-md)/1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n height: auto;\n padding-inline: var(--e-space-2);\n }\n\n .e-numbtn {\n display: inline-grid;\n place-items: center;\n flex: none;\n width: var(--e-control-height);\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--e-ink);\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-numbtn:first-child {\n border-inline-end: var(--e-stroke-hair) solid var(--e-border-strong);\n border-start-start-radius: var(--e-radius-md);\n border-end-start-radius: var(--e-radius-md);\n }\n\n .e-numbtn:last-child {\n border-inline-start: var(--e-stroke-hair) solid var(--e-border-strong);\n border-start-end-radius: var(--e-radius-md);\n border-end-end-radius: var(--e-radius-md);\n }\n\n .e-numbtn:hover:not(:disabled) {\n background: var(--e-wash-hover);\n }\n\n .e-numbtn:active:not(:disabled) {\n background: var(--e-wash-press);\n }\n\n .e-numbtn:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: -3px;\n }\n\n .e-numbtn:disabled {\n color: var(--e-muted);\n cursor: not-allowed;\n background: transparent;\n }\n\n .e-numfield--affix .e-numinput {\n flex: none;\n width: calc(var(--e-chars) * 1ch);\n padding-inline: 0;\n text-align: start;\n }\n\n .e-numfield--affix .e-affix--pre {\n padding-inline: 0 var(--e-space-1);\n }\n\n .e-numfield--affix .e-affix--post {\n padding-inline: var(--e-space-1) 0;\n }\n\n .e-numfield--affix .e-numfield-first {\n margin-inline-start: auto;\n }\n\n .e-numfield--affix .e-numfield-last {\n margin-inline-end: auto;\n }\n\n @container (max-width: 10rem) {\n .e-numbtn {\n display: none;\n }\n\n .e-numfield .e-numinput {\n text-align: start;\n padding-inline: var(--e-space-3);\n }\n }\n\n @container (max-width: 13rem) {\n .e-numfield--affix .e-numbtn {\n display: none;\n }\n\n .e-numfield--affix .e-numfield-first {\n margin-inline-start: var(--e-space-3);\n }\n\n .e-numfield--affix .e-numfield-last {\n margin-inline-end: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-numbtn {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ENumberField.js","names":["_sfc_main","ENumberField_vue_vue_type_script_setup_true_lang_default","ENumberField_default"],"sources":["../../../src/components/NumberField/ENumberField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EField from \"../Field/EField.vue\";\nimport { useMessages } from \"../../config.js\";\nimport { focusInside } from \"../../composables/focusInside.js\";\nimport { useFieldAttrs } from \"../../composables/useFieldAttrs.js\";\nimport \"../../styles/base.css\";\nimport \"../TextField/input.css\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** The visible label, a mono kicker above the field. */\n label: string;\n /** Keep the label for screen readers and remove it from the page. */\n hideLabel?: boolean;\n /** The lowest value. The value clamps to it and the decrease button disables there. */\n min?: number;\n /** The highest value. The value clamps to it and the increase button disables there. */\n max?: number;\n /** The amount one step of the buttons and arrow keys changes the value. Decimals shown follow the step (`0.25` shows two). @default 1 */\n step?: number;\n /** A unit before the value. */\n prefix?: string;\n /** A unit after the value, such as visits. */\n suffix?: string;\n /** The name submitted with a form (the number, or empty). */\n name?: string;\n /** Help that stays under the field. */\n hint?: string;\n /** What to fix. Replaces the hint, marks the field invalid and is announced. */\n error?: string;\n /** The `required` attribute and a word beside the label. */\n required?: boolean;\n /** A word beside the label. Flag whichever is rarer. */\n optional?: boolean;\n /** Disables the input and both buttons. */\n disabled?: boolean;\n /** The id of the input; the label points at it. @default generated */\n id?: string;\n}>();\n\n/** The number; `null` when empty. */\nconst model = defineModel<number | null>({ default: null });\n\nconst t = useMessages();\nconst attrs = useFieldAttrs();\nconst input = ref<HTMLInputElement | null>(null);\n\nconst stepBy = computed(() => props.step || 1);\nconst decimals = computed(() => (String(stepBy.value).split(\".\")[1] || \"\").length);\nconst format = (n: number | null | undefined) => (n == null ? \"\" : Number(n).toFixed(decimals.value));\nconst text = ref(format(model.value));\nwatch(model, (v) => (text.value = format(v)));\n\nconst num = computed(() => (model.value == null ? undefined : Number(model.value)));\n\nfunction clamp(n: number): number {\n if (props.min != null && n < props.min) n = props.min;\n if (props.max != null && n > props.max) n = props.max;\n return n;\n}\nfunction set(n: number) {\n n = clamp(n);\n model.value = n;\n text.value = n.toFixed(decimals.value);\n}\nfunction bump(dir: 1 | -1, mult = 1) {\n const base = num.value == null ? (props.min != null ? props.min - stepBy.value * (dir > 0 ? 1 : 0) : 0) : num.value;\n set(Math.round((base + dir * stepBy.value * mult) * 1e6) / 1e6);\n}\nfunction commit() {\n const n = parseFloat(text.value.replace(/,/g, \"\"));\n if (isNaN(n)) {\n if (text.value === \"\") model.value = null;\n else text.value = format(model.value);\n } else set(n);\n}\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n bump(1, e.shiftKey ? 10 : 1);\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n bump(-1, e.shiftKey ? 10 : 1);\n } else if (e.key === \"Enter\") commit();\n}\n\nfunction inputBind(field: { id: string; ariaInvalid: \"true\" | undefined; ariaDescribedby: string | undefined }) {\n return {\n id: field.id,\n class: [\"e-input\", \"e-numinput\", !props.prefix && \"e-numfield-first\", !props.suffix && \"e-numfield-last\"],\n style: { \"--e-chars\": Math.max(text.value.length, 1) },\n type: \"text\" as const,\n inputmode: \"decimal\" as const,\n role: \"spinbutton\",\n autocomplete: \"off\",\n value: text.value,\n disabled: props.disabled,\n required: props.required,\n \"aria-valuenow\": num.value,\n \"aria-valuemin\": props.min,\n \"aria-valuemax\": props.max,\n \"aria-invalid\": field.ariaInvalid,\n ...attrs.input(field.ariaDescribedby),\n };\n}\n\ndefineExpose({\n input,\n focus: () => input.value?.focus(),\n});\n</script>\n\n<template>\n <EField\n v-bind=\"attrs.wrapper()\"\n :id=\"id\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :optional=\"optional\"\n >\n <template #default=\"field\">\n <!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->\n <div\n class=\"e-input-wrap e-numfield\"\n :class=\"{ 'e-numfield--affix': prefix || suffix }\"\n :data-invalid=\"error ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n @click=\"focusInside\"\n >\n <button\n type=\"button\"\n class=\"e-numbtn\"\n :aria-label=\"t('decrease')\"\n :disabled=\"disabled || (min != null && num != null && num <= min)\"\n @click=\"bump(-1)\"\n >\n <EIcon name=\"minus\" bold />\n </button>\n <span v-if=\"prefix\" class=\"e-affix e-affix--pre e-numfield-first\" aria-hidden=\"true\">{{ prefix }}</span>\n <input\n ref=\"input\"\n v-bind=\"inputBind(field)\"\n @input=\"text = ($event.target as HTMLInputElement).value\"\n @blur=\"commit\"\n @keydown=\"onKeydown\"\n />\n <span v-if=\"suffix\" class=\"e-affix e-affix--post e-numfield-last\" aria-hidden=\"true\">{{ suffix }}</span>\n <button\n type=\"button\"\n class=\"e-numbtn\"\n :aria-label=\"t('increase')\"\n :disabled=\"disabled || (max != null && num != null && num >= max)\"\n @click=\"bump(1)\"\n >\n <EIcon name=\"plus\" bold />\n </button>\n </div>\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"num == null ? '' : num\" />\n </template>\n </EField>\n</template>\n\n<style>\n@layer e.controls {\n .e-numfield {\n align-items: stretch;\n container-type: inline-size;\n }\n\n .e-numfield .e-numinput {\n text-align: center;\n font: 500 var(--e-text-md)/1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n height: auto;\n padding-inline: var(--e-space-2);\n }\n\n .e-numbtn {\n display: inline-grid;\n place-items: center;\n flex: none;\n width: var(--e-control-height);\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--e-ink);\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-numbtn:first-child {\n border-inline-end: var(--e-stroke-hair) solid var(--e-border-strong);\n border-start-start-radius: var(--e-radius-md);\n border-end-start-radius: var(--e-radius-md);\n }\n\n .e-numbtn:last-child {\n border-inline-start: var(--e-stroke-hair) solid var(--e-border-strong);\n border-start-end-radius: var(--e-radius-md);\n border-end-end-radius: var(--e-radius-md);\n }\n\n .e-numbtn:hover:not(:disabled) {\n background: var(--e-wash-hover);\n }\n\n .e-numbtn:active:not(:disabled) {\n background: var(--e-wash-press);\n }\n\n .e-numbtn:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-numbtn:disabled {\n color: var(--e-muted);\n cursor: not-allowed;\n background: transparent;\n }\n\n .e-numfield--affix .e-numinput {\n flex: none;\n width: calc(var(--e-chars) * 1ch);\n padding-inline: 0;\n text-align: start;\n }\n\n .e-numfield--affix .e-affix--pre {\n padding-inline: 0 var(--e-space-1);\n }\n\n .e-numfield--affix .e-affix--post {\n padding-inline: var(--e-space-1) 0;\n }\n\n .e-numfield--affix .e-numfield-first {\n margin-inline-start: auto;\n }\n\n .e-numfield--affix .e-numfield-last {\n margin-inline-end: auto;\n }\n\n @container (max-width: 10rem) {\n .e-numbtn {\n display: none;\n }\n\n .e-numfield .e-numinput {\n text-align: start;\n padding-inline: var(--e-space-3);\n }\n }\n\n @container (max-width: 13rem) {\n .e-numfield--affix .e-numbtn {\n display: none;\n }\n\n .e-numfield--affix .e-numfield-first {\n margin-inline-start: var(--e-space-3);\n }\n\n .e-numfield--affix .e-numfield-last {\n margin-inline-end: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-numbtn {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -7,7 +7,7 @@ type __VLS_Props = {
7
7
  min?: number;
8
8
  /** The highest value. The value clamps to it and the increase button disables there. */
9
9
  max?: number;
10
- /** How far a button or arrow key moves the value. Decimals shown follow the step. */
10
+ /** The amount one step of the buttons and arrow keys changes the value. Decimals shown follow the step (`0.25` shows two). @default 1 */
11
11
  step?: number;
12
12
  /** A unit before the value. */
13
13
  prefix?: string;
@@ -19,15 +19,17 @@ type __VLS_Props = {
19
19
  hint?: string;
20
20
  /** What to fix. Replaces the hint, marks the field invalid and is announced. */
21
21
  error?: string;
22
- /** A word beside the label. */
22
+ /** The `required` attribute and a word beside the label. */
23
23
  required?: boolean;
24
24
  /** A word beside the label. Flag whichever is rarer. */
25
25
  optional?: boolean;
26
+ /** Disables the input and both buttons. */
26
27
  disabled?: boolean;
27
- /** The id of the input; the label points at it. Generated when left out. */
28
+ /** The id of the input; the label points at it. @default generated */
28
29
  id?: string;
29
30
  };
30
31
  type __VLS_ModelProps = {
32
+ /** The number; `null` when empty. */
31
33
  modelValue?: number | null;
32
34
  };
33
35
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
@@ -1 +1 @@
1
- {"version":3,"file":"ENumberField.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createBlock","EField","_mergeProps","_unref","_withCtx","_createElementVNode","_normalizeClass","_createVNode","EIcon","_createElementBlock","_toDisplayString","_createCommentVNode","EIcon_default","EField_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","ENumberField_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","__expose","props","__props","model","useModel","t","useMessages","attrs","useFieldAttrs","input","ref","stepBy","computed","decimals","format","n","text","v","num","clamp","set","bump","base","dir","mult","commit","onKeydown","inputBind","field","openBlock","createBlock","mergeProps","unref","withCtx","createElementVNode","normalizeClass","_cache","args","focusInside","createVNode","createElementBlock","toDisplayString","createCommentVNode","$event"],"sources":["../../../src/components/NumberField/ENumberField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EField from \"../Field/EField.vue\";\nimport { useMessages } from \"../../config.js\";\nimport { focusInside } from \"../../composables/focusInside.js\";\nimport { useFieldAttrs } from \"../../composables/useFieldAttrs.js\";\nimport \"../../styles/base.css\";\nimport \"../TextField/input.css\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** The visible label, a mono kicker above the field. */\n label: string;\n /** Keep the label for screen readers and remove it from the page. */\n hideLabel?: boolean;\n /** The lowest value. The value clamps to it and the decrease button disables there. */\n min?: number;\n /** The highest value. The value clamps to it and the increase button disables there. */\n max?: number;\n /** How far a button or arrow key moves the value. Decimals shown follow the step. */\n step?: number;\n /** A unit before the value. */\n prefix?: string;\n /** A unit after the value, such as visits. */\n suffix?: string;\n /** The name submitted with a form (the number, or empty). */\n name?: string;\n /** Help that stays under the field. */\n hint?: string;\n /** What to fix. Replaces the hint, marks the field invalid and is announced. */\n error?: string;\n /** A word beside the label. */\n required?: boolean;\n /** A word beside the label. Flag whichever is rarer. */\n optional?: boolean;\n disabled?: boolean;\n /** The id of the input; the label points at it. Generated when left out. */\n id?: string;\n}>();\n\nconst model = defineModel<number | null>({ default: null });\n\nconst t = useMessages();\nconst attrs = useFieldAttrs();\nconst input = ref<HTMLInputElement | null>(null);\n\nconst stepBy = computed(() => props.step || 1);\nconst decimals = computed(() => (String(stepBy.value).split(\".\")[1] || \"\").length);\nconst format = (n: number | null | undefined) => (n == null ? \"\" : Number(n).toFixed(decimals.value));\nconst text = ref(format(model.value));\nwatch(model, (v) => (text.value = format(v)));\n\nconst num = computed(() => (model.value == null ? undefined : Number(model.value)));\n\nfunction clamp(n: number): number {\n if (props.min != null && n < props.min) n = props.min;\n if (props.max != null && n > props.max) n = props.max;\n return n;\n}\nfunction set(n: number) {\n n = clamp(n);\n model.value = n;\n text.value = n.toFixed(decimals.value);\n}\nfunction bump(dir: 1 | -1, mult = 1) {\n const base = num.value == null ? (props.min != null ? props.min - stepBy.value * (dir > 0 ? 1 : 0) : 0) : num.value;\n set(Math.round((base + dir * stepBy.value * mult) * 1e6) / 1e6);\n}\nfunction commit() {\n const n = parseFloat(text.value.replace(/,/g, \"\"));\n if (isNaN(n)) {\n if (text.value === \"\") model.value = null;\n else text.value = format(model.value);\n } else set(n);\n}\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n bump(1, e.shiftKey ? 10 : 1);\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n bump(-1, e.shiftKey ? 10 : 1);\n } else if (e.key === \"Enter\") commit();\n}\n\nfunction inputBind(field: { id: string; ariaInvalid: \"true\" | undefined; ariaDescribedby: string | undefined }) {\n return {\n id: field.id,\n class: [\"e-input\", \"e-numinput\", !props.prefix && \"e-numfield-first\", !props.suffix && \"e-numfield-last\"],\n style: { \"--e-chars\": Math.max(text.value.length, 1) },\n type: \"text\" as const,\n inputmode: \"decimal\" as const,\n role: \"spinbutton\",\n autocomplete: \"off\",\n value: text.value,\n disabled: props.disabled,\n required: props.required,\n \"aria-valuenow\": num.value,\n \"aria-valuemin\": props.min,\n \"aria-valuemax\": props.max,\n \"aria-invalid\": field.ariaInvalid,\n ...attrs.input(field.ariaDescribedby),\n };\n}\n\ndefineExpose({\n input,\n focus: () => input.value?.focus(),\n});\n</script>\n\n<template>\n <EField\n v-bind=\"attrs.wrapper()\"\n :id=\"id\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :optional=\"optional\"\n >\n <template #default=\"field\">\n <!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->\n <div\n class=\"e-input-wrap e-numfield\"\n :class=\"{ 'e-numfield--affix': prefix || suffix }\"\n :data-invalid=\"error ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n @click=\"focusInside\"\n >\n <button\n type=\"button\"\n class=\"e-numbtn\"\n :aria-label=\"t('decrease')\"\n :disabled=\"disabled || (min != null && num != null && num <= min)\"\n @click=\"bump(-1)\"\n >\n <EIcon name=\"minus\" bold />\n </button>\n <span v-if=\"prefix\" class=\"e-affix e-affix--pre e-numfield-first\" aria-hidden=\"true\">{{ prefix }}</span>\n <input\n ref=\"input\"\n v-bind=\"inputBind(field)\"\n @input=\"text = ($event.target as HTMLInputElement).value\"\n @blur=\"commit\"\n @keydown=\"onKeydown\"\n />\n <span v-if=\"suffix\" class=\"e-affix e-affix--post e-numfield-last\" aria-hidden=\"true\">{{ suffix }}</span>\n <button\n type=\"button\"\n class=\"e-numbtn\"\n :aria-label=\"t('increase')\"\n :disabled=\"disabled || (max != null && num != null && num >= max)\"\n @click=\"bump(1)\"\n >\n <EIcon name=\"plus\" bold />\n </button>\n </div>\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"num == null ? '' : num\" />\n </template>\n </EField>\n</template>\n\n<style>\n@layer e.controls {\n .e-numfield {\n align-items: stretch;\n container-type: inline-size;\n }\n\n .e-numfield .e-numinput {\n text-align: center;\n font: 500 var(--e-text-md)/1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n height: auto;\n padding-inline: var(--e-space-2);\n }\n\n .e-numbtn {\n display: inline-grid;\n place-items: center;\n flex: none;\n width: var(--e-control-height);\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--e-ink);\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-numbtn:first-child {\n border-inline-end: var(--e-stroke-hair) solid var(--e-border-strong);\n border-start-start-radius: var(--e-radius-md);\n border-end-start-radius: var(--e-radius-md);\n }\n\n .e-numbtn:last-child {\n border-inline-start: var(--e-stroke-hair) solid var(--e-border-strong);\n border-start-end-radius: var(--e-radius-md);\n border-end-end-radius: var(--e-radius-md);\n }\n\n .e-numbtn:hover:not(:disabled) {\n background: var(--e-wash-hover);\n }\n\n .e-numbtn:active:not(:disabled) {\n background: var(--e-wash-press);\n }\n\n .e-numbtn:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: -3px;\n }\n\n .e-numbtn:disabled {\n color: var(--e-muted);\n cursor: not-allowed;\n background: transparent;\n }\n\n .e-numfield--affix .e-numinput {\n flex: none;\n width: calc(var(--e-chars) * 1ch);\n padding-inline: 0;\n text-align: start;\n }\n\n .e-numfield--affix .e-affix--pre {\n padding-inline: 0 var(--e-space-1);\n }\n\n .e-numfield--affix .e-affix--post {\n padding-inline: var(--e-space-1) 0;\n }\n\n .e-numfield--affix .e-numfield-first {\n margin-inline-start: auto;\n }\n\n .e-numfield--affix .e-numfield-last {\n margin-inline-end: auto;\n }\n\n @container (max-width: 10rem) {\n .e-numbtn {\n display: none;\n }\n\n .e-numfield .e-numinput {\n text-align: start;\n padding-inline: var(--e-space-3);\n }\n }\n\n @container (max-width: 13rem) {\n .e-numfield--affix .e-numbtn {\n display: none;\n }\n\n .e-numfield--affix .e-numfield-first {\n margin-inline-start: var(--e-space-3);\n }\n\n .e-numfield--affix .e-numfield-last {\n margin-inline-end: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-numbtn {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYA,IAAM0B,IAAQC,GA8BRC,IAAQ5B,EAA0B2B,GAAA,YAAkB,GAEpDG,IAAIC,EAAY,GAChBC,IAAQC,EAAc,GACtBC,IAAQC,EAA6B,IAAI,GAEzCC,IAASC,QAAeX,EAAM,QAAQ,CAAC,GACvCY,IAAWD,SAAgB,OAAOD,EAAO,KAAK,C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AAA,YAAaA,EAAA,OAAG,QAAYgB,EAAA,SAAG,QAAYA,EAAA,SAAOhB,EAAA;KAC5D,SAAK,AAAAkC,EAAA,QAAA,MAAEf,EAAI,EAAA;I,IAEZrC,EAA2BC,GAAA;KAApB,MAAK;KAAQ,MAAA;;IAEViB,EAAA,UAAZ1B,EAAA,GAAAU,EAAwG,QAAxGO,GAAwGN,EAAhBe,EAAA,MAAM,GAAA,CAAA,K;IAC9FpB,EAME,SANFH,EAME;KALI,SAAA;KAAJ,KAAI8B;IACI,GAAAkB,EAAUC,CAAK,GAAA;KACtB,SAAK,AAAAQ,EAAA,QAAA,MAAE,EAAA,QAAQO,EAAO,OAA4B;KAClD,QAAMlB;KACG;;IAEAvB,EAAA,UAAZ1B,EAAA,GAAAU,EAAwG,QAAxGQ,GAAwGP,EAAhBe,EAAA,MAAM,GAAA,CAAA,K;IAC9FpB,EAQS,UAAA;KAPP,MAAK;KACL,OAAM;KACL,cAAYF,EAAAyB,CAAA,CAAC,CAAA,UAAA;KACb,UAAUH,EAAA,YAAaA,EAAA,OAAG,QAAYgB,EAAA,SAAG,QAAYA,EAAA,SAAOhB,EAAA;KAC5D,SAAK,AAAAkC,EAAA,QAAA,MAAEf,EAAI,CAAA;I,IAEZrC,EAA0BC,GAAA;KAAnB,MAAK;KAAO,MAAA;;G,WAGViB,EAAA,QAAb1B,EAAA,GAAAU,EAAgF,SAAA;;IAA7D,MAAK;IAAU,MAAMgB,EAAA;IAAO,OAAOgB,EAAA,SAAG,OAAA,KAAgBA,EAAA"}
1
+ {"version":3,"file":"ENumberField.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createBlock","EField","_mergeProps","_unref","_withCtx","_createElementVNode","_normalizeClass","_createVNode","EIcon","_createElementBlock","_toDisplayString","_createCommentVNode","EIcon_default","EField_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","ENumberField_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","__expose","props","__props","model","useModel","t","useMessages","attrs","useFieldAttrs","input","ref","stepBy","computed","decimals","format","n","text","v","num","clamp","set","bump","base","dir","mult","commit","onKeydown","inputBind","field","openBlock","createBlock","mergeProps","unref","withCtx","createElementVNode","normalizeClass","_cache","args","focusInside","createVNode","createElementBlock","toDisplayString","createCommentVNode","$event"],"sources":["../../../src/components/NumberField/ENumberField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EField from \"../Field/EField.vue\";\nimport { useMessages } from \"../../config.js\";\nimport { focusInside } from \"../../composables/focusInside.js\";\nimport { useFieldAttrs } from \"../../composables/useFieldAttrs.js\";\nimport \"../../styles/base.css\";\nimport \"../TextField/input.css\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps<{\n /** The visible label, a mono kicker above the field. */\n label: string;\n /** Keep the label for screen readers and remove it from the page. */\n hideLabel?: boolean;\n /** The lowest value. The value clamps to it and the decrease button disables there. */\n min?: number;\n /** The highest value. The value clamps to it and the increase button disables there. */\n max?: number;\n /** The amount one step of the buttons and arrow keys changes the value. Decimals shown follow the step (`0.25` shows two). @default 1 */\n step?: number;\n /** A unit before the value. */\n prefix?: string;\n /** A unit after the value, such as visits. */\n suffix?: string;\n /** The name submitted with a form (the number, or empty). */\n name?: string;\n /** Help that stays under the field. */\n hint?: string;\n /** What to fix. Replaces the hint, marks the field invalid and is announced. */\n error?: string;\n /** The `required` attribute and a word beside the label. */\n required?: boolean;\n /** A word beside the label. Flag whichever is rarer. */\n optional?: boolean;\n /** Disables the input and both buttons. */\n disabled?: boolean;\n /** The id of the input; the label points at it. @default generated */\n id?: string;\n}>();\n\n/** The number; `null` when empty. */\nconst model = defineModel<number | null>({ default: null });\n\nconst t = useMessages();\nconst attrs = useFieldAttrs();\nconst input = ref<HTMLInputElement | null>(null);\n\nconst stepBy = computed(() => props.step || 1);\nconst decimals = computed(() => (String(stepBy.value).split(\".\")[1] || \"\").length);\nconst format = (n: number | null | undefined) => (n == null ? \"\" : Number(n).toFixed(decimals.value));\nconst text = ref(format(model.value));\nwatch(model, (v) => (text.value = format(v)));\n\nconst num = computed(() => (model.value == null ? undefined : Number(model.value)));\n\nfunction clamp(n: number): number {\n if (props.min != null && n < props.min) n = props.min;\n if (props.max != null && n > props.max) n = props.max;\n return n;\n}\nfunction set(n: number) {\n n = clamp(n);\n model.value = n;\n text.value = n.toFixed(decimals.value);\n}\nfunction bump(dir: 1 | -1, mult = 1) {\n const base = num.value == null ? (props.min != null ? props.min - stepBy.value * (dir > 0 ? 1 : 0) : 0) : num.value;\n set(Math.round((base + dir * stepBy.value * mult) * 1e6) / 1e6);\n}\nfunction commit() {\n const n = parseFloat(text.value.replace(/,/g, \"\"));\n if (isNaN(n)) {\n if (text.value === \"\") model.value = null;\n else text.value = format(model.value);\n } else set(n);\n}\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n bump(1, e.shiftKey ? 10 : 1);\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n bump(-1, e.shiftKey ? 10 : 1);\n } else if (e.key === \"Enter\") commit();\n}\n\nfunction inputBind(field: { id: string; ariaInvalid: \"true\" | undefined; ariaDescribedby: string | undefined }) {\n return {\n id: field.id,\n class: [\"e-input\", \"e-numinput\", !props.prefix && \"e-numfield-first\", !props.suffix && \"e-numfield-last\"],\n style: { \"--e-chars\": Math.max(text.value.length, 1) },\n type: \"text\" as const,\n inputmode: \"decimal\" as const,\n role: \"spinbutton\",\n autocomplete: \"off\",\n value: text.value,\n disabled: props.disabled,\n required: props.required,\n \"aria-valuenow\": num.value,\n \"aria-valuemin\": props.min,\n \"aria-valuemax\": props.max,\n \"aria-invalid\": field.ariaInvalid,\n ...attrs.input(field.ariaDescribedby),\n };\n}\n\ndefineExpose({\n input,\n focus: () => input.value?.focus(),\n});\n</script>\n\n<template>\n <EField\n v-bind=\"attrs.wrapper()\"\n :id=\"id\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :optional=\"optional\"\n >\n <template #default=\"field\">\n <!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/no-static-element-interactions -->\n <div\n class=\"e-input-wrap e-numfield\"\n :class=\"{ 'e-numfield--affix': prefix || suffix }\"\n :data-invalid=\"error ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n @click=\"focusInside\"\n >\n <button\n type=\"button\"\n class=\"e-numbtn\"\n :aria-label=\"t('decrease')\"\n :disabled=\"disabled || (min != null && num != null && num <= min)\"\n @click=\"bump(-1)\"\n >\n <EIcon name=\"minus\" bold />\n </button>\n <span v-if=\"prefix\" class=\"e-affix e-affix--pre e-numfield-first\" aria-hidden=\"true\">{{ prefix }}</span>\n <input\n ref=\"input\"\n v-bind=\"inputBind(field)\"\n @input=\"text = ($event.target as HTMLInputElement).value\"\n @blur=\"commit\"\n @keydown=\"onKeydown\"\n />\n <span v-if=\"suffix\" class=\"e-affix e-affix--post e-numfield-last\" aria-hidden=\"true\">{{ suffix }}</span>\n <button\n type=\"button\"\n class=\"e-numbtn\"\n :aria-label=\"t('increase')\"\n :disabled=\"disabled || (max != null && num != null && num >= max)\"\n @click=\"bump(1)\"\n >\n <EIcon name=\"plus\" bold />\n </button>\n </div>\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"num == null ? '' : num\" />\n </template>\n </EField>\n</template>\n\n<style>\n@layer e.controls {\n .e-numfield {\n align-items: stretch;\n container-type: inline-size;\n }\n\n .e-numfield .e-numinput {\n text-align: center;\n font: 500 var(--e-text-md)/1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n height: auto;\n padding-inline: var(--e-space-2);\n }\n\n .e-numbtn {\n display: inline-grid;\n place-items: center;\n flex: none;\n width: var(--e-control-height);\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--e-ink);\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-numbtn:first-child {\n border-inline-end: var(--e-stroke-hair) solid var(--e-border-strong);\n border-start-start-radius: var(--e-radius-md);\n border-end-start-radius: var(--e-radius-md);\n }\n\n .e-numbtn:last-child {\n border-inline-start: var(--e-stroke-hair) solid var(--e-border-strong);\n border-start-end-radius: var(--e-radius-md);\n border-end-end-radius: var(--e-radius-md);\n }\n\n .e-numbtn:hover:not(:disabled) {\n background: var(--e-wash-hover);\n }\n\n .e-numbtn:active:not(:disabled) {\n background: var(--e-wash-press);\n }\n\n .e-numbtn:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-numbtn:disabled {\n color: var(--e-muted);\n cursor: not-allowed;\n background: transparent;\n }\n\n .e-numfield--affix .e-numinput {\n flex: none;\n width: calc(var(--e-chars) * 1ch);\n padding-inline: 0;\n text-align: start;\n }\n\n .e-numfield--affix .e-affix--pre {\n padding-inline: 0 var(--e-space-1);\n }\n\n .e-numfield--affix .e-affix--post {\n padding-inline: var(--e-space-1) 0;\n }\n\n .e-numfield--affix .e-numfield-first {\n margin-inline-start: auto;\n }\n\n .e-numfield--affix .e-numfield-last {\n margin-inline-end: auto;\n }\n\n @container (max-width: 10rem) {\n .e-numbtn {\n display: none;\n }\n\n .e-numfield .e-numinput {\n text-align: start;\n padding-inline: var(--e-space-3);\n }\n }\n\n @container (max-width: 13rem) {\n .e-numfield--affix .e-numbtn {\n display: none;\n }\n\n .e-numfield--affix .e-numfield-first {\n margin-inline-start: var(--e-space-3);\n }\n\n .e-numfield--affix .e-numfield-last {\n margin-inline-end: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-numbtn {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYA,IAAM0B,IAAQC,GAgCRC,IAAQ5B,EAA0B2B,GA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EAAA0D,CAAA,KAAA1D,EAAA0D,CAAA,CAAA,CAAA,GAAAD,CAAA;;IAERvD,EAQS,UAAA;KAPP,MAAK;KACL,OAAM;KACL,cAAYF,EAAAyB,CAAA,CAAC,CAAA,UAAA;KACb,UAAUH,EAAA,YAAaA,EAAA,OAAG,QAAYgB,EAAA,SAAG,QAAYA,EAAA,SAAOhB,EAAA;KAC5D,SAAK,AAAAkC,EAAA,QAAA,MAAEf,EAAI,EAAA;I,IAEZrC,EAA2BC,GAAA;KAApB,MAAK;KAAQ,MAAA;;IAEViB,EAAA,UAAZ1B,EAAA,GAAAU,EAAwG,QAAxGO,GAAwGN,EAAhBe,EAAA,MAAM,GAAA,CAAA,K;IAC9FpB,EAME,SANFH,EAME;KALI,SAAA;KAAJ,KAAI8B;IACI,GAAAkB,EAAUC,CAAK,GAAA;KACtB,SAAK,AAAAQ,EAAA,QAAA,MAAE,EAAA,QAAQO,EAAO,OAA4B;KAClD,QAAMlB;KACG;;IAEAvB,EAAA,UAAZ1B,EAAA,GAAAU,EAAwG,QAAxGQ,GAAwGP,EAAhBe,EAAA,MAAM,GAAA,CAAA,K;IAC9FpB,EAQS,UAAA;KAPP,MAAK;KACL,OAAM;KACL,cAAYF,EAAAyB,CAAA,CAAC,CAAA,UAAA;KACb,UAAUH,EAAA,YAAaA,EAAA,OAAG,QAAYgB,EAAA,SAAG,QAAYA,EAAA,SAAOhB,EAAA;KAC5D,SAAK,AAAAkC,EAAA,QAAA,MAAEf,EAAI,CAAA;I,IAEZrC,EAA0BC,GAAA;KAAnB,MAAK;KAAO,MAAA;;G,WAGViB,EAAA,QAAb1B,EAAA,GAAAU,EAAgF,SAAA;;IAA7D,MAAK;IAAU,MAAMgB,EAAA;IAAO,OAAOgB,EAAA,SAAG,OAAA,KAAgBA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EOtpField.js","names":["_sfc_main","EOtpField_vue_vue_type_script_setup_true_lang_default","EOtpField_default"],"sources":["../../../src/components/OtpField/EOtpField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, watch } from \"vue\";\nimport EField from \"../Field/EField.vue\";\nimport { useMessages } from \"../../config.js\";\nimport { useFieldAttrs } from \"../../composables/useFieldAttrs.js\";\nimport \"../../styles/base.css\";\nimport \"../TextField/input.css\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(\n defineProps<{\n /** The visible label. \"Verification code\" when left out. */\n label?: string;\n /** Keep the label for screen readers and remove it from the page. */\n hideLabel?: boolean;\n /** How many characters. */\n length?: number;\n /** `numeric` opens the number pad; `text` takes letters and digits. */\n type?: \"numeric\" | \"text\";\n /** A gap between groups: 6 with 3 reads 123 456. */\n groupSize?: number;\n /** The name submitted with a form (the whole code). */\n name?: string;\n /** Start in the first empty box. */\n autoFocus?: boolean;\n /** Help under the boxes, read with each box. */\n hint?: string;\n /** What to fix. Replaces the hint and is announced. */\n error?: string;\n /** A word beside the label, and the `required` attribute on every box. */\n required?: boolean;\n /** A word beside the label. Flag whichever is rarer. */\n optional?: boolean;\n disabled?: boolean;\n /** The id of the first box; the label and hint ids are built from it. Generated when left out. */\n id?: string;\n }>(),\n { length: 6, type: \"numeric\", groupSize: 0 },\n);\n\nconst emit = defineEmits<{\n /** Once, when the last box fills. */\n complete: [code: string];\n}>();\n\nconst model = defineModel<string>({ default: \"\" });\n\nconst t = useMessages();\nconst attrs = useFieldAttrs();\nconst numeric = computed(() => props.type !== \"text\");\nconst refs: (HTMLInputElement | null)[] = [];\n\nfunction clean(s: unknown): string {\n const text = String(s ?? \"\");\n return (numeric.value ? text.replace(/\\D/g, \"\") : text.replace(/[^a-z0-9]/gi, \"\").toUpperCase()).slice(\n 0,\n props.length,\n );\n}\nconst value = computed(() => clean(model.value));\n\nlet live = value.value;\nwatch(value, (v) => (live = v), { flush: \"sync\" });\n\nfunction commit(next: string) {\n next = clean(next);\n const prev = live;\n live = next;\n model.value = next;\n if (next.length === props.length && prev !== next) emit(\"complete\", next);\n}\nfunction focusAt(i: number) {\n refs[Math.max(0, Math.min(props.length - 1, i))]?.focus();\n}\nconst without = (v: string, i: number) => v.slice(0, i) + v.slice(i + 1);\nfunction put(i: number, text: string) {\n const chars = clean(text);\n if (!chars) return;\n const from = chars.length >= props.length ? 0 : Math.min(i, live.length);\n commit(live.slice(0, from) + chars);\n focusAt(from + chars.length);\n}\nfunction onInput(i: number, e: Event) {\n const target = e.target as HTMLInputElement;\n const v = live;\n let raw = target.value;\n if (!raw) {\n commit(without(v, i));\n return;\n }\n if (v[i] && raw.length === 2) {\n const k = raw.indexOf(v[i]!);\n raw = k >= 0 ? without(raw, k) : raw.charAt(1);\n }\n const chars = clean(raw);\n if (!chars) {\n target.value = live[i] ?? \"\";\n return;\n }\n if (chars.length === 1 && i < v.length) {\n commit(v.slice(0, i) + chars + v.slice(i + 1));\n focusAt(i + 1);\n } else put(i, chars);\n target.value = live[i] ?? \"\";\n}\nfunction onKey(i: number, e: KeyboardEvent) {\n const v = live;\n const k = e.key;\n if (k === \"Backspace\") {\n e.preventDefault();\n if (v[i]) {\n commit(without(v, i));\n focusAt(i);\n } else if (i > 0) {\n commit(without(v, i - 1));\n focusAt(i - 1);\n }\n } else if (k === \"Delete\") {\n e.preventDefault();\n commit(without(v, i));\n } else if (k === \"ArrowLeft\") {\n e.preventDefault();\n focusAt(i - 1);\n } else if (k === \"ArrowRight\") {\n e.preventDefault();\n focusAt(Math.min(i + 1, v.length));\n } else if (k === \"Home\") {\n e.preventDefault();\n focusAt(0);\n } else if (k === \"End\") {\n e.preventDefault();\n focusAt(v.length);\n }\n}\nfunction onFocus(i: number) {\n if (i > live.length) focusAt(live.length);\n}\nfunction onPaste(i: number, e: ClipboardEvent) {\n e.preventDefault();\n put(i, e.clipboardData?.getData(\"text\") ?? \"\");\n}\n\nonMounted(() => {\n if (props.autoFocus) focusAt(live.length);\n});\n\ndefineExpose({\n focus: () => focusAt(live.length),\n});\n</script>\n\n<template>\n <EField\n v-bind=\"attrs.wrapper()\"\n :id=\"id\"\n :label=\"label || t('verificationCode')\"\n :hide-label=\"hideLabel\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :optional=\"optional\"\n >\n <template #default=\"field\">\n <div role=\"group\" :aria-labelledby=\"`${field.id}-label`\" class=\"e-otp\" v-bind=\"attrs.input()\">\n <template v-for=\"i in length\" :key=\"i\">\n <span v-if=\"groupSize && i > 1 && (i - 1) % groupSize === 0\" class=\"e-otp-sep\" aria-hidden=\"true\" />\n <input\n :id=\"i === 1 ? field.id : undefined\"\n :ref=\"(el) => (refs[i - 1] = el as HTMLInputElement | null)\"\n class=\"e-input e-otp-box\"\n type=\"text\"\n :inputmode=\"numeric ? 'numeric' : 'text'\"\n :autocomplete=\"i === 1 ? 'one-time-code' : 'off'\"\n autocapitalize=\"characters\"\n :spellcheck=\"false\"\n :value=\"value[i - 1] || ''\"\n :disabled=\"disabled\"\n :required=\"required\"\n :data-filled=\"value[i - 1] ? '' : undefined\"\n :aria-label=\"t(numeric ? 'otpDigit' : 'otpChar', { n: i, total: length })\"\n :aria-invalid=\"field.ariaInvalid\"\n :aria-describedby=\"field.ariaDescribedby\"\n @input=\"onInput(i - 1, $event)\"\n @keydown=\"onKey(i - 1, $event)\"\n @focus=\"onFocus(i - 1)\"\n @paste=\"onPaste(i - 1, $event)\"\n />\n </template>\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"value\" />\n </div>\n </template>\n </EField>\n</template>\n\n<style>\n@layer e.controls {\n .e-otp {\n display: flex;\n align-items: center;\n gap: var(--e-space-2);\n max-width: 100%;\n }\n\n .e-otp-sep {\n flex: none;\n width: var(--e-space-3);\n }\n\n .e-otp .e-otp-box {\n flex: 1 1 0;\n width: 0;\n min-width: 30px;\n max-width: var(--e-control-height);\n padding: 0;\n text-align: center;\n font: 500 var(--e-text-xl)/1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n caret-color: var(--e-primary);\n }\n\n /* stylelint-disable-next-line selector-not-notation */\n .e-otp .e-otp-box[data-filled]:not(:focus):not([aria-invalid=\"true\"]) {\n border-color: var(--e-ink);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"EOtpField.js","names":["_sfc_main","EOtpField_vue_vue_type_script_setup_true_lang_default","EOtpField_default"],"sources":["../../../src/components/OtpField/EOtpField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, watch } from \"vue\";\nimport EField from \"../Field/EField.vue\";\nimport { useMessages } from \"../../config.js\";\nimport { useFieldAttrs } from \"../../composables/useFieldAttrs.js\";\nimport \"../../styles/base.css\";\nimport \"../TextField/input.css\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(\n defineProps<{\n /** The field's label. @default \"Verification code\" */\n label?: string;\n /** Keep the label for screen readers and remove it from the page. */\n hideLabel?: boolean;\n /** How many characters: the number of boxes. */\n length?: number;\n /** `numeric` opens the number pad; `text` takes letters and digits, upper-cased. */\n inputmode?: \"numeric\" | \"text\";\n /** A gap between groups: 6 with 3 reads 123 456. */\n groupSize?: number;\n /** The name submitted with a form (the whole code), through a hidden input. */\n name?: string;\n /** Start in the first empty box. */\n autoFocus?: boolean;\n /** Help under the boxes, read with each box. */\n hint?: string;\n /** What to fix. Replaces the hint, marks every box invalid and is announced. */\n error?: string;\n /** A word beside the label, and the `required` attribute on every box. */\n required?: boolean;\n /** A word beside the label. Flag whichever is rarer. */\n optional?: boolean;\n /** Disables every box. */\n disabled?: boolean;\n /** The id of the first box; the label and hint ids are built from it. @default generated */\n id?: string;\n }>(),\n { length: 6, inputmode: \"numeric\", groupSize: 0 },\n);\n\nconst emit = defineEmits<{\n /** Once, when the last box fills. */\n complete: [code: string];\n}>();\n\n/** The code typed so far. */\nconst model = defineModel<string>({ default: \"\" });\n\nconst t = useMessages();\nconst attrs = useFieldAttrs();\nconst numeric = computed(() => props.inputmode !== \"text\");\nconst refs: (HTMLInputElement | null)[] = [];\n\nfunction clean(s: unknown): string {\n const text = String(s ?? \"\");\n return (numeric.value ? text.replace(/\\D/g, \"\") : text.replace(/[^a-z0-9]/gi, \"\").toUpperCase()).slice(\n 0,\n props.length,\n );\n}\nconst value = computed(() => clean(model.value));\n\nlet live = value.value;\nwatch(value, (v) => (live = v), { flush: \"sync\" });\n\nfunction commit(next: string) {\n next = clean(next);\n const prev = live;\n live = next;\n model.value = next;\n if (next.length === props.length && prev !== next) emit(\"complete\", next);\n}\nfunction focusAt(i: number) {\n refs[Math.max(0, Math.min(props.length - 1, i))]?.focus();\n}\nconst without = (v: string, i: number) => v.slice(0, i) + v.slice(i + 1);\nfunction put(i: number, text: string) {\n const chars = clean(text);\n if (!chars) return;\n const from = chars.length >= props.length ? 0 : Math.min(i, live.length);\n commit(live.slice(0, from) + chars);\n focusAt(from + chars.length);\n}\nfunction onInput(i: number, e: Event) {\n const target = e.target as HTMLInputElement;\n const v = live;\n let raw = target.value;\n if (!raw) {\n commit(without(v, i));\n return;\n }\n if (v[i] && raw.length === 2) {\n const k = raw.indexOf(v[i]!);\n raw = k >= 0 ? without(raw, k) : raw.charAt(1);\n }\n const chars = clean(raw);\n if (!chars) {\n target.value = live[i] ?? \"\";\n return;\n }\n if (chars.length === 1 && i < v.length) {\n commit(v.slice(0, i) + chars + v.slice(i + 1));\n focusAt(i + 1);\n } else put(i, chars);\n target.value = live[i] ?? \"\";\n}\nfunction onKey(i: number, e: KeyboardEvent) {\n const v = live;\n const k = e.key;\n if (k === \"Backspace\") {\n e.preventDefault();\n if (v[i]) {\n commit(without(v, i));\n focusAt(i);\n } else if (i > 0) {\n commit(without(v, i - 1));\n focusAt(i - 1);\n }\n } else if (k === \"Delete\") {\n e.preventDefault();\n commit(without(v, i));\n } else if (k === \"ArrowLeft\") {\n e.preventDefault();\n focusAt(i - 1);\n } else if (k === \"ArrowRight\") {\n e.preventDefault();\n focusAt(Math.min(i + 1, v.length));\n } else if (k === \"Home\") {\n e.preventDefault();\n focusAt(0);\n } else if (k === \"End\") {\n e.preventDefault();\n focusAt(v.length);\n }\n}\nfunction onFocus(i: number) {\n if (i > live.length) focusAt(live.length);\n}\nfunction onPaste(i: number, e: ClipboardEvent) {\n e.preventDefault();\n put(i, e.clipboardData?.getData(\"text\") ?? \"\");\n}\n\nonMounted(() => {\n if (props.autoFocus) focusAt(live.length);\n});\n\ndefineExpose({\n focus: () => focusAt(live.length),\n});\n</script>\n\n<template>\n <EField\n v-bind=\"attrs.wrapper()\"\n :id=\"id\"\n :label=\"label || t('verificationCode')\"\n :hide-label=\"hideLabel\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :optional=\"optional\"\n >\n <template #default=\"field\">\n <div role=\"group\" :aria-labelledby=\"`${field.id}-label`\" class=\"e-otp\" v-bind=\"attrs.input()\">\n <template v-for=\"i in length\" :key=\"i\">\n <span v-if=\"groupSize && i > 1 && (i - 1) % groupSize === 0\" class=\"e-otp-sep\" aria-hidden=\"true\" />\n <input\n :id=\"i === 1 ? field.id : undefined\"\n :ref=\"(el) => (refs[i - 1] = el as HTMLInputElement | null)\"\n class=\"e-input e-otp-box\"\n type=\"text\"\n :inputmode=\"numeric ? 'numeric' : 'text'\"\n :autocomplete=\"i === 1 ? 'one-time-code' : 'off'\"\n autocapitalize=\"characters\"\n :spellcheck=\"false\"\n :value=\"value[i - 1] || ''\"\n :disabled=\"disabled\"\n :required=\"required\"\n :data-filled=\"value[i - 1] ? '' : undefined\"\n :aria-label=\"t(numeric ? 'otpDigit' : 'otpChar', { n: i, total: length })\"\n :aria-invalid=\"field.ariaInvalid\"\n :aria-describedby=\"field.ariaDescribedby\"\n @input=\"onInput(i - 1, $event)\"\n @keydown=\"onKey(i - 1, $event)\"\n @focus=\"onFocus(i - 1)\"\n @paste=\"onPaste(i - 1, $event)\"\n />\n </template>\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"value\" />\n </div>\n </template>\n </EField>\n</template>\n\n<style>\n@layer e.controls {\n .e-otp {\n display: flex;\n align-items: center;\n gap: var(--e-space-2);\n max-width: 100%;\n }\n\n .e-otp-sep {\n flex: none;\n width: var(--e-space-3);\n }\n\n .e-otp .e-otp-box {\n flex: 1 1 0;\n width: 0;\n min-width: 30px;\n max-width: var(--e-control-height);\n padding: 0;\n text-align: center;\n font: 500 var(--e-text-xl)/1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n caret-color: var(--e-primary);\n }\n\n /* stylelint-disable-next-line selector-not-notation */\n .e-otp .e-otp-box[data-filled]:not(:focus):not([aria-invalid=\"true\"]) {\n border-color: var(--e-ink);\n }\n}\n</style>\n"],"mappings":""}
@@ -1,31 +1,33 @@
1
1
  type __VLS_Props = {
2
- /** The visible label. "Verification code" when left out. */
2
+ /** The field's label. @default "Verification code" */
3
3
  label?: string;
4
4
  /** Keep the label for screen readers and remove it from the page. */
5
5
  hideLabel?: boolean;
6
- /** How many characters. */
6
+ /** How many characters: the number of boxes. */
7
7
  length?: number;
8
- /** `numeric` opens the number pad; `text` takes letters and digits. */
9
- type?: "numeric" | "text";
8
+ /** `numeric` opens the number pad; `text` takes letters and digits, upper-cased. */
9
+ inputmode?: "numeric" | "text";
10
10
  /** A gap between groups: 6 with 3 reads 123 456. */
11
11
  groupSize?: number;
12
- /** The name submitted with a form (the whole code). */
12
+ /** The name submitted with a form (the whole code), through a hidden input. */
13
13
  name?: string;
14
14
  /** Start in the first empty box. */
15
15
  autoFocus?: boolean;
16
16
  /** Help under the boxes, read with each box. */
17
17
  hint?: string;
18
- /** What to fix. Replaces the hint and is announced. */
18
+ /** What to fix. Replaces the hint, marks every box invalid and is announced. */
19
19
  error?: string;
20
20
  /** A word beside the label, and the `required` attribute on every box. */
21
21
  required?: boolean;
22
22
  /** A word beside the label. Flag whichever is rarer. */
23
23
  optional?: boolean;
24
+ /** Disables every box. */
24
25
  disabled?: boolean;
25
- /** The id of the first box; the label and hint ids are built from it. Generated when left out. */
26
+ /** The id of the first box; the label and hint ids are built from it. @default generated */
26
27
  id?: string;
27
28
  };
28
29
  type __VLS_ModelProps = {
30
+ /** The code typed so far. */
29
31
  modelValue?: string;
30
32
  };
31
33
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
@@ -39,7 +41,7 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {
39
41
  onComplete?: ((code: string) => any) | undefined;
40
42
  }>, {
41
43
  length: number;
42
- type: "text" | "numeric";
44
+ inputmode: "text" | "numeric";
43
45
  groupSize: number;
44
46
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
45
47
  declare const _default: typeof __VLS_export;
@@ -31,7 +31,7 @@ var y = ["aria-labelledby"], b = {
31
31
  label: {},
32
32
  hideLabel: { type: Boolean },
33
33
  length: { default: 6 },
34
- type: { default: "numeric" },
34
+ inputmode: { default: "numeric" },
35
35
  groupSize: { default: 0 },
36
36
  name: {},
37
37
  autoFocus: { type: Boolean },
@@ -47,7 +47,7 @@ var y = ["aria-labelledby"], b = {
47
47
  }),
48
48
  emits: /*@__PURE__*/ u(["complete"], ["update:modelValue"]),
49
49
  setup(l, { expose: u, emit: C }) {
50
- let w = l, T = C, E = g(l, "modelValue"), D = e(), O = t(), k = i(() => w.type !== "text"), A = [];
50
+ let w = l, T = C, E = g(l, "modelValue"), D = e(), O = t(), k = i(() => w.inputmode !== "text"), A = [];
51
51
  function j(e) {
52
52
  let t = String(e ?? "");
53
53
  return (k.value ? t.replace(/\D/g, "") : t.replace(/[^a-z0-9]/gi, "").toUpperCase()).slice(0, w.length);
@@ -1 +1 @@
1
- {"version":3,"file":"EOtpField.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createBlock","EField","_mergeProps","_unref","_withCtx","_createElementVNode","_createElementBlock","_Fragment","_renderList","_createCommentVNode","EField_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","EOtpField_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","__expose","__emit","props","__props","emit","model","useModel","t","useMessages","attrs","useFieldAttrs","numeric","computed","refs","clean","text","s","value","live","v","commit","next","prev","focusAt","i","without","put","chars","from","onInput","target","e","raw","k","onKey","onFocus","onPaste","onMounted","openBlock","createBlock","mergeProps","unref","withCtx","createElementVNode","field","createElementBlock","Fragment","renderList","createCommentVNode","el","$event"],"sources":["../../../src/components/OtpField/EOtpField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, watch } from \"vue\";\nimport EField from \"../Field/EField.vue\";\nimport { useMessages } from \"../../config.js\";\nimport { useFieldAttrs } from \"../../composables/useFieldAttrs.js\";\nimport \"../../styles/base.css\";\nimport \"../TextField/input.css\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(\n defineProps<{\n /** The visible label. \"Verification code\" when left out. */\n label?: string;\n /** Keep the label for screen readers and remove it from the page. */\n hideLabel?: boolean;\n /** How many characters. */\n length?: number;\n /** `numeric` opens the number pad; `text` takes letters and digits. */\n type?: \"numeric\" | \"text\";\n /** A gap between groups: 6 with 3 reads 123 456. */\n groupSize?: number;\n /** The name submitted with a form (the whole code). */\n name?: string;\n /** Start in the first empty box. */\n autoFocus?: boolean;\n /** Help under the boxes, read with each box. */\n hint?: string;\n /** What to fix. Replaces the hint and is announced. */\n error?: string;\n /** A word beside the label, and the `required` attribute on every box. */\n required?: boolean;\n /** A word beside the label. Flag whichever is rarer. */\n optional?: boolean;\n disabled?: boolean;\n /** The id of the first box; the label and hint ids are built from it. Generated when left out. */\n id?: string;\n }>(),\n { length: 6, type: \"numeric\", groupSize: 0 },\n);\n\nconst emit = defineEmits<{\n /** Once, when the last box fills. */\n complete: [code: string];\n}>();\n\nconst model = defineModel<string>({ default: \"\" });\n\nconst t = useMessages();\nconst attrs = useFieldAttrs();\nconst numeric = computed(() => props.type !== \"text\");\nconst refs: (HTMLInputElement | null)[] = [];\n\nfunction clean(s: unknown): string {\n const text = String(s ?? \"\");\n return (numeric.value ? text.replace(/\\D/g, \"\") : text.replace(/[^a-z0-9]/gi, \"\").toUpperCase()).slice(\n 0,\n props.length,\n );\n}\nconst value = computed(() => clean(model.value));\n\nlet live = value.value;\nwatch(value, (v) => (live = v), { flush: \"sync\" });\n\nfunction commit(next: string) {\n next = clean(next);\n const prev = live;\n live = next;\n model.value = next;\n if (next.length === props.length && prev !== next) emit(\"complete\", next);\n}\nfunction focusAt(i: number) {\n refs[Math.max(0, Math.min(props.length - 1, i))]?.focus();\n}\nconst without = (v: string, i: number) => v.slice(0, i) + v.slice(i + 1);\nfunction put(i: number, text: string) {\n const chars = clean(text);\n if (!chars) return;\n const from = chars.length >= props.length ? 0 : Math.min(i, live.length);\n commit(live.slice(0, from) + chars);\n focusAt(from + chars.length);\n}\nfunction onInput(i: number, e: Event) {\n const target = e.target as HTMLInputElement;\n const v = live;\n let raw = target.value;\n if (!raw) {\n commit(without(v, i));\n return;\n }\n if (v[i] && raw.length === 2) {\n const k = raw.indexOf(v[i]!);\n raw = k >= 0 ? without(raw, k) : raw.charAt(1);\n }\n const chars = clean(raw);\n if (!chars) {\n target.value = live[i] ?? \"\";\n return;\n }\n if (chars.length === 1 && i < v.length) {\n commit(v.slice(0, i) + chars + v.slice(i + 1));\n focusAt(i + 1);\n } else put(i, chars);\n target.value = live[i] ?? \"\";\n}\nfunction onKey(i: number, e: KeyboardEvent) {\n const v = live;\n const k = e.key;\n if (k === \"Backspace\") {\n e.preventDefault();\n if (v[i]) {\n commit(without(v, i));\n focusAt(i);\n } else if (i > 0) {\n commit(without(v, i - 1));\n focusAt(i - 1);\n }\n } else if (k === \"Delete\") {\n e.preventDefault();\n commit(without(v, i));\n } else if (k === \"ArrowLeft\") {\n e.preventDefault();\n focusAt(i - 1);\n } else if (k === \"ArrowRight\") {\n e.preventDefault();\n focusAt(Math.min(i + 1, v.length));\n } else if (k === \"Home\") {\n e.preventDefault();\n focusAt(0);\n } else if (k === \"End\") {\n e.preventDefault();\n focusAt(v.length);\n }\n}\nfunction onFocus(i: number) {\n if (i > live.length) focusAt(live.length);\n}\nfunction onPaste(i: number, e: ClipboardEvent) {\n e.preventDefault();\n put(i, e.clipboardData?.getData(\"text\") ?? \"\");\n}\n\nonMounted(() => {\n if (props.autoFocus) focusAt(live.length);\n});\n\ndefineExpose({\n focus: () => focusAt(live.length),\n});\n</script>\n\n<template>\n <EField\n v-bind=\"attrs.wrapper()\"\n :id=\"id\"\n :label=\"label || t('verificationCode')\"\n :hide-label=\"hideLabel\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :optional=\"optional\"\n >\n <template #default=\"field\">\n <div role=\"group\" :aria-labelledby=\"`${field.id}-label`\" class=\"e-otp\" v-bind=\"attrs.input()\">\n <template v-for=\"i in length\" :key=\"i\">\n <span v-if=\"groupSize && i > 1 && (i - 1) % groupSize === 0\" class=\"e-otp-sep\" aria-hidden=\"true\" />\n <input\n :id=\"i === 1 ? field.id : undefined\"\n :ref=\"(el) => (refs[i - 1] = el as HTMLInputElement | null)\"\n class=\"e-input e-otp-box\"\n type=\"text\"\n :inputmode=\"numeric ? 'numeric' : 'text'\"\n :autocomplete=\"i === 1 ? 'one-time-code' : 'off'\"\n autocapitalize=\"characters\"\n :spellcheck=\"false\"\n :value=\"value[i - 1] || ''\"\n :disabled=\"disabled\"\n :required=\"required\"\n :data-filled=\"value[i - 1] ? '' : undefined\"\n :aria-label=\"t(numeric ? 'otpDigit' : 'otpChar', { n: i, total: length })\"\n :aria-invalid=\"field.ariaInvalid\"\n :aria-describedby=\"field.ariaDescribedby\"\n @input=\"onInput(i - 1, $event)\"\n @keydown=\"onKey(i - 1, $event)\"\n @focus=\"onFocus(i - 1)\"\n @paste=\"onPaste(i - 1, $event)\"\n />\n </template>\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"value\" />\n </div>\n </template>\n </EField>\n</template>\n\n<style>\n@layer e.controls {\n .e-otp {\n display: flex;\n align-items: center;\n gap: var(--e-space-2);\n max-width: 100%;\n }\n\n .e-otp-sep {\n flex: none;\n width: var(--e-space-3);\n }\n\n .e-otp .e-otp-box {\n flex: 1 1 0;\n width: 0;\n min-width: 30px;\n max-width: var(--e-control-height);\n padding: 0;\n text-align: center;\n font: 500 var(--e-text-xl)/1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n caret-color: var(--e-primary);\n }\n\n /* stylelint-disable-next-line selector-not-notation */\n .e-otp .e-otp-box[data-filled]:not(:focus):not([aria-invalid=\"true\"]) {\n border-color: var(--e-ink);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,IAAMsB,IAAQC,GA+BRC,IAAOH,GAKPI,IAAQzB,EAAmBuB,GAAA,YAAgB,GAE3CI,IAAIC,EAAY,GAChBC,IAAQC,EAAc,GACtBC,IAAUC,QAAeV,EAAM,SAAS,MAAM,GAC9CW,IAAoC,CAAC;EAE3C,SAASC,EAAM,GAAoB;GACjC,IAAMC,IAAO,OAAOC,KAAK,EAAE;GAC3B,QAAQL,EAAQ,QAAQI,EAAK,QAAQ,OAAO,EAAE,IAAIA,EAAK,QAAQ,eAAe,EAAE,CAAC,CAAC,YAAY,EAAA,CAAG,MAC/F,GACAb,EAAM,MACR;EACF;EACA,IAAMe,IAAQL,QAAeE,EAAMT,EAAM,KAAK,CAAC,GAE3Ca,IAAOD,EAAM;EACjB,EAAMA,IAAQ,MAAO,IAAOE,GAAI,EAAE,OAAO,OAAO,CAAC;EAEjD,SAASC,EAAO,GAAc;GAC5B,IAAON,EAAMO,CAAI;GACjB,IAAMC,IAAOJ;GAGb,AAFA,IAAOG,GACP,EAAM,QAAQA,GACVA,EAAK,WAAWnB,EAAM,UAAUoB,MAASD,KAAMjB,EAAK,YAAYiB,CAAI;EAC1E;EACA,SAASE,EAAQ,GAAW;GAC1B,EAAK,KAAK,IAAI,GAAG,KAAK,IAAIrB,EAAM,SAAS,GAAGsB,CAAC,CAAC,EAAE,EAAE,MAAM;EAC1D;EACA,IAAMC,KAAW,GAAW,MAAcN,EAAE,MAAM,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MAASA,IAAC,KAAQrB,EAAA,aAAS,KAArDtB,EAAA,GAAAO,EAAoG,QAApGM,CAAoG,K,WACpGP,EAoBE,SAAA;IAnBC,IAAIqC,MAAC,IAASoB,EAAM,KAAK,KAAA;;IACzB,MAAM,MAAQ,EAAKpB,IAAC,KAAQyB;IAC7B,OAAM;IACN,MAAK;IACJ,WAAWtC,EAAA,QAAO,YAAA;IAClB,cAAca,MAAC,IAAA,kBAAA;IAChB,gBAAe;IACd,YAAY;IACZ,OAAOP,EAAA,MAAMO,IAAC,MAAA;IACd,UAAUrB,EAAA;IACV,UAAUA,EAAA;IACV,eAAac,EAAA,MAAMO,IAAC,KAAA,KAAa,KAAA;IACjC,cAAYvC,EAAAsB,CAAA,CAAC,CAACI,EAAA,QAAO,aAAA,WAAA;KAAA,GAAgCa;KAAC,OAASrB,EAAA;IAAM,CAAA;IACrE,gBAAcyC,EAAM;IACpB,oBAAkBA,EAAM;IACxB,UAAK,MAAEf,EAAQL,IAAC,GAAM0B,CAAM;IAC5B,YAAO,MAAEhB,EAAMV,IAAC,GAAM0B,CAAM;IAC5B,UAAK,MAAEf,EAAQX,IAAC,CAAA;IAChB,UAAK,MAAEY,EAAQZ,IAAC,GAAM0B,CAAM;G,gCAGpB/C,EAAA,QAAbtB,EAAA,GAAAO,EAA+D,SAAA;;IAA5C,MAAK;IAAU,MAAMe,EAAA;IAAO,OAAOc,EAAA"}
1
+ {"version":3,"file":"EOtpField.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createBlock","EField","_mergeProps","_unref","_withCtx","_createElementVNode","_createElementBlock","_Fragment","_renderList","_createCommentVNode","EField_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","EOtpField_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","__expose","__emit","props","__props","emit","model","useModel","t","useMessages","attrs","useFieldAttrs","numeric","computed","refs","clean","text","s","value","live","v","commit","next","prev","focusAt","i","without","put","chars","from","onInput","target","e","raw","k","onKey","onFocus","onPaste","onMounted","openBlock","createBlock","mergeProps","unref","withCtx","createElementVNode","field","createElementBlock","Fragment","renderList","createCommentVNode","el","$event"],"sources":["../../../src/components/OtpField/EOtpField.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, watch } from \"vue\";\nimport EField from \"../Field/EField.vue\";\nimport { useMessages } from \"../../config.js\";\nimport { useFieldAttrs } from \"../../composables/useFieldAttrs.js\";\nimport \"../../styles/base.css\";\nimport \"../TextField/input.css\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(\n defineProps<{\n /** The field's label. @default \"Verification code\" */\n label?: string;\n /** Keep the label for screen readers and remove it from the page. */\n hideLabel?: boolean;\n /** How many characters: the number of boxes. */\n length?: number;\n /** `numeric` opens the number pad; `text` takes letters and digits, upper-cased. */\n inputmode?: \"numeric\" | \"text\";\n /** A gap between groups: 6 with 3 reads 123 456. */\n groupSize?: number;\n /** The name submitted with a form (the whole code), through a hidden input. */\n name?: string;\n /** Start in the first empty box. */\n autoFocus?: boolean;\n /** Help under the boxes, read with each box. */\n hint?: string;\n /** What to fix. Replaces the hint, marks every box invalid and is announced. */\n error?: string;\n /** A word beside the label, and the `required` attribute on every box. */\n required?: boolean;\n /** A word beside the label. Flag whichever is rarer. */\n optional?: boolean;\n /** Disables every box. */\n disabled?: boolean;\n /** The id of the first box; the label and hint ids are built from it. @default generated */\n id?: string;\n }>(),\n { length: 6, inputmode: \"numeric\", groupSize: 0 },\n);\n\nconst emit = defineEmits<{\n /** Once, when the last box fills. */\n complete: [code: string];\n}>();\n\n/** The code typed so far. */\nconst model = defineModel<string>({ default: \"\" });\n\nconst t = useMessages();\nconst attrs = useFieldAttrs();\nconst numeric = computed(() => props.inputmode !== \"text\");\nconst refs: (HTMLInputElement | null)[] = [];\n\nfunction clean(s: unknown): string {\n const text = String(s ?? \"\");\n return (numeric.value ? text.replace(/\\D/g, \"\") : text.replace(/[^a-z0-9]/gi, \"\").toUpperCase()).slice(\n 0,\n props.length,\n );\n}\nconst value = computed(() => clean(model.value));\n\nlet live = value.value;\nwatch(value, (v) => (live = v), { flush: \"sync\" });\n\nfunction commit(next: string) {\n next = clean(next);\n const prev = live;\n live = next;\n model.value = next;\n if (next.length === props.length && prev !== next) emit(\"complete\", next);\n}\nfunction focusAt(i: number) {\n refs[Math.max(0, Math.min(props.length - 1, i))]?.focus();\n}\nconst without = (v: string, i: number) => v.slice(0, i) + v.slice(i + 1);\nfunction put(i: number, text: string) {\n const chars = clean(text);\n if (!chars) return;\n const from = chars.length >= props.length ? 0 : Math.min(i, live.length);\n commit(live.slice(0, from) + chars);\n focusAt(from + chars.length);\n}\nfunction onInput(i: number, e: Event) {\n const target = e.target as HTMLInputElement;\n const v = live;\n let raw = target.value;\n if (!raw) {\n commit(without(v, i));\n return;\n }\n if (v[i] && raw.length === 2) {\n const k = raw.indexOf(v[i]!);\n raw = k >= 0 ? without(raw, k) : raw.charAt(1);\n }\n const chars = clean(raw);\n if (!chars) {\n target.value = live[i] ?? \"\";\n return;\n }\n if (chars.length === 1 && i < v.length) {\n commit(v.slice(0, i) + chars + v.slice(i + 1));\n focusAt(i + 1);\n } else put(i, chars);\n target.value = live[i] ?? \"\";\n}\nfunction onKey(i: number, e: KeyboardEvent) {\n const v = live;\n const k = e.key;\n if (k === \"Backspace\") {\n e.preventDefault();\n if (v[i]) {\n commit(without(v, i));\n focusAt(i);\n } else if (i > 0) {\n commit(without(v, i - 1));\n focusAt(i - 1);\n }\n } else if (k === \"Delete\") {\n e.preventDefault();\n commit(without(v, i));\n } else if (k === \"ArrowLeft\") {\n e.preventDefault();\n focusAt(i - 1);\n } else if (k === \"ArrowRight\") {\n e.preventDefault();\n focusAt(Math.min(i + 1, v.length));\n } else if (k === \"Home\") {\n e.preventDefault();\n focusAt(0);\n } else if (k === \"End\") {\n e.preventDefault();\n focusAt(v.length);\n }\n}\nfunction onFocus(i: number) {\n if (i > live.length) focusAt(live.length);\n}\nfunction onPaste(i: number, e: ClipboardEvent) {\n e.preventDefault();\n put(i, e.clipboardData?.getData(\"text\") ?? \"\");\n}\n\nonMounted(() => {\n if (props.autoFocus) focusAt(live.length);\n});\n\ndefineExpose({\n focus: () => focusAt(live.length),\n});\n</script>\n\n<template>\n <EField\n v-bind=\"attrs.wrapper()\"\n :id=\"id\"\n :label=\"label || t('verificationCode')\"\n :hide-label=\"hideLabel\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :optional=\"optional\"\n >\n <template #default=\"field\">\n <div role=\"group\" :aria-labelledby=\"`${field.id}-label`\" class=\"e-otp\" v-bind=\"attrs.input()\">\n <template v-for=\"i in length\" :key=\"i\">\n <span v-if=\"groupSize && i > 1 && (i - 1) % groupSize === 0\" class=\"e-otp-sep\" aria-hidden=\"true\" />\n <input\n :id=\"i === 1 ? field.id : undefined\"\n :ref=\"(el) => (refs[i - 1] = el as HTMLInputElement | null)\"\n class=\"e-input e-otp-box\"\n type=\"text\"\n :inputmode=\"numeric ? 'numeric' : 'text'\"\n :autocomplete=\"i === 1 ? 'one-time-code' : 'off'\"\n autocapitalize=\"characters\"\n :spellcheck=\"false\"\n :value=\"value[i - 1] || ''\"\n :disabled=\"disabled\"\n :required=\"required\"\n :data-filled=\"value[i - 1] ? '' : undefined\"\n :aria-label=\"t(numeric ? 'otpDigit' : 'otpChar', { n: i, total: length })\"\n :aria-invalid=\"field.ariaInvalid\"\n :aria-describedby=\"field.ariaDescribedby\"\n @input=\"onInput(i - 1, $event)\"\n @keydown=\"onKey(i - 1, $event)\"\n @focus=\"onFocus(i - 1)\"\n @paste=\"onPaste(i - 1, $event)\"\n />\n </template>\n <input v-if=\"name\" type=\"hidden\" :name=\"name\" :value=\"value\" />\n </div>\n </template>\n </EField>\n</template>\n\n<style>\n@layer e.controls {\n .e-otp {\n display: flex;\n align-items: center;\n gap: var(--e-space-2);\n max-width: 100%;\n }\n\n .e-otp-sep {\n flex: none;\n width: var(--e-space-3);\n }\n\n .e-otp .e-otp-box {\n flex: 1 1 0;\n width: 0;\n min-width: 30px;\n max-width: var(--e-control-height);\n padding: 0;\n text-align: center;\n font: 500 var(--e-text-xl)/1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n caret-color: var(--e-primary);\n }\n\n /* stylelint-disable-next-line selector-not-notation */\n .e-otp .e-otp-box[data-filled]:not(:focus):not([aria-invalid=\"true\"]) {\n border-color: var(--e-ink);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,IAAMsB,IAAQC,GAgCRC,IAAOH,GAMPI,IAAQzB,EAAmBuB,GAAA,YAAgB,GAE3CI,IAAIC,EAAY,GAChBC,IAAQC,EAAc,GACtBC,IAAUC,QAAeV,EAAM,cAAc,MAAM,GACnDW,IAAoC,CAAC;EAE3C,SAASC,EAAM,GAAoB;GACjC,IAAMC,IAAO,OAAOC,KAAK,EAAE;GAC3B,QAAQL,EAAQ,QAAQI,EAAK,QAAQ,OAAO,EAAE,IAAIA,EAAK,QAAQ,eAAe,EAAE,CAAC,CAAC,YAAY,EAAA,CAAG,MAC/F,GACAb,EAAM,MACR;EACF;EACA,IAAMe,IAAQL,QAAeE,EAAMT,EAAM,KAAK,CAAC,GAE3Ca,IAAOD,EAAM;EACjB,EAAMA,IAAQ,MAAO,IAAOE,GAAI,EAAE,OAAO,OAAO,CAAC;EAEjD,SAASC,EAAO,GAAc;GAC5B,IAAON,EAAMO,CAAI;GACjB,IAAMC,IAAOJ;GAGb,AAFA,IAAOG,GACP,EAAM,QAAQA,GACVA,EAAK,WAAWnB,EAAM,UAAUoB,MAASD,KAAMjB,EAAK,YAAYiB,CAAI;EAC1E;EACA,SAASE,EAAQ,GAAW;GAC1B,EAAK,KAAK,IAAI,GAAG,KAAK,IAAIrB,EAAM,SAAS,GAAGsB,CAAC,CAAC,EAAE,EAAE,MAAM;EAC1D;EACA,IAAMC,KAAW,GAAW,MAAcN,EAAE,MAAM,G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AASA,IAAC,KAAQrB,EAAA,aAAS,KAArDtB,EAAA,GAAAO,EAAoG,QAApGM,CAAoG,K,WACpGP,EAoBE,SAAA;IAnBC,IAAIqC,MAAC,IAASoB,EAAM,KAAK,KAAA;;IACzB,MAAM,MAAQ,EAAKpB,IAAC,KAAQyB;IAC7B,OAAM;IACN,MAAK;IACJ,WAAWtC,EAAA,QAAO,YAAA;IAClB,cAAca,MAAC,IAAA,kBAAA;IAChB,gBAAe;IACd,YAAY;IACZ,OAAOP,EAAA,MAAMO,IAAC,MAAA;IACd,UAAUrB,EAAA;IACV,UAAUA,EAAA;IACV,eAAac,EAAA,MAAMO,IAAC,KAAA,KAAa,KAAA;IACjC,cAAYvC,EAAAsB,CAAA,CAAC,CAACI,EAAA,QAAO,aAAA,WAAA;KAAA,GAAgCa;KAAC,OAASrB,EAAA;IAAM,CAAA;IACrE,gBAAcyC,EAAM;IACpB,oBAAkBA,EAAM;IACxB,UAAK,MAAEf,EAAQL,IAAC,GAAM0B,CAAM;IAC5B,YAAO,MAAEhB,EAAMV,IAAC,GAAM0B,CAAM;IAC5B,UAAK,MAAEf,EAAQX,IAAC,CAAA;IAChB,UAAK,MAAEY,EAAQZ,IAAC,GAAM0B,CAAM;G,gCAGpB/C,EAAA,QAAbtB,EAAA,GAAAO,EAA+D,SAAA;;IAA5C,MAAK;IAAU,MAAMe,EAAA;IAAO,OAAOc,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EPageHeader.js","names":["_sfc_main","EPageHeader_vue_vue_type_script_setup_true_lang_default","EPageHeader_default"],"sources":["../../../src/components/PageHeader/EPageHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport EActions from \"../Actions/EActions.vue\";\nimport \"../../styles/base.css\";\n\nwithDefaults(\n defineProps<{\n /** The page's title: where the person is, in their words (\"Visit on Oct 2\"). */\n title: string;\n /** A short line under the title. */\n description?: string;\n /** The heading level, 1 by default. A page has exactly one h1. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n }>(),\n { headingLevel: 1 },\n);\n\ndefineSlots<{\n /** An EBreadcrumb above the title. */\n breadcrumb?(): unknown;\n /** An EStamp beside the title. */\n status?(): unknown;\n /** The page's Buttons, the main one first. */\n actions?(): unknown;\n}>();\n</script>\n\n<template>\n <div class=\"e-pagehead\">\n <slot name=\"breadcrumb\" />\n <div class=\"e-pagehead-row\">\n <div class=\"e-pagehead-text\">\n <div class=\"e-pagehead-titlerow\">\n <component :is=\"`h${headingLevel}`\" class=\"e-pagehead-title\">{{ title }}</component>\n <slot name=\"status\" />\n </div>\n <p v-if=\"description\" class=\"e-pagehead-desc\">{{ description }}</p>\n </div>\n <EActions v-if=\"$slots.actions\" class=\"e-pagehead-actions\"><slot name=\"actions\" /></EActions>\n </div>\n </div>\n</template>\n\n<style>\n@layer e.page {\n .e-pagehead {\n display: grid;\n gap: var(--e-space-3);\n margin-bottom: var(--e-space-6);\n }\n\n .e-pagehead-row {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--e-space-3) var(--e-space-4);\n }\n\n .e-pagehead-text {\n flex: 1 1 18rem;\n min-width: 0;\n }\n\n .e-pagehead-title {\n margin: 0;\n font: 500 var(--e-text-4xl) / 1.1 var(--e-font-sans);\n text-wrap: balance;\n }\n\n .e-pagehead-desc {\n margin: var(--e-space-2) 0 0;\n max-width: var(--e-measure);\n font: 400 var(--e-text-lg) / 1.45 var(--e-font-sans);\n color: var(--e-muted);\n }\n\n @media (max-width: 32rem) {\n .e-pagehead-title {\n font-size: var(--e-text-2xl);\n }\n }\n\n .e-pagehead-titlerow {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--e-space-2) var(--e-space-4);\n }\n\n .e-pagehead-titlerow > :not(.e-pagehead-title) {\n margin-top: var(--e-space-1);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"EPageHeader.js","names":["_sfc_main","EPageHeader_vue_vue_type_script_setup_true_lang_default","EPageHeader_default"],"sources":["../../../src/components/PageHeader/EPageHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport EActions from \"../Actions/EActions.vue\";\nimport \"../../styles/base.css\";\n\nwithDefaults(\n defineProps<{\n /** The page's title: where the person is, in their words (\"Visit on Oct 2\"). */\n title: string;\n /** A short line under the title. */\n description?: string;\n /** The heading level of the title, 1 by default. A page has exactly one h1; change it only when the header is not the page's title. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n }>(),\n { headingLevel: 1 },\n);\n\ndefineSlots<{\n /** An EBreadcrumb above the title. */\n breadcrumb?(): unknown;\n /** An EStamp beside the title. */\n status?(): unknown;\n /** The page's Buttons, the main one first. */\n actions?(): unknown;\n}>();\n</script>\n\n<template>\n <div class=\"e-pagehead\">\n <slot name=\"breadcrumb\" />\n <div class=\"e-pagehead-row\">\n <div class=\"e-pagehead-text\">\n <div class=\"e-pagehead-titlerow\">\n <component :is=\"`h${headingLevel}`\" class=\"e-pagehead-title\">{{ title }}</component>\n <slot name=\"status\" />\n </div>\n <p v-if=\"description\" class=\"e-pagehead-desc\">{{ description }}</p>\n </div>\n <EActions v-if=\"$slots.actions\" class=\"e-pagehead-actions\"><slot name=\"actions\" /></EActions>\n </div>\n </div>\n</template>\n\n<style>\n@layer e.page {\n .e-pagehead {\n display: grid;\n gap: var(--e-space-3);\n margin-bottom: var(--e-space-6);\n }\n\n .e-pagehead-row {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--e-space-3) var(--e-space-4);\n }\n\n .e-pagehead-text {\n flex: 1 1 18rem;\n min-width: 0;\n }\n\n .e-pagehead-title {\n margin: 0;\n font: 500 var(--e-text-4xl) / 1.1 var(--e-font-sans);\n text-wrap: balance;\n }\n\n .e-pagehead-desc {\n margin: var(--e-space-2) 0 0;\n max-width: var(--e-measure);\n font: 400 var(--e-text-lg) / 1.45 var(--e-font-sans);\n color: var(--e-muted);\n }\n\n @media (max-width: 32rem) {\n .e-pagehead-title {\n font-size: var(--e-text-2xl);\n }\n }\n\n .e-pagehead-titlerow {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--e-space-2) var(--e-space-4);\n }\n\n .e-pagehead-titlerow > :not(.e-pagehead-title) {\n margin-top: var(--e-space-1);\n }\n}\n</style>\n"],"mappings":""}