@threadlabs/looma 0.50.2 → 0.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/components/shared/binding-inputs.js +5 -0
  2. package/components/shared/calendar-model.js +84 -0
  3. package/components/shared/date-input-segments.js +25 -0
  4. package/components/shared/date-navigation.js +35 -0
  5. package/components/shared/date-picker.js +38 -0
  6. package/components/shared/date-range.js +61 -0
  7. package/components/shared/date-time.js +273 -0
  8. package/components/shared/external-value.js +12 -0
  9. package/components/shared/form-reset.js +1 -1
  10. package/components/shared/icons.js +2 -0
  11. package/components/shared/initial-field-value.js +14 -0
  12. package/components/shared/input-segments.js +190 -0
  13. package/components/shared/prepared-module.js +19 -0
  14. package/components/ui-button/ui-button.html +31 -10
  15. package/components/ui-calendar/calendar-source.js +34 -0
  16. package/components/ui-calendar/ui-calendar.html +221 -0
  17. package/components/ui-calendar/ui-calendar.js +185 -0
  18. package/components/ui-cluster/ui-cluster.html +5 -2
  19. package/components/ui-date-field/ui-date-field.html +143 -0
  20. package/components/ui-date-field/ui-date-field.js +258 -0
  21. package/components/ui-date-picker/ui-date-picker.html +213 -0
  22. package/components/ui-date-picker/ui-date-picker.js +153 -0
  23. package/components/ui-date-range-picker/ui-date-range-picker.html +202 -0
  24. package/components/ui-date-range-picker/ui-date-range-picker.js +224 -0
  25. package/components/ui-file-input/files.js +15 -0
  26. package/components/ui-file-input/ui-file-input.html +79 -0
  27. package/components/ui-file-input/ui-file-input.js +108 -0
  28. package/components/ui-form-field/ui-form-field.js +2 -2
  29. package/components/ui-grid/ui-grid.html +74 -5
  30. package/components/ui-icon/ui-icon.html +8 -0
  31. package/components/ui-icon-button/ui-icon-button.html +22 -7
  32. package/components/ui-input/ui-input.html +10 -1
  33. package/components/ui-input/ui-input.js +11 -5
  34. package/components/ui-input-group/ui-input-group.html +2 -2
  35. package/components/ui-input-group/ui-input-group.js +6 -5
  36. package/components/ui-popover/ui-popover.html +2 -0
  37. package/components/ui-popover/ui-popover.js +5 -1
  38. package/components/ui-select/ui-select.html +8 -3
  39. package/components/ui-time-field/ui-time-field.html +62 -0
  40. package/components/ui-time-field/ui-time-field.js +21 -0
  41. package/components/ui-time-picker/time-options.js +25 -0
  42. package/components/ui-time-picker/ui-time-picker.html +160 -0
  43. package/components/ui-time-picker/ui-time-picker.js +132 -0
  44. package/dist/index.js +68 -61
  45. package/docs/README.md +2 -2
  46. package/docs/catalog.json +14346 -6343
  47. package/docs/documentation.css +1 -1
  48. package/docs/framework-examples.mjs +13 -2
  49. package/docs/site.mjs +1 -1
  50. package/editor/components.css +62 -29
  51. package/editor/icons.d.ts +2 -0
  52. package/editor/index.js +602 -141
  53. package/package.json +6 -4
  54. package/styles/ui-action-bar.css +1 -1
  55. package/styles/ui-affordance-scope.css +1 -1
  56. package/styles/ui-avatar-group.css +1 -1
  57. package/styles/ui-avatar.css +1 -1
  58. package/styles/ui-badge.css +1 -1
  59. package/styles/ui-breadcrumb-item.css +1 -1
  60. package/styles/ui-breadcrumbs.css +1 -1
  61. package/styles/ui-button.css +19 -7
  62. package/styles/ui-calendar.css +1 -0
  63. package/styles/ui-callout.css +1 -1
  64. package/styles/ui-card-group.css +1 -1
  65. package/styles/ui-card.css +1 -1
  66. package/styles/ui-checkbox.css +1 -1
  67. package/styles/ui-cluster.css +4 -1
  68. package/styles/ui-color-picker.css +1 -1
  69. package/styles/ui-combobox.css +1 -1
  70. package/styles/ui-compact-content.css +1 -1
  71. package/styles/ui-compact-editor.css +1 -1
  72. package/styles/ui-compact-mark.css +1 -1
  73. package/styles/ui-compact-node.css +1 -1
  74. package/styles/ui-container.css +1 -1
  75. package/styles/ui-context-menu.css +1 -1
  76. package/styles/ui-cover.css +1 -1
  77. package/styles/ui-curve-editor.css +1 -1
  78. package/styles/ui-cycle-button.css +1 -1
  79. package/styles/ui-date-field.css +1 -0
  80. package/styles/ui-date-picker.css +1 -0
  81. package/styles/ui-date-range-picker.css +1 -0
  82. package/styles/ui-description-item.css +1 -1
  83. package/styles/ui-description-list.css +1 -1
  84. package/styles/ui-dialog.css +1 -1
  85. package/styles/ui-disclosure.css +1 -1
  86. package/styles/ui-editable.css +1 -1
  87. package/styles/ui-editor-block-actions.css +1 -1
  88. package/styles/ui-editor-chip-editor.css +1 -1
  89. package/styles/ui-editor-code-language.css +1 -1
  90. package/styles/ui-editor-footnote-editor.css +1 -1
  91. package/styles/ui-editor-formatting-tools.css +1 -1
  92. package/styles/ui-editor-image-toolbar.css +1 -1
  93. package/styles/ui-editor-insert-table-grid.css +1 -1
  94. package/styles/ui-editor-link-card.css +1 -1
  95. package/styles/ui-editor-link-form.css +1 -1
  96. package/styles/ui-editor-mention-menu-item.css +1 -1
  97. package/styles/ui-editor-mention-menu.css +1 -1
  98. package/styles/ui-editor-slash-menu-group.css +1 -1
  99. package/styles/ui-editor-slash-menu-item.css +1 -1
  100. package/styles/ui-editor-slash-menu.css +1 -1
  101. package/styles/ui-editor-surface.css +1 -1
  102. package/styles/ui-editor-table-context-menu.css +1 -1
  103. package/styles/ui-editor-table-overlay.css +1 -1
  104. package/styles/ui-editor-table-toolbar.css +1 -1
  105. package/styles/ui-editor-toolbar.css +1 -1
  106. package/styles/ui-editor.css +1 -1
  107. package/styles/ui-file-input.css +1 -0
  108. package/styles/ui-floating-action-button.css +1 -1
  109. package/styles/ui-form-field.css +1 -1
  110. package/styles/ui-grid.css +44 -1
  111. package/styles/ui-icon-button.css +19 -5
  112. package/styles/ui-icon.css +5 -1
  113. package/styles/ui-image.css +1 -1
  114. package/styles/ui-input-group.css +3 -3
  115. package/styles/ui-input.css +1 -1
  116. package/styles/ui-light-editor.css +1 -1
  117. package/styles/ui-list-item.css +1 -1
  118. package/styles/ui-list.css +1 -1
  119. package/styles/ui-listbox.css +1 -1
  120. package/styles/ui-menu-group.css +1 -1
  121. package/styles/ui-menu-item.css +1 -1
  122. package/styles/ui-menu.css +1 -1
  123. package/styles/ui-meter.css +1 -1
  124. package/styles/ui-nav-item.css +1 -1
  125. package/styles/ui-number-input.css +1 -1
  126. package/styles/ui-page-header.css +1 -1
  127. package/styles/ui-pagination.css +1 -1
  128. package/styles/ui-popover.css +1 -1
  129. package/styles/ui-radio-group.css +1 -1
  130. package/styles/ui-radio.css +1 -1
  131. package/styles/ui-reel.css +1 -1
  132. package/styles/ui-scroll-area.css +1 -1
  133. package/styles/ui-search-result-row.css +1 -1
  134. package/styles/ui-search-shell.css +1 -1
  135. package/styles/ui-section.css +1 -1
  136. package/styles/ui-select.css +9 -4
  137. package/styles/ui-separator.css +1 -1
  138. package/styles/ui-sidebar.css +1 -1
  139. package/styles/ui-site-header.css +19 -19
  140. package/styles/ui-skeleton.css +1 -1
  141. package/styles/ui-slider.css +1 -1
  142. package/styles/ui-spinner.css +1 -1
  143. package/styles/ui-stack.css +1 -1
  144. package/styles/ui-status-message.css +1 -1
  145. package/styles/ui-swatch.css +1 -1
  146. package/styles/ui-switch.css +1 -1
  147. package/styles/ui-switcher.css +1 -1
  148. package/styles/ui-table.css +1 -1
  149. package/styles/ui-tabs.css +1 -1
  150. package/styles/ui-text.css +1 -1
  151. package/styles/ui-textarea.css +1 -1
  152. package/styles/ui-time-field.css +1 -0
  153. package/styles/ui-time-picker.css +1 -0
  154. package/styles/ui-toast-region.css +1 -1
  155. package/styles/ui-toast.css +1 -1
  156. package/styles/ui-tooltip.css +1 -1
  157. package/styles/ui-top-bar.css +1 -1
  158. package/styles/ui-tree-item.css +1 -1
  159. package/styles/ui-tree.css +1 -1
  160. package/tokens.css +4 -0
  161. package/vanilla/UiActionBar.d.ts +1 -1
  162. package/vanilla/UiActionBar.js +1 -1
  163. package/vanilla/UiAffordanceScope.d.ts +1 -1
  164. package/vanilla/UiAffordanceScope.js +1 -1
  165. package/vanilla/UiAvatar.d.ts +1 -1
  166. package/vanilla/UiAvatar.js +1 -1
  167. package/vanilla/UiAvatarGroup.d.ts +1 -1
  168. package/vanilla/UiAvatarGroup.js +1 -1
  169. package/vanilla/UiBadge.d.ts +1 -1
  170. package/vanilla/UiBadge.js +1 -1
  171. package/vanilla/UiBreadcrumbItem.d.ts +1 -1
  172. package/vanilla/UiBreadcrumbItem.js +1 -1
  173. package/vanilla/UiBreadcrumbs.d.ts +1 -1
  174. package/vanilla/UiBreadcrumbs.js +1 -1
  175. package/vanilla/UiButton.d.ts +2 -1
  176. package/vanilla/UiButton.js +128 -108
  177. package/vanilla/UiCalendar.d.ts +50 -0
  178. package/vanilla/UiCalendar.js +477 -0
  179. package/vanilla/UiCallout.d.ts +1 -1
  180. package/vanilla/UiCallout.js +1 -1
  181. package/vanilla/UiCard.d.ts +1 -1
  182. package/vanilla/UiCard.js +1 -1
  183. package/vanilla/UiCardGroup.d.ts +1 -1
  184. package/vanilla/UiCardGroup.js +1 -1
  185. package/vanilla/UiCheckbox.d.ts +1 -1
  186. package/vanilla/UiCheckbox.js +1 -1
  187. package/vanilla/UiCluster.d.ts +2 -2
  188. package/vanilla/UiCluster.js +2 -2
  189. package/vanilla/UiColorPicker.d.ts +1 -1
  190. package/vanilla/UiColorPicker.js +1 -1
  191. package/vanilla/UiCombobox.d.ts +1 -1
  192. package/vanilla/UiCombobox.js +1 -1
  193. package/vanilla/UiCompactContent.d.ts +1 -1
  194. package/vanilla/UiCompactContent.js +1 -1
  195. package/vanilla/UiCompactEditor.d.ts +1 -1
  196. package/vanilla/UiCompactEditor.js +1 -1
  197. package/vanilla/UiCompactMark.d.ts +1 -1
  198. package/vanilla/UiCompactMark.js +1 -1
  199. package/vanilla/UiCompactNode.d.ts +1 -1
  200. package/vanilla/UiCompactNode.js +1 -1
  201. package/vanilla/UiContainer.d.ts +1 -1
  202. package/vanilla/UiContainer.js +1 -1
  203. package/vanilla/UiContextMenu.d.ts +1 -1
  204. package/vanilla/UiContextMenu.js +1 -1
  205. package/vanilla/UiCover.d.ts +1 -1
  206. package/vanilla/UiCover.js +1 -1
  207. package/vanilla/UiCurveEditor.d.ts +1 -1
  208. package/vanilla/UiCurveEditor.js +1 -1
  209. package/vanilla/UiCycleButton.d.ts +1 -1
  210. package/vanilla/UiCycleButton.js +1 -1
  211. package/vanilla/UiDateField.d.ts +52 -0
  212. package/vanilla/UiDateField.js +208 -0
  213. package/vanilla/UiDatePicker.d.ts +63 -0
  214. package/vanilla/UiDatePicker.js +360 -0
  215. package/vanilla/UiDateRangePicker.d.ts +60 -0
  216. package/vanilla/UiDateRangePicker.js +418 -0
  217. package/vanilla/UiDescriptionItem.d.ts +1 -1
  218. package/vanilla/UiDescriptionItem.js +1 -1
  219. package/vanilla/UiDescriptionList.d.ts +1 -1
  220. package/vanilla/UiDescriptionList.js +1 -1
  221. package/vanilla/UiDialog.d.ts +1 -1
  222. package/vanilla/UiDialog.js +1 -1
  223. package/vanilla/UiDisclosure.d.ts +1 -1
  224. package/vanilla/UiDisclosure.js +1 -1
  225. package/vanilla/UiEditable.d.ts +1 -1
  226. package/vanilla/UiEditable.js +1 -1
  227. package/vanilla/UiEditor.d.ts +1 -1
  228. package/vanilla/UiEditor.js +1 -1
  229. package/vanilla/UiEditorBlockActions.d.ts +1 -1
  230. package/vanilla/UiEditorBlockActions.js +1 -1
  231. package/vanilla/UiEditorChipEditor.d.ts +1 -1
  232. package/vanilla/UiEditorChipEditor.js +1 -1
  233. package/vanilla/UiEditorCodeLanguage.d.ts +1 -1
  234. package/vanilla/UiEditorCodeLanguage.js +1 -1
  235. package/vanilla/UiEditorFootnoteEditor.d.ts +1 -1
  236. package/vanilla/UiEditorFootnoteEditor.js +1 -1
  237. package/vanilla/UiEditorFormattingTools.d.ts +1 -1
  238. package/vanilla/UiEditorFormattingTools.js +1 -1
  239. package/vanilla/UiEditorImageToolbar.d.ts +1 -1
  240. package/vanilla/UiEditorImageToolbar.js +1 -1
  241. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  242. package/vanilla/UiEditorInsertTableGrid.js +1 -1
  243. package/vanilla/UiEditorLinkCard.d.ts +1 -1
  244. package/vanilla/UiEditorLinkCard.js +1 -1
  245. package/vanilla/UiEditorLinkForm.d.ts +1 -1
  246. package/vanilla/UiEditorLinkForm.js +1 -1
  247. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  248. package/vanilla/UiEditorMentionMenu.js +1 -1
  249. package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
  250. package/vanilla/UiEditorMentionMenuItem.js +1 -1
  251. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  252. package/vanilla/UiEditorSlashMenu.js +1 -1
  253. package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
  254. package/vanilla/UiEditorSlashMenuGroup.js +1 -1
  255. package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
  256. package/vanilla/UiEditorSlashMenuItem.js +1 -1
  257. package/vanilla/UiEditorSurface.d.ts +1 -1
  258. package/vanilla/UiEditorSurface.js +1 -1
  259. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  260. package/vanilla/UiEditorTableContextMenu.js +1 -1
  261. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  262. package/vanilla/UiEditorTableOverlay.js +1 -1
  263. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  264. package/vanilla/UiEditorTableToolbar.js +1 -1
  265. package/vanilla/UiEditorToolbar.d.ts +1 -1
  266. package/vanilla/UiEditorToolbar.js +1 -1
  267. package/vanilla/UiFileInput.d.ts +36 -0
  268. package/vanilla/UiFileInput.js +209 -0
  269. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  270. package/vanilla/UiFloatingActionButton.js +1 -1
  271. package/vanilla/UiFormField.d.ts +1 -1
  272. package/vanilla/UiFormField.js +1 -1
  273. package/vanilla/UiGrid.d.ts +7 -2
  274. package/vanilla/UiGrid.js +85 -19
  275. package/vanilla/UiIcon.d.ts +2 -1
  276. package/vanilla/UiIcon.js +10 -10
  277. package/vanilla/UiIconButton.d.ts +2 -2
  278. package/vanilla/UiIconButton.js +2 -2
  279. package/vanilla/UiImage.d.ts +1 -1
  280. package/vanilla/UiImage.js +1 -1
  281. package/vanilla/UiInput.d.ts +2 -1
  282. package/vanilla/UiInput.js +11 -11
  283. package/vanilla/UiInputGroup.d.ts +1 -1
  284. package/vanilla/UiInputGroup.js +1 -1
  285. package/vanilla/UiLightEditor.d.ts +1 -1
  286. package/vanilla/UiLightEditor.js +1 -1
  287. package/vanilla/UiList.d.ts +1 -1
  288. package/vanilla/UiList.js +1 -1
  289. package/vanilla/UiListItem.d.ts +1 -1
  290. package/vanilla/UiListItem.js +1 -1
  291. package/vanilla/UiListbox.d.ts +1 -1
  292. package/vanilla/UiListbox.js +1 -1
  293. package/vanilla/UiMenu.d.ts +1 -1
  294. package/vanilla/UiMenu.js +1 -1
  295. package/vanilla/UiMenuGroup.d.ts +1 -1
  296. package/vanilla/UiMenuGroup.js +1 -1
  297. package/vanilla/UiMenuItem.d.ts +1 -1
  298. package/vanilla/UiMenuItem.js +1 -1
  299. package/vanilla/UiMeter.d.ts +1 -1
  300. package/vanilla/UiMeter.js +1 -1
  301. package/vanilla/UiNavItem.d.ts +1 -1
  302. package/vanilla/UiNavItem.js +1 -1
  303. package/vanilla/UiNumberInput.d.ts +1 -1
  304. package/vanilla/UiNumberInput.js +1 -1
  305. package/vanilla/UiPageHeader.d.ts +1 -1
  306. package/vanilla/UiPageHeader.js +1 -1
  307. package/vanilla/UiPagination.d.ts +1 -1
  308. package/vanilla/UiPagination.js +1 -1
  309. package/vanilla/UiPopover.d.ts +2 -1
  310. package/vanilla/UiPopover.js +4 -4
  311. package/vanilla/UiRadio.d.ts +1 -1
  312. package/vanilla/UiRadio.js +1 -1
  313. package/vanilla/UiRadioGroup.d.ts +1 -1
  314. package/vanilla/UiRadioGroup.js +1 -1
  315. package/vanilla/UiReel.d.ts +1 -1
  316. package/vanilla/UiReel.js +1 -1
  317. package/vanilla/UiScrollArea.d.ts +1 -1
  318. package/vanilla/UiScrollArea.js +1 -1
  319. package/vanilla/UiSearchResultRow.d.ts +1 -1
  320. package/vanilla/UiSearchResultRow.js +1 -1
  321. package/vanilla/UiSearchShell.d.ts +1 -1
  322. package/vanilla/UiSearchShell.js +1 -1
  323. package/vanilla/UiSection.d.ts +1 -1
  324. package/vanilla/UiSection.js +1 -1
  325. package/vanilla/UiSelect.d.ts +1 -1
  326. package/vanilla/UiSelect.js +1 -1
  327. package/vanilla/UiSeparator.d.ts +1 -1
  328. package/vanilla/UiSeparator.js +1 -1
  329. package/vanilla/UiSidebar.d.ts +1 -1
  330. package/vanilla/UiSidebar.js +1 -1
  331. package/vanilla/UiSiteHeader.d.ts +1 -1
  332. package/vanilla/UiSiteHeader.js +1 -1
  333. package/vanilla/UiSkeleton.d.ts +1 -1
  334. package/vanilla/UiSkeleton.js +1 -1
  335. package/vanilla/UiSlider.d.ts +1 -1
  336. package/vanilla/UiSlider.js +1 -1
  337. package/vanilla/UiSpinner.d.ts +1 -1
  338. package/vanilla/UiSpinner.js +1 -1
  339. package/vanilla/UiStack.d.ts +1 -1
  340. package/vanilla/UiStack.js +1 -1
  341. package/vanilla/UiStatusMessage.d.ts +1 -1
  342. package/vanilla/UiStatusMessage.js +1 -1
  343. package/vanilla/UiSwatch.d.ts +1 -1
  344. package/vanilla/UiSwatch.js +1 -1
  345. package/vanilla/UiSwitch.d.ts +1 -1
  346. package/vanilla/UiSwitch.js +1 -1
  347. package/vanilla/UiSwitcher.d.ts +1 -1
  348. package/vanilla/UiSwitcher.js +1 -1
  349. package/vanilla/UiTable.d.ts +1 -1
  350. package/vanilla/UiTable.js +1 -1
  351. package/vanilla/UiTabs.d.ts +1 -1
  352. package/vanilla/UiTabs.js +1 -1
  353. package/vanilla/UiText.d.ts +1 -1
  354. package/vanilla/UiText.js +1 -1
  355. package/vanilla/UiTextarea.d.ts +1 -1
  356. package/vanilla/UiTextarea.js +1 -1
  357. package/vanilla/UiTimeField.d.ts +42 -0
  358. package/vanilla/UiTimeField.js +112 -0
  359. package/vanilla/UiTimePicker.d.ts +48 -0
  360. package/vanilla/UiTimePicker.js +372 -0
  361. package/vanilla/UiToast.d.ts +1 -1
  362. package/vanilla/UiToast.js +1 -1
  363. package/vanilla/UiToastRegion.d.ts +1 -1
  364. package/vanilla/UiToastRegion.js +1 -1
  365. package/vanilla/UiTooltip.d.ts +1 -1
  366. package/vanilla/UiTooltip.js +1 -1
  367. package/vanilla/UiTopBar.d.ts +1 -1
  368. package/vanilla/UiTopBar.js +1 -1
  369. package/vanilla/UiTree.d.ts +1 -1
  370. package/vanilla/UiTree.js +1 -1
  371. package/vanilla/UiTreeItem.d.ts +1 -1
  372. package/vanilla/UiTreeItem.js +1 -1
  373. package/vanilla/index.js +7 -0
@@ -0,0 +1,213 @@
1
+ <link rel="component" href="../ui-date-field/ui-date-field.html">
2
+ <link rel="component" href="../ui-calendar/ui-calendar.html">
3
+ <link rel="component" href="../ui-time-picker/ui-time-picker.html">
4
+ <link rel="component" href="../ui-input-group/ui-input-group.html">
5
+ <link rel="component" href="../ui-icon-button/ui-icon-button.html">
6
+ <link rel="component" href="../ui-icon/ui-icon.html">
7
+ <link rel="component" href="../ui-popover/ui-popover.html">
8
+ <link rel="component" href="../ui-stack/ui-stack.html">
9
+ <link rel="component" href="../ui-text/ui-text.html">
10
+ <link rel="component" href="../ui-cluster/ui-cluster.html">
11
+ <template component="ui-date-picker" module="./ui-date-picker.js">
12
+ <defs>
13
+ <prop name="value" type="string" default=""
14
+ >Initial canonical value, and a replacement when changed externally. Valid edits update live state and emit input/change; a form reset returns to the last
15
+ external value.</prop>
16
+ <prop name="type" type="keyword" values="date, datetime-local, instant, zoned" default="date"
17
+ >The value's meaning and export format. Date is the default and exports only YYYY-MM-DD, without a time or timezone. Local date-time is a wall-clock value;
18
+ instant uses a UTC timestamp; zoned retains a named zone. Time-zone and display options alone never change this type.</prop>
19
+ <prop name="valueFormat" type="keyword" values="iso, space" default="iso"
20
+ >Local date-time bindings use T by default; space emits YYYY-MM-DD HH:mm[:ss]. Other types retain their ISO form.</prop>
21
+ <prop name="locale" type="string" default="en-US">Explicit Intl locale for numeric editing order, digits and display. ISO input is always accepted.</prop>
22
+ <prop name="timeZone" type="string" default=""
23
+ >Display/editing zone for instant values, required for localized instant editing. Zoned values otherwise use their saved zone; an override preserves that
24
+ saved zone. Required when creating a new zoned value. Date and local date-time bindings remain without a zone.</prop>
25
+ <prop name="disambiguation" type="keyword" values="reject, earlier, later, compatible" default="reject"
26
+ >How zoned edits resolve a skipped or repeated wall-clock time. Reject leaves the draft visible with a validation error.</prop>
27
+ <prop name="hourCycle" type="keyword" values="h11, h12, h23, h24">Intl hour cycle. Omit to follow locale conventions.</prop>
28
+ <prop name="granularity" type="keyword" values="minute, second" default="minute"
29
+ >Smallest displayed time unit. Existing nonzero seconds and fractions remain editable without precision loss.</prop>
30
+ <prop name="displayOptions" type="object">Intl display options while unfocused. Focusing uses the numeric editing grammar; formatting does not change the
31
+ binding. Calendar identity and editing timezone stay with the field.
32
+ <prop name="dateStyle" type="keyword" values="full, long, medium, short"></prop>
33
+ <prop name="timeStyle" type="keyword" values="full, long, medium, short"></prop>
34
+ <prop name="weekday" type="keyword" values="long, short, narrow"></prop>
35
+ <prop name="era" type="keyword" values="long, short, narrow"></prop>
36
+ <prop name="year" type="keyword" values="numeric, 2-digit"></prop>
37
+ <prop name="month" type="keyword" values="numeric, 2-digit, long, short, narrow"></prop>
38
+ <prop name="day" type="keyword" values="numeric, 2-digit"></prop>
39
+ <prop name="hour" type="keyword" values="numeric, 2-digit"></prop>
40
+ <prop name="minute" type="keyword" values="numeric, 2-digit"></prop>
41
+ <prop name="second" type="keyword" values="numeric, 2-digit"></prop>
42
+ <prop name="timeZoneName" type="keyword" values="long, short, shortOffset, longOffset, shortGeneric, longGeneric"></prop>
43
+ <prop name="dayPeriod" type="keyword" values="long, short, narrow"></prop>
44
+ <prop name="hourCycle" type="keyword" values="h11, h12, h23, h24"></prop>
45
+ <prop name="localeMatcher" type="string" values="lookup, best fit"></prop>
46
+ <prop name="formatMatcher" type="string" values="basic, best fit"></prop>
47
+ <prop name="fractionalSecondDigits" type="integer" min="1" max="3"></prop>
48
+ <prop name="hour12" type="boolean"></prop>
49
+ <prop name="numberingSystem" type="string"></prop>
50
+ </prop>
51
+ <prop name="min" type="string" default="">Inclusive minimum in the bound value's format.</prop>
52
+ <prop name="max" type="string" default="">Inclusive maximum in the bound value's format.</prop>
53
+ <prop name="disabledDates" type="list(string)" default="[]">Unavailable ISO dates, applied in the editing zone for exact values.</prop>
54
+ <prop name="disabledRanges" type="list" default="[]">Unavailable inclusive ISO-date intervals.<prop type="object"><prop
55
+ name="start"
56
+ type="string"
57
+ required
58
+ ></prop><prop name="end" type="string" required></prop></prop></prop>
59
+ <prop name="disabledWeekdays" type="list(integer)" default="[]">Unavailable ISO weekdays, from 1 (Monday) to 7 (Sunday).</prop>
60
+ <prop name="allowedDates" type="list(string)"
61
+ >Allowed ISO dates, unioned with allowedRanges. Omission imposes no allow restriction; an explicitly empty allow set permits nothing.</prop>
62
+ <prop name="allowedRanges" type="list">Allowed inclusive ISO-date intervals, unioned with allowedDates.<prop type="object"><prop
63
+ name="start"
64
+ type="string"
65
+ required
66
+ ></prop><prop name="end" type="string" required></prop></prop></prop>
67
+ <prop name="name" type="string" default="">Native form field name. The enhanced field submits its canonical value.</prop>
68
+ <prop name="form" type="string" default="">Optional ID of a form outside this component’s ancestor tree.</prop>
69
+ <prop name="inputId" type="string" default="">ID of the active native input for an authored label's for attribute, preserved across upgrade.</prop>
70
+ <prop name="label" type="string" default=""
71
+ >Optional accessible name. Prefer an authored visible label associated with input-id; a supplied label overrides that name.</prop>
72
+ <prop name="size" type="keyword" values="sm, md, lg" default="md">Input's shared size scale.</prop>
73
+ <prop name="placeholder" type="string" default="">Optional editing hint. A placeholder never replaces the label.</prop>
74
+ <prop name="disabled" type="boolean" default="false">Prevents editing and omits the value from submission.</prop>
75
+ <prop name="readonly" type="boolean" default="false">Retains selection and submission while preventing edits.</prop>
76
+ <prop name="required" type="boolean" default="false">Requires a complete value.</prop>
77
+ <prop name="invalid" type="boolean" default="false">External invalid state, independent of parsing and availability.</prop>
78
+ <prop name="today" type="string" default="">Optional YYYY-MM-DD date to mark as today in the calendar.</prop>
79
+ <prop name="weekStartsOn" type="integer" min="1" max="7"
80
+ >Week order override using ISO weekdays: Sunday 7, Saturday 6, or Monday 1. Omission follows the locale's week information, with Sunday as the fallback when
81
+ unavailable.</prop>
82
+ <prop name="pickerLabel" type="string" default="Choose date">Accessible name of the calendar action and its dialog.</prop>
83
+ <prop name="timeLabel" type="string" default="Time">Label of the time field.</prop>
84
+ <prop name="monthLabel" type="string" default="Choose month">Accessible name of the month navigation toggle.</prop>
85
+ <prop name="yearLabel" type="string" default="Choose year">Accessible name of the year navigation toggle and direct year input.</prop>
86
+ <prop name="previousLabel" type="string" default="Previous">Accessible name of the previous-page action.</prop>
87
+ <prop name="nextLabel" type="string" default="Next">Accessible name of the next-page action.</prop>
88
+ <prop
89
+ name="model"
90
+ type="object({ date: string, time: string, minDate: string, maxDate: string, weekStartsOn: integer, allowedDates: list(string), allowedRanges: list(object({ start: string, end: string })) })"
91
+ >Server-prepared civil date/time projection owned by the component module.</prop>
92
+ <state name="current" type="string" from="$value"></state>
93
+ <state name="draftDate" type="string" value=""></state>
94
+ <state name="draftTime" type="string" value=""></state>
95
+ <state name="enhanced" type="boolean" value="false"></state>
96
+ <state name="opened" type="boolean" value="false"></state>
97
+ <state name="fieldBlocked" type="boolean" value="false"></state>
98
+ <state name="anchorId" type="string" value=""></state>
99
+ <state name="error" type="string" value=""></state>
100
+ <event name="input" type="object"><prop name="value" type="string" required></prop><prop
101
+ name="trigger"
102
+ type="keyword"
103
+ values="keyboard, pointer, programmatic"
104
+ required
105
+ ></prop></event>
106
+ <event name="change" type="object"><prop name="value" type="string" required></prop><prop
107
+ name="trigger"
108
+ type="keyword"
109
+ values="keyboard, pointer, programmatic"
110
+ required
111
+ ></prop></event>
112
+ <event name="query-change" type="object"><prop name="query" type="string" required></prop></event>
113
+ <event name="validation-change" type="object"><prop name="invalid" type="boolean" required></prop><prop
114
+ name="message"
115
+ type="string"
116
+ required
117
+ ></prop></event>
118
+ <event name="open" type="object"><prop name="open" type="boolean" required></prop><prop
119
+ name="reason"
120
+ type="keyword"
121
+ values="action, programmatic, light-dismiss, escape"
122
+ required
123
+ ></prop><prop name="trigger" type="keyword" values="keyboard, pointer, programmatic" required></prop></event>
124
+ <event name="close" type="object"><prop name="open" type="boolean" required></prop><prop
125
+ name="reason"
126
+ type="keyword"
127
+ values="action, programmatic, light-dismiss, escape"
128
+ required
129
+ ></prop><prop name="trigger" type="keyword" values="keyboard, pointer, programmatic" required></prop></event>
130
+ </defs>
131
+ <span>
132
+ <ui-input-group from:disabled="$disabled">
133
+ <ui-date-field
134
+ data-picker-field
135
+ from:value="$current"
136
+ from:type="$type"
137
+ from:value-format="$valueFormat"
138
+ from:locale="$locale"
139
+ from:time-zone="$timeZone"
140
+ from:disambiguation="$disambiguation"
141
+ from:hour-cycle="$hourCycle"
142
+ from:granularity="$granularity"
143
+ from:display-options="$displayOptions"
144
+ from:min="$min"
145
+ from:max="$max"
146
+ from:allowed-dates="$allowedDates"
147
+ from:allowed-ranges="$allowedRanges"
148
+ from:disabled-dates="$disabledDates"
149
+ from:disabled-ranges="$disabledRanges"
150
+ from:disabled-weekdays="$disabledWeekdays"
151
+ from:name="$name"
152
+ from:form="$form"
153
+ from:input-id="$inputId"
154
+ from:label="$label"
155
+ from:size="$size"
156
+ from:placeholder="$placeholder"
157
+ from:disabled="$disabled"
158
+ from:readonly="$readonly"
159
+ from:required="$required"
160
+ from:invalid="$invalid"
161
+ ></ui-date-field>
162
+ <ui-icon-button
163
+ data-picker-trigger
164
+ slot="action"
165
+ from:id="$anchorId"
166
+ from:hidden="not $enhanced"
167
+ from:size="$size"
168
+ variant="ghost"
169
+ from:label="$pickerLabel"
170
+ from:disabled="$disabled or $readonly or $fieldBlocked"
171
+ aria-haspopup="dialog"
172
+ ><ui-icon name="calendar"></ui-icon></ui-icon-button>
173
+ </ui-input-group>
174
+ <ui-popover data-picker-popover size="sm" from:for="$anchorId" from:open="$opened" role="dialog" from:aria-label="$pickerLabel">
175
+ <ui-stack gap="s">
176
+ <ui-calendar
177
+ data-picker-calendar
178
+ from:value="$opened ? $draftDate : $model.date"
179
+ from:min="$model.minDate"
180
+ from:max="$model.maxDate"
181
+ from:allowed-dates="$model.allowedDates"
182
+ from:allowed-ranges="$model.allowedRanges"
183
+ from:week-starts-on="$model.weekStartsOn"
184
+ from:label="$pickerLabel"
185
+ from:locale="$locale"
186
+ from:today="$today"
187
+ from:disabled-dates="$disabledDates"
188
+ from:disabled-ranges="$disabledRanges"
189
+ from:disabled-weekdays="$disabledWeekdays"
190
+ from:month-label="$monthLabel"
191
+ from:year-label="$yearLabel"
192
+ from:previous-label="$previousLabel"
193
+ from:next-label="$nextLabel"
194
+ ></ui-calendar>
195
+ <ui-cluster gap="s" align="center" justify="between" wrap="nowrap" from:hidden="$type = 'date'">
196
+ <ui-text as="label" variant="label" from:for="{ true: concat($anchorId, '-time'), false: null }[concat($anchorId != '')]">{$timeLabel}</ui-text>
197
+ <ui-cluster fixed><ui-time-picker
198
+ data-picker-time
199
+ from:input-id="{ true: concat($anchorId, '-time'), false: null }[concat($anchorId != '')]"
200
+ from:label="$timeLabel"
201
+ from:value="$opened ? $draftTime : $model.time"
202
+ from:locale="$locale"
203
+ from:hour-cycle="$hourCycle"
204
+ from:granularity="$granularity"
205
+ from:disabled="not $opened or $type = 'date'"
206
+ size="sm"
207
+ ></ui-time-picker></ui-cluster>
208
+ </ui-cluster>
209
+ <ui-text tone="danger" role="alert" from:hidden="$error = ''">{$error}</ui-text>
210
+ </ui-stack>
211
+ </ui-popover>
212
+ </span>
213
+ </template>
@@ -0,0 +1,153 @@
1
+ import { preparedModule } from "../shared/prepared-module.js";
2
+ import { componentInputs } from "@nextwebwg/html-next/inputs";
3
+ import { calendarWeekStart, isValueAllowed } from "../shared/date-time.js";
4
+ import { pickerParts, replacePickerParts } from "../shared/date-picker.js";
5
+ import { afterFormReset } from "../shared/form-reset.js";
6
+ import { externalValueTracker } from "../shared/external-value.js";
7
+ import { readOptionalInput } from "../shared/binding-inputs.js";
8
+ import { initialFieldValue } from "../shared/initial-field-value.js";
9
+
10
+ const optionNames = ["type", "valueFormat", "timeZone", "disambiguation", "min", "max", "allowedDates", "allowedRanges", "disabledDates", "disabledRanges", "disabledWeekdays"];
11
+
12
+ /** Commit calendar and clock choices directly to the typed field and canonical form value. */
13
+ function interactions(host) {
14
+ const element = host.element;
15
+ const field = element.querySelector("[data-picker-field]");
16
+ const control = field.querySelector("[data-date-editor]");
17
+ const trigger = element.querySelector("[data-picker-trigger]");
18
+ const popover = element.querySelector("[data-picker-popover]");
19
+ const calendar = element.querySelector("[data-picker-calendar]");
20
+ const time = element.querySelector("[data-picker-time]");
21
+ const clock = time.querySelector("[data-date-editor]");
22
+ let current = host.state.current ?? host.props.value.value ?? "";
23
+ const externalChanged = externalValueTracker(element, { initialValue: host.props.value.value });
24
+ let connected = true;
25
+ let frame;
26
+ const settings = () => Object.fromEntries(optionNames.map(name => [name, host.props[name].value]));
27
+ const initial = initialFieldValue(field, { ...settings(), locale: host.props.locale.value });
28
+ try {
29
+ if (initial !== undefined && initial !== current && (initial || !host.props.required.value) && isValueAllowed(initial, settings())) {
30
+ current = initial; host.state.current = current;
31
+ }
32
+ } catch { /* The field retains an invalid native draft for correction. */ }
33
+ const blocked = () => host.props.disabled.value || host.props.readonly.value || control.matches(":disabled, :read-only");
34
+ const close = restore => {
35
+ host.state.opened = false; host.state.error = "";
36
+ if (restore) {
37
+ cancelAnimationFrame(frame);
38
+ frame = requestAnimationFrame(() => { if (connected) trigger.focus(); });
39
+ }
40
+ };
41
+ const seed = () => {
42
+ const parts = pickerParts(current, settings());
43
+ host.state.draftDate = parts.date;
44
+ host.state.draftTime = parts.time || "00:00";
45
+ host.state.error = "";
46
+ };
47
+ const relay = event => {
48
+ if (!(event instanceof CustomEvent)) return;
49
+ event.stopPropagation();
50
+ if (event.type === "input" || event.type === "change") { current = event.detail.value; host.state.current = current; }
51
+ host.dispatch(event.type, event.detail);
52
+ };
53
+ const overlay = event => {
54
+ if (!(event instanceof CustomEvent) || event.target !== popover) return;
55
+ event.stopPropagation();
56
+ if (event.type === "open") {
57
+ if (blocked()) { close(); return; }
58
+ try { seed(); } catch (error) { host.state.error = error.message; }
59
+ host.state.opened = true;
60
+ queueMicrotask(() => {
61
+ if (connected && host.state.opened && element.ownerDocument.activeElement !== clock) time.dispatchEvent(new CustomEvent("set-value", { cancelable: true, detail: { value: host.state.draftTime } }));
62
+ });
63
+ cancelAnimationFrame(frame);
64
+ frame = requestAnimationFrame(() => {
65
+ if (!connected || !host.state.opened || popover.contains(element.ownerDocument.activeElement)) return;
66
+ const date = host.state.draftDate || host.props.today.value;
67
+ if (date) calendar.dispatchEvent(new CustomEvent("focus-date", { detail: { value: date } }));
68
+ else calendar.querySelector('[data-calendar-day][tabindex="0"], [data-calendar-days][tabindex="0"]')?.focus();
69
+ });
70
+ } else close(event.detail.reason === "escape");
71
+ host.dispatch(event.type, event.detail);
72
+ };
73
+ const select = event => {
74
+ event.stopPropagation();
75
+ if (event instanceof CustomEvent && !blocked()) {
76
+ host.state.draftDate = event.detail.value; host.state.error = "";
77
+ accept(event.detail.trigger, host.props.type.value === "date");
78
+ }
79
+ };
80
+ const draft = event => {
81
+ event.stopPropagation();
82
+ if (event instanceof CustomEvent && time.contains(event.target) && (event.type === "input" || event.type === "change")) {
83
+ host.state.draftTime = event.detail.value;
84
+ if (host.state.draftDate) accept(event.detail.trigger, false);
85
+ }
86
+ };
87
+ const accept = (trigger, dismiss) => {
88
+ if (blocked() || !host.state.opened) return;
89
+ try {
90
+ if (host.props.type.value !== "date") {
91
+ time.dispatchEvent(new Event("validate"));
92
+ if (!clock.checkValidity()) throw new RangeError("Enter a complete, available time.");
93
+ }
94
+ const options = settings();
95
+ const value = replacePickerParts(current, host.state.draftDate, host.state.draftTime, options);
96
+ if (!isValueAllowed(value, options)) throw new RangeError("Choose an available value within the permitted range.");
97
+ if (!field.dispatchEvent(new CustomEvent("set-value", { cancelable: true, detail: { value, trigger } }))) return;
98
+ host.state.error = "";
99
+ if (dismiss) close(true);
100
+ } catch (error) { host.state.error = error.message; }
101
+ };
102
+ const request = event => {
103
+ if (event.target !== element) return;
104
+ if (!field.dispatchEvent(event instanceof CustomEvent ? new CustomEvent(event.type, { cancelable: event.cancelable, detail: event.detail }) : new Event(event.type))) event.preventDefault();
105
+ };
106
+ const mutability = () => { host.state.fieldBlocked = blocked(); if (blocked()) close(); };
107
+ const observer = new MutationObserver(mutability);
108
+ observer.observe(control, { attributes: true, attributeFilter: ["disabled", "readonly"] });
109
+ mutability();
110
+ const fieldEvents = ["input", "change", "query-change", "validation-change"];
111
+ for (const name of fieldEvents) field.addEventListener(name, relay);
112
+ for (const name of ["open", "close"]) popover.addEventListener(name, overlay);
113
+ for (const name of fieldEvents) popover.addEventListener(name, draft);
114
+ calendar.addEventListener("select", select);
115
+ for (const name of ["validate", "set-value"]) element.addEventListener(name, request);
116
+ if (!host.state.anchorId) host.state.anchorId = `ui-date-picker-${Math.random().toString(36).slice(2, 11)}`;
117
+ const stop = host.effect(() => {
118
+ const value = host.props.value.value;
119
+ if (externalChanged(value)) { current = value ?? ""; host.state.current = current; if (host.state.opened) seed(); }
120
+ host.state.enhanced = Boolean(host.props.model.value);
121
+ if (blocked()) close();
122
+ });
123
+ const reset = afterFormReset(control, () => { current = host.props.value.value ?? ""; host.state.current = current; close(); });
124
+ return () => {
125
+ connected = false; cancelAnimationFrame(frame); observer.disconnect(); stop(); reset(); close(); host.state.enhanced = false;
126
+ for (const name of fieldEvents) field.removeEventListener(name, relay);
127
+ for (const name of ["open", "close"]) popover.removeEventListener(name, overlay);
128
+ for (const name of fieldEvents) popover.removeEventListener(name, draft);
129
+ calendar.removeEventListener("select", select);
130
+ for (const name of ["validate", "set-value"]) element.removeEventListener(name, request);
131
+ };
132
+ }
133
+
134
+ /** Prepare civil parts before rendering and retain their producer ownership through hydration. */
135
+ export const { connect, prepare, adopt } = preparedModule(host => {
136
+ const inputs = componentInputs(host);
137
+ return {
138
+ props: { model: {
139
+ input: (props, { state }) => ({ value: state.current, type: props.type, valueFormat: props.valueFormat, locale: props.locale, timeZone: props.timeZone, min: props.min, max: props.max,
140
+ ...Object.fromEntries(["weekStartsOn", "allowedDates", "allowedRanges"].map(name => [name, readOptionalInput(inputs, props, name)]).filter(([, value]) => value !== undefined)),
141
+ }),
142
+ load(options) {
143
+ const parts = pickerParts(options.value, options);
144
+ return { ...parts, minDate: pickerParts(options.min, options).date, maxDate: pickerParts(options.max, options).date,
145
+ weekStartsOn: calendarWeekStart(options.locale, options.weekStartsOn),
146
+ allowedDates: options.allowedDates ?? [],
147
+ allowedRanges: options.allowedRanges ?? (options.allowedDates === undefined ? [{ start: "0001-01-01", end: "9999-12-31" }] : []),
148
+ };
149
+ },
150
+ } },
151
+ connect: interactions,
152
+ };
153
+ });
@@ -0,0 +1,202 @@
1
+ <link rel="component" href="../ui-date-field/ui-date-field.html">
2
+ <link rel="component" href="../ui-calendar/ui-calendar.html">
3
+ <link rel="component" href="../ui-form-field/ui-form-field.html">
4
+ <link rel="component" href="../ui-input-group/ui-input-group.html">
5
+ <link rel="component" href="../ui-icon-button/ui-icon-button.html">
6
+ <link rel="component" href="../ui-icon/ui-icon.html">
7
+ <link rel="component" href="../ui-popover/ui-popover.html">
8
+ <link rel="component" href="../ui-stack/ui-stack.html">
9
+ <link rel="component" href="../ui-grid/ui-grid.html">
10
+ <link rel="component" href="../ui-text/ui-text.html">
11
+ <template component="ui-date-range-picker" module="./ui-date-range-picker.js">
12
+ <defs>
13
+ <prop name="value" type="object({ start: string, end: string })" default="{ start: '', end: '' }"
14
+ >Initial inclusive date range, replaced on external changes. Each endpoint is YYYY-MM-DD, without a time or timezone. A complete accepted edit emits both
15
+ endpoints together. Reset restores this external value.</prop>
16
+ <prop name="locale" type="string" default="en-US"
17
+ >Intl Gregorian editing order, digits, labels and default week order. ISO date paste is always accepted.</prop>
18
+ <prop name="displayOptions" type="object">Intl date display options while fields are unfocused. Focus restores numeric entry; canonical endpoints remain
19
+ YYYY-MM-DD.
20
+ <prop name="dateStyle" type="keyword" values="full, long, medium, short"></prop>
21
+ <prop name="weekday" type="keyword" values="long, short, narrow"></prop>
22
+ <prop name="year" type="keyword" values="numeric, 2-digit"></prop>
23
+ <prop name="month" type="keyword" values="numeric, 2-digit, long, short, narrow"></prop>
24
+ <prop name="day" type="keyword" values="numeric, 2-digit"></prop>
25
+ <prop name="era" type="keyword" values="long, short, narrow"></prop>
26
+ <prop name="numberingSystem" type="string"></prop>
27
+ <prop name="localeMatcher" type="string" values="lookup, best fit"></prop>
28
+ <prop name="formatMatcher" type="string" values="basic, best fit"></prop>
29
+ </prop>
30
+ <prop name="min" type="string" default="">Inclusive earliest YYYY-MM-DD endpoint.</prop>
31
+ <prop name="max" type="string" default="">Inclusive latest YYYY-MM-DD endpoint.</prop>
32
+ <prop name="allowedDates" type="list(string)"
33
+ >Allowed ISO dates, unioned with allowed-ranges. Omission is unrestricted; an explicit empty allow set permits nothing.</prop>
34
+ <prop name="allowedRanges" type="list(object({ start: string, end: string }))">Inclusive allowed date intervals, unioned with allowed-dates.</prop>
35
+ <prop name="disabledDates" type="list(string)" default="[]">Unavailable ISO dates, subtracted after bounds and allowed rules.</prop>
36
+ <prop name="disabledRanges" type="list(object({ start: string, end: string }))" default="[]">Inclusive unavailable date intervals.</prop>
37
+ <prop name="disabledWeekdays" type="list(integer)" default="[]">Unavailable ISO weekdays: Monday 1 through Sunday 7.</prop>
38
+ <prop name="allowUnavailableWithinRange" type="boolean" default="false"
39
+ >Allows crossing unavailable interior dates. Both endpoints must still be available.</prop>
40
+ <prop name="weekStartsOn" type="integer" min="1" max="7">ISO week order override. Omission follows the locale, falling back to Sunday (7).</prop>
41
+ <prop name="today" type="string" default="">Optional explicit YYYY-MM-DD date to mark as today.</prop>
42
+ <prop name="startName" type="string" default="">Native form name for the start date.</prop>
43
+ <prop name="endName" type="string" default="">Native form name for the end date.</prop>
44
+ <prop name="startInputId" type="string" default="">ID for the start field and its visible label, including before JavaScript.</prop>
45
+ <prop name="endInputId" type="string" default="">ID for the end field and its visible label, including before JavaScript.</prop>
46
+ <prop name="form" type="string" default="">Optional ID of a form outside this component's ancestor tree.</prop>
47
+ <prop name="size" type="keyword" values="sm, md, lg" default="md">Shared input and action size.</prop>
48
+ <prop name="disabled" type="boolean" default="false">Prevents editing and omits both endpoints from submission.</prop>
49
+ <prop name="readonly" type="boolean" default="false">Retains selection and submission while preventing edits.</prop>
50
+ <prop name="required" type="boolean" default="false">Requires both endpoints. A partially entered optional range also requires its missing endpoint.</prop>
51
+ <prop name="invalid" type="boolean" default="false">External invalid appearance supplied by the application.</prop>
52
+ <prop name="label" type="string" default="Date range">Accessible name of the range group.</prop>
53
+ <prop name="startLabel" type="string" default="Start date">Visible label of the start field.</prop>
54
+ <prop name="endLabel" type="string" default="End date">Visible label of the end field.</prop>
55
+ <prop name="pickerLabel" type="string" default="Choose date range">Accessible name of the picker dialog and actions.</prop>
56
+ <prop name="monthLabel" type="string" default="Choose month">Accessible name of the month navigation toggle.</prop>
57
+ <prop name="yearLabel" type="string" default="Choose year">Accessible name of year navigation and direct year entry.</prop>
58
+ <prop name="previousLabel" type="string" default="Previous">Accessible name of the previous-page action.</prop>
59
+ <prop name="nextLabel" type="string" default="Next">Accessible name of the next-page action.</prop>
60
+ <prop
61
+ name="model"
62
+ type="object({ startRanges: list(object({ start: string, end: string })), endRanges: list(object({ start: string, end: string })), calendarRanges: list(object({ start: string, end: string })), weekStartsOn: integer })"
63
+ >Server-prepared endpoint availability, owned by the component module's producer.</prop>
64
+ <state name="current" type="object({ start: string, end: string })" from="$value"></state>
65
+ <state name="draft" type="object({ start: string, end: string })" from="$value"></state>
66
+ <state name="selection" type="object({ start: string, end: string })" value="{ start: '', end: '' }"></state>
67
+ <state name="preview" type="object({ start: string, end: string })" value="{ start: '', end: '' }"></state>
68
+ <state name="anchor" type="string" value=""></state>
69
+ <state name="mode" type="string" value="range"></state>
70
+ <state name="popupValue" type="string" value=""></state>
71
+ <state name="enhanced" type="boolean" value="false"></state>
72
+ <state name="opened" type="boolean" value="false"></state>
73
+ <state name="idPrefix" type="string" value=""></state>
74
+ <state name="activeAnchor" type="string" value=""></state>
75
+ <state name="blocked" type="boolean" value="false"></state>
76
+ <state name="error" type="string" value=""></state>
77
+ <event name="input" type="object"><prop name="value" type="object({ start: string, end: string })" required></prop><prop
78
+ name="trigger"
79
+ type="keyword"
80
+ values="keyboard, pointer, programmatic"
81
+ required
82
+ ></prop></event>
83
+ <event name="change" type="object"><prop name="value" type="object({ start: string, end: string })" required></prop><prop
84
+ name="trigger"
85
+ type="keyword"
86
+ values="keyboard, pointer, programmatic"
87
+ required
88
+ ></prop></event>
89
+ <event name="query-change" type="object"><prop name="endpoint" type="keyword" values="start, end" required></prop><prop
90
+ name="query"
91
+ type="string"
92
+ required
93
+ ></prop></event>
94
+ <event name="validation-change" type="object"><prop name="invalid" type="boolean" required></prop><prop name="message" type="string" required></prop><prop
95
+ name="endpoint"
96
+ type="keyword"
97
+ values="start, end"
98
+ ></prop></event>
99
+ <event name="open" type="object"><prop name="open" type="boolean" required></prop><prop
100
+ name="reason"
101
+ type="keyword"
102
+ values="action, programmatic, light-dismiss, escape"
103
+ required
104
+ ></prop><prop name="trigger" type="keyword" values="keyboard, pointer, programmatic" required></prop></event>
105
+ <event name="close" type="object"><prop name="open" type="boolean" required></prop><prop
106
+ name="reason"
107
+ type="keyword"
108
+ values="action, programmatic, light-dismiss, escape"
109
+ required
110
+ ></prop><prop name="trigger" type="keyword" values="keyboard, pointer, programmatic" required></prop></event>
111
+ </defs>
112
+ <span role="group" from:aria-label="$label">
113
+ <ui-stack gap="s">
114
+ <ui-grid columns="2" gap="s">
115
+ <template $each="endpoint of ['start', 'end']" $key="$endpoint">
116
+ <ui-form-field from:disabled="$disabled" from:required="$required or $draft.start != '' or $draft.end != ''" from:invalid="$invalid">
117
+ <ui-text slot="label" as="label" variant="label" from:for="{ start: $startInputId, end: $endInputId }[$endpoint]"
118
+ >{{ start: $startLabel, end: $endLabel }[$endpoint]}</ui-text>
119
+ <ui-input-group from:disabled="$disabled">
120
+ <ui-date-field
121
+ from:data-range-field="$endpoint"
122
+ from:value="$draft[$endpoint]"
123
+ from:label="{ start: $startLabel, end: $endLabel }[$endpoint]"
124
+ from:input-id="{ start: $startInputId, end: $endInputId }[$endpoint]"
125
+ from:name="{ true: '', false: { start: $startName, end: $endName }[$endpoint] }[concat($enhanced)]"
126
+ from:form="$form"
127
+ from:locale="$locale"
128
+ from:display-options="$displayOptions"
129
+ from:size="$size"
130
+ from:min="$min"
131
+ from:max="$max"
132
+ from:allowed-ranges="{ start: $model.startRanges, end: $model.endRanges }[$endpoint]"
133
+ from:disabled-dates="$disabledDates"
134
+ from:disabled-ranges="$disabledRanges"
135
+ from:disabled-weekdays="$disabledWeekdays"
136
+ from:disabled="$disabled"
137
+ from:readonly="$readonly"
138
+ from:required="$required or $draft.start != '' or $draft.end != ''"
139
+ from:invalid="$invalid"
140
+ ></ui-date-field>
141
+ <ui-icon-button
142
+ slot="action"
143
+ from:data-range-trigger="$endpoint"
144
+ from:id="{ true: concat($idPrefix, '-', $endpoint), false: null }[concat($idPrefix != '')]"
145
+ from:label="concat($pickerLabel, ': ', { start: $startLabel, end: $endLabel }[$endpoint])"
146
+ from:hidden="not $enhanced"
147
+ from:size="$size"
148
+ variant="ghost"
149
+ from:disabled="$disabled or $readonly or $blocked"
150
+ aria-haspopup="dialog"
151
+ from:aria-expanded="$opened and $activeAnchor = concat($idPrefix, '-', $endpoint)"
152
+ ><ui-icon name="calendar"></ui-icon></ui-icon-button>
153
+ </ui-input-group>
154
+ </ui-form-field>
155
+ </template>
156
+ </ui-grid>
157
+ <ui-text data-range-error tone="danger" role="alert" from:hidden="$error = '' or $opened">{$error}</ui-text>
158
+ </ui-stack>
159
+ <input
160
+ data-range-value="start"
161
+ type="hidden"
162
+ from:name="$startName"
163
+ from:form="{ true: $form, false: null }[concat($form != '')]"
164
+ from:value="$current.start"
165
+ from:disabled="not $enhanced or $disabled"
166
+ >
167
+ <input
168
+ data-range-value="end"
169
+ type="hidden"
170
+ from:name="$endName"
171
+ from:form="{ true: $form, false: null }[concat($form != '')]"
172
+ from:value="$current.end"
173
+ from:disabled="not $enhanced or $disabled"
174
+ >
175
+ <ui-popover data-range-popover trigger="manual" size="sm" from:for="$activeAnchor" from:open="$opened" role="dialog" from:aria-label="$pickerLabel">
176
+ <ui-stack gap="s">
177
+ <ui-calendar
178
+ data-range-calendar
179
+ from:value="{ true: $popupValue, false: $current.start }[concat($opened)]"
180
+ from:start="{ true: $preview.start, false: $current.start }[concat($opened)]"
181
+ from:end="{ true: $preview.end, false: $current.end }[concat($opened)]"
182
+ from:allowed-ranges="$model.calendarRanges"
183
+ from:min="$min"
184
+ from:max="$max"
185
+ from:disabled-dates="$disabledDates"
186
+ from:disabled-ranges="$disabledRanges"
187
+ from:disabled-weekdays="$disabledWeekdays"
188
+ from:week-starts-on="$model.weekStartsOn"
189
+ from:locale="$locale"
190
+ from:today="$today"
191
+ from:label="$pickerLabel"
192
+ from:month-label="$monthLabel"
193
+ from:year-label="$yearLabel"
194
+ from:previous-label="$previousLabel"
195
+ from:next-label="$nextLabel"
196
+ from:disabled="not $opened or $disabled or $readonly"
197
+ ></ui-calendar>
198
+ <ui-text data-range-popup-error tone="danger" role="alert" from:hidden="$error = ''">{$error}</ui-text>
199
+ </ui-stack>
200
+ </ui-popover>
201
+ </span>
202
+ </template>