pxd 0.1.2 → 0.1.3
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/dist/components/_internal/calendar-day.vue +19 -19
- package/dist/components/_internal/dismiss-container.d.vue.ts +1 -1
- package/dist/components/_internal/dismiss-container.vue +19 -19
- package/dist/components/_internal/loading-mask.vue +9 -1
- package/dist/components/_internal/mention-editor.d.vue.ts +1 -1
- package/dist/components/_internal/mention-editor.vue +1 -1
- package/dist/components/_internal/popover-arrow.d.vue.ts +1 -1
- package/dist/components/_internal/popover-arrow.vue +1 -1
- package/dist/components/{steps → _internal}/step-item.d.vue.ts +1 -1
- package/dist/components/{steps → _internal}/step-item.vue +1 -1
- package/dist/components/_internal/tree-node.d.vue.ts +20 -20
- package/dist/components/_internal/tree-node.vue +53 -45
- package/dist/components/active-graph/index.d.vue.ts +2 -2
- package/dist/components/approval-card/index.d.vue.ts +1 -1
- package/dist/components/approval-card/index.vue +34 -17
- package/dist/components/approval-card/types.d.ts +1 -1
- package/dist/components/avatar/index.d.vue.ts +2 -2
- package/dist/components/avatar/index.vue +1 -1
- package/dist/components/backtop/index.d.vue.ts +3 -3
- package/dist/components/backtop/index.vue +17 -17
- package/dist/components/backtop/types.d.ts +1 -1
- package/dist/components/badge/index.d.vue.ts +3 -3
- package/dist/components/badge/index.vue +43 -43
- package/dist/components/badge/types.d.ts +1 -1
- package/dist/components/book/types.d.ts +1 -1
- package/dist/components/border-beam/index.vue +1 -1
- package/dist/components/border-beam/types.d.ts +1 -1
- package/dist/components/bubble/index.vue +1 -1
- package/dist/components/bubble-group/index.d.vue.ts +4 -4
- package/dist/components/button/index.d.vue.ts +5 -5
- package/dist/components/button/index.vue +13 -13
- package/dist/components/button/types.d.ts +1 -1
- package/dist/components/button-group/types.d.ts +1 -1
- package/dist/components/calendar/index.d.vue.ts +2 -2
- package/dist/components/calendar/index.vue +5 -5
- package/dist/components/calendar/types.d.ts +1 -1
- package/dist/components/card/types.d.ts +1 -1
- package/dist/components/carousel/index.d.vue.ts +7 -7
- package/dist/components/carousel/index.vue +1 -1
- package/dist/components/carousel/types.d.ts +1 -1
- package/dist/components/checkbox/index.vue +1 -1
- package/dist/components/checkbox/types.d.ts +1 -1
- package/dist/components/checkbox-group/index.d.vue.ts +2 -2
- package/dist/components/checkbox-group/types.d.ts +1 -1
- package/dist/components/chip/index.d.vue.ts +1 -1
- package/dist/components/chip/types.d.ts +1 -1
- package/dist/components/choicebox/index.d.vue.ts +3 -3
- package/dist/components/choicebox/types.d.ts +1 -1
- package/dist/components/choicebox-item/index.vue +8 -8
- package/dist/components/choicebox-item/types.d.ts +1 -1
- package/dist/components/collapse/index.vue +2 -2
- package/dist/components/collapse-group/index.vue +1 -1
- package/dist/components/collapse-group/types.d.ts +1 -1
- package/dist/components/command-menu/index.d.vue.ts +5 -5
- package/dist/components/command-menu/index.vue +10 -3
- package/dist/components/config-provider/index.d.vue.ts +40 -5
- package/dist/components/config-provider/types.d.ts +2 -1
- package/dist/components/confirm-popover/index.d.vue.ts +39 -0
- package/dist/components/confirm-popover/index.vue +177 -0
- package/dist/components/confirm-popover/types.d.ts +23 -0
- package/dist/components/copy-button/index.d.vue.ts +2 -6
- package/dist/components/copy-button/index.vue +4 -6
- package/dist/components/dash-line/index.d.vue.ts +1 -1
- package/dist/components/dash-line/index.vue +8 -8
- package/dist/components/dash-line/types.d.ts +1 -1
- package/dist/components/date-picker/index.d.vue.ts +1 -1
- package/dist/components/date-picker/index.vue +3 -3
- package/dist/components/date-picker/types.d.ts +1 -1
- package/dist/components/drawer/index.d.vue.ts +7 -7
- package/dist/components/drawer/index.vue +30 -15
- package/dist/components/drawer/types.d.ts +2 -2
- package/dist/components/effort-slider/index.vue +12 -18
- package/dist/components/effort-slider/types.d.ts +1 -1
- package/dist/components/ellipsis-text/index.d.vue.ts +2 -2
- package/dist/components/ellipsis-text/index.vue +75 -75
- package/dist/components/error/types.d.ts +1 -1
- package/dist/components/fader/index.vue +2 -2
- package/dist/components/fader/types.d.ts +1 -1
- package/dist/components/gauge/index.vue +2 -2
- package/dist/components/gauge/types.d.ts +1 -1
- package/dist/components/grid/types.d.ts +1 -1
- package/dist/components/grid-item/types.d.ts +1 -1
- package/dist/components/hint/index.d.vue.ts +32 -0
- package/dist/components/hint/index.vue +239 -0
- package/dist/components/hint/types.d.ts +17 -0
- package/dist/components/hold-button/index.d.vue.ts +4 -4
- package/dist/components/hold-button/index.vue +10 -10
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/input/index.d.vue.ts +1 -1
- package/dist/components/input/index.vue +14 -7
- package/dist/components/input/types.d.ts +1 -1
- package/dist/components/intersection-observer/index.vue +3 -3
- package/dist/components/kbd/index.vue +2 -2
- package/dist/components/kbd/types.d.ts +1 -1
- package/dist/components/link-button/index.d.vue.ts +5 -5
- package/dist/components/list/index.d.vue.ts +4 -4
- package/dist/components/list/index.vue +126 -47
- package/dist/components/list/types.d.ts +1 -1
- package/dist/components/list-group/types.d.ts +1 -1
- package/dist/components/list-item/index.d.vue.ts +2 -2
- package/dist/components/list-item/index.vue +26 -8
- package/dist/components/loading-bar/index.vue +5 -5
- package/dist/components/marching-ants/index.d.vue.ts +2 -2
- package/dist/components/marching-ants/index.vue +56 -56
- package/dist/components/marching-ants/types.d.ts +1 -1
- package/dist/components/marquee/index.d.vue.ts +6 -6
- package/dist/components/marquee/index.vue +16 -16
- package/dist/components/marquee/types.d.ts +1 -1
- package/dist/components/material/index.d.vue.ts +3 -3
- package/dist/components/mention/index.d.vue.ts +5 -5
- package/dist/components/mention/index.vue +68 -68
- package/dist/components/menu/index.d.vue.ts +4 -4
- package/dist/components/menu/index.vue +10 -10
- package/dist/components/menu/types.d.ts +1 -1
- package/dist/components/message/index.d.vue.ts +1 -1
- package/dist/components/message/index.vue +19 -25
- package/dist/components/message/types.d.ts +1 -1
- package/dist/components/message-item/index.vue +2 -6
- package/dist/components/modal/index.d.vue.ts +7 -7
- package/dist/components/modal/index.vue +26 -11
- package/dist/components/modal/types.d.ts +2 -2
- package/dist/components/noise-background/types.d.ts +1 -1
- package/dist/components/note/index.vue +6 -2
- package/dist/components/note/types.d.ts +2 -1
- package/dist/components/number-input/index.d.vue.ts +11 -6
- package/dist/components/number-input/index.vue +57 -16
- package/dist/components/number-input/types.d.ts +2 -1
- package/dist/components/overlay/index.d.vue.ts +2 -3
- package/dist/components/overlay/index.vue +10 -62
- package/dist/components/overlay/types.d.ts +0 -2
- package/dist/components/page-number/index.vue +30 -29
- package/dist/components/page-number/types.d.ts +1 -1
- package/dist/components/pin-input/index.d.vue.ts +1 -1
- package/dist/components/pin-input/index.vue +6 -6
- package/dist/components/pin-input/types.d.ts +1 -1
- package/dist/components/popover/index.vue +49 -21
- package/dist/components/popover/types.d.ts +3 -1
- package/dist/components/progress/index.d.vue.ts +2 -2
- package/dist/components/progress/index.vue +12 -12
- package/dist/components/progress/types.d.ts +1 -1
- package/dist/components/project-banner/types.d.ts +1 -1
- package/dist/components/questionnaire/index.vue +14 -14
- package/dist/components/radio/index.vue +1 -1
- package/dist/components/radio/types.d.ts +1 -1
- package/dist/components/radio-group/index.d.vue.ts +2 -2
- package/dist/components/radio-group/types.d.ts +1 -1
- package/dist/components/rating/index.vue +28 -28
- package/dist/components/rating/types.d.ts +1 -1
- package/dist/components/resizable/index.d.vue.ts +1 -0
- package/dist/components/resizable/index.vue +130 -195
- package/dist/components/resizable/types.d.ts +2 -10
- package/dist/components/reveal/index.d.vue.ts +3 -3
- package/dist/components/reveal/index.vue +4 -4
- package/dist/components/reveal/types.d.ts +1 -1
- package/dist/components/rolling-number/index.d.vue.ts +2 -2
- package/dist/components/rolling-number/index.vue +15 -15
- package/dist/components/scalable-text/index.vue +9 -9
- package/dist/components/scroll-text/index.d.vue.ts +3 -3
- package/dist/components/scroll-text/index.vue +6 -6
- package/dist/components/scroll-text/types.d.ts +1 -1
- package/dist/components/scrollable/types.d.ts +2 -1
- package/dist/components/search-input/index.d.vue.ts +5 -5
- package/dist/components/search-input/index.vue +2 -1
- package/dist/components/select/index.d.vue.ts +12 -9
- package/dist/components/select/index.vue +165 -42
- package/dist/components/select/types.d.ts +3 -1
- package/dist/components/separator/index.d.vue.ts +1 -1
- package/dist/components/separator/types.d.ts +1 -1
- package/dist/components/skeleton/index.d.vue.ts +1 -1
- package/dist/components/skeleton/index.vue +11 -11
- package/dist/components/skeleton/types.d.ts +1 -1
- package/dist/components/slider/index.d.vue.ts +1 -1
- package/dist/components/slider/index.vue +1 -1
- package/dist/components/slider/types.d.ts +1 -1
- package/dist/components/snippet/index.d.vue.ts +3 -3
- package/dist/components/snippet/index.vue +7 -5
- package/dist/components/snippet/types.d.ts +1 -1
- package/dist/components/spinner/index.vue +5 -1
- package/dist/components/spinner-dots/index.d.vue.ts +1 -1
- package/dist/components/split-button/index.d.vue.ts +5 -5
- package/dist/components/split-button/types.d.ts +1 -1
- package/dist/components/stack/index.d.vue.ts +3 -3
- package/dist/components/stack/index.vue +28 -29
- package/dist/components/stack/types.d.ts +1 -1
- package/dist/components/status-dot/types.d.ts +1 -1
- package/dist/components/steps/index.d.vue.ts +2 -2
- package/dist/components/steps/index.vue +6 -6
- package/dist/components/steps/types.d.ts +1 -1
- package/dist/components/stick-to-bottom/types.d.ts +1 -1
- package/dist/components/swipe-cell/index.d.vue.ts +6 -6
- package/dist/components/swipe-cell/index.vue +64 -64
- package/dist/components/swipe-cell/types.d.ts +2 -1
- package/dist/components/switch/index.vue +1 -1
- package/dist/components/switch/types.d.ts +1 -1
- package/dist/components/switch-item/index.vue +1 -1
- package/dist/components/switch-item/types.d.ts +1 -1
- package/dist/components/tabs/index.d.vue.ts +1 -1
- package/dist/components/tabs/index.vue +48 -51
- package/dist/components/tabs/types.d.ts +1 -1
- package/dist/components/teleport/index.vue +2 -2
- package/dist/components/text/index.d.vue.ts +3 -3
- package/dist/components/text/index.vue +11 -11
- package/dist/components/text/types.d.ts +1 -1
- package/dist/components/textarea/index.vue +1 -1
- package/dist/components/textarea/types.d.ts +1 -1
- package/dist/components/theme-switcher/index.d.vue.ts +3 -2
- package/dist/components/theme-switcher/index.vue +15 -7
- package/dist/components/theme-switcher/types.d.ts +2 -2
- package/dist/components/time-ago/index.d.vue.ts +6 -0
- package/dist/components/time-ago/index.vue +143 -0
- package/dist/components/time-ago/types.d.ts +4 -0
- package/dist/components/time-picker/index.d.vue.ts +1 -1
- package/dist/components/time-picker/index.vue +7 -7
- package/dist/components/time-picker/types.d.ts +1 -1
- package/dist/components/toc/index.d.vue.ts +2 -2
- package/dist/components/toc/index.vue +1 -1
- package/dist/components/todo-list/index.d.vue.ts +4 -4
- package/dist/components/todo-list/index.vue +15 -15
- package/dist/components/todo-list/types.d.ts +1 -1
- package/dist/components/toggle/index.vue +3 -3
- package/dist/components/toggle/types.d.ts +1 -1
- package/dist/components/toggle-button/index.vue +14 -11
- package/dist/components/toggle-button/types.d.ts +2 -2
- package/dist/components/toggle-button-group/index.d.vue.ts +3 -3
- package/dist/components/toggle-button-group/index.vue +2 -2
- package/dist/components/toggle-button-group/types.d.ts +2 -2
- package/dist/components/tool-call/index.vue +5 -5
- package/dist/components/tooltip/index.d.vue.ts +4 -5
- package/dist/components/tooltip/index.vue +4 -49
- package/dist/components/tooltip/types.d.ts +3 -7
- package/dist/components/tour/index.d.vue.ts +33 -0
- package/dist/components/tour/index.vue +302 -0
- package/dist/components/tour/types.d.ts +29 -0
- package/dist/components/tree/index.d.vue.ts +24 -28
- package/dist/components/tree/index.vue +290 -223
- package/dist/components/tree/types.d.ts +38 -13
- package/dist/components/virtual-list/index.d.vue.ts +4 -4
- package/dist/composables/_internal/use-list-keyboard-controller.js +9 -10
- package/dist/composables/_internal/use-list-rows.d.ts +4 -0
- package/dist/composables/_internal/use-list-rows.js +12 -4
- package/dist/composables/_internal/use-list-selection.d.ts +1 -1
- package/dist/composables/_internal/use-lock-scroll.d.ts +8 -1
- package/dist/composables/_internal/use-lock-scroll.js +57 -36
- package/dist/composables/_internal/use-mention-editor.js +1 -1
- package/dist/composables/_internal/use-message-group.d.ts +22 -0
- package/dist/composables/_internal/use-message-group.js +143 -0
- package/dist/composables/_internal/use-overlay-dialog.js +1 -3
- package/dist/composables/_internal/use-overlay-manager.d.ts +4 -1
- package/dist/composables/_internal/use-overlay-manager.js +67 -8
- package/dist/composables/_internal/use-swipe-gesture.d.ts +1 -1
- package/dist/composables/_internal/use-tour-target.d.ts +29 -0
- package/dist/composables/_internal/use-tour-target.js +201 -0
- package/dist/composables/_internal/use-tree.d.ts +103 -0
- package/dist/composables/_internal/use-tree.js +676 -0
- package/dist/composables/_internal/use-word-limit.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-color-scheme.d.ts +1 -1
- package/dist/composables/use-color-scheme.js +7 -6
- package/dist/composables/use-delay-destroy.d.ts +1 -1
- package/dist/composables/use-document-hidden.d.ts +1 -1
- package/dist/composables/use-intersection-observer.d.ts +1 -1
- package/dist/composables/use-intersection-observer.js +1 -1
- package/dist/composables/{_internal/use-motion-reduce.js → use-motion-reduce.js} +2 -2
- package/dist/composables/use-mutation-observer.d.ts +1 -1
- package/dist/composables/use-mutation-observer.js +1 -1
- package/dist/composables/use-resize-observer.d.ts +1 -1
- package/dist/composables/use-resize-observer.js +1 -1
- package/dist/composables/use-view-transition.js +1 -0
- package/dist/composables/use-virtual-list.d.ts +1 -1
- package/dist/constants/tooltip-variants.d.ts +28 -0
- package/dist/constants/tooltip-variants.js +27 -0
- package/dist/contexts/avatar.js +1 -1
- package/dist/contexts/breadcrumb.js +1 -1
- package/dist/contexts/button.js +1 -1
- package/dist/contexts/checkbox.js +1 -1
- package/dist/contexts/choicebox.js +1 -1
- package/dist/contexts/collapse.js +1 -1
- package/dist/contexts/config-provider.js +1 -1
- package/dist/contexts/list.js +1 -1
- package/dist/contexts/radio.js +1 -1
- package/dist/contexts/switch.js +1 -1
- package/dist/contexts/toggle-button.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/locales/en-us.d.ts +35 -0
- package/dist/locales/en-us.js +20 -0
- package/dist/locales/zh-cn.d.ts +35 -0
- package/dist/locales/zh-cn.js +20 -0
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tw.css +43 -30
- package/dist/utils/{context.js → _internal/context.js} +1 -1
- package/dist/utils/{observer.d.ts → _internal/observer.d.ts} +1 -1
- package/dist/utils/{observer.js → _internal/observer.js} +4 -4
- package/dist/{components/swipe-cell/instances.d.ts → utils/_internal/swipe-cell-instances.d.ts} +1 -1
- package/dist/utils/event.d.ts +2 -1
- package/dist/utils/event.js +3 -0
- package/package.json +26 -50
- package/volar.d.ts +4 -0
- package/dist/components/message/composables/use-group-expand.d.ts +0 -13
- package/dist/components/message/composables/use-group-expand.js +0 -50
- package/dist/components/message/composables/use-message-timer.d.ts +0 -9
- package/dist/components/message/composables/use-message-timer.js +0 -62
- package/dist/components/message/composables/use-promise-message.d.ts +0 -4
- package/dist/components/message/composables/use-promise-message.js +0 -49
- package/dist/components/resizable/utils.d.ts +0 -4
- package/dist/components/resizable/utils.js +0 -10
- package/dist/composables/_internal/use-tree-drag.d.ts +0 -23
- package/dist/composables/_internal/use-tree-drag.js +0 -196
- package/dist/composables/_internal/use-tree-move.d.ts +0 -20
- package/dist/composables/_internal/use-tree-move.js +0 -96
- package/dist/composables/_internal/use-tree-rows.d.ts +0 -46
- package/dist/composables/_internal/use-tree-rows.js +0 -101
- package/dist/composables/_internal/use-tree-selection.d.ts +0 -22
- package/dist/composables/_internal/use-tree-selection.js +0 -87
- package/dist/styles/source.css +0 -675
- package/dist/types/shared/index.d.ts +0 -2
- /package/dist/composables/{_internal/use-motion-reduce.d.ts → use-motion-reduce.d.ts} +0 -0
- /package/dist/utils/{context.d.ts → _internal/context.d.ts} +0 -0
- /package/dist/utils/{mention-html.d.ts → _internal/mention-html.d.ts} +0 -0
- /package/dist/utils/{mention-html.js → _internal/mention-html.js} +0 -0
- /package/dist/{components/swipe-cell/instances.js → utils/_internal/swipe-cell-instances.js} +0 -0
|
@@ -45,34 +45,6 @@ const props = defineProps({
|
|
|
45
45
|
required: false
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
const { attrs, classes: variantClasses } = useTailwindVariant({
|
|
49
|
-
base: "pxd-stack flex w-full max-w-full gap-(--xs) [--xs:1rem]",
|
|
50
|
-
variants: {
|
|
51
|
-
wrap: { true: "flex-wrap" },
|
|
52
|
-
align: {
|
|
53
|
-
start: "items-start",
|
|
54
|
-
end: "items-end",
|
|
55
|
-
center: "items-center",
|
|
56
|
-
between: "items-between",
|
|
57
|
-
around: "items-around",
|
|
58
|
-
evenly: "items-evenly",
|
|
59
|
-
stretch: "items-stretch"
|
|
60
|
-
},
|
|
61
|
-
justify: {
|
|
62
|
-
start: "justify-start",
|
|
63
|
-
end: "justify-end",
|
|
64
|
-
center: "justify-center",
|
|
65
|
-
between: "justify-between",
|
|
66
|
-
around: "justify-around",
|
|
67
|
-
evenly: "justify-evenly",
|
|
68
|
-
stretch: "justify-stretch"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}, { selection: () => ({
|
|
72
|
-
wrap: props.wrap,
|
|
73
|
-
align: props.align,
|
|
74
|
-
justify: props.justify
|
|
75
|
-
}) });
|
|
76
48
|
const presetDir = {
|
|
77
49
|
"--xs:vertical": "flex-col",
|
|
78
50
|
"--xs:horizontal": "flex-row",
|
|
@@ -102,6 +74,34 @@ const formattedDirection = computed(() => {
|
|
|
102
74
|
acc[bp] = presetDir[`--${bp}:${value}`];
|
|
103
75
|
});
|
|
104
76
|
});
|
|
77
|
+
const { attrs, classes: variantClasses } = useTailwindVariant({
|
|
78
|
+
base: "pxd-stack flex w-full max-w-full gap-(--xs) [--xs:1rem]",
|
|
79
|
+
variants: {
|
|
80
|
+
wrap: { true: "flex-wrap" },
|
|
81
|
+
align: {
|
|
82
|
+
start: "items-start",
|
|
83
|
+
end: "items-end",
|
|
84
|
+
center: "items-center",
|
|
85
|
+
between: "items-between",
|
|
86
|
+
around: "items-around",
|
|
87
|
+
evenly: "items-evenly",
|
|
88
|
+
stretch: "items-stretch"
|
|
89
|
+
},
|
|
90
|
+
justify: {
|
|
91
|
+
start: "justify-start",
|
|
92
|
+
end: "justify-end",
|
|
93
|
+
center: "justify-center",
|
|
94
|
+
between: "justify-between",
|
|
95
|
+
around: "justify-around",
|
|
96
|
+
evenly: "justify-evenly",
|
|
97
|
+
stretch: "justify-stretch"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, { selection: () => ({
|
|
101
|
+
wrap: props.wrap,
|
|
102
|
+
align: props.align,
|
|
103
|
+
justify: props.justify
|
|
104
|
+
}) });
|
|
105
105
|
const computedClasses = computed(() => {
|
|
106
106
|
const classes = [
|
|
107
107
|
variantClasses.value,
|
|
@@ -116,7 +116,6 @@ const computedClasses = computed(() => {
|
|
|
116
116
|
<Component
|
|
117
117
|
data-stack
|
|
118
118
|
:is="props.as"
|
|
119
|
-
class="pxd-stack flex max-w-full"
|
|
120
119
|
:class="computedClasses"
|
|
121
120
|
v-bind="attrs"
|
|
122
121
|
:style="formattedGap"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentAs, ComponentDirection, ResponsiveValue } from '../../types/shared'
|
|
1
|
+
import type { ComponentAs, ComponentDirection, ResponsiveValue } from '../../types/shared/props'
|
|
2
2
|
|
|
3
3
|
type Align = 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch'
|
|
4
4
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { StepsOption, StepsProps, StepsStatus } from './types';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_10: {
|
|
3
3
|
index: number;
|
|
4
4
|
item: StepsOption;
|
|
5
5
|
status: StepsStatus;
|
|
6
6
|
};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
item?: (props: typeof
|
|
8
|
+
item?: (props: typeof __VLS_10) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<StepsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
11
|
change: (args_0: number) => any;
|
|
@@ -3,7 +3,7 @@ import { computed, shallowRef } from "vue";
|
|
|
3
3
|
import { useModelValue } from "../../composables/_internal/use-model-value.js";
|
|
4
4
|
import { useConfigProvider } from "../../contexts/config-provider.js";
|
|
5
5
|
import { getFallbackValue } from "../../utils/helper.js";
|
|
6
|
-
import PStepsItem from "
|
|
6
|
+
import PStepsItem from "../_internal/step-item.vue";
|
|
7
7
|
defineOptions({
|
|
8
8
|
name: "PSteps",
|
|
9
9
|
inheritAttrs: false,
|
|
@@ -46,11 +46,6 @@ const props = defineProps({
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
const emits = defineEmits(["change", "update:modelValue"]);
|
|
49
|
-
const configProvider = useConfigProvider();
|
|
50
|
-
const modelValue = useModelValue(props, emits);
|
|
51
|
-
/** Uncontrolled fallback: a bound `modelValue` always wins. */
|
|
52
|
-
const innerValue = shallowRef(props.defaultValue);
|
|
53
|
-
const activeIndex = computed(() => props.modelValue ?? innerValue.value ?? 0);
|
|
54
49
|
const SIZES = {
|
|
55
50
|
sm: {
|
|
56
51
|
indicatorSize: "1.25rem",
|
|
@@ -77,6 +72,10 @@ const SIZES = {
|
|
|
77
72
|
gap: "0.5rem"
|
|
78
73
|
}
|
|
79
74
|
};
|
|
75
|
+
/** Uncontrolled fallback: a bound `modelValue` always wins. */
|
|
76
|
+
const innerValue = shallowRef(props.defaultValue);
|
|
77
|
+
const activeIndex = computed(() => props.modelValue ?? innerValue.value ?? 0);
|
|
78
|
+
const configProvider = useConfigProvider();
|
|
80
79
|
const computedSize = computed(() => getFallbackValue(props.size, SIZES, configProvider.size));
|
|
81
80
|
const computedStyle = computed(() => {
|
|
82
81
|
const size = computedSize.value;
|
|
@@ -89,6 +88,7 @@ const computedStyle = computed(() => {
|
|
|
89
88
|
"--steps-gap": size.gap
|
|
90
89
|
};
|
|
91
90
|
});
|
|
91
|
+
const modelValue = useModelValue(props, emits);
|
|
92
92
|
function resolveStatus(option, index) {
|
|
93
93
|
if (option.status) {
|
|
94
94
|
return option.status;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { SwipeCellCloseTrigger, SwipeCellProps, SwipeCellSide } from './types';
|
|
2
2
|
declare function close(trigger?: SwipeCellCloseTrigger): Promise<boolean>;
|
|
3
|
-
declare var
|
|
3
|
+
declare var __VLS_9: {
|
|
4
4
|
side: SwipeCellSide;
|
|
5
5
|
active: boolean;
|
|
6
6
|
distance: number;
|
|
7
7
|
progress: number;
|
|
8
8
|
overSwipe: boolean;
|
|
9
|
-
},
|
|
9
|
+
}, __VLS_11: {}, __VLS_13: {
|
|
10
10
|
side: SwipeCellSide;
|
|
11
11
|
active: boolean;
|
|
12
12
|
distance: number;
|
|
@@ -14,11 +14,11 @@ declare var __VLS_11: {
|
|
|
14
14
|
overSwipe: boolean;
|
|
15
15
|
};
|
|
16
16
|
type __VLS_Slots = {} & {
|
|
17
|
-
prefix?: (props: typeof
|
|
17
|
+
prefix?: (props: typeof __VLS_9) => any;
|
|
18
18
|
} & {
|
|
19
|
-
default?: (props: typeof
|
|
19
|
+
default?: (props: typeof __VLS_11) => any;
|
|
20
20
|
} & {
|
|
21
|
-
suffix?: (props: typeof
|
|
21
|
+
suffix?: (props: typeof __VLS_13) => any;
|
|
22
22
|
};
|
|
23
23
|
declare const __VLS_base: import("vue").DefineComponent<SwipeCellProps, {
|
|
24
24
|
close: typeof close;
|
|
@@ -35,7 +35,7 @@ declare const __VLS_base: import("vue").DefineComponent<SwipeCellProps, {
|
|
|
35
35
|
"onOver-swipe"?: ((state: import("./types").SwipeCellOverSwipeState) => any) | undefined;
|
|
36
36
|
}>, {
|
|
37
37
|
as: import("../../types/shared/props.js").ComponentAs;
|
|
38
|
-
modelValue:
|
|
38
|
+
modelValue: false | SwipeCellSide;
|
|
39
39
|
threshold: number;
|
|
40
40
|
group: string;
|
|
41
41
|
overSwipeThreshold: number;
|
|
@@ -3,8 +3,8 @@ import { nextTick, onBeforeUnmount, onMounted, shallowReactive, shallowRef, watc
|
|
|
3
3
|
import { useSwipeGesture } from "../../composables/_internal/use-swipe-gesture.js";
|
|
4
4
|
import { useOutsideClick } from "../../composables/use-outside-click.js";
|
|
5
5
|
import { useResizeObserver } from "../../composables/use-resize-observer.js";
|
|
6
|
+
import { exclusiveOpen, registerSwipeCell } from "../../utils/_internal/swipe-cell-instances.js";
|
|
6
7
|
import { getElement } from "../../utils/dom.js";
|
|
7
|
-
import { exclusiveOpen, registerSwipeCell } from "./instances.js";
|
|
8
8
|
defineOptions({
|
|
9
9
|
name: "PSwipeCell",
|
|
10
10
|
inheritAttrs: false,
|
|
@@ -93,15 +93,22 @@ const emits = defineEmits([
|
|
|
93
93
|
"over-swipe",
|
|
94
94
|
"update:modelValue"
|
|
95
95
|
]);
|
|
96
|
-
const rootRef = shallowRef();
|
|
97
|
-
const contentRef = shallowRef();
|
|
98
|
-
const prefixRef = shallowRef();
|
|
99
|
-
const suffixRef = shallowRef();
|
|
100
96
|
let alive = true;
|
|
101
97
|
let offset = 0;
|
|
102
98
|
let openToken = 0;
|
|
103
99
|
let trackOffset = 0;
|
|
104
100
|
let gestureStartOffset = 0;
|
|
101
|
+
const cellEntry = {
|
|
102
|
+
getGroup: () => props.group,
|
|
103
|
+
close: (trigger) => {
|
|
104
|
+
void setOpen(false, trigger);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const unregisterCell = registerSwipeCell(cellEntry);
|
|
108
|
+
const rootRef = shallowRef();
|
|
109
|
+
const contentRef = shallowRef();
|
|
110
|
+
const prefixRef = shallowRef();
|
|
111
|
+
const suffixRef = shallowRef();
|
|
105
112
|
const dragging = shallowRef(false);
|
|
106
113
|
const openedSide = shallowRef(props.modelValue);
|
|
107
114
|
const prefixWidth = shallowRef(0);
|
|
@@ -120,13 +127,59 @@ const suffixSlotState = shallowReactive({
|
|
|
120
127
|
progress: 0,
|
|
121
128
|
overSwipe: false
|
|
122
129
|
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
useSwipeGesture(rootRef, {
|
|
131
|
+
disabled: () => props.disabled,
|
|
132
|
+
beforeStart: () => {
|
|
133
|
+
const side = openedSide.value;
|
|
134
|
+
if (!side || !props.beforeClose) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
return Promise.resolve(props.beforeClose(side)).then((allowed) => allowed && alive && !props.disabled);
|
|
138
|
+
},
|
|
139
|
+
onPress: () => {
|
|
140
|
+
openToken += 1;
|
|
141
|
+
measureWidths();
|
|
142
|
+
gestureStartOffset = trackOffset;
|
|
143
|
+
},
|
|
144
|
+
onFollow: ({ displacement }) => {
|
|
145
|
+
if (!dragging.value) {
|
|
146
|
+
dragging.value = true;
|
|
147
|
+
}
|
|
148
|
+
trackOffset = gestureStartOffset + displacement;
|
|
149
|
+
applyOffset(clampOffset(trackOffset));
|
|
150
|
+
syncSlots();
|
|
151
|
+
},
|
|
152
|
+
onRelease: ({ displacement, axisLocked, event }) => {
|
|
153
|
+
if (event.type === "pointercancel") {
|
|
154
|
+
openToken += 1;
|
|
155
|
+
syncOpenOffset();
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (!axisLocked) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
trackOffset = gestureStartOffset + displacement;
|
|
162
|
+
void releaseSwipe();
|
|
163
|
+
},
|
|
164
|
+
onTap: ({ startEvent, vetoed }) => {
|
|
165
|
+
if (vetoed || !startEvent) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const target = startEvent.target;
|
|
169
|
+
if (target instanceof Node) {
|
|
170
|
+
closeByTarget(target);
|
|
171
|
+
}
|
|
127
172
|
}
|
|
128
|
-
};
|
|
129
|
-
|
|
173
|
+
});
|
|
174
|
+
useOutsideClick(getRootEl, {
|
|
175
|
+
eventName: "pointerdown",
|
|
176
|
+
listenerOptions: { capture: true },
|
|
177
|
+
enabled: () => Boolean(openedSide.value) && !props.disabled,
|
|
178
|
+
onTrigger: () => {
|
|
179
|
+
void close("outside");
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
useResizeObserver([prefixRef, suffixRef], measureWidths);
|
|
130
183
|
function getRootEl() {
|
|
131
184
|
return getElement(rootRef);
|
|
132
185
|
}
|
|
@@ -286,59 +339,6 @@ async function releaseSwipe() {
|
|
|
286
339
|
}
|
|
287
340
|
await setOpen(next);
|
|
288
341
|
}
|
|
289
|
-
useSwipeGesture(rootRef, {
|
|
290
|
-
disabled: () => props.disabled,
|
|
291
|
-
beforeStart: () => {
|
|
292
|
-
const side = openedSide.value;
|
|
293
|
-
if (!side || !props.beforeClose) {
|
|
294
|
-
return true;
|
|
295
|
-
}
|
|
296
|
-
return Promise.resolve(props.beforeClose(side)).then((allowed) => allowed && alive && !props.disabled);
|
|
297
|
-
},
|
|
298
|
-
onPress: () => {
|
|
299
|
-
openToken += 1;
|
|
300
|
-
measureWidths();
|
|
301
|
-
gestureStartOffset = trackOffset;
|
|
302
|
-
},
|
|
303
|
-
onFollow: ({ displacement }) => {
|
|
304
|
-
if (!dragging.value) {
|
|
305
|
-
dragging.value = true;
|
|
306
|
-
}
|
|
307
|
-
trackOffset = gestureStartOffset + displacement;
|
|
308
|
-
applyOffset(clampOffset(trackOffset));
|
|
309
|
-
syncSlots();
|
|
310
|
-
},
|
|
311
|
-
onRelease: ({ displacement, axisLocked, event }) => {
|
|
312
|
-
if (event.type === "pointercancel") {
|
|
313
|
-
openToken += 1;
|
|
314
|
-
syncOpenOffset();
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
if (!axisLocked) {
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
trackOffset = gestureStartOffset + displacement;
|
|
321
|
-
void releaseSwipe();
|
|
322
|
-
},
|
|
323
|
-
onTap: ({ startEvent, vetoed }) => {
|
|
324
|
-
if (vetoed || !startEvent) {
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
const target = startEvent.target;
|
|
328
|
-
if (target instanceof Node) {
|
|
329
|
-
closeByTarget(target);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
useOutsideClick(getRootEl, {
|
|
334
|
-
eventName: "pointerdown",
|
|
335
|
-
listenerOptions: { capture: true },
|
|
336
|
-
enabled: () => Boolean(openedSide.value) && !props.disabled,
|
|
337
|
-
onTrigger: () => {
|
|
338
|
-
void close("outside");
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
useResizeObserver([prefixRef, suffixRef], measureWidths);
|
|
342
342
|
watch(() => props.modelValue, (value) => {
|
|
343
343
|
openToken += 1;
|
|
344
344
|
if (value === openedSide.value) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentAs, ComponentClass } from '../../types/shared/props'
|
|
2
|
+
import type { Awaitable } from '../../types/shared/utils'
|
|
2
3
|
|
|
3
4
|
export type SwipeCellSide = 'prefix' | 'suffix'
|
|
4
5
|
export type SwipeCellDirection = 'left' | 'right'
|
|
@@ -45,8 +45,8 @@ const SIZES = {
|
|
|
45
45
|
lg: `${BASIC_HEIGHTS.lg} text-base`
|
|
46
46
|
};
|
|
47
47
|
const configProvider = useConfigProvider();
|
|
48
|
-
const modelValue = useModelValue(props, emits);
|
|
49
48
|
const computedSize = computed(() => getFallbackValue(props.size, SIZES, configProvider.size));
|
|
49
|
+
const modelValue = useModelValue(props, emits);
|
|
50
50
|
provideSwitchContext({
|
|
51
51
|
props,
|
|
52
52
|
emits,
|
|
@@ -30,9 +30,9 @@ const emits = defineEmits([]);
|
|
|
30
30
|
const uniqueId = getUniqueId();
|
|
31
31
|
const switchGroupContext = useSwitchContext();
|
|
32
32
|
const switchGroupName = switchGroupContext?.name ?? getUniqueId();
|
|
33
|
+
const isDisabled = computed(() => props.disabled || switchGroupContext?.props.disabled || false);
|
|
33
34
|
const modelValue = useModelValue(switchGroupContext?.props ?? props, switchGroupContext?.emits ?? emits);
|
|
34
35
|
const isChecked = computed(() => modelValue.value === props.value);
|
|
35
|
-
const isDisabled = computed(() => props.disabled || switchGroupContext?.props.disabled || false);
|
|
36
36
|
const { classes } = useTailwindVariant({
|
|
37
37
|
base: "pxd-switch-item--label px-2.5 font-medium flex size-full items-center justify-center truncate rounded-sm text-foreground-secondary peer-focus-ring outline-none select-none peer-checked:bg-gray-100 peer-disabled:cursor-not-allowed peer-disabled:text-gray-800 empty:hidden hover:text-foreground motion-safe:transition-colors",
|
|
38
38
|
variants: { disabled: { false: "peer-checked:text-foreground" } }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentValue } from '../../types/shared';
|
|
1
|
+
import type { ComponentValue } from '../../types/shared/props';
|
|
2
2
|
import type { TabsProps, TabsOptions } from './types';
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<TabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
4
|
change: (args_0: NonNullable<ComponentValue>) => any;
|
|
@@ -41,18 +41,48 @@ const props = defineProps({
|
|
|
41
41
|
const emits = defineEmits(["change", "update:modelValue"]);
|
|
42
42
|
const BORDER_WIDTH = 2;
|
|
43
43
|
const SCROLL_EPSILON = 2;
|
|
44
|
-
const
|
|
44
|
+
const uid = getUniqueId("pxd-tabs");
|
|
45
|
+
let resizeObserver = null;
|
|
45
46
|
/** Uncontrolled fallback: a bound `modelValue` always wins. */
|
|
46
47
|
const innerValue = shallowRef(props.defaultValue);
|
|
47
48
|
const activeValue = computed(() => props.modelValue === undefined ? innerValue.value : props.modelValue);
|
|
48
|
-
const slots = useSlots();
|
|
49
|
-
const uid = getUniqueId("pxd-tabs");
|
|
50
49
|
const scrollRef = shallowRef();
|
|
51
50
|
const innerNavRef = shallowRef();
|
|
52
51
|
const overflowing = shallowRef(false);
|
|
53
52
|
const canScrollLeft = shallowRef(false);
|
|
54
53
|
const canScrollRight = shallowRef(false);
|
|
55
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Values whose panel was already activated. Kept as a plain array because
|
|
56
|
+
* reactive collections are banned here, and pruned so dynamic option lists
|
|
57
|
+
* cannot grow it without bound.
|
|
58
|
+
*/
|
|
59
|
+
const activatedValues = shallowRef([]);
|
|
60
|
+
const modelValue = useModelValue(props, emits, { withChange: false });
|
|
61
|
+
const slots = useSlots();
|
|
62
|
+
/** Roving tabindex: arrow keys move focus and activate, matching the APG tabs pattern. */
|
|
63
|
+
const navigation = useListNavigation({
|
|
64
|
+
count: () => props.options.length,
|
|
65
|
+
isDisabled: (index) => !!props.options[index]?.disabled,
|
|
66
|
+
scrollToIndex: (index) => focusTab(index)
|
|
67
|
+
});
|
|
68
|
+
const { onKeydown: onNavKeydown } = useListKeyboardController({
|
|
69
|
+
keymap: {
|
|
70
|
+
ArrowRight: "next",
|
|
71
|
+
ArrowLeft: "previous",
|
|
72
|
+
Home: "first",
|
|
73
|
+
End: "last"
|
|
74
|
+
},
|
|
75
|
+
onCommand: (command) => {
|
|
76
|
+
if (!navigation.dispatch(command)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
const option = props.options[navigation.activeIndex.value];
|
|
80
|
+
if (option) {
|
|
81
|
+
select(option.value);
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
56
86
|
function tabId(index) {
|
|
57
87
|
return `${uid}-tab-${index}`;
|
|
58
88
|
}
|
|
@@ -71,26 +101,6 @@ function select(value) {
|
|
|
71
101
|
modelValue.value = value;
|
|
72
102
|
emits("change", value);
|
|
73
103
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Values whose panel was already activated. Kept as a plain array because
|
|
76
|
-
* reactive collections are banned here, and pruned so dynamic option lists
|
|
77
|
-
* cannot grow it without bound.
|
|
78
|
-
*/
|
|
79
|
-
const activatedValues = shallowRef([]);
|
|
80
|
-
watch(activeValue, (value) => {
|
|
81
|
-
if (value !== undefined && !activatedValues.value.includes(value)) {
|
|
82
|
-
activatedValues.value = [...activatedValues.value, value];
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
immediate: true,
|
|
86
|
-
flush: "sync"
|
|
87
|
-
});
|
|
88
|
-
watch(() => props.options.map((option) => option.value), (values) => {
|
|
89
|
-
const kept = activatedValues.value.filter((value) => values.includes(value));
|
|
90
|
-
if (kept.length !== activatedValues.value.length) {
|
|
91
|
-
activatedValues.value = kept;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
104
|
function isActivated(option) {
|
|
95
105
|
return isActiveOption(option) || activatedValues.value.includes(option.value);
|
|
96
106
|
}
|
|
@@ -159,30 +169,6 @@ function focusTab(index) {
|
|
|
159
169
|
tab?.focus();
|
|
160
170
|
scrollActiveTabIntoView();
|
|
161
171
|
}
|
|
162
|
-
/** Roving tabindex: arrow keys move focus and activate, matching the APG tabs pattern. */
|
|
163
|
-
const navigation = useListNavigation({
|
|
164
|
-
count: () => props.options.length,
|
|
165
|
-
isDisabled: (index) => !!props.options[index]?.disabled,
|
|
166
|
-
scrollToIndex: (index) => focusTab(index)
|
|
167
|
-
});
|
|
168
|
-
const { onKeydown: onNavKeydown } = useListKeyboardController({
|
|
169
|
-
keymap: {
|
|
170
|
-
ArrowRight: "next",
|
|
171
|
-
ArrowLeft: "previous",
|
|
172
|
-
Home: "first",
|
|
173
|
-
End: "last"
|
|
174
|
-
},
|
|
175
|
-
onCommand: (command) => {
|
|
176
|
-
if (!navigation.dispatch(command)) {
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
const option = props.options[navigation.activeIndex.value];
|
|
180
|
-
if (option) {
|
|
181
|
-
select(option.value);
|
|
182
|
-
}
|
|
183
|
-
return true;
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
172
|
function teardownScrollObservers() {
|
|
187
173
|
resizeObserver?.disconnect();
|
|
188
174
|
resizeObserver = null;
|
|
@@ -204,6 +190,20 @@ function setupScrollObservers() {
|
|
|
204
190
|
}
|
|
205
191
|
updateScrollState();
|
|
206
192
|
}
|
|
193
|
+
watch(activeValue, (value) => {
|
|
194
|
+
if (value !== undefined && !activatedValues.value.includes(value)) {
|
|
195
|
+
activatedValues.value = [...activatedValues.value, value];
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
immediate: true,
|
|
199
|
+
flush: "sync"
|
|
200
|
+
});
|
|
201
|
+
watch(() => props.options.map((option) => option.value), (values) => {
|
|
202
|
+
const kept = activatedValues.value.filter((value) => values.includes(value));
|
|
203
|
+
if (kept.length !== activatedValues.value.length) {
|
|
204
|
+
activatedValues.value = kept;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
207
|
watch(() => props.options.length, () => {
|
|
208
208
|
nextTick(setupScrollObservers);
|
|
209
209
|
}, { flush: "post" });
|
|
@@ -217,9 +217,6 @@ watch(() => [activeValue.value, props.options.length], () => {
|
|
|
217
217
|
if (index >= 0) {
|
|
218
218
|
navigation.setActiveIndex(index);
|
|
219
219
|
}
|
|
220
|
-
if (import.meta.env?.DEV && activeValue.value !== undefined && index < 0) {
|
|
221
|
-
console.warn(`[pxd] PTabs: active value "${String(activeValue.value)}" matches no option.`);
|
|
222
|
-
}
|
|
223
220
|
}, {
|
|
224
221
|
immediate: true,
|
|
225
222
|
flush: "post"
|
|
@@ -18,13 +18,13 @@ const props = defineProps({
|
|
|
18
18
|
});
|
|
19
19
|
const inVue3 = isVue3();
|
|
20
20
|
const inServer = isServer();
|
|
21
|
+
let isTeleported = false;
|
|
22
|
+
let homeLocation;
|
|
21
23
|
// A teleported subtree cannot be prerendered: the content never reaches the HTML, so
|
|
22
24
|
// hydration would rebuild it elsewhere and leave the server copy orphaned. Render it
|
|
23
25
|
// in place for the server pass and for the first client render, then move it.
|
|
24
26
|
const mounted = shallowRef(false);
|
|
25
27
|
const isDisabled = computed(() => props.disabled || !mounted.value);
|
|
26
|
-
let isTeleported = false;
|
|
27
|
-
let homeLocation;
|
|
28
28
|
const containerRef = shallowRef();
|
|
29
29
|
const targetEl = computed(() => {
|
|
30
30
|
const { disabled, to } = props;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { TextProps } from './types';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_7: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
default?: (props: typeof
|
|
4
|
+
default?: (props: typeof __VLS_7) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_base: import("vue").DefineComponent<TextProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TextProps> & Readonly<{}>, {
|
|
7
7
|
as: import("../../types/shared/props.js").ComponentAs;
|
|
8
|
-
align: "
|
|
8
|
+
align: "center" | "left" | "right";
|
|
9
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
11
|
declare const _default: typeof __VLS_export;
|
|
@@ -39,6 +39,17 @@ const props = defineProps({
|
|
|
39
39
|
required: false
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
const presetSize = {
|
|
43
|
+
"--text-xs": "text-xs",
|
|
44
|
+
"--text-sm": "sm:text-sm",
|
|
45
|
+
"--text-md": "md:text-md",
|
|
46
|
+
"--text-lg": "lg:text-lg",
|
|
47
|
+
"--text-xl": "xl:text-xl"
|
|
48
|
+
};
|
|
49
|
+
const computedStyle = computed(() => {
|
|
50
|
+
const { size } = props;
|
|
51
|
+
return getResponsiveValue(size, (typeof size === "object" ? size.xs : size) ?? "14px", (acc, bp, value) => acc[bp] = acc[`--text-${bp}`] = getCssUnitValue(value));
|
|
52
|
+
});
|
|
42
53
|
const { attrs, classes: variantClasses } = useTailwindVariant({
|
|
43
54
|
base: "pxd-text m-0 shrink-0",
|
|
44
55
|
variants: {
|
|
@@ -55,17 +66,6 @@ const { attrs, classes: variantClasses } = useTailwindVariant({
|
|
|
55
66
|
monospace: props.monospace,
|
|
56
67
|
secondary: props.secondary
|
|
57
68
|
}) });
|
|
58
|
-
const presetSize = {
|
|
59
|
-
"--text-xs": "text-xs",
|
|
60
|
-
"--text-sm": "sm:text-sm",
|
|
61
|
-
"--text-md": "md:text-md",
|
|
62
|
-
"--text-lg": "lg:text-lg",
|
|
63
|
-
"--text-xl": "xl:text-xl"
|
|
64
|
-
};
|
|
65
|
-
const computedStyle = computed(() => {
|
|
66
|
-
const { size } = props;
|
|
67
|
-
return getResponsiveValue(size, (typeof size === "object" ? size.xs : size) ?? "14px", (acc, bp, value) => acc[bp] = acc[`--text-${bp}`] = getCssUnitValue(value));
|
|
68
|
-
});
|
|
69
69
|
const computedClasses = computed(() => {
|
|
70
70
|
const classes = [variantClasses.value, ...Object.keys(computedStyle.value).map((bp) => presetSize[bp])].filter(Boolean);
|
|
71
71
|
return classes;
|
|
@@ -82,9 +82,9 @@ const emits = defineEmits([
|
|
|
82
82
|
"blur"
|
|
83
83
|
]);
|
|
84
84
|
const uniqueId = getUniqueId();
|
|
85
|
+
const isComposing = shallowRef(false);
|
|
85
86
|
const modelValue = useModelValue(props, emits);
|
|
86
87
|
const configProvider = useConfigProvider();
|
|
87
|
-
const isComposing = shallowRef(false);
|
|
88
88
|
const { isWordLimitShown, hasMaxLength, isWordLimitOutside, isWordLimitExceeded, wordLimitText, nativeMaxLength } = useWordLimit({
|
|
89
89
|
modelValue,
|
|
90
90
|
showWordLimit: () => props.showWordLimit,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ColorPreference } from '../../composables/use-color-scheme';
|
|
1
2
|
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
-
toggle: (args_0:
|
|
3
|
+
toggle: (args_0: ColorPreference) => any;
|
|
3
4
|
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
-
onToggle?: ((args_0:
|
|
5
|
+
onToggle?: ((args_0: ColorPreference) => any) | undefined;
|
|
5
6
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
7
|
declare const _default: typeof __VLS_export;
|
|
7
8
|
export default _default;
|