vft 0.0.511 → 0.0.514

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