pxd 0.1.3 → 0.1.6
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/dismiss-container.d.vue.ts +2 -2
- package/dist/components/_internal/dismiss-container.vue +2 -2
- package/dist/components/_internal/mention-editor.d.vue.ts +2 -3
- package/dist/components/_internal/mention-editor.vue +9 -7
- package/dist/components/_internal/step-item.vue +1 -1
- package/dist/components/_internal/tree-node.d.vue.ts +13 -1
- package/dist/components/_internal/tree-node.vue +43 -14
- package/dist/components/active-graph/index.d.vue.ts +1 -1
- package/dist/components/active-graph/index.vue +4 -18
- package/dist/components/active-graph/types.d.ts +1 -1
- package/dist/components/approval-card/index.d.vue.ts +2 -2
- package/dist/components/approval-card/index.vue +8 -4
- package/dist/components/approval-card/types.d.ts +1 -1
- package/dist/components/avatar/index.vue +1 -1
- package/dist/components/backtop/index.vue +1 -1
- package/dist/components/badge/index.vue +4 -2
- package/dist/components/badge/types.d.ts +7 -2
- package/dist/components/browser/index.vue +1 -1
- package/dist/components/bubble/index.vue +39 -18
- package/dist/components/bubble/types.d.ts +2 -1
- package/dist/components/bubble-group/index.vue +21 -8
- package/dist/components/bubble-group/types.d.ts +4 -4
- package/dist/components/button/index.vue +8 -7
- 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 +8 -8
- package/dist/components/calendar/types.d.ts +1 -1
- package/dist/components/card/index.vue +2 -2
- package/dist/components/carousel/index.d.vue.ts +0 -1
- package/dist/components/carousel/index.vue +22 -17
- package/dist/components/carousel/types.d.ts +0 -1
- package/dist/components/checkbox/index.d.vue.ts +2 -2
- package/dist/components/checkbox/index.vue +4 -4
- 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/index.vue +2 -2
- package/dist/components/checkbox-group/types.d.ts +1 -1
- package/dist/components/checkerboard/index.d.vue.ts +3 -1
- package/dist/components/checkerboard/index.vue +13 -2
- package/dist/components/checkerboard/types.d.ts +1 -0
- package/dist/components/choicebox/index.d.vue.ts +2 -2
- package/dist/components/choicebox/index.vue +2 -2
- package/dist/components/choicebox/types.d.ts +1 -1
- package/dist/components/choicebox-item/index.vue +3 -3
- package/dist/components/code-block/index.d.vue.ts +26 -0
- package/dist/components/code-block/index.vue +362 -0
- package/dist/components/code-block/types.d.ts +33 -0
- package/dist/components/collapse/index.d.vue.ts +3 -1
- package/dist/components/collapse/index.vue +34 -38
- package/dist/components/collapse/types.d.ts +3 -1
- package/dist/components/collapse-group/index.vue +3 -3
- package/dist/components/color-selector/index.d.vue.ts +2 -2
- package/dist/components/color-selector/index.vue +2 -2
- package/dist/components/color-selector/types.d.ts +1 -1
- package/dist/components/command-menu/index.d.vue.ts +2 -2
- package/dist/components/command-menu/index.vue +3 -4
- package/dist/components/command-menu/types.d.ts +1 -1
- package/dist/components/config-provider/index.d.vue.ts +4 -0
- package/dist/components/confirm-popover/index.d.vue.ts +9 -10
- package/dist/components/confirm-popover/index.vue +40 -19
- package/dist/components/confirm-popover/types.d.ts +7 -6
- package/dist/components/context-usage/index.d.vue.ts +6 -0
- package/dist/components/context-usage/index.vue +120 -0
- package/dist/components/context-usage/types.d.ts +13 -0
- package/dist/components/copy-button/index.vue +17 -13
- package/dist/components/copy-button/types.d.ts +3 -1
- package/dist/components/countdown/index.vue +1 -1
- package/dist/components/date-picker/index.d.vue.ts +2 -2
- package/dist/components/date-picker/index.vue +3 -3
- package/dist/components/date-picker/types.d.ts +1 -1
- package/dist/components/description/index.vue +2 -2
- package/dist/components/description/types.d.ts +3 -1
- package/dist/components/drawer/index.d.vue.ts +2 -2
- package/dist/components/drawer/index.vue +17 -23
- package/dist/components/drawer/types.d.ts +2 -2
- package/dist/components/effort-slider/index.d.vue.ts +2 -2
- package/dist/components/effort-slider/index.vue +63 -17
- package/dist/components/effort-slider/types.d.ts +3 -1
- package/dist/components/ellipsis-text/index.d.vue.ts +3 -3
- package/dist/components/ellipsis-text/index.vue +4 -4
- package/dist/components/ellipsis-text/types.d.ts +4 -2
- package/dist/components/empty-state/index.vue +1 -1
- package/dist/components/empty-state/types.d.ts +3 -1
- package/dist/components/error/index.vue +2 -2
- package/dist/components/feedback-bar/index.d.vue.ts +4 -4
- package/dist/components/feedback-bar/index.vue +4 -4
- package/dist/components/feedback-bar/types.d.ts +2 -2
- package/dist/components/gauge/index.vue +75 -79
- package/dist/components/gauge/types.d.ts +2 -0
- package/dist/components/hint/index.vue +2 -3
- package/dist/components/hold-button/index.d.vue.ts +4 -4
- package/dist/components/hold-button/index.vue +86 -75
- package/dist/components/hue-text/index.vue +2 -2
- package/dist/components/hue-text/types.d.ts +3 -1
- package/dist/components/image-preview/index.d.vue.ts +40 -0
- package/dist/components/image-preview/index.vue +376 -0
- package/dist/components/image-preview/types.d.ts +18 -0
- package/dist/components/index.d.ts +134 -0
- package/dist/components/index.js +5 -0
- package/dist/components/input/index.d.vue.ts +2 -2
- package/dist/components/input/index.vue +7 -6
- package/dist/components/input/types.d.ts +1 -1
- package/dist/components/kbd/index.vue +1 -1
- package/dist/components/link-button/index.vue +1 -1
- package/dist/components/link-button/types.d.ts +1 -1
- package/dist/components/list/index.d.vue.ts +2 -2
- package/dist/components/list/index.vue +4 -4
- package/dist/components/list/types.d.ts +1 -1
- package/dist/components/list-group/index.vue +7 -1
- package/dist/components/list-item/index.vue +21 -8
- package/dist/components/{_internal/loading-mask.d.vue.ts → loading-mask/index.d.vue.ts} +2 -4
- package/dist/components/{_internal/loading-mask.vue → loading-mask/index.vue} +1 -1
- package/dist/components/loading-mask/types.d.ts +3 -0
- package/dist/components/marquee/index.d.vue.ts +1 -1
- package/dist/components/marquee/index.vue +7 -3
- package/dist/components/marquee/types.d.ts +2 -2
- package/dist/components/mention/index.d.vue.ts +2 -2
- package/dist/components/mention/index.vue +2 -2
- package/dist/components/mention/types.d.ts +1 -1
- package/dist/components/menu/index.d.vue.ts +2 -2
- package/dist/components/menu/index.vue +2 -2
- package/dist/components/menu/types.d.ts +1 -1
- package/dist/components/message/index.vue +1 -1
- package/dist/components/modal/index.d.vue.ts +2 -2
- package/dist/components/modal/index.vue +17 -23
- package/dist/components/modal/types.d.ts +2 -2
- package/dist/components/more-button/index.d.vue.ts +4 -4
- package/dist/components/more-button/index.vue +4 -4
- package/dist/components/more-button/types.d.ts +3 -3
- package/dist/components/note/index.vue +2 -2
- package/dist/components/note/types.d.ts +1 -1
- package/dist/components/number-input/index.d.vue.ts +2 -2
- package/dist/components/number-input/index.vue +8 -8
- package/dist/components/number-input/types.d.ts +1 -1
- package/dist/components/overlay/index.d.vue.ts +2 -3
- package/dist/components/overlay/index.vue +6 -12
- package/dist/components/overlay/types.d.ts +2 -3
- package/dist/components/page-number/index.d.vue.ts +3 -3
- package/dist/components/page-number/index.vue +3 -3
- package/dist/components/page-number/types.d.ts +1 -1
- package/dist/components/pagination/index.vue +4 -4
- package/dist/components/pin-input/index.d.vue.ts +2 -2
- package/dist/components/pin-input/index.vue +8 -4
- package/dist/components/pin-input/types.d.ts +1 -1
- package/dist/components/placeholder/index.vue +3 -3
- package/dist/components/placeholder/types.d.ts +1 -1
- package/dist/components/popover/index.vue +92 -50
- package/dist/components/popover/types.d.ts +1 -1
- package/dist/components/project-banner/index.vue +22 -9
- package/dist/components/questionnaire/index.d.vue.ts +1 -0
- package/dist/components/questionnaire/index.vue +83 -85
- package/dist/components/questionnaire/types.d.ts +1 -3
- package/dist/components/radio/index.d.vue.ts +2 -2
- package/dist/components/radio/index.vue +3 -3
- 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/index.vue +2 -2
- package/dist/components/radio-group/types.d.ts +1 -1
- package/dist/components/rating/index.d.vue.ts +2 -2
- package/dist/components/rating/index.vue +2 -2
- package/dist/components/rating/types.d.ts +1 -1
- package/dist/components/reactions/index.d.vue.ts +34 -0
- package/dist/components/reactions/index.vue +143 -0
- package/dist/components/reactions/types.d.ts +23 -0
- package/dist/components/reasoning/index.d.vue.ts +2 -0
- package/dist/components/reasoning/index.vue +49 -30
- package/dist/components/reasoning/types.d.ts +9 -0
- package/dist/components/resizable/index.d.vue.ts +7 -2
- package/dist/components/resizable/index.vue +258 -109
- package/dist/components/resizable/types.d.ts +7 -1
- package/dist/components/rolling-number/index.vue +1 -1
- package/dist/components/scroll-text/index.d.vue.ts +1 -1
- package/dist/components/scroll-text/index.vue +2 -2
- package/dist/components/scroll-text/types.d.ts +2 -2
- package/dist/components/scrollable/index.d.vue.ts +3 -2
- package/dist/components/scrollable/types.d.ts +0 -15
- package/dist/components/search-input/index.d.vue.ts +5 -5
- package/dist/components/search-input/index.vue +1 -1
- package/dist/components/select/index.d.vue.ts +2 -2
- package/dist/components/select/index.vue +10 -8
- package/dist/components/select/types.d.ts +1 -1
- package/dist/components/shimmer-text/index.vue +1 -1
- package/dist/components/shimmer-text/types.d.ts +1 -1
- package/dist/components/slider/index.d.vue.ts +2 -3
- package/dist/components/slider/index.vue +17 -6
- package/dist/components/slider/types.d.ts +2 -1
- package/dist/components/snippet/index.vue +1 -5
- package/dist/components/snippet/types.d.ts +6 -2
- package/dist/components/spinner-dots/types.d.ts +1 -1
- package/dist/components/split-button/index.d.vue.ts +2 -2
- package/dist/components/split-button/index.vue +2 -2
- package/dist/components/split-button/types.d.ts +1 -1
- package/dist/components/steps/index.d.vue.ts +2 -2
- package/dist/components/steps/index.vue +2 -2
- package/dist/components/steps/types.d.ts +1 -1
- package/dist/components/stick-to-bottom/index.vue +3 -6
- package/dist/components/swipe-cell/index.d.vue.ts +2 -2
- package/dist/components/swipe-cell/index.vue +4 -4
- package/dist/components/swipe-cell/types.d.ts +1 -1
- package/dist/components/switch/index.d.vue.ts +2 -2
- package/dist/components/switch/index.vue +3 -3
- package/dist/components/switch/types.d.ts +1 -1
- package/dist/components/switch-item/index.vue +2 -2
- package/dist/components/tabs/index.d.vue.ts +2 -2
- package/dist/components/tabs/index.vue +3 -3
- package/dist/components/tabs/types.d.ts +1 -1
- package/dist/components/teleport/index.vue +20 -22
- package/dist/components/text/index.vue +1 -1
- package/dist/components/text/types.d.ts +1 -1
- package/dist/components/textarea/index.d.vue.ts +2 -2
- package/dist/components/textarea/index.vue +3 -2
- package/dist/components/textarea/types.d.ts +1 -1
- package/dist/components/theme-switcher/index.d.vue.ts +2 -3
- package/dist/components/theme-switcher/index.vue +7 -7
- package/dist/components/time-picker/index.d.vue.ts +2 -2
- package/dist/components/time-picker/index.vue +6 -6
- package/dist/components/time-picker/types.d.ts +1 -1
- package/dist/components/timeline-item/index.d.vue.ts +0 -1
- package/dist/components/timeline-item/index.vue +20 -4
- package/dist/components/timeline-item/types.d.ts +2 -2
- package/dist/components/toc/index.vue +1 -1
- package/dist/components/todo-list/index.d.vue.ts +4 -13
- package/dist/components/todo-list/index.vue +122 -133
- package/dist/components/todo-list/types.d.ts +5 -4
- package/dist/components/toggle/index.d.vue.ts +4 -4
- package/dist/components/toggle/index.vue +5 -5
- package/dist/components/toggle/types.d.ts +6 -6
- package/dist/components/toggle-button/index.d.vue.ts +2 -2
- package/dist/components/toggle-button/index.vue +13 -7
- package/dist/components/toggle-button/types.d.ts +4 -3
- package/dist/components/toggle-button-group/index.d.vue.ts +2 -2
- package/dist/components/toggle-button-group/index.vue +3 -2
- package/dist/components/toggle-button-group/types.d.ts +3 -3
- package/dist/components/tool-call/index.d.vue.ts +2 -0
- package/dist/components/tool-call/index.vue +139 -133
- package/dist/components/tool-call/types.d.ts +6 -1
- package/dist/components/tooltip/index.d.vue.ts +1 -1
- package/dist/components/tooltip/index.vue +1 -0
- package/dist/components/tour/index.d.vue.ts +2 -2
- package/dist/components/tour/index.vue +6 -6
- package/dist/components/tour/types.d.ts +5 -5
- package/dist/components/tree/index.d.vue.ts +31 -19
- package/dist/components/tree/index.vue +196 -103
- package/dist/components/tree/types.d.ts +22 -17
- package/dist/components/virtual-list/index.d.vue.ts +4 -4
- package/dist/components/virtual-list/index.vue +3 -3
- package/dist/components/virtual-list/types.d.ts +10 -8
- package/dist/composables/_internal/use-code-highlight.d.ts +12 -0
- package/dist/composables/_internal/use-code-highlight.js +49 -0
- package/dist/composables/_internal/use-details-collapse.d.ts +7 -0
- package/dist/composables/_internal/use-details-collapse.js +68 -0
- package/dist/composables/_internal/use-list-selection.d.ts +1 -1
- package/dist/composables/_internal/use-list-selection.js +2 -2
- package/dist/composables/_internal/use-lock-scroll.js +5 -22
- package/dist/composables/_internal/use-model-value.d.ts +1 -1
- package/dist/composables/_internal/use-model-value.js +1 -1
- package/dist/composables/_internal/use-overlay-manager.d.ts +0 -1
- package/dist/composables/_internal/use-overlay-manager.js +2 -18
- package/dist/composables/_internal/use-popover-responsive.js +9 -12
- package/dist/composables/_internal/use-swipe-gesture.d.ts +1 -1
- package/dist/composables/_internal/use-swipe-gesture.js +5 -4
- package/dist/composables/_internal/use-tree.d.ts +32 -6
- package/dist/composables/_internal/use-tree.js +89 -54
- package/dist/composables/use-color-scheme.d.ts +1 -1
- package/dist/composables/use-color-scheme.js +7 -3
- package/dist/composables/use-countdown.d.ts +1 -1
- package/dist/composables/use-countdown.js +9 -9
- package/dist/composables/use-loading-bar.js +4 -0
- package/dist/composables/use-media-query.d.ts +3 -1
- package/dist/composables/use-media-query.js +33 -51
- package/dist/composables/use-outside-click.d.ts +2 -1
- package/dist/composables/use-outside-click.js +3 -7
- package/dist/composables/use-repeat-action.d.ts +1 -1
- package/dist/composables/use-repeat-action.js +3 -3
- package/dist/composables/use-stick-to-bottom.d.ts +5 -0
- package/dist/composables/use-stick-to-bottom.js +45 -31
- package/dist/composables/use-virtual-list.d.ts +1 -1
- package/dist/constants/size.d.ts +1 -0
- package/dist/constants/size.js +7 -6
- package/dist/constants/tooltip-variants.d.ts +2 -2
- package/dist/constants/tooltip-variants.js +3 -3
- package/dist/contexts/collapse.d.ts +1 -1
- package/dist/locales/en-us.d.ts +4 -0
- package/dist/locales/en-us.js +4 -0
- package/dist/locales/zh-cn.d.ts +4 -0
- package/dist/locales/zh-cn.js +4 -0
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tw.css +20 -10
- package/package.json +10 -9
- package/volar.d.ts +5 -0
- package/dist/components/bubble-group/types.js +0 -0
- package/dist/components/virtual-list/types.js +0 -0
- package/dist/composables/_internal/use-collapse-motion.d.ts +0 -6
- package/dist/composables/_internal/use-collapse-motion.js +0 -85
|
@@ -11,7 +11,7 @@ defineOptions({
|
|
|
11
11
|
inheritAttrs: false,
|
|
12
12
|
model: {
|
|
13
13
|
prop: "modelValue",
|
|
14
|
-
event: "update:
|
|
14
|
+
event: "update:model-value"
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
const props = defineProps({
|
|
@@ -25,11 +25,26 @@ const props = defineProps({
|
|
|
25
25
|
required: false,
|
|
26
26
|
default: "percent"
|
|
27
27
|
},
|
|
28
|
+
reverse: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
required: false,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
28
33
|
minSize: {
|
|
29
34
|
type: Array,
|
|
30
35
|
required: false,
|
|
31
36
|
default: () => [0, 0]
|
|
32
37
|
},
|
|
38
|
+
collapsed: {
|
|
39
|
+
type: [Boolean, null],
|
|
40
|
+
required: false,
|
|
41
|
+
default: null
|
|
42
|
+
},
|
|
43
|
+
dblclickAction: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false,
|
|
46
|
+
default: "reset"
|
|
47
|
+
},
|
|
33
48
|
handle: {
|
|
34
49
|
type: Boolean,
|
|
35
50
|
required: false,
|
|
@@ -54,36 +69,43 @@ const props = defineProps({
|
|
|
54
69
|
const emits = defineEmits([
|
|
55
70
|
"change",
|
|
56
71
|
"reset",
|
|
57
|
-
"update:
|
|
72
|
+
"update:collapsed",
|
|
73
|
+
"update:model-value"
|
|
58
74
|
]);
|
|
59
75
|
const PERCENT_TOTAL = 100;
|
|
60
76
|
const KEYBOARD_STEP = 1;
|
|
61
77
|
const KEYBOARD_STEP_LARGE = 10;
|
|
78
|
+
const UNFOLD_DISTANCE = 10;
|
|
62
79
|
const uid = getUniqueId("pxd-resizable");
|
|
63
80
|
const leadingId = `${uid}-leading`;
|
|
64
81
|
const trailingId = `${uid}-trailing`;
|
|
65
|
-
const initialSizes = toPair(isNil(props.modelValue) ? props.defaultValue : props.modelValue);
|
|
66
82
|
let drag = null;
|
|
67
|
-
const flushResize = throttleByRaf(
|
|
83
|
+
const flushResize = throttleByRaf(flushPointer);
|
|
68
84
|
const containerRef = shallowRef();
|
|
69
85
|
const handleRef = shallowRef();
|
|
70
86
|
const containerSize = shallowRef(0);
|
|
87
|
+
const innerSizes = shallowRef(toPair(props.defaultValue));
|
|
88
|
+
const innerCollapsed = shallowRef(false);
|
|
89
|
+
/** Pointer position in `unit` during a drag; unclamped so a leftward overshoot is not swallowed. */
|
|
90
|
+
const dragPointer = shallowRef(null);
|
|
91
|
+
const dragCollapsed = shallowRef(false);
|
|
92
|
+
/** Leading size to restore when a folded panel is expanded without dragging. */
|
|
93
|
+
const foldedFrom = shallowRef(null);
|
|
71
94
|
const isControlled = computed(() => !isNil(props.modelValue));
|
|
72
95
|
const isPixel = computed(() => props.unit === "px");
|
|
73
|
-
|
|
96
|
+
/** `reverse` only means anything where a panel fills the rest, i.e. under `px`. */
|
|
97
|
+
const isReversed = computed(() => isPixel.value && props.reverse);
|
|
74
98
|
/** Percent sizes are measured against 100; pixel sizes fill the measured container. */
|
|
75
99
|
const totalSize = computed(() => isPixel.value ? containerSize.value : PERCENT_TOTAL);
|
|
76
|
-
/**
|
|
100
|
+
/** Under `px` only the pinned panel's size comes from the caller. */
|
|
77
101
|
const sizes = computed(() => {
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
|
|
102
|
+
const [leading, trailing] = toPair(isControlled.value ? props.modelValue : innerSizes.value);
|
|
103
|
+
const total = totalSize.value;
|
|
104
|
+
if (isReversed.value) {
|
|
105
|
+
return [Math.max(total - trailing, 0), trailing];
|
|
106
|
+
}
|
|
107
|
+
return isPixel.value ? [leading, Math.max(total - leading, 0)] : [leading, trailing];
|
|
81
108
|
});
|
|
82
|
-
/** The pair the panel slots are handed, updated only when a change settles. */
|
|
83
|
-
const settledSizes = shallowRef(sizes.value);
|
|
84
|
-
const restoreSizes = shallowRef(null);
|
|
85
|
-
const collapsed = computed(() => restoreSizes.value !== null);
|
|
86
|
-
const unitSuffix = computed(() => isPixel.value ? "px" : "%");
|
|
87
109
|
const bounds = computed(() => {
|
|
88
110
|
const [leading, trailing] = toPair(props.minSize);
|
|
89
111
|
const total = totalSize.value;
|
|
@@ -104,29 +126,121 @@ const bounds = computed(() => {
|
|
|
104
126
|
max: total - trailing
|
|
105
127
|
};
|
|
106
128
|
});
|
|
107
|
-
const
|
|
108
|
-
|
|
129
|
+
const collapsed = computed(() => dragPointer.value === null ? props.collapsed ?? innerCollapsed.value : dragCollapsed.value);
|
|
130
|
+
/** The bound the divider parks against while folded. */
|
|
131
|
+
const foldedLeading = computed(() => isReversed.value ? bounds.value.max : bounds.value.min);
|
|
132
|
+
/** Half of the pinned floor; a panel without a floor has nothing to fold past. */
|
|
133
|
+
const foldThreshold = computed(() => (isReversed.value ? totalSize.value - bounds.value.max : bounds.value.min) / 2);
|
|
134
|
+
const renderedSizes = computed(() => {
|
|
135
|
+
if (collapsed.value) {
|
|
136
|
+
return foldedPair();
|
|
137
|
+
}
|
|
138
|
+
if (dragPointer.value === null) {
|
|
139
|
+
return sizes.value;
|
|
140
|
+
}
|
|
141
|
+
const { min, max } = bounds.value;
|
|
142
|
+
const pointer = isReversed.value ? Math.min(dragPointer.value, max) : Math.max(dragPointer.value, min);
|
|
143
|
+
return pairFrom(pointer);
|
|
144
|
+
});
|
|
145
|
+
/** The pair the panel slots are handed, updated only when a change settles. */
|
|
146
|
+
const settledSizes = shallowRef(renderedSizes.value);
|
|
147
|
+
const unitSuffix = computed(() => isPixel.value ? "px" : "%");
|
|
148
|
+
/** An empty panel puts the divider on a container edge, where a line is just residue. */
|
|
149
|
+
const isFlush = computed(() => renderedSizes.value[0] <= 0 || renderedSizes.value[1] <= 0);
|
|
150
|
+
const ariaValueNow = computed(() => roundSize(renderedSizes.value[0]));
|
|
151
|
+
const ariaValueText = computed(() => `${ariaValueNow.value}${unitSuffix.value}`);
|
|
152
|
+
/** Folded, the divider is out of the tab order and cannot move, so it exposes no value range. */
|
|
153
|
+
const separatorRange = computed(() => collapsed.value ? {} : {
|
|
154
|
+
"aria-valuenow": ariaValueNow.value,
|
|
155
|
+
"aria-valuemin": bounds.value.min,
|
|
156
|
+
"aria-valuemax": bounds.value.max,
|
|
157
|
+
"aria-valuetext": ariaValueText.value
|
|
158
|
+
});
|
|
109
159
|
const modelValue = useModelValue(props, emits, { withChange: false });
|
|
110
160
|
useResizeObserver(containerRef, syncContainerSize);
|
|
111
161
|
function roundSize(value) {
|
|
112
162
|
return Math.round(value * 100) / 100;
|
|
113
163
|
}
|
|
164
|
+
/** Pixel distance as the group's `unit`. */
|
|
165
|
+
function toUnit(px) {
|
|
166
|
+
if (isPixel.value) {
|
|
167
|
+
return px;
|
|
168
|
+
}
|
|
169
|
+
return containerSize.value > 0 ? px / containerSize.value * PERCENT_TOTAL : 0;
|
|
170
|
+
}
|
|
114
171
|
function toPair(value) {
|
|
115
172
|
return [value?.[0] ?? 0, value?.[1] ?? 0];
|
|
116
173
|
}
|
|
174
|
+
function pairFrom(leading) {
|
|
175
|
+
const next = roundSize(leading);
|
|
176
|
+
return [next, roundSize(Math.max(totalSize.value - next, 0))];
|
|
177
|
+
}
|
|
178
|
+
function foldedPair() {
|
|
179
|
+
const total = roundSize(totalSize.value);
|
|
180
|
+
return isReversed.value ? [total, 0] : [0, total];
|
|
181
|
+
}
|
|
182
|
+
function writeSizes(next) {
|
|
183
|
+
if (!isControlled.value) {
|
|
184
|
+
innerSizes.value = next;
|
|
185
|
+
}
|
|
186
|
+
modelValue.value = next;
|
|
187
|
+
}
|
|
117
188
|
function setSizes([leading, trailing]) {
|
|
118
189
|
const [currentLeading, currentTrailing] = sizes.value;
|
|
119
190
|
const nextLeading = roundSize(leading);
|
|
120
|
-
const next = isPixel.value ?
|
|
191
|
+
const next = isPixel.value ? pairFrom(nextLeading) : [nextLeading, roundSize(trailing)];
|
|
121
192
|
if (next[0] === currentLeading && next[1] === currentTrailing) {
|
|
122
193
|
return false;
|
|
123
194
|
}
|
|
124
|
-
|
|
125
|
-
innerSizes.value = next;
|
|
126
|
-
}
|
|
127
|
-
modelValue.value = next;
|
|
195
|
+
writeSizes(next);
|
|
128
196
|
return true;
|
|
129
197
|
}
|
|
198
|
+
function foldLeading(from) {
|
|
199
|
+
foldedFrom.value = from;
|
|
200
|
+
if (isNil(props.collapsed)) {
|
|
201
|
+
innerCollapsed.value = true;
|
|
202
|
+
}
|
|
203
|
+
emits("update:collapsed", true);
|
|
204
|
+
return setSizes(foldedPair());
|
|
205
|
+
}
|
|
206
|
+
function clearFold(wasCollapsed) {
|
|
207
|
+
foldedFrom.value = null;
|
|
208
|
+
if (isNil(props.collapsed)) {
|
|
209
|
+
innerCollapsed.value = false;
|
|
210
|
+
}
|
|
211
|
+
if (wasCollapsed) {
|
|
212
|
+
emits("update:collapsed", false);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function expandLeading() {
|
|
216
|
+
const wasCollapsed = collapsed.value;
|
|
217
|
+
const { min, max } = bounds.value;
|
|
218
|
+
const changed = setSizes(pairFrom(clampValue(foldedFrom.value ?? sizes.value[0], min, max)));
|
|
219
|
+
clearFold(wasCollapsed);
|
|
220
|
+
return changed;
|
|
221
|
+
}
|
|
222
|
+
function reset() {
|
|
223
|
+
const wasCollapsed = collapsed.value;
|
|
224
|
+
const { min, max } = bounds.value;
|
|
225
|
+
const configured = toPair(props.defaultValue);
|
|
226
|
+
const target = isReversed.value ? totalSize.value - configured[1] : configured[0];
|
|
227
|
+
const next = pairFrom(clampValue(target, min, max));
|
|
228
|
+
const changed = setSizes(next);
|
|
229
|
+
clearFold(wasCollapsed);
|
|
230
|
+
if (!changed && !wasCollapsed) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (!changed) {
|
|
234
|
+
writeSizes(next);
|
|
235
|
+
}
|
|
236
|
+
emits("reset", next);
|
|
237
|
+
}
|
|
238
|
+
function toggleFold() {
|
|
239
|
+
const changed = collapsed.value ? expandLeading() : foldLeading(sizes.value[0]);
|
|
240
|
+
if (changed) {
|
|
241
|
+
emits("change", sizes.value.slice());
|
|
242
|
+
}
|
|
243
|
+
}
|
|
130
244
|
function applyDelta(delta) {
|
|
131
245
|
const [leading, trailing] = sizes.value;
|
|
132
246
|
const { min, max } = bounds.value;
|
|
@@ -135,11 +249,7 @@ function applyDelta(delta) {
|
|
|
135
249
|
return false;
|
|
136
250
|
}
|
|
137
251
|
const nextLeading = roundSize(leading + applied);
|
|
138
|
-
|
|
139
|
-
if (changed) {
|
|
140
|
-
restoreSizes.value = null;
|
|
141
|
-
}
|
|
142
|
-
return changed;
|
|
252
|
+
return setSizes([nextLeading, roundSize(leading + trailing - nextLeading)]);
|
|
143
253
|
}
|
|
144
254
|
function syncContainerSize() {
|
|
145
255
|
const container = containerRef.value;
|
|
@@ -149,77 +259,68 @@ function syncContainerSize() {
|
|
|
149
259
|
}
|
|
150
260
|
containerSize.value = props.direction === "horizontal" ? container.offsetWidth : container.offsetHeight;
|
|
151
261
|
}
|
|
152
|
-
function
|
|
153
|
-
|
|
262
|
+
function flushPointer() {
|
|
263
|
+
const current = dragPointer.value;
|
|
264
|
+
if (!drag || current === null || drag.delta === 0) {
|
|
154
265
|
return;
|
|
155
266
|
}
|
|
156
|
-
const
|
|
267
|
+
const step = toUnit(drag.delta);
|
|
157
268
|
drag.delta = 0;
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
function applyPointerDelta(delta) {
|
|
161
|
-
if (isPixel.value) {
|
|
162
|
-
return applyDelta(delta);
|
|
163
|
-
}
|
|
164
|
-
if (containerSize.value <= 0) {
|
|
165
|
-
return false;
|
|
166
|
-
}
|
|
167
|
-
return applyDelta(delta / containerSize.value * PERCENT_TOTAL);
|
|
168
|
-
}
|
|
169
|
-
function commitChange() {
|
|
170
|
-
emits("change", sizes.value.slice());
|
|
171
|
-
}
|
|
172
|
-
function toggleCollapse() {
|
|
173
|
-
if (props.disabled) {
|
|
269
|
+
if (step === 0) {
|
|
174
270
|
return;
|
|
175
271
|
}
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
commitChange();
|
|
181
|
-
}
|
|
272
|
+
const { min, max } = bounds.value;
|
|
273
|
+
const next = roundSize(current + step);
|
|
274
|
+
const pointer = isReversed.value ? Math.max(next, min) : Math.min(next, max);
|
|
275
|
+
if (pointer === current) {
|
|
182
276
|
return;
|
|
183
277
|
}
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
restoreSizes.value = null;
|
|
192
|
-
if (setSizes(initialSizes)) {
|
|
193
|
-
emits("reset", sizes.value.slice());
|
|
278
|
+
dragPointer.value = pointer;
|
|
279
|
+
const threshold = foldThreshold.value;
|
|
280
|
+
const folded = threshold > 0 && (isReversed.value ? totalSize.value - pointer <= threshold : pointer <= threshold);
|
|
281
|
+
if (folded !== dragCollapsed.value) {
|
|
282
|
+
dragCollapsed.value = folded;
|
|
283
|
+
foldedFrom.value = folded ? foldedLeading.value : null;
|
|
284
|
+
emits("update:collapsed", folded);
|
|
194
285
|
}
|
|
286
|
+
modelValue.value = renderedSizes.value.slice();
|
|
195
287
|
}
|
|
196
288
|
function axisOf(event) {
|
|
197
289
|
return props.direction === "horizontal" ? event.clientX : event.clientY;
|
|
198
290
|
}
|
|
199
291
|
function resetDragging() {
|
|
200
292
|
const pointerId = drag?.pointerId;
|
|
201
|
-
const handle = handleRef.value;
|
|
202
293
|
flushResize.cancel();
|
|
203
294
|
drag = null;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
295
|
+
dragPointer.value = null;
|
|
296
|
+
dragCollapsed.value = false;
|
|
208
297
|
try {
|
|
209
|
-
|
|
298
|
+
if (pointerId !== undefined) {
|
|
299
|
+
handleRef.value?.releasePointerCapture(pointerId);
|
|
300
|
+
}
|
|
210
301
|
} catch {}
|
|
211
302
|
}
|
|
212
303
|
function handlePointerDown(event) {
|
|
213
304
|
if (props.disabled) {
|
|
214
305
|
return;
|
|
215
306
|
}
|
|
307
|
+
syncContainerSize();
|
|
308
|
+
const startCollapsed = collapsed.value;
|
|
309
|
+
const [startLeading, startTrailing] = renderedSizes.value;
|
|
310
|
+
const { min, max } = bounds.value;
|
|
311
|
+
const boundary = isReversed.value ? totalSize.value - foldThreshold.value : foldThreshold.value;
|
|
312
|
+
const deadZone = toUnit(UNFOLD_DISTANCE);
|
|
313
|
+
const collapsedPointer = isReversed.value ? boundary + deadZone : boundary - deadZone;
|
|
216
314
|
drag = {
|
|
217
315
|
pointerId: event.pointerId,
|
|
218
316
|
position: axisOf(event),
|
|
219
317
|
delta: 0,
|
|
220
|
-
|
|
318
|
+
start: [startLeading, startTrailing],
|
|
319
|
+
startCollapsed
|
|
221
320
|
};
|
|
222
|
-
|
|
321
|
+
// A collapsed handle parks one dead zone short of the boundary, so opening it takes a real drag.
|
|
322
|
+
dragPointer.value = startCollapsed ? Math.max(collapsedPointer, 0) : clampValue(sizes.value[0], min, max);
|
|
323
|
+
dragCollapsed.value = startCollapsed;
|
|
223
324
|
try {
|
|
224
325
|
handleRef.value?.setPointerCapture(event.pointerId);
|
|
225
326
|
} catch {}
|
|
@@ -234,69 +335,116 @@ function handlePointerMove(event) {
|
|
|
234
335
|
drag.position = position;
|
|
235
336
|
flushResize();
|
|
236
337
|
}
|
|
237
|
-
function
|
|
238
|
-
if (!drag ||
|
|
338
|
+
function finishDrag(reportChange) {
|
|
339
|
+
if (!drag || dragPointer.value === null) {
|
|
239
340
|
return;
|
|
240
341
|
}
|
|
241
342
|
flushResize.cancel();
|
|
242
|
-
|
|
243
|
-
const
|
|
343
|
+
flushPointer();
|
|
344
|
+
const { start, startCollapsed } = drag;
|
|
345
|
+
const folded = dragCollapsed.value;
|
|
346
|
+
const [leading, trailing] = renderedSizes.value;
|
|
347
|
+
const changed = folded !== startCollapsed || leading !== start[0] || trailing !== start[1];
|
|
348
|
+
const settled = folded ? foldedPair() : [leading, trailing];
|
|
244
349
|
resetDragging();
|
|
245
|
-
if (
|
|
246
|
-
|
|
350
|
+
if (!changed) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
foldedFrom.value = folded ? foldedLeading.value : null;
|
|
354
|
+
if (isNil(props.collapsed)) {
|
|
355
|
+
innerCollapsed.value = folded;
|
|
356
|
+
}
|
|
357
|
+
setSizes(settled);
|
|
358
|
+
if (reportChange) {
|
|
359
|
+
emits("change", settled);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function handlePointerUp(event) {
|
|
363
|
+
if (drag && event.pointerId === drag.pointerId) {
|
|
364
|
+
finishDrag(true);
|
|
247
365
|
}
|
|
248
366
|
}
|
|
249
367
|
function handlePointerCancel(event) {
|
|
250
|
-
if (
|
|
251
|
-
|
|
368
|
+
if (drag && event.pointerId === drag.pointerId) {
|
|
369
|
+
finishDrag(false);
|
|
252
370
|
}
|
|
253
|
-
resetDragging();
|
|
254
371
|
}
|
|
255
372
|
function handleLostCapture() {
|
|
256
|
-
if (
|
|
373
|
+
if (drag) {
|
|
374
|
+
finishDrag(false);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function handleDblclick() {
|
|
378
|
+
if (props.disabled) {
|
|
257
379
|
return;
|
|
258
380
|
}
|
|
259
|
-
|
|
381
|
+
if (props.dblclickAction === "fold") {
|
|
382
|
+
toggleFold();
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
reset();
|
|
260
386
|
}
|
|
261
387
|
function handleKeydown(event) {
|
|
262
388
|
if (props.disabled) {
|
|
263
389
|
return;
|
|
264
390
|
}
|
|
265
|
-
const step = event.shiftKey ? KEYBOARD_STEP_LARGE : KEYBOARD_STEP;
|
|
266
391
|
const horizontal = props.direction === "horizontal";
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
delta = bounds.value.max - sizes.value[0];
|
|
276
|
-
}
|
|
277
|
-
if (delta === null) {
|
|
392
|
+
const back = horizontal ? "ArrowLeft" : "ArrowUp";
|
|
393
|
+
const forward = horizontal ? "ArrowRight" : "ArrowDown";
|
|
394
|
+
if (![
|
|
395
|
+
back,
|
|
396
|
+
forward,
|
|
397
|
+
"Home",
|
|
398
|
+
"End"
|
|
399
|
+
].includes(event.key)) {
|
|
278
400
|
return;
|
|
279
401
|
}
|
|
280
402
|
event.preventDefault();
|
|
281
|
-
|
|
282
|
-
|
|
403
|
+
const wasCollapsed = collapsed.value;
|
|
404
|
+
if (wasCollapsed) {
|
|
405
|
+
expandLeading();
|
|
406
|
+
}
|
|
407
|
+
const step = event.shiftKey ? KEYBOARD_STEP_LARGE : KEYBOARD_STEP;
|
|
408
|
+
const leading = sizes.value[0];
|
|
409
|
+
let delta = event.key === back ? -step : step;
|
|
410
|
+
if (event.key === "Home") {
|
|
411
|
+
delta = bounds.value.min - leading;
|
|
412
|
+
} else if (event.key === "End") {
|
|
413
|
+
delta = bounds.value.max - leading;
|
|
414
|
+
}
|
|
415
|
+
if (applyDelta(delta) || wasCollapsed) {
|
|
416
|
+
emits("change", sizes.value.slice());
|
|
283
417
|
}
|
|
284
418
|
}
|
|
285
|
-
/** Only the
|
|
419
|
+
/** Only the pinned panel of a pixel group gets a basis; the other one fills. */
|
|
286
420
|
function panelStyle(index) {
|
|
287
|
-
if (isPixel.value && index === 1) {
|
|
421
|
+
if (isPixel.value && index === (isReversed.value ? 0 : 1)) {
|
|
288
422
|
return {};
|
|
289
423
|
}
|
|
290
|
-
return { flexBasis: `${
|
|
424
|
+
return { flexBasis: `${renderedSizes.value[index]}${unitSuffix.value}` };
|
|
425
|
+
}
|
|
426
|
+
/** A panel clipped to nothing is gone for focus and AT, not just for the eye. */
|
|
427
|
+
function isPanelEmpty(index) {
|
|
428
|
+
return renderedSizes.value[index] <= 0 || undefined;
|
|
291
429
|
}
|
|
292
|
-
watch(
|
|
293
|
-
if (
|
|
430
|
+
watch(renderedSizes, (value) => {
|
|
431
|
+
if (dragPointer.value === null) {
|
|
294
432
|
settledSizes.value = value;
|
|
295
433
|
}
|
|
296
434
|
});
|
|
435
|
+
watch(() => props.collapsed, (next, prev) => {
|
|
436
|
+
if (isNil(props.collapsed) || dragPointer.value !== null) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
if (next === true && sizes.value[0] !== 0) {
|
|
440
|
+
foldLeading(sizes.value[0]);
|
|
441
|
+
} else if (prev === true) {
|
|
442
|
+
expandLeading();
|
|
443
|
+
}
|
|
444
|
+
});
|
|
297
445
|
onMounted(syncContainerSize);
|
|
298
446
|
defineExpose({
|
|
299
|
-
getPanelSizes: () =>
|
|
447
|
+
getPanelSizes: () => renderedSizes.value.slice(),
|
|
300
448
|
reset
|
|
301
449
|
});
|
|
302
450
|
</script>
|
|
@@ -307,6 +455,7 @@ defineExpose({
|
|
|
307
455
|
ref="containerRef"
|
|
308
456
|
:data-orientation="direction"
|
|
309
457
|
:data-unit="unit"
|
|
458
|
+
:data-reverse="reverse || void 0"
|
|
310
459
|
class="pxd-resizable flex size-full max-w-full flex-row overflow-hidden data-[orientation=vertical]:flex-col"
|
|
311
460
|
v-bind="$attrs"
|
|
312
461
|
>
|
|
@@ -314,6 +463,7 @@ defineExpose({
|
|
|
314
463
|
:id="leadingId"
|
|
315
464
|
class="pxd-resizable-panel min-w-0 min-h-0 overflow-hidden"
|
|
316
465
|
:style="panelStyle(0)"
|
|
466
|
+
:inert="isPanelEmpty(0)"
|
|
317
467
|
>
|
|
318
468
|
<slot name="leading" :size="settledSizes[0]" />
|
|
319
469
|
</div>
|
|
@@ -321,32 +471,31 @@ defineExpose({
|
|
|
321
471
|
<div
|
|
322
472
|
ref="handleRef"
|
|
323
473
|
role="separator"
|
|
324
|
-
:tabindex="disabled ? -1 : 0"
|
|
474
|
+
:tabindex="disabled || collapsed ? -1 : 0"
|
|
325
475
|
aria-label="Resize the panels"
|
|
326
476
|
:aria-orientation="direction"
|
|
327
|
-
|
|
328
|
-
:aria-valuemin="bounds.min"
|
|
329
|
-
:aria-valuemax="bounds.max"
|
|
330
|
-
:aria-valuetext="ariaValueText"
|
|
477
|
+
v-bind="separatorRange"
|
|
331
478
|
:aria-controls="`${leadingId} ${trailingId}`"
|
|
332
479
|
:aria-disabled="disabled || void 0"
|
|
333
480
|
:data-collapsed="collapsed || void 0"
|
|
481
|
+
:data-flush="isFlush || void 0"
|
|
334
482
|
:data-handler="handle"
|
|
335
483
|
:data-orientation="direction"
|
|
336
|
-
class="pxd-resizable-handle relative shrink-0 touch-none self-focus-ring select-none aria-disabled:cursor-default after:motion-safe:transition-colors"
|
|
337
|
-
@pointerdown
|
|
484
|
+
class="pxd-resizable-handle relative shrink-0 touch-none self-focus-ring select-none hover:after:delay-200 aria-disabled:cursor-default after:motion-safe:transition-colors"
|
|
485
|
+
@pointerdown="handlePointerDown"
|
|
338
486
|
@pointermove="handlePointerMove"
|
|
339
487
|
@pointerup="handlePointerUp"
|
|
340
488
|
@pointercancel="handlePointerCancel"
|
|
341
489
|
@lostpointercapture="handleLostCapture"
|
|
342
490
|
@keydown="handleKeydown"
|
|
343
|
-
@dblclick.prevent.stop="
|
|
491
|
+
@dblclick.prevent.stop="handleDblclick"
|
|
344
492
|
/>
|
|
345
493
|
|
|
346
494
|
<div
|
|
347
495
|
:id="trailingId"
|
|
348
496
|
class="pxd-resizable-panel min-w-0 min-h-0 overflow-hidden"
|
|
349
497
|
:style="panelStyle(1)"
|
|
498
|
+
:inert="isPanelEmpty(1)"
|
|
350
499
|
>
|
|
351
500
|
<slot name="trailing" :size="settledSizes[1]" />
|
|
352
501
|
</div>
|
|
@@ -354,5 +503,5 @@ defineExpose({
|
|
|
354
503
|
</template>
|
|
355
504
|
|
|
356
505
|
<style>
|
|
357
|
-
.pxd-resizable-panel{flex-grow:0;flex-shrink:1}.pxd-resizable[data-unit=px] .pxd-resizable-panel:first-child{flex-shrink:0}.pxd-resizable[data-unit=px] .pxd-resizable-panel:last-child{flex-basis:0;flex-grow:1}.pxd-resizable-handle[data-handler=true]:before{background-color:var(--color-gray-300);border-radius:.5rem;content:"";left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.pxd-resizable-handle
|
|
506
|
+
.pxd-resizable-panel{flex-grow:0;flex-shrink:1}.pxd-resizable-panel[inert]{visibility:hidden}.pxd-resizable[data-unit=px] .pxd-resizable-panel:first-child{flex-shrink:0}.pxd-resizable[data-unit=px] .pxd-resizable-panel:last-child{flex-basis:0;flex-grow:1}.pxd-resizable[data-unit=px][data-reverse] .pxd-resizable-panel:first-child{flex-basis:0;flex-grow:1;flex-shrink:1}.pxd-resizable[data-unit=px][data-reverse] .pxd-resizable-panel:last-child{flex-grow:0;flex-shrink:0}.pxd-resizable-handle[data-handler=true]:before{background-color:var(--color-gray-300);border-radius:.5rem;content:"";left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.pxd-resizable-handle:after{background-color:transparent;content:"";position:absolute}.pxd-resizable-handle:hover:after{background-color:var(--color-primary)}.pxd-resizable-handle[data-orientation=horizontal]{border-left-width:1px;cursor:col-resize;height:100%;margin-right:-1px}.pxd-resizable-handle[data-orientation=horizontal]:before{height:1.5rem;width:.375rem}.pxd-resizable-handle[data-orientation=horizontal]:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:.25rem}.pxd-resizable-handle[data-orientation=vertical]{border-bottom-width:1px;cursor:row-resize;margin-bottom:-1px;width:100%}.pxd-resizable-handle[data-orientation=vertical]:before{height:.375rem;width:1.5rem}.pxd-resizable-handle[data-orientation=vertical]:after{height:.25rem;left:0;top:50%;transform:translateY(-50%);width:100%}.pxd-resizable-handle[data-collapsed=true],.pxd-resizable-handle[data-flush=true]{background-color:transparent}.pxd-resizable-handle[data-collapsed=true]:before{opacity:.4}
|
|
358
507
|
</style>
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { ComponentDirection } from '../../types/shared/props'
|
|
2
2
|
|
|
3
|
+
export type ResizableDblclickAction = 'reset' | 'fold'
|
|
4
|
+
|
|
3
5
|
export interface ResizableProps {
|
|
4
6
|
direction?: ComponentDirection
|
|
5
7
|
unit?: 'percent' | 'px'
|
|
8
|
+
reverse?: boolean
|
|
6
9
|
minSize?: number[]
|
|
10
|
+
collapsed?: boolean | null
|
|
11
|
+
dblclickAction?: ResizableDblclickAction
|
|
7
12
|
handle?: boolean
|
|
8
13
|
disabled?: boolean
|
|
9
14
|
defaultValue?: number[]
|
|
@@ -13,5 +18,6 @@ export interface ResizableProps {
|
|
|
13
18
|
export interface ResizableEmits {
|
|
14
19
|
change: [number[]]
|
|
15
20
|
reset: [number[]]
|
|
16
|
-
'update:
|
|
21
|
+
'update:collapsed': [boolean]
|
|
22
|
+
'update:model-value': [number[]]
|
|
17
23
|
}
|
|
@@ -209,7 +209,7 @@ defineExpose({
|
|
|
209
209
|
<template>
|
|
210
210
|
<span
|
|
211
211
|
data-rolling-number
|
|
212
|
-
class="pxd-rolling-number tabular-nums text-trim-both"
|
|
212
|
+
class="pxd-rolling-number relative tabular-nums text-trim-both"
|
|
213
213
|
role="status"
|
|
214
214
|
aria-live="polite"
|
|
215
215
|
aria-atomic="true"
|
|
@@ -4,7 +4,7 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_7) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_base: import("vue").DefineComponent<ScrollTextProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScrollTextProps> & Readonly<{}>, {
|
|
7
|
-
text: string;
|
|
7
|
+
text: string | number | null;
|
|
8
8
|
as: import("../../types/shared/props.js").ComponentAs;
|
|
9
9
|
speed: string | number;
|
|
10
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -14,7 +14,7 @@ const props = defineProps({
|
|
|
14
14
|
default: "span"
|
|
15
15
|
},
|
|
16
16
|
text: {
|
|
17
|
-
type:
|
|
17
|
+
type: null,
|
|
18
18
|
required: false,
|
|
19
19
|
default: ""
|
|
20
20
|
},
|
|
@@ -119,5 +119,5 @@ onBeforeUnmount(() => {
|
|
|
119
119
|
</template>
|
|
120
120
|
|
|
121
121
|
<style>
|
|
122
|
-
.pxd-scroll-text[data-overflow=true]:hover .pxd-scroll-text--content{animation:pxd-scroll-text-shift var(--scroll-text-duration) linear infinite;display:inline-block;max-width:none;overflow:visible;text-overflow:clip;width:-moz-max-content;width:max-content}@keyframes pxd-scroll-text-shift{0%{transform:translateX(0)}to{transform:translateX(calc(var(--scroll-text-distance)*-1))}}
|
|
122
|
+
.pxd-scroll-text[data-overflow=true]:hover .pxd-scroll-text--content{animation:pxd-scroll-text-shift calc(var(--scroll-text-duration)*1.6667) linear infinite;display:inline-block;max-width:none;overflow:visible;text-overflow:clip;width:-moz-max-content;width:max-content}@keyframes pxd-scroll-text-shift{0%,6%{transform:translateX(0)}80%,to{transform:translateX(calc(var(--scroll-text-distance)*-1))}}
|
|
123
123
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ComponentAs } from '../../types/shared/props'
|
|
1
|
+
import type { ComponentAs, ComponentLabel } from '../../types/shared/props'
|
|
2
2
|
|
|
3
3
|
export interface ScrollTextProps {
|
|
4
4
|
as?: ComponentAs
|
|
5
|
-
text?:
|
|
5
|
+
text?: ComponentLabel
|
|
6
6
|
speed?: number | string
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComponentDirection } from '../../types/shared/props';
|
|
1
2
|
import type { ScrollableProps } from './types';
|
|
2
3
|
declare function scrollTo(top: number, left: number): void;
|
|
3
4
|
declare function forceUpdate(): void;
|
|
@@ -10,10 +11,10 @@ declare const __VLS_base: import("vue").DefineComponent<ScrollableProps, {
|
|
|
10
11
|
forceUpdate: typeof forceUpdate;
|
|
11
12
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
13
|
scroll: (args_0: Event) => any;
|
|
13
|
-
bottom: (args_0:
|
|
14
|
+
bottom: (args_0: ComponentDirection, args_1: Event) => any;
|
|
14
15
|
}, string, import("vue").PublicProps, Readonly<ScrollableProps> & Readonly<{
|
|
15
16
|
onScroll?: ((args_0: Event) => any) | undefined;
|
|
16
|
-
onBottom?: ((args_0:
|
|
17
|
+
onBottom?: ((args_0: ComponentDirection, args_1: Event) => any) | undefined;
|
|
17
18
|
}>, {
|
|
18
19
|
bottomThreshold: number;
|
|
19
20
|
fader: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ComponentClass, ComponentDirection } from '../../types/shared/props'
|
|
2
|
-
import type { Nullable } from '../../types/shared/utils'
|
|
3
2
|
import type { CSSProperties } from 'vue'
|
|
4
3
|
|
|
5
4
|
export interface ScrollableProps {
|
|
@@ -22,17 +21,3 @@ export interface ScrollableEmits {
|
|
|
22
21
|
scroll: [Event]
|
|
23
22
|
bottom: [ComponentDirection, Event]
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
export interface ScrollableDragState {
|
|
27
|
-
isDragging: boolean
|
|
28
|
-
direction: Nullable<ComponentDirection>
|
|
29
|
-
startClientPos: number
|
|
30
|
-
startThumbPos: number
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface ScrollableCachedPadding {
|
|
34
|
-
top: number
|
|
35
|
-
bottom: number
|
|
36
|
-
left: number
|
|
37
|
-
right: number
|
|
38
|
-
}
|