vft 0.0.317 → 0.0.319

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 (84) hide show
  1. package/dist/index.css +1 -1
  2. package/es/component.js +157 -155
  3. package/es/components/avatar-stack/avatar-stack.vue.d.ts +12 -0
  4. package/es/components/avatar-stack/avatar-stack.vue.js +4 -0
  5. package/es/components/avatar-stack/avatar-stack.vue2.js +70 -0
  6. package/es/components/avatar-stack/index.d.ts +43 -0
  7. package/es/components/avatar-stack/index.js +12 -0
  8. package/es/components/avatar-stack/style/css.d.ts +4 -0
  9. package/es/components/avatar-stack/style/css.js +6 -0
  10. package/es/components/avatar-stack/style/index.d.ts +4 -0
  11. package/es/components/avatar-stack/style/index.js +6 -0
  12. package/es/components/avatar-stack/types.d.ts +19 -0
  13. package/es/components/avatar-stack/types.js +1 -0
  14. package/es/components/color-picker/color-picker.vue2.js +1 -1
  15. package/es/components/index.d.ts +13 -12
  16. package/es/components/index.js +421 -419
  17. package/es/components/list-cell/list-cell.vue2.js +36 -36
  18. package/es/components/super-form/component-map.d.ts +6 -0
  19. package/es/components/super-form/component-map.js +42 -30
  20. package/es/components/super-form/style/css.d.ts +6 -0
  21. package/es/components/super-form/style/css.js +15 -6
  22. package/es/components/super-form/style/index.d.ts +6 -0
  23. package/es/components/super-form/style/index.js +16 -7
  24. package/es/components/super-form/super-form-item.vue2.js +217 -199
  25. package/es/components/super-form/use/helper.js +137 -23
  26. package/es/components/table/style/css.js +15 -6
  27. package/es/components/table/style/index.js +16 -7
  28. package/es/components/tree/index.d.ts +5 -5
  29. package/es/components/tree/tree.vue.d.ts +2 -2
  30. package/es/components/upload/index.d.ts +15 -15
  31. package/es/components/upload/upload-content.vue.d.ts +1 -1
  32. package/es/components/upload/upload-content.vue2.js +51 -47
  33. package/es/components/upload/upload-list.vue2.js +70 -66
  34. package/es/components/upload/upload.vue.d.ts +1 -1
  35. package/es/components/upload/upload.vue2.js +30 -30
  36. package/es/index.js +562 -560
  37. package/es/package.json.d.ts +1 -1
  38. package/es/package.json.js +1 -1
  39. package/lib/component.cjs +1 -1
  40. package/lib/components/avatar-stack/avatar-stack.vue.cjs +1 -0
  41. package/lib/components/avatar-stack/avatar-stack.vue.d.ts +12 -0
  42. package/lib/components/avatar-stack/avatar-stack.vue2.cjs +1 -0
  43. package/lib/components/avatar-stack/index.cjs +1 -0
  44. package/lib/components/avatar-stack/index.d.ts +43 -0
  45. package/lib/components/avatar-stack/style/css.cjs +1 -0
  46. package/lib/components/avatar-stack/style/css.d.ts +4 -0
  47. package/lib/components/avatar-stack/style/index.cjs +1 -0
  48. package/lib/components/avatar-stack/style/index.d.ts +4 -0
  49. package/lib/components/avatar-stack/types.cjs +1 -0
  50. package/lib/components/avatar-stack/types.d.ts +19 -0
  51. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  52. package/lib/components/index.cjs +1 -1
  53. package/lib/components/index.d.ts +13 -12
  54. package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
  55. package/lib/components/super-form/component-map.cjs +1 -1
  56. package/lib/components/super-form/component-map.d.ts +6 -0
  57. package/lib/components/super-form/style/css.cjs +1 -1
  58. package/lib/components/super-form/style/css.d.ts +6 -0
  59. package/lib/components/super-form/style/index.cjs +1 -1
  60. package/lib/components/super-form/style/index.d.ts +6 -0
  61. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  62. package/lib/components/super-form/use/helper.cjs +1 -1
  63. package/lib/components/table/style/css.cjs +1 -1
  64. package/lib/components/table/style/index.cjs +1 -1
  65. package/lib/components/tree/index.d.ts +5 -5
  66. package/lib/components/tree/tree.vue.d.ts +2 -2
  67. package/lib/components/upload/index.d.ts +15 -15
  68. package/lib/components/upload/upload-content.vue.d.ts +1 -1
  69. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  70. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  71. package/lib/components/upload/upload.vue.d.ts +1 -1
  72. package/lib/components/upload/upload.vue2.cjs +1 -1
  73. package/lib/index.cjs +1 -1
  74. package/lib/package.json.cjs +1 -1
  75. package/lib/package.json.d.ts +1 -1
  76. package/package.json +5 -5
  77. package/theme-style/index.css +1 -1
  78. package/theme-style/src/avatar-stack.scss +38 -0
  79. package/theme-style/src/common/var.scss +16 -2
  80. package/theme-style/src/index.scss +1 -0
  81. package/theme-style/src/super-form.scss +6 -1
  82. package/theme-style/vft-avatar-stack.css +1 -0
  83. package/theme-style/vft-super-form.css +1 -1
  84. package/web-types.json +1 -1
@@ -1,20 +1,22 @@
1
- import { defineComponent as h, ref as $, createBlock as d, openBlock as n, TransitionGroup as V, unref as e, normalizeClass as t, withCtx as B, createElementBlock as r, renderSlot as g, Fragment as N, renderList as z, withKeys as F, createCommentVNode as a, createElementVNode as k, withModifiers as P, createVNode as v, toDisplayString as K, normalizeStyle as L } from "vue";
1
+ import { defineComponent as h, ref as V, createBlock as d, openBlock as o, TransitionGroup as B, unref as e, normalizeClass as s, withCtx as F, createElementBlock as m, renderSlot as g, Fragment as N, renderList as z, withKeys as I, createCommentVNode as c, createElementVNode as k, withModifiers as P, createVNode as v, toDisplayString as K, normalizeStyle as L, nextTick as S } from "vue";
2
2
  import "../form/index.js";
3
- import { VftIcon as m } from "../icon/index.js";
4
- import { VftProgress as S } from "../progress/index.js";
3
+ import { VftIcon as u } from "../icon/index.js";
4
+ import { VftProgress as D } from "../progress/index.js";
5
5
  import "@vueuse/core";
6
6
  import "@vft/utils";
7
+ import { debugWarn as E } from "../../utils/error.js";
7
8
  import "../config-provider/hooks/use-global-config.js";
8
9
  import "lodash-es";
9
10
  import { useNamespace as f } from "../../hooks/use-namespace/index.js";
10
11
  import "../../hooks/use-model-toggle/index.js";
11
12
  import "@popperjs/core";
12
13
  import "../../hooks/use-z-index/index.js";
13
- import { useFormDisabled as D } from "../form/hooks/use-form-common-props.js";
14
- const E = ["onKeydown"], I = ["src"], U = ["onClick"], G = ["onClick"], M = ["onClick"], R = h({
14
+ import { useFormDisabled as U } from "../form/hooks/use-form-common-props.js";
15
+ import { useFormItem as G } from "../form/hooks/use-form-item.js";
16
+ const M = ["onKeydown"], R = ["src"], W = ["onClick"], j = ["onClick"], q = ["onClick"], A = h({
15
17
  name: "VftUploadList"
16
- }), se = /* @__PURE__ */ h({
17
- ...R,
18
+ }), ae = /* @__PURE__ */ h({
19
+ ...A,
18
20
  props: {
19
21
  files: { default: [] },
20
22
  disabled: { type: Boolean, default: !1 },
@@ -23,119 +25,121 @@ const E = ["onKeydown"], I = ["src"], U = ["onClick"], G = ["onClick"], M = ["on
23
25
  listType: { default: "text" }
24
26
  },
25
27
  emits: ["remove"],
26
- setup(j, { emit: C }) {
27
- const T = C, i = f("upload"), o = f("icon"), w = f("list"), p = D(), y = $(!1), b = (s) => {
28
- T("remove", s);
28
+ setup(H, { emit: C }) {
29
+ const T = C, i = f("upload"), n = f("icon"), w = f("list"), p = U(), { formItem: $ } = G(), y = V(!1), b = (t) => {
30
+ T("remove", t), S(() => {
31
+ $?.validate("change").catch((a) => E(a));
32
+ });
29
33
  };
30
- return (s, u) => (n(), d(V, {
34
+ return (t, a) => (o(), d(B, {
31
35
  tag: "ul",
32
- class: t([
36
+ class: s([
33
37
  e(i).b("list"),
34
- e(i).bm("list", s.listType),
38
+ e(i).bm("list", t.listType),
35
39
  e(i).is("disabled", e(p))
36
40
  ]),
37
41
  name: e(w).b()
38
42
  }, {
39
- default: B(() => [
40
- (n(!0), r(N, null, z(s.files, (l) => (n(), r("li", {
43
+ default: F(() => [
44
+ (o(!0), m(N, null, z(t.files, (l) => (o(), m("li", {
41
45
  key: l.uid || l.name,
42
- class: t([
46
+ class: s([
43
47
  e(i).be("list", "item"),
44
48
  e(i).is(l.status),
45
49
  { focusing: y.value }
46
50
  ]),
47
51
  tabindex: "0",
48
- onKeydown: F((c) => !e(p) && b(l), ["delete"]),
49
- onFocus: u[0] || (u[0] = (c) => y.value = !0),
50
- onBlur: u[1] || (u[1] = (c) => y.value = !1),
51
- onClick: u[2] || (u[2] = (c) => y.value = !1)
52
+ onKeydown: I((r) => !e(p) && b(l), ["delete"]),
53
+ onFocus: a[0] || (a[0] = (r) => y.value = !0),
54
+ onBlur: a[1] || (a[1] = (r) => y.value = !1),
55
+ onClick: a[2] || (a[2] = (r) => y.value = !1)
52
56
  }, [
53
- g(s.$slots, "default", { file: l }, () => [
54
- s.listType === "picture" || l.status !== "uploading" && s.listType === "picture-card" ? (n(), r("img", {
57
+ g(t.$slots, "default", { file: l }, () => [
58
+ t.listType === "picture" || l.status !== "uploading" && t.listType === "picture-card" ? (o(), m("img", {
55
59
  key: 0,
56
- class: t(e(i).be("list", "item-thumbnail")),
60
+ class: s(e(i).be("list", "item-thumbnail")),
57
61
  src: l.url,
58
62
  alt: ""
59
- }, null, 10, I)) : a("", !0),
60
- l.status === "uploading" || s.listType !== "picture-card" ? (n(), r("div", {
63
+ }, null, 10, R)) : c("", !0),
64
+ l.status === "uploading" || t.listType !== "picture-card" ? (o(), m("div", {
61
65
  key: 1,
62
- class: t(e(i).be("list", "item-info"))
66
+ class: s(e(i).be("list", "item-info"))
63
67
  }, [
64
68
  k("a", {
65
- class: t(e(i).be("list", "item-name")),
66
- onClick: P((c) => s.handlePreview(l), ["prevent"])
69
+ class: s(e(i).be("list", "item-name")),
70
+ onClick: P((r) => t.handlePreview(l), ["prevent"])
67
71
  }, [
68
- v(e(m), {
69
- class: t(e(o).m("document")),
72
+ v(e(u), {
73
+ class: s(e(n).m("document")),
70
74
  icon: "icon-document"
71
75
  }, null, 8, ["class"]),
72
76
  k("span", {
73
- class: t(e(i).be("list", "item-file-name"))
77
+ class: s(e(i).be("list", "item-file-name"))
74
78
  }, K(l.name), 3)
75
- ], 10, U),
76
- l.status === "uploading" ? (n(), d(e(S), {
79
+ ], 10, W),
80
+ l.status === "uploading" ? (o(), d(e(D), {
77
81
  key: 0,
78
- type: s.listType === "picture-card" ? "circle" : "line",
79
- "stroke-width": s.listType === "picture-card" ? 6 : 2,
82
+ type: t.listType === "picture-card" ? "circle" : "line",
83
+ "stroke-width": t.listType === "picture-card" ? 6 : 2,
80
84
  percentage: Number(l.percentage),
81
- style: L(s.listType === "picture-card" ? "" : "margin-top: 0.5rem")
82
- }, null, 8, ["type", "stroke-width", "percentage", "style"])) : a("", !0)
83
- ], 2)) : a("", !0),
85
+ style: L(t.listType === "picture-card" ? "" : "margin-top: 0.5rem")
86
+ }, null, 8, ["type", "stroke-width", "percentage", "style"])) : c("", !0)
87
+ ], 2)) : c("", !0),
84
88
  k("label", {
85
- class: t(e(i).be("list", "item-status-label"))
89
+ class: s(e(i).be("list", "item-status-label"))
86
90
  }, [
87
- s.listType === "text" ? (n(), d(e(m), {
91
+ t.listType === "text" ? (o(), d(e(u), {
88
92
  key: 0,
89
93
  icon: "icon-circle-check",
90
- class: t([e(o).m("upload-success"), e(o).m("circle-check")])
91
- }, null, 8, ["class"])) : ["picture-card", "picture"].includes(s.listType) ? (n(), d(e(m), {
94
+ class: s([e(n).m("upload-success"), e(n).m("circle-check")])
95
+ }, null, 8, ["class"])) : ["picture-card", "picture"].includes(t.listType) ? (o(), d(e(u), {
92
96
  key: 1,
93
97
  icon: "icon-check",
94
- class: t([e(o).m("upload-success"), e(o).m("check")])
95
- }, null, 8, ["class"])) : a("", !0)
98
+ class: s([e(n).m("upload-success"), e(n).m("check")])
99
+ }, null, 8, ["class"])) : c("", !0)
96
100
  ], 2),
97
- e(p) ? a("", !0) : (n(), d(e(m), {
101
+ e(p) ? c("", !0) : (o(), d(e(u), {
98
102
  key: 2,
99
103
  icon: "icon-close",
100
- class: t(e(o).m("close")),
101
- onClick: (c) => b(l)
104
+ class: s(e(n).m("close")),
105
+ onClick: (r) => b(l)
102
106
  }, null, 8, ["class", "onClick"])),
103
- e(p) ? a("", !0) : (n(), r("i", {
107
+ e(p) ? c("", !0) : (o(), m("i", {
104
108
  key: 3,
105
- class: t(e(o).m("close-tip"))
109
+ class: s(e(n).m("close-tip"))
106
110
  }, " 按 delete 键可删除 ", 2)),
107
- s.listType === "picture-card" ? (n(), r("span", {
111
+ t.listType === "picture-card" ? (o(), m("span", {
108
112
  key: 4,
109
- class: t(e(i).be("list", "item-actions"))
113
+ class: s(e(i).be("list", "item-actions"))
110
114
  }, [
111
115
  k("span", {
112
- class: t(e(i).be("list", "item-preview")),
113
- onClick: (c) => s.handlePreview(l)
116
+ class: s(e(i).be("list", "item-preview")),
117
+ onClick: (r) => t.handlePreview(l)
114
118
  }, [
115
- v(e(m), {
119
+ v(e(u), {
116
120
  icon: "icon-zoom-in",
117
- class: t(e(o).m("zoom-in"))
121
+ class: s(e(n).m("zoom-in"))
118
122
  }, null, 8, ["class"])
119
- ], 10, G),
120
- e(p) ? a("", !0) : (n(), r("span", {
123
+ ], 10, j),
124
+ e(p) ? c("", !0) : (o(), m("span", {
121
125
  key: 0,
122
- class: t(e(i).be("list", "item-delete")),
123
- onClick: (c) => b(l)
126
+ class: s(e(i).be("list", "item-delete")),
127
+ onClick: (r) => b(l)
124
128
  }, [
125
- v(e(m), {
129
+ v(e(u), {
126
130
  icon: "icon-delete",
127
- class: t(e(o).m("delete"))
131
+ class: s(e(n).m("delete"))
128
132
  }, null, 8, ["class"])
129
- ], 10, M))
130
- ], 2)) : a("", !0)
133
+ ], 10, q))
134
+ ], 2)) : c("", !0)
131
135
  ])
132
- ], 42, E))), 128)),
133
- g(s.$slots, "append")
136
+ ], 42, M))), 128)),
137
+ g(t.$slots, "append")
134
138
  ]),
135
139
  _: 3
136
140
  }, 8, ["class", "name"]));
137
141
  }
138
142
  });
139
143
  export {
140
- se as default
144
+ ae as default
141
145
  };
@@ -89,8 +89,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
89
89
  method: string;
90
90
  multiple: boolean;
91
91
  action: string;
92
- accept: string;
93
92
  showFileList: boolean;
93
+ accept: string;
94
94
  fileList: import("./types").UploadUserFile[];
95
95
  autoUpload: boolean;
96
96
  listType: import("./types").ListType;
@@ -1,14 +1,14 @@
1
- import { defineComponent as w, useSlots as U, shallowRef as T, computed as h, onBeforeUnmount as j, provide as N, toRef as V, createElementBlock as q, openBlock as f, createBlock as m, createCommentVNode as t, renderSlot as l, unref as o, createSlots as g, withCtx as r, createVNode as D, mergeProps as k } from "vue";
1
+ import { defineComponent as b, useSlots as U, shallowRef as T, computed as h, onBeforeUnmount as j, provide as N, toRef as V, createElementBlock as _, openBlock as f, createBlock as m, createCommentVNode as t, renderSlot as l, unref as o, createSlots as g, withCtx as r, createVNode as q, mergeProps as k } from "vue";
2
2
  import "../form/index.js";
3
- import { ajaxUpload as H } from "./ajax.js";
4
- import { uploadContextKey as K } from "./constants.js";
3
+ import { ajaxUpload as D } from "./ajax.js";
4
+ import { uploadContextKey as H } from "./constants.js";
5
5
  import R from "./upload-content.vue2.js";
6
- import b from "./upload-list.vue2.js";
7
- import { useHandlers as O } from "./use-handlers.js";
8
- import { useFormDisabled as W } from "../form/hooks/use-form-common-props.js";
9
- const z = w({
6
+ import w from "./upload-list.vue2.js";
7
+ import { useHandlers as K } from "./use-handlers.js";
8
+ import { useFormDisabled as O } from "../form/hooks/use-form-common-props.js";
9
+ const W = { class: "vft-upload-wrapper" }, z = b({
10
10
  name: "vft-upload"
11
- }), _ = /* @__PURE__ */ w({
11
+ }), x = /* @__PURE__ */ b({
12
12
  ...z,
13
13
  props: {
14
14
  action: { default: "#" },
@@ -25,7 +25,7 @@ const z = w({
25
25
  fileList: { default: [] },
26
26
  autoUpload: { type: Boolean, default: !1 },
27
27
  listType: { default: "text" },
28
- httpRequest: { type: Function, default: H },
28
+ httpRequest: { type: Function, default: D },
29
29
  disabled: { type: Boolean },
30
30
  limit: {},
31
31
  beforeUpload: {},
@@ -39,52 +39,52 @@ const z = w({
39
39
  onExceed: {}
40
40
  },
41
41
  setup($, { expose: B }) {
42
- const i = $, s = U(), v = W(), u = T(), {
42
+ const i = $, s = U(), c = O(), u = T(), {
43
43
  abort: L,
44
44
  submit: P,
45
45
  clearFiles: C,
46
46
  uploadFiles: a,
47
- handleStart: y,
47
+ handleStart: v,
48
48
  handleError: F,
49
- handleRemove: n,
49
+ handleRemove: d,
50
50
  handleSuccess: S,
51
51
  handleProgress: E
52
- } = O(i, u), d = h(() => i.listType === "picture-card"), c = h(() => ({
52
+ } = K(i, u), n = h(() => i.listType === "picture-card"), y = h(() => ({
53
53
  ...i,
54
54
  fileList: a.value,
55
- onStart: y,
55
+ onStart: v,
56
56
  onProgress: E,
57
57
  onSuccess: S,
58
58
  onError: F,
59
- onRemove: n
59
+ onRemove: d
60
60
  }));
61
61
  return j(() => {
62
62
  a.value.forEach(({ url: e }) => {
63
63
  e?.startsWith("blob:") && URL.revokeObjectURL(e);
64
64
  });
65
- }), N(K, {
65
+ }), N(H, {
66
66
  accept: V(i, "accept")
67
67
  }), B({
68
68
  abort: L,
69
69
  submit: P,
70
70
  clearFiles: C,
71
- handleStart: y,
72
- handleRemove: n,
71
+ handleStart: v,
72
+ handleRemove: d,
73
73
  fileList: a
74
- }), (e, A) => (f(), q("div", null, [
75
- d.value && e.showFileList ? (f(), m(b, {
74
+ }), (e, A) => (f(), _("div", W, [
75
+ n.value && e.showFileList ? (f(), m(w, {
76
76
  key: 0,
77
- disabled: o(v),
77
+ disabled: o(c),
78
78
  "list-type": e.listType,
79
79
  files: o(a),
80
80
  "handle-preview": e.onPreview,
81
- onRemove: o(n)
81
+ onRemove: o(d)
82
82
  }, g({
83
83
  append: r(() => [
84
- D(R, k({
84
+ q(R, k({
85
85
  ref_key: "uploadRef",
86
86
  ref: u
87
- }, c.value), {
87
+ }, y.value), {
88
88
  default: r(() => [
89
89
  o(s).trigger ? l(e.$slots, "trigger", { key: 0 }) : t("", !0),
90
90
  !o(s).trigger && o(s).default ? l(e.$slots, "default", { key: 1 }) : t("", !0)
@@ -102,11 +102,11 @@ const z = w({
102
102
  key: "0"
103
103
  } : void 0
104
104
  ]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : t("", !0),
105
- !d.value || d.value && !e.showFileList ? (f(), m(R, k({
105
+ !n.value || n.value && !e.showFileList ? (f(), m(R, k({
106
106
  key: 1,
107
107
  ref_key: "uploadRef",
108
108
  ref: u
109
- }, c.value), {
109
+ }, y.value), {
110
110
  default: r(() => [
111
111
  o(s).trigger ? l(e.$slots, "trigger", { key: 0 }) : t("", !0),
112
112
  !o(s).trigger && o(s).default ? l(e.$slots, "default", { key: 1 }) : t("", !0)
@@ -115,13 +115,13 @@ const z = w({
115
115
  }, 16)) : t("", !0),
116
116
  e.$slots.trigger ? l(e.$slots, "default", { key: 2 }) : t("", !0),
117
117
  l(e.$slots, "tip"),
118
- !d.value && e.showFileList ? (f(), m(b, {
118
+ !n.value && e.showFileList ? (f(), m(w, {
119
119
  key: 3,
120
- disabled: o(v),
120
+ disabled: o(c),
121
121
  "list-type": e.listType,
122
122
  files: o(a),
123
123
  "handle-preview": e.onPreview,
124
- onRemove: o(n)
124
+ onRemove: o(d)
125
125
  }, g({ _: 2 }, [
126
126
  e.$slots.file ? {
127
127
  name: "default",
@@ -135,5 +135,5 @@ const z = w({
135
135
  }
136
136
  });
137
137
  export {
138
- _ as default
138
+ x as default
139
139
  };