@xihan-ui/vue 1.0.0 → 1.1.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/CHANGELOG.md +259 -0
- package/README.md +1 -1
- package/dist/components/anchor/anchor.d.ts +1 -1
- package/dist/components/back-top/back-top.d.ts +1 -1
- package/dist/components/calendar/calendar.d.ts +1 -1
- package/dist/components/carousel/carousel.d.ts +1 -1
- package/dist/components/cascader/cascader.d.ts +6 -6
- package/dist/components/color-picker/color-picker.d.ts +2 -2
- package/dist/components/combobox/combobox.d.ts +5 -5
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +2 -1
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/context-menu/context-menu.d.ts +2 -2
- package/dist/components/date-field/date-field.d.ts +2 -2
- package/dist/components/date-picker/date-picker.d.ts +5 -5
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/descriptions/descriptions.d.ts +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -1
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/float-button/float-button.d.ts +3 -3
- package/dist/components/floating-panel/floating-panel.d.ts +2 -2
- package/dist/components/form/form.d.ts +1 -1
- package/dist/components/hotkeys/hotkeys.d.ts +1 -1
- package/dist/components/hover-card/hover-card.d.ts +1 -1
- package/dist/components/image-viewer/image-viewer.d.ts +3 -3
- package/dist/components/json-viewer/json-viewer.d.ts +1 -1
- package/dist/components/list/list.d.ts +1 -1
- package/dist/components/listbox/listbox.d.ts +1 -1
- package/dist/components/mention/mention.d.ts +4 -4
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/notification/notification.d.ts +2 -2
- package/dist/components/number-animation/number-animation.d.ts +1 -1
- package/dist/components/number-field/number-field.d.ts +2 -2
- package/dist/components/pagination/pagination.d.ts +1 -1
- package/dist/components/password-input/password-input.d.ts +2 -2
- package/dist/components/pin-input/pin-input.d.ts +1 -1
- package/dist/components/popconfirm/popconfirm.d.ts +1 -1
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popselect/popselect.d.ts +3 -3
- package/dist/components/popselect/popselect.d.ts.map +1 -1
- package/dist/components/popselect/popselect.js +2 -1
- package/dist/components/popselect/popselect.js.map +1 -1
- package/dist/components/resizable/context.d.ts +7 -0
- package/dist/components/resizable/context.d.ts.map +1 -0
- package/dist/components/resizable/context.js +15 -0
- package/dist/components/resizable/context.js.map +1 -0
- package/dist/components/resizable/resizable.d.ts +174 -0
- package/dist/components/resizable/resizable.d.ts.map +1 -0
- package/dist/components/resizable/resizable.js +108 -0
- package/dist/components/resizable/resizable.js.map +1 -0
- package/dist/components/resizable/use-resizable.d.ts +14 -0
- package/dist/components/resizable/use-resizable.d.ts.map +1 -0
- package/dist/components/resizable/use-resizable.js +25 -0
- package/dist/components/resizable/use-resizable.js.map +1 -0
- package/dist/components/select/select.d.ts +4 -4
- package/dist/components/side-nav/side-nav.d.ts +2 -2
- package/dist/components/slider/slider.d.ts +1 -1
- package/dist/components/sortable/context.d.ts +7 -0
- package/dist/components/sortable/context.d.ts.map +1 -0
- package/dist/components/sortable/context.js +15 -0
- package/dist/components/sortable/context.js.map +1 -0
- package/dist/components/sortable/sortable.d.ts +166 -0
- package/dist/components/sortable/sortable.d.ts.map +1 -0
- package/dist/components/sortable/sortable.js +128 -0
- package/dist/components/sortable/sortable.js.map +1 -0
- package/dist/components/sortable/use-sortable.d.ts +14 -0
- package/dist/components/sortable/use-sortable.d.ts.map +1 -0
- package/dist/components/sortable/use-sortable.js +26 -0
- package/dist/components/sortable/use-sortable.js.map +1 -0
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/table/table.d.ts +48 -4
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +58 -8
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/use-table.d.ts +1 -1
- package/dist/components/table/use-table.d.ts.map +1 -1
- package/dist/components/table/use-table.js +3 -2
- package/dist/components/table/use-table.js.map +1 -1
- package/dist/components/tabs/tabs.d.ts +47 -2
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +45 -3
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tabs/use-tabs.d.ts +1 -1
- package/dist/components/tabs/use-tabs.d.ts.map +1 -1
- package/dist/components/tabs/use-tabs.js +3 -2
- package/dist/components/tabs/use-tabs.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +3 -3
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/text-field/text-field.d.ts.map +1 -1
- package/dist/components/text-field/text-field.js +2 -1
- package/dist/components/text-field/text-field.js.map +1 -1
- package/dist/components/time-field/time-field.d.ts +2 -2
- package/dist/components/time-picker/time-picker.d.ts +5 -5
- package/dist/components/toast/toast.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tour/tour.d.ts +4 -4
- package/dist/components/tree/tree.d.ts +46 -2
- package/dist/components/tree/tree.d.ts.map +1 -1
- package/dist/components/tree/tree.js +45 -3
- package/dist/components/tree/tree.js.map +1 -1
- package/dist/components/tree/use-tree.d.ts +1 -1
- package/dist/components/tree/use-tree.d.ts.map +1 -1
- package/dist/components/tree/use-tree.js +3 -2
- package/dist/components/tree/use-tree.js.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +5 -5
- package/dist/index.d.ts +10 -4
- package/dist/index.js +10 -4
- package/dist/package.js +1 -1
- package/package.json +15 -14
|
@@ -130,15 +130,15 @@ declare const XhDrawerRoot: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
130
130
|
"onUpdate:open"?: ((_open: boolean) => any) | undefined;
|
|
131
131
|
}>, {
|
|
132
132
|
size: Size;
|
|
133
|
-
translations: Partial<import("@xihan-ui/headless").DrawerTranslations> | undefined;
|
|
134
133
|
open: boolean;
|
|
135
134
|
defaultOpen: boolean;
|
|
136
|
-
|
|
135
|
+
translations: Partial<import("@xihan-ui/headless").DrawerTranslations> | undefined;
|
|
137
136
|
modal: boolean;
|
|
138
137
|
role: "dialog" | "alertdialog";
|
|
139
138
|
closeOnEscape: boolean;
|
|
140
139
|
closeOnInteractOutside: boolean;
|
|
141
140
|
restoreFocus: boolean;
|
|
141
|
+
side: DrawerSide;
|
|
142
142
|
container: string | Element;
|
|
143
143
|
contained: boolean;
|
|
144
144
|
}, SlotsType<{
|
|
@@ -69,12 +69,12 @@ declare const XhFloatButtonRoot: import("vue").DefineComponent<import("vue").Ext
|
|
|
69
69
|
"onUpdate:open"?: ((_open: boolean) => any) | undefined;
|
|
70
70
|
}>, {
|
|
71
71
|
disabled: boolean;
|
|
72
|
-
offset: number;
|
|
73
|
-
translations: Partial<FloatButtonTranslations>;
|
|
74
72
|
open: boolean;
|
|
75
73
|
defaultOpen: boolean;
|
|
76
|
-
|
|
74
|
+
translations: Partial<FloatButtonTranslations>;
|
|
75
|
+
offset: number;
|
|
77
76
|
placement: FloatButtonPlacement;
|
|
77
|
+
expandTrigger: FloatButtonExpandTrigger;
|
|
78
78
|
shape: FloatButtonShape;
|
|
79
79
|
}, SlotsType<{
|
|
80
80
|
default?: (props: FloatButtonRootSlotProps) => VNode[];
|
|
@@ -142,9 +142,10 @@ declare const XhFloatingPanelRoot: import("vue").DefineComponent<import("vue").E
|
|
|
142
142
|
}>, {
|
|
143
143
|
size: FloatingPanelSize;
|
|
144
144
|
disabled: boolean;
|
|
145
|
-
translations: Partial<import("@xihan-ui/headless").FloatingPanelTranslations> | undefined;
|
|
146
145
|
open: boolean;
|
|
147
146
|
defaultOpen: boolean;
|
|
147
|
+
translations: Partial<import("@xihan-ui/headless").FloatingPanelTranslations> | undefined;
|
|
148
|
+
resizable: boolean;
|
|
148
149
|
position: FloatingPanelPosition;
|
|
149
150
|
stage: FloatingPanelStage;
|
|
150
151
|
defaultPosition: FloatingPanelPosition;
|
|
@@ -153,7 +154,6 @@ declare const XhFloatingPanelRoot: import("vue").DefineComponent<import("vue").E
|
|
|
153
154
|
maxSize: FloatingPanelSize;
|
|
154
155
|
defaultStage: FloatingPanelStage;
|
|
155
156
|
draggable: boolean;
|
|
156
|
-
resizable: boolean;
|
|
157
157
|
}, SlotsType<{
|
|
158
158
|
default?: (props: FloatingPanelRootSlotProps) => VNode[];
|
|
159
159
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -134,8 +134,8 @@ declare const XhFormRoot: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
134
134
|
}>, {
|
|
135
135
|
values: FormValues;
|
|
136
136
|
disabled: boolean;
|
|
137
|
-
layout: import("@xihan-ui/headless").FormLayout | undefined;
|
|
138
137
|
readOnly: boolean;
|
|
138
|
+
layout: import("@xihan-ui/headless").FormLayout | undefined;
|
|
139
139
|
validate: ((values: FormValues) => FormErrorPatch | Promise<FormErrorPatch>) | undefined;
|
|
140
140
|
rules: import("@xihan-ui/headless").FormRules | undefined;
|
|
141
141
|
validateMessages: import("@xihan-ui/headless").FormValidateMessages | undefined;
|
|
@@ -78,8 +78,8 @@ declare const XhHotkeys: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
78
78
|
}>, {
|
|
79
79
|
keys: string[];
|
|
80
80
|
size: Size;
|
|
81
|
-
translations: Partial<HotkeysTranslations>;
|
|
82
81
|
target: HotkeysTarget;
|
|
82
|
+
translations: Partial<HotkeysTranslations>;
|
|
83
83
|
platform: HotkeysPlatform;
|
|
84
84
|
preventDefault: boolean;
|
|
85
85
|
enabled: boolean;
|
|
@@ -80,9 +80,9 @@ declare const XhHoverCardRoot: import("vue").DefineComponent<import("vue").Extra
|
|
|
80
80
|
dir: Direction;
|
|
81
81
|
size: Size;
|
|
82
82
|
disabled: boolean;
|
|
83
|
-
offset: number;
|
|
84
83
|
open: boolean;
|
|
85
84
|
defaultOpen: boolean;
|
|
85
|
+
offset: number;
|
|
86
86
|
placement: Placement;
|
|
87
87
|
openDelay: number;
|
|
88
88
|
closeDelay: number;
|
|
@@ -118,15 +118,15 @@ declare const XhImageViewerRoot: import("vue").DefineComponent<import("vue").Ext
|
|
|
118
118
|
"onIndex-change"?: ((_details: import("@xihan-ui/headless").ImageViewerIndexChangeDetails) => any) | undefined;
|
|
119
119
|
"onUpdate:index"?: ((_index: number) => any) | undefined;
|
|
120
120
|
}>, {
|
|
121
|
-
translations: Partial<import("@xihan-ui/headless").ImageViewerTranslations> | undefined;
|
|
122
121
|
open: boolean;
|
|
123
122
|
defaultOpen: boolean;
|
|
124
|
-
|
|
123
|
+
translations: Partial<import("@xihan-ui/headless").ImageViewerTranslations> | undefined;
|
|
125
124
|
loop: boolean;
|
|
126
|
-
|
|
125
|
+
index: number;
|
|
127
126
|
closeOnEscape: boolean;
|
|
128
127
|
closeOnInteractOutside: boolean;
|
|
129
128
|
restoreFocus: boolean;
|
|
129
|
+
items: ImageViewerItem[];
|
|
130
130
|
defaultIndex: number;
|
|
131
131
|
zoomStep: number;
|
|
132
132
|
minScale: number;
|
|
@@ -115,8 +115,8 @@ declare const XhJsonViewerRoot: import("vue").DefineComponent<import("vue").Extr
|
|
|
115
115
|
dir: Direction;
|
|
116
116
|
size: Size;
|
|
117
117
|
translations: Partial<JsonViewerTranslations>;
|
|
118
|
-
view: JsonViewerView;
|
|
119
118
|
loop: boolean;
|
|
119
|
+
view: JsonViewerView;
|
|
120
120
|
expandedValue: string[];
|
|
121
121
|
defaultExpandedValue: string[];
|
|
122
122
|
defaultExpandedDepth: number;
|
|
@@ -32,8 +32,8 @@ declare const XhListRoot: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
32
32
|
}>> & Readonly<{}>, {
|
|
33
33
|
as: string;
|
|
34
34
|
size: Size;
|
|
35
|
-
hoverable: boolean;
|
|
36
35
|
split: boolean;
|
|
36
|
+
hoverable: boolean;
|
|
37
37
|
bordered: boolean;
|
|
38
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
39
|
declare const XhListItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -103,8 +103,8 @@ declare const XhListboxRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
103
103
|
orientation: Orientation;
|
|
104
104
|
dir: Direction;
|
|
105
105
|
disabled: boolean;
|
|
106
|
-
selectionMode: ListboxSelectionMode;
|
|
107
106
|
loop: boolean;
|
|
107
|
+
selectionMode: ListboxSelectionMode;
|
|
108
108
|
typeahead: boolean;
|
|
109
109
|
}, SlotsType<{
|
|
110
110
|
default?: (props: ListboxRootSlotProps) => VNode[];
|
|
@@ -132,14 +132,14 @@ declare const XhMentionRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
132
132
|
tone: Tone;
|
|
133
133
|
size: Size;
|
|
134
134
|
disabled: boolean;
|
|
135
|
-
offset: number;
|
|
136
135
|
translations: MentionTranslations;
|
|
137
|
-
|
|
136
|
+
offset: number;
|
|
138
137
|
readOnly: boolean;
|
|
139
|
-
|
|
138
|
+
prefix: string | string[];
|
|
140
139
|
placeholder: string;
|
|
140
|
+
loop: boolean;
|
|
141
141
|
placement: Placement;
|
|
142
|
-
|
|
142
|
+
variant: ControlVariant;
|
|
143
143
|
}, SlotsType<{
|
|
144
144
|
default?: (props: MentionRootSlotProps) => VNode[];
|
|
145
145
|
/** 铺开 collection 时每条候选的文本插槽。 */
|
|
@@ -123,15 +123,15 @@ declare const XhMenuRoot: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
123
123
|
dir: Direction;
|
|
124
124
|
tone: Tone;
|
|
125
125
|
size: Size;
|
|
126
|
-
offset: number;
|
|
127
126
|
open: boolean;
|
|
128
127
|
defaultOpen: boolean;
|
|
128
|
+
offset: number;
|
|
129
129
|
loop: boolean;
|
|
130
130
|
placement: Placement;
|
|
131
|
+
triggerAsChild: boolean;
|
|
131
132
|
openOnHover: boolean;
|
|
132
133
|
hoverOpenDelay: number;
|
|
133
134
|
hoverCloseDelay: number;
|
|
134
|
-
triggerAsChild: boolean;
|
|
135
135
|
}, SlotsType<{
|
|
136
136
|
default?: (props: MenuRootSlotProps) => VNode[];
|
|
137
137
|
trigger?: () => VNode[];
|
|
@@ -98,8 +98,8 @@ declare const XhNotificationRoot: import("vue").DefineComponent<import("vue").Ex
|
|
|
98
98
|
"onUpdate:items"?: ((_items: NotificationRecord[]) => any) | undefined;
|
|
99
99
|
}>, {
|
|
100
100
|
translations: Partial<NotificationTranslations>;
|
|
101
|
-
max: number;
|
|
102
101
|
placement: NotificationPlacement;
|
|
102
|
+
max: number;
|
|
103
103
|
items: NotificationRecord[];
|
|
104
104
|
gap: number;
|
|
105
105
|
defaultItems: NotificationRecord[];
|
|
@@ -216,8 +216,8 @@ declare const XhNotificationItem: import("vue").DefineComponent<import("vue").Ex
|
|
|
216
216
|
}>, {
|
|
217
217
|
type: ToastType;
|
|
218
218
|
title: string;
|
|
219
|
-
translations: Partial<NotificationTranslations>;
|
|
220
219
|
closable: boolean;
|
|
220
|
+
translations: Partial<NotificationTranslations>;
|
|
221
221
|
duration: number;
|
|
222
222
|
removeDelay: number;
|
|
223
223
|
pauseOnPageIdle: boolean;
|
|
@@ -103,8 +103,8 @@ declare const XhNumberAnimation: import("vue").DefineComponent<import("vue").Ext
|
|
|
103
103
|
}>, {
|
|
104
104
|
tone: Tone;
|
|
105
105
|
size: Size;
|
|
106
|
-
separator: string;
|
|
107
106
|
to: number;
|
|
107
|
+
separator: string;
|
|
108
108
|
active: boolean;
|
|
109
109
|
precision: number;
|
|
110
110
|
live: NumberAnimationLive;
|
|
@@ -145,14 +145,14 @@ declare const XhNumberFieldRoot: import("vue").DefineComponent<import("vue").Ext
|
|
|
145
145
|
tone: Tone;
|
|
146
146
|
size: Size;
|
|
147
147
|
disabled: boolean;
|
|
148
|
+
readOnly: boolean;
|
|
148
149
|
variant: ControlVariant;
|
|
149
150
|
max: number;
|
|
150
|
-
readOnly: boolean;
|
|
151
151
|
min: number;
|
|
152
152
|
format: ((value: number) => string) | undefined;
|
|
153
|
+
parse: ((text: string) => number) | undefined;
|
|
153
154
|
step: number;
|
|
154
155
|
largeStep: number;
|
|
155
|
-
parse: ((text: string) => number) | undefined;
|
|
156
156
|
changeDelay: number;
|
|
157
157
|
changeInterval: number;
|
|
158
158
|
}, SlotsType<{
|
|
@@ -113,9 +113,9 @@ declare const XhPaginationRoot: import("vue").DefineComponent<import("vue").Extr
|
|
|
113
113
|
tone: Tone;
|
|
114
114
|
size: Size;
|
|
115
115
|
translations: Partial<PaginationTranslations>;
|
|
116
|
+
count: number;
|
|
116
117
|
page: number;
|
|
117
118
|
defaultPage: number;
|
|
118
|
-
count: number;
|
|
119
119
|
pageSize: number;
|
|
120
120
|
pageSizeOptions: number[];
|
|
121
121
|
defaultPageSize: number;
|
|
@@ -150,10 +150,10 @@ declare const XhPasswordInputRoot: import("vue").DefineComponent<import("vue").E
|
|
|
150
150
|
size: Size;
|
|
151
151
|
disabled: boolean;
|
|
152
152
|
translations: Partial<PasswordInputTranslations>;
|
|
153
|
-
variant: ControlVariant;
|
|
154
153
|
readOnly: boolean;
|
|
155
|
-
visible: boolean;
|
|
156
154
|
placeholder: string;
|
|
155
|
+
variant: ControlVariant;
|
|
156
|
+
visible: boolean;
|
|
157
157
|
defaultVisible: boolean;
|
|
158
158
|
autoComplete: string;
|
|
159
159
|
}, SlotsType<{
|
|
@@ -127,8 +127,8 @@ declare const XhPinInputRoot: import("vue").DefineComponent<import("vue").Extrac
|
|
|
127
127
|
size: Size;
|
|
128
128
|
disabled: boolean;
|
|
129
129
|
translations: Partial<PinInputTranslations>;
|
|
130
|
-
variant: ControlVariant;
|
|
131
130
|
placeholder: string;
|
|
131
|
+
variant: ControlVariant;
|
|
132
132
|
mask: boolean;
|
|
133
133
|
otp: boolean;
|
|
134
134
|
blurOnComplete: boolean;
|
|
@@ -87,9 +87,9 @@ declare const XhPopconfirmRoot: import("vue").DefineComponent<import("vue").Extr
|
|
|
87
87
|
"onUpdate:open"?: ((_open: boolean) => any) | undefined;
|
|
88
88
|
}>, {
|
|
89
89
|
size: Size;
|
|
90
|
-
offset: number;
|
|
91
90
|
open: boolean;
|
|
92
91
|
defaultOpen: boolean;
|
|
92
|
+
offset: number;
|
|
93
93
|
placement: Placement;
|
|
94
94
|
closeOnEscape: boolean;
|
|
95
95
|
closeOnInteractOutside: boolean;
|
|
@@ -84,10 +84,10 @@ declare const XhPopoverRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
84
84
|
"onUpdate:open"?: ((_open: boolean) => any) | undefined;
|
|
85
85
|
}>, {
|
|
86
86
|
size: Size;
|
|
87
|
-
offset: number;
|
|
88
|
-
translations: Partial<import("@xihan-ui/headless").PopoverTranslations> | undefined;
|
|
89
87
|
open: boolean;
|
|
90
88
|
defaultOpen: boolean;
|
|
89
|
+
translations: Partial<import("@xihan-ui/headless").PopoverTranslations> | undefined;
|
|
90
|
+
offset: number;
|
|
91
91
|
placement: Placement;
|
|
92
92
|
modal: boolean;
|
|
93
93
|
closeOnEscape: boolean;
|
|
@@ -155,13 +155,13 @@ declare const XhPopselectRoot: import("vue").DefineComponent<import("vue").Extra
|
|
|
155
155
|
tone: Tone;
|
|
156
156
|
size: Size;
|
|
157
157
|
disabled: boolean;
|
|
158
|
-
offset: number;
|
|
159
|
-
translations: Partial<PopselectTranslations>;
|
|
160
158
|
open: boolean;
|
|
161
159
|
defaultOpen: boolean;
|
|
162
|
-
|
|
160
|
+
translations: Partial<PopselectTranslations>;
|
|
161
|
+
offset: number;
|
|
163
162
|
loop: boolean;
|
|
164
163
|
placement: Placement;
|
|
164
|
+
variant: ControlVariant;
|
|
165
165
|
typeahead: boolean;
|
|
166
166
|
closeOnEscape: boolean;
|
|
167
167
|
closeOnInteractOutside: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popselect.d.ts","names":[],"sources":["../../../src/components/popselect/popselect.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"popselect.d.ts","names":[],"sources":["../../../src/components/popselect/popselect.ts"],"mappings":";;;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AAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withXhConfig } from "../../config/config.js";
|
|
1
2
|
import { useScrollbars } from "../../runtime/use-scrollbars.js";
|
|
2
3
|
import { mergeIntoChild } from "../../runtime/as-child.js";
|
|
3
4
|
import { providePopselect, providePopselectItem, usePopselectContext, usePopselectItemContext } from "./context.js";
|
|
@@ -79,7 +80,7 @@ const XhPopselectRoot = defineComponent({
|
|
|
79
80
|
},
|
|
80
81
|
slots: Object,
|
|
81
82
|
setup(props, { slots, emit }) {
|
|
82
|
-
const ctx = usePopselect(props, {
|
|
83
|
+
const ctx = usePopselect(withXhConfig("popselect", props), {
|
|
83
84
|
onValueChange: (details) => {
|
|
84
85
|
emit("value-change", details);
|
|
85
86
|
emit("update:value", details.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popselect.js","names":[],"sources":["../../../src/components/popselect/popselect.ts"],"sourcesContent":["import type { PopselectApi, PopselectItemProps, PopselectNode, PopselectNodeMeta, PopselectTranslations } from '@xihan-ui/headless'\nimport type { ControlVariant, Direction, Placement, Size, Tone } from '@xihan-ui/kernel'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport type { PopselectNotifiers, PopselectRootProps } from './use-popselect'\nimport { computed, defineComponent, h, mergeProps, onBeforeUnmount, ref, Teleport, watch } from 'vue'\nimport { mergeIntoChild } from '../../runtime/as-child'\nimport { useScrollbars } from '../../runtime/use-scrollbars'\nimport { providePopselect, providePopselectItem, usePopselectContext, usePopselectItemContext } from './context'\nimport { usePopselect } from './use-popselect'\n\n/** 默认插槽的载荷:浮层开合、选中集合与条目数据,以及改动它们的方法。 */\nexport type PopselectRootSlotProps = Pick<\n PopselectApi,\n 'open' | 'value' | 'collection' | 'focusedValue' | 'canClear' | 'isSelected' | 'setOpen' | 'setValue' | 'select' | 'clear'\n>\n\nexport const XhPopselectRoot = defineComponent({\n name: 'XhPopselectRoot',\n // 有 connect 或机器兜底的 prop 一律 default: undefined\n props: {\n collection: { type: Array as PropType<PopselectNode[]>, default: undefined },\n value: { type: [String, Array] as PropType<string | string[]>, default: undefined },\n defaultValue: { type: [String, Array] as PropType<string | string[]>, default: undefined },\n multiple: Boolean,\n disabled: Boolean,\n loop: { type: Boolean, default: undefined },\n typeahead: { type: Boolean, default: undefined },\n dir: { type: String as PropType<Direction>, default: undefined },\n open: { type: Boolean, default: undefined },\n defaultOpen: Boolean,\n placement: { type: String as PropType<Placement>, default: undefined },\n offset: { type: Number, default: undefined },\n closeOnEscape: { type: Boolean, default: undefined },\n closeOnInteractOutside: { type: Boolean, default: undefined },\n variant: { type: String as PropType<ControlVariant>, default: undefined },\n tone: { type: String as PropType<Tone>, default: undefined },\n size: { type: String as PropType<Size>, default: undefined },\n translations: { type: Object as PropType<Partial<PopselectTranslations>>, default: undefined },\n },\n // *-change 携带 details 对象,update:* 携带裸值;回传的选中值恒为数组,单选时长度 ≤ 1\n emits: {\n 'value-change': (_details: PayloadOf<PopselectNotifiers, 'onValueChange'>) => true,\n 'open-change': (_details: PayloadOf<PopselectNotifiers, 'onOpenChange'>) => true,\n 'update:value': (_value: PayloadOf<PopselectNotifiers, 'onValueChange'>['value']) => true,\n 'update:open': (_open: PayloadOf<PopselectNotifiers, 'onOpenChange'>['open']) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: PopselectRootSlotProps) => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const notify: PopselectNotifiers = {\n onValueChange: (details) => {\n emit('value-change', details)\n emit('update:value', details.value)\n },\n onOpenChange: (details) => {\n emit('open-change', details)\n emit('update:open', details.open)\n },\n }\n const ctx = usePopselect(props as PopselectRootProps, notify)\n providePopselect(ctx)\n return () => h('div', ctx.api.value.getRootProps() as Record<string, unknown>, slots.default?.({\n open: ctx.api.value.open,\n value: ctx.api.value.value,\n collection: ctx.api.value.collection,\n focusedValue: ctx.api.value.focusedValue,\n canClear: ctx.api.value.canClear,\n isSelected: ctx.api.value.isSelected,\n setOpen: ctx.api.value.setOpen,\n setValue: ctx.api.value.setValue,\n select: ctx.api.value.select,\n clear: ctx.api.value.clear,\n }))\n },\n})\n\n/** 盒:触发器与清空按钮在里面并排,描边、底色与聚焦环都长在它上面。 */\nexport const XhPopselectControl = defineComponent({\n name: 'XhPopselectControl',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n return () => h('div', ctx.api.value.getControlProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhPopselectTrigger = defineComponent({\n name: 'XhPopselectTrigger',\n props: {\n /** 借用作者的子节点当触发器,不再渲染自己的包裹元素;子节点须恰好一个。 */\n asChild: Boolean,\n },\n setup(props, { slots }) {\n const ctx = usePopselectContext()\n return () => {\n const attrs = {\n ...ctx.api.value.getTriggerProps() as Record<string, unknown>,\n ref: (el: unknown) => { ctx.triggerRef.value = el as HTMLElement },\n }\n const children = slots.default?.()\n // asChild:把触发器属性合到作者的节点上,不再自己渲染包裹元素\n if (props.asChild) {\n const merged = mergeIntoChild(children, attrs, 'popselect')\n if (merged)\n return merged\n }\n return h('button', attrs, children)\n }\n },\n})\n\n/** 清空钮:盒里 trigger 的兄弟节点,有选中值才显出;没写内容时由皮肤画叉。 */\nexport const XhPopselectClearTrigger = defineComponent({\n name: 'XhPopselectClearTrigger',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n return () => h('button', ctx.api.value.getClearTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhPopselectPositioner = defineComponent({\n name: 'XhPopselectPositioner',\n // 根是 Teleport,Vue 不会把直通属性合上去,作者写的 class 与 style 得自己接住落到 positioner 上\n inheritAttrs: false,\n setup(_, { slots, attrs }) {\n const ctx = usePopselectContext()\n // 候选列表的自绘条:与 content 同级、绝对定位不占布局,壳是这层已经 fixed 的 positioner\n const bars = useScrollbars({ scrollable: () => ctx.contentRef.value })\n // 定位层搬到 portal 落点,逃开祖先的层叠上下文\n return () => h(Teleport, { to: ctx.portalTarget.value }, [\n h('div', {\n ...mergeProps(ctx.api.value.getPositionerProps() as Record<string, unknown>, attrs),\n ref: (el: unknown) => { ctx.positionerRef.value = el as HTMLElement },\n }, [...(slots.default?.() ?? []), ...bars.render()]),\n ])\n },\n})\n\nexport const XhPopselectContent = defineComponent({\n name: 'XhPopselectContent',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n return () => h('div', {\n ...ctx.api.value.getContentProps() as Record<string, unknown>,\n // 收起跟着退场闸门走:皮肤刻意没给 content 补 [hidden]{display:none}(补了退场\n // 就一帧都播不出来),所以真正的收起落成内联 display——节点始终留在原地\n style: ctx.visible.value ? undefined : { display: 'none' },\n ref: (el: unknown) => { ctx.contentRef.value = el as HTMLElement },\n }, slots.default?.() ?? renderItems(ctx.api.value.collection, slots.item))\n },\n})\n\nexport const XhPopselectItem = defineComponent({\n name: 'XhPopselectItem',\n props: {\n value: { type: String, required: true },\n // 缺省交给 connect 回 collection 里查,写死 false 会盖掉数据里的禁用\n disabled: { type: Boolean, default: undefined },\n },\n setup(props, { slots }) {\n const ctx = usePopselectContext()\n const item = computed<PopselectItemProps>(() => ({ value: props.value, disabled: props.disabled }))\n providePopselectItem({ item })\n // 本条目持有焦点时,value 变更重报焦点条目,卸载时上报列表失焦\n const itemEl = ref<HTMLElement | null>(null)\n watch(() => props.value, (next, prev) => {\n if (next === prev)\n return\n const { listbox } = ctx\n if (listbox.getStatus() !== 'Started')\n return\n if (itemEl.value && listbox.scope.getActiveElement() === itemEl.value)\n listbox.send({ type: 'ITEM.FOCUS', value: next })\n })\n onBeforeUnmount(() => {\n const { listbox } = ctx\n if (listbox.getStatus() !== 'Started')\n return\n // 按「本节点当下正持有焦点」判定,不按 value 比对\n if (itemEl.value && listbox.scope.getActiveElement() === itemEl.value)\n listbox.send({ type: 'LIST.BLUR' })\n })\n return () => h(\n 'div',\n { ...ctx.api.value.getItemProps(item.value) as Record<string, unknown>, ref: itemEl },\n slots.default?.(),\n )\n },\n})\n\nexport const XhPopselectItemText = defineComponent({\n name: 'XhPopselectItemText',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n const { item } = usePopselectItemContext()\n return () => h('span', ctx.api.value.getItemTextProps(item.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhPopselectItemIndicator = defineComponent({\n name: 'XhPopselectItemIndicator',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n const { item } = usePopselectItemContext()\n return () => h('span', ctx.api.value.getItemIndicatorProps(item.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 浮层里没写默认插槽时按 collection 铺开的条目,作者只交数据。\n * 与手写部件产出的 DOM 完全一致,要在条目之外放别的节点就写默认插槽。\n */\nfunction renderItems(\n collection: readonly PopselectNodeMeta[],\n itemSlot?: (node: PopselectNodeMeta) => VNode[],\n): VNode[] {\n return collection.map(node =>\n h(XhPopselectItem, { key: node.value, value: node.value }, () => [\n h(XhPopselectItemText, null, () => itemSlot?.(node) ?? node.label),\n h(XhPopselectItemIndicator),\n ]),\n )\n}\n"],"mappings":";;;;;;AAiBA,MAAa,kBAAkB,gBAAgB;CAC7C,MAAM;CAEN,OAAO;EACL,YAAY;GAAE,MAAM;GAAoC,SAAS,KAAA;EAAU;EAC3E,OAAO;GAAE,MAAM,CAAC,QAAQ,KAAK;GAAkC,SAAS,KAAA;EAAU;EAClF,cAAc;GAAE,MAAM,CAAC,QAAQ,KAAK;GAAkC,SAAS,KAAA;EAAU;EACzF,UAAU;EACV,UAAU;EACV,MAAM;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC1C,WAAW;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC/C,KAAK;GAAE,MAAM;GAA+B,SAAS,KAAA;EAAU;EAC/D,MAAM;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC1C,aAAa;EACb,WAAW;GAAE,MAAM;GAA+B,SAAS,KAAA;EAAU;EACrE,QAAQ;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EAC3C,eAAe;GA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AM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,oBAAoB;EAChC,MAAM,EAAE,SAAS,wBAAwB;EACzC,aAAa,EAAE,QAAQ,IAAI,IAAI,MAAM,iBAAiB,KAAK,KAAK,GAA8B,MAAM,UAAU,CAAC;CACjH;AACF,CAAC;AAED,MAAa,2BAA2B,gBAAgB;CACtD,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,oBAAoB;EAChC,MAAM,EAAE,SAAS,wBAAwB;EACzC,aAAa,EAAE,QAAQ,IAAI,IAAI,MAAM,sBAAsB,KAAK,KAAK,GAA8B,MAAM,UAAU,CAAC;CACtH;AACF,CAAC;;;;;AAMD,SAAS,YACP,YACA,UACS;CACT,OAAO,WAAW,KAAI,SACpB,EAAE,iBAAiB;EAAE,KAAK,KAAK;EAAO,OAAO,KAAK;CAAM,SAAS,CAC/D,EAAE,qBAAqB,YAAY,WAAW,IAAI,KAAK,KAAK,KAAK,GACjE,EAAE,wBAAwB,CAC5B,CAAC,CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"popselect.js","names":[],"sources":["../../../src/components/popselect/popselect.ts"],"sourcesContent":["import type { PopselectApi, PopselectItemProps, PopselectNode, PopselectNodeMeta, PopselectTranslations } from '@xihan-ui/headless'\nimport type { ControlVariant, Direction, Placement, Size, Tone } from '@xihan-ui/kernel'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport type { PopselectNotifiers, PopselectRootProps } from './use-popselect'\nimport { computed, defineComponent, h, mergeProps, onBeforeUnmount, ref, Teleport, watch } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { mergeIntoChild } from '../../runtime/as-child'\nimport { useScrollbars } from '../../runtime/use-scrollbars'\nimport { providePopselect, providePopselectItem, usePopselectContext, usePopselectItemContext } from './context'\nimport { usePopselect } from './use-popselect'\n\n/** 默认插槽的载荷:浮层开合、选中集合与条目数据,以及改动它们的方法。 */\nexport type PopselectRootSlotProps = Pick<\n PopselectApi,\n 'open' | 'value' | 'collection' | 'focusedValue' | 'canClear' | 'isSelected' | 'setOpen' | 'setValue' | 'select' | 'clear'\n>\n\nexport const XhPopselectRoot = defineComponent({\n name: 'XhPopselectRoot',\n // 有 connect 或机器兜底的 prop 一律 default: undefined\n props: {\n collection: { type: Array as PropType<PopselectNode[]>, default: undefined },\n value: { type: [String, Array] as PropType<string | string[]>, default: undefined },\n defaultValue: { type: [String, Array] as PropType<string | string[]>, default: undefined },\n multiple: Boolean,\n disabled: Boolean,\n loop: { type: Boolean, default: undefined },\n typeahead: { type: Boolean, default: undefined },\n dir: { type: String as PropType<Direction>, default: undefined },\n open: { type: Boolean, default: undefined },\n defaultOpen: Boolean,\n placement: { type: String as PropType<Placement>, default: undefined },\n offset: { type: Number, default: undefined },\n closeOnEscape: { type: Boolean, default: undefined },\n closeOnInteractOutside: { type: Boolean, default: undefined },\n variant: { type: String as PropType<ControlVariant>, default: undefined },\n tone: { type: String as PropType<Tone>, default: undefined },\n size: { type: String as PropType<Size>, default: undefined },\n translations: { type: Object as PropType<Partial<PopselectTranslations>>, default: undefined },\n },\n // *-change 携带 details 对象,update:* 携带裸值;回传的选中值恒为数组,单选时长度 ≤ 1\n emits: {\n 'value-change': (_details: PayloadOf<PopselectNotifiers, 'onValueChange'>) => true,\n 'open-change': (_details: PayloadOf<PopselectNotifiers, 'onOpenChange'>) => true,\n 'update:value': (_value: PayloadOf<PopselectNotifiers, 'onValueChange'>['value']) => true,\n 'update:open': (_open: PayloadOf<PopselectNotifiers, 'onOpenChange'>['open']) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: PopselectRootSlotProps) => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const notify: PopselectNotifiers = {\n onValueChange: (details) => {\n emit('value-change', details)\n emit('update:value', details.value)\n },\n onOpenChange: (details) => {\n emit('open-change', details)\n emit('update:open', details.open)\n },\n }\n const ctx = usePopselect(withXhConfig('popselect', props) as PopselectRootProps, notify)\n providePopselect(ctx)\n return () => h('div', ctx.api.value.getRootProps() as Record<string, unknown>, slots.default?.({\n open: ctx.api.value.open,\n value: ctx.api.value.value,\n collection: ctx.api.value.collection,\n focusedValue: ctx.api.value.focusedValue,\n canClear: ctx.api.value.canClear,\n isSelected: ctx.api.value.isSelected,\n setOpen: ctx.api.value.setOpen,\n setValue: ctx.api.value.setValue,\n select: ctx.api.value.select,\n clear: ctx.api.value.clear,\n }))\n },\n})\n\n/** 盒:触发器与清空按钮在里面并排,描边、底色与聚焦环都长在它上面。 */\nexport const XhPopselectControl = defineComponent({\n name: 'XhPopselectControl',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n return () => h('div', ctx.api.value.getControlProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhPopselectTrigger = defineComponent({\n name: 'XhPopselectTrigger',\n props: {\n /** 借用作者的子节点当触发器,不再渲染自己的包裹元素;子节点须恰好一个。 */\n asChild: Boolean,\n },\n setup(props, { slots }) {\n const ctx = usePopselectContext()\n return () => {\n const attrs = {\n ...ctx.api.value.getTriggerProps() as Record<string, unknown>,\n ref: (el: unknown) => { ctx.triggerRef.value = el as HTMLElement },\n }\n const children = slots.default?.()\n // asChild:把触发器属性合到作者的节点上,不再自己渲染包裹元素\n if (props.asChild) {\n const merged = mergeIntoChild(children, attrs, 'popselect')\n if (merged)\n return merged\n }\n return h('button', attrs, children)\n }\n },\n})\n\n/** 清空钮:盒里 trigger 的兄弟节点,有选中值才显出;没写内容时由皮肤画叉。 */\nexport const XhPopselectClearTrigger = defineComponent({\n name: 'XhPopselectClearTrigger',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n return () => h('button', ctx.api.value.getClearTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhPopselectPositioner = defineComponent({\n name: 'XhPopselectPositioner',\n // 根是 Teleport,Vue 不会把直通属性合上去,作者写的 class 与 style 得自己接住落到 positioner 上\n inheritAttrs: false,\n setup(_, { slots, attrs }) {\n const ctx = usePopselectContext()\n // 候选列表的自绘条:与 content 同级、绝对定位不占布局,壳是这层已经 fixed 的 positioner\n const bars = useScrollbars({ scrollable: () => ctx.contentRef.value })\n // 定位层搬到 portal 落点,逃开祖先的层叠上下文\n return () => h(Teleport, { to: ctx.portalTarget.value }, [\n h('div', {\n ...mergeProps(ctx.api.value.getPositionerProps() as Record<string, unknown>, attrs),\n ref: (el: unknown) => { ctx.positionerRef.value = el as HTMLElement },\n }, [...(slots.default?.() ?? []), ...bars.render()]),\n ])\n },\n})\n\nexport const XhPopselectContent = defineComponent({\n name: 'XhPopselectContent',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n return () => h('div', {\n ...ctx.api.value.getContentProps() as Record<string, unknown>,\n // 收起跟着退场闸门走:皮肤刻意没给 content 补 [hidden]{display:none}(补了退场\n // 就一帧都播不出来),所以真正的收起落成内联 display——节点始终留在原地\n style: ctx.visible.value ? undefined : { display: 'none' },\n ref: (el: unknown) => { ctx.contentRef.value = el as HTMLElement },\n }, slots.default?.() ?? renderItems(ctx.api.value.collection, slots.item))\n },\n})\n\nexport const XhPopselectItem = defineComponent({\n name: 'XhPopselectItem',\n props: {\n value: { type: String, required: true },\n // 缺省交给 connect 回 collection 里查,写死 false 会盖掉数据里的禁用\n disabled: { type: Boolean, default: undefined },\n },\n setup(props, { slots }) {\n const ctx = usePopselectContext()\n const item = computed<PopselectItemProps>(() => ({ value: props.value, disabled: props.disabled }))\n providePopselectItem({ item })\n // 本条目持有焦点时,value 变更重报焦点条目,卸载时上报列表失焦\n const itemEl = ref<HTMLElement | null>(null)\n watch(() => props.value, (next, prev) => {\n if (next === prev)\n return\n const { listbox } = ctx\n if (listbox.getStatus() !== 'Started')\n return\n if (itemEl.value && listbox.scope.getActiveElement() === itemEl.value)\n listbox.send({ type: 'ITEM.FOCUS', value: next })\n })\n onBeforeUnmount(() => {\n const { listbox } = ctx\n if (listbox.getStatus() !== 'Started')\n return\n // 按「本节点当下正持有焦点」判定,不按 value 比对\n if (itemEl.value && listbox.scope.getActiveElement() === itemEl.value)\n listbox.send({ type: 'LIST.BLUR' })\n })\n return () => h(\n 'div',\n { ...ctx.api.value.getItemProps(item.value) as Record<string, unknown>, ref: itemEl },\n slots.default?.(),\n )\n },\n})\n\nexport const XhPopselectItemText = defineComponent({\n name: 'XhPopselectItemText',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n const { item } = usePopselectItemContext()\n return () => h('span', ctx.api.value.getItemTextProps(item.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhPopselectItemIndicator = defineComponent({\n name: 'XhPopselectItemIndicator',\n setup(_, { slots }) {\n const ctx = usePopselectContext()\n const { item } = usePopselectItemContext()\n return () => h('span', ctx.api.value.getItemIndicatorProps(item.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 浮层里没写默认插槽时按 collection 铺开的条目,作者只交数据。\n * 与手写部件产出的 DOM 完全一致,要在条目之外放别的节点就写默认插槽。\n */\nfunction renderItems(\n collection: readonly PopselectNodeMeta[],\n itemSlot?: (node: PopselectNodeMeta) => VNode[],\n): VNode[] {\n return collection.map(node =>\n h(XhPopselectItem, { key: node.value, value: node.value }, () => [\n h(XhPopselectItemText, null, () => itemSlot?.(node) ?? node.label),\n h(XhPopselectItemIndicator),\n ]),\n )\n}\n"],"mappings":";;;;;;;AAkBA,MAAa,kBAAkB,gBAAgB;CAC7C,MAAM;CAEN,OAAO;EACL,YAAY;GAAE,MAAM;GAAoC,SAAS,KAAA;EAAU;EAC3E,OAAO;GAAE,MAAM,CAAC,QAAQ,KAAK;GAAkC,SAAS,KAAA;EAAU;EAClF,cAAc;GAAE,MAAM,CAAC,QAAQ,KAAK;GAAkC,SAAS,KAAA;EAAU;EACzF,UAAU;EACV,UAAU;EACV,MAAM;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC1C,WAAW;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC/C,KAAK;GAAE,MAAM;GAA+B,SAAS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,KAAK,EAAE,MAAM,YAAY,CAAC;EACtC,CAAC;EACD,aAAa,EACX,OACA;GAAE,GAAG,IAAI,IAAI,MAAM,aAAa,KAAK,KAAK;GAA8B,KAAK;EAAO,GACpF,MAAM,UAAU,CAClB;CACF;AACF,CAAC;AAED,MAAa,sBAAsB,gBAAgB;CACjD,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,oBAAoB;EAChC,MAAM,EAAE,SAAS,wBAAwB;EACzC,aAAa,EAAE,QAAQ,IAAI,IAAI,MAAM,iBAAiB,KAAK,KAAK,GAA8B,MAAM,UAAU,CAAC;CACjH;AACF,CAAC;AAED,MAAa,2BAA2B,gBAAgB;CACtD,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,oBAAoB;EAChC,MAAM,EAAE,SAAS,wBAAwB;EACzC,aAAa,EAAE,QAAQ,IAAI,IAAI,MAAM,sBAAsB,KAAK,KAAK,GAA8B,MAAM,UAAU,CAAC;CACtH;AACF,CAAC;;;;;AAMD,SAAS,YACP,YACA,UACS;CACT,OAAO,WAAW,KAAI,SACpB,EAAE,iBAAiB;EAAE,KAAK,KAAK;EAAO,OAAO,KAAK;CAAM,SAAS,CAC/D,EAAE,qBAAqB,YAAY,WAAW,IAAI,KAAK,KAAK,KAAK,GACjE,EAAE,wBAAwB,CAC5B,CAAC,CACH;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ResizableContext } from "./use-resizable.js";
|
|
2
|
+
//#region src/components/resizable/context.d.ts
|
|
3
|
+
declare function provideResizable(ctx: ResizableContext): void;
|
|
4
|
+
declare function useResizableContext(): ResizableContext;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { provideResizable, useResizableContext };
|
|
7
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","names":[],"sources":["../../../src/components/resizable/context.ts"],"mappings":";;iBAMgB,iBAAiB,KAAK;iBAItB,uBAAuB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { inject, provide } from "vue";
|
|
2
|
+
//#region src/components/resizable/context.ts
|
|
3
|
+
const KEY = Symbol.for("xh-resizable");
|
|
4
|
+
function provideResizable(ctx) {
|
|
5
|
+
provide(KEY, ctx);
|
|
6
|
+
}
|
|
7
|
+
function useResizableContext() {
|
|
8
|
+
const ctx = inject(KEY, null);
|
|
9
|
+
if (!ctx) throw new Error("[xh] Resizable 部件必须用在 XhResizableRoot 内");
|
|
10
|
+
return ctx;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { provideResizable, useResizableContext };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../../src/components/resizable/context.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { ResizableContext } from './use-resizable'\nimport { inject, provide } from 'vue'\n\nconst KEY: InjectionKey<ResizableContext> = Symbol.for('xh-resizable')\n\nexport function provideResizable(ctx: ResizableContext): void {\n provide(KEY, ctx)\n}\n\nexport function useResizableContext(): ResizableContext {\n const ctx = inject(KEY, null)\n if (!ctx)\n throw new Error('[xh] Resizable 部件必须用在 XhResizableRoot 内')\n return ctx\n}\n"],"mappings":";;AAIA,MAAM,MAAsC,OAAO,IAAI,cAAc;AAErE,SAAgB,iBAAiB,KAA6B;CAC5D,QAAQ,KAAK,GAAG;AAClB;AAEA,SAAgB,sBAAwC;CACtD,MAAM,MAAM,OAAO,KAAK,IAAI;CAC5B,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,yCAAyC;CAC3D,OAAO;AACT"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { PayloadOf } from "../../runtime/payload.js";
|
|
2
|
+
import { PropType, SlotsType, VNode } from "vue";
|
|
3
|
+
import { ResizableOffset, ResizableSchema, ResizableSize, ResizableTranslations } from "@xihan-ui/headless";
|
|
4
|
+
import { Direction } from "@xihan-ui/kernel";
|
|
5
|
+
import { ResizeEdge } from "@xihan-ui/pointer";
|
|
6
|
+
//#region src/components/resizable/resizable.d.ts
|
|
7
|
+
type ResizableProps = ResizableSchema['props'];
|
|
8
|
+
/** 默认插槽的载荷:当前尺寸、位移与调整态。 */
|
|
9
|
+
interface ResizableRootSlotProps {
|
|
10
|
+
size: ResizableSize;
|
|
11
|
+
offset: ResizableOffset;
|
|
12
|
+
resizing: boolean;
|
|
13
|
+
activeEdge: ResizeEdge | null;
|
|
14
|
+
}
|
|
15
|
+
declare const XhResizableRoot: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
16
|
+
size: {
|
|
17
|
+
type: PropType<ResizableSize>;
|
|
18
|
+
default: undefined;
|
|
19
|
+
};
|
|
20
|
+
defaultSize: {
|
|
21
|
+
type: PropType<ResizableSize>;
|
|
22
|
+
default: undefined;
|
|
23
|
+
};
|
|
24
|
+
minWidth: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
28
|
+
minHeight: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: undefined;
|
|
31
|
+
};
|
|
32
|
+
maxWidth: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
36
|
+
maxHeight: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
aspectRatio: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: undefined;
|
|
43
|
+
};
|
|
44
|
+
step: {
|
|
45
|
+
type: NumberConstructor;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
keyboardStep: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
keyboardLargeStep: {
|
|
53
|
+
type: NumberConstructor;
|
|
54
|
+
default: undefined;
|
|
55
|
+
};
|
|
56
|
+
edges: {
|
|
57
|
+
type: PropType<ResizeEdge[]>;
|
|
58
|
+
default: undefined;
|
|
59
|
+
};
|
|
60
|
+
disabled: BooleanConstructor;
|
|
61
|
+
dir: {
|
|
62
|
+
type: PropType<Direction>;
|
|
63
|
+
default: undefined;
|
|
64
|
+
};
|
|
65
|
+
translations: {
|
|
66
|
+
type: PropType<Partial<ResizableTranslations>>;
|
|
67
|
+
default: undefined;
|
|
68
|
+
};
|
|
69
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
72
|
+
'size-change': (_details: PayloadOf<ResizableProps, "onSizeChange">) => true;
|
|
73
|
+
'update:size': (_size: PayloadOf<ResizableProps, "onSizeChange">["size"]) => true;
|
|
74
|
+
'size-change-end': (_details: PayloadOf<ResizableProps, "onSizeChangeEnd">) => true;
|
|
75
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
76
|
+
size: {
|
|
77
|
+
type: PropType<ResizableSize>;
|
|
78
|
+
default: undefined;
|
|
79
|
+
};
|
|
80
|
+
defaultSize: {
|
|
81
|
+
type: PropType<ResizableSize>;
|
|
82
|
+
default: undefined;
|
|
83
|
+
};
|
|
84
|
+
minWidth: {
|
|
85
|
+
type: NumberConstructor;
|
|
86
|
+
default: undefined;
|
|
87
|
+
};
|
|
88
|
+
minHeight: {
|
|
89
|
+
type: NumberConstructor;
|
|
90
|
+
default: undefined;
|
|
91
|
+
};
|
|
92
|
+
maxWidth: {
|
|
93
|
+
type: NumberConstructor;
|
|
94
|
+
default: undefined;
|
|
95
|
+
};
|
|
96
|
+
maxHeight: {
|
|
97
|
+
type: NumberConstructor;
|
|
98
|
+
default: undefined;
|
|
99
|
+
};
|
|
100
|
+
aspectRatio: {
|
|
101
|
+
type: NumberConstructor;
|
|
102
|
+
default: undefined;
|
|
103
|
+
};
|
|
104
|
+
step: {
|
|
105
|
+
type: NumberConstructor;
|
|
106
|
+
default: undefined;
|
|
107
|
+
};
|
|
108
|
+
keyboardStep: {
|
|
109
|
+
type: NumberConstructor;
|
|
110
|
+
default: undefined;
|
|
111
|
+
};
|
|
112
|
+
keyboardLargeStep: {
|
|
113
|
+
type: NumberConstructor;
|
|
114
|
+
default: undefined;
|
|
115
|
+
};
|
|
116
|
+
edges: {
|
|
117
|
+
type: PropType<ResizeEdge[]>;
|
|
118
|
+
default: undefined;
|
|
119
|
+
};
|
|
120
|
+
disabled: BooleanConstructor;
|
|
121
|
+
dir: {
|
|
122
|
+
type: PropType<Direction>;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
125
|
+
translations: {
|
|
126
|
+
type: PropType<Partial<ResizableTranslations>>;
|
|
127
|
+
default: undefined;
|
|
128
|
+
};
|
|
129
|
+
}>> & Readonly<{
|
|
130
|
+
"onSize-change"?: ((_details: import("@xihan-ui/headless").ResizableSizeChangeDetails) => any) | undefined;
|
|
131
|
+
"onUpdate:size"?: ((_size: ResizableSize) => any) | undefined;
|
|
132
|
+
"onSize-change-end"?: ((_details: import("@xihan-ui/headless").ResizableSizeChangeEndDetails) => any) | undefined;
|
|
133
|
+
}>, {
|
|
134
|
+
dir: Direction;
|
|
135
|
+
size: ResizableSize;
|
|
136
|
+
disabled: boolean;
|
|
137
|
+
translations: Partial<ResizableTranslations>;
|
|
138
|
+
defaultSize: ResizableSize;
|
|
139
|
+
aspectRatio: number;
|
|
140
|
+
minWidth: number;
|
|
141
|
+
minHeight: number;
|
|
142
|
+
step: number;
|
|
143
|
+
maxWidth: number;
|
|
144
|
+
maxHeight: number;
|
|
145
|
+
keyboardStep: number;
|
|
146
|
+
keyboardLargeStep: number;
|
|
147
|
+
edges: ResizeEdge[];
|
|
148
|
+
}, SlotsType<{
|
|
149
|
+
default?: (props: ResizableRootSlotProps) => VNode[];
|
|
150
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
151
|
+
/**
|
|
152
|
+
* 一条边上的把手。
|
|
153
|
+
*
|
|
154
|
+
* 推西边与北边时容器的起点会动,那段位移写成 root 的 left / top——皮肤已给
|
|
155
|
+
* `position: relative`,开箱即对。把 root 改成 static 会让这两个方向只变尺寸不移位。
|
|
156
|
+
*/
|
|
157
|
+
declare const XhResizableHandle: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
158
|
+
edge: {
|
|
159
|
+
type: PropType<ResizeEdge>;
|
|
160
|
+
required: true;
|
|
161
|
+
};
|
|
162
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
163
|
+
[key: string]: any;
|
|
164
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
165
|
+
edge: {
|
|
166
|
+
type: PropType<ResizeEdge>;
|
|
167
|
+
required: true;
|
|
168
|
+
};
|
|
169
|
+
}>> & Readonly<{}>, {}, SlotsType<{
|
|
170
|
+
default?: () => VNode[];
|
|
171
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
172
|
+
//#endregion
|
|
173
|
+
export { ResizableRootSlotProps, XhResizableHandle, XhResizableRoot };
|
|
174
|
+
//# sourceMappingURL=resizable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","names":[],"sources":["../../../src/components/resizable/resizable.ts"],"mappings":";;;;;;KAUK,iBAAiB;;UAGL;EACf,MAAM;EACN,QAAQ;EACR;EACA,YAAY;;cAGD,+BAAe,8BAAA;;IAGA,MAAA,SAAS;;;;IACF,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAShB,MAAA,SAAS;;;;;IAEV,MAAA,SAAS;;;;IACA,MAAA,SAAS,QAAQ;;;;;;EAKvB,gBAAA,UAAA,UAAU;EACb,gBAAA,OAAA,UAAU;EACH,oBAAA,UAAA,UAAU;;;IApBhB,MAAA,SAAS;;;;IACF,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAShB,MAAA,SAAS;;;;;IAEV,MAAA,SAAS;;;;IACA,MAAA,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;EAUvC,WAAC,OAAO,2BAA2B;kCAoB/C;;;;;;;cAQW,iCAAiB,8BAAA;;IAGF,MAAA,SAAS;;;;;;;IAAT,MAAA,SAAS;;;;EAGvB,gBAAM;kCAUlB"}
|