pxd 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/components/_internal/calendar-day.d.vue.ts +15 -13
- package/dist/components/_internal/dismiss-container.d.vue.ts +5 -3
- package/dist/components/_internal/fragment-container.d.vue.ts +5 -3
- package/dist/components/_internal/mention-editor.d.vue.ts +3 -1
- package/dist/components/_internal/mention-editor.vue +9 -3
- package/dist/components/_internal/step-item.d.vue.ts +5 -3
- package/dist/components/_internal/tree-node.d.vue.ts +37 -33
- package/dist/components/_internal/tree-node.vue +17 -3
- package/dist/components/active-graph/index.d.vue.ts +7 -5
- package/dist/components/active-graph/index.vue +63 -63
- package/dist/components/approval-card/index.d.vue.ts +5 -3
- package/dist/components/avatar/index.d.vue.ts +7 -5
- package/dist/components/avatar/index.vue +1 -1
- package/dist/components/backtop/index.d.vue.ts +6 -4
- package/dist/components/backtop/index.vue +71 -38
- package/dist/components/backtop/types.d.ts +1 -0
- package/dist/components/badge/index.d.vue.ts +7 -5
- package/dist/components/book/index.d.vue.ts +9 -7
- package/dist/components/border-beam/index.d.vue.ts +5 -3
- package/dist/components/breadcrumb/index.d.vue.ts +5 -3
- package/dist/components/breadcrumb-item/index.d.vue.ts +7 -5
- package/dist/components/browser/index.d.vue.ts +5 -3
- package/dist/components/browser/index.vue +1 -1
- package/dist/components/bubble/index.d.vue.ts +14 -12
- package/dist/components/bubble/index.vue +8 -6
- package/dist/components/bubble/types.d.ts +1 -1
- package/dist/components/bubble-group/index.d.vue.ts +17 -14
- package/dist/components/bubble-group/index.vue +121 -9
- package/dist/components/bubble-group/types.d.ts +1 -1
- package/dist/components/button/index.d.vue.ts +9 -7
- package/dist/components/button/index.vue +6 -3
- package/dist/components/button-group/index.d.vue.ts +5 -3
- package/dist/components/calendar/index.d.vue.ts +20 -18
- package/dist/components/card/index.d.vue.ts +9 -7
- package/dist/components/carousel/index.d.vue.ts +13 -11
- package/dist/components/checkbox/index.d.vue.ts +5 -3
- package/dist/components/checkbox-group/index.d.vue.ts +5 -3
- package/dist/components/checkerboard/index.d.vue.ts +5 -3
- package/dist/components/chip/index.d.vue.ts +5 -3
- package/dist/components/choicebox/index.d.vue.ts +5 -3
- package/dist/components/choicebox/types.d.ts +2 -2
- package/dist/components/choicebox-item/index.d.vue.ts +9 -7
- package/dist/components/choicebox-item/index.vue +9 -5
- package/dist/components/choicebox-item/types.d.ts +1 -1
- package/dist/components/code-block/index.d.vue.ts +7 -5
- package/dist/components/code-block/index.vue +6 -6
- package/dist/components/collapse/index.d.vue.ts +7 -5
- package/dist/components/collapse-group/index.d.vue.ts +5 -3
- package/dist/components/command-menu/index.d.vue.ts +12 -10
- package/dist/components/command-menu/index.vue +1 -1
- package/dist/components/config-provider/index.d.vue.ts +5 -14
- package/dist/components/confirm-popover/index.d.vue.ts +16 -14
- package/dist/components/confirm-popover/index.vue +1 -1
- package/dist/components/context-usage/index.vue +19 -12
- package/dist/components/copy-button/index.d.vue.ts +7 -5
- package/dist/components/countdown/index.d.vue.ts +17 -16
- package/dist/components/countdown/index.vue +3 -8
- package/dist/components/countdown/types.d.ts +1 -1
- package/dist/components/date-picker/index.d.vue.ts +5 -3
- package/dist/components/description/index.d.vue.ts +7 -5
- package/dist/components/description/index.vue +5 -2
- package/dist/components/description/types.d.ts +1 -1
- package/dist/components/drawer/index.d.vue.ts +13 -11
- package/dist/components/drawer/index.vue +1 -1
- package/dist/components/effort-slider/index.vue +47 -47
- package/dist/components/empty-state/index.d.vue.ts +11 -9
- package/dist/components/empty-state/index.vue +2 -2
- package/dist/components/empty-state/types.d.ts +1 -1
- package/dist/components/error/index.d.vue.ts +5 -3
- package/dist/components/error/index.vue +1 -1
- package/dist/components/fader/index.d.vue.ts +2 -0
- package/dist/components/fader/index.vue +55 -29
- package/dist/components/fader/types.d.ts +2 -1
- package/dist/components/grid/index.d.vue.ts +5 -3
- package/dist/components/grid-item/index.d.vue.ts +5 -3
- package/dist/components/hint/index.d.vue.ts +15 -13
- package/dist/components/hold-button/index.d.vue.ts +9 -7
- package/dist/components/hue-text/index.d.vue.ts +7 -5
- package/dist/components/image-preview/index.d.vue.ts +24 -7
- package/dist/components/image-preview/index.vue +122 -23
- package/dist/components/image-preview/types.d.ts +9 -1
- package/dist/components/input/index.d.vue.ts +7 -5
- package/dist/components/input/index.vue +1 -1
- package/dist/components/intersection-observer/index.d.vue.ts +7 -5
- package/dist/components/kbd/index.d.vue.ts +5 -3
- package/dist/components/kbd/index.vue +1 -1
- package/dist/components/label/index.d.vue.ts +5 -3
- package/dist/components/link-button/index.d.vue.ts +10 -8
- package/dist/components/list/index.d.vue.ts +12 -10
- package/dist/components/list/index.vue +36 -43
- package/dist/components/list/types.d.ts +5 -5
- package/dist/components/list-group/index.vue +1 -1
- package/dist/components/list-item/index.d.vue.ts +5 -3
- package/dist/components/list-item/index.vue +16 -6
- package/dist/components/loading-dots/index.vue +0 -1
- package/dist/components/loading-mask/index.d.vue.ts +13 -1
- package/dist/components/loading-mask/index.vue +5 -3
- package/dist/components/marching-ants/index.d.vue.ts +6 -4
- package/dist/components/marquee/index.d.vue.ts +12 -10
- package/dist/components/material/index.d.vue.ts +5 -3
- package/dist/components/mention/index.d.vue.ts +17 -13
- package/dist/components/mention/index.vue +35 -3
- package/dist/components/mention/types.d.ts +11 -0
- package/dist/components/menu/index.d.vue.ts +16 -14
- package/dist/components/message/index.d.vue.ts +1 -1
- package/dist/components/modal/index.d.vue.ts +13 -11
- package/dist/components/modal/index.vue +2 -2
- package/dist/components/note/index.d.vue.ts +9 -7
- package/dist/components/number-input/index.d.vue.ts +15 -13
- package/dist/components/number-input/index.vue +7 -3
- package/dist/components/overlay/index.d.vue.ts +5 -3
- package/dist/components/pagination/index.d.vue.ts +5 -3
- package/dist/components/pagination/index.vue +2 -2
- package/dist/components/pin-input/index.d.vue.ts +1 -1
- package/dist/components/pin-input/index.vue +1 -1
- package/dist/components/placeholder/index.d.vue.ts +5 -3
- package/dist/components/popover/index.vue +4 -5
- package/dist/components/progress/index.d.vue.ts +5 -3
- package/dist/components/project-banner/index.d.vue.ts +9 -7
- package/dist/components/radial-burst/index.d.vue.ts +5 -3
- package/dist/components/radio/index.d.vue.ts +5 -3
- package/dist/components/radio-group/index.d.vue.ts +5 -3
- package/dist/components/rating/index.d.vue.ts +1 -1
- package/dist/components/reactions/index.d.vue.ts +5 -3
- package/dist/components/reasoning/index.d.vue.ts +6 -4
- package/dist/components/reasoning/index.vue +14 -12
- package/dist/components/reasoning/types.d.ts +5 -7
- package/dist/components/resizable/index.d.vue.ts +11 -9
- package/dist/components/resizable/index.vue +2 -2
- package/dist/components/reveal/index.d.vue.ts +6 -4
- package/dist/components/rolling-number/index.d.vue.ts +1 -1
- package/dist/components/scroll-progress/index.d.vue.ts +7 -5
- package/dist/components/scroll-text/index.d.vue.ts +6 -3
- package/dist/components/scroll-text/index.vue +11 -2
- package/dist/components/scroll-text/types.d.ts +1 -0
- package/dist/components/scrollable/index.d.vue.ts +5 -3
- package/dist/components/scrollable/index.vue +119 -179
- package/dist/components/search-input/index.d.vue.ts +7 -5
- package/dist/components/select/index.d.vue.ts +22 -20
- package/dist/components/select/index.vue +2 -2
- package/dist/components/shimmer-text/index.d.vue.ts +6 -4
- package/dist/components/skeleton/index.d.vue.ts +5 -3
- package/dist/components/slider/index.vue +74 -74
- package/dist/components/spinner/index.vue +0 -1
- package/dist/components/spinner-dots/index.vue +0 -1
- package/dist/components/split-button/index.d.vue.ts +18 -16
- package/dist/components/stack/index.d.vue.ts +5 -3
- package/dist/components/steps/index.d.vue.ts +9 -7
- package/dist/components/steps/index.vue +3 -3
- package/dist/components/stick-to-bottom/index.d.vue.ts +13 -10
- package/dist/components/stick-to-bottom/index.vue +25 -10
- package/dist/components/stick-to-bottom/types.d.ts +2 -1
- package/dist/components/swipe-cell/index.d.vue.ts +21 -19
- package/dist/components/switch/index.d.vue.ts +5 -3
- package/dist/components/switch/index.vue +1 -1
- package/dist/components/switch-item/index.d.vue.ts +5 -3
- package/dist/components/tabs/index.vue +1 -1
- package/dist/components/teleport/index.d.vue.ts +7 -5
- package/dist/components/text/index.d.vue.ts +5 -3
- package/dist/components/textarea/index.vue +1 -1
- package/dist/components/time-picker/index.d.vue.ts +5 -3
- package/dist/components/time-picker/index.vue +3 -8
- package/dist/components/timeline-item/index.d.vue.ts +7 -5
- package/dist/components/toc/index.d.vue.ts +11 -9
- package/dist/components/toc/index.vue +81 -62
- package/dist/components/todo-list/index.d.vue.ts +25 -23
- package/dist/components/todo-list/index.vue +2 -3
- package/dist/components/todo-list/types.d.ts +1 -1
- package/dist/components/toggle/index.d.vue.ts +7 -5
- package/dist/components/toggle/index.vue +1 -1
- package/dist/components/toggle-button/index.d.vue.ts +5 -3
- package/dist/components/toggle-button/index.vue +1 -1
- package/dist/components/toggle-button-group/index.d.vue.ts +5 -3
- package/dist/components/tool-call/index.d.vue.ts +15 -1
- package/dist/components/tool-call/index.vue +26 -16
- package/dist/components/tooltip/index.d.vue.ts +11 -9
- package/dist/components/tour/index.d.vue.ts +2 -2
- package/dist/components/tour/index.vue +1 -1
- package/dist/components/tour/types.d.ts +1 -1
- package/dist/components/tree/index.d.vue.ts +44 -42
- package/dist/components/tree/index.vue +16 -12
- package/dist/components/virtual-list/index.d.vue.ts +13 -10
- package/dist/components/virtual-list/index.vue +10 -5
- package/dist/components/virtual-list/types.d.ts +2 -1
- package/dist/composables/_internal/use-details-collapse.d.ts +2 -1
- package/dist/composables/_internal/use-focus-trap.d.ts +1 -2
- package/dist/composables/_internal/use-forward-ref-expose.d.ts +1 -1
- package/dist/composables/_internal/use-list-keyboard-controller.d.ts +1 -1
- package/dist/composables/_internal/use-list-navigation.d.ts +2 -1
- package/dist/composables/_internal/use-list-search.d.ts +2 -1
- package/dist/composables/_internal/use-list-search.js +1 -3
- package/dist/composables/_internal/use-mention-editor.d.ts +10 -5
- package/dist/composables/_internal/use-mention-editor.js +97 -25
- package/dist/composables/_internal/use-message-group.d.ts +1 -1
- package/dist/composables/_internal/use-overlay-manager.d.ts +1 -1
- package/dist/composables/_internal/use-remote-search.d.ts +2 -1
- package/dist/composables/_internal/use-selected-list-item.d.ts +1 -1
- package/dist/composables/_internal/use-swipe-gesture.d.ts +1 -2
- package/dist/composables/_internal/use-tailwind-variant.js +1 -1
- package/dist/composables/_internal/use-tour-target.d.ts +1 -1
- package/dist/composables/_internal/use-tree.d.ts +2 -2
- package/dist/composables/_internal/use-word-limit.d.ts +2 -1
- package/dist/composables/use-countdown.d.ts +2 -7
- package/dist/composables/use-countdown.js +6 -6
- package/dist/composables/use-deferred-value.d.ts +2 -1
- package/dist/composables/use-delay-change.d.ts +2 -1
- package/dist/composables/use-delay-destroy.d.ts +2 -2
- package/dist/composables/use-intersection-observer.d.ts +1 -1
- package/dist/composables/use-mutation-observer.d.ts +1 -1
- package/dist/composables/use-mutation-observer.js +4 -1
- package/dist/composables/use-outside-click.d.ts +1 -2
- package/dist/composables/use-repeat-action.d.ts +1 -2
- package/dist/composables/use-resize-observer.d.ts +1 -1
- package/dist/composables/use-scrollspy.d.ts +2 -1
- package/dist/composables/use-stick-to-bottom.d.ts +6 -2
- package/dist/composables/use-stick-to-bottom.js +18 -2
- package/dist/composables/use-virtual-list.d.ts +9 -3
- package/dist/composables/use-virtual-list.js +92 -48
- package/dist/constants/size.d.ts +1 -0
- package/dist/constants/size.js +1 -0
- package/dist/constants/tooltip-variants.d.ts +1 -1
- package/dist/constants/tooltip-variants.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/en-us.d.ts +0 -11
- package/dist/locales/en-us.js +0 -11
- package/dist/locales/zh-cn.d.ts +0 -11
- package/dist/locales/zh-cn.js +0 -11
- package/dist/styles/styles.css +2 -2
- package/dist/types/shared/props.d.ts +4 -0
- package/dist/types/shared/utils.d.ts +4 -1
- package/dist/utils/_internal/mention-html.d.ts +32 -0
- package/dist/utils/_internal/mention-html.js +45 -17
- package/dist/utils/_internal/observer.d.ts +2 -1
- package/dist/utils/dom.d.ts +5 -6
- package/dist/utils/dom.js +5 -31
- package/dist/utils/event.d.ts +0 -1
- package/dist/utils/event.js +0 -3
- package/dist/utils/helper.d.ts +1 -4
- package/dist/utils/mention-html.js +13 -38
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +12 -12
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import type { CountdownProps } from './types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
default?: (props: {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
times: {
|
|
7
|
+
dd: string;
|
|
8
|
+
hh: string;
|
|
9
|
+
mm: string;
|
|
10
|
+
ss: string;
|
|
11
|
+
ms: string;
|
|
12
|
+
};
|
|
13
|
+
}) => any;
|
|
10
14
|
};
|
|
11
15
|
};
|
|
12
|
-
type __VLS_Slots =
|
|
13
|
-
default?: (props: typeof __VLS_1) => any;
|
|
14
|
-
};
|
|
16
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
15
17
|
declare const __VLS_base: import("vue").DefineComponent<CountdownProps, {
|
|
16
18
|
reset: () => void;
|
|
17
19
|
times: import("vue").ComputedRef<{
|
|
@@ -22,21 +24,20 @@ declare const __VLS_base: import("vue").DefineComponent<CountdownProps, {
|
|
|
22
24
|
ms: string;
|
|
23
25
|
}>;
|
|
24
26
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
-
change: (
|
|
27
|
+
change: (enabled: boolean) => any;
|
|
26
28
|
reset: () => any;
|
|
27
29
|
finish: () => any;
|
|
28
30
|
}, string, import("vue").PublicProps, Readonly<CountdownProps> & Readonly<{
|
|
29
|
-
onChange?: ((
|
|
31
|
+
onChange?: ((enabled: boolean) => any) | undefined;
|
|
30
32
|
onReset?: (() => any) | undefined;
|
|
31
33
|
onFinish?: (() => any) | undefined;
|
|
32
34
|
}>, {
|
|
33
|
-
duration: number;
|
|
34
35
|
format: string;
|
|
35
36
|
millisecond: boolean;
|
|
36
|
-
|
|
37
|
+
duration: number;
|
|
38
|
+
enabled: boolean;
|
|
37
39
|
endTime: number;
|
|
38
40
|
autoReset: boolean;
|
|
39
|
-
precision: number;
|
|
40
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
42
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
42
43
|
declare const _default: typeof __VLS_export;
|
|
@@ -3,7 +3,7 @@ import { computed, onBeforeUnmount } from "vue";
|
|
|
3
3
|
import { useCountdown } from "../../composables/use-countdown.js";
|
|
4
4
|
import { dayjs, dayjsDurationPlugin, dayjsMillisecondTokenPlugin } from "../../utils/date.js";
|
|
5
5
|
defineOptions({
|
|
6
|
-
name: "
|
|
6
|
+
name: "PCountdown",
|
|
7
7
|
inheritAttrs: false
|
|
8
8
|
});
|
|
9
9
|
const props = defineProps({
|
|
@@ -16,7 +16,7 @@ const props = defineProps({
|
|
|
16
16
|
type: Boolean,
|
|
17
17
|
required: false
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
enabled: {
|
|
20
20
|
type: Boolean,
|
|
21
21
|
required: false,
|
|
22
22
|
default: false
|
|
@@ -40,11 +40,6 @@ const props = defineProps({
|
|
|
40
40
|
required: false,
|
|
41
41
|
default: 0
|
|
42
42
|
},
|
|
43
|
-
precision: {
|
|
44
|
-
type: Number,
|
|
45
|
-
required: false,
|
|
46
|
-
default: 0
|
|
47
|
-
},
|
|
48
43
|
millisecond: {
|
|
49
44
|
type: Boolean,
|
|
50
45
|
required: false,
|
|
@@ -95,7 +90,7 @@ defineExpose({
|
|
|
95
90
|
class="pxd-countdown relative w-max max-w-full leading-none tabular-nums text-trim-both"
|
|
96
91
|
v-bind="$attrs"
|
|
97
92
|
>
|
|
98
|
-
<slot :
|
|
93
|
+
<slot :enabled="enabled" :times="times">
|
|
99
94
|
{{ displayTimes }}
|
|
100
95
|
</slot>
|
|
101
96
|
</div>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ComponentDateTimeValue } from '../../types/shared/props';
|
|
2
2
|
import type { DatePickerProps } from './types';
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
declare const __VLS_template: () => {
|
|
4
|
+
__VLS_Slots: {
|
|
5
|
+
suffix?: (props: {}) => any;
|
|
6
|
+
};
|
|
6
7
|
};
|
|
8
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
7
9
|
declare const __VLS_base: import("vue").DefineComponent<DatePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
10
|
change: (args_0: ComponentDateTimeValue) => any;
|
|
9
11
|
"update:model-value": (args_0: ComponentDateTimeValue) => any;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { DescriptionProps } from './types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} & {
|
|
6
|
-
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
title?: (props: {}) => any;
|
|
5
|
+
} & {
|
|
6
|
+
description?: (props: {}) => any;
|
|
7
|
+
};
|
|
7
8
|
};
|
|
9
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
8
10
|
declare const __VLS_base: import("vue").DefineComponent<DescriptionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DescriptionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
11
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
12
|
declare const _default: typeof __VLS_export;
|
|
@@ -15,7 +15,7 @@ defineProps({
|
|
|
15
15
|
required: false
|
|
16
16
|
},
|
|
17
17
|
description: {
|
|
18
|
-
type:
|
|
18
|
+
type: null,
|
|
19
19
|
required: false
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -34,7 +34,10 @@ defineProps({
|
|
|
34
34
|
<InformationIcon class="text-base scale-125" />
|
|
35
35
|
</PTooltip>
|
|
36
36
|
</dt>
|
|
37
|
-
<dd
|
|
37
|
+
<dd
|
|
38
|
+
v-if="description || $slots.description"
|
|
39
|
+
class="pxd-description--description text-sm font-medium leading-4 text-foreground empty:hidden"
|
|
40
|
+
>
|
|
38
41
|
<slot name="description">
|
|
39
42
|
{{ description }}
|
|
40
43
|
</slot>
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { DrawerProps } from './types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} & {
|
|
6
|
-
|
|
7
|
-
} & {
|
|
8
|
-
|
|
9
|
-
} & {
|
|
10
|
-
|
|
11
|
-
} & {
|
|
12
|
-
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
header?: (props: {}) => any;
|
|
5
|
+
} & {
|
|
6
|
+
title?: (props: {}) => any;
|
|
7
|
+
} & {
|
|
8
|
+
subtitle?: (props: {}) => any;
|
|
9
|
+
} & {
|
|
10
|
+
default?: (props: {}) => any;
|
|
11
|
+
} & {
|
|
12
|
+
footer?: (props: {}) => any;
|
|
13
|
+
};
|
|
13
14
|
};
|
|
15
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
14
16
|
declare const __VLS_base: import("vue").DefineComponent<DrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
17
|
change: (args_0: boolean) => any;
|
|
16
18
|
"update:model-value": (visible: boolean) => any;
|
|
@@ -211,7 +211,7 @@ watch(() => isVisible.value, (visible) => {
|
|
|
211
211
|
</header>
|
|
212
212
|
|
|
213
213
|
<div
|
|
214
|
-
class="pxd-drawer--content p-5 empty:py-2.5 h-full flex-1
|
|
214
|
+
class="pxd-drawer--content p-5 empty:py-2.5 h-full flex-1 overflow-auto"
|
|
215
215
|
:class="contentClass"
|
|
216
216
|
>
|
|
217
217
|
<slot />
|
|
@@ -52,22 +52,6 @@ const props = defineProps({
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
const emits = defineEmits(["change", "update:model-value"]);
|
|
55
|
-
const configProvider = useConfigProvider();
|
|
56
|
-
const modelValue = useModelValue(props, emits, { withChange: false });
|
|
57
|
-
const { attrs, classes } = useTailwindVariant({
|
|
58
|
-
base: "pxd-effort-slider--track group relative flex w-full max-w-full shrink-0 touch-none items-center rounded-full bg-gray-200 select-none",
|
|
59
|
-
variants: {
|
|
60
|
-
size: {
|
|
61
|
-
sm: "h-2",
|
|
62
|
-
md: "h-2.5",
|
|
63
|
-
lg: "h-3.5"
|
|
64
|
-
},
|
|
65
|
-
disabled: { true: "cursor-not-allowed" }
|
|
66
|
-
}
|
|
67
|
-
}, { selection: () => ({
|
|
68
|
-
size: props.size || configProvider.size,
|
|
69
|
-
disabled: props.disabled
|
|
70
|
-
}) });
|
|
71
55
|
const thumbClasses = createTailwindVariant({
|
|
72
56
|
base: "pxd-effort-slider--thumb group rounded-xs absolute -translate-x-1/2 transform-gpu touch-none bg-none self-focus-ring outline-none motion-safe:before:transition-appearance",
|
|
73
57
|
variants: {
|
|
@@ -87,6 +71,11 @@ let lastUpdatedValue = null;
|
|
|
87
71
|
let stopMoveListener = null;
|
|
88
72
|
const PARTICLE_COUNT = 16;
|
|
89
73
|
const PARTICLE_DURATION = 2;
|
|
74
|
+
const scheduleUpdate = throttleByRaf(() => {
|
|
75
|
+
if (lastClientX !== null) {
|
|
76
|
+
updateFromPosition(lastClientX);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
90
79
|
const trackRef = shallowRef();
|
|
91
80
|
const labelRef = shallowRef();
|
|
92
81
|
const dragging = shallowRef(false);
|
|
@@ -118,32 +107,6 @@ const percentage = computed(() => {
|
|
|
118
107
|
return count > 1 ? currentIndex.value / (count - 1) * 100 : 100;
|
|
119
108
|
});
|
|
120
109
|
const labelVisible = computed(() => dragging.value || focused.value);
|
|
121
|
-
function clamp(value, lower, upper) {
|
|
122
|
-
return Math.min(Math.max(value, lower), upper);
|
|
123
|
-
}
|
|
124
|
-
function particleSeed(index, salt) {
|
|
125
|
-
const value = Math.sin(index * 127.1 + salt * 311.7) * 43758.5453;
|
|
126
|
-
return value - Math.floor(value);
|
|
127
|
-
}
|
|
128
|
-
function updateLabelShift() {
|
|
129
|
-
const label = labelRef.value;
|
|
130
|
-
const track = trackRef.value;
|
|
131
|
-
if (!label || !track) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
// Layout pixels: `getBoundingClientRect()` reports the box already scaled by an ancestor
|
|
135
|
-
// zoom or transform, while the shift below is applied in unscaled pixels.
|
|
136
|
-
const trackWidth = track.clientWidth;
|
|
137
|
-
const labelWidth = label.offsetWidth;
|
|
138
|
-
if (!trackWidth || labelWidth > trackWidth) {
|
|
139
|
-
labelShift.value = 0;
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
const center = percentage.value / 100 * trackWidth;
|
|
143
|
-
const half = labelWidth / 2;
|
|
144
|
-
// The label stays inside the track, so at the ends it stops at the track edge.
|
|
145
|
-
labelShift.value = clamp(center, half, trackWidth - half) - center;
|
|
146
|
-
}
|
|
147
110
|
const tickList = computed(() => {
|
|
148
111
|
const count = levelCount.value;
|
|
149
112
|
return Array.from({ length: Math.max(0, count - 2) }, (_, index) => {
|
|
@@ -181,6 +144,48 @@ const particleList = computed(() => {
|
|
|
181
144
|
};
|
|
182
145
|
});
|
|
183
146
|
});
|
|
147
|
+
const configProvider = useConfigProvider();
|
|
148
|
+
const modelValue = useModelValue(props, emits, { withChange: false });
|
|
149
|
+
const { attrs, classes } = useTailwindVariant({
|
|
150
|
+
base: "pxd-effort-slider--track group relative flex w-full max-w-full shrink-0 touch-none items-center rounded-full bg-gray-200 select-none",
|
|
151
|
+
variants: {
|
|
152
|
+
size: {
|
|
153
|
+
sm: "h-2",
|
|
154
|
+
md: "h-2.5",
|
|
155
|
+
lg: "h-3.5"
|
|
156
|
+
},
|
|
157
|
+
disabled: { true: "cursor-not-allowed" }
|
|
158
|
+
}
|
|
159
|
+
}, { selection: () => ({
|
|
160
|
+
size: props.size || configProvider.size,
|
|
161
|
+
disabled: props.disabled
|
|
162
|
+
}) });
|
|
163
|
+
function clamp(value, lower, upper) {
|
|
164
|
+
return Math.min(Math.max(value, lower), upper);
|
|
165
|
+
}
|
|
166
|
+
function particleSeed(index, salt) {
|
|
167
|
+
const value = Math.sin(index * 127.1 + salt * 311.7) * 43758.5453;
|
|
168
|
+
return value - Math.floor(value);
|
|
169
|
+
}
|
|
170
|
+
function updateLabelShift() {
|
|
171
|
+
const label = labelRef.value;
|
|
172
|
+
const track = trackRef.value;
|
|
173
|
+
if (!label || !track) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
// Layout pixels: `getBoundingClientRect()` reports the box already scaled by an ancestor
|
|
177
|
+
// zoom or transform, while the shift below is applied in unscaled pixels.
|
|
178
|
+
const trackWidth = track.clientWidth;
|
|
179
|
+
const labelWidth = label.offsetWidth;
|
|
180
|
+
if (!trackWidth || labelWidth > trackWidth) {
|
|
181
|
+
labelShift.value = 0;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const center = percentage.value / 100 * trackWidth;
|
|
185
|
+
const half = labelWidth / 2;
|
|
186
|
+
// The label stays inside the track, so at the ends it stops at the track edge.
|
|
187
|
+
labelShift.value = clamp(center, half, trackWidth - half) - center;
|
|
188
|
+
}
|
|
184
189
|
function setValue(index) {
|
|
185
190
|
const option = optionList.value[index];
|
|
186
191
|
if (!option) {
|
|
@@ -218,11 +223,6 @@ function updateFromPosition(clientX) {
|
|
|
218
223
|
// what this drag emitted, not against `modelValue`.
|
|
219
224
|
lastUpdatedValue = setValue(index);
|
|
220
225
|
}
|
|
221
|
-
const scheduleUpdate = throttleByRaf(() => {
|
|
222
|
-
if (lastClientX !== null) {
|
|
223
|
-
updateFromPosition(lastClientX);
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
226
|
function onTrackPointerdown(ev) {
|
|
227
227
|
if (props.disabled || dragging.value) {
|
|
228
228
|
return;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { EmptyStateProps } from './types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} & {
|
|
6
|
-
|
|
7
|
-
} & {
|
|
8
|
-
|
|
9
|
-
} & {
|
|
10
|
-
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
icon?: (props: {}) => any;
|
|
5
|
+
} & {
|
|
6
|
+
title?: (props: {}) => any;
|
|
7
|
+
} & {
|
|
8
|
+
description?: (props: {}) => any;
|
|
9
|
+
} & {
|
|
10
|
+
default?: (props: {}) => any;
|
|
11
|
+
};
|
|
11
12
|
};
|
|
13
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
12
14
|
declare const __VLS_base: import("vue").DefineComponent<EmptyStateProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EmptyStateProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
15
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
16
|
declare const _default: typeof __VLS_export;
|
|
@@ -9,7 +9,7 @@ defineProps({
|
|
|
9
9
|
required: false
|
|
10
10
|
},
|
|
11
11
|
description: {
|
|
12
|
-
type:
|
|
12
|
+
type: null,
|
|
13
13
|
required: false
|
|
14
14
|
}
|
|
15
15
|
});
|
|
@@ -37,7 +37,7 @@ defineProps({
|
|
|
37
37
|
</slot>
|
|
38
38
|
</p>
|
|
39
39
|
|
|
40
|
-
<p class="pxd-empty-state--description text-
|
|
40
|
+
<p class="pxd-empty-state--description text-xs text-center text-foreground-secondary">
|
|
41
41
|
<slot name="description">
|
|
42
42
|
{{ description }}
|
|
43
43
|
</slot>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ErrorProps } from './types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
default?: (props: {}) => any;
|
|
5
|
+
};
|
|
5
6
|
};
|
|
7
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
6
8
|
declare const __VLS_base: import("vue").DefineComponent<ErrorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ErrorProps> & Readonly<{}>, {
|
|
7
9
|
variant: "default" | "card";
|
|
8
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { FaderProps } from './types';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<FaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FaderProps> & Readonly<{}>, {
|
|
3
|
+
size: number;
|
|
4
|
+
threshold: number;
|
|
3
5
|
direction: import("../../types/shared/props.js").ComponentDirection | "both";
|
|
4
6
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
7
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
3
|
+
import { useMutationObserver } from "../../composables/use-mutation-observer.js";
|
|
3
4
|
import { useResizeObserver } from "../../composables/use-resize-observer.js";
|
|
4
5
|
import { getElement } from "../../utils/dom.js";
|
|
5
6
|
import { cachedOff, cachedOn, throttleByRaf } from "../../utils/event.js";
|
|
@@ -11,62 +12,87 @@ defineOptions({
|
|
|
11
12
|
const props = defineProps({
|
|
12
13
|
size: {
|
|
13
14
|
type: Number,
|
|
14
|
-
required: false
|
|
15
|
+
required: false,
|
|
16
|
+
default: 16
|
|
15
17
|
},
|
|
16
18
|
color: {
|
|
17
19
|
type: String,
|
|
18
20
|
required: false
|
|
19
21
|
},
|
|
20
|
-
|
|
21
|
-
type:
|
|
22
|
-
required: false
|
|
22
|
+
threshold: {
|
|
23
|
+
type: Number,
|
|
24
|
+
required: false,
|
|
25
|
+
default: 16
|
|
23
26
|
},
|
|
24
27
|
direction: {
|
|
25
28
|
type: String,
|
|
26
29
|
required: false,
|
|
27
30
|
default: "both"
|
|
31
|
+
},
|
|
32
|
+
scrollTarget: {
|
|
33
|
+
type: null,
|
|
34
|
+
required: false
|
|
28
35
|
}
|
|
29
36
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
right: false,
|
|
36
|
-
bottom: false
|
|
37
|
-
});
|
|
37
|
+
const showTop = shallowRef(false);
|
|
38
|
+
const showLeft = shallowRef(false);
|
|
39
|
+
const showRight = shallowRef(false);
|
|
40
|
+
const showBottom = shallowRef(false);
|
|
41
|
+
const observedContent = shallowRef([]);
|
|
38
42
|
const computedStyle = computed(() => ({
|
|
39
43
|
"--fader-color": props.color,
|
|
40
44
|
"--fader-size": getCssUnitValue(props.size)
|
|
41
45
|
}));
|
|
42
46
|
const formattedContainer = computed(() => getElement(props.scrollTarget));
|
|
43
|
-
const
|
|
47
|
+
const updateFaders = throttleByRaf(() => {
|
|
44
48
|
const container = formattedContainer.value;
|
|
45
49
|
if (!container || !container.isConnected) {
|
|
46
50
|
return;
|
|
47
51
|
}
|
|
48
|
-
const { size
|
|
52
|
+
const { size, threshold } = props;
|
|
49
53
|
const { scrollLeft, scrollWidth, clientWidth, scrollTop, clientHeight, scrollHeight } = container;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
bottom: scrollTop + clientHeight < scrollHeight - DIFF_THRESHOLD
|
|
55
|
-
};
|
|
54
|
+
showLeft.value = scrollLeft >= size;
|
|
55
|
+
showRight.value = scrollLeft + clientWidth < scrollWidth - threshold;
|
|
56
|
+
showTop.value = scrollTop >= size;
|
|
57
|
+
showBottom.value = scrollTop + clientHeight < scrollHeight - threshold;
|
|
56
58
|
});
|
|
57
|
-
useResizeObserver(() =>
|
|
59
|
+
useResizeObserver(() => {
|
|
60
|
+
const container = formattedContainer.value;
|
|
61
|
+
return container ? [container, ...observedContent.value] : [];
|
|
62
|
+
}, updateFaders);
|
|
63
|
+
useMutationObserver(() => formattedContainer.value, (items) => {
|
|
64
|
+
if (items.some((item) => item.entry.type === "childList")) {
|
|
65
|
+
syncObservedContent();
|
|
66
|
+
}
|
|
67
|
+
updateFaders();
|
|
68
|
+
}, {
|
|
69
|
+
childList: true,
|
|
70
|
+
subtree: true,
|
|
71
|
+
attributes: true,
|
|
72
|
+
attributeFilter: ["class", "style"]
|
|
73
|
+
});
|
|
74
|
+
function syncObservedContent() {
|
|
75
|
+
const container = formattedContainer.value;
|
|
76
|
+
const next = container ? Array.from(container.children) : [];
|
|
77
|
+
const prev = observedContent.value;
|
|
78
|
+
if (prev.length === next.length && prev.every((el, i) => el === next[i])) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
observedContent.value = next;
|
|
82
|
+
}
|
|
58
83
|
watch(() => formattedContainer.value, (container, oldDom) => {
|
|
59
84
|
if (oldDom) {
|
|
60
|
-
cachedOff(oldDom, "scroll",
|
|
85
|
+
cachedOff(oldDom, "scroll", updateFaders);
|
|
61
86
|
}
|
|
62
87
|
if (!container) {
|
|
63
88
|
return;
|
|
64
89
|
}
|
|
65
|
-
cachedOn(container, "scroll",
|
|
90
|
+
cachedOn(container, "scroll", updateFaders, { passive: true });
|
|
91
|
+
syncObservedContent();
|
|
66
92
|
}, { immediate: true });
|
|
67
93
|
onBeforeUnmount(() => {
|
|
68
|
-
|
|
69
|
-
cachedOff(formattedContainer.value, "scroll",
|
|
94
|
+
updateFaders.cancel();
|
|
95
|
+
cachedOff(formattedContainer.value, "scroll", updateFaders);
|
|
70
96
|
});
|
|
71
97
|
</script>
|
|
72
98
|
|
|
@@ -79,14 +105,14 @@ onBeforeUnmount(() => {
|
|
|
79
105
|
v-bind="$attrs"
|
|
80
106
|
>
|
|
81
107
|
<div
|
|
82
|
-
v-if="
|
|
108
|
+
v-if="direction !== 'vertical'"
|
|
83
109
|
class="pxd-fader--item horizontal inset-0 absolute rounded-inherit before:default-transition-duration before:default-transition-timing-function after:default-transition-duration after:default-transition-timing-function"
|
|
84
|
-
:class="{ left:
|
|
110
|
+
:class="{ left: showLeft, right: showRight }"
|
|
85
111
|
/>
|
|
86
112
|
<div
|
|
87
|
-
v-if="
|
|
113
|
+
v-if="direction !== 'horizontal'"
|
|
88
114
|
class="pxd-fader--item vertical inset-0 absolute rounded-inherit before:default-transition-duration before:default-transition-timing-function after:default-transition-duration after:default-transition-timing-function"
|
|
89
|
-
:class="{ top:
|
|
115
|
+
:class="{ top: showTop, bottom: showBottom }"
|
|
90
116
|
/>
|
|
91
117
|
</div>
|
|
92
118
|
</template>
|
|
@@ -4,6 +4,7 @@ import type { ComponentPublicInstance } from 'vue'
|
|
|
4
4
|
export interface FaderProps {
|
|
5
5
|
size?: number
|
|
6
6
|
color?: string
|
|
7
|
-
|
|
7
|
+
threshold?: number
|
|
8
8
|
direction?: ComponentDirection | 'both'
|
|
9
|
+
scrollTarget?: string | HTMLElement | ComponentPublicInstance | null
|
|
9
10
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { GridProps } from './types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
default?: (props: {}) => any;
|
|
5
|
+
};
|
|
5
6
|
};
|
|
7
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
6
8
|
declare const __VLS_base: import("vue").DefineComponent<GridProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<GridProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
10
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { GridItemProps } from './types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
default?: (props: {}) => any;
|
|
5
|
+
};
|
|
5
6
|
};
|
|
7
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
6
8
|
declare const __VLS_base: import("vue").DefineComponent<GridItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<GridItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
10
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import type { HintProps, HintStatus } from './types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
declare const __VLS_template: () => {
|
|
3
|
+
__VLS_Slots: {
|
|
4
|
+
default?: (props: {
|
|
5
|
+
status: HintStatus;
|
|
6
|
+
}) => any;
|
|
7
|
+
} & {
|
|
8
|
+
content?: (props: {
|
|
9
|
+
status: HintStatus;
|
|
10
|
+
value: unknown;
|
|
11
|
+
error: unknown;
|
|
12
|
+
activeTrigger: HTMLElement | null;
|
|
13
|
+
activeTriggerIndex: number;
|
|
14
|
+
}) => any;
|
|
15
|
+
};
|
|
15
16
|
};
|
|
17
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
16
18
|
declare const __VLS_base: import("vue").DefineComponent<HintProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
19
|
close: () => any;
|
|
18
20
|
}, string, import("vue").PublicProps, Readonly<HintProps> & Readonly<{
|