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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getClassNameMixin as
|
|
3
|
-
import {
|
|
4
|
-
import { localeInjectionKey as
|
|
5
|
-
import { configProviderInjectionKey as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as z, inject as y, computed as i, provide as g, shallowRef as P, normalizeStyle as v, onBeforeUpdate as b, createVNode as C, Fragment as h, mergeProps as x } from "vue";
|
|
2
|
+
import { getClassNameMixin as N } from "../../_utils/config.js";
|
|
3
|
+
import { getThemeColorStyles as O } from "../../_utils/palette.js";
|
|
4
|
+
import { localeInjectionKey as k } from "../../locale/index.js";
|
|
5
|
+
import { configProviderInjectionKey as S } from "./context.js";
|
|
6
|
+
const K = /* @__PURE__ */ z({
|
|
7
7
|
name: "ConfigProvider",
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
props: {
|
|
@@ -48,50 +48,67 @@ const R = /* @__PURE__ */ y({
|
|
|
48
48
|
default: "div"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
setup(
|
|
52
|
-
slots:
|
|
53
|
-
attrs:
|
|
51
|
+
setup(l, {
|
|
52
|
+
slots: n,
|
|
53
|
+
attrs: d
|
|
54
54
|
}) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
55
|
+
const j = N("config-provider"), t = y(S, void 0), f = y(k, void 0), s = i(() => l.locale ?? (f == null ? void 0 : f.value));
|
|
56
|
+
g(k, s);
|
|
57
|
+
const m = P(v(d.style));
|
|
58
|
+
b(() => {
|
|
59
|
+
m.value = v(d.style);
|
|
60
|
+
});
|
|
61
|
+
const c = i(() => {
|
|
62
|
+
var r;
|
|
63
|
+
const e = (r = t == null ? void 0 : t.popupTheme) == null ? void 0 : r.value;
|
|
64
|
+
if (l.tag === null) return e ?? {
|
|
65
|
+
dark: !1,
|
|
66
|
+
style: {}
|
|
67
|
+
};
|
|
68
|
+
const o = l.dark || (e == null ? void 0 : e.dark) || !1, a = l.themeColor ?? (e == null ? void 0 : e.seed), u = Object.fromEntries(Object.entries(m.value ?? {}).filter(([p]) => p.startsWith("--")));
|
|
69
|
+
return {
|
|
70
|
+
dark: o,
|
|
71
|
+
seed: a,
|
|
72
|
+
style: {
|
|
73
|
+
...e == null ? void 0 : e.style,
|
|
74
|
+
// An unchanged nested boundary inherits explicit parent overrides too.
|
|
75
|
+
...a && (l.themeColor !== void 0 || o !== (e == null ? void 0 : e.dark)) ? O(a, o) : {},
|
|
76
|
+
...u
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
return g(S, {
|
|
81
|
+
size: i(() => {
|
|
82
|
+
var e;
|
|
83
|
+
return l.size ?? ((e = t == null ? void 0 : t.size) == null ? void 0 : e.value);
|
|
84
|
+
}),
|
|
85
|
+
locale: s,
|
|
86
|
+
slots: new Proxy(n, {
|
|
87
|
+
get(e, o, a) {
|
|
88
|
+
return Reflect.get(e, o, a) ?? (t == null ? void 0 : t.slots[o]);
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
popupTheme: c
|
|
92
|
+
}), () => {
|
|
93
|
+
var u;
|
|
76
94
|
const {
|
|
77
|
-
class:
|
|
78
|
-
style: o,
|
|
79
|
-
...n
|
|
80
|
-
} = u;
|
|
81
|
-
return e.tag === null ? m(P, null, [(i = t.default) == null ? void 0 : i.call(t)]) : m(e.tag, k(n, {
|
|
82
|
-
ref: a,
|
|
83
|
-
class: [g.block, r],
|
|
95
|
+
class: e,
|
|
84
96
|
style: o,
|
|
85
|
-
|
|
97
|
+
...a
|
|
98
|
+
} = d;
|
|
99
|
+
return l.tag === null ? C(h, null, [(u = n.default) == null ? void 0 : u.call(n)]) : C(l.tag, x(a, {
|
|
100
|
+
class: [j.block, e],
|
|
101
|
+
style: [o, c.value.style],
|
|
102
|
+
"data-theme": c.value.dark ? "dark" : void 0
|
|
86
103
|
}), {
|
|
87
104
|
default: () => {
|
|
88
|
-
var
|
|
89
|
-
return [(
|
|
105
|
+
var r;
|
|
106
|
+
return [(r = n.default) == null ? void 0 : r.call(n)];
|
|
90
107
|
}
|
|
91
108
|
});
|
|
92
109
|
};
|
|
93
110
|
}
|
|
94
111
|
});
|
|
95
112
|
export {
|
|
96
|
-
|
|
113
|
+
K as default
|
|
97
114
|
};
|
|
@@ -1,224 +1,171 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLocale as
|
|
3
|
-
import { getComponentPrefix as
|
|
4
|
-
import { addUnit as
|
|
5
|
-
import { isFunction as
|
|
6
|
-
import
|
|
7
|
-
import { useOverflow as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
18
|
-
return !1;
|
|
19
|
-
for (let s = o; s; s = s.parentElement) {
|
|
20
|
-
if (s.matches("fieldset[disabled]") && o.matches("button, input, select, textarea")) {
|
|
21
|
-
const i = Array.from(s.children).find((g) => g.tagName === "LEGEND");
|
|
22
|
-
if (!(i != null && i.contains(o))) return !1;
|
|
23
|
-
}
|
|
24
|
-
const a = window.getComputedStyle(s);
|
|
25
|
-
if (a.display === "none" || a.visibility === "hidden" || a.visibility === "collapse")
|
|
26
|
-
return !1;
|
|
27
|
-
}
|
|
28
|
-
return !0;
|
|
29
|
-
}), Ie = /* @__PURE__ */ ie({
|
|
30
|
-
name: ve("Dialog"),
|
|
1
|
+
import { defineComponent as oe, computed as s, ref as C, onBeforeUnmount as le, watch as P, createVNode as l, Teleport as ne, withDirectives as ae, mergeProps as ie, Transition as L, vShow as se } from "vue";
|
|
2
|
+
import { useLocale as de } from "../../locale/index.js";
|
|
3
|
+
import { getComponentPrefix as re, getClassNameMixin as S } from "../../_utils/config.js";
|
|
4
|
+
import { addUnit as _ } from "../../_utils/helpers.js";
|
|
5
|
+
import { isFunction as ce } from "../../_utils/is.js";
|
|
6
|
+
import ue from "../../_hooks/use-popup-manager.js";
|
|
7
|
+
import { useOverflow as me } from "../../_hooks/use-overflow.js";
|
|
8
|
+
import { usePopupClose as fe } from "../../_hooks/use-popup-close.js";
|
|
9
|
+
import { useDialogFocus as be } from "../../_hooks/use-dialog-focus.js";
|
|
10
|
+
import { usePopupTheme as ge } from "../../_hooks/use-popup-theme.js";
|
|
11
|
+
import { KEYBOARD_KEY as ve } from "../../_utils/keyboard.js";
|
|
12
|
+
import { getElement as ye, on as he, off as Ce } from "../../_utils/dom.js";
|
|
13
|
+
import { dialogProps as we } from "./props.js";
|
|
14
|
+
const xe = ["width", "minWidth", "height", "minHeight"];
|
|
15
|
+
let ke = 0;
|
|
16
|
+
const Ie = /* @__PURE__ */ oe({
|
|
17
|
+
name: re("Dialog"),
|
|
31
18
|
inheritAttrs: !1,
|
|
32
|
-
props:
|
|
19
|
+
props: we,
|
|
33
20
|
slots: Object,
|
|
34
21
|
emits: ["closed", "close", "open", "opened", "update:modelValue"],
|
|
35
|
-
setup(
|
|
36
|
-
attrs:
|
|
37
|
-
emit:
|
|
22
|
+
setup(e, {
|
|
23
|
+
attrs: d,
|
|
24
|
+
emit: r,
|
|
38
25
|
slots: a
|
|
39
26
|
}) {
|
|
40
|
-
const i =
|
|
41
|
-
t:
|
|
42
|
-
} =
|
|
27
|
+
const i = S("dialog"), {
|
|
28
|
+
t: V
|
|
29
|
+
} = de(), A = i.block, {
|
|
30
|
+
popupThemeStyle: N,
|
|
31
|
+
popupThemeName: R
|
|
32
|
+
} = ge(), c = S("message-box"), m = `x-dialog-title-${++ke}`, j = () => [A, e.messageBox && "is-message-box", e.messageBox && c.block, e.popupClass && e.popupClass, d.class], F = () => {
|
|
43
33
|
const {
|
|
44
|
-
class:
|
|
45
|
-
style:
|
|
46
|
-
id:
|
|
47
|
-
"aria-label":
|
|
48
|
-
"aria-labelledby":
|
|
49
|
-
"aria-describedby":
|
|
50
|
-
...
|
|
51
|
-
} =
|
|
52
|
-
return
|
|
53
|
-
}
|
|
34
|
+
class: t,
|
|
35
|
+
style: o,
|
|
36
|
+
id: O,
|
|
37
|
+
"aria-label": Te,
|
|
38
|
+
"aria-labelledby": Be,
|
|
39
|
+
"aria-describedby": De,
|
|
40
|
+
...te
|
|
41
|
+
} = d;
|
|
42
|
+
return te;
|
|
43
|
+
}, f = s(() => {
|
|
54
44
|
if (!(typeof document > "u"))
|
|
55
|
-
return
|
|
56
|
-
}),
|
|
57
|
-
zIndex:
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
})),
|
|
63
|
-
}),
|
|
64
|
-
zIndex:
|
|
65
|
-
isLastDialog:
|
|
66
|
-
close:
|
|
67
|
-
} =
|
|
68
|
-
visible:
|
|
45
|
+
return ye(e.renderTo) || document.body;
|
|
46
|
+
}), b = C(), w = C(), I = s(() => e.disabled || !f.value), M = s(() => [N.value, {
|
|
47
|
+
zIndex: U.value
|
|
48
|
+
}, d.style]), z = s(() => {
|
|
49
|
+
const t = {};
|
|
50
|
+
return e.fullscreen || (!e.center && e.top && (t.top = _(e.top)), xe.forEach((o) => {
|
|
51
|
+
e[o] && (t[o] = _(e[o]));
|
|
52
|
+
})), t;
|
|
53
|
+
}), g = C(!1), n = s(() => e.modelValue), x = s(() => n.value || g.value), G = s(() => !e.destroyOnClosed || x.value), H = s(() => x.value), {
|
|
54
|
+
zIndex: U,
|
|
55
|
+
isLastDialog: k,
|
|
56
|
+
close: Y
|
|
57
|
+
} = ue("dialog", {
|
|
58
|
+
visible: n
|
|
69
59
|
}), {
|
|
70
|
-
setOverflowHidden:
|
|
71
|
-
resetOverflow:
|
|
72
|
-
} =
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
let
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
preventScroll: !0
|
|
83
|
-
});
|
|
60
|
+
setOverflowHidden: q,
|
|
61
|
+
resetOverflow: T
|
|
62
|
+
} = me(f, b), W = (t, o) => {
|
|
63
|
+
r("update:modelValue", !1), r("close", t, o);
|
|
64
|
+
};
|
|
65
|
+
let v = !1;
|
|
66
|
+
const {
|
|
67
|
+
focus: $,
|
|
68
|
+
restore: B,
|
|
69
|
+
onKeydown: J
|
|
70
|
+
} = be(n, b, w, s(() => e.mask), k), Q = () => {
|
|
71
|
+
v || n.value || (g.value = !1, T(), B(), r("closed"));
|
|
84
72
|
}, X = () => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}), b = (e, n) => {
|
|
100
|
-
let l = !0;
|
|
101
|
-
if (m[e] = !0, ye(t.onBeforeCancel))
|
|
102
|
-
try {
|
|
103
|
-
l = t.onBeforeCancel(e) ?? !1;
|
|
104
|
-
} catch {
|
|
105
|
-
l = !1;
|
|
106
|
-
}
|
|
107
|
-
if (he(l)) {
|
|
108
|
-
l.then((d) => {
|
|
109
|
-
d && O(e, n);
|
|
110
|
-
}).catch(() => !1).finally(() => {
|
|
111
|
-
m[e] = !1;
|
|
112
|
-
});
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
m[e] = !1, l && O(e, n);
|
|
116
|
-
}, te = () => {
|
|
117
|
-
t.maskToClose && t.mask && b("cancel");
|
|
118
|
-
}, ne = (e) => {
|
|
119
|
-
b("cancel", e);
|
|
120
|
-
}, le = (e) => {
|
|
121
|
-
b("ok", e);
|
|
73
|
+
v || !n.value || (r("opened"), $());
|
|
74
|
+
}, {
|
|
75
|
+
loading: D,
|
|
76
|
+
requestClose: u
|
|
77
|
+
} = fe(n, (t) => {
|
|
78
|
+
if (!ce(e.onBeforeCancel)) return !0;
|
|
79
|
+
const o = e.onBeforeCancel(t);
|
|
80
|
+
return o && typeof o == "object" && "then" in o ? Promise.resolve(o).then((O) => !!O) : !!o;
|
|
81
|
+
}, W), Z = () => {
|
|
82
|
+
e.maskToClose && e.mask && u("cancel");
|
|
83
|
+
}, p = (t) => {
|
|
84
|
+
u("cancel", t);
|
|
85
|
+
}, ee = (t) => {
|
|
86
|
+
u("ok", t);
|
|
122
87
|
};
|
|
123
|
-
let
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
}, N = () => {
|
|
127
|
-
typeof document > "u" || t.escToClose && !T && (T = !0, we(document.documentElement, "keydown", _));
|
|
88
|
+
let y = !1;
|
|
89
|
+
const E = (t) => {
|
|
90
|
+
e.escToClose && t.key === ve.ESC && k() && u("cancel", t);
|
|
128
91
|
}, K = () => {
|
|
129
|
-
typeof document > "u" || (
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
const n = E.value;
|
|
133
|
-
if (!n) return;
|
|
134
|
-
const l = G(n);
|
|
135
|
-
if (!l.length) {
|
|
136
|
-
e.preventDefault(), n.focus({
|
|
137
|
-
preventScroll: !0
|
|
138
|
-
});
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const d = l[0], v = l[l.length - 1], y = document.activeElement;
|
|
142
|
-
l.includes(y) ? e.shiftKey && y === d ? (e.preventDefault(), v.focus({
|
|
143
|
-
preventScroll: !0
|
|
144
|
-
})) : !e.shiftKey && y === v && (e.preventDefault(), d.focus({
|
|
145
|
-
preventScroll: !0
|
|
146
|
-
})) : (e.preventDefault(), (e.shiftKey ? v : d).focus({
|
|
147
|
-
preventScroll: !0
|
|
148
|
-
}));
|
|
92
|
+
typeof document > "u" || e.escToClose && !y && (y = !0, he(document.documentElement, "keydown", E));
|
|
93
|
+
}, h = () => {
|
|
94
|
+
typeof document > "u" || (y = !1, Ce(document.documentElement, "keydown", E));
|
|
149
95
|
};
|
|
150
|
-
return
|
|
151
|
-
|
|
152
|
-
}),
|
|
153
|
-
|
|
96
|
+
return le(() => {
|
|
97
|
+
v = !0, B(), Y(), T(), h();
|
|
98
|
+
}), P(() => n.value, (t) => {
|
|
99
|
+
t ? (r("open"), q(), g.value = !0, K()) : h();
|
|
154
100
|
}, {
|
|
155
101
|
immediate: !0
|
|
156
|
-
}),
|
|
157
|
-
|
|
158
|
-
}), () =>
|
|
159
|
-
to:
|
|
160
|
-
disabled:
|
|
102
|
+
}), P(() => e.escToClose, (t) => {
|
|
103
|
+
n.value && (t ? K() : h());
|
|
104
|
+
}), () => l(ne, {
|
|
105
|
+
to: f.value,
|
|
106
|
+
disabled: I.value
|
|
161
107
|
}, {
|
|
162
|
-
default: () => [
|
|
163
|
-
ref:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
108
|
+
default: () => [G.value && ae(l("div", ie({
|
|
109
|
+
ref: b,
|
|
110
|
+
"data-theme": R.value,
|
|
111
|
+
class: j(),
|
|
112
|
+
style: M.value,
|
|
113
|
+
id: d.id
|
|
114
|
+
}, F()), [l(L, {
|
|
168
115
|
name: "x-fade-in-standard",
|
|
169
116
|
appear: !0
|
|
170
117
|
}, {
|
|
171
|
-
default: () => [
|
|
118
|
+
default: () => [e.mask && n.value && l("div", {
|
|
172
119
|
class: i.element("mask")
|
|
173
120
|
}, null)]
|
|
174
|
-
}),
|
|
121
|
+
}), l("div", {
|
|
175
122
|
class: [i.element("wrapper"), {
|
|
176
|
-
"is-center":
|
|
123
|
+
"is-center": e.center
|
|
177
124
|
}],
|
|
178
|
-
onClick: (
|
|
179
|
-
}, [
|
|
125
|
+
onClick: (t) => t.target === t.currentTarget && Z()
|
|
126
|
+
}, [l(L, {
|
|
180
127
|
name: "x-zoom-in",
|
|
181
128
|
appear: !0,
|
|
182
|
-
onAfterEnter:
|
|
183
|
-
onAfterLeave:
|
|
129
|
+
onAfterEnter: X,
|
|
130
|
+
onAfterLeave: Q
|
|
184
131
|
}, {
|
|
185
|
-
default: () => [
|
|
186
|
-
ref:
|
|
132
|
+
default: () => [n.value && l("div", {
|
|
133
|
+
ref: w,
|
|
187
134
|
class: [i.element("container"), {
|
|
188
|
-
"is-fullscreen":
|
|
135
|
+
"is-fullscreen": e.fullscreen
|
|
189
136
|
}],
|
|
190
|
-
style:
|
|
137
|
+
style: z.value,
|
|
191
138
|
role: "dialog",
|
|
192
|
-
"aria-modal":
|
|
193
|
-
"aria-label":
|
|
194
|
-
"aria-labelledby":
|
|
195
|
-
"aria-describedby":
|
|
139
|
+
"aria-modal": e.mask ? "true" : void 0,
|
|
140
|
+
"aria-label": e.title || a.title ? void 0 : d["aria-label"],
|
|
141
|
+
"aria-labelledby": e.title || a.title ? m : d["aria-labelledby"],
|
|
142
|
+
"aria-describedby": d["aria-describedby"],
|
|
196
143
|
tabindex: -1,
|
|
197
|
-
onKeydown:
|
|
198
|
-
}, [
|
|
199
|
-
class: [
|
|
200
|
-
id: a.title ?
|
|
201
|
-
}, [a.title ? a.title() :
|
|
202
|
-
id:
|
|
144
|
+
onKeydown: J
|
|
145
|
+
}, [l("div", {
|
|
146
|
+
class: [e.messageBox ? c.element("header") : i.element("header"), e.showHeaderBottomLine && "is-bottom-line"],
|
|
147
|
+
id: a.title ? m : void 0
|
|
148
|
+
}, [a.title ? a.title() : l("div", {
|
|
149
|
+
id: e.title ? m : void 0,
|
|
203
150
|
class: [i.element("header-title")]
|
|
204
|
-
}, [
|
|
205
|
-
class: [
|
|
206
|
-
}, [a.default && a.default()]), !
|
|
207
|
-
class: [
|
|
151
|
+
}, [e.title])]), l("div", {
|
|
152
|
+
class: [e.messageBox ? c.element("body") : i.element("body")]
|
|
153
|
+
}, [a.default && a.default()]), !e.hideFooter && a.footer && l("div", {
|
|
154
|
+
class: [e.messageBox ? c.element("footer") : i.element("footer")]
|
|
208
155
|
}, [a.footer({
|
|
209
|
-
cancel:
|
|
210
|
-
ok:
|
|
211
|
-
loadingObj:
|
|
212
|
-
"loading-obj":
|
|
213
|
-
})]),
|
|
156
|
+
cancel: p,
|
|
157
|
+
ok: ee,
|
|
158
|
+
loadingObj: D,
|
|
159
|
+
"loading-obj": D
|
|
160
|
+
})]), e.showClose && l("button", {
|
|
214
161
|
type: "button",
|
|
215
|
-
class: [i.element("close-icon"),
|
|
216
|
-
"aria-label":
|
|
162
|
+
class: [i.element("close-icon"), e.messageBox && c.element("close-icon")],
|
|
163
|
+
"aria-label": V("common.closeTarget", {
|
|
217
164
|
target: "对话框"
|
|
218
165
|
}),
|
|
219
|
-
onClick: (
|
|
166
|
+
onClick: (t) => u("cancel", t)
|
|
220
167
|
}, null)])]
|
|
221
|
-
})])]), [[
|
|
168
|
+
})])]), [[se, H.value]])]
|
|
222
169
|
});
|
|
223
170
|
}
|
|
224
171
|
});
|