vft 0.0.83 → 0.0.85

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 (70) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/es/component.js +28 -26
  4. package/es/components/alert/index.js +1 -1
  5. package/es/components/backtop/backtop.vue.js +4 -0
  6. package/es/components/{back-top/back-top.vue2.js → backtop/backtop.vue2.js} +5 -4
  7. package/es/components/{back-top → backtop}/index.js +2 -2
  8. package/es/components/backtop/style/css.js +2 -0
  9. package/es/components/backtop/style/index.js +2 -0
  10. package/es/components/container/footer.vue2.js +15 -21
  11. package/es/components/container/header.vue2.js +10 -16
  12. package/es/components/context-menu/context-menu.vue2.js +4 -3
  13. package/es/components/footer-layout/footer-layout.vue2.js +4 -3
  14. package/es/components/header-layout/header-layout.vue2.js +4 -3
  15. package/es/components/horizontal-menu/horizontal-menu.vue2.js +37 -37
  16. package/es/components/index.js +151 -149
  17. package/es/components/md-container/md-container.vue2.js +4 -3
  18. package/es/components/menu/menu-item.vue2.js +4 -3
  19. package/es/components/menu/sub-menu.vue2.js +4 -3
  20. package/es/components/multiple-tabs/multiple-tabs.vue2.js +4 -3
  21. package/es/components/result/result.vue2.js +4 -3
  22. package/es/components/side-menu/side-menu.vue2.js +4 -3
  23. package/es/components/table/columns.js +10 -0
  24. package/es/components/table/table.vue2.js +121 -154
  25. package/es/components/tabs/tab-nav.vue2.js +4 -3
  26. package/es/index.js +280 -278
  27. package/es/package.json.js +1 -1
  28. package/lib/component.cjs +1 -1
  29. package/lib/components/alert/index.cjs +1 -1
  30. package/lib/components/{back-top/back-top.vue.cjs → backtop/backtop.vue.cjs} +1 -1
  31. package/lib/components/{back-top/back-top.vue2.cjs → backtop/backtop.vue2.cjs} +1 -1
  32. package/lib/components/{back-top → backtop}/index.cjs +1 -1
  33. package/lib/components/{back-top → backtop}/style/css.cjs +1 -1
  34. package/lib/components/{back-top → backtop}/style/index.cjs +1 -1
  35. package/lib/components/container/footer.vue2.cjs +1 -1
  36. package/lib/components/container/header.vue2.cjs +1 -1
  37. package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
  38. package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
  39. package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
  40. package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
  41. package/lib/components/index.cjs +1 -1
  42. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  43. package/lib/components/menu/menu-item.vue2.cjs +1 -1
  44. package/lib/components/menu/sub-menu.vue2.cjs +1 -1
  45. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  46. package/lib/components/result/result.vue2.cjs +1 -1
  47. package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
  48. package/lib/components/table/columns.cjs +1 -0
  49. package/lib/components/table/table.vue2.cjs +1 -1
  50. package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
  51. package/lib/index.cjs +1 -1
  52. package/lib/package.json.cjs +1 -1
  53. package/package.json +2 -2
  54. package/tags.json +1 -1
  55. package/theme-style/base.css +1 -1
  56. package/theme-style/index.css +1 -1
  57. package/theme-style/src/{back-top.scss → backtop.scss} +3 -3
  58. package/theme-style/src/common/var.scss +6 -6
  59. package/theme-style/src/index.scss +1 -1
  60. package/theme-style/src/table.scss +105 -66
  61. package/theme-style/vft-backtop.css +1 -0
  62. package/theme-style/vft-menu.css +1 -1
  63. package/theme-style/vft-table.css +1 -1
  64. package/theme-style/vft-var.css +1 -1
  65. package/web-types.json +1 -1
  66. package/es/components/back-top/back-top.vue.js +0 -4
  67. package/es/components/back-top/style/css.js +0 -2
  68. package/es/components/back-top/style/index.js +0 -2
  69. /package/es/components/{back-top/use-back-top.js → backtop/use-backtop.js} +0 -0
  70. /package/lib/components/{back-top/use-back-top.cjs → backtop/use-backtop.cjs} +0 -0
@@ -1,26 +1,26 @@
1
- import { defineComponent as W, useAttrs as U, ref as d, computed as x, watch as w, createVNode as p, resolveComponent as L, nextTick as Z, reactive as _, onMounted as ee, openBlock as S, createElementBlock as te, normalizeClass as k, unref as a, createBlock as O, mergeProps as N, createCommentVNode as D, createSlots as le, withCtx as P, withDirectives as ne, createElementVNode as T, vShow as ae } from "vue";
2
- import { VftEmpty as oe } from "../empty/index.js";
3
- import { VftPagination as I } from "../pagination/index.js";
4
- import { useNamespace as re } from "../../hooks/use-namespace/index.js";
1
+ import { defineComponent as V, useAttrs as Y, ref as c, computed as H, watch as y, createVNode as p, reactive as J, onMounted as K, resolveComponent as Q, openBlock as C, createElementBlock as U, normalizeClass as b, unref as n, createBlock as L, mergeProps as x, createCommentVNode as P, createSlots as Z, withCtx as R, withDirectives as _, createElementVNode as O, vShow as ee } from "vue";
2
+ import { VftEmpty as te } from "../empty/index.js";
3
+ import { VftPagination as W } from "../pagination/index.js";
4
+ import { useNamespace as ae } from "../../hooks/use-namespace/index.js";
5
5
  import "@popperjs/core";
6
6
  import "lodash";
7
7
  import "../../hooks/use-z-index/index.js";
8
- import { useDebounceFn as ie, useResizeObserver as ce } from "@vueuse/core";
8
+ import { useDebounceFn as le, useResizeObserver as ne } from "@vueuse/core";
9
9
  import "@vft/utils";
10
10
  import "../../utils/ns-cover.js";
11
- import E from "vxe-table";
12
- import { EmptyEnum as se } from "../empty/constants.js";
13
- const c = (
11
+ import I from "vxe-table";
12
+ import { EmptyEnum as oe } from "../empty/constants.js";
13
+ const r = (
14
14
  /* hoist-static*/
15
- re("table")
16
- ), ue = W({
17
- name: c.b()
18
- }), Se = /* @__PURE__ */ W({
19
- ...ue,
15
+ ae("table")
16
+ ), re = V({
17
+ name: r.b()
18
+ }), Ce = /* @__PURE__ */ V({
19
+ ...re,
20
20
  props: {
21
21
  maxHeight: null,
22
22
  columns: null,
23
- tableData: {
23
+ data: {
24
24
  default: []
25
25
  },
26
26
  loading: {
@@ -50,86 +50,53 @@ const c = (
50
50
  pageOptions: null
51
51
  },
52
52
  emits: ["page-change", "sort-change", "update:pageNum"],
53
- setup(t, {
53
+ setup(e, {
54
54
  expose: q,
55
- emit: h
55
+ emit: d
56
56
  }) {
57
- const V = U(), A = d(0), s = d(), $ = ie(() => M(), 120), z = x(() => t.pagePlacement.startsWith("bottom"));
58
- w([() => t.loading, () => t.tableData, () => t.columns], () => {
59
- $();
57
+ const T = Y(), $ = c(0), i = c(), A = le(() => D(), 120), S = H(() => e.pagePlacement.startsWith("bottom"));
58
+ y([() => e.loading, () => e.data, () => e.columns], () => {
59
+ A();
60
60
  }, {
61
61
  immediate: !0
62
62
  });
63
- function M() {
64
- v.data = t.tableData, H(t.pageNum);
63
+ function D() {
64
+ g.data = e.data, w(e.pageNum);
65
65
  }
66
- E.renderer.add("Encrypt", {
66
+ I.renderer.add("Encrypt", {
67
67
  // 加密模板
68
- renderDefault(e, l) {
68
+ renderDefault(t, a) {
69
69
  const {
70
- row: n,
71
- column: o
72
- } = l;
70
+ row: l,
71
+ column: f
72
+ } = a;
73
73
  return p("span", {
74
74
  class: "line-clamp",
75
- innerHTML: n[o.field] || "-"
75
+ innerHTML: l[f.field] || "-"
76
76
  }, null);
77
77
  }
78
- }), E.renderer.add("Clamp", {
79
- // 展开收起
80
- renderDefault(e, l) {
81
- const {
82
- row: n,
83
- column: o
84
- } = l;
85
- return o.showOverflow = null, p(L("vftClampToggle"), {
86
- autoResize: !0,
87
- maxLines: 2,
88
- text: n[o.field],
89
- title: n[o.field],
90
- toggleText: ["展开", "收起"],
91
- onClampChange: (i) => X(l)
92
- }, null);
93
- }
94
- }), E.formats.mixin({
78
+ }), I.formats.mixin({
95
79
  showEmpty({
96
- cellValue: e
80
+ cellValue: t
97
81
  }) {
98
- return e || "-";
82
+ return t || "-";
99
83
  }
100
84
  });
101
- function G(e) {
102
- h("page-change", e), h("update:pageNum", e);
85
+ function G(t) {
86
+ d("page-change", t), d("update:pageNum", t);
103
87
  }
104
- const X = (e, l) => {
105
- const {
106
- rowid: n
107
- } = e;
108
- Z(() => {
109
- const o = document.getElementsByClassName("vxe-body--row"), i = [];
110
- for (var u = 0; u < o.length; u++)
111
- o[u].getAttribute("rowid") === n && i.push(o[u]);
112
- setTimeout(() => {
113
- if (i.length > 1) {
114
- const g = i[0].clientHeight, Q = i[1].clientHeight;
115
- g !== Q && (i[1].style.height = g + "px");
116
- }
117
- }, 1);
118
- });
119
- }, j = x(() => t.columns.filter((e) => (e && e.type !== "seq" && !e.formatter && !e.slots && !e.cellRender && (e.cellRender = {
120
- name: "Encrypt"
121
- }), e))), F = () => ({
88
+ const M = () => ({
122
89
  maxHeight: "88px",
123
90
  height: "44px"
124
- }), Y = (e) => {
125
- var n;
91
+ }), X = (t) => {
92
+ var l;
126
93
  const {
127
- column: l
128
- } = e;
94
+ column: a
95
+ } = t;
129
96
  return {
130
- maxHeight: ((n = l == null ? void 0 : l.cellRender) == null ? void 0 : n.name) === "Clamp" ? "max-content" : "44px"
97
+ maxHeight: ((l = a == null ? void 0 : a.cellRender) == null ? void 0 : l.name) === "Clamp" ? "max-content" : "44px"
131
98
  };
132
- }, v = _({
99
+ }, g = J({
133
100
  autoResize: !0,
134
101
  sortConfig: {
135
102
  trigger: "cell",
@@ -137,17 +104,17 @@ const c = (
137
104
  defaultSort: {
138
105
  field: "",
139
106
  order: "desc",
140
- ...t.defaultSort
107
+ ...e.defaultSort
141
108
  },
142
109
  orders: ["desc", "asc", null]
143
110
  },
144
111
  seqConfig: {
145
- startIndex: A.value
112
+ startIndex: $.value
146
113
  },
147
114
  cellClassName: "cellClass",
148
115
  rowClassName: "rowClass",
149
- cellStyle: Y,
150
- rowStyle: F,
116
+ cellStyle: X,
117
+ rowStyle: M,
151
118
  headerRowClassName: "headerRowClass",
152
119
  headerAlign: "center",
153
120
  columnConfig: {
@@ -163,115 +130,115 @@ const c = (
163
130
  scrollX: {
164
131
  enabled: !1
165
132
  },
166
- ...t.tableConfig,
167
- ...V
168
- }), J = (e) => {
169
- h("sort-change", e);
133
+ ...e.tableConfig,
134
+ ...T
135
+ }), j = (t) => {
136
+ d("sort-change", t);
170
137
  };
171
- w(() => t.pageNum, (e) => {
172
- H(e);
138
+ y(() => e.pageNum, (t) => {
139
+ w(t);
173
140
  });
174
- const H = (e) => {
175
- v.seqConfig && (v.seqConfig.startIndex = (e - 1) * t.pageSize);
176
- }, m = d(), B = d();
177
- let C = d(!1), r = d(null), y = d(null);
178
- const f = x(() => {
179
- var e;
180
- return ((e = t.sticky) == null ? void 0 : e.getContainer) || document.documentElement || document.body;
141
+ const w = (t) => {
142
+ g.seqConfig && (g.seqConfig.startIndex = (t - 1) * e.pageSize);
143
+ }, u = c(), k = c();
144
+ let h = c(!1), o = c(null), m = c(null);
145
+ const s = H(() => {
146
+ var t;
147
+ return ((t = e.sticky) == null ? void 0 : t.getContainer) || document.documentElement || document.body;
181
148
  });
182
- w(() => [s, t.sticky], () => {
183
- var e, l, n;
184
- (e = s.value) != null && e.$el && t.sticky && ((l = f.value) == null || l.removeEventListener("scroll", b), (n = f.value) == null || n.addEventListener("scroll", b), setTimeout(() => {
185
- R();
149
+ y(() => [i, e.sticky], () => {
150
+ var t, a, l;
151
+ (t = i.value) != null && t.$el && e.sticky && ((a = s.value) == null || a.removeEventListener("scroll", v), (l = s.value) == null || l.addEventListener("scroll", v), setTimeout(() => {
152
+ N();
186
153
  }, 50));
187
154
  }, {
188
155
  immediate: !0,
189
156
  deep: !0
190
157
  });
191
- function R() {
192
- if (!r.value || !y.value || (b(), !C.value))
158
+ function N() {
159
+ if (!o.value || !m.value || (v(), !h.value))
193
160
  return;
194
- const e = r.value.clientWidth, l = y.value.offsetWidth;
195
- m.value.style.width = e - 1 + "px", B.value.style.width = l + "px";
161
+ const t = o.value.clientWidth, a = m.value.offsetWidth;
162
+ u.value.style.width = t - 1 + "px", k.value.style.width = a + "px";
196
163
  }
197
- function b() {
198
- var i, u, g;
199
- if (!((i = s.value) != null && i.$el) || !r.value || !f.value)
164
+ function v() {
165
+ var z, E, B;
166
+ if (!((z = i.value) != null && z.$el) || !o.value || !s.value)
200
167
  return;
201
- const e = ((u = f.value) == null ? void 0 : u.clientHeight) || window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, {
202
- top: l,
203
- bottom: n
204
- } = r.value.getBoundingClientRect(), o = ((g = f.value) == null ? void 0 : g.getBoundingClientRect().top) || document.body.getBoundingClientRect().top;
205
- C.value = l < e && n > e && n - o > e, m.value.scrollLeft = r.value.scrollLeft;
168
+ const t = ((E = s.value) == null ? void 0 : E.clientHeight) || window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, {
169
+ top: a,
170
+ bottom: l
171
+ } = o.value.getBoundingClientRect(), f = ((B = s.value) == null ? void 0 : B.getBoundingClientRect().top) || document.body.getBoundingClientRect().top;
172
+ h.value = a < t && l > t && l - f > t, u.value.scrollLeft = o.value.scrollLeft;
206
173
  }
207
- const K = () => {
208
- var l;
209
- const e = (l = s.value) == null ? void 0 : l.$el;
210
- e && (r.value = e.querySelector(".vxe-table--body-wrapper"), y.value = e.querySelector(".vxe-table--body"), !(!r.value && !y.value) && (r.value.addEventListener("scroll", function(n) {
211
- m.value.scrollLeft = n.target.scrollLeft;
212
- }), m.value.addEventListener("scroll", function(n) {
213
- r.value.scrollLeft = n.target.scrollLeft;
174
+ const F = () => {
175
+ var a;
176
+ const t = (a = i.value) == null ? void 0 : a.$el;
177
+ t && (o.value = t.querySelector(".vxe-table--body-wrapper"), m.value = t.querySelector(".vxe-table--body"), !(!o.value && !m.value) && (o.value.addEventListener("scroll", function(l) {
178
+ u.value.scrollLeft = l.target.scrollLeft;
179
+ }), u.value.addEventListener("scroll", function(l) {
180
+ o.value.scrollLeft = l.target.scrollLeft;
214
181
  })));
215
182
  };
216
- return ee(() => {
217
- t.sticky && (K(), ce(s, () => R()));
183
+ return K(() => {
184
+ e.sticky && (F(), ne(i, () => N()));
218
185
  }), q({
219
- table: s
220
- }), (e, l) => {
221
- const n = L("vxe-grid");
222
- return S(), te("div", {
223
- class: k(a(c).b())
224
- }, [a(z) ? D("", !0) : (S(), O(a(I), N({
186
+ table: i
187
+ }), (t, a) => {
188
+ const l = Q("vxe-grid");
189
+ return C(), U("div", {
190
+ class: b(n(r).b())
191
+ }, [n(S) ? P("", !0) : (C(), L(n(W), x({
225
192
  key: 0,
226
- class: [a(c).e("pager"), a(c).m("pager-" + t.pagePlacement)],
193
+ class: [n(r).e("pager"), n(r).m("pager-" + e.pagePlacement)],
227
194
  layout: "prev, pager, next"
228
- }, t.pageOptions, {
229
- total: t.total,
230
- "page-size": t.pageSize,
231
- onCurrentChange: l[0] || (l[0] = (o) => h("page-change", t.pageNum)),
232
- "current-page": t.pageNum
233
- }), null, 16, ["class", "total", "page-size", "current-page"])), p(n, N({
195
+ }, e.pageOptions, {
196
+ total: e.total,
197
+ "page-size": e.pageSize,
198
+ onCurrentChange: a[0] || (a[0] = (f) => d("page-change", e.pageNum)),
199
+ "current-page": e.pageNum
200
+ }), null, 16, ["class", "total", "page-size", "current-page"])), p(l, x({
234
201
  ref_key: "xGrid",
235
- ref: s
236
- }, v, {
237
- height: t.height,
238
- "max-height": t.maxHeight,
239
- columns: a(j),
240
- data: t.tableData,
202
+ ref: i
203
+ }, g, {
204
+ height: e.height,
205
+ "max-height": e.maxHeight,
206
+ columns: e.columns,
207
+ data: e.data,
241
208
  "auto-resize": "",
242
- loading: t.loading,
209
+ loading: e.loading,
243
210
  resizable: "",
244
- onSortChange: J
245
- }), le({
246
- empty: P(() => [p(a(oe), {
247
- type: a(se).NO_DATA
211
+ onSortChange: j
212
+ }), Z({
213
+ empty: R(() => [p(n(te), {
214
+ type: n(oe).NO_DATA
248
215
  }, null, 8, ["type"])]),
249
216
  _: 2
250
- }, [t.sticky ? {
217
+ }, [e.sticky ? {
251
218
  name: "bottom",
252
- fn: P(() => [ne(T("div", {
219
+ fn: R(() => [_(O("div", {
253
220
  ref_key: "stickyScroll",
254
- ref: m,
255
- class: k(a(c).e("sticky-scroll-warpper"))
256
- }, [T("div", {
221
+ ref: u,
222
+ class: b(n(r).e("sticky-scroll-warpper"))
223
+ }, [O("div", {
257
224
  ref_key: "stickyScrollBar",
258
- ref: B,
259
- class: k(a(c).e("sticky-scroll-bar"))
260
- }, null, 2)], 2), [[ae, a(C)]])]),
225
+ ref: k,
226
+ class: b(n(r).e("sticky-scroll-bar"))
227
+ }, null, 2)], 2), [[ee, n(h)]])]),
261
228
  key: "0"
262
- } : void 0]), 1040, ["height", "max-height", "columns", "data", "loading"]), a(z) ? (S(), O(a(I), N({
229
+ } : void 0]), 1040, ["height", "max-height", "columns", "data", "loading"]), n(S) ? (C(), L(n(W), x({
263
230
  key: 1,
264
- class: [a(c).e("pager"), a(c).m("pager-" + t.pagePlacement)],
231
+ class: [n(r).e("pager"), n(r).m("pager-" + e.pagePlacement)],
265
232
  layout: "prev, pager, next"
266
- }, t.pageOptions, {
267
- total: t.total,
268
- "page-size": t.pageSize,
233
+ }, e.pageOptions, {
234
+ total: e.total,
235
+ "page-size": e.pageSize,
269
236
  onCurrentChange: G,
270
- "current-page": t.pageNum
271
- }), null, 16, ["class", "total", "page-size", "current-page"])) : D("", !0)], 2);
237
+ "current-page": e.pageNum
238
+ }), null, 16, ["class", "total", "page-size", "current-page"])) : P("", !0)], 2);
272
239
  };
273
240
  }
274
241
  });
275
242
  export {
276
- Se as default
243
+ Ce as default
277
244
  };
@@ -22,7 +22,7 @@ import "../footer-layout/index.js";
22
22
  import "../iframe-layout/index.js";
23
23
  import "../router-view-content/index.js";
24
24
  import "../logo/index.js";
25
- import "../back-top/index.js";
25
+ import "../backtop/index.js";
26
26
  import "../container/index.js";
27
27
  import "../config-provider/index.js";
28
28
  import "../descriptions/index.js";
@@ -74,6 +74,7 @@ import "../skeleton/index.js";
74
74
  import "../space/index.js";
75
75
  import "../card/index.js";
76
76
  import "../popconfirm/index.js";
77
+ import "../alert/index.js";
77
78
  import "../md-container/index.js";
78
79
  import "../md-comment/index.js";
79
80
  import "../md-tabs/index.js";
@@ -92,7 +93,7 @@ const V = (
92
93
  K("tab-nav")
93
94
  ), ct = E({
94
95
  name: V.b()
95
- }), Uo = /* @__PURE__ */ E({
96
+ }), Xo = /* @__PURE__ */ E({
96
97
  ...ct,
97
98
  props: {
98
99
  panes: null,
@@ -246,5 +247,5 @@ const V = (
246
247
  }
247
248
  });
248
249
  export {
249
- Uo as default
250
+ Xo as default
250
251
  };