vft 0.0.487 → 0.0.494

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 (97) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
  4. package/es/components/autocomplete/index.d.ts +6 -6
  5. package/es/components/button/index.d.ts +9 -9
  6. package/es/components/carousel/use-carousel.js +1 -1
  7. package/es/components/config-provider/hooks/use-global-config.js +3 -3
  8. package/es/components/dialog/use-dialog.js +11 -11
  9. package/es/components/input/input.vue2.js +4 -4
  10. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  11. package/es/components/message/message.vue2.js +45 -42
  12. package/es/components/message/types.d.ts +8 -2
  13. package/es/components/message/types.js +2 -1
  14. package/es/components/modal/modal-footer-action.vue.d.ts +1 -1
  15. package/es/components/modal/modal-footer-action.vue2.js +13 -15
  16. package/es/components/modal/modal.vue2.js +35 -36
  17. package/es/components/popconfirm/index.d.ts +15 -15
  18. package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
  19. package/es/components/select/index.d.ts +4 -4
  20. package/es/components/select/select.vue.d.ts +4 -4
  21. package/es/components/select/useSelect.d.ts +4 -4
  22. package/es/components/super-form/index.d.ts +30 -24
  23. package/es/components/super-form/super-form-item.vue2.js +263 -231
  24. package/es/components/super-form/super-form.vue.d.ts +3 -1
  25. package/es/components/super-form/super-form.vue2.js +153 -132
  26. package/es/components/super-form/types.d.ts +19 -2
  27. package/es/components/super-form/use/helper.d.ts +34 -0
  28. package/es/components/super-form/use/helper.js +81 -34
  29. package/es/components/switch/index.d.ts +3 -2
  30. package/es/components/switch/switch.vue.d.ts +1 -25
  31. package/es/components/switch/types.d.ts +46 -0
  32. package/es/components/switch/types.js +1 -0
  33. package/es/components/table/index.d.ts +6 -0
  34. package/es/components/table/table.vue.d.ts +4 -0
  35. package/es/components/table/table.vue2.js +164 -149
  36. package/es/components/tree/index.d.ts +5 -5
  37. package/es/components/tree/tree.vue.d.ts +2 -2
  38. package/es/components/upload/index.d.ts +15 -15
  39. package/es/components/upload/upload-content.vue.d.ts +1 -1
  40. package/es/components/upload/upload.vue.d.ts +1 -1
  41. package/es/hooks/use-z-index/index.js +3 -3
  42. package/es/package.json.d.ts +1 -1
  43. package/es/package.json.js +1 -1
  44. package/es/utils/form-register.d.ts +1 -1
  45. package/es/utils/form-register.js +1 -1
  46. package/es/utils/vue/vnode.js +1 -1
  47. package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
  48. package/lib/components/autocomplete/index.d.ts +6 -6
  49. package/lib/components/button/index.d.ts +9 -9
  50. package/lib/components/dialog/use-dialog.cjs +1 -1
  51. package/lib/components/input/input.vue2.cjs +1 -1
  52. package/lib/components/message/message.vue2.cjs +1 -1
  53. package/lib/components/message/types.cjs +1 -1
  54. package/lib/components/message/types.d.ts +8 -2
  55. package/lib/components/modal/modal-footer-action.vue.d.ts +1 -1
  56. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  57. package/lib/components/modal/modal.vue2.cjs +1 -1
  58. package/lib/components/popconfirm/index.d.ts +15 -15
  59. package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
  60. package/lib/components/select/index.d.ts +4 -4
  61. package/lib/components/select/select.vue.d.ts +4 -4
  62. package/lib/components/select/useSelect.d.ts +4 -4
  63. package/lib/components/super-form/index.d.ts +30 -24
  64. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  65. package/lib/components/super-form/super-form.vue.d.ts +3 -1
  66. package/lib/components/super-form/super-form.vue2.cjs +1 -1
  67. package/lib/components/super-form/types.d.ts +19 -2
  68. package/lib/components/super-form/use/helper.cjs +1 -1
  69. package/lib/components/super-form/use/helper.d.ts +34 -0
  70. package/lib/components/switch/index.d.ts +3 -2
  71. package/lib/components/switch/switch.vue.d.ts +1 -25
  72. package/lib/components/switch/types.cjs +1 -0
  73. package/lib/components/switch/types.d.ts +46 -0
  74. package/lib/components/table/index.d.ts +6 -0
  75. package/lib/components/table/table.vue.d.ts +4 -0
  76. package/lib/components/table/table.vue2.cjs +1 -1
  77. package/lib/components/tree/index.d.ts +5 -5
  78. package/lib/components/tree/tree.vue.d.ts +2 -2
  79. package/lib/components/upload/index.d.ts +15 -15
  80. package/lib/components/upload/upload-content.vue.d.ts +1 -1
  81. package/lib/components/upload/upload.vue.d.ts +1 -1
  82. package/lib/package.json.cjs +1 -1
  83. package/lib/package.json.d.ts +1 -1
  84. package/lib/utils/form-register.cjs +1 -1
  85. package/lib/utils/form-register.d.ts +1 -1
  86. package/package.json +4 -4
  87. package/tags.json +1 -1
  88. package/theme-style/index.css +1 -1
  89. package/theme-style/src/dialog.scss +1 -1
  90. package/theme-style/src/message.scss +8 -4
  91. package/theme-style/src/super-form.scss +6 -0
  92. package/theme-style/src/table.scss +25 -6
  93. package/theme-style/vft-dialog.css +1 -1
  94. package/theme-style/vft-message.css +1 -1
  95. package/theme-style/vft-super-form.css +1 -1
  96. package/theme-style/vft-table.css +1 -1
  97. package/web-types.json +1 -1
@@ -62,9 +62,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
62
62
  readonly placement?: import("@popperjs/core").Placement | undefined;
63
63
  readonly strategy?: "fixed" | "absolute" | undefined;
64
64
  readonly effect?: "light" | "dark" | undefined;
65
+ readonly visible?: boolean | null | undefined;
65
66
  readonly teleported?: boolean | undefined;
66
67
  readonly open?: boolean | undefined;
67
- readonly visible?: boolean | null | undefined;
68
68
  readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
69
69
  readonly arrowOffset?: number | undefined;
70
70
  readonly gpuAcceleration?: boolean | undefined;
@@ -480,9 +480,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
480
480
  readonly placement?: import("@popperjs/core").Placement | undefined;
481
481
  readonly strategy?: "fixed" | "absolute" | undefined;
482
482
  readonly effect?: "light" | "dark" | undefined;
483
+ readonly visible?: boolean | null | undefined;
483
484
  readonly teleported?: boolean | undefined;
484
485
  readonly open?: boolean | undefined;
485
- readonly visible?: boolean | null | undefined;
486
486
  readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
487
487
  readonly arrowOffset?: number | undefined;
488
488
  readonly gpuAcceleration?: boolean | undefined;
@@ -85,9 +85,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
85
85
  readonly placement?: import("@popperjs/core").Placement | undefined;
86
86
  readonly strategy?: "fixed" | "absolute" | undefined;
87
87
  readonly effect?: "light" | "dark" | undefined;
88
+ readonly visible?: boolean | null | undefined;
88
89
  readonly teleported?: boolean | undefined;
89
90
  readonly open?: boolean | undefined;
90
- readonly visible?: boolean | null | undefined;
91
91
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
92
92
  readonly arrowOffset?: number | undefined;
93
93
  readonly gpuAcceleration?: boolean | undefined;
@@ -503,9 +503,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
503
503
  readonly placement?: import("@popperjs/core").Placement | undefined;
504
504
  readonly strategy?: "fixed" | "absolute" | undefined;
505
505
  readonly effect?: "light" | "dark" | undefined;
506
+ readonly visible?: boolean | null | undefined;
506
507
  readonly teleported?: boolean | undefined;
507
508
  readonly open?: boolean | undefined;
508
- readonly visible?: boolean | null | undefined;
509
509
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
510
510
  readonly arrowOffset?: number | undefined;
511
511
  readonly gpuAcceleration?: boolean | undefined;
@@ -1006,9 +1006,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
1006
1006
  readonly placement?: import("@popperjs/core").Placement | undefined;
1007
1007
  readonly strategy?: "fixed" | "absolute" | undefined;
1008
1008
  readonly effect?: "light" | "dark" | undefined;
1009
+ readonly visible?: boolean | null | undefined;
1009
1010
  readonly teleported?: boolean | undefined;
1010
1011
  readonly open?: boolean | undefined;
1011
- readonly visible?: boolean | null | undefined;
1012
1012
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
1013
1013
  readonly arrowOffset?: number | undefined;
1014
1014
  readonly gpuAcceleration?: boolean | undefined;
@@ -1424,9 +1424,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
1424
1424
  readonly placement?: import("@popperjs/core").Placement | undefined;
1425
1425
  readonly strategy?: "fixed" | "absolute" | undefined;
1426
1426
  readonly effect?: "light" | "dark" | undefined;
1427
+ readonly visible?: boolean | null | undefined;
1427
1428
  readonly teleported?: boolean | undefined;
1428
1429
  readonly open?: boolean | undefined;
1429
- readonly visible?: boolean | null | undefined;
1430
1430
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
1431
1431
  readonly arrowOffset?: number | undefined;
1432
1432
  readonly gpuAcceleration?: boolean | undefined;
@@ -1916,9 +1916,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
1916
1916
  readonly placement?: import("@popperjs/core").Placement | undefined;
1917
1917
  readonly strategy?: "fixed" | "absolute" | undefined;
1918
1918
  readonly effect?: "light" | "dark" | undefined;
1919
+ readonly visible?: boolean | null | undefined;
1919
1920
  readonly teleported?: boolean | undefined;
1920
1921
  readonly open?: boolean | undefined;
1921
- readonly visible?: boolean | null | undefined;
1922
1922
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
1923
1923
  readonly arrowOffset?: number | undefined;
1924
1924
  readonly gpuAcceleration?: boolean | undefined;
@@ -2334,9 +2334,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
2334
2334
  readonly placement?: import("@popperjs/core").Placement | undefined;
2335
2335
  readonly strategy?: "fixed" | "absolute" | undefined;
2336
2336
  readonly effect?: "light" | "dark" | undefined;
2337
+ readonly visible?: boolean | null | undefined;
2337
2338
  readonly teleported?: boolean | undefined;
2338
2339
  readonly open?: boolean | undefined;
2339
- readonly visible?: boolean | null | undefined;
2340
2340
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
2341
2341
  readonly arrowOffset?: number | undefined;
2342
2342
  readonly gpuAcceleration?: boolean | undefined;
@@ -24,12 +24,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
24
24
  autofocus: {
25
25
  type: import("vue").PropType<boolean>;
26
26
  };
27
- dark: {
28
- type: import("vue").PropType<boolean>;
29
- };
30
27
  icon: {
31
28
  type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
32
29
  };
30
+ dark: {
31
+ type: import("vue").PropType<boolean>;
32
+ };
33
33
  loading: {
34
34
  type: import("vue").PropType<boolean>;
35
35
  };
@@ -114,12 +114,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
114
114
  autofocus: {
115
115
  type: import("vue").PropType<boolean>;
116
116
  };
117
- dark: {
118
- type: import("vue").PropType<boolean>;
119
- };
120
117
  icon: {
121
118
  type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
122
119
  };
120
+ dark: {
121
+ type: import("vue").PropType<boolean>;
122
+ };
123
123
  loading: {
124
124
  type: import("vue").PropType<boolean>;
125
125
  };
@@ -199,12 +199,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
199
199
  autofocus: {
200
200
  type: import("vue").PropType<boolean>;
201
201
  };
202
- dark: {
203
- type: import("vue").PropType<boolean>;
204
- };
205
202
  icon: {
206
203
  type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
207
204
  };
205
+ dark: {
206
+ type: import("vue").PropType<boolean>;
207
+ };
208
208
  loading: {
209
209
  type: import("vue").PropType<boolean>;
210
210
  };
@@ -11,7 +11,7 @@ import "../../hooks/use-model-toggle/index.js";
11
11
  import { useOrderedChildren as ge } from "../../hooks/use-ordered-children/index.js";
12
12
  import "@popperjs/core";
13
13
  import "../../hooks/use-z-index/index.js";
14
- import { carouselContextKey as Se, CAROUSEL_ITEM_NAME as H } from "./constants.js";
14
+ import { CAROUSEL_ITEM_NAME as H, carouselContextKey as Se } from "./constants.js";
15
15
  const L = 300, ze = (t, O, M) => {
16
16
  const {
17
17
  children: o,
@@ -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,23 +1,23 @@
1
- import { DEFAULT_DIALOG_TRANSITION as P } from "./constants.js";
2
1
  import "../config-provider/index.js";
3
2
  import { UPDATE_MODEL_EVENT as Y } from "../../constants/event.js";
4
- import { useTimeoutFn as M, isClient as H } from "@vueuse/core";
5
- import { isObject as R, isArray as p, isFunction as N } from "@vft/utils";
3
+ import { useTimeoutFn as P, isClient as H } from "@vueuse/core";
4
+ import { isObject as R, isArray as p, isFunction as M } from "@vft/utils";
6
5
  import { addUnit as ee } from "../../utils/helper.js";
7
6
  import { getCurrentInstance as ne, ref as r, computed as l, watch as x, nextTick as oe, onMounted as te } from "vue";
8
7
  import "lodash-es";
9
8
  import "../form/index.js";
10
- import { useId as k } from "../../hooks/use-id/index.js";
9
+ import { useId as N } from "../../hooks/use-id/index.js";
11
10
  import { useLockscreen as le } from "../../hooks/use-lockscreen/index.js";
12
11
  import "../../hooks/use-model-toggle/index.js";
13
12
  import { defaultNamespace as ie } from "../../hooks/use-namespace/index.js";
14
13
  import "@popperjs/core";
15
14
  import { useZIndex as ae } from "../../hooks/use-z-index/index.js";
15
+ import { DEFAULT_DIALOG_TRANSITION as k } from "./constants.js";
16
16
  import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.js";
17
17
  const Te = (e, t) => {
18
18
  const i = ne().emit, { nextZIndex: m } = ae();
19
19
  let T = "";
20
- const B = k(), S = k(), a = r(!1), v = r(!1), u = r(!1), d = r(e.zIndex ?? m());
20
+ const B = N(), S = N(), a = r(!1), v = r(!1), u = r(!1), d = r(e.zIndex ?? m());
21
21
  let C, y;
22
22
  const O = fe(), U = l(() => O.value?.namespace ?? ie), c = l(() => O.value?.dialog), V = l(() => {
23
23
  const n = {}, f = `--${U.value}-dialog`;
@@ -29,7 +29,7 @@ const Te = (e, t) => {
29
29
  ), G = l(
30
30
  () => e.overflow ?? c.value?.overflow ?? !1
31
31
  ), Z = l(() => F.value ? { display: "flex" } : {}), j = l(() => {
32
- const n = e.transition ?? c.value?.transition ?? P, f = {
32
+ const n = e.transition ?? c.value?.transition ?? k, f = {
33
33
  name: n,
34
34
  onAfterEnter: g,
35
35
  onBeforeLeave: I,
@@ -38,10 +38,10 @@ const Te = (e, t) => {
38
38
  if (R(n)) {
39
39
  const o = { ...n }, b = (s, X) => (w) => {
40
40
  p(s) ? s.forEach((z) => {
41
- N(z) && z(w);
42
- }) : N(s) && s(w), X();
41
+ M(z) && z(w);
42
+ }) : M(s) && s(w), X();
43
43
  };
44
- return o.onAfterEnter = b(o.onAfterEnter, g), o.onBeforeLeave = b(o.onBeforeLeave, I), o.onAfterLeave = b(o.onAfterLeave, A), o.name || (o.name = P), o;
44
+ return o.onAfterEnter = b(o.onAfterEnter, g), o.onBeforeLeave = b(o.onBeforeLeave, I), o.onAfterLeave = b(o.onAfterLeave, A), o.name || (o.name = k), o;
45
45
  }
46
46
  return f;
47
47
  });
@@ -55,10 +55,10 @@ const Te = (e, t) => {
55
55
  i("close");
56
56
  }
57
57
  function _() {
58
- y?.(), C?.(), e.openDelay && e.openDelay > 0 ? { stop: C } = M(() => h(), e.openDelay) : h();
58
+ y?.(), C?.(), e.openDelay && e.openDelay > 0 ? { stop: C } = P(() => h(), e.openDelay) : h();
59
59
  }
60
60
  function D() {
61
- C?.(), y?.(), e.closeDelay && e.closeDelay > 0 ? { stop: y } = M(() => L(), e.closeDelay) : L();
61
+ C?.(), y?.(), e.closeDelay && e.closeDelay > 0 ? { stop: y } = P(() => L(), e.closeDelay) : L();
62
62
  }
63
63
  function E() {
64
64
  function n(f) {
@@ -13,8 +13,8 @@ import "../../hooks/use-z-index/index.js";
13
13
  import { UPDATE_MODEL_EVENT as Q } from "@vft/constants";
14
14
  import { useAttrs as Ze, useCursor as _e } from "@vft/use";
15
15
  import { calcTextareaHeight as he } from "./utils.js";
16
- import { useFormItem as et, useFormItemInputId as tt } from "../form/hooks/use-form-item.js";
17
- import { useFormSize as at, useFormDisabled as nt } from "../form/hooks/use-form-common-props.js";
16
+ import { useFormSize as et, useFormDisabled as tt } from "../form/hooks/use-form-common-props.js";
17
+ import { useFormItem as at, useFormItemInputId as nt } from "../form/hooks/use-form-item.js";
18
18
  const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"], st = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"], It = /* @__PURE__ */ Oe({
19
19
  __name: "input",
20
20
  props: {
@@ -85,9 +85,9 @@ const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
85
85
  n.is("focus", v.value)
86
86
  ]), d = Ze({
87
87
  excludeKeys: l(() => Object.keys(X.value))
88
- }), { form: Ce, formItem: F } = et(), { inputId: Y } = tt(we.props, {
88
+ }), { form: Ce, formItem: F } = at(), { inputId: Y } = nt(we.props, {
89
89
  formItemContext: F
90
- }), ke = at(), x = nt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
90
+ }), ke = et(), x = tt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
91
91
  icon: "icon-circle-close",
92
92
  size: 16
93
93
  })), te = l(() => Ce?.statusIcon ?? !1), I = l(() => F?.validateState || ""), ae = l(
@@ -1,6 +1,6 @@
1
1
  import { shallowRef as B, ref as L, computed as c, watch as G } from "vue";
2
2
  import { EVENT_CODE as g } from "../../../constants/aria.js";
3
- import { CHANGE_EVENT as i, UPDATE_MODEL_EVENT as d, INPUT_EVENT as H } from "../../../constants/event.js";
3
+ import { CHANGE_EVENT as i, INPUT_EVENT as H, UPDATE_MODEL_EVENT as d } from "../../../constants/event.js";
4
4
  import "@vueuse/core";
5
5
  import { isUndefined as K } from "@vft/utils";
6
6
  import { debugWarn as C } from "../../../utils/error.js";
@@ -1,13 +1,13 @@
1
- import { defineComponent as V, ref as f, computed as i, onMounted as H, watch as $, createBlock as w, openBlock as c, Transition as D, unref as o, withCtx as F, withDirectives as P, createElementVNode as j, normalizeStyle as A, normalizeClass as a, createElementBlock as d, createCommentVNode as k, renderSlot as U, createVNode as Z, normalizeProps as G, guardReactiveProps as q, toDisplayString as J, mergeProps as K, withModifiers as Q, vShow as W } from "vue";
2
- import { VftIcon as B } from "../icon/index.js";
1
+ import { defineComponent as V, ref as m, computed as i, onMounted as H, watch as $, createBlock as w, openBlock as c, Transition as D, unref as o, withCtx as F, withDirectives as P, createElementVNode as j, normalizeStyle as A, normalizeClass as a, createElementBlock as d, createCommentVNode as B, renderSlot as U, createVNode as Z, normalizeProps as G, guardReactiveProps as q, toDisplayString as J, mergeProps as K, withModifiers as Q, vShow as W } from "vue";
2
+ import { VftIcon as k } from "../icon/index.js";
3
3
  import { EVENT_CODE as X } from "@vft/constants";
4
4
  import { useEventListener as Y } from "@vft/use";
5
5
  import { singleAttrToObj as T } from "@vft/utils";
6
6
  import { useResizeObserver as _, useTimeoutFn as ee } from "@vueuse/core";
7
7
  import "../config-provider/index.js";
8
- import { getLastOffset as oe, getOffsetOrSpace as te } from "./instance.js";
9
- import { useGlobalComponentSettings as ne } from "../config-provider/hooks/use-global-config.js";
10
- const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
8
+ import { getLastOffset as oe, getOffsetOrSpace as ne } from "./instance.js";
9
+ import { useGlobalComponentSettings as te } from "../config-provider/hooks/use-global-config.js";
10
+ const se = ["id"], ie = ["innerHTML"], ve = /* @__PURE__ */ V({
11
11
  __name: "message",
12
12
  props: {
13
13
  customClass: {},
@@ -15,6 +15,7 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
15
15
  dangerouslyUseHTMLString: { type: Boolean },
16
16
  duration: {},
17
17
  icon: {},
18
+ showIcon: { type: Boolean },
18
19
  closeIcon: {},
19
20
  id: {},
20
21
  message: { type: [String, Object, Function] },
@@ -28,36 +29,38 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
28
29
  },
29
30
  emits: ["destroy"],
30
31
  setup(e, { expose: b }) {
31
- const t = e, { ns: n, zIndex: M } = ne("message"), { currentZIndex: S, nextZIndex: x } = M, u = f(), l = f(!1), g = f(0);
32
- let v;
33
- const L = /* @__PURE__ */ new Map([
32
+ const n = e, { ns: t, zIndex: I } = te("message"), { currentZIndex: M, nextZIndex: S } = I, u = m(), l = m(!1), g = m(0);
33
+ let y;
34
+ const x = /* @__PURE__ */ new Map([
35
+ ["primary", { icon: "icon-info-filled" }],
36
+ ["info", { icon: "icon-info-filled" }],
34
37
  ["success", { icon: "icon-success-filled" }],
35
38
  ["error", { icon: "icon-circle-close-filled" }],
36
39
  ["warning", { icon: "icon-warning-filled" }]
37
- ]), y = i(
38
- () => T(t.icon, "icon", {
39
- icon: L.get(t.type)?.icon
40
+ ]), v = i(
41
+ () => T(n.icon, "icon", {
42
+ icon: x.get(n.type)?.icon
40
43
  })
41
- ), I = i(
42
- () => T(t.icon, "icon", {
44
+ ), L = i(
45
+ () => T(n.icon, "icon", {
43
46
  icon: "icon-close"
44
47
  })
45
48
  ), O = i(() => {
46
- const s = t.type;
47
- return { [n.bm("icon", s)]: s };
48
- }), z = i(() => oe(t.id)), p = i(
49
- () => te(t.id, t.offset) + z.value
49
+ const s = n.type;
50
+ return { [t.bm("icon", s)]: s };
51
+ }), z = i(() => oe(n.id)), p = i(
52
+ () => ne(n.id, n.offset) + z.value
50
53
  ), E = i(() => g.value + p.value), N = i(() => ({
51
54
  top: `${p.value}px`,
52
- zIndex: S.value
55
+ zIndex: M.value
53
56
  }));
54
- function m() {
55
- t.duration !== 0 && ({ stop: v } = ee(() => {
57
+ function f() {
58
+ n.duration !== 0 && ({ stop: y } = ee(() => {
56
59
  r();
57
- }, t.duration));
60
+ }, n.duration));
58
61
  }
59
62
  function C() {
60
- v?.();
63
+ y?.();
61
64
  }
62
65
  function r() {
63
66
  l.value = !1;
@@ -66,11 +69,11 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
66
69
  s === X.esc && r();
67
70
  }
68
71
  return H(() => {
69
- m(), x(), l.value = !0;
72
+ f(), S(), l.value = !0;
70
73
  }), $(
71
- () => t.repeatNum,
74
+ () => n.repeatNum,
72
75
  () => {
73
- C(), m();
76
+ C(), f();
74
77
  }
75
78
  ), Y(document, "keydown", R), _(u, () => {
76
79
  g.value = u.value.getBoundingClientRect().height;
@@ -79,7 +82,7 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
79
82
  bottom: E,
80
83
  close: r
81
84
  }), (s, h) => (c(), w(D, {
82
- name: o(n).b("fade"),
85
+ name: o(t).b("fade"),
83
86
  onBeforeLeave: e.onClose,
84
87
  onAfterLeave: h[0] || (h[0] = (ce) => s.$emit("destroy"))
85
88
  }, {
@@ -89,39 +92,39 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
89
92
  ref_key: "messageRef",
90
93
  ref: u,
91
94
  class: a([
92
- o(n).b(),
93
- { [o(n).m(e.type)]: e.type && !e.icon },
94
- o(n).is("center", e.center),
95
- o(n).is("closable", e.showClose),
95
+ o(t).b(),
96
+ { [o(t).m(e.type)]: e.type && !e.icon },
97
+ o(t).is("center", e.center),
98
+ o(t).is("closable", e.showClose),
96
99
  e.customClass
97
100
  ]),
98
101
  style: A(N.value),
99
102
  role: "alert",
100
103
  onMouseenter: C,
101
- onMouseleave: m
104
+ onMouseleave: f
102
105
  }, [
103
- y.value?.icon ? (c(), d("div", {
106
+ e.showIcon && v.value?.icon ? (c(), d("div", {
104
107
  key: 0,
105
- class: a([o(n).e("icon"), O.value])
108
+ class: a([o(t).e("icon"), O.value])
106
109
  }, [
107
- Z(o(B), G(q(y.value)), null, 16)
108
- ], 2)) : k("", !0),
110
+ Z(o(k), G(q(v.value)), null, 16)
111
+ ], 2)) : B("", !0),
109
112
  U(s.$slots, "default", {}, () => [
110
113
  e.dangerouslyUseHTMLString ? (c(), d("p", {
111
114
  key: 1,
112
- class: a(o(n).e("content")),
115
+ class: a(o(t).e("content")),
113
116
  innerHTML: e.message
114
117
  }, null, 10, ie)) : (c(), d("p", {
115
118
  key: 0,
116
- class: a(o(n).e("content"))
119
+ class: a(o(t).e("content"))
117
120
  }, J(e.message), 3))
118
121
  ]),
119
- e.showClose ? (c(), w(o(B), K({
122
+ e.showClose ? (c(), w(o(k), K({
120
123
  key: 1,
121
- class: o(n).e("closeBtn")
122
- }, I.value, {
124
+ class: o(t).e("closeBtn")
125
+ }, L.value, {
123
126
  onClick: Q(r, ["stop"])
124
- }), null, 16, ["class"])) : k("", !0)
127
+ }), null, 16, ["class"])) : B("", !0)
125
128
  ], 46, se), [
126
129
  [W, l.value]
127
130
  ])
@@ -131,5 +134,5 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
131
134
  }
132
135
  });
133
136
  export {
134
- ye as default
137
+ ve as default
135
138
  };
@@ -1,6 +1,6 @@
1
1
  import type { AppContext, VNode } from 'vue';
2
- export declare const messageTypes: readonly ["success", "info", "warning", "error"];
3
- export type MessageType = 'success' | 'warning' | 'info' | 'error';
2
+ export declare const messageTypes: readonly ["primary", "success", "info", "warning", "error"];
3
+ export type MessageType = 'primary' | 'success' | 'warning' | 'info' | 'error';
4
4
  export interface MessageConfigContext {
5
5
  /** 可同时显示的消息最大数量 */
6
6
  max?: number;
@@ -14,6 +14,8 @@ export interface MessageConfigContext {
14
14
  duration?: number;
15
15
  /** 默认图标 */
16
16
  icon?: string;
17
+ /** 默认是否显示图标 */
18
+ showIcon?: boolean;
17
19
  /** 默认是否显示关闭按钮 */
18
20
  showClose?: boolean;
19
21
  /** 默认消息类型 */
@@ -33,6 +35,7 @@ export declare const messageDefaults: {
33
35
  dangerouslyUseHTMLString: boolean;
34
36
  duration: number;
35
37
  icon: undefined;
38
+ showIcon: boolean;
36
39
  id: string;
37
40
  message: string;
38
41
  onClose: undefined;
@@ -55,6 +58,8 @@ export interface MessageProps {
55
58
  duration: number;
56
59
  /** 自定义图标,该属性会覆盖 type 的图标 */
57
60
  icon?: any;
61
+ /** 是否显示图标 */
62
+ showIcon?: boolean;
58
63
  /** 自定义关闭图标 */
59
64
  closeIcon?: any;
60
65
  /** 消息的唯一标识 */
@@ -94,6 +99,7 @@ export type MessageFn = {
94
99
  };
95
100
  export type MessageTypedFn = (options?: MessageParamsWithType, appContext?: null | AppContext) => MessageHandler;
96
101
  export interface Message extends MessageFn {
102
+ primary: MessageTypedFn;
97
103
  success: MessageTypedFn;
98
104
  warning: MessageTypedFn;
99
105
  info: MessageTypedFn;
@@ -1,10 +1,11 @@
1
1
  import { isClient as e } from "@vueuse/core";
2
- const o = ["success", "info", "warning", "error"], n = {
2
+ const o = ["primary", "success", "info", "warning", "error"], n = {
3
3
  customClass: "",
4
4
  center: !1,
5
5
  dangerouslyUseHTMLString: !1,
6
6
  duration: 3e3,
7
7
  icon: void 0,
8
+ showIcon: !0,
8
9
  id: "",
9
10
  message: "",
10
11
  onClose: void 0,
@@ -1,4 +1,4 @@
1
- import { ModalActionProps } from 'vft/es/components/modal';
1
+ import type { ModalActionProps } from 'vft/es/components/modal';
2
2
  declare function __VLS_template(): {
3
3
  submitBefore?(_: {}): any;
4
4
  submitAfter?(_: {}): any;
@@ -1,8 +1,6 @@
1
- import { defineComponent as O, computed as e, createBlock as n, openBlock as i, unref as o, normalizeProps as w, guardReactiveProps as y, withCtx as s, createCommentVNode as c, renderSlot as p, mergeProps as l, createTextVNode as f, toDisplayString as B } from "vue";
1
+ import { defineComponent as O, computed as e, createBlock as n, openBlock as s, unref as o, normalizeProps as w, guardReactiveProps as y, withCtx as i, createCommentVNode as c, renderSlot as l, mergeProps as p, createTextVNode as f, toDisplayString as B } from "vue";
2
2
  import { VftRow as g } from "../row/index.js";
3
3
  import { VftButton as b } from "../button/index.js";
4
- import "../super-form/index.js";
5
- import "./index.js";
6
4
  import "@vueuse/core";
7
5
  import "@vft/utils";
8
6
  import "../config-provider/hooks/use-global-config.js";
@@ -12,7 +10,7 @@ import { useNamespace as h } from "../../hooks/use-namespace/index.js";
12
10
  import "../../hooks/use-model-toggle/index.js";
13
11
  import "@popperjs/core";
14
12
  import "../../hooks/use-z-index/index.js";
15
- const q = /* @__PURE__ */ O({
13
+ const A = /* @__PURE__ */ O({
16
14
  __name: "modal-footer-action",
17
15
  props: {
18
16
  showSubmitButton: { type: Boolean },
@@ -27,36 +25,36 @@ const q = /* @__PURE__ */ O({
27
25
  ...t.actionRowOptions
28
26
  })), r = e(
29
27
  () => Object.assign({ btnText: "确认" }, t.submitButtonOptions)
30
- ), m = e(
28
+ ), u = e(
31
29
  () => Object.assign({ btnText: "取消" }, t.cancelButtonOptions)
32
30
  );
33
- return (u, v) => (i(), n(o(g), w(y(d.value)), {
34
- default: s(() => [
35
- t.showCancelButton ? (i(), n(o(b), l({ key: 0 }, m.value, {
31
+ return (m, v) => (s(), n(o(g), w(y(d.value)), {
32
+ default: i(() => [
33
+ t.showCancelButton ? (s(), n(o(b), p({ key: 0 }, u.value, {
36
34
  class: o(a).e("cancel")
37
35
  }), {
38
- default: s(() => [
39
- f(B(m.value.btnText), 1)
36
+ default: i(() => [
37
+ f(B(u.value.btnText), 1)
40
38
  ]),
41
39
  _: 1
42
40
  }, 16, ["class"])) : c("", !0),
43
- p(u.$slots, "submitBefore"),
44
- t.showSubmitButton ? (i(), n(o(b), l({
41
+ l(m.$slots, "submitBefore"),
42
+ t.showSubmitButton ? (s(), n(o(b), p({
45
43
  key: 1,
46
44
  type: "primary",
47
45
  class: o(a).e("submit")
48
46
  }, r.value), {
49
- default: s(() => [
47
+ default: i(() => [
50
48
  f(B(r.value.btnText), 1)
51
49
  ]),
52
50
  _: 1
53
51
  }, 16, ["class"])) : c("", !0),
54
- p(u.$slots, "submitAfter")
52
+ l(m.$slots, "submitAfter")
55
53
  ]),
56
54
  _: 3
57
55
  }, 16));
58
56
  }
59
57
  });
60
58
  export {
61
- q as default
59
+ A as default
62
60
  };