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.
- package/CHANGELOG.md +38 -1
- package/README.md +5 -1
- package/dist/components/_shared/nextFrame.d.ts +11 -0
- package/dist/components/_shared/useFieldValidation.d.ts +2 -1
- package/dist/components/alert/DTAlert.vue.d.ts +2 -2
- package/dist/components/autocomplete/DTAutocomplete.vue.d.ts +4 -0
- package/dist/components/card/DTCard.vue.d.ts +1 -1
- package/dist/components/card/DTCardMedia.vue.d.ts +1 -1
- package/dist/components/checkbox/DTCheckbox.vue.d.ts +11 -2
- package/dist/components/date-picker/DTDateInput.vue.d.ts +7 -0
- package/dist/components/date-picker/DTDatePicker.vue.d.ts +7 -4
- package/dist/components/date-time-picker/DTDateTimeInput.vue.d.ts +4 -0
- package/dist/components/file-input/DTFileInput.vue.d.ts +4 -0
- package/dist/components/form/DTForm.vue.d.ts +67 -0
- package/dist/components/form/formContext.d.ts +24 -0
- package/dist/components/form/useFormField.d.ts +42 -0
- package/dist/components/list/DTListGroup.vue.d.ts +35 -0
- package/dist/components/mention/DTMention.vue.d.ts +4 -0
- package/dist/components/modal/modalStack.d.ts +6 -0
- package/dist/components/number-input/DTNumberInput.vue.d.ts +4 -0
- package/dist/components/radio/DTRadioGroup.vue.d.ts +11 -2
- package/dist/components/select/DTSelect.vue.d.ts +8 -0
- package/dist/components/sortable/DTSortable.vue.d.ts +70 -0
- package/dist/components/sortable/sortableGroups.d.ts +41 -0
- package/dist/components/splitter/DTSplitter.vue.d.ts +48 -0
- package/dist/components/switch/DTSwitch.vue.d.ts +11 -0
- package/dist/components/text-field/DTInput.vue.d.ts +6 -2
- package/dist/components/text-field/fieldShared.d.ts +18 -3
- package/dist/components/textarea/DTTextarea.vue.d.ts +6 -2
- package/dist/components/time-picker/DTTimeInput.vue.d.ts +4 -0
- package/dist/components/toast/toastStore.d.ts +1 -1
- package/dist/components/virtual-scroll/DTVirtualScroll.vue.d.ts +58 -0
- package/dist/index.d.ts +10 -0
- package/dist/locale/en.d.ts +17 -0
- package/dist/locale/en.js +3 -0
- package/dist/locale/messages.d.ts +17 -0
- package/dist/locale/vi.d.ts +17 -0
- package/dist/locale/vi.js +3 -0
- package/dist/styles/accordion.css +177 -0
- package/dist/styles/alert.css +750 -0
- package/dist/styles/anchor.css +120 -0
- package/dist/styles/app-bar.css +1333 -0
- package/dist/styles/autocomplete.css +2100 -0
- package/dist/styles/avatar.css +153 -0
- package/dist/styles/badge.css +862 -0
- package/dist/styles/base.css +383 -0
- package/dist/styles/border-beam.css +57 -0
- package/dist/styles/breadcrumb.css +120 -0
- package/dist/styles/button-group.css +517 -0
- package/dist/styles/button.css +517 -0
- package/dist/styles/card.css +365 -0
- package/dist/styles/carousel.css +272 -0
- package/dist/styles/checkbox.css +457 -0
- package/dist/styles/chip.css +784 -0
- package/dist/styles/code.css +10 -0
- package/dist/styles/col.css +128 -0
- package/dist/styles/color-input.css +1818 -0
- package/dist/styles/color-picker.css +1818 -0
- package/dist/styles/combobox.css +2100 -0
- package/dist/styles/container.css +20 -0
- package/dist/styles/data-table.css +2692 -0
- package/dist/styles/date-picker.css +1309 -0
- package/dist/styles/date-time-picker.css +1574 -0
- package/dist/styles/divider.css +61 -0
- package/dist/styles/empty-state.css +183 -0
- package/dist/styles/field-control.css +293 -0
- package/dist/styles/field.css +69 -0
- package/dist/styles/file-input.css +1427 -0
- package/dist/styles/file-upload.css +1794 -0
- package/dist/styles/form.css +62 -0
- package/dist/styles/grid.css +330 -0
- package/dist/styles/heading.css +9 -0
- package/dist/styles/icon.css +62 -0
- package/dist/styles/infinite-scroll.css +589 -0
- package/dist/styles/inline.css +17 -0
- package/dist/styles/kbd.css +17 -0
- package/dist/styles/layout-app.css +56 -0
- package/dist/styles/link.css +34 -0
- package/dist/styles/list.css +369 -0
- package/dist/styles/manifest.json +350 -0
- package/dist/styles/mention.css +2041 -0
- package/dist/styles/menu.css +305 -0
- package/dist/styles/modal.css +275 -0
- package/dist/styles/navigation-drawer.css +2006 -0
- package/dist/styles/number-input.css +709 -0
- package/dist/styles/otp-input.css +187 -0
- package/dist/styles/pagination.css +165 -0
- package/dist/styles/popover.css +419 -0
- package/dist/styles/progress.css +196 -0
- package/dist/styles/pull-refresh.css +674 -0
- package/dist/styles/radio.css +457 -0
- package/dist/styles/rating.css +211 -0
- package/dist/styles/row.css +71 -0
- package/dist/styles/select.css +1540 -0
- package/dist/styles/sheet.css +601 -0
- package/dist/styles/skeleton.css +65 -0
- package/dist/styles/skip-link.css +131 -0
- package/dist/styles/slider.css +633 -0
- package/dist/styles/sortable.css +249 -0
- package/dist/styles/spinner.css +115 -0
- package/dist/styles/splitter.css +127 -0
- package/dist/styles/stack.css +8 -0
- package/dist/styles/statistic.css +49 -0
- package/dist/styles/stepper.css +324 -0
- package/dist/styles/surface.css +95 -0
- package/dist/styles/switch.css +857 -0
- package/dist/styles/table.css +260 -0
- package/dist/styles/tabs.css +663 -0
- package/dist/styles/text-field.css +602 -0
- package/dist/styles/text.css +9 -0
- package/dist/styles/textarea.css +602 -0
- package/dist/styles/time-picker.css +1446 -0
- package/dist/styles/timeline.css +376 -0
- package/dist/styles/toast.css +542 -0
- package/dist/styles/tooltip.css +179 -0
- package/dist/styles/tour.css +1130 -0
- package/dist/styles/tree-select.css +1803 -0
- package/dist/styles/treeview.css +365 -0
- package/dist/styles/virtual-scroll.css +33 -0
- package/dist/styles/watermark.css +3 -0
- package/dist/tandd-ui.css +684 -91
- package/dist/tandd-ui.js +7517 -6407
- package/package.json +20 -7
- package/src/components/_index.scss +4 -0
- package/src/components/alert/DTAlert.scss +29 -45
- package/src/components/border-beam/DTBorderBeam.scss +4 -3
- package/src/components/card/DTCard.scss +6 -5
- package/src/components/checkbox/DTChoice.scss +28 -0
- package/src/components/date-picker/DTDatePicker.scss +30 -0
- package/src/components/date-time-picker/DTDateTimePicker.scss +2 -1
- package/src/components/form/DTForm.scss +66 -0
- package/src/components/list/DTList.scss +79 -0
- package/src/components/menu/DTMenu.scss +0 -15
- package/src/components/modal/DTModal.scss +11 -1
- package/src/components/navigation-drawer/DTNavigationDrawer.scss +20 -0
- package/src/components/sheet/DTSheet.scss +12 -1
- package/src/components/sortable/DTSortable.scss +196 -0
- package/src/components/splitter/DTSplitter.scss +133 -0
- package/src/components/switch/DTSwitch.scss +19 -0
- package/src/components/time-picker/DTTimePicker.scss +37 -6
- package/src/components/toast/DTToast.scss +35 -22
- package/src/components/tour/DTTour.scss +2 -1
- package/src/components/virtual-scroll/DTVirtualScroll.scss +35 -0
- package/src/styles/foundation/_motion.scss +19 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface SortableList {
|
|
2
|
+
readonly group: () => string | undefined;
|
|
3
|
+
readonly root: () => HTMLElement | undefined;
|
|
4
|
+
readonly items: () => unknown[];
|
|
5
|
+
readonly setItems: (list: unknown[]) => void;
|
|
6
|
+
readonly label: () => string | undefined;
|
|
7
|
+
readonly disabled: () => boolean;
|
|
8
|
+
readonly vertical: () => boolean;
|
|
9
|
+
readonly rowAt: (index: number) => HTMLElement | undefined;
|
|
10
|
+
readonly rows: () => Map<string | number, HTMLElement>;
|
|
11
|
+
readonly setPicked: (index: number | null) => void;
|
|
12
|
+
readonly setDropTarget: (on: boolean) => void;
|
|
13
|
+
readonly focusHandle: (index: number) => Promise<void>;
|
|
14
|
+
readonly announce: (key: "picked" | "moved" | "movedToList" | "dropped" | "cancelled", index: number, item: unknown) => void;
|
|
15
|
+
readonly emitModel: (list: unknown[]) => void;
|
|
16
|
+
readonly emitChange: (item: unknown, from: number, to: number) => void;
|
|
17
|
+
readonly emitAdd: (item: unknown, to: number) => void;
|
|
18
|
+
readonly emitRemove: (item: unknown, from: number) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function joinGroup(name: string, list: SortableList): void;
|
|
21
|
+
export declare function leaveGroup(name: string, list: SortableList): void;
|
|
22
|
+
/** The mounted lists of a group in document order (the order of the columns on screen). */
|
|
23
|
+
export declare function groupLists(name: string | undefined, self: SortableList): SortableList[];
|
|
24
|
+
/** A keyboard move in progress: the item, where it started, and every list it has touched. */
|
|
25
|
+
export interface KeySession {
|
|
26
|
+
item: unknown;
|
|
27
|
+
origin: SortableList;
|
|
28
|
+
originIndex: number;
|
|
29
|
+
current: SortableList;
|
|
30
|
+
index: number;
|
|
31
|
+
snapshots: Map<SortableList, unknown[]>;
|
|
32
|
+
}
|
|
33
|
+
export declare const shared: {
|
|
34
|
+
session: KeySession | null;
|
|
35
|
+
refocusing: boolean;
|
|
36
|
+
/** Lists taking part in the pointer drag in progress (null when none). */
|
|
37
|
+
dragLists: SortableList[] | null;
|
|
38
|
+
};
|
|
39
|
+
export declare function captureRows(lists: Iterable<SortableList>): Map<string | number | HTMLElement, DOMRect>;
|
|
40
|
+
export declare function resetRows(lists: Iterable<SortableList>): void;
|
|
41
|
+
export declare function playRows(lists: Iterable<SortableList>, first: Map<HTMLElement | string | number, DOMRect>, scale: number, animate: boolean): void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type DTSplitterDirection = "horizontal" | "vertical";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** `v-model`: the first pane's size, in percent of the splitter (0-100). */
|
|
4
|
+
modelValue?: number;
|
|
5
|
+
/** `horizontal`: panes side by side, a vertical divider. `vertical`: stacked panes. */
|
|
6
|
+
direction?: DTSplitterDirection;
|
|
7
|
+
/** Smallest first-pane size, in percent. */
|
|
8
|
+
min?: number;
|
|
9
|
+
/** Largest first-pane size, in percent. */
|
|
10
|
+
max?: number;
|
|
11
|
+
/** Percent moved per arrow key press; Shift moves 10 times as far. */
|
|
12
|
+
step?: number;
|
|
13
|
+
/** Enter collapses the first pane to `min`, and Enter again restores it. */
|
|
14
|
+
collapsible?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Accessible name of the divider. Name the first pane ("Folders") so the value reads as its size. */
|
|
17
|
+
label?: string;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_Slots = {
|
|
20
|
+
/** The first pane (left, or top when vertical). */
|
|
21
|
+
start?: () => unknown;
|
|
22
|
+
/** The second pane. */
|
|
23
|
+
end?: () => unknown;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
|
+
"update:modelValue": (value: number) => any;
|
|
27
|
+
resize: (value: number) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
30
|
+
onResize?: ((value: number) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
label: string;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
modelValue: number;
|
|
35
|
+
max: number;
|
|
36
|
+
min: number;
|
|
37
|
+
step: number;
|
|
38
|
+
direction: DTSplitterDirection;
|
|
39
|
+
collapsible: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DTFormFieldProps } from '../form/useFormField';
|
|
1
2
|
export type DTSwitchSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
2
3
|
export type DTSwitchVariant = "round" | "square";
|
|
3
4
|
type __VLS_Props = {
|
|
@@ -22,6 +23,12 @@ type __VLS_Props = {
|
|
|
22
23
|
disabled?: boolean;
|
|
23
24
|
/** Spinner in the thumb and `aria-busy`; the switch stays focusable but cannot be toggled. */
|
|
24
25
|
loading?: boolean;
|
|
26
|
+
/** `true` marks it invalid; a string also shows the message below it (owner 2026-12-02 audit). */
|
|
27
|
+
error?: boolean | string;
|
|
28
|
+
/** Validation: rules get the model value. */
|
|
29
|
+
rules?: DTFormFieldProps["rules"];
|
|
30
|
+
validateOn?: DTFormFieldProps["validateOn"];
|
|
31
|
+
errorMessages?: DTFormFieldProps["errorMessages"];
|
|
25
32
|
id?: string;
|
|
26
33
|
ripple?: boolean;
|
|
27
34
|
};
|
|
@@ -34,6 +41,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
34
41
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
42
|
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
36
43
|
}>, {
|
|
44
|
+
error: boolean | string;
|
|
37
45
|
value: undefined;
|
|
38
46
|
ripple: boolean;
|
|
39
47
|
variant: DTSwitchVariant;
|
|
@@ -41,8 +49,11 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
41
49
|
label: string;
|
|
42
50
|
icons: boolean;
|
|
43
51
|
id: string;
|
|
52
|
+
errorMessages: string | readonly string[];
|
|
44
53
|
disabled: boolean;
|
|
45
54
|
loading: boolean;
|
|
55
|
+
rules: readonly import('../..').FieldRule[];
|
|
56
|
+
validateOn: import('../..').ValidateOn;
|
|
46
57
|
modelValue: boolean;
|
|
47
58
|
trueIcon: string;
|
|
48
59
|
falseIcon: string;
|
|
@@ -21,18 +21,18 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import('vue').DefineComponent<DTInputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
23
23
|
"click:clear": (event: MouseEvent) => any;
|
|
24
|
+
"update:modelValue": (value: string) => any;
|
|
24
25
|
"click:prepend": (event: MouseEvent) => any;
|
|
25
26
|
"click:prepend-inner": (event: MouseEvent) => any;
|
|
26
27
|
"click:append-inner": (event: MouseEvent) => any;
|
|
27
28
|
"click:append": (event: MouseEvent) => any;
|
|
28
|
-
"update:modelValue": (value: string) => any;
|
|
29
29
|
}, string, import('vue').PublicProps, Readonly<DTInputProps> & Readonly<{
|
|
30
30
|
"onClick:clear"?: ((event: MouseEvent) => any) | undefined;
|
|
31
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
31
32
|
"onClick:prepend"?: ((event: MouseEvent) => any) | undefined;
|
|
32
33
|
"onClick:prepend-inner"?: ((event: MouseEvent) => any) | undefined;
|
|
33
34
|
"onClick:append-inner"?: ((event: MouseEvent) => any) | undefined;
|
|
34
35
|
"onClick:append"?: ((event: MouseEvent) => any) | undefined;
|
|
35
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
36
36
|
}>, {
|
|
37
37
|
error: boolean | string;
|
|
38
38
|
variant: import('./fieldShared').DTFieldVariant;
|
|
@@ -46,11 +46,15 @@ declare const __VLS_base: import('vue').DefineComponent<DTInputProps, {}, {}, {}
|
|
|
46
46
|
clearLabel: string;
|
|
47
47
|
placeholder: string;
|
|
48
48
|
id: string;
|
|
49
|
+
errorMessages: string | readonly string[];
|
|
49
50
|
required: boolean;
|
|
50
51
|
disabled: boolean;
|
|
51
52
|
readonly: boolean;
|
|
52
53
|
loading: boolean;
|
|
53
54
|
clearable: boolean;
|
|
55
|
+
rules: readonly import('../..').FieldRule[];
|
|
56
|
+
maxErrors: number | string;
|
|
57
|
+
validateOn: import('../..').ValidateOn;
|
|
54
58
|
modelValue: string | number;
|
|
55
59
|
helper: string;
|
|
56
60
|
prependIcon: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DTInputSize, DTInputVariant } from '../../config';
|
|
2
|
+
import { DTFormFieldProps } from '../form/useFormField';
|
|
2
3
|
export type DTFieldVariant = DTInputVariant;
|
|
3
4
|
export type DTFieldSize = DTInputSize;
|
|
4
|
-
/** Props shared by DTInput and DTTextarea. */
|
|
5
|
-
export interface DTTextFieldBaseProps {
|
|
5
|
+
/** Props shared by DTInput and DTTextarea (and the other text fields), validation included. */
|
|
6
|
+
export interface DTTextFieldBaseProps extends DTFormFieldProps {
|
|
6
7
|
modelValue?: string | number;
|
|
7
8
|
label?: string;
|
|
8
9
|
variant?: DTFieldVariant;
|
|
@@ -49,6 +50,10 @@ export declare const textFieldBaseDefaults: {
|
|
|
49
50
|
readonly prependInnerIconLabel: undefined;
|
|
50
51
|
readonly appendInnerIconLabel: undefined;
|
|
51
52
|
readonly appendIconLabel: undefined;
|
|
53
|
+
readonly rules: undefined;
|
|
54
|
+
readonly validateOn: undefined;
|
|
55
|
+
readonly errorMessages: undefined;
|
|
56
|
+
readonly maxErrors: 1;
|
|
52
57
|
};
|
|
53
58
|
/** The four icon positions of a text field, as used in `click:<position>` event names. */
|
|
54
59
|
export type DTFieldIconPosition = "prepend" | "prepend-inner" | "append-inner" | "append";
|
|
@@ -72,13 +77,23 @@ export declare function useTextField(props: DTTextFieldBaseProps, prefix: string
|
|
|
72
77
|
disabled: import('vue').ComputedRef<boolean>;
|
|
73
78
|
required: import('vue').ComputedRef<boolean>;
|
|
74
79
|
invalid: import('vue').ComputedRef<boolean>;
|
|
75
|
-
helperText: import('vue').ComputedRef<string
|
|
80
|
+
helperText: import('vue').ComputedRef<string>;
|
|
76
81
|
hasValue: import('vue').ComputedRef<boolean>;
|
|
77
82
|
describedBy: import('vue').ComputedRef<string | undefined>;
|
|
78
83
|
controlAttrs: import('vue').ComputedRef<{
|
|
79
84
|
[x: string]: unknown;
|
|
80
85
|
}>;
|
|
81
86
|
iconActions: import('vue').ComputedRef<("prepend" | "prepend-inner" | "append-inner" | "append")[]>;
|
|
87
|
+
validation: {
|
|
88
|
+
errors: import('vue').ComputedRef<readonly string[]>;
|
|
89
|
+
errorText: import('vue').ComputedRef<string>;
|
|
90
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
91
|
+
validating: import('vue').Ref<boolean, boolean>;
|
|
92
|
+
validate: () => Promise<import('../..').ValidationResult>;
|
|
93
|
+
resetValidation: () => void;
|
|
94
|
+
onBlur: () => void;
|
|
95
|
+
form: import('../form/formContext').DTFormContext | null;
|
|
96
|
+
};
|
|
82
97
|
};
|
|
83
98
|
/** Accessible names and the click handler for the icon buttons of DTInput and DTTextarea. */
|
|
84
99
|
export declare function useIconActions(props: DTTextFieldBaseProps, field: ReturnType<typeof useTextField>, emit: (...args: never[]) => void, component: "DTInput" | "DTTextarea"): {
|
|
@@ -11,17 +11,17 @@ type __VLS_Slots = {} & {
|
|
|
11
11
|
[K in NonNullable<typeof __VLS_12>]?: (props: typeof __VLS_13) => any;
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_base: import('vue').DefineComponent<DTTextareaProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: string) => any;
|
|
14
15
|
"click:prepend": (event: MouseEvent) => any;
|
|
15
16
|
"click:prepend-inner": (event: MouseEvent) => any;
|
|
16
17
|
"click:append-inner": (event: MouseEvent) => any;
|
|
17
18
|
"click:append": (event: MouseEvent) => any;
|
|
18
|
-
"update:modelValue": (value: string) => any;
|
|
19
19
|
}, string, import('vue').PublicProps, Readonly<DTTextareaProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
20
21
|
"onClick:prepend"?: ((event: MouseEvent) => any) | undefined;
|
|
21
22
|
"onClick:prepend-inner"?: ((event: MouseEvent) => any) | undefined;
|
|
22
23
|
"onClick:append-inner"?: ((event: MouseEvent) => any) | undefined;
|
|
23
24
|
"onClick:append"?: ((event: MouseEvent) => any) | undefined;
|
|
24
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
25
25
|
}>, {
|
|
26
26
|
error: boolean | string;
|
|
27
27
|
variant: import('../..').DTFieldVariant;
|
|
@@ -33,9 +33,13 @@ declare const __VLS_base: import('vue').DefineComponent<DTTextareaProps, {}, {},
|
|
|
33
33
|
appendIconLabel: string;
|
|
34
34
|
placeholder: string;
|
|
35
35
|
id: string;
|
|
36
|
+
errorMessages: string | readonly string[];
|
|
36
37
|
required: boolean;
|
|
37
38
|
disabled: boolean;
|
|
38
39
|
readonly: boolean;
|
|
40
|
+
rules: readonly import('../..').FieldRule[];
|
|
41
|
+
maxErrors: number | string;
|
|
42
|
+
validateOn: import('../..').ValidateOn;
|
|
39
43
|
modelValue: string | number;
|
|
40
44
|
helper: string;
|
|
41
45
|
prependIcon: string;
|
|
@@ -47,10 +47,14 @@ declare const __VLS_base: import('vue').DefineComponent<DTTimeInputProps, {}, {}
|
|
|
47
47
|
doneText: string;
|
|
48
48
|
placeholder: string;
|
|
49
49
|
id: string;
|
|
50
|
+
errorMessages: string | readonly string[];
|
|
50
51
|
required: boolean;
|
|
51
52
|
disabled: boolean;
|
|
52
53
|
readonly: boolean;
|
|
53
54
|
clearable: boolean;
|
|
55
|
+
rules: readonly import('../..').FieldRule[];
|
|
56
|
+
maxErrors: number | string;
|
|
57
|
+
validateOn: import('../..').ValidateOn;
|
|
54
58
|
modelValue: IsoTime | null;
|
|
55
59
|
max: IsoTime;
|
|
56
60
|
helper: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type DTToastTone = "info" | "success" | "warning" | "danger";
|
|
2
2
|
/**
|
|
3
|
-
* `tonal` is
|
|
3
|
+
* `tonal` is a plain card whose icon carries the tone; `solid` fills with the tone; `outlined`
|
|
4
4
|
* draws a tone border; `raised` is a 3D tone card: a lit gradient, an icon tile, and soft circles.
|
|
5
5
|
*/
|
|
6
6
|
export type DTToastVariant = "tonal" | "solid" | "outlined" | "raised";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
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<{
|
|
2
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<{
|
|
3
|
+
items?: readonly T[];
|
|
4
|
+
/** Height of each row in px. Without it, rows are measured once rendered (estimated first). */
|
|
5
|
+
itemHeight?: number | string;
|
|
6
|
+
/** Estimated height of an unmeasured row, in px. */
|
|
7
|
+
estimatedHeight?: number | string;
|
|
8
|
+
/** Height of the scroll box: a number of px or a CSS length. Without it, set a height with CSS. */
|
|
9
|
+
height?: number | string;
|
|
10
|
+
/** Rows rendered beyond each edge of the view. */
|
|
11
|
+
overscan?: number | string;
|
|
12
|
+
/** A property name or function for each row's key. Default: the index. */
|
|
13
|
+
itemKey?: string | ((item: T, index: number) => string | number);
|
|
14
|
+
/** `list`: role="list" on the box and role="listitem" on rows, with aria-setsize/posinset. */
|
|
15
|
+
role?: "list" | "none";
|
|
16
|
+
/** Accessible name of the list. */
|
|
17
|
+
label?: string;
|
|
18
|
+
} & {
|
|
19
|
+
onUpdate?: ((range: {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
}) => any) | undefined;
|
|
23
|
+
}> & (typeof globalThis extends {
|
|
24
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
25
|
+
} ? P : {});
|
|
26
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
27
|
+
scrollToIndex: (index: number, options?: {
|
|
28
|
+
align?: "start" | "center" | "end";
|
|
29
|
+
behavior?: ScrollBehavior;
|
|
30
|
+
}) => void;
|
|
31
|
+
range: import('vue').ComputedRef<{
|
|
32
|
+
start: number;
|
|
33
|
+
end: number;
|
|
34
|
+
}>;
|
|
35
|
+
}>) => void;
|
|
36
|
+
attrs: any;
|
|
37
|
+
slots: {
|
|
38
|
+
default?: (props: {
|
|
39
|
+
item: T;
|
|
40
|
+
index: number;
|
|
41
|
+
}) => unknown;
|
|
42
|
+
/** Shown when `items` is empty. */
|
|
43
|
+
empty?: () => unknown;
|
|
44
|
+
};
|
|
45
|
+
emit: (evt: "update", range: {
|
|
46
|
+
start: number;
|
|
47
|
+
end: number;
|
|
48
|
+
}) => void;
|
|
49
|
+
}>) => import('vue').VNode & {
|
|
50
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
51
|
+
};
|
|
52
|
+
declare const _default: typeof __VLS_export;
|
|
53
|
+
export default _default;
|
|
54
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
55
|
+
[K in keyof T]: T[K];
|
|
56
|
+
} : {
|
|
57
|
+
[K in keyof T as K]: T[K];
|
|
58
|
+
}) & {};
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export { default as DTChipGroup } from './components/chip/DTChipGroup.vue';
|
|
|
96
96
|
export { default as DTList } from './components/list/DTList.vue';
|
|
97
97
|
export { default as DTListItem } from './components/list/DTListItem.vue';
|
|
98
98
|
export { default as DTListSubheader } from './components/list/DTListSubheader.vue';
|
|
99
|
+
export { default as DTListGroup } from './components/list/DTListGroup.vue';
|
|
99
100
|
export type { DTListDensity, DTListLines, DTListSelectable } from './components/list/listContext';
|
|
100
101
|
export { default as DTFileInput } from './components/file-input/DTFileInput.vue';
|
|
101
102
|
export type { DTFileRejection } from './components/file-input/DTFileInput.vue';
|
|
@@ -164,6 +165,15 @@ export { default as DTTour } from './components/tour/DTTour.vue';
|
|
|
164
165
|
export { default as DTTourStep } from './components/tour/DTTourStep.vue';
|
|
165
166
|
export type { DTTourPlacement } from './components/tour/DTTour.vue';
|
|
166
167
|
export type { DTTourTarget } from './components/tour/tourContext';
|
|
168
|
+
export { default as DTForm } from './components/form/DTForm.vue';
|
|
169
|
+
export type { DTFormSubmitEvent, DTFormFieldError } from './components/form/DTForm.vue';
|
|
170
|
+
export type { DTFormFieldProps } from './components/form/useFormField';
|
|
171
|
+
export type { FieldRule, FieldRuleResult, ValidateOn, ValidationResult } from './components/_shared/useFieldValidation';
|
|
172
|
+
export { default as DTSplitter } from './components/splitter/DTSplitter.vue';
|
|
173
|
+
export type { DTSplitterDirection } from './components/splitter/DTSplitter.vue';
|
|
174
|
+
export { default as DTVirtualScroll } from './components/virtual-scroll/DTVirtualScroll.vue';
|
|
175
|
+
export { default as DTSortable } from './components/sortable/DTSortable.vue';
|
|
176
|
+
export type { DTSortableChange, DTSortableTransfer, DTSortableDirection, DTSortableDragFrom, DTSortableVariant } from './components/sortable/DTSortable.vue';
|
|
167
177
|
export { default as DTWatermark } from './components/watermark/DTWatermark.vue';
|
|
168
178
|
export type { DTWatermarkFont } from './components/watermark/DTWatermark.vue';
|
|
169
179
|
export { default as DTInfiniteScroll } from './components/infinite-scroll/DTInfiniteScroll.vue';
|
package/dist/locale/en.d.ts
CHANGED
|
@@ -295,6 +295,23 @@ export declare const en: {
|
|
|
295
295
|
indicatorText: string;
|
|
296
296
|
closeLabel: string;
|
|
297
297
|
};
|
|
298
|
+
DTSortable: {
|
|
299
|
+
handleLabel: string;
|
|
300
|
+
instructionsText: string;
|
|
301
|
+
groupInstructionsText: string;
|
|
302
|
+
pickedText: string;
|
|
303
|
+
movedText: string;
|
|
304
|
+
movedToListText: string;
|
|
305
|
+
droppedText: string;
|
|
306
|
+
cancelledText: string;
|
|
307
|
+
emptyText: string;
|
|
308
|
+
};
|
|
309
|
+
DTSplitter: {
|
|
310
|
+
label: string;
|
|
311
|
+
};
|
|
312
|
+
DTForm: {
|
|
313
|
+
summaryTitle: string;
|
|
314
|
+
};
|
|
298
315
|
DTTreeSelect: {
|
|
299
316
|
placeholder: string;
|
|
300
317
|
noDataText: string;
|
package/dist/locale/en.js
CHANGED
|
@@ -176,6 +176,9 @@ const e = {
|
|
|
176
176
|
DTTimePicker: { hourLabel: "Hours", minuteLabel: "Minutes", secondLabel: "Seconds", periodLabel: "AM/PM" },
|
|
177
177
|
DTToastRegion: { label: "Notifications", closeLabel: "Dismiss notification" },
|
|
178
178
|
DTTour: { prevText: "Previous", nextText: "Next", finishText: "Finish", indicatorText: "Step {0} of {1}", closeLabel: "Close tour" },
|
|
179
|
+
DTSortable: { handleLabel: "Reorder {0}", instructionsText: "Press Space to pick up. Use the arrow keys to move, Space to drop, Escape to cancel.", groupInstructionsText: "Press Space to pick up. Use the arrow keys to move, within this list or to the next one, Space to drop, Escape to cancel.", pickedText: "Picked up {0}. Position {1} of {2}.", movedText: "{0} moved to position {1} of {2}.", movedToListText: "{0} moved to {3}, position {1} of {2}.", droppedText: "{0} dropped at position {1} of {2}.", cancelledText: "Reorder cancelled. {0} is back at position {1} of {2}.", emptyText: "Drop here" },
|
|
180
|
+
DTSplitter: { label: "Resize panes" },
|
|
181
|
+
DTForm: { summaryTitle: "Fix {0} fields before you continue" },
|
|
179
182
|
DTTreeSelect: {
|
|
180
183
|
placeholder: "Select…",
|
|
181
184
|
noDataText: "No matches",
|
|
@@ -272,6 +272,23 @@ export interface TanDDMessages {
|
|
|
272
272
|
indicatorText?: string;
|
|
273
273
|
closeLabel?: string;
|
|
274
274
|
};
|
|
275
|
+
DTSortable?: {
|
|
276
|
+
handleLabel?: string;
|
|
277
|
+
instructionsText?: string;
|
|
278
|
+
groupInstructionsText?: string;
|
|
279
|
+
pickedText?: string;
|
|
280
|
+
movedText?: string;
|
|
281
|
+
movedToListText?: string;
|
|
282
|
+
droppedText?: string;
|
|
283
|
+
cancelledText?: string;
|
|
284
|
+
emptyText?: string;
|
|
285
|
+
};
|
|
286
|
+
DTSplitter?: {
|
|
287
|
+
label?: string;
|
|
288
|
+
};
|
|
289
|
+
DTForm?: {
|
|
290
|
+
summaryTitle?: string;
|
|
291
|
+
};
|
|
275
292
|
DTTreeSelect?: {
|
|
276
293
|
placeholder?: string;
|
|
277
294
|
noDataText?: string;
|
package/dist/locale/vi.d.ts
CHANGED
|
@@ -293,6 +293,23 @@ export declare const vi: {
|
|
|
293
293
|
indicatorText: string;
|
|
294
294
|
closeLabel: string;
|
|
295
295
|
};
|
|
296
|
+
DTSortable: {
|
|
297
|
+
handleLabel: string;
|
|
298
|
+
instructionsText: string;
|
|
299
|
+
groupInstructionsText: string;
|
|
300
|
+
pickedText: string;
|
|
301
|
+
movedText: string;
|
|
302
|
+
movedToListText: string;
|
|
303
|
+
droppedText: string;
|
|
304
|
+
cancelledText: string;
|
|
305
|
+
emptyText: string;
|
|
306
|
+
};
|
|
307
|
+
DTSplitter: {
|
|
308
|
+
label: string;
|
|
309
|
+
};
|
|
310
|
+
DTForm: {
|
|
311
|
+
summaryTitle: string;
|
|
312
|
+
};
|
|
296
313
|
DTTreeSelect: {
|
|
297
314
|
placeholder: string;
|
|
298
315
|
noDataText: string;
|
package/dist/locale/vi.js
CHANGED
|
@@ -176,6 +176,9 @@ const e = {
|
|
|
176
176
|
DTTimePicker: { hourLabel: "Giờ", minuteLabel: "Phút", secondLabel: "Giây", periodLabel: "SA/CH" },
|
|
177
177
|
DTToastRegion: { label: "Thông báo", closeLabel: "Đóng thông báo" },
|
|
178
178
|
DTTour: { prevText: "Quay lại", nextText: "Tiếp", finishText: "Hoàn tất", indicatorText: "Bước {0}/{1}", closeLabel: "Đóng hướng dẫn" },
|
|
179
|
+
DTSortable: { handleLabel: "Sắp xếp {0}", instructionsText: "Nhấn Space để nhấc lên. Dùng phím mũi tên để di chuyển, Space để thả, Escape để hủy.", groupInstructionsText: "Nhấn Space để nhấc lên. Dùng phím mũi tên để di chuyển trong danh sách này hoặc sang danh sách bên cạnh, Space để thả, Escape để hủy.", pickedText: "Đã nhấc {0}. Vị trí {1}/{2}.", movedText: "{0} chuyển đến vị trí {1}/{2}.", movedToListText: "{0} chuyển sang {3}, vị trí {1}/{2}.", droppedText: "Đã thả {0} ở vị trí {1}/{2}.", cancelledText: "Đã hủy sắp xếp. {0} trở về vị trí {1}/{2}.", emptyText: "Thả vào đây" },
|
|
180
|
+
DTSplitter: { label: "Đổi kích thước khung" },
|
|
181
|
+
DTForm: { summaryTitle: "Sửa {0} trường trước khi tiếp tục" },
|
|
179
182
|
DTTreeSelect: {
|
|
180
183
|
placeholder: "Chọn…",
|
|
181
184
|
noDataText: "Không có kết quả phù hợp",
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
.dt-icon {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
flex: 0 0 auto;
|
|
4
|
+
inline-size: var(--dt-icon-size, 1em);
|
|
5
|
+
block-size: var(--dt-icon-size, 1em);
|
|
6
|
+
overflow: visible;
|
|
7
|
+
color: currentColor;
|
|
8
|
+
vertical-align: -0.125em;
|
|
9
|
+
fill: none;
|
|
10
|
+
stroke: currentColor;
|
|
11
|
+
stroke-width: var(--dt-icon-stroke, 1.5);
|
|
12
|
+
stroke-linecap: round;
|
|
13
|
+
stroke-linejoin: round;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dt-icon--text {
|
|
17
|
+
color: var(--dt-color-text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dt-icon--muted {
|
|
21
|
+
color: var(--dt-color-text-muted);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dt-icon--subtle {
|
|
25
|
+
color: var(--dt-color-text-subtle);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.dt-icon--primary {
|
|
29
|
+
color: var(--dt-color-primary);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.dt-icon--danger {
|
|
33
|
+
color: var(--dt-color-danger);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dt-icon--info {
|
|
37
|
+
color: var(--dt-color-info);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dt-icon--warning {
|
|
41
|
+
color: var(--dt-color-warning);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dt-icon--size-xs {
|
|
45
|
+
--dt-icon-size: var(--dt-icon-xs);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dt-icon--size-sm {
|
|
49
|
+
--dt-icon-size: var(--dt-icon-sm);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.dt-icon--size-md {
|
|
53
|
+
--dt-icon-size: var(--dt-icon-md);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dt-icon--size-lg {
|
|
57
|
+
--dt-icon-size: var(--dt-icon-lg);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.dt-icon--size-xl {
|
|
61
|
+
--dt-icon-size: var(--dt-icon-xl);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.dt-accordion {
|
|
65
|
+
display: grid;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
border: 1px solid var(--dt-color-border);
|
|
68
|
+
border-radius: var(--dt-radius-md);
|
|
69
|
+
color: var(--dt-color-text);
|
|
70
|
+
background: var(--dt-color-surface);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.dt-accordion__item + .dt-accordion__item {
|
|
74
|
+
border-top: 1px solid var(--dt-color-border);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.dt-accordion__heading {
|
|
78
|
+
margin: 0;
|
|
79
|
+
font: inherit;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dt-accordion__trigger {
|
|
83
|
+
display: flex;
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: space-between;
|
|
87
|
+
gap: var(--dt-space-3);
|
|
88
|
+
width: 100%;
|
|
89
|
+
padding: var(--dt-space-3) var(--dt-space-4);
|
|
90
|
+
border: 0;
|
|
91
|
+
color: var(--dt-color-text);
|
|
92
|
+
background: transparent;
|
|
93
|
+
font: inherit;
|
|
94
|
+
font-size: var(--dt-font-size-sm);
|
|
95
|
+
font-weight: var(--dt-font-weight-semibold);
|
|
96
|
+
text-align: left;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
transition: background var(--dt-duration-fast);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.dt-accordion__trigger:hover:not(:disabled) {
|
|
102
|
+
background: var(--dt-color-surface-hover);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.dt-accordion__trigger:focus-visible {
|
|
106
|
+
outline: 2px solid var(--dt-color-primary);
|
|
107
|
+
outline-offset: -2px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.dt-accordion__trigger:disabled {
|
|
111
|
+
cursor: not-allowed;
|
|
112
|
+
opacity: 0.45;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.dt-accordion__icon {
|
|
116
|
+
flex: none;
|
|
117
|
+
transition: transform var(--dt-duration-slow) var(--dt-ease-standard);
|
|
118
|
+
transform: perspective(100px) rotateX(0deg);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.dt-accordion__trigger[aria-expanded=true] .dt-accordion__icon {
|
|
122
|
+
transform: perspective(100px) rotateX(180deg);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.dt-accordion__panel {
|
|
126
|
+
padding: 0 var(--dt-space-4) var(--dt-space-4);
|
|
127
|
+
color: var(--dt-color-text-muted);
|
|
128
|
+
font-size: var(--dt-font-size-sm);
|
|
129
|
+
line-height: 1.55;
|
|
130
|
+
}
|
|
131
|
+
.dt-accordion__panel > p {
|
|
132
|
+
margin: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (prefers-reduced-motion: reduce) {
|
|
136
|
+
.dt-accordion__icon {
|
|
137
|
+
transition: none;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
.dt-accordion__item.is-readonly .dt-accordion__trigger {
|
|
141
|
+
cursor: default;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.dt-accordion__item.is-readonly .dt-accordion__trigger:hover {
|
|
145
|
+
background: transparent;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.dt-accordion__trigger[aria-expanded=true] .dt-accordion__icon--static {
|
|
149
|
+
transform: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.dt-accordion--outlined {
|
|
153
|
+
background: transparent;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.dt-accordion--flat {
|
|
157
|
+
border-color: transparent;
|
|
158
|
+
border-radius: 0;
|
|
159
|
+
background: transparent;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.dt-accordion--separated {
|
|
163
|
+
gap: var(--dt-space-2);
|
|
164
|
+
overflow: visible;
|
|
165
|
+
border: 0;
|
|
166
|
+
border-radius: 0;
|
|
167
|
+
background: transparent;
|
|
168
|
+
}
|
|
169
|
+
.dt-accordion--separated > .dt-accordion__item {
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
border: 1px solid var(--dt-color-border);
|
|
172
|
+
border-radius: var(--dt-radius-md);
|
|
173
|
+
background: var(--dt-color-surface);
|
|
174
|
+
}
|
|
175
|
+
.dt-accordion--separated > .dt-accordion__item + .dt-accordion__item {
|
|
176
|
+
border-top: 1px solid var(--dt-color-border);
|
|
177
|
+
}
|