vft 0.0.506 → 0.0.509

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