tandd-ui 0.2.6 → 0.2.8

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 (144) hide show
  1. package/CHANGELOG.md +38 -1
  2. package/README.md +5 -1
  3. package/dist/components/_shared/nextFrame.d.ts +11 -0
  4. package/dist/components/_shared/useFieldValidation.d.ts +2 -1
  5. package/dist/components/alert/DTAlert.vue.d.ts +2 -2
  6. package/dist/components/autocomplete/DTAutocomplete.vue.d.ts +4 -0
  7. package/dist/components/card/DTCard.vue.d.ts +1 -1
  8. package/dist/components/card/DTCardMedia.vue.d.ts +1 -1
  9. package/dist/components/checkbox/DTCheckbox.vue.d.ts +11 -2
  10. package/dist/components/date-picker/DTDateInput.vue.d.ts +7 -0
  11. package/dist/components/date-picker/DTDatePicker.vue.d.ts +7 -4
  12. package/dist/components/date-time-picker/DTDateTimeInput.vue.d.ts +4 -0
  13. package/dist/components/file-input/DTFileInput.vue.d.ts +4 -0
  14. package/dist/components/form/DTForm.vue.d.ts +67 -0
  15. package/dist/components/form/formContext.d.ts +24 -0
  16. package/dist/components/form/useFormField.d.ts +42 -0
  17. package/dist/components/list/DTListGroup.vue.d.ts +35 -0
  18. package/dist/components/mention/DTMention.vue.d.ts +4 -0
  19. package/dist/components/modal/modalStack.d.ts +6 -0
  20. package/dist/components/number-input/DTNumberInput.vue.d.ts +4 -0
  21. package/dist/components/radio/DTRadioGroup.vue.d.ts +11 -2
  22. package/dist/components/select/DTSelect.vue.d.ts +8 -0
  23. package/dist/components/sortable/DTSortable.vue.d.ts +70 -0
  24. package/dist/components/sortable/sortableGroups.d.ts +41 -0
  25. package/dist/components/splitter/DTSplitter.vue.d.ts +48 -0
  26. package/dist/components/switch/DTSwitch.vue.d.ts +11 -0
  27. package/dist/components/text-field/DTInput.vue.d.ts +6 -2
  28. package/dist/components/text-field/fieldShared.d.ts +18 -3
  29. package/dist/components/textarea/DTTextarea.vue.d.ts +6 -2
  30. package/dist/components/time-picker/DTTimeInput.vue.d.ts +4 -0
  31. package/dist/components/toast/toastStore.d.ts +1 -1
  32. package/dist/components/virtual-scroll/DTVirtualScroll.vue.d.ts +58 -0
  33. package/dist/index.d.ts +10 -0
  34. package/dist/locale/en.d.ts +17 -0
  35. package/dist/locale/en.js +3 -0
  36. package/dist/locale/messages.d.ts +17 -0
  37. package/dist/locale/vi.d.ts +17 -0
  38. package/dist/locale/vi.js +3 -0
  39. package/dist/styles/accordion.css +177 -0
  40. package/dist/styles/alert.css +750 -0
  41. package/dist/styles/anchor.css +120 -0
  42. package/dist/styles/app-bar.css +1333 -0
  43. package/dist/styles/autocomplete.css +2100 -0
  44. package/dist/styles/avatar.css +153 -0
  45. package/dist/styles/badge.css +862 -0
  46. package/dist/styles/base.css +383 -0
  47. package/dist/styles/border-beam.css +57 -0
  48. package/dist/styles/breadcrumb.css +120 -0
  49. package/dist/styles/button-group.css +517 -0
  50. package/dist/styles/button.css +517 -0
  51. package/dist/styles/card.css +365 -0
  52. package/dist/styles/carousel.css +272 -0
  53. package/dist/styles/checkbox.css +457 -0
  54. package/dist/styles/chip.css +784 -0
  55. package/dist/styles/code.css +10 -0
  56. package/dist/styles/col.css +128 -0
  57. package/dist/styles/color-input.css +1818 -0
  58. package/dist/styles/color-picker.css +1818 -0
  59. package/dist/styles/combobox.css +2100 -0
  60. package/dist/styles/container.css +20 -0
  61. package/dist/styles/data-table.css +2692 -0
  62. package/dist/styles/date-picker.css +1309 -0
  63. package/dist/styles/date-time-picker.css +1574 -0
  64. package/dist/styles/divider.css +61 -0
  65. package/dist/styles/empty-state.css +183 -0
  66. package/dist/styles/field-control.css +293 -0
  67. package/dist/styles/field.css +69 -0
  68. package/dist/styles/file-input.css +1427 -0
  69. package/dist/styles/file-upload.css +1794 -0
  70. package/dist/styles/form.css +62 -0
  71. package/dist/styles/grid.css +330 -0
  72. package/dist/styles/heading.css +9 -0
  73. package/dist/styles/icon.css +62 -0
  74. package/dist/styles/infinite-scroll.css +589 -0
  75. package/dist/styles/inline.css +17 -0
  76. package/dist/styles/kbd.css +17 -0
  77. package/dist/styles/layout-app.css +56 -0
  78. package/dist/styles/link.css +34 -0
  79. package/dist/styles/list.css +369 -0
  80. package/dist/styles/manifest.json +350 -0
  81. package/dist/styles/mention.css +2041 -0
  82. package/dist/styles/menu.css +305 -0
  83. package/dist/styles/modal.css +275 -0
  84. package/dist/styles/navigation-drawer.css +2006 -0
  85. package/dist/styles/number-input.css +709 -0
  86. package/dist/styles/otp-input.css +187 -0
  87. package/dist/styles/pagination.css +165 -0
  88. package/dist/styles/popover.css +419 -0
  89. package/dist/styles/progress.css +196 -0
  90. package/dist/styles/pull-refresh.css +674 -0
  91. package/dist/styles/radio.css +457 -0
  92. package/dist/styles/rating.css +211 -0
  93. package/dist/styles/row.css +71 -0
  94. package/dist/styles/select.css +1540 -0
  95. package/dist/styles/sheet.css +601 -0
  96. package/dist/styles/skeleton.css +65 -0
  97. package/dist/styles/skip-link.css +131 -0
  98. package/dist/styles/slider.css +633 -0
  99. package/dist/styles/sortable.css +249 -0
  100. package/dist/styles/spinner.css +115 -0
  101. package/dist/styles/splitter.css +127 -0
  102. package/dist/styles/stack.css +8 -0
  103. package/dist/styles/statistic.css +49 -0
  104. package/dist/styles/stepper.css +324 -0
  105. package/dist/styles/surface.css +95 -0
  106. package/dist/styles/switch.css +857 -0
  107. package/dist/styles/table.css +260 -0
  108. package/dist/styles/tabs.css +663 -0
  109. package/dist/styles/text-field.css +602 -0
  110. package/dist/styles/text.css +9 -0
  111. package/dist/styles/textarea.css +602 -0
  112. package/dist/styles/time-picker.css +1446 -0
  113. package/dist/styles/timeline.css +376 -0
  114. package/dist/styles/toast.css +542 -0
  115. package/dist/styles/tooltip.css +179 -0
  116. package/dist/styles/tour.css +1130 -0
  117. package/dist/styles/tree-select.css +1803 -0
  118. package/dist/styles/treeview.css +365 -0
  119. package/dist/styles/virtual-scroll.css +33 -0
  120. package/dist/styles/watermark.css +3 -0
  121. package/dist/tandd-ui.css +684 -91
  122. package/dist/tandd-ui.js +7517 -6407
  123. package/package.json +20 -7
  124. package/src/components/_index.scss +4 -0
  125. package/src/components/alert/DTAlert.scss +29 -45
  126. package/src/components/border-beam/DTBorderBeam.scss +4 -3
  127. package/src/components/card/DTCard.scss +6 -5
  128. package/src/components/checkbox/DTChoice.scss +28 -0
  129. package/src/components/date-picker/DTDatePicker.scss +30 -0
  130. package/src/components/date-time-picker/DTDateTimePicker.scss +2 -1
  131. package/src/components/form/DTForm.scss +66 -0
  132. package/src/components/list/DTList.scss +79 -0
  133. package/src/components/menu/DTMenu.scss +0 -15
  134. package/src/components/modal/DTModal.scss +11 -1
  135. package/src/components/navigation-drawer/DTNavigationDrawer.scss +20 -0
  136. package/src/components/sheet/DTSheet.scss +12 -1
  137. package/src/components/sortable/DTSortable.scss +196 -0
  138. package/src/components/splitter/DTSplitter.scss +133 -0
  139. package/src/components/switch/DTSwitch.scss +19 -0
  140. package/src/components/time-picker/DTTimePicker.scss +37 -6
  141. package/src/components/toast/DTToast.scss +35 -22
  142. package/src/components/tour/DTTour.scss +2 -1
  143. package/src/components/virtual-scroll/DTVirtualScroll.scss +35 -0
  144. package/src/styles/foundation/_motion.scss +19 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,43 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.6 (2026-11-27)
3
+ ## Unreleased
4
+
5
+ ### Fixed
6
+
7
+ - **Server-side rendering:** an open `DTMenu`, and any focus trap or roving focus that waits for a paint, threw `requestAnimationFrame is not defined` in `renderToString`. Frame waits now fall back without a browser. Every exported component is rendered without a DOM in the test suite.
8
+
9
+ ### Added
10
+
11
+ - **DTVirtualScroll:** a scroll box that renders only the rows in view, for lists of thousands of rows. Fixed row height or measured rows, `scrollToIndex()`, an `update` event with the rendered range, and list semantics with each row's position in the whole list.
12
+ - **DTSplitter:** two panes, side by side or stacked, with a divider that is dragged or moved with the arrow keys (WAI-ARIA window splitter). `v-model` in percent, `min`, `max`, `step`, `collapsible` (Enter), and a `resize` event to save the size.
13
+ - **Per-component stylesheets:** `tandd-ui/styles/base.css` and `tandd-ui/styles/<component>.css` (for example `button.css`, `date-picker.css`), each with the styles of the components it renders. A page using one component loads about 5 KB of CSS gzipped instead of 41 KB. `styles.css` is unchanged.
14
+ - **DTForm and field rules:** a form that validates its fields before it submits. Every field (DTInput, DTTextarea, DTSelect, DTAutocomplete, DTCombobox, DTNumberInput, the date and time inputs, DTColorInput, DTFileInput, DTMention, DTCheckbox, DTSwitch, DTRadioGroup) takes `rules`, `validate-on`, and `error-messages`; a field checks when it is left, then as you type. On submit the form focuses the first invalid field, and `error-summary` lists every problem with links. `validate()`, `reset()`, and `resetValidation()` are exposed. DTCheckbox, DTSwitch, and DTRadioGroup can now show a message, and their `error` accepts a string.
15
+ - **Docs:** a Server-Side Rendering guide (Nuxt setup, what happens on the server, hydration).
16
+
17
+ ## 0.2.8 (2026-12-02)
18
+
19
+ ### Fixed
20
+
21
+ - **Stacked dialogs:** a DTModal opened from another one now always opens on top, also when the dialogs are declared side by side (as in Vuetify) and the later one comes first in the template. Before, every backdrop had the same z-index, so such a dialog opened underneath its opener. Open modals, sheets, and tours are layered by when they opened; only the newest is interactive, and Escape closes one level at a time. The page also no longer gets darker with each dialog: only the newest layer draws the backdrop tint, so two or three open dialogs dim the page as much as one.
22
+
23
+ ### Added
24
+
25
+ - **DTSortable:** a list people reorder by dragging, bound to an array with `v-model` (a new array on drop) and a `change` event with `{ item, from, to }`. Pointer drags work with a mouse, pen, or finger; the lifted row follows the pointer and the others slide aside. Each row's grip is a button: Space picks the row up, the arrow keys, Home, and End move it, Space drops it, Escape puts it back, and a live region announces each step. Props: `item-key`, `item-text`, `direction` (vertical or horizontal, mirrored in RTL), `drag-from` (handle or the whole row for a mouse), `variant` (card or plain), `disabled`, `label`, `tag` (`ul` or `ol`), and translatable announcement strings.
26
+ - **DTSortable groups:** lists with the same `group` exchange rows, for a kanban board. Drag a row to another list, or hold it with Space and press Left or Right to move it to the previous or next list. An empty list shows a drop area (`empty` slot, `empty-text`). New `add` and `remove` events with `{ item, index }`; the move is announced with the list's `label`.
27
+ - **Date range picker (`months`):** DTDatePicker and DTDateInput show 1 to 3 months side by side; with `range :months="2"` the band runs across both months and the hover preview follows into the second. Previous sits on the first month and Next on the last; keyboard focus crosses months and turns the view only past the last one shown. They stack on narrow screens, and the DTDateInput calendar stays inside a phone screen with its shortcuts above.
28
+ - **DTTimePicker:** a glass selection band across the centre row, and wheel picking: columns snap one value at a time and the centred value is picked when scrolling settles.
29
+
30
+ ## 0.2.7 (2026-11-29)
31
+
32
+ ### Added
33
+
34
+ - **DTListGroup:** a collapsible group in a `DTList`, for submenus in a navigation drawer. The header is a button that opens and closes a nested list of `DTListItem` rows; groups nest. A group holding the current page opens on load and colours its header. Props: `title`, `subtitle`, `prepend-icon`, `v-model:open`, `disabled`; slots `default`, `prepend`, `title`. Closed rows are hidden and skipped by Tab and screen readers. Its chevron turns like DTAccordion's.
35
+ - **DTNavigationDrawer submenus:** a `DTListGroup` header spans the row; in the collapsed rail only its icon shows, filled while it holds the current page. The hover and current-row fills follow the rows while a group opens or closes, and move to a closed group's header when the current page is inside it.
36
+
37
+ ### Changed
38
+
39
+ - **tandd-icon 1.1.0** (was 0.2.0). No icon was removed or redrawn; the new version adds hold and loop play modes.
40
+
4
41
 
5
42
  Also the first npm release of the 0.2.5 changes below (0.2.5 was tagged but not published).
6
43
 
package/README.md CHANGED
@@ -74,6 +74,10 @@ createTanDDUI({
74
74
  - **Language:** switch at runtime with `useLocale().setLocale("en-US", en)`. A component's own text prop always wins.
75
75
  - **Defaults:** a prop set on one component always wins over `defaults`.
76
76
 
77
+ ### Per-component styles
78
+
79
+ Import `tandd-ui/styles/base.css` plus `tandd-ui/styles/<component>.css` for the components you use instead of the whole `styles.css`; see Getting Started in the docs.
80
+
77
81
  ### Sass
78
82
 
79
83
  To build from the Sass source instead of `styles.css`, use Sass's package importer (Dart Sass 1.71+):
@@ -89,7 +93,7 @@ To build from the Sass source instead of `styles.css`, use Sass's package import
89
93
  | Layout | DTContainer, DTRow, DTCol, DTGrid, DTGridItem, DTStack, DTInline, DTAppBar, DTLayout, DTMain, DTSurface, DTDivider |
90
94
  | Actions | DTButton, DTButtonGroup, DTMenu (+ DTMenuItem, DTMenuLabel, DTMenuSeparator), DTChip, DTChipGroup |
91
95
  | Forms | DTInput, DTNumberInput, DTOtpInput, DTTextarea, DTSelect, DTTreeSelect, DTAutocomplete, DTCombobox, DTMention, DTCheckbox, DTRadio, DTRadioGroup, DTSwitch, DTSlider, DTFileInput, DTFileUpload, DTDatePicker, DTDateInput, DTTimePicker, DTTimeInput, DTDateTimePicker, DTDateTimeInput, DTColorInput, DTColorPicker, DTRating |
92
- | Display | DTIcon, DTBadge, DTAvatar, DTAvatarGroup, DTCard (+ parts), DTList (+ DTListItem, DTListSubheader), DTTable, DTDataTable, DTAccordion, DTAccordionItem, DTCarousel (+ DTCarouselItem), DTTimeline (+ DTTimelineItem), DTBorderBeam, DTEmptyState, DTStatistic (+ DTCountdown), DTInfiniteScroll, DTPullRefresh, DTWatermark |
96
+ | Display | DTIcon, DTBadge, DTAvatar, DTAvatarGroup, DTCard (+ parts), DTList (+ DTListItem, DTListSubheader), DTTable, DTDataTable, DTAccordion, DTAccordionItem, DTCarousel (+ DTCarouselItem), DTTimeline (+ DTTimelineItem), DTBorderBeam, DTEmptyState, DTStatistic (+ DTCountdown), DTInfiniteScroll, DTPullRefresh, DTWatermark, DTSortable |
93
97
  | Feedback | DTAlert, DTToastRegion + `useToast()`, DTModal, DTSheet, DTPopover, DTTooltip, DTTour (+ DTTourStep), DTProgress, DTSpinner, DTSkeleton |
94
98
  | Navigation | DTNavigationDrawer, DTTabs, DTTab, DTStepper (+ DTStep), DTTreeview, DTBreadcrumb, DTPagination, DTAnchor (+ DTAnchorLink), DTSkipLink |
95
99
  | Typography | DTText, DTHeading, DTLink, DTCode, DTKbd, DTField |
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The next animation frame, safe on the server (owner 2026-12-02 audit: `DTMenu :open="true"` threw
3
+ * `requestAnimationFrame is not defined` in `renderToString`). Without a browser it resolves on the
4
+ * next microtask, so code that waits for a paint still continues, and code that would then touch
5
+ * the DOM must check for it as it already does.
6
+ */
7
+ export declare const nextFrame: () => Promise<void>;
8
+ /** `requestAnimationFrame` where it exists; a no-op returning 0 on the server. */
9
+ export declare const onNextFrame: (callback: FrameRequestCallback) => number;
10
+ /** `cancelAnimationFrame` where it exists. */
11
+ export declare const cancelFrame: (handle: number) => void;
@@ -1,6 +1,7 @@
1
1
  import { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
2
+ /** `true` (or any non-string) passes; a string is the error message. */
2
3
  export type FieldRuleResult = true | string;
3
- export type FieldRule = (value: unknown) => FieldRuleResult | PromiseLike<FieldRuleResult>;
4
+ export type FieldRule = (value: unknown) => boolean | string | PromiseLike<boolean | string>;
4
5
  export type ValidationTrigger = "input" | "blur" | "submit" | "manual";
5
6
  export type ValidateOn = ValidationTrigger | readonly ValidationTrigger[];
6
7
  export interface ValidationResult {
@@ -12,13 +12,13 @@ type __VLS_Props = {
12
12
  /** Replaces the tone icon; `false` hides it. */
13
13
  icon?: string | false;
14
14
  closeLabel?: string;
15
- /** `tonal` is the reference tinted gradient; `outlined` a tone border on the surface; `solid` a full tone fill. */
15
+ /** `tonal` is a flat tint of the tone; `outlined` a tone border on the surface; `solid` a full tone fill. */
16
16
  variant?: DTAlertVariant;
17
17
  /** Padding and gap: `comfortable` and `compact` tighten the default spacing. */
18
18
  density?: DTAlertDensity;
19
19
  /** A thicker tone-coloured edge on the start (inline-start) or top side. */
20
20
  border?: DTAlertBorder | false;
21
- /** A larger icon tile, title, and padding for important notices. */
21
+ /** A larger icon, title, and padding for important notices. */
22
22
  prominent?: boolean;
23
23
  };
24
24
  declare var __VLS_6: {}, __VLS_8: {}, __VLS_10: {};
@@ -97,11 +97,15 @@ declare const __VLS_base: import('vue').DefineComponent<DTAutocompleteProps, {},
97
97
  resultsTextOne: string;
98
98
  placeholder: string;
99
99
  id: string;
100
+ errorMessages: string | readonly string[];
100
101
  required: boolean;
101
102
  disabled: boolean;
102
103
  readonly: boolean;
103
104
  loading: boolean;
104
105
  clearable: boolean;
106
+ rules: readonly import('../..').FieldRule[];
107
+ maxErrors: number | string;
108
+ validateOn: import('../..').ValidateOn;
105
109
  modelValue: undefined;
106
110
  helper: string;
107
111
  prependInnerIcon: string;
@@ -2,7 +2,7 @@ export type DTCardElevation = "flat" | "raised";
2
2
  export type DTCardVariant = "elevated" | "outlined" | "tonal";
3
3
  type __VLS_Props = {
4
4
  as?: string;
5
- /** Hover lift and a whole-card hit area. Put one `DTCardTitle` with `href` inside. */
5
+ /** A hover border and fill, and a whole-card hit area. Put one `DTCardTitle` with `href` inside. */
6
6
  interactive?: boolean;
7
7
  /** `raised` adds a small shadow; the reference card is flat with a border. */
8
8
  elevation?: DTCardElevation;
@@ -1,5 +1,5 @@
1
1
  type __VLS_Props = {
2
- /** Image URL; without it the reference gradient placeholder shows. */
2
+ /** Image URL; without it a plain muted placeholder shows. */
3
3
  src?: string;
4
4
  /** Image alt text. Leave empty for decorative images. */
5
5
  alt?: string;
@@ -1,3 +1,4 @@
1
+ import { DTFormFieldProps } from '../form/useFormField';
1
2
  type __VLS_Props = {
2
3
  /** `boolean`, or an array of selected values when several checkboxes share one model. */
3
4
  modelValue?: boolean | readonly unknown[];
@@ -7,7 +8,12 @@ type __VLS_Props = {
7
8
  /** Mixed state, e.g. a "select all" over a partial selection. Cleared on the next toggle. */
8
9
  indeterminate?: boolean;
9
10
  disabled?: boolean;
10
- error?: boolean;
11
+ /** `true` marks it invalid; a string also shows the message below it. */
12
+ error?: boolean | string;
13
+ /** Validation (owner 2026-12-02 audit): rules get the checked state (or the array model). */
14
+ rules?: DTFormFieldProps["rules"];
15
+ validateOn?: DTFormFieldProps["validateOn"];
16
+ errorMessages?: DTFormFieldProps["errorMessages"];
11
17
  /** Icon shown when checked, in place of the box. Setting it or `falseIcon` switches to icon mode. */
12
18
  trueIcon?: string;
13
19
  /** Icon shown when unchecked, in place of the box. Setting it or `trueIcon` switches to icon mode. */
@@ -28,12 +34,15 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
28
34
  "onUpdate:modelValue"?: ((value: boolean | unknown[]) => any) | undefined;
29
35
  "onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
30
36
  }>, {
31
- error: boolean;
37
+ error: boolean | string;
32
38
  value: undefined;
33
39
  ripple: boolean;
34
40
  label: string;
35
41
  id: string;
42
+ errorMessages: string | readonly string[];
36
43
  disabled: boolean;
44
+ rules: readonly import('../..').FieldRule[];
45
+ validateOn: import('../..').ValidateOn;
37
46
  modelValue: boolean | readonly unknown[];
38
47
  indeterminate: boolean;
39
48
  trueIcon: string;
@@ -6,6 +6,8 @@ interface DTDateInputProps extends Omit<DTTextFieldBaseProps, "modelValue" | "pr
6
6
  /** "YYYY-MM-DD", `[start, end]` with `range`, or an array with `multiple`. */
7
7
  modelValue?: DTDatePickerValue;
8
8
  range?: boolean;
9
+ /** Months shown side by side in the calendar dialog, 1 to 3 (owner 2026-12-01: date range picker). */
10
+ months?: number | string;
9
11
  multiple?: boolean;
10
12
  min?: IsoDate;
11
13
  max?: IsoDate;
@@ -74,10 +76,14 @@ declare const __VLS_base: import('vue').DefineComponent<DTDateInputProps, {}, {}
74
76
  doneText: string;
75
77
  placeholder: string;
76
78
  id: string;
79
+ errorMessages: string | readonly string[];
77
80
  required: boolean;
78
81
  disabled: boolean;
79
82
  readonly: boolean;
80
83
  clearable: boolean;
84
+ rules: readonly import('../..').FieldRule[];
85
+ maxErrors: number | string;
86
+ validateOn: import('../..').ValidateOn;
81
87
  modelValue: DTDatePickerValue;
82
88
  max: IsoDate;
83
89
  helper: string;
@@ -86,6 +92,7 @@ declare const __VLS_base: import('vue').DefineComponent<DTDateInputProps, {}, {}
86
92
  min: IsoDate;
87
93
  format: Intl.DateTimeFormatOptions | string;
88
94
  multiple: boolean;
95
+ months: number | string;
89
96
  allowedDates: (date: IsoDate) => boolean;
90
97
  firstDayOfWeek: number | string;
91
98
  showAdjacentMonths: boolean;
@@ -7,6 +7,8 @@ type __VLS_Props = {
7
7
  modelValue?: DTDatePickerValue;
8
8
  /** The month shown, "YYYY-MM" (`v-model:month`). Default: the value's month, else today's. */
9
9
  month?: string;
10
+ /** How many months are shown side by side, 1 to 3 (owner 2026-12-01: date range picker); `month` is the first. They stack when the container is too narrow. */
11
+ months?: number | string;
10
12
  range?: boolean;
11
13
  /** Several separate dates. */
12
14
  multiple?: boolean;
@@ -45,20 +47,20 @@ declare var __VLS_8: {
45
47
  month: string;
46
48
  label: string;
47
49
  view: DTDatePickerView;
48
- }, __VLS_25: {
50
+ }, __VLS_30: {
49
51
  date: string;
50
52
  day: number;
51
53
  selected: boolean;
52
54
  today: boolean;
53
55
  disabled: boolean;
54
56
  outside: boolean;
55
- }, __VLS_27: {};
57
+ }, __VLS_32: {};
56
58
  type __VLS_Slots = {} & {
57
59
  header?: (props: typeof __VLS_8) => any;
58
60
  } & {
59
- day?: (props: typeof __VLS_25) => any;
61
+ day?: (props: typeof __VLS_30) => any;
60
62
  } & {
61
- actions?: (props: typeof __VLS_27) => any;
63
+ actions?: (props: typeof __VLS_32) => any;
62
64
  };
63
65
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
64
66
  focus: () => Promise<void>;
@@ -88,6 +90,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
88
90
  range: boolean;
89
91
  min: IsoDate;
90
92
  multiple: boolean;
93
+ months: number | string;
91
94
  allowedDates: (date: IsoDate) => boolean;
92
95
  firstDayOfWeek: number | string;
93
96
  showAdjacentMonths: boolean;
@@ -81,10 +81,14 @@ declare const __VLS_base: import('vue').DefineComponent<DTDateTimeInputProps, {}
81
81
  doneText: string;
82
82
  placeholder: string;
83
83
  id: string;
84
+ errorMessages: string | readonly string[];
84
85
  required: boolean;
85
86
  disabled: boolean;
86
87
  readonly: boolean;
87
88
  clearable: boolean;
89
+ rules: readonly import('../..').FieldRule[];
90
+ maxErrors: number | string;
91
+ validateOn: import('../..').ValidateOn;
88
92
  modelValue: IsoDateTime | null;
89
93
  max: string;
90
94
  helper: string;
@@ -117,10 +117,14 @@ declare const __VLS_base: import('vue').DefineComponent<DTFileInputProps, {}, {}
117
117
  clearedText: string;
118
118
  placeholder: string;
119
119
  id: string;
120
+ errorMessages: string | readonly string[];
120
121
  required: boolean;
121
122
  disabled: boolean;
122
123
  readonly: boolean;
123
124
  clearable: boolean;
125
+ rules: readonly import('../..').FieldRule[];
126
+ maxErrors: number | string;
127
+ validateOn: import('../..').ValidateOn;
124
128
  modelValue: File | File[] | null;
125
129
  helper: string;
126
130
  prependIcon: string;
@@ -0,0 +1,67 @@
1
+ import { ValidateOn } from '../_shared/useFieldValidation';
2
+ export interface DTFormSubmitEvent {
3
+ /** The native submit event; already prevented. */
4
+ event: SubmitEvent | Event;
5
+ valid: boolean;
6
+ /** Every invalid field, in document order: its id, label, and messages. */
7
+ errors: DTFormFieldError[];
8
+ }
9
+ export interface DTFormFieldError {
10
+ id: string;
11
+ label?: string;
12
+ errors: readonly string[];
13
+ }
14
+ type __VLS_Props = {
15
+ /** `v-model`: whether every field passed its last validation (null before any). */
16
+ modelValue?: boolean | null;
17
+ /** When fields validate, unless a field sets its own `validate-on`. Default: when left, then live. */
18
+ validateOn?: ValidateOn;
19
+ disabled?: boolean;
20
+ readonly?: boolean;
21
+ /** List the invalid fields above the form after a failed submit, with links to them. */
22
+ errorSummary?: boolean;
23
+ /** Heading of the error summary. `{0}` is the number of fields. */
24
+ summaryTitle?: string;
25
+ };
26
+ type __VLS_Slots = {
27
+ default?: (props: {
28
+ valid: boolean | null;
29
+ submitting: boolean;
30
+ errors: DTFormFieldError[];
31
+ }) => unknown;
32
+ };
33
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
34
+ validate: () => Promise<{
35
+ valid: boolean;
36
+ errors: DTFormFieldError[];
37
+ }>;
38
+ reset: () => Promise<void>;
39
+ resetValidation: () => void;
40
+ submitted: import('vue').Ref<boolean, boolean>;
41
+ submitting: import('vue').Ref<boolean, boolean>;
42
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
43
+ submit: (event: DTFormSubmitEvent) => any;
44
+ reset: () => any;
45
+ "update:modelValue": (valid: boolean | null) => any;
46
+ "submit:attempt": (event: DTFormSubmitEvent) => any;
47
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
48
+ onSubmit?: ((event: DTFormSubmitEvent) => any) | undefined;
49
+ onReset?: (() => any) | undefined;
50
+ "onUpdate:modelValue"?: ((valid: boolean | null) => any) | undefined;
51
+ "onSubmit:attempt"?: ((event: DTFormSubmitEvent) => any) | undefined;
52
+ }>, {
53
+ summaryTitle: string;
54
+ disabled: boolean;
55
+ readonly: boolean;
56
+ validateOn: ValidateOn;
57
+ modelValue: boolean | null;
58
+ errorSummary: boolean;
59
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
60
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
61
+ declare const _default: typeof __VLS_export;
62
+ export default _default;
63
+ type __VLS_WithSlots<T, S> = T & {
64
+ new (): {
65
+ $slots: S;
66
+ };
67
+ };
@@ -0,0 +1,24 @@
1
+ import { ComputedRef, InjectionKey, Ref } from 'vue';
2
+ import { ValidationResult } from '../_shared/useFieldValidation';
3
+ export interface DTFormFieldEntry {
4
+ /** The field's control id, for the error summary's links. */
5
+ id: () => string;
6
+ /** The field's label, for the error summary. */
7
+ label: () => string | undefined;
8
+ errors: ComputedRef<readonly string[]>;
9
+ validate: () => Promise<ValidationResult>;
10
+ resetValidation: () => void;
11
+ /** Clears the value (the form's reset()). */
12
+ reset: () => void;
13
+ focus: () => void;
14
+ }
15
+ export interface DTFormContext {
16
+ register: (field: DTFormFieldEntry) => () => void;
17
+ /** Field triggers apply unless the field sets its own `validate-on`. */
18
+ validateOn: () => import('../_shared/useFieldValidation').ValidateOn | undefined;
19
+ disabled: Ref<boolean>;
20
+ readonly: Ref<boolean>;
21
+ /** True once the form was submitted: fields that wait for submit start validating as you type. */
22
+ submitted: Ref<boolean>;
23
+ }
24
+ export declare const DTFormKey: InjectionKey<DTFormContext>;
@@ -0,0 +1,42 @@
1
+ import { FieldRule, ValidateOn, ValidationResult } from '../_shared/useFieldValidation';
2
+ /** Props every field component accepts for validation. */
3
+ export interface DTFormFieldProps {
4
+ /** Functions returning `true` or an error message; run in order. Async rules are awaited. */
5
+ rules?: readonly FieldRule[];
6
+ /** When the rules run: `input`, `blur`, `submit`, or several. Default: the form's, else `input` once the field was left or the form submitted. */
7
+ validateOn?: ValidateOn;
8
+ /** Messages shown as errors, from a server for example. They win over the rules' messages. */
9
+ errorMessages?: string | readonly string[];
10
+ /** How many rule messages to collect. */
11
+ maxErrors?: number | string;
12
+ }
13
+ export declare const formFieldDefaults: {
14
+ readonly rules: undefined;
15
+ readonly validateOn: undefined;
16
+ readonly errorMessages: undefined;
17
+ readonly maxErrors: 1;
18
+ };
19
+ interface Options {
20
+ props: DTFormFieldProps & {
21
+ error?: boolean | string;
22
+ label?: string;
23
+ disabled?: boolean;
24
+ };
25
+ value: () => unknown;
26
+ /** The value that clears the field on the form's reset(). */
27
+ emptyValue: () => unknown;
28
+ setValue: (value: unknown) => void;
29
+ id: () => string;
30
+ focus: () => void;
31
+ }
32
+ export declare function useFormField(options: Options): {
33
+ errors: import('vue').ComputedRef<readonly string[]>;
34
+ errorText: import('vue').ComputedRef<string>;
35
+ invalid: import('vue').ComputedRef<boolean>;
36
+ validating: import('vue').Ref<boolean, boolean>;
37
+ validate: () => Promise<ValidationResult>;
38
+ resetValidation: () => void;
39
+ onBlur: () => void;
40
+ form: import('./formContext').DTFormContext | null;
41
+ };
42
+ export type { FieldRule, ValidateOn };
@@ -0,0 +1,35 @@
1
+ type __VLS_Props = {
2
+ title?: string;
3
+ subtitle?: string;
4
+ prependIcon?: string;
5
+ /** Open state, for `v-model:open`. Unset: the group opens on mount when it holds an active row. */
6
+ open?: boolean;
7
+ disabled?: boolean;
8
+ };
9
+ type __VLS_Slots = {
10
+ /** The group's rows: DTListItem, or nested DTListGroup. */
11
+ default?: () => unknown;
12
+ /** Replaces the header's icon. */
13
+ prepend?: () => unknown;
14
+ /** Replaces the header's title and subtitle. */
15
+ title?: () => unknown;
16
+ };
17
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
+ "update:open": (value: boolean) => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
21
+ }>, {
22
+ title: string;
23
+ disabled: boolean;
24
+ prependIcon: string;
25
+ open: boolean;
26
+ subtitle: string;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -68,10 +68,14 @@ declare const __VLS_base: import('vue').DefineComponent<DTMentionProps, {}, {},
68
68
  resultsTextOne: string;
69
69
  placeholder: string;
70
70
  id: string;
71
+ errorMessages: string | readonly string[];
71
72
  required: boolean;
72
73
  disabled: boolean;
73
74
  readonly: boolean;
74
75
  loading: boolean;
76
+ rules: readonly import('../..').FieldRule[];
77
+ maxErrors: number | string;
78
+ validateOn: import('../..').ValidateOn;
75
79
  modelValue: string;
76
80
  helper: string;
77
81
  prependInnerIcon: string;
@@ -3,6 +3,12 @@
3
3
  * one handles Escape, and page scroll stays locked until the last modal in a document closes.
4
4
  * (Focus trapping uses the matching stack in useFocusTrap, so only the topmost dialog traps Tab.)
5
5
  *
6
+ * Each layer is drawn above the ones opened before it, whatever its place in the document: every
7
+ * backdrop has the same z-index token, so without an order of its own a modal declared before its
8
+ * opener in the template (Vuetify-style sibling dialogs) opened underneath it (owner 2026-12-02:
9
+ * "modal đang không chồng lên nhau được"). The stack sets `--dt-modal-layer` (0, 1, 2, …) on each
10
+ * root, and the backdrop, sheet scrim, and tour styles add it to their z-index.
11
+ *
6
12
  * Everything outside the topmost modal is also made `inert`: `aria-modal` alone is not honoured
7
13
  * consistently by browsers and screen readers, so without it the outer dialog's fields and the page
8
14
  * behind stayed in the accessibility tree while a nested dialog was open (WAI-ARIA APG dialog).
@@ -40,9 +40,13 @@ declare const __VLS_base: import('vue').DefineComponent<DTNumberInputProps, {},
40
40
  decreaseLabel: string;
41
41
  placeholder: string;
42
42
  id: string;
43
+ errorMessages: string | readonly string[];
43
44
  required: boolean;
44
45
  disabled: boolean;
45
46
  readonly: boolean;
47
+ rules: readonly import('../..').FieldRule[];
48
+ maxErrors: number | string;
49
+ validateOn: import('../..').ValidateOn;
46
50
  modelValue: number | null;
47
51
  max: number | string;
48
52
  helper: string;
@@ -1,3 +1,4 @@
1
+ import { DTFormFieldProps } from '../form/useFormField';
1
2
  export type DTRadioGroupOrientation = "vertical" | "horizontal";
2
3
  type __VLS_Props = {
3
4
  modelValue?: unknown;
@@ -7,7 +8,12 @@ type __VLS_Props = {
7
8
  name?: string;
8
9
  orientation?: DTRadioGroupOrientation;
9
10
  disabled?: boolean;
10
- error?: boolean;
11
+ /** `true` marks the group invalid; a string also shows the message below it. */
12
+ error?: boolean | string;
13
+ /** Validation (owner 2026-12-02 audit): rules get the selected value. */
14
+ rules?: DTFormFieldProps["rules"];
15
+ validateOn?: DTFormFieldProps["validateOn"];
16
+ errorMessages?: DTFormFieldProps["errorMessages"];
11
17
  };
12
18
  declare var __VLS_1: {};
13
19
  type __VLS_Slots = {} & {
@@ -18,10 +24,13 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
18
24
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
19
25
  "onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
20
26
  }>, {
21
- error: boolean;
27
+ error: boolean | string;
22
28
  name: string;
23
29
  label: string;
30
+ errorMessages: string | readonly string[];
24
31
  disabled: boolean;
32
+ rules: readonly import('../..').FieldRule[];
33
+ validateOn: import('../..').ValidateOn;
25
34
  modelValue: undefined;
26
35
  orientation: DTRadioGroupOrientation;
27
36
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,4 +1,5 @@
1
1
  import { HTMLAttributes } from 'vue';
2
+ import { DTFormFieldProps } from '../form/useFormField';
2
3
  export type DTSelectItem = string | number | Record<string, unknown>;
3
4
  export type DTSelectSize = "sm" | "md" | "lg";
4
5
  /** The field look, as DTInput: soft (default), outlined, filled, underlined, plain. */
@@ -26,6 +27,10 @@ type __VLS_Props = {
26
27
  helper?: string;
27
28
  /** `true` marks the select invalid; a string also replaces the helper. */
28
29
  error?: boolean | string;
30
+ /** Validation (owner 2026-12-02 audit): rules get the value (an array with `multiple`). */
31
+ rules?: DTFormFieldProps["rules"];
32
+ validateOn?: DTFormFieldProps["validateOn"];
33
+ errorMessages?: DTFormFieldProps["errorMessages"];
29
34
  disabled?: boolean;
30
35
  id?: string;
31
36
  /** Select several values; `v-model` is an array and the panel stays open while toggling. */
@@ -118,9 +123,12 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
118
123
  noDataText: string;
119
124
  placeholder: string;
120
125
  id: string;
126
+ errorMessages: string | readonly string[];
121
127
  disabled: boolean;
122
128
  readonly: boolean;
123
129
  clearable: boolean;
130
+ rules: readonly import('../..').FieldRule[];
131
+ validateOn: import('../..').ValidateOn;
124
132
  modelValue: undefined;
125
133
  helper: string;
126
134
  items: readonly DTSelectItem[];
@@ -0,0 +1,70 @@
1
+ export type DTSortableDirection = "vertical" | "horizontal";
2
+ export type DTSortableDragFrom = "handle" | "item";
3
+ export type DTSortableVariant = "card" | "plain";
4
+ export interface DTSortableChange<Item = unknown> {
5
+ item: Item;
6
+ from: number;
7
+ to: number;
8
+ }
9
+ export interface DTSortableTransfer<Item = unknown> {
10
+ item: Item;
11
+ /** Index in this list: where it was (remove) or where it landed (add). */
12
+ index: number;
13
+ }
14
+ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
15
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<{
16
+ modelValue: T[];
17
+ /** A property name or a function giving each item a stable key. Unset: the item itself for strings and numbers, else its `id`. */
18
+ itemKey?: string | ((item: T) => string | number);
19
+ /** The text that names an item in announcements and on its handle. Unset: the item for strings and numbers, else its `title`, `label`, or `name`. */
20
+ itemText?: string | ((item: T) => string);
21
+ direction?: DTSortableDirection;
22
+ /** Where a pointer drag may start: the grip only, or anywhere on the row (mouse and pen; touch keeps the grip so the page can scroll). */
23
+ dragFrom?: DTSortableDragFrom;
24
+ variant?: DTSortableVariant;
25
+ disabled?: boolean;
26
+ /** Lists with the same group name exchange rows (a kanban board). Keys must be unique across the group. */
27
+ group?: string;
28
+ /** Accessible name of the list; also names it in announcements when a row moves between lists. */
29
+ label?: string;
30
+ tag?: "ul" | "ol";
31
+ handleLabel?: string;
32
+ instructionsText?: string;
33
+ groupInstructionsText?: string;
34
+ pickedText?: string;
35
+ movedText?: string;
36
+ movedToListText?: string;
37
+ droppedText?: string;
38
+ cancelledText?: string;
39
+ emptyText?: string;
40
+ } & {
41
+ onAdd?: ((event: DTSortableTransfer<T>) => any) | undefined;
42
+ "onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
43
+ onChange?: ((event: DTSortableChange<T>) => any) | undefined;
44
+ onRemove?: ((event: DTSortableTransfer<T>) => any) | undefined;
45
+ }> & (typeof globalThis extends {
46
+ __VLS_PROPS_FALLBACK: infer P;
47
+ } ? P : {});
48
+ expose: (exposed: {}) => void;
49
+ attrs: any;
50
+ slots: {
51
+ /** One row's content. */
52
+ default?: (props: {
53
+ item: T;
54
+ index: number;
55
+ dragging: boolean;
56
+ }) => unknown;
57
+ /** Shown in an empty list. */
58
+ empty?: () => unknown;
59
+ };
60
+ emit: ((evt: "add", event: DTSortableTransfer<T>) => void) & ((evt: "update:modelValue", value: T[]) => void) & ((evt: "change", event: DTSortableChange<T>) => void) & ((evt: "remove", event: DTSortableTransfer<T>) => void);
61
+ }>) => import('vue').VNode & {
62
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
63
+ };
64
+ declare const _default: typeof __VLS_export;
65
+ export default _default;
66
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
67
+ [K in keyof T]: T[K];
68
+ } : {
69
+ [K in keyof T as K]: T[K];
70
+ }) & {};