vft 0.0.511 → 0.0.513
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/cascader/cascader.vue2.js +202 -203
- package/es/components/cascader-panel/menu.vue2.js +49 -50
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
- package/es/components/color-picker/color-picker.vue2.js +133 -134
- package/es/components/config-provider/config-provider.vue.d.ts +0 -2
- package/es/components/config-provider/config-provider.vue2.js +4 -5
- package/es/components/config-provider/constants.d.ts +0 -1
- package/es/components/config-provider/constants.js +2 -3
- package/es/components/config-provider/hooks/use-global-config.js +30 -33
- package/es/components/config-provider/index.d.ts +0 -9
- package/es/components/config-provider/index.js +5 -6
- package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
- package/es/components/date-picker/composables/use-month-range-header.js +14 -15
- package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
- package/es/components/date-time-select/date-time-select.vue2.js +36 -39
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue2.js +67 -68
- package/es/components/dropdown/index.d.ts +33 -33
- package/es/components/empty/empty.vue2.js +38 -39
- package/es/components/full-screen/full-screen.vue2.js +17 -18
- package/es/components/image/image.vue2.js +59 -60
- package/es/components/image-viewer/image-viewer.vue2.js +44 -45
- package/es/components/index.js +97 -98
- package/es/components/md-container/md-container.vue2.js +74 -75
- package/es/components/md-container/toc.js +36 -37
- package/es/components/message-box/message-box.vue2.js +3 -3
- package/es/components/message-box/method.js +47 -48
- package/es/components/modal/modal-footer-action.vue2.js +24 -25
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/popconfirm/popconfirm.vue2.js +39 -40
- package/es/components/search/search.vue2.js +50 -51
- package/es/components/select/index.d.ts +4 -4
- package/es/components/select/select.vue.d.ts +4 -4
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/select/useSelect.js +231 -232
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
- package/es/components/transfer/transfer-panel.vue2.js +56 -57
- package/es/components/transfer/transfer.vue2.js +69 -70
- package/es/components/tree/tree.vue2.js +59 -60
- package/es/components/upload/upload-content.vue2.js +49 -50
- package/es/components/upload/upload-list.vue2.js +45 -46
- package/es/components/upload/upload.vue2.js +99 -100
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -5
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +0 -1
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +0 -9
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.d.ts +33 -33
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/message-box/message-box.vue2.cjs +1 -1
- package/lib/components/message-box/method.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/index.d.ts +4 -4
- package/lib/components/select/select.vue.d.ts +4 -4
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +2 -2
- package/theme-style/index.css +1 -1
- package/theme-style/src/message-box.scss +2 -2
- package/theme-style/src/table.scss +2 -0
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
- package/es/locale/index.d.js +0 -1
- package/es/locale/index.d.ts +0 -26
- package/es/locale/index.js +0 -10
- package/es/locale/lang/en.d.ts +0 -183
- package/es/locale/lang/en.js +0 -241
- package/es/locale/lang/zh-cn.d.ts +0 -183
- package/es/locale/lang/zh-cn.js +0 -241
- package/es/locale/lang/zh-tw.d.ts +0 -183
- package/es/locale/lang/zh-tw.js +0 -241
- package/es/locale/use-locale.d.ts +0 -17
- package/es/locale/use-locale.js +0 -56
- package/lib/locale/index.cjs +0 -1
- package/lib/locale/index.d.cjs +0 -1
- package/lib/locale/index.d.ts +0 -26
- package/lib/locale/lang/en.cjs +0 -1
- package/lib/locale/lang/en.d.ts +0 -183
- package/lib/locale/lang/zh-cn.cjs +0 -1
- package/lib/locale/lang/zh-cn.d.ts +0 -183
- package/lib/locale/lang/zh-tw.cjs +0 -1
- package/lib/locale/lang/zh-tw.d.ts +0 -183
- package/lib/locale/use-locale.cjs +0 -1
- package/lib/locale/use-locale.d.ts +0 -17
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { defineComponent as N, getCurrentInstance as
|
|
2
|
-
import { VftScrollbar as
|
|
1
|
+
import { defineComponent as N, getCurrentInstance as I, inject as Z, ref as b, computed as p, openBlock as r, createBlock as k, unref as e, normalizeClass as l, withCtx as A, createElementBlock as m, Fragment as B, renderList as z, createVNode as S, createTextVNode as x, renderSlot as q, createCommentVNode as R } from "vue";
|
|
2
|
+
import { VftScrollbar as X } from "../scrollbar/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import "@vft/utils";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../form/index.js";
|
|
8
|
-
import { useId as
|
|
9
|
-
import { useNamespace as
|
|
8
|
+
import { useId as j } from "../../hooks/use-id/index.js";
|
|
9
|
+
import { useNamespace as D } from "../../hooks/use-namespace/index.js";
|
|
10
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
const Y = N({
|
|
13
|
+
import { VftIcon as F } from "../icon/index.js";
|
|
14
|
+
import J from "./node.vue2.js";
|
|
15
|
+
import { CASCADER_PANEL_INJECTION_KEY as K } from "./types.js";
|
|
16
|
+
const O = N({
|
|
18
17
|
name: "VftCascaderMenu"
|
|
19
|
-
}),
|
|
20
|
-
...
|
|
18
|
+
}), ce = /* @__PURE__ */ N({
|
|
19
|
+
...O,
|
|
21
20
|
props: {
|
|
22
21
|
nodes: {
|
|
23
22
|
type: Array,
|
|
@@ -29,70 +28,70 @@ const Y = N({
|
|
|
29
28
|
}
|
|
30
29
|
},
|
|
31
30
|
setup(f) {
|
|
32
|
-
const v = f, w =
|
|
33
|
-
let
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
if (!(!
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
const
|
|
31
|
+
const v = f, w = I(), t = D("cascader-menu"), E = j();
|
|
32
|
+
let s, i;
|
|
33
|
+
const c = Z(K), a = b(), y = p(() => !v.nodes.length), H = p(() => !c.initialLoaded), g = p(() => `${E.value}-${v.index}`), L = (n) => {
|
|
34
|
+
s = n.target;
|
|
35
|
+
}, V = (n) => {
|
|
36
|
+
if (!(!c.isHoverMenu || !s || !a.value))
|
|
37
|
+
if (s.contains(n.target)) {
|
|
38
|
+
h();
|
|
39
|
+
const o = w.vnode.el, { left: u } = o.getBoundingClientRect(), { offsetWidth: M, offsetHeight: _ } = o, C = n.clientX - u, d = s.offsetTop, T = d + s.offsetHeight;
|
|
41
40
|
a.value.innerHTML = `
|
|
42
41
|
<path style="pointer-events: auto;" fill="transparent" d="M${C} ${d} L${M} 0 V${d} Z" />
|
|
43
|
-
<path style="pointer-events: auto;" fill="transparent" d="M${C} ${T} L${M} ${
|
|
42
|
+
<path style="pointer-events: auto;" fill="transparent" d="M${C} ${T} L${M} ${_} V${T} Z" />
|
|
44
43
|
`;
|
|
45
|
-
} else
|
|
44
|
+
} else i || (i = window.setTimeout($, c.config.hoverThreshold));
|
|
45
|
+
}, h = () => {
|
|
46
|
+
i && (clearTimeout(i), i = void 0);
|
|
46
47
|
}, $ = () => {
|
|
47
|
-
|
|
48
|
-
}, _ = () => {
|
|
49
|
-
a.value && (a.value.innerHTML = "", $());
|
|
48
|
+
a.value && (a.value.innerHTML = "", h());
|
|
50
49
|
};
|
|
51
|
-
return (
|
|
52
|
-
key:
|
|
50
|
+
return (n, o) => (r(), k(e(X), {
|
|
51
|
+
key: g.value,
|
|
53
52
|
tag: "ul",
|
|
54
53
|
role: "menu",
|
|
55
|
-
class:
|
|
54
|
+
class: l(e(t).b()),
|
|
56
55
|
"wrap-class": e(t).e("wrap"),
|
|
57
|
-
"view-class": [e(t).e("list"), e(t).is("empty",
|
|
58
|
-
onMousemove:
|
|
59
|
-
onMouseleave:
|
|
56
|
+
"view-class": [e(t).e("list"), e(t).is("empty", y.value)],
|
|
57
|
+
onMousemove: V,
|
|
58
|
+
onMouseleave: $
|
|
60
59
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
(
|
|
63
|
-
key:
|
|
64
|
-
node:
|
|
65
|
-
"menu-id":
|
|
66
|
-
onExpand:
|
|
60
|
+
default: A(() => [
|
|
61
|
+
(r(!0), m(B, null, z(f.nodes, (u) => (r(), k(J, {
|
|
62
|
+
key: u.uid,
|
|
63
|
+
node: u,
|
|
64
|
+
"menu-id": g.value,
|
|
65
|
+
onExpand: L
|
|
67
66
|
}, null, 8, ["node", "menu-id"]))), 128)),
|
|
68
|
-
H.value ? (
|
|
67
|
+
H.value ? (r(), m("div", {
|
|
69
68
|
key: 0,
|
|
70
|
-
class:
|
|
69
|
+
class: l(e(t).e("empty-text"))
|
|
71
70
|
}, [
|
|
72
|
-
|
|
71
|
+
S(e(F), {
|
|
73
72
|
icon: "icon-loadding",
|
|
74
73
|
size: "14",
|
|
75
|
-
class:
|
|
74
|
+
class: l(e(t).is("loading"))
|
|
76
75
|
}, null, 8, ["class"]),
|
|
77
|
-
x("
|
|
78
|
-
], 2)) :
|
|
76
|
+
o[0] || (o[0] = x(" 加载中 ", -1))
|
|
77
|
+
], 2)) : y.value ? (r(), m("div", {
|
|
79
78
|
key: 1,
|
|
80
|
-
class:
|
|
79
|
+
class: l(e(t).e("empty-text"))
|
|
81
80
|
}, [
|
|
82
|
-
|
|
83
|
-
x(
|
|
81
|
+
q(n.$slots, "empty", {}, () => [
|
|
82
|
+
o[1] || (o[1] = x("暂无数据", -1))
|
|
84
83
|
])
|
|
85
|
-
], 2)) : e(
|
|
84
|
+
], 2)) : e(c)?.isHoverMenu ? (r(), m("svg", {
|
|
86
85
|
key: 2,
|
|
87
86
|
ref_key: "hoverZone",
|
|
88
87
|
ref: a,
|
|
89
|
-
class:
|
|
90
|
-
}, null, 2)) :
|
|
88
|
+
class: l(e(t).e("hover-zone"))
|
|
89
|
+
}, null, 2)) : R("", !0)
|
|
91
90
|
]),
|
|
92
91
|
_: 3
|
|
93
92
|
}, 8, ["class", "wrap-class", "view-class"]));
|
|
94
93
|
}
|
|
95
94
|
});
|
|
96
95
|
export {
|
|
97
|
-
|
|
96
|
+
ce as default
|
|
98
97
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftClamp as
|
|
1
|
+
import { defineComponent as n, computed as t, openBlock as a, createBlock as u, unref as i, normalizeStyle as x, withCtx as d, createElementBlock as f, normalizeClass as p, toDisplayString as z, createCommentVNode as C } from "vue";
|
|
2
|
+
import { VftClamp as h } from "../clamp/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import "@vft/utils";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
|
-
import { generateCssVars as
|
|
6
|
+
import { generateCssVars as y } from "../../utils/ns-cover.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "../form/index.js";
|
|
9
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as k } from "../../hooks/use-namespace/index.js";
|
|
10
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
|
|
14
|
-
const B = ["onClick"], S = m({
|
|
13
|
+
const T = ["onClick"], v = n({
|
|
15
14
|
name: "vft-clamp-toggle"
|
|
16
|
-
}),
|
|
17
|
-
...
|
|
15
|
+
}), F = /* @__PURE__ */ n({
|
|
16
|
+
...v,
|
|
18
17
|
props: {
|
|
19
18
|
text: {},
|
|
20
19
|
maxHeight: {},
|
|
@@ -30,14 +29,14 @@ const B = ["onClick"], S = m({
|
|
|
30
29
|
toggleText: {}
|
|
31
30
|
},
|
|
32
31
|
setup(e) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
]),
|
|
32
|
+
const m = k("clamp-toggle"), s = t(() => [
|
|
33
|
+
"展开",
|
|
34
|
+
"收缩"
|
|
35
|
+
]), o = t(() => e.toggleText || s.value), r = t(() => y(
|
|
37
36
|
{ color: e.color, size: e.size, toggleColor: e.toggleColor, toggleSize: e.toggleSize },
|
|
38
37
|
"clamp-toggle"
|
|
39
38
|
));
|
|
40
|
-
return (
|
|
39
|
+
return (B, S) => (a(), u(i(h), {
|
|
41
40
|
style: x(r.value),
|
|
42
41
|
text: e.text,
|
|
43
42
|
"max-height": e.maxHeight,
|
|
@@ -47,17 +46,17 @@ const B = ["onClick"], S = m({
|
|
|
47
46
|
ellipsis: e.ellipsis,
|
|
48
47
|
"auto-resize": e.autoResize
|
|
49
48
|
}, {
|
|
50
|
-
after: d(({ toggle:
|
|
51
|
-
|
|
49
|
+
after: d(({ toggle: c, expanded: l, clamped: g }) => [
|
|
50
|
+
l || g ? (a(), f("span", {
|
|
52
51
|
key: 0,
|
|
53
|
-
class:
|
|
54
|
-
onClick:
|
|
55
|
-
},
|
|
52
|
+
class: p(["cursor-pointer", [i(m).e("more")]]),
|
|
53
|
+
onClick: c
|
|
54
|
+
}, z(l ? o.value[1] : o.value[0]), 11, T)) : C("", !0)
|
|
56
55
|
]),
|
|
57
56
|
_: 1
|
|
58
57
|
}, 8, ["style", "text", "max-height", "max-lines", "expanded", "location", "ellipsis", "auto-resize"]));
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
60
|
export {
|
|
62
|
-
|
|
61
|
+
F as default
|
|
63
62
|
};
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ClickOutside as
|
|
3
|
-
import { VftButton as
|
|
1
|
+
import { defineComponent as W, ref as c, reactive as ie, computed as b, onMounted as se, watch as g, nextTick as C, provide as ce, openBlock as m, createBlock as V, unref as e, withCtx as y, createElementVNode as u, withKeys as L, normalizeClass as n, createElementBlock as H, createCommentVNode as E, normalizeStyle as ue, withDirectives as M, createVNode as p, vShow as de, createTextVNode as O } from "vue";
|
|
2
|
+
import { ClickOutside as me } from "@vft/directives";
|
|
3
|
+
import { VftButton as R } from "../button/index.js";
|
|
4
4
|
import "../form/index.js";
|
|
5
|
-
import { VftIcon as
|
|
6
|
-
import { VftInput as
|
|
7
|
-
import { VftTooltip as
|
|
8
|
-
import { UPDATE_MODEL_EVENT as P, CHANGE_EVENT as
|
|
5
|
+
import { VftIcon as U } from "../icon/index.js";
|
|
6
|
+
import { VftInput as pe } from "../input/index.js";
|
|
7
|
+
import { VftTooltip as fe } from "../tooltip/index.js";
|
|
8
|
+
import { UPDATE_MODEL_EVENT as P, CHANGE_EVENT as ve } from "../../constants/event.js";
|
|
9
9
|
import "@vueuse/core";
|
|
10
10
|
import "@vft/utils";
|
|
11
|
-
import { debugWarn as
|
|
11
|
+
import { debugWarn as G } from "../../utils/error.js";
|
|
12
12
|
import "../config-provider/hooks/use-global-config.js";
|
|
13
|
-
import { debounce as
|
|
14
|
-
import { useNamespace as
|
|
13
|
+
import { debounce as be } from "lodash-es";
|
|
14
|
+
import { useNamespace as he } from "../../hooks/use-namespace/index.js";
|
|
15
15
|
import "../../hooks/use-model-toggle/index.js";
|
|
16
16
|
import "@popperjs/core";
|
|
17
17
|
import "../../hooks/use-z-index/index.js";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import { colorPickerContextKey as
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
const Pe = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex"], ze = j({
|
|
18
|
+
import ke from "./components/alpha-slider.vue2.js";
|
|
19
|
+
import we from "./components/hue-slider.vue.js";
|
|
20
|
+
import ge from "./components/predefine.vue.js";
|
|
21
|
+
import Ce from "./components/sv-panel.vue.js";
|
|
22
|
+
import { colorPickerContextKey as Ve } from "./contants.js";
|
|
23
|
+
import $ from "./utils/color.js";
|
|
24
|
+
import { useFormItem as ye, useFormItemInputId as Ee } from "../form/hooks/use-form-item.js";
|
|
25
|
+
import { useFormSize as xe, useFormDisabled as Ae } from "../form/hooks/use-form-common-props.js";
|
|
26
|
+
const Ie = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex"], Se = W({
|
|
28
27
|
name: "VftColorPicker"
|
|
29
|
-
}),
|
|
30
|
-
...
|
|
28
|
+
}), eo = /* @__PURE__ */ W({
|
|
29
|
+
...Se,
|
|
31
30
|
props: {
|
|
32
31
|
modelValue: {},
|
|
33
32
|
id: {},
|
|
@@ -43,232 +42,232 @@ const Pe = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex
|
|
|
43
42
|
},
|
|
44
43
|
emits: [
|
|
45
44
|
P,
|
|
46
|
-
|
|
45
|
+
ve,
|
|
47
46
|
"activeChange",
|
|
48
47
|
"click-outside"
|
|
49
48
|
],
|
|
50
|
-
setup(
|
|
51
|
-
const
|
|
52
|
-
formItemContext:
|
|
53
|
-
}),
|
|
54
|
-
let
|
|
55
|
-
const t =
|
|
56
|
-
new
|
|
49
|
+
setup(i, { expose: j, emit: q }) {
|
|
50
|
+
const a = i, d = q, l = he("color"), { formItem: h } = ye(), J = xe(), x = Ae(), { inputId: Q, isLabeledByFormItem: z } = Ee(a, {
|
|
51
|
+
formItemContext: h
|
|
52
|
+
}), B = c(), X = c(), F = c(), Y = c();
|
|
53
|
+
let A = !0;
|
|
54
|
+
const t = ie(
|
|
55
|
+
new $({
|
|
57
56
|
enableAlpha: a.showAlpha,
|
|
58
57
|
format: a.colorFormat || "",
|
|
59
58
|
value: a.modelValue
|
|
60
59
|
})
|
|
61
|
-
),
|
|
60
|
+
), f = c(!1), s = c(!1), v = c(""), Z = b(() => !a.modelValue && !s.value ? "transparent" : le(t, a.showAlpha)), I = b(() => !a.modelValue && !s.value ? "" : t.value), _ = b(() => z.value ? void 0 : a.label || "色彩选择器"), ee = b(() => z.value ? h?.labelId : void 0), oe = b(() => [
|
|
62
61
|
l.b("picker"),
|
|
63
|
-
l.is("disabled",
|
|
64
|
-
l.bm("picker",
|
|
62
|
+
l.is("disabled", x.value),
|
|
63
|
+
l.bm("picker", J.value)
|
|
65
64
|
]);
|
|
66
|
-
function
|
|
67
|
-
if (!(o instanceof
|
|
65
|
+
function le(o, r) {
|
|
66
|
+
if (!(o instanceof $))
|
|
68
67
|
throw new TypeError("color should be instance of _color Class");
|
|
69
|
-
const { r:
|
|
70
|
-
return
|
|
68
|
+
const { r: w, g: D, b: K } = o.toRgb();
|
|
69
|
+
return r ? `rgba(${w}, ${D}, ${K}, ${o.get("alpha") / 100})` : `rgb(${w}, ${D}, ${K})`;
|
|
71
70
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
71
|
+
function ae(o) {
|
|
72
|
+
f.value = o;
|
|
74
73
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
77
|
-
|
|
74
|
+
const k = be(ae, 100);
|
|
75
|
+
function te(o) {
|
|
76
|
+
k(!1), S(), d("click-outside", o);
|
|
78
77
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
a.modelValue ? t.fromString(a.modelValue) : (t.value = "",
|
|
82
|
-
|
|
78
|
+
function S() {
|
|
79
|
+
C(() => {
|
|
80
|
+
a.modelValue ? t.fromString(a.modelValue) : (t.value = "", C(() => {
|
|
81
|
+
s.value = !1;
|
|
83
82
|
}));
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
85
|
+
function N() {
|
|
86
|
+
x.value || k(!f.value);
|
|
88
87
|
}
|
|
89
|
-
function
|
|
90
|
-
t.fromString(
|
|
88
|
+
function T() {
|
|
89
|
+
t.fromString(v.value);
|
|
91
90
|
}
|
|
92
|
-
function
|
|
91
|
+
function re() {
|
|
93
92
|
const o = t.value;
|
|
94
|
-
|
|
95
|
-
const
|
|
93
|
+
d(P, o), d("change", o), a.validateEvent && h?.validate("change").catch((r) => G(r)), k(!1), C(() => {
|
|
94
|
+
const r = new $({
|
|
96
95
|
enableAlpha: a.showAlpha,
|
|
97
96
|
format: a.colorFormat || "",
|
|
98
97
|
value: a.modelValue
|
|
99
98
|
});
|
|
100
|
-
t.compare(
|
|
99
|
+
t.compare(r) || S();
|
|
101
100
|
});
|
|
102
101
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
102
|
+
function ne() {
|
|
103
|
+
k(!1), d(P, null), d("change", null), a.modelValue !== null && a.validateEvent && h?.validate("change").catch((o) => G(o)), S();
|
|
105
104
|
}
|
|
106
|
-
return
|
|
107
|
-
a.modelValue && (
|
|
108
|
-
}),
|
|
105
|
+
return se(() => {
|
|
106
|
+
a.modelValue && (v.value = I.value);
|
|
107
|
+
}), g(
|
|
109
108
|
() => a.modelValue,
|
|
110
109
|
(o) => {
|
|
111
|
-
o ? o && o !== t.value && (
|
|
110
|
+
o ? o && o !== t.value && (A = !1, t.fromString(o)) : s.value = !1;
|
|
112
111
|
}
|
|
113
|
-
),
|
|
114
|
-
() =>
|
|
112
|
+
), g(
|
|
113
|
+
() => I.value,
|
|
115
114
|
(o) => {
|
|
116
|
-
|
|
115
|
+
v.value = o, A && d("activeChange", o), A = !0;
|
|
117
116
|
}
|
|
118
|
-
),
|
|
117
|
+
), g(
|
|
119
118
|
() => t.value,
|
|
120
119
|
() => {
|
|
121
|
-
!a.modelValue && !
|
|
120
|
+
!a.modelValue && !s.value && (s.value = !0);
|
|
122
121
|
}
|
|
123
|
-
),
|
|
124
|
-
() =>
|
|
122
|
+
), g(
|
|
123
|
+
() => f.value,
|
|
125
124
|
() => {
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
C(() => {
|
|
126
|
+
B.value?.update(), X.value?.update(), F.value?.update();
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
|
-
),
|
|
131
|
-
currentColor:
|
|
132
|
-
}),
|
|
129
|
+
), ce(Ve, {
|
|
130
|
+
currentColor: I
|
|
131
|
+
}), j({
|
|
133
132
|
/**
|
|
134
133
|
* @description current color object
|
|
135
134
|
*/
|
|
136
135
|
color: t,
|
|
137
|
-
showPicker:
|
|
138
|
-
}), (o,
|
|
136
|
+
showPicker: f
|
|
137
|
+
}), (o, r) => (m(), V(e(fe), {
|
|
139
138
|
ref_key: "popper",
|
|
140
|
-
ref:
|
|
141
|
-
visible:
|
|
139
|
+
ref: Y,
|
|
140
|
+
visible: f.value,
|
|
142
141
|
"show-arrow": !1,
|
|
143
142
|
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
144
143
|
offset: 0,
|
|
145
144
|
"gpu-acceleration": !1,
|
|
146
|
-
"popper-class": [e(l).be("picker", "panel"), e(l).b("dropdown"),
|
|
145
|
+
"popper-class": [e(l).be("picker", "panel"), e(l).b("dropdown"), i.popperClass],
|
|
147
146
|
"stop-popper-mouse-event": !1,
|
|
148
147
|
effect: "light",
|
|
149
148
|
trigger: "click",
|
|
150
149
|
transition: `${e(l).namespace.value}-zoom-in-top`,
|
|
151
150
|
persistent: ""
|
|
152
151
|
}, {
|
|
153
|
-
content:
|
|
154
|
-
|
|
152
|
+
content: y(() => [
|
|
153
|
+
M((m(), H("div", null, [
|
|
155
154
|
u("div", {
|
|
156
|
-
class:
|
|
155
|
+
class: n(e(l).be("dropdown", "main-wrapper"))
|
|
157
156
|
}, [
|
|
158
|
-
p(
|
|
157
|
+
p(we, {
|
|
159
158
|
ref_key: "hue",
|
|
160
|
-
ref:
|
|
159
|
+
ref: B,
|
|
161
160
|
class: "hue-slider",
|
|
162
161
|
color: t,
|
|
163
162
|
vertical: ""
|
|
164
163
|
}, null, 8, ["color"]),
|
|
165
|
-
p(
|
|
164
|
+
p(Ce, {
|
|
166
165
|
ref: "svPanel",
|
|
167
166
|
color: t
|
|
168
167
|
}, null, 8, ["color"])
|
|
169
168
|
], 2),
|
|
170
|
-
|
|
169
|
+
i.showAlpha ? (m(), V(ke, {
|
|
171
170
|
key: 0,
|
|
172
171
|
ref_key: "alpha",
|
|
173
|
-
ref:
|
|
172
|
+
ref: F,
|
|
174
173
|
color: t
|
|
175
|
-
}, null, 8, ["color"])) :
|
|
176
|
-
|
|
174
|
+
}, null, 8, ["color"])) : E("", !0),
|
|
175
|
+
i.predefine ? (m(), V(ge, {
|
|
177
176
|
key: 1,
|
|
178
177
|
ref: "predefine",
|
|
179
178
|
color: t,
|
|
180
|
-
colors:
|
|
181
|
-
}, null, 8, ["color", "colors"])) :
|
|
179
|
+
colors: i.predefine
|
|
180
|
+
}, null, 8, ["color", "colors"])) : E("", !0),
|
|
182
181
|
u("div", {
|
|
183
|
-
class:
|
|
182
|
+
class: n(e(l).be("dropdown", "btns"))
|
|
184
183
|
}, [
|
|
185
184
|
u("span", {
|
|
186
|
-
class:
|
|
185
|
+
class: n(e(l).be("dropdown", "value"))
|
|
187
186
|
}, [
|
|
188
|
-
p(e(
|
|
189
|
-
modelValue:
|
|
190
|
-
"onUpdate:modelValue":
|
|
187
|
+
p(e(pe), {
|
|
188
|
+
modelValue: v.value,
|
|
189
|
+
"onUpdate:modelValue": r[0] || (r[0] = (w) => v.value = w),
|
|
191
190
|
"validate-event": !1,
|
|
192
191
|
size: "small",
|
|
193
|
-
onKeyup:
|
|
194
|
-
onBlur:
|
|
192
|
+
onKeyup: L(T, ["enter"]),
|
|
193
|
+
onBlur: T
|
|
195
194
|
}, null, 8, ["modelValue"])
|
|
196
195
|
], 2),
|
|
197
|
-
p(e(
|
|
198
|
-
class:
|
|
196
|
+
p(e(R), {
|
|
197
|
+
class: n(e(l).be("dropdown", "link-btn")),
|
|
199
198
|
text: "",
|
|
200
199
|
size: "small",
|
|
201
|
-
onClick:
|
|
200
|
+
onClick: ne
|
|
202
201
|
}, {
|
|
203
|
-
default:
|
|
204
|
-
|
|
205
|
-
]),
|
|
202
|
+
default: y(() => [...r[1] || (r[1] = [
|
|
203
|
+
O(" 清空 ", -1)
|
|
204
|
+
])]),
|
|
206
205
|
_: 1
|
|
207
206
|
}, 8, ["class"]),
|
|
208
|
-
p(e(
|
|
207
|
+
p(e(R), {
|
|
209
208
|
plain: "",
|
|
210
209
|
size: "small",
|
|
211
|
-
class:
|
|
212
|
-
onClick:
|
|
210
|
+
class: n(e(l).be("dropdown", "btn")),
|
|
211
|
+
onClick: re
|
|
213
212
|
}, {
|
|
214
|
-
default:
|
|
215
|
-
|
|
216
|
-
]),
|
|
213
|
+
default: y(() => [...r[2] || (r[2] = [
|
|
214
|
+
O(" 确认 ", -1)
|
|
215
|
+
])]),
|
|
217
216
|
_: 1
|
|
218
217
|
}, 8, ["class"])
|
|
219
218
|
], 2)
|
|
220
219
|
])), [
|
|
221
|
-
[e(
|
|
220
|
+
[e(me), te]
|
|
222
221
|
])
|
|
223
222
|
]),
|
|
224
|
-
default:
|
|
223
|
+
default: y(() => [
|
|
225
224
|
u("div", {
|
|
226
|
-
id: e(
|
|
227
|
-
class:
|
|
225
|
+
id: e(Q),
|
|
226
|
+
class: n(oe.value),
|
|
228
227
|
role: "button",
|
|
229
|
-
"aria-label":
|
|
230
|
-
"aria-labelledby":
|
|
231
|
-
"aria-description":
|
|
232
|
-
tabindex:
|
|
233
|
-
onKeydown:
|
|
228
|
+
"aria-label": _.value,
|
|
229
|
+
"aria-labelledby": ee.value,
|
|
230
|
+
"aria-description": `当前色彩为 {color}。按 Enter 确认选择 ${i.modelValue}`,
|
|
231
|
+
tabindex: i.tabindex,
|
|
232
|
+
onKeydown: L(N, ["enter"])
|
|
234
233
|
}, [
|
|
235
|
-
e(
|
|
234
|
+
e(x) ? (m(), H("div", {
|
|
236
235
|
key: 0,
|
|
237
|
-
class:
|
|
238
|
-
}, null, 2)) :
|
|
236
|
+
class: n(e(l).be("picker", "mask"))
|
|
237
|
+
}, null, 2)) : E("", !0),
|
|
239
238
|
u("div", {
|
|
240
|
-
class:
|
|
241
|
-
onClick:
|
|
239
|
+
class: n(e(l).be("picker", "trigger")),
|
|
240
|
+
onClick: N
|
|
242
241
|
}, [
|
|
243
242
|
u("span", {
|
|
244
|
-
class:
|
|
243
|
+
class: n([e(l).be("picker", "color"), e(l).is("alpha", i.showAlpha)])
|
|
245
244
|
}, [
|
|
246
245
|
u("span", {
|
|
247
|
-
class:
|
|
248
|
-
style:
|
|
249
|
-
backgroundColor:
|
|
246
|
+
class: n(e(l).be("picker", "color-inner")),
|
|
247
|
+
style: ue({
|
|
248
|
+
backgroundColor: Z.value
|
|
250
249
|
})
|
|
251
250
|
}, [
|
|
252
|
-
|
|
251
|
+
M(p(e(U), {
|
|
253
252
|
icon: "icon-arrow-down",
|
|
254
|
-
class:
|
|
253
|
+
class: n([e(l).be("picker", "icon"), e(l).is("icon-arrow-down")])
|
|
255
254
|
}, null, 8, ["class"]), [
|
|
256
|
-
[
|
|
255
|
+
[de, i.modelValue || s.value]
|
|
257
256
|
]),
|
|
258
|
-
!
|
|
257
|
+
!i.modelValue && !s.value ? (m(), V(e(U), {
|
|
259
258
|
key: 0,
|
|
260
259
|
icon: "icon-circle-close",
|
|
261
|
-
class:
|
|
262
|
-
}, null, 8, ["class"])) :
|
|
260
|
+
class: n([e(l).be("picker", "empty"), e(l).is("icon-close")])
|
|
261
|
+
}, null, 8, ["class"])) : E("", !0)
|
|
263
262
|
], 6)
|
|
264
263
|
], 2)
|
|
265
264
|
], 2)
|
|
266
|
-
], 42,
|
|
265
|
+
], 42, Ie)
|
|
267
266
|
]),
|
|
268
267
|
_: 1
|
|
269
268
|
}, 8, ["visible", "popper-class", "transition"]));
|
|
270
269
|
}
|
|
271
270
|
});
|
|
272
271
|
export {
|
|
273
|
-
|
|
272
|
+
eo as default
|
|
274
273
|
};
|