vft 0.0.429 → 0.0.430

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 (218) hide show
  1. package/attributes.json +1 -1
  2. package/es/components/alert/alert.vue2.js +38 -38
  3. package/es/components/autocomplete/autocomplete.vue2.js +82 -82
  4. package/es/components/avatar/avatar.vue2.js +23 -23
  5. package/es/components/avatar-stack/avatar-stack.vue2.js +25 -25
  6. package/es/components/breadcrumb/breadcrumb-item.vue2.js +19 -19
  7. package/es/components/button/button.vue2.js +37 -37
  8. package/es/components/card/card.vue2.js +19 -19
  9. package/es/components/carousel/carousel.vue2.js +75 -75
  10. package/es/components/carousel/use-carousel.js +1 -1
  11. package/es/components/cascader-panel/index.vue2.js +2 -2
  12. package/es/components/cascader-panel/menu.vue2.js +2 -2
  13. package/es/components/cascader-panel/node.vue2.js +3 -4
  14. package/es/components/checkbox/checkbox-button.vue2.js +52 -52
  15. package/es/components/checkbox/checkbox-group.vue2.js +26 -26
  16. package/es/components/checkbox/checkbox.vue2.js +57 -57
  17. package/es/components/clamp/clamp.vue2.js +14 -14
  18. package/es/components/clamp-toggle/clamp-toggle.vue2.js +17 -17
  19. package/es/components/clamp-tooltip/clamp-tooltip.vue2.js +19 -19
  20. package/es/components/col/col.vue2.js +20 -20
  21. package/es/components/color-picker/color-picker.vue2.js +126 -128
  22. package/es/components/color-picker/components/sv-panel.vue.js +2 -2
  23. package/es/components/config-provider/hooks/use-global-config.js +3 -3
  24. package/es/components/context-menu/context-menu.vue2.js +18 -18
  25. package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +37 -39
  26. package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +8 -10
  27. package/es/components/date-picker/date-picker.d.ts +1 -1
  28. package/es/components/date-picker/index.d.ts +2 -2
  29. package/es/components/descriptions/description.vue2.js +44 -44
  30. package/es/components/descriptions/descriptions-row.vue2.js +12 -12
  31. package/es/components/dialog/dialog-content.vue2.js +31 -31
  32. package/es/components/dialog/dialog.vue2.js +46 -46
  33. package/es/components/divider/divider.vue2.js +19 -19
  34. package/es/components/drawer/drawer.vue2.js +41 -41
  35. package/es/components/dropdown/dropdown-item-impl.vue2.js +40 -40
  36. package/es/components/dropdown/dropdown-item.vue2.js +28 -28
  37. package/es/components/dropdown/dropdown.vue2.js +124 -124
  38. package/es/components/form/form-item.vue2.js +71 -71
  39. package/es/components/header-layout/header-layout.vue2.js +25 -25
  40. package/es/components/icon/icon.vue2.js +15 -15
  41. package/es/components/icon-text/icon-text.vue2.js +28 -28
  42. package/es/components/iframe-layout/iframe-layout.vue2.js +13 -13
  43. package/es/components/iframe-layout/iframe-page.vue2.js +11 -11
  44. package/es/components/image/image.vue2.js +63 -63
  45. package/es/components/image-viewer/image-viewer.vue2.js +88 -88
  46. package/es/components/infinite-scroll/index.d.ts +1 -1
  47. package/es/components/input/input.vue2.js +112 -112
  48. package/es/components/input-number/input-number.vue2.js +100 -100
  49. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  50. package/es/components/link/link.vue2.js +20 -20
  51. package/es/components/list-cell/list-cell.vue2.js +19 -19
  52. package/es/components/logo/logo.vue2.js +22 -22
  53. package/es/components/menu/menu-item-group.vue2.js +8 -8
  54. package/es/components/menu/menu-item.vue2.js +48 -48
  55. package/es/components/message/message.vue2.js +66 -66
  56. package/es/components/modal/modal-footer-action.vue2.js +25 -25
  57. package/es/components/modal/modal.vue2.js +40 -40
  58. package/es/components/multiple-tabs/multiple-tabs.vue2.js +30 -30
  59. package/es/components/page-wrapper/page-wrapper.vue2.js +12 -12
  60. package/es/components/pagination/components/jumper.vue2.js +18 -18
  61. package/es/components/pagination/components/next.vue2.js +11 -11
  62. package/es/components/pagination/components/pager.vue2.js +74 -74
  63. package/es/components/pagination/components/prev.vue2.js +9 -9
  64. package/es/components/pagination/components/sizes.vue2.js +18 -18
  65. package/es/components/pagination/components/total.vue2.js +8 -8
  66. package/es/components/popconfirm/popconfirm.vue2.js +47 -47
  67. package/es/components/popover/popover.vue2.js +28 -28
  68. package/es/components/popper/trigger.vue2.js +9 -9
  69. package/es/components/progress/progress.vue2.js +87 -87
  70. package/es/components/qrcode/qrcode.vue2.js +31 -31
  71. package/es/components/radio/radio-button.vue2.js +17 -17
  72. package/es/components/radio/radio-group.vue2.js +35 -35
  73. package/es/components/router-view-content/router-view-content.vue2.js +25 -25
  74. package/es/components/roving-focus-group/roving-focus-item.vue2.js +30 -30
  75. package/es/components/row/row.vue2.js +5 -5
  76. package/es/components/scrollbar/bar.vue2.js +16 -16
  77. package/es/components/scrollbar/scrollbar.vue2.js +48 -48
  78. package/es/components/scrollbar/thumb.vue2.js +27 -27
  79. package/es/components/search/search.vue2.js +29 -29
  80. package/es/components/select/index.d.ts +1 -1
  81. package/es/components/select/select.vue.d.ts +1 -1
  82. package/es/components/side-menu/index.d.ts +2 -8
  83. package/es/components/side-menu/side-menu.vue.d.ts +5 -59
  84. package/es/components/side-menu/types.d.ts +107 -0
  85. package/es/components/skeleton/skeleton-item.vue2.js +9 -9
  86. package/es/components/skeleton/skeleton.vue2.js +14 -14
  87. package/es/components/slider/button.vue2.js +54 -54
  88. package/es/components/slider/slider.vue2.js +106 -106
  89. package/es/components/steps/item.vue2.js +56 -56
  90. package/es/components/steps/steps.vue2.js +16 -16
  91. package/es/components/super-form/super-form-action.vue2.js +28 -28
  92. package/es/components/super-form/super-form-item.vue2.js +1 -1
  93. package/es/components/switch/switch.vue2.js +108 -108
  94. package/es/components/table/field.d.ts +4 -4
  95. package/es/components/teleport/teleport.vue2.js +6 -6
  96. package/es/components/time-picker/common/picker.vue.d.ts +1 -1
  97. package/es/components/time-picker/index.d.ts +2 -2
  98. package/es/components/time-picker/time-picker.d.ts +1 -1
  99. package/es/components/timeline/timeline-item.vue2.js +20 -20
  100. package/es/components/tooltip/content.vue2.js +57 -57
  101. package/es/components/tooltip/tooltip.vue2.js +66 -66
  102. package/es/components/tooltip/trigger.vue2.js +42 -42
  103. package/es/components/tree/tree.vue2.js +72 -72
  104. package/es/components/upload/upload-content.vue2.js +85 -85
  105. package/es/components/upload/upload-list.vue2.js +70 -70
  106. package/es/components/upload/upload.vue2.js +86 -86
  107. package/es/components/verify-code/verify-code.vue2.js +18 -18
  108. package/es/package.json.d.ts +1 -1
  109. package/es/package.json.js +1 -1
  110. package/es/utils/vue/vnode.js +1 -1
  111. package/lib/components/alert/alert.vue2.cjs +1 -1
  112. package/lib/components/autocomplete/autocomplete.vue2.cjs +1 -1
  113. package/lib/components/avatar/avatar.vue2.cjs +1 -1
  114. package/lib/components/avatar-stack/avatar-stack.vue2.cjs +1 -1
  115. package/lib/components/breadcrumb/breadcrumb-item.vue2.cjs +1 -1
  116. package/lib/components/button/button.vue2.cjs +1 -1
  117. package/lib/components/card/card.vue2.cjs +1 -1
  118. package/lib/components/carousel/carousel.vue2.cjs +1 -1
  119. package/lib/components/cascader-panel/index.vue2.cjs +1 -1
  120. package/lib/components/cascader-panel/menu.vue2.cjs +1 -1
  121. package/lib/components/cascader-panel/node.vue2.cjs +1 -1
  122. package/lib/components/checkbox/checkbox-button.vue2.cjs +1 -1
  123. package/lib/components/checkbox/checkbox-group.vue2.cjs +1 -1
  124. package/lib/components/checkbox/checkbox.vue2.cjs +1 -1
  125. package/lib/components/clamp/clamp.vue2.cjs +1 -1
  126. package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
  127. package/lib/components/clamp-tooltip/clamp-tooltip.vue2.cjs +1 -1
  128. package/lib/components/col/col.vue2.cjs +1 -1
  129. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  130. package/lib/components/color-picker/components/sv-panel.vue.cjs +1 -1
  131. package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
  132. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
  133. package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
  134. package/lib/components/date-picker/date-picker.d.ts +1 -1
  135. package/lib/components/date-picker/index.d.ts +2 -2
  136. package/lib/components/descriptions/description.vue2.cjs +1 -1
  137. package/lib/components/descriptions/descriptions-row.vue2.cjs +1 -1
  138. package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
  139. package/lib/components/dialog/dialog.vue2.cjs +1 -1
  140. package/lib/components/divider/divider.vue2.cjs +1 -1
  141. package/lib/components/drawer/drawer.vue2.cjs +1 -1
  142. package/lib/components/dropdown/dropdown-item-impl.vue2.cjs +1 -1
  143. package/lib/components/dropdown/dropdown-item.vue2.cjs +1 -1
  144. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  145. package/lib/components/form/form-item.vue2.cjs +1 -1
  146. package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
  147. package/lib/components/icon/icon.vue2.cjs +1 -1
  148. package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
  149. package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
  150. package/lib/components/iframe-layout/iframe-page.vue2.cjs +1 -1
  151. package/lib/components/image/image.vue2.cjs +1 -1
  152. package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
  153. package/lib/components/infinite-scroll/index.d.ts +1 -1
  154. package/lib/components/input/input.vue2.cjs +1 -1
  155. package/lib/components/input-number/input-number.vue2.cjs +1 -1
  156. package/lib/components/link/link.vue2.cjs +1 -1
  157. package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
  158. package/lib/components/logo/logo.vue2.cjs +1 -1
  159. package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
  160. package/lib/components/menu/menu-item.vue2.cjs +1 -1
  161. package/lib/components/message/message.vue2.cjs +1 -1
  162. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  163. package/lib/components/modal/modal.vue2.cjs +1 -1
  164. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  165. package/lib/components/page-wrapper/page-wrapper.vue2.cjs +1 -1
  166. package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
  167. package/lib/components/pagination/components/next.vue2.cjs +1 -1
  168. package/lib/components/pagination/components/pager.vue2.cjs +1 -1
  169. package/lib/components/pagination/components/prev.vue2.cjs +1 -1
  170. package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
  171. package/lib/components/pagination/components/total.vue2.cjs +1 -1
  172. package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
  173. package/lib/components/popover/popover.vue2.cjs +1 -1
  174. package/lib/components/popper/trigger.vue2.cjs +1 -1
  175. package/lib/components/progress/progress.vue2.cjs +5 -5
  176. package/lib/components/qrcode/qrcode.vue2.cjs +1 -1
  177. package/lib/components/radio/radio-button.vue2.cjs +1 -1
  178. package/lib/components/radio/radio-group.vue2.cjs +1 -1
  179. package/lib/components/router-view-content/router-view-content.vue2.cjs +1 -1
  180. package/lib/components/roving-focus-group/roving-focus-item.vue2.cjs +1 -1
  181. package/lib/components/row/row.vue2.cjs +1 -1
  182. package/lib/components/scrollbar/bar.vue2.cjs +1 -1
  183. package/lib/components/scrollbar/scrollbar.vue2.cjs +1 -1
  184. package/lib/components/scrollbar/thumb.vue2.cjs +1 -1
  185. package/lib/components/search/search.vue2.cjs +1 -1
  186. package/lib/components/select/index.d.ts +1 -1
  187. package/lib/components/select/select.vue.d.ts +1 -1
  188. package/lib/components/side-menu/index.d.ts +2 -8
  189. package/lib/components/side-menu/side-menu.vue.d.ts +5 -59
  190. package/lib/components/side-menu/types.d.ts +107 -0
  191. package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
  192. package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
  193. package/lib/components/slider/button.vue2.cjs +1 -1
  194. package/lib/components/slider/slider.vue2.cjs +1 -1
  195. package/lib/components/steps/item.vue2.cjs +1 -1
  196. package/lib/components/steps/steps.vue2.cjs +1 -1
  197. package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
  198. package/lib/components/switch/switch.vue2.cjs +1 -1
  199. package/lib/components/table/field.d.ts +4 -4
  200. package/lib/components/teleport/teleport.vue2.cjs +1 -1
  201. package/lib/components/time-picker/common/picker.vue.d.ts +1 -1
  202. package/lib/components/time-picker/index.d.ts +2 -2
  203. package/lib/components/time-picker/time-picker.d.ts +1 -1
  204. package/lib/components/timeline/timeline-item.vue2.cjs +1 -1
  205. package/lib/components/tooltip/content.vue2.cjs +1 -1
  206. package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
  207. package/lib/components/tooltip/trigger.vue2.cjs +1 -1
  208. package/lib/components/tree/tree.vue2.cjs +1 -1
  209. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  210. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  211. package/lib/components/upload/upload.vue2.cjs +1 -1
  212. package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
  213. package/lib/package.json.cjs +1 -1
  214. package/lib/package.json.d.ts +1 -1
  215. package/package.json +5 -5
  216. package/tags.json +1 -1
  217. package/theme-style/src/mixins/mixins.scss +1 -0
  218. package/web-types.json +1 -1
@@ -1,7 +1,7 @@
1
- import { defineComponent as c, inject as d, computed as n, createBlock as h, openBlock as $, resolveDynamicComponent as g, normalizeStyle as b, normalizeClass as v, withCtx as x, renderSlot as y } from "vue";
1
+ import { defineComponent as f, inject as d, computed as n, createBlock as h, openBlock as $, resolveDynamicComponent as g, normalizeStyle as b, normalizeClass as v, withCtx as x, renderSlot as y } from "vue";
2
2
  import "../row/index.js";
3
3
  import "@vueuse/core";
4
- import { isNumber as u, isObject as _ } from "@vft/utils";
4
+ import { isNumber as c, isObject as _ } from "@vft/utils";
5
5
  import "../config-provider/hooks/use-global-config.js";
6
6
  import "lodash-es";
7
7
  import "../form/index.js";
@@ -10,9 +10,9 @@ import "../../hooks/use-model-toggle/index.js";
10
10
  import "@popperjs/core";
11
11
  import "../../hooks/use-z-index/index.js";
12
12
  import { rowContextKey as j } from "../row/constants.js";
13
- const E = c({
13
+ const E = f({
14
14
  name: "vft-col"
15
- }), G = /* @__PURE__ */ c({
15
+ }), G = /* @__PURE__ */ f({
16
16
  ...E,
17
17
  props: {
18
18
  tag: { default: "div" },
@@ -26,31 +26,31 @@ const E = c({
26
26
  pull: { default: 0 },
27
27
  push: { default: 0 }
28
28
  },
29
- setup(f) {
30
- const e = C("col"), o = f, { gutter: a } = d(j, { gutter: n(() => 0) }), i = n(() => {
31
- const t = {};
32
- return a.value && (t.paddingLeft = t.paddingRight = `${a.value / 2}px`), t;
29
+ setup(r) {
30
+ const s = C("col"), o = r, { gutter: a } = d(j, { gutter: n(() => 0) }), i = n(() => {
31
+ const e = {};
32
+ return a.value && (e.paddingLeft = e.paddingRight = `${a.value / 2}px`), e;
33
33
  }), m = n(() => {
34
- const t = [];
35
- return ["span", "offset", "pull", "push"].forEach((s) => {
36
- const l = o[s];
37
- u(l) && (s === "span" ? t.push(e.b(`${o[s]}`)) : l > 0 && t.push(e.b(`${s}-${o[s]}`)));
38
- }), ["xs", "sm", "md", "lg", "xl"].forEach((s) => {
39
- u(o[s]) ? t.push(e.b(`${s}-${o[s]}`)) : _(o[s]) && Object.entries(o[s]).forEach(
40
- ([l, r]) => {
41
- t.push(
42
- l !== "span" ? e.b(`${s}-${l}-${r}`) : e.b(`${s}-${r}`)
34
+ const e = [];
35
+ return ["span", "offset", "pull", "push"].forEach((t) => {
36
+ const l = o[t];
37
+ c(l) && (t === "span" ? e.push(s.b(`${o[t]}`)) : l > 0 && e.push(s.b(`${t}-${o[t]}`)));
38
+ }), ["xs", "sm", "md", "lg", "xl"].forEach((t) => {
39
+ c(o[t]) ? e.push(s.b(`${t}-${o[t]}`)) : _(o[t]) && Object.entries(o[t]).forEach(
40
+ ([l, u]) => {
41
+ e.push(
42
+ l !== "span" ? s.b(`${t}-${l}-${u}`) : s.b(`${t}-${u}`)
43
43
  );
44
44
  }
45
45
  );
46
- }), a.value && t.push(e.is("guttered")), [e.b(), t];
46
+ }), a.value && e.push(s.is("guttered")), [s.b(), e];
47
47
  });
48
- return (t, p) => ($(), h(g(t.tag), {
48
+ return (e, p) => ($(), h(g(r.tag), {
49
49
  class: v(m.value),
50
50
  style: b(i.value)
51
51
  }, {
52
52
  default: x(() => [
53
- y(t.$slots, "default")
53
+ y(e.$slots, "default")
54
54
  ]),
55
55
  _: 3
56
56
  }, 8, ["class", "style"]));
@@ -1,14 +1,14 @@
1
- import { defineComponent as U, ref as s, reactive as ie, computed as v, onMounted as se, watch as w, nextTick as g, provide as ue, createBlock as C, openBlock as p, unref as o, withCtx as V, createElementVNode as u, withKeys as K, normalizeClass as n, createElementBlock as x, createCommentVNode as y, normalizeStyle as ce, withDirectives as L, createVNode as d, vShow as pe, createTextVNode as H } from "vue";
2
- import { ClickOutside as de } from "@vft/directives";
3
- import { VftButton as M } 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, 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";
4
4
  import "../form/index.js";
5
- import { VftIcon as O } from "../icon/index.js";
6
- import { VftInput as me } from "../input/index.js";
5
+ import { VftIcon as U } from "../icon/index.js";
6
+ import { VftInput as pe } from "../input/index.js";
7
7
  import { VftTooltip as fe } from "../tooltip/index.js";
8
- import { UPDATE_MODEL_EVENT as _, CHANGE_EVENT as ve } from "../../constants/event.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 R } from "../../utils/error.js";
11
+ import { debugWarn as G } from "../../utils/error.js";
12
12
  import "../config-provider/hooks/use-global-config.js";
13
13
  import { debounce as be } from "lodash-es";
14
14
  import { useNamespace as he } from "../../hooks/use-namespace/index.js";
@@ -20,13 +20,13 @@ import we from "./components/hue-slider.vue.js";
20
20
  import ge from "./components/predefine.vue.js";
21
21
  import Ce from "./components/sv-panel.vue.js";
22
22
  import { colorPickerContextKey as Ve } from "./contants.js";
23
- import P from "./utils/color.js";
23
+ import $ from "./utils/color.js";
24
24
  import { useFormItem as ye, useFormItemInputId as Ee } from "../form/hooks/use-form-item.js";
25
- import { useFormSize as Ae, useFormDisabled as Ie } from "../form/hooks/use-form-common-props.js";
26
- const Se = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex"], _e = U({
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({
27
27
  name: "VftColorPicker"
28
- }), eo = /* @__PURE__ */ U({
29
- ..._e,
28
+ }), eo = /* @__PURE__ */ W({
29
+ ...Se,
30
30
  props: {
31
31
  modelValue: {},
32
32
  id: {},
@@ -41,230 +41,228 @@ const Se = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex
41
41
  validateEvent: { type: Boolean, default: !0 }
42
42
  },
43
43
  emits: [
44
- _,
44
+ P,
45
45
  ve,
46
46
  "activeChange",
47
47
  "click-outside"
48
48
  ],
49
- setup(G, { expose: W, emit: j }) {
50
- const a = G, c = j, l = he("color"), { formItem: b } = ye(), q = Ae(), E = Ie(), { inputId: J, isLabeledByFormItem: $ } = Ee(a, {
51
- formItemContext: b
52
- }), z = s(), Q = s(), B = s(), X = s();
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
53
  let A = !0;
54
- const r = ie(
55
- new P({
54
+ const t = ie(
55
+ new $({
56
56
  enableAlpha: a.showAlpha,
57
57
  format: a.colorFormat || "",
58
58
  value: a.modelValue
59
59
  })
60
- ), m = s(!1), i = s(!1), f = s(""), Y = v(() => !a.modelValue && !i.value ? "transparent" : le(r, a.showAlpha)), I = v(() => !a.modelValue && !i.value ? "" : r.value), Z = v(() => $.value ? void 0 : a.label || "色彩选择器"), ee = v(() => $.value ? b?.labelId : void 0), oe = v(() => [
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
61
  l.b("picker"),
62
- l.is("disabled", E.value),
63
- l.bm("picker", q.value)
62
+ l.is("disabled", x.value),
63
+ l.bm("picker", J.value)
64
64
  ]);
65
- function le(e, t) {
66
- if (!(e instanceof P))
65
+ function le(o, r) {
66
+ if (!(o instanceof $))
67
67
  throw new TypeError("color should be instance of _color Class");
68
- const { r: k, g: T, b: D } = e.toRgb();
69
- return t ? `rgba(${k}, ${T}, ${D}, ${e.get("alpha") / 100})` : `rgb(${k}, ${T}, ${D})`;
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})`;
70
70
  }
71
- function ae(e) {
72
- m.value = e;
71
+ function ae(o) {
72
+ f.value = o;
73
73
  }
74
- const h = be(ae, 100);
75
- function re(e) {
76
- h(!1), S(), c("click-outside", e);
74
+ const k = be(ae, 100);
75
+ function te(o) {
76
+ k(!1), S(), d("click-outside", o);
77
77
  }
78
78
  function S() {
79
- g(() => {
80
- a.modelValue ? r.fromString(a.modelValue) : (r.value = "", g(() => {
81
- i.value = !1;
79
+ C(() => {
80
+ a.modelValue ? t.fromString(a.modelValue) : (t.value = "", C(() => {
81
+ s.value = !1;
82
82
  }));
83
83
  });
84
84
  }
85
- function F() {
86
- E.value || h(!m.value);
87
- }
88
85
  function N() {
89
- r.fromString(f.value);
86
+ x.value || k(!f.value);
87
+ }
88
+ function T() {
89
+ t.fromString(v.value);
90
90
  }
91
- function te() {
92
- const e = r.value;
93
- c(_, e), c("change", e), a.validateEvent && b?.validate("change").catch((t) => R(t)), h(!1), g(() => {
94
- const t = new P({
91
+ function re() {
92
+ 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 $({
95
95
  enableAlpha: a.showAlpha,
96
96
  format: a.colorFormat || "",
97
97
  value: a.modelValue
98
98
  });
99
- r.compare(t) || S();
99
+ t.compare(r) || S();
100
100
  });
101
101
  }
102
102
  function ne() {
103
- h(!1), c(_, null), c("change", null), a.modelValue !== null && a.validateEvent && b?.validate("change").catch((e) => R(e)), S();
103
+ k(!1), d(P, null), d("change", null), a.modelValue !== null && a.validateEvent && h?.validate("change").catch((o) => G(o)), S();
104
104
  }
105
105
  return se(() => {
106
- a.modelValue && (f.value = I.value);
107
- }), w(
106
+ a.modelValue && (v.value = I.value);
107
+ }), g(
108
108
  () => a.modelValue,
109
- (e) => {
110
- e ? e && e !== r.value && (A = !1, r.fromString(e)) : i.value = !1;
109
+ (o) => {
110
+ o ? o && o !== t.value && (A = !1, t.fromString(o)) : s.value = !1;
111
111
  }
112
- ), w(
112
+ ), g(
113
113
  () => I.value,
114
- (e) => {
115
- f.value = e, A && c("activeChange", e), A = !0;
114
+ (o) => {
115
+ v.value = o, A && d("activeChange", o), A = !0;
116
116
  }
117
- ), w(
118
- () => r.value,
117
+ ), g(
118
+ () => t.value,
119
119
  () => {
120
- !a.modelValue && !i.value && (i.value = !0);
120
+ !a.modelValue && !s.value && (s.value = !0);
121
121
  }
122
- ), w(
123
- () => m.value,
122
+ ), g(
123
+ () => f.value,
124
124
  () => {
125
- g(() => {
126
- z.value?.update(), Q.value?.update(), B.value?.update();
125
+ C(() => {
126
+ B.value?.update(), X.value?.update(), F.value?.update();
127
127
  });
128
128
  }
129
- ), ue(Ve, {
129
+ ), ce(Ve, {
130
130
  currentColor: I
131
- }), W({
131
+ }), j({
132
132
  /**
133
133
  * @description current color object
134
134
  */
135
- color: r,
136
- showPicker: m
137
- }), (e, t) => (p(), C(o(fe), {
135
+ color: t,
136
+ showPicker: f
137
+ }), (o, r) => (m(), V(e(fe), {
138
138
  ref_key: "popper",
139
- ref: X,
140
- visible: m.value,
139
+ ref: Y,
140
+ visible: f.value,
141
141
  "show-arrow": !1,
142
142
  "fallback-placements": ["bottom", "top", "right", "left"],
143
143
  offset: 0,
144
144
  "gpu-acceleration": !1,
145
- "popper-class": [o(l).be("picker", "panel"), o(l).b("dropdown"), e.popperClass],
145
+ "popper-class": [e(l).be("picker", "panel"), e(l).b("dropdown"), i.popperClass],
146
146
  "stop-popper-mouse-event": !1,
147
147
  effect: "light",
148
148
  trigger: "click",
149
- transition: `${o(l).namespace.value}-zoom-in-top`,
149
+ transition: `${e(l).namespace.value}-zoom-in-top`,
150
150
  persistent: ""
151
151
  }, {
152
- content: V(() => [
153
- L((p(), x("div", null, [
152
+ content: y(() => [
153
+ M((m(), H("div", null, [
154
154
  u("div", {
155
- class: n(o(l).be("dropdown", "main-wrapper"))
155
+ class: n(e(l).be("dropdown", "main-wrapper"))
156
156
  }, [
157
- d(we, {
157
+ p(we, {
158
158
  ref_key: "hue",
159
- ref: z,
159
+ ref: B,
160
160
  class: "hue-slider",
161
- color: r,
161
+ color: t,
162
162
  vertical: ""
163
163
  }, null, 8, ["color"]),
164
- d(Ce, {
164
+ p(Ce, {
165
165
  ref: "svPanel",
166
- color: r
166
+ color: t
167
167
  }, null, 8, ["color"])
168
168
  ], 2),
169
- e.showAlpha ? (p(), C(ke, {
169
+ i.showAlpha ? (m(), V(ke, {
170
170
  key: 0,
171
171
  ref_key: "alpha",
172
- ref: B,
173
- color: r
174
- }, null, 8, ["color"])) : y("", !0),
175
- e.predefine ? (p(), C(ge, {
172
+ ref: F,
173
+ color: t
174
+ }, null, 8, ["color"])) : E("", !0),
175
+ i.predefine ? (m(), V(ge, {
176
176
  key: 1,
177
177
  ref: "predefine",
178
- color: r,
179
- colors: e.predefine
180
- }, null, 8, ["color", "colors"])) : y("", !0),
178
+ color: t,
179
+ colors: i.predefine
180
+ }, null, 8, ["color", "colors"])) : E("", !0),
181
181
  u("div", {
182
- class: n(o(l).be("dropdown", "btns"))
182
+ class: n(e(l).be("dropdown", "btns"))
183
183
  }, [
184
184
  u("span", {
185
- class: n(o(l).be("dropdown", "value"))
185
+ class: n(e(l).be("dropdown", "value"))
186
186
  }, [
187
- d(o(me), {
188
- modelValue: f.value,
189
- "onUpdate:modelValue": t[0] || (t[0] = (k) => f.value = k),
187
+ p(e(pe), {
188
+ modelValue: v.value,
189
+ "onUpdate:modelValue": r[0] || (r[0] = (w) => v.value = w),
190
190
  "validate-event": !1,
191
191
  size: "small",
192
- onKeyup: K(N, ["enter"]),
193
- onBlur: N
192
+ onKeyup: L(T, ["enter"]),
193
+ onBlur: T
194
194
  }, null, 8, ["modelValue"])
195
195
  ], 2),
196
- d(o(M), {
197
- class: n(o(l).be("dropdown", "link-btn")),
196
+ p(e(R), {
197
+ class: n(e(l).be("dropdown", "link-btn")),
198
198
  text: "",
199
199
  size: "small",
200
200
  onClick: ne
201
201
  }, {
202
- default: V(() => t[1] || (t[1] = [
203
- H(" 清除 ")
204
- ])),
205
- _: 1,
206
- __: [1]
202
+ default: y(() => [...r[1] || (r[1] = [
203
+ O(" 清除 ", -1)
204
+ ])]),
205
+ _: 1
207
206
  }, 8, ["class"]),
208
- d(o(M), {
207
+ p(e(R), {
209
208
  plain: "",
210
209
  size: "small",
211
- class: n(o(l).be("dropdown", "btn")),
212
- onClick: te
210
+ class: n(e(l).be("dropdown", "btn")),
211
+ onClick: re
213
212
  }, {
214
- default: V(() => t[2] || (t[2] = [
215
- H(" 确认 ")
216
- ])),
217
- _: 1,
218
- __: [2]
213
+ default: y(() => [...r[2] || (r[2] = [
214
+ O(" 确认 ", -1)
215
+ ])]),
216
+ _: 1
219
217
  }, 8, ["class"])
220
218
  ], 2)
221
219
  ])), [
222
- [o(de), re]
220
+ [e(me), te]
223
221
  ])
224
222
  ]),
225
- default: V(() => [
223
+ default: y(() => [
226
224
  u("div", {
227
- id: o(J),
225
+ id: e(Q),
228
226
  class: n(oe.value),
229
227
  role: "button",
230
- "aria-label": Z.value,
228
+ "aria-label": _.value,
231
229
  "aria-labelledby": ee.value,
232
- "aria-description": `目前色彩為 {color}。按一下 Enter 以選擇新色彩${e.modelValue}`,
233
- tabindex: e.tabindex,
234
- onKeydown: K(F, ["enter"])
230
+ "aria-description": `目前色彩為 {color}。按一下 Enter 以選擇新色彩${i.modelValue}`,
231
+ tabindex: i.tabindex,
232
+ onKeydown: L(N, ["enter"])
235
233
  }, [
236
- o(E) ? (p(), x("div", {
234
+ e(x) ? (m(), H("div", {
237
235
  key: 0,
238
- class: n(o(l).be("picker", "mask"))
239
- }, null, 2)) : y("", !0),
236
+ class: n(e(l).be("picker", "mask"))
237
+ }, null, 2)) : E("", !0),
240
238
  u("div", {
241
- class: n(o(l).be("picker", "trigger")),
242
- onClick: F
239
+ class: n(e(l).be("picker", "trigger")),
240
+ onClick: N
243
241
  }, [
244
242
  u("span", {
245
- class: n([o(l).be("picker", "color"), o(l).is("alpha", e.showAlpha)])
243
+ class: n([e(l).be("picker", "color"), e(l).is("alpha", i.showAlpha)])
246
244
  }, [
247
245
  u("span", {
248
- class: n(o(l).be("picker", "color-inner")),
249
- style: ce({
250
- backgroundColor: Y.value
246
+ class: n(e(l).be("picker", "color-inner")),
247
+ style: ue({
248
+ backgroundColor: Z.value
251
249
  })
252
250
  }, [
253
- L(d(o(O), {
251
+ M(p(e(U), {
254
252
  icon: "icon-arrow-down",
255
- class: n([o(l).be("picker", "icon"), o(l).is("icon-arrow-down")])
253
+ class: n([e(l).be("picker", "icon"), e(l).is("icon-arrow-down")])
256
254
  }, null, 8, ["class"]), [
257
- [pe, e.modelValue || i.value]
255
+ [de, i.modelValue || s.value]
258
256
  ]),
259
- !e.modelValue && !i.value ? (p(), C(o(O), {
257
+ !i.modelValue && !s.value ? (m(), V(e(U), {
260
258
  key: 0,
261
259
  icon: "icon-circle-close",
262
- class: n([o(l).be("picker", "empty"), o(l).is("icon-close")])
263
- }, null, 8, ["class"])) : y("", !0)
260
+ class: n([e(l).be("picker", "empty"), e(l).is("icon-close")])
261
+ }, null, 8, ["class"])) : E("", !0)
264
262
  ], 6)
265
263
  ], 2)
266
264
  ], 2)
267
- ], 42, Se)
265
+ ], 42, Ie)
268
266
  ]),
269
267
  _: 1
270
268
  }, 8, ["visible", "popper-class", "transition"]));
@@ -20,9 +20,9 @@ function p(e, l, u, d, c, m) {
20
20
  top: e.cursorTop + "px",
21
21
  left: e.cursorLeft + "px"
22
22
  })
23
- }, l[0] || (l[0] = [
23
+ }, [...l[0] || (l[0] = [
24
24
  r("div", null, null, -1)
25
- ]), 6)
25
+ ])], 6)
26
26
  ], 6);
27
27
  }
28
28
  const b = /* @__PURE__ */ i(n, [["render", p]]);
@@ -1,7 +1,7 @@
1
1
  import { keysOf as f } from "@vft/utils";
2
2
  import "@vueuse/core";
3
3
  import { debugWarn as v } from "../../../utils/error.js";
4
- import { getCurrentInstance as l, computed as i, unref as p, provide as g, ref as C, inject as x } from "vue";
4
+ import { ref as g, getCurrentInstance as l, computed as i, unref as p, provide as C, inject as x } from "vue";
5
5
  import "lodash-es";
6
6
  import "../../form/index.js";
7
7
  import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
@@ -9,7 +9,7 @@ import "../../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
11
11
  import { configProviderContextKey as m } from "../constants.js";
12
- const a = C();
12
+ const a = g();
13
13
  function d(o, e = void 0) {
14
14
  const n = l() ? x(m, a) : a;
15
15
  return o ? i(() => n?.value?.[o] ?? e) : n;
@@ -27,7 +27,7 @@ function B(o) {
27
27
  };
28
28
  }
29
29
  const S = (o, e, n = !1) => {
30
- const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? g : void 0);
30
+ const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? C : void 0);
31
31
  if (!u) {
32
32
  v(
33
33
  "provideGlobalConfig",
@@ -1,4 +1,4 @@
1
- import { defineComponent as p, ref as d, computed as k, createBlock as c, openBlock as r, Transition as C, withCtx as b, withDirectives as g, createElementVNode as m, normalizeClass as z, withModifiers as M, normalizeStyle as $, unref as u, createElementBlock as B, Fragment as E, renderList as S, vShow as F } from "vue";
1
+ import { defineComponent as p, ref as c, computed as k, createBlock as d, openBlock as r, Transition as C, withCtx as b, withDirectives as g, createElementVNode as m, normalizeClass as z, withModifiers as M, normalizeStyle as $, unref as u, createElementBlock as B, Fragment as E, renderList as S, vShow as F } from "vue";
2
2
  import { useTimeoutFn as H, useClickAway as I, useEventListener as f } from "@vft/use";
3
3
  import { VftMenuItem as L } from "../menu/index.js";
4
4
  import "@vueuse/core";
@@ -12,7 +12,7 @@ import "@popperjs/core";
12
12
  import "../../hooks/use-z-index/index.js";
13
13
  const R = { class: "vft-sub-menu" }, T = p({
14
14
  name: "vft-context-menu"
15
- }), Q = /* @__PURE__ */ p({
15
+ }), U = /* @__PURE__ */ p({
16
16
  ...T,
17
17
  props: {
18
18
  axis: {},
@@ -20,27 +20,27 @@ const R = { class: "vft-sub-menu" }, T = p({
20
20
  width: {},
21
21
  items: {}
22
22
  },
23
- setup(o) {
23
+ setup(n) {
24
24
  const v = N("context-menu");
25
- let a = d();
25
+ let a = c();
26
26
  const x = k(() => {
27
- const { x: t, y: i } = o.axis || { x: 0, y: 0 }, e = (o.items || []).length * 40, l = o.width || 0, s = document.body, w = s.clientWidth < t + l ? t - l : t, y = s.clientHeight < i + e ? i - e : i;
27
+ const { x: t, y: o } = n.axis || { x: 0, y: 0 }, e = (n.items || []).length * 40, l = n.width || 0, s = document.body, w = s.clientWidth < t + l ? t - l : t, y = s.clientHeight < o + e ? o - e : o;
28
28
  return {
29
29
  zIndex: 3e3,
30
- ...o.styles,
30
+ ...n.styles,
31
31
  position: "fixed",
32
- width: `${o.width}px`,
32
+ width: `${n.width}px`,
33
33
  left: `${w + 1}px`,
34
34
  top: `${y + 1}px`
35
35
  };
36
36
  });
37
- let n = d(!1);
37
+ let i = c(!1);
38
38
  H(() => {
39
- n.value = !0;
39
+ i.value = !0;
40
40
  }, 0), I(
41
41
  a,
42
42
  () => {
43
- n.value = !1;
43
+ i.value = !1;
44
44
  },
45
45
  {
46
46
  listenerOptions: {
@@ -51,7 +51,7 @@ const R = { class: "vft-sub-menu" }, T = p({
51
51
  window,
52
52
  "scroll",
53
53
  () => {
54
- n.value = !1;
54
+ i.value = !1;
55
55
  },
56
56
  {
57
57
  capture: !0
@@ -60,27 +60,27 @@ const R = { class: "vft-sub-menu" }, T = p({
60
60
  window,
61
61
  "drag",
62
62
  () => {
63
- n.value = !1;
63
+ i.value = !1;
64
64
  },
65
65
  {
66
66
  capture: !0
67
67
  }
68
68
  );
69
69
  function h(t) {
70
- t?.disabled || (t.handler?.(), n.value = !1);
70
+ t?.disabled || (t.handler?.(), i.value = !1);
71
71
  }
72
- return (t, i) => (r(), c(C, { name: "vft-zoom-in-top" }, {
72
+ return (t, o) => (r(), d(C, { name: "vft-zoom-in-top" }, {
73
73
  default: b(() => [
74
74
  g(m("div", {
75
75
  ref_key: "contextMenuRef",
76
76
  ref: a,
77
77
  style: $(x.value),
78
- onClick: i[0] || (i[0] = M(() => {
78
+ onClick: o[0] || (o[0] = M(() => {
79
79
  }, ["stop"])),
80
80
  class: z([u(v).b(), "vft-menu"])
81
81
  }, [
82
82
  m("div", R, [
83
- (r(!0), B(E, null, S(t.items, (e, l) => (r(), c(u(L), {
83
+ (r(!0), B(E, null, S(n.items, (e, l) => (r(), d(u(L), {
84
84
  onClick: (s) => h(e),
85
85
  index: l + e.text,
86
86
  title: e.text,
@@ -92,7 +92,7 @@ const R = { class: "vft-sub-menu" }, T = p({
92
92
  }, null, 8, ["onClick", "index", "title", "divider", "disabled", "icon"]))), 128))
93
93
  ])
94
94
  ], 6), [
95
- [F, u(n)]
95
+ [F, u(i)]
96
96
  ])
97
97
  ]),
98
98
  _: 1
@@ -100,5 +100,5 @@ const R = { class: "vft-sub-menu" }, T = p({
100
100
  }
101
101
  });
102
102
  export {
103
- Q as default
103
+ U as default
104
104
  };