x-next 1.10.0 → 1.11.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/AI_CODING.md +97 -0
- package/AI_USAGE/catalog.md +111 -0
- package/AI_USAGE/components/alert.md +33 -0
- package/AI_USAGE/components/bar-chart.md +46 -0
- package/AI_USAGE/components/button.md +35 -0
- package/AI_USAGE/components/checkbox.md +34 -0
- package/AI_USAGE/components/color-picker.md +36 -0
- package/AI_USAGE/components/config-provider.md +58 -0
- package/AI_USAGE/components/date-picker.md +34 -0
- package/AI_USAGE/components/dialog.md +37 -0
- package/AI_USAGE/components/dropdown.md +38 -0
- package/AI_USAGE/components/empty.md +30 -0
- package/AI_USAGE/components/input.md +32 -0
- package/AI_USAGE/components/line-chart.md +45 -0
- package/AI_USAGE/components/message-box.md +39 -0
- package/AI_USAGE/components/message.md +36 -0
- package/AI_USAGE/components/notification.md +37 -0
- package/AI_USAGE/components/pagination.md +32 -0
- package/AI_USAGE/components/pie-chart.md +55 -0
- package/AI_USAGE/components/popconfirm.md +33 -0
- package/AI_USAGE/components/popover.md +35 -0
- package/AI_USAGE/components/progress.md +32 -0
- package/AI_USAGE/components/radio.md +35 -0
- package/AI_USAGE/components/rate.md +30 -0
- package/AI_USAGE/components/select.md +38 -0
- package/AI_USAGE/components/slider.md +34 -0
- package/AI_USAGE/components/steps.md +33 -0
- package/AI_USAGE/components/switch.md +32 -0
- package/AI_USAGE/components/tabs.md +33 -0
- package/AI_USAGE/components/textarea.md +31 -0
- package/AI_USAGE/components/time-picker.md +34 -0
- package/AI_USAGE/components/upload.md +60 -0
- package/AI_USAGE/core.md +37 -0
- package/AI_USAGE/index.md +52 -0
- package/AI_USAGE/recipes/form-on-demand.md +42 -0
- package/AI_USAGE.md +173 -46
- package/CHANGELOG.md +36 -1
- package/README.md +15 -2
- package/dist/_container/resize-trigger.vue.d.ts +1 -1
- package/dist/_hooks/use-dialog-focus.d.ts +7 -0
- package/dist/_hooks/use-pointer-drag.d.ts +6 -0
- package/dist/_hooks/use-popup-close.d.ts +11 -0
- package/dist/_hooks/use-popup-theme.d.ts +5 -0
- package/dist/_utils/palette.d.ts +2 -0
- package/dist/components/_components/picker/input-range.vue.d.ts +1 -3
- package/dist/components/_components/picker/input.vue.d.ts +1 -3
- package/dist/components/_components/select-view/select-view.d.ts +9 -0
- package/dist/components/alert/Alert.vue.d.ts +1 -1
- package/dist/components/alert/index.d.ts +3 -3
- package/dist/components/bar-chart/BarChart.d.ts +3 -3
- package/dist/components/bar-chart/index.d.ts +9 -9
- package/dist/components/color-picker/ColorPicker.d.ts +2 -1
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/panel.d.ts +6 -0
- package/dist/components/config-provider/context.d.ts +7 -1
- package/dist/components/date-picker/DatePicker.vue.d.ts +9 -12
- package/dist/components/date-picker/index.d.ts +19 -27
- package/dist/components/drawer/index.d.ts +51 -9
- package/dist/components/drawer/src/Drawer.vue.d.ts +19 -4
- package/dist/components/dropdown/Dropdown.vue.d.ts +6 -3
- package/dist/components/dropdown/DropdownButton.vue.d.ts +6 -3
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +6 -3
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +6 -3
- package/dist/components/dropdown/index.d.ts +36 -18
- package/dist/components/form-select/Select.d.ts +18 -5
- package/dist/components/form-select/SelectDropdown.vue.d.ts +6 -3
- package/dist/components/form-select/SelectOption.vue.d.ts +1 -0
- package/dist/components/form-select/SelectOptionGroup.vue.d.ts +1 -0
- package/dist/components/form-select/hooks/use-options.d.ts +1 -1
- package/dist/components/form-select/hooks/use-select.d.ts +1 -1
- package/dist/components/form-select/index.d.ts +57 -17
- package/dist/components/form-select/interface.d.ts +8 -0
- package/dist/components/form-slider/Slider.vue.d.ts +1 -1
- package/dist/components/form-slider/index.d.ts +3 -3
- package/dist/components/form-textarea/Textarea.vue.d.ts +2 -4
- package/dist/components/form-textarea/index.d.ts +6 -12
- package/dist/components/image/Image.vue.d.ts +2 -4
- package/dist/components/image/index.d.ts +6 -12
- package/dist/components/layout/LayoutSidebar.vue.d.ts +5 -5
- package/dist/components/layout/index.d.ts +10 -10
- package/dist/components/line-chart/LineChart.d.ts +3 -3
- package/dist/components/line-chart/index.d.ts +9 -9
- package/dist/components/menu/Menu.d.ts +6 -3
- package/dist/components/menu/base-menu.vue.d.ts +6 -3
- package/dist/components/menu/index.d.ts +12 -6
- package/dist/components/menu/sub-menu-pop.vue.d.ts +6 -3
- package/dist/components/network/Network.vue.d.ts +1 -1
- package/dist/components/network/index.d.ts +3 -3
- package/dist/components/pagination/page-options.vue.d.ts +60 -32
- package/dist/components/pie-chart/PieChart.d.ts +1 -1
- package/dist/components/pie-chart/index.d.ts +3 -3
- package/dist/components/resize-box/ResizeBox.vue.d.ts +2 -2
- package/dist/components/resize-box/index.d.ts +5 -5
- package/dist/components/scrollbar-v2/Scrollbar.vue.d.ts +2 -1
- package/dist/components/scrollbar-v2/index.d.ts +6 -3
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimeColumn.vue.d.ts +6 -3
- package/dist/components/time-picker/TimePanel.vue.d.ts +6 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +9 -12
- package/dist/components/time-picker/index.d.ts +19 -27
- package/dist/components/trend-chart/components/TrendChart.d.ts +5 -5
- package/dist/components/trend-chart/components/trend-chart-curve.d.ts +1 -1
- package/dist/components/trend-chart/index.d.ts +14 -14
- package/dist/components/trigger/interface.d.ts +2 -0
- package/dist/components/virtual-list-v2/virtual-list.vue.d.ts +7 -4
- package/dist/es/_hooks/use-dialog-focus.js +69 -0
- package/dist/es/_hooks/use-pointer-drag.js +18 -0
- package/dist/es/_hooks/use-popup-close.js +27 -0
- package/dist/es/_hooks/use-popup-manager.js +26 -24
- package/dist/es/_hooks/use-popup-theme.js +18 -0
- package/dist/es/_hooks/use-teleport-container.js +9 -10
- package/dist/es/_utils/palette.js +57 -52
- package/dist/es/components/_components/select-view/select-view.js +89 -78
- package/dist/es/components/button/Button.js +1 -1
- package/dist/es/components/color-picker/ColorPicker.js +131 -102
- package/dist/es/components/color-picker/gradient-slider.js +38 -40
- package/dist/es/components/color-picker/panel.js +221 -192
- package/dist/es/components/color-picker/sv-panel.js +51 -50
- package/dist/es/components/config-provider/ConfigProvider.js +58 -41
- package/dist/es/components/dialog/Dialog.js +133 -186
- package/dist/es/components/drawer/src/Drawer.vue.js +59 -51
- package/dist/es/components/drawer/src/Drawer.vue2.js +117 -107
- package/dist/es/components/form/FormItem.vue.js +12 -12
- package/dist/es/components/form-input-tag/InputTag.js +1 -1
- package/dist/es/components/form-select/Select.js +348 -300
- package/dist/es/components/form-select/SelectDropdown.vue.js +7 -7
- package/dist/es/components/form-select/SelectOption.vue.js +22 -17
- package/dist/es/components/form-select/SelectOption.vue2.js +59 -51
- package/dist/es/components/form-select/SelectOptionGroup.vue.js +17 -13
- package/dist/es/components/form-select/SelectOptionGroup.vue2.js +8 -5
- package/dist/es/components/form-select/hooks/use-options.js +40 -40
- package/dist/es/components/form-select/hooks/use-select.js +76 -71
- package/dist/es/components/form-switch/Switch.vue.js +24 -24
- package/dist/es/components/image/Image.vue.js +12 -12
- package/dist/es/components/link/Link.vue.js +6 -6
- package/dist/es/components/menu/sub-menu-inline.vue.js +11 -11
- package/dist/es/components/menu/sub-menu-pop.vue.js +12 -12
- package/dist/es/components/notification/Notification.js +59 -59
- package/dist/es/components/resize-box/ResizeBox.vue.js +19 -22
- package/dist/es/components/skeleton/Skeleton.vue.js +9 -9
- package/dist/es/components/tag/Tag.vue.js +7 -7
- package/dist/es/components/trigger/Trigger.js +171 -163
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/style/bar-chart.js +1 -0
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/color-picker.css +1 -1
- package/dist/style/color-picker.js +4 -0
- package/dist/style/date-picker.js +4 -0
- package/dist/style/dependencies.json +296 -0
- package/dist/style/dialog.js +2 -0
- package/dist/style/drawer.js +3 -0
- package/dist/style/dropdown.js +5 -0
- package/dist/style/form-checkbox.css +1 -1
- package/dist/style/form-input-number.js +2 -0
- package/dist/style/form-input.css +1 -1
- package/dist/style/form-input.js +1 -0
- package/dist/style/form-select.js +5 -0
- package/dist/style/form-slider.js +5 -0
- package/dist/style/form.js +3 -0
- package/dist/style/heatmap.js +1 -0
- package/dist/style/image.js +2 -0
- package/dist/style/layout.js +1 -0
- package/dist/style/line-chart.js +1 -0
- package/dist/style/menu.js +3 -0
- package/dist/style/message-box.js +3 -0
- package/dist/style/pagination.js +9 -0
- package/dist/style/pie-chart.js +1 -0
- package/dist/style/popconfirm.js +3 -0
- package/dist/style/popover.js +1 -0
- package/dist/style/popup.js +2 -0
- package/dist/style/table.js +12 -0
- package/dist/style/time-picker.js +3 -0
- package/dist/style/tooltip.js +1 -0
- package/dist/style/upload.js +4 -0
- package/dist/style.css +1 -1
- package/package.json +17 -7
|
@@ -85,13 +85,13 @@ export declare const TrendChart: {
|
|
|
85
85
|
}, import('vue').PublicProps, {
|
|
86
86
|
fill: boolean;
|
|
87
87
|
status: import('./props').TrendChartStatus;
|
|
88
|
-
height: string | number;
|
|
89
|
-
width: string | number;
|
|
90
88
|
grid: Record<string, unknown> | null;
|
|
91
|
-
padding: string | number;
|
|
92
|
-
stroke: boolean;
|
|
93
89
|
smooth: boolean;
|
|
90
|
+
stroke: boolean;
|
|
94
91
|
tooltip: boolean;
|
|
92
|
+
padding: string | number;
|
|
93
|
+
height: string | number;
|
|
94
|
+
width: string | number;
|
|
95
95
|
dataset: import('./props').DataSet;
|
|
96
96
|
labels: Record<string, unknown> | null;
|
|
97
97
|
theme: import('./props').Theme;
|
|
@@ -226,8 +226,8 @@ export declare const TrendChart: {
|
|
|
226
226
|
}>> & Readonly<{}>, {
|
|
227
227
|
fill: boolean;
|
|
228
228
|
data: number[];
|
|
229
|
-
stroke: boolean;
|
|
230
229
|
smooth: boolean;
|
|
230
|
+
stroke: boolean;
|
|
231
231
|
tooltip: boolean;
|
|
232
232
|
boundary: import('./props').Boundary;
|
|
233
233
|
showPoints: import('./props').ShowPoints;
|
|
@@ -321,13 +321,13 @@ export declare const TrendChart: {
|
|
|
321
321
|
}>, () => VNode, {}, {}, {}, {
|
|
322
322
|
fill: boolean;
|
|
323
323
|
status: import('./props').TrendChartStatus;
|
|
324
|
-
height: string | number;
|
|
325
|
-
width: string | number;
|
|
326
324
|
grid: Record<string, unknown> | null;
|
|
327
|
-
padding: string | number;
|
|
328
|
-
stroke: boolean;
|
|
329
325
|
smooth: boolean;
|
|
326
|
+
stroke: boolean;
|
|
330
327
|
tooltip: boolean;
|
|
328
|
+
padding: string | number;
|
|
329
|
+
height: string | number;
|
|
330
|
+
width: string | number;
|
|
331
331
|
dataset: import('./props').DataSet;
|
|
332
332
|
labels: Record<string, unknown> | null;
|
|
333
333
|
theme: import('./props').Theme;
|
|
@@ -424,13 +424,13 @@ export declare const TrendChart: {
|
|
|
424
424
|
}, string, {
|
|
425
425
|
fill: boolean;
|
|
426
426
|
status: import('./props').TrendChartStatus;
|
|
427
|
-
height: string | number;
|
|
428
|
-
width: string | number;
|
|
429
427
|
grid: Record<string, unknown> | null;
|
|
430
|
-
padding: string | number;
|
|
431
|
-
stroke: boolean;
|
|
432
428
|
smooth: boolean;
|
|
429
|
+
stroke: boolean;
|
|
433
430
|
tooltip: boolean;
|
|
431
|
+
padding: string | number;
|
|
432
|
+
height: string | number;
|
|
433
|
+
width: string | number;
|
|
434
434
|
dataset: import('./props').DataSet;
|
|
435
435
|
labels: Record<string, unknown> | null;
|
|
436
436
|
theme: import('./props').Theme;
|
|
@@ -565,8 +565,8 @@ export declare const TrendChart: {
|
|
|
565
565
|
}>> & Readonly<{}>, {
|
|
566
566
|
fill: boolean;
|
|
567
567
|
data: number[];
|
|
568
|
-
stroke: boolean;
|
|
569
568
|
smooth: boolean;
|
|
569
|
+
stroke: boolean;
|
|
570
570
|
tooltip: boolean;
|
|
571
571
|
boundary: import('./props').Boundary;
|
|
572
572
|
showPoints: import('./props').ShowPoints;
|
|
@@ -17,6 +17,8 @@ export interface TriggerProps {
|
|
|
17
17
|
blurToClose?: boolean;
|
|
18
18
|
clickToClose?: boolean;
|
|
19
19
|
clickOutsideToClose?: boolean;
|
|
20
|
+
scrollToClose?: boolean;
|
|
21
|
+
scrollToCloseDistance?: number;
|
|
20
22
|
unmountOnClose?: boolean;
|
|
21
23
|
contentClass?: any;
|
|
22
24
|
contentStyle?: CSSProperties;
|
|
@@ -133,8 +133,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
133
133
|
}>, {
|
|
134
134
|
data: Record<string, any>[];
|
|
135
135
|
component: string | Record<string, any>;
|
|
136
|
-
height: string | number;
|
|
137
136
|
scrollbar: boolean | ScrollbarProps;
|
|
137
|
+
height: string | number;
|
|
138
138
|
fixedSize: boolean;
|
|
139
139
|
estimatedSize: number;
|
|
140
140
|
buffer: number;
|
|
@@ -198,11 +198,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
198
198
|
modifier: (className: string) => string;
|
|
199
199
|
is: (className: string) => string;
|
|
200
200
|
};
|
|
201
|
-
cls: import('vue').ComputedRef<unknown[]>;
|
|
201
|
+
cls: import('vue').ComputedRef<(string | false | Record<string, any> | unknown[] | null | undefined)[]>;
|
|
202
202
|
style: import('vue').ComputedRef<import('vue').StyleValue[]>;
|
|
203
203
|
rootRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
204
204
|
getContainerAttrs: () => {
|
|
205
205
|
[x: string]: unknown;
|
|
206
|
+
class?: import('vue').ClassValue;
|
|
206
207
|
};
|
|
207
208
|
getContainerStyle: () => import('vue').StyleValue;
|
|
208
209
|
containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
@@ -325,11 +326,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
325
326
|
modifier: (className: string) => string;
|
|
326
327
|
is: (className: string) => string;
|
|
327
328
|
};
|
|
328
|
-
cls: import('vue').ComputedRef<unknown[]>;
|
|
329
|
+
cls: import('vue').ComputedRef<(string | false | Record<string, any> | unknown[] | null | undefined)[]>;
|
|
329
330
|
style: import('vue').ComputedRef<import('vue').StyleValue[]>;
|
|
330
331
|
rootRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
331
332
|
getContainerAttrs: () => {
|
|
332
333
|
[x: string]: unknown;
|
|
334
|
+
class?: import('vue').ClassValue;
|
|
333
335
|
};
|
|
334
336
|
getContainerStyle: () => import('vue').StyleValue;
|
|
335
337
|
containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
@@ -396,11 +398,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
396
398
|
modifier: (className: string) => string;
|
|
397
399
|
is: (className: string) => string;
|
|
398
400
|
};
|
|
399
|
-
cls: import('vue').ComputedRef<unknown[]>;
|
|
401
|
+
cls: import('vue').ComputedRef<(string | false | Record<string, any> | unknown[] | null | undefined)[]>;
|
|
400
402
|
style: import('vue').ComputedRef<import('vue').StyleValue[]>;
|
|
401
403
|
rootRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
402
404
|
getContainerAttrs: () => {
|
|
403
405
|
[x: string]: unknown;
|
|
406
|
+
class?: import('vue').ClassValue;
|
|
404
407
|
};
|
|
405
408
|
getContainerStyle: () => import('vue').StyleValue;
|
|
406
409
|
containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { watch as g, onBeforeUnmount as S, nextTick as N } from "vue";
|
|
2
|
+
const w = [
|
|
3
|
+
"a[href]",
|
|
4
|
+
"button:not([disabled])",
|
|
5
|
+
"textarea:not([disabled])",
|
|
6
|
+
'input:not([disabled]):not([type="hidden"])',
|
|
7
|
+
"select:not([disabled])",
|
|
8
|
+
"[tabindex]"
|
|
9
|
+
].join(","), f = (r) => r instanceof HTMLInputElement && r.type === "radio" && !!r.name, v = (r, d) => r.name === d.name && r.form === d.form && r.getRootNode() === d.getRootNode(), x = (r) => {
|
|
10
|
+
const d = Array.from(r.querySelectorAll(w)).filter((t) => {
|
|
11
|
+
if (t.tabIndex < 0 || t.matches(':disabled, input[type="hidden"]') || t.closest('[hidden], [inert], [aria-hidden="true"]')) return !1;
|
|
12
|
+
for (let n = t; n; n = n.parentElement) {
|
|
13
|
+
if (n.matches("fieldset[disabled]") && t.matches("button, input, select, textarea")) {
|
|
14
|
+
const l = Array.from(n.children).find((c) => c.tagName === "LEGEND");
|
|
15
|
+
if (!(l != null && l.contains(t))) return !1;
|
|
16
|
+
}
|
|
17
|
+
const i = window.getComputedStyle(n);
|
|
18
|
+
if (i.display === "none" || i.visibility === "hidden" || i.visibility === "collapse") return !1;
|
|
19
|
+
}
|
|
20
|
+
return !0;
|
|
21
|
+
});
|
|
22
|
+
return d.filter((t) => {
|
|
23
|
+
if (!f(t)) return !0;
|
|
24
|
+
const n = d.filter(
|
|
25
|
+
(i) => f(i) && v(t, i)
|
|
26
|
+
);
|
|
27
|
+
return t === (n.find((i) => i.checked) ?? n[0]);
|
|
28
|
+
}).sort((t, n) => (t.tabIndex || 1 / 0) - (n.tabIndex || 1 / 0));
|
|
29
|
+
}, K = (r, d, t, n, i) => {
|
|
30
|
+
let l = null, c = !1;
|
|
31
|
+
g(r, (e) => {
|
|
32
|
+
e && typeof document < "u" && (l = document.activeElement);
|
|
33
|
+
}, { immediate: !0, flush: "sync" });
|
|
34
|
+
const E = () => {
|
|
35
|
+
typeof document > "u" || N(() => {
|
|
36
|
+
const e = t.value;
|
|
37
|
+
!e || !r.value || c || !i() || (x(e)[0] ?? e).focus({ preventScroll: !0 });
|
|
38
|
+
});
|
|
39
|
+
}, m = () => {
|
|
40
|
+
var o;
|
|
41
|
+
const e = l;
|
|
42
|
+
if (l = null, !(e != null && e.isConnected) || typeof document > "u") return;
|
|
43
|
+
const s = document.activeElement;
|
|
44
|
+
s != null && s.isConnected && s !== document.body && s !== document.documentElement && s !== e && !((o = d.value) != null && o.contains(s)) || e.focus({ preventScroll: !0 });
|
|
45
|
+
}, I = (e) => {
|
|
46
|
+
if (e.key !== "Tab" || !n.value || !i()) return;
|
|
47
|
+
const s = t.value;
|
|
48
|
+
if (!s) return;
|
|
49
|
+
const o = x(s), u = document.activeElement;
|
|
50
|
+
if (f(u)) {
|
|
51
|
+
const a = o.findIndex((h) => f(h) && v(u, h));
|
|
52
|
+
a >= 0 && (o[a] = u);
|
|
53
|
+
}
|
|
54
|
+
const p = o.indexOf(u);
|
|
55
|
+
if (p >= 0 && o.some((a) => a.tabIndex > 0)) {
|
|
56
|
+
e.preventDefault(), o[(p + (e.shiftKey ? -1 : 1) + o.length) % o.length].focus({ preventScroll: !0 });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const y = o[0] ?? s, b = o.at(-1) ?? s;
|
|
60
|
+
(!o.includes(u) || (e.shiftKey ? u === y : u === b)) && (e.preventDefault(), (e.shiftKey ? b : y).focus({ preventScroll: !0 }));
|
|
61
|
+
};
|
|
62
|
+
return S(() => {
|
|
63
|
+
c = !0, m();
|
|
64
|
+
}), { focus: E, restore: m, onKeydown: I };
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
x as getTabbableElements,
|
|
68
|
+
K as useDialogFocus
|
|
69
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ref as p, watch as s, onBeforeUnmount as c } from "vue";
|
|
2
|
+
const l = (u, d) => {
|
|
3
|
+
const o = p(!1);
|
|
4
|
+
let r, n;
|
|
5
|
+
const i = (e) => {
|
|
6
|
+
!o.value || n === "pointer" && e.pointerId !== r || d(e.clientX, e.clientY);
|
|
7
|
+
}, t = (e) => {
|
|
8
|
+
e && "pointerId" in e && e.pointerId !== r || (o.value = !1, n = void 0, r = void 0, !(typeof document > "u") && (document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", t), document.removeEventListener("pointermove", i), document.removeEventListener("pointerup", t), document.removeEventListener("pointercancel", t), window.removeEventListener("blur", t)));
|
|
9
|
+
}, m = (e) => {
|
|
10
|
+
u.value || o.value || e.button !== 0 || (e.preventDefault(), o.value = !0, n = e.type === "pointerdown" ? "pointer" : "mouse", r = n === "pointer" ? e.pointerId : void 0, d(e.clientX, e.clientY), document.addEventListener(n === "pointer" ? "pointermove" : "mousemove", i), document.addEventListener(n === "pointer" ? "pointerup" : "mouseup", t), n === "pointer" && document.addEventListener("pointercancel", t), window.addEventListener("blur", t));
|
|
11
|
+
};
|
|
12
|
+
return s(u, (e) => {
|
|
13
|
+
e && t();
|
|
14
|
+
}, { flush: "sync" }), c(() => t()), { dragging: o, start: m };
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
l as usePointerDrag
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { reactive as h, watch as m, onBeforeUnmount as d } from "vue";
|
|
2
|
+
const y = (n, f, u) => {
|
|
3
|
+
const e = h({ ok: !1, cancel: !1 });
|
|
4
|
+
let r = 0, l = !1;
|
|
5
|
+
const c = () => {
|
|
6
|
+
r++, e.ok = e.cancel = !1;
|
|
7
|
+
};
|
|
8
|
+
return m(n, c, { flush: "sync" }), d(() => {
|
|
9
|
+
l = !0, c();
|
|
10
|
+
}), { loading: e, requestClose: (s, a) => {
|
|
11
|
+
if (l || !n.value || e.ok || e.cancel) return;
|
|
12
|
+
const i = ++r;
|
|
13
|
+
e[s] = !0;
|
|
14
|
+
const p = () => !l && n.value && i === r, o = (t) => {
|
|
15
|
+
p() && (e[s] = !1, t && u(s, a));
|
|
16
|
+
};
|
|
17
|
+
try {
|
|
18
|
+
const t = f(s, a);
|
|
19
|
+
t && typeof t == "object" && "then" in t ? Promise.resolve(t).then(o, () => o(!1)) : o(t);
|
|
20
|
+
} catch {
|
|
21
|
+
o(!1);
|
|
22
|
+
}
|
|
23
|
+
} };
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
y as usePopupClose
|
|
27
|
+
};
|
|
@@ -1,51 +1,53 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
2
|
+
var l = (o, e, t) => e in o ? c(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var a = (o, e, t) => l(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ref as f, watch as g, onMounted as S, onBeforeUnmount as m, readonly as h } from "vue";
|
|
5
|
+
const k = 1e3, E = 3e3, _ = 1;
|
|
6
|
+
class x {
|
|
7
7
|
constructor() {
|
|
8
|
-
|
|
8
|
+
a(this, "popupStack", {
|
|
9
9
|
popup: /* @__PURE__ */ new Set(),
|
|
10
10
|
dialog: /* @__PURE__ */ new Set(),
|
|
11
11
|
message: /* @__PURE__ */ new Set()
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
a(this, "getNextZIndex", (e) => (e === "message" ? Array.from(this.popupStack.message).pop() || E : Array.from(this.popupStack.popup).pop() || k) + _);
|
|
14
|
+
a(this, "add", (e) => {
|
|
15
15
|
const t = this.getNextZIndex(e);
|
|
16
16
|
return this.popupStack[e].add(t), e === "dialog" && this.popupStack.popup.add(t), t;
|
|
17
17
|
});
|
|
18
|
-
|
|
18
|
+
a(this, "delete", (e, t) => {
|
|
19
19
|
this.popupStack[t].delete(e), t === "dialog" && this.popupStack.popup.delete(e);
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
a(this, "isLastDialog", (e) => this.popupStack.dialog.size > 1 ? e === Array.from(this.popupStack.dialog).pop() : !0);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
24
|
+
const s = new x();
|
|
25
|
+
function D(o, {
|
|
26
26
|
visible: e,
|
|
27
27
|
runOnMounted: t
|
|
28
28
|
} = {}) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
29
|
+
const p = f(0);
|
|
30
|
+
let r = !1;
|
|
31
|
+
const n = () => {
|
|
32
|
+
r || (p.value = s.add(o), r = !0);
|
|
33
|
+
}, u = () => {
|
|
34
|
+
r && (s.delete(p.value, o), r = !1);
|
|
35
|
+
}, d = () => o === "dialog" ? s.isLastDialog(p.value) : !1;
|
|
34
36
|
return g(
|
|
35
37
|
() => e == null ? void 0 : e.value,
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
+
(i) => {
|
|
39
|
+
i ? n() : u();
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
42
|
immediate: !0
|
|
41
43
|
}
|
|
42
|
-
), t &&
|
|
43
|
-
zIndex:
|
|
44
|
+
), t && S(n), m(u), {
|
|
45
|
+
zIndex: h(p),
|
|
44
46
|
open: n,
|
|
45
|
-
close:
|
|
46
|
-
isLastDialog:
|
|
47
|
+
close: u,
|
|
48
|
+
isLastDialog: d
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
51
|
export {
|
|
50
|
-
|
|
52
|
+
D as default
|
|
51
53
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { inject as m, computed as o } from "vue";
|
|
2
|
+
import { configProviderInjectionKey as r } from "../components/config-provider/context.js";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const e = m(r, void 0);
|
|
5
|
+
return {
|
|
6
|
+
popupThemeStyle: o(() => {
|
|
7
|
+
var p;
|
|
8
|
+
return (p = e == null ? void 0 : e.popupTheme) == null ? void 0 : p.value.style;
|
|
9
|
+
}),
|
|
10
|
+
popupThemeName: o(() => {
|
|
11
|
+
var p;
|
|
12
|
+
return (p = e == null ? void 0 : e.popupTheme) != null && p.value.dark ? "dark" : void 0;
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
d as usePopupTheme
|
|
18
|
+
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as u, onMounted as f, watch as i } from "vue";
|
|
2
2
|
import { getElement as s } from "../_utils/dom.js";
|
|
3
3
|
const g = ({
|
|
4
4
|
popupContainer: e,
|
|
5
|
-
visible:
|
|
5
|
+
visible: a,
|
|
6
6
|
defaultContainer: m = "body",
|
|
7
|
-
documentContainer:
|
|
7
|
+
documentContainer: d
|
|
8
8
|
}) => {
|
|
9
|
-
const t =
|
|
10
|
-
|
|
11
|
-
r
|
|
9
|
+
const t = u(e.value), n = u(), o = () => {
|
|
10
|
+
if (typeof document > "u") return;
|
|
11
|
+
const r = s(e.value), l = r ? e.value : m, c = r ?? document.documentElement;
|
|
12
|
+
l !== t.value && (t.value = l), c !== n.value && (n.value = c);
|
|
12
13
|
};
|
|
13
|
-
return
|
|
14
|
-
t.value !== e.value && n && l();
|
|
15
|
-
}), {
|
|
14
|
+
return f(() => o()), i([e, a], o, { flush: "post" }), {
|
|
16
15
|
teleportContainer: t,
|
|
17
|
-
containerRef:
|
|
16
|
+
containerRef: n
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
19
|
export {
|
|
@@ -1,65 +1,70 @@
|
|
|
1
|
-
import { PALETTE_ALIASES as
|
|
2
|
-
const
|
|
3
|
-
if (typeof
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
6
|
-
const t =
|
|
1
|
+
import { PALETTE_ALIASES as x, PALETTE_ALIASES_DARK as b } from "../_styles/palette-aliases.js";
|
|
2
|
+
const y = 2.05, p = 95.5, d = 22, A = [1, 0.8, 0.6, 0.4, 0.2], _ = [1 / 3, 2 / 3, 1], S = 90, H = 300, u = (r, c, i) => Math.min(i, Math.max(c, r)), P = (r) => {
|
|
3
|
+
if (typeof r != "string") return null;
|
|
4
|
+
const c = r.trim();
|
|
5
|
+
if (c.startsWith("#")) {
|
|
6
|
+
const t = c.slice(1);
|
|
7
7
|
if (!/^(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t)) return null;
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const m = t.length === 3 ? [...t].map((a) => a + a).join("") : t.length === 6 || t.length === 8 ? t.slice(0, 6) : null;
|
|
9
|
+
return m ? [0, 2, 4].map((a) => parseInt(m.slice(a, a + 2), 16)) : null;
|
|
10
10
|
}
|
|
11
|
-
const i =
|
|
11
|
+
const i = c.match(/^rgba?\(([^)]+)\)$/i);
|
|
12
12
|
if (!i) return null;
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
const l =
|
|
18
|
-
return l.some((t) => !Number.isFinite(t)) ? null : l.map((t) =>
|
|
19
|
-
},
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
return t !== 0 && (
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
return e < 60 ?
|
|
27
|
-
},
|
|
28
|
-
const i =
|
|
13
|
+
const n = i[1].trim(), s = n.includes(",") ? n.split(",").map((t) => t.trim()) : n.split(/\s*\/\s*/)[0].split(/\s+/), e = n.includes(",") ? s[3] : n.includes("/") ? n.split("/")[1].trim() : void 0;
|
|
14
|
+
if (n.split("/").length > 2 || s.length < 3 || s.length > (n.includes(",") ? 4 : 3)) return null;
|
|
15
|
+
const o = /^[+-]?(?:\d+\.?\d*|\.\d+)%?$/;
|
|
16
|
+
if (s.slice(0, 3).some((t) => !o.test(t)) || e !== void 0 && !o.test(e)) return null;
|
|
17
|
+
const l = s.slice(0, 3).map((t) => t.endsWith("%") ? Math.round(parseFloat(t) / 100 * 255) : Number(t));
|
|
18
|
+
return l.some((t) => !Number.isFinite(t)) ? null : l.map((t) => u(Math.round(t), 0, 255));
|
|
19
|
+
}, $ = ([r, c, i]) => {
|
|
20
|
+
const n = r / 255, s = c / 255, e = i / 255, o = Math.max(n, s, e), l = Math.min(n, s, e), t = o - l, m = (o + l) / 2;
|
|
21
|
+
let a = 0, h = 0;
|
|
22
|
+
return t !== 0 && (h = m > 0.5 ? t / (2 - o - l) : t / (o + l), o === n ? a = (s - e) / t + (s < e ? 6 : 0) : o === s ? a = (e - n) / t + 2 : a = (n - s) / t + 4, a *= 60), { h: a, s: h * 100, l: m * 100 };
|
|
23
|
+
}, I = ({ h: r, s: c, l: i }) => {
|
|
24
|
+
const n = u(c, 0, 100) / 100, s = u(i, 0, 100) / 100, e = (r % 360 + 360) % 360, o = (1 - Math.abs(2 * s - 1)) * n, l = o * (1 - Math.abs(e / 60 % 2 - 1)), t = s - o / 2;
|
|
25
|
+
let m;
|
|
26
|
+
return e < 60 ? m = [o, l, 0] : e < 120 ? m = [l, o, 0] : e < 180 ? m = [0, o, l] : e < 240 ? m = [0, l, o] : e < 300 ? m = [l, 0, o] : m = [o, 0, l], m.map((a) => u(Math.round((a + t) * 255), 0, 255));
|
|
27
|
+
}, L = (r) => `#${r.map((c) => u(Math.round(c), 0, 255).toString(16).padStart(2, "0")).join("")}`, R = (r) => r <= S || r >= H ? 1 : -1, g = (r, c = {}) => {
|
|
28
|
+
const i = P(r);
|
|
29
29
|
if (!i)
|
|
30
|
-
throw new Error(`[x-next] generatePalette: 无法解析种子色 "${
|
|
31
|
-
const { h:
|
|
32
|
-
for (let
|
|
30
|
+
throw new Error(`[x-next] generatePalette: 无法解析种子色 "${r}"`);
|
|
31
|
+
const { h: n, s, l: e } = $(i), o = R(n), { dark: l = !1 } = c, t = l ? Math.min(d, e) : Math.max(p, e), m = l ? Math.max(p, e) : Math.min(d, e), a = [];
|
|
32
|
+
for (let h = 0; h < 9; h += 1) {
|
|
33
33
|
let f;
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
h < 5 ? f = e + (t - e) * A[h] : h === 5 ? f = e : f = e + (m - e) * _[h - 6];
|
|
35
|
+
const E = 5 - h, M = o * y * E * (l ? -1 : 1);
|
|
36
|
+
a.push(L(I({ h: n + M, s, l: u(f, 0, 100) })));
|
|
37
37
|
}
|
|
38
|
-
return
|
|
39
|
-
}, G = (
|
|
40
|
-
const { name: i = "primary", target:
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
return a;
|
|
39
|
+
}, G = (r, c = {}) => {
|
|
40
|
+
const { name: i = "primary", target: n, dark: s } = c, e = g(r, { dark: s }), o = n ?? (typeof document < "u" ? document.documentElement : null);
|
|
41
|
+
if (o) {
|
|
42
|
+
o.style.setProperty(`--x-color-${i}`, e[5]), e.forEach((l, t) => {
|
|
43
|
+
o.style.setProperty(`--x-color-${i}-${t + 1}`, l);
|
|
44
44
|
});
|
|
45
|
-
const l
|
|
46
|
-
|
|
47
|
-
const t = r ? E[i] : void 0;
|
|
48
|
-
for (const [c, h] of Object.entries(l))
|
|
49
|
-
n.style.setProperty(c, (t == null ? void 0 : t[c]) ?? h);
|
|
50
|
-
}
|
|
45
|
+
for (const [l, t] of Object.entries(T(i, s)))
|
|
46
|
+
o.style.setProperty(l, t);
|
|
51
47
|
}
|
|
52
48
|
return e;
|
|
53
|
-
},
|
|
54
|
-
const
|
|
55
|
-
return
|
|
49
|
+
}, T = (r, c) => {
|
|
50
|
+
const i = x[r] ?? {}, n = c ? b[r] : void 0;
|
|
51
|
+
return Object.fromEntries(
|
|
52
|
+
Object.entries(i).map(([s, e]) => [s, (n == null ? void 0 : n[s]) ?? e])
|
|
53
|
+
);
|
|
54
|
+
}, W = (r, c = !1) => {
|
|
55
|
+
const i = g(r, { dark: c });
|
|
56
|
+
return {
|
|
57
|
+
"--x-color-primary": i[5],
|
|
58
|
+
...Object.fromEntries(i.map((n, s) => [`--x-color-primary-${s + 1}`, n])),
|
|
59
|
+
...T("primary", c)
|
|
60
|
+
};
|
|
56
61
|
};
|
|
57
62
|
export {
|
|
58
63
|
G as applyThemeColor,
|
|
59
|
-
|
|
60
|
-
W as
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
g as generatePalette,
|
|
65
|
+
W as getThemeColorStyles,
|
|
66
|
+
I as hslToRgb,
|
|
67
|
+
P as parseColor,
|
|
68
|
+
$ as rgbToHsl,
|
|
69
|
+
L as toHex
|
|
65
70
|
};
|