vft 0.0.110 → 0.0.112
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.
- package/dist/index.css +1 -1
- package/es/components/horizontal-menu/horizontal-menu.vue2.js +79 -79
- package/es/components/index.js +227 -222
- package/es/components/pagination/components/jumper.vue2.js +13 -13
- package/es/components/pagination/components/sizes.vue2.js +38 -23
- package/es/components/table/columns.js +170 -6
- package/es/components/table/index.js +11 -6
- package/es/components/table/table.vue2.js +76 -72
- package/es/index.js +201 -196
- package/es/package.json.js +1 -1
- package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/table/columns.cjs +1 -1
- package/lib/components/table/index.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/pagination.scss +6 -1
- package/theme-style/src/table.scss +1 -1
- package/theme-style/vft-pagination.css +1 -1
- package/theme-style/vft-select-v2.css +1 -0
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as B, computed as C, getCurrentInstance as
|
|
2
|
-
import { VftMenu as
|
|
3
|
-
import { useNamespace as
|
|
1
|
+
import { defineComponent as B, computed as C, getCurrentInstance as Q, useSlots as W, ref as X, createVNode as b, mergeProps as J } from "vue";
|
|
2
|
+
import { VftMenu as Y, VftSubMenu as Z, VftMenuItem as m } from "../menu/index.js";
|
|
3
|
+
import { useNamespace as _ } from "../../hooks/use-namespace/index.js";
|
|
4
4
|
import "@popperjs/core";
|
|
5
5
|
import "lodash";
|
|
6
6
|
import "../../hooks/use-z-index/index.js";
|
|
7
7
|
import "@vueuse/core";
|
|
8
|
-
import { isUrl as
|
|
8
|
+
import { isUrl as ee } from "@vft/utils";
|
|
9
9
|
import "../../utils/ns-cover.js";
|
|
10
|
-
import { useRouterHelper as
|
|
11
|
-
import { MenuTypeEnum as
|
|
10
|
+
import { useRouterHelper as ne } from "@vft/router";
|
|
11
|
+
import { MenuTypeEnum as oe } from "./constants.js";
|
|
12
12
|
const y = (
|
|
13
13
|
/* hoist-static*/
|
|
14
|
-
|
|
15
|
-
),
|
|
14
|
+
_("horizontal-menu")
|
|
15
|
+
), te = B({
|
|
16
16
|
name: y.b()
|
|
17
|
-
}),
|
|
18
|
-
...
|
|
17
|
+
}), ve = /* @__PURE__ */ B({
|
|
18
|
+
...te,
|
|
19
19
|
props: {
|
|
20
20
|
menus: {},
|
|
21
21
|
attrMapping: {},
|
|
@@ -43,13 +43,13 @@ const y = (
|
|
|
43
43
|
},
|
|
44
44
|
emits: ["open", "close", "select"],
|
|
45
45
|
setup(t, {
|
|
46
|
-
expose:
|
|
47
|
-
emit:
|
|
46
|
+
expose: z,
|
|
47
|
+
emit: w
|
|
48
48
|
}) {
|
|
49
|
-
const
|
|
50
|
-
var
|
|
49
|
+
const D = C(() => (e, u, a) => {
|
|
50
|
+
var c, r, n, p;
|
|
51
51
|
return {
|
|
52
|
-
"grid-template-rows": `repeat(${Math.min(((
|
|
52
|
+
"grid-template-rows": `repeat(${Math.min(((r = (c = e == null ? void 0 : e[u]) == null ? void 0 : c[o.value.children]) == null ? void 0 : r.length) || 0, Number(a || t.maxRowLength ? a || t.maxRowLength : (p = (n = e == null ? void 0 : e[u]) == null ? void 0 : n[o.value.children]) == null ? void 0 : p.length))}, auto)`
|
|
53
53
|
};
|
|
54
54
|
}), o = C(() => ({
|
|
55
55
|
path: "path",
|
|
@@ -59,113 +59,113 @@ const y = (
|
|
|
59
59
|
icon: "icon",
|
|
60
60
|
disabled: "disabled",
|
|
61
61
|
...t.attrMapping
|
|
62
|
-
})),
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
key:
|
|
66
|
-
index: String(
|
|
67
|
-
icon:
|
|
68
|
-
route:
|
|
62
|
+
})), P = Q(), f = W(), R = X(), S = P.appContext.config.globalProperties.$router, T = (e, u, a) => {
|
|
63
|
+
const c = e[o.value.path], r = e[o.value.title], n = e == null ? void 0 : e[o.value.index], p = e == null ? void 0 : e[o.value.icon], h = !!(e != null && e[o.value.disabled]), d = t.disabledJudgeTurnOver ? !h : h, x = n || c || u + r;
|
|
64
|
+
return b(m, J(e, {
|
|
65
|
+
key: x,
|
|
66
|
+
index: String(x),
|
|
67
|
+
icon: p,
|
|
68
|
+
route: c,
|
|
69
69
|
title: r,
|
|
70
|
-
disabled: t.openDisabled &&
|
|
70
|
+
disabled: t.openDisabled && d,
|
|
71
71
|
className: a ? "vft-menu-popup-item" : "vft-menu-no-popup-item"
|
|
72
72
|
}), {
|
|
73
|
-
default: a ?
|
|
73
|
+
default: a ? f.menuItem ? () => {
|
|
74
74
|
var g;
|
|
75
|
-
return (g =
|
|
75
|
+
return (g = f.menuItem) == null ? void 0 : g.call(f, {
|
|
76
76
|
item: e
|
|
77
77
|
});
|
|
78
|
-
} : null :
|
|
78
|
+
} : null : f.menuTopItem ? () => {
|
|
79
79
|
var g;
|
|
80
|
-
return (g =
|
|
80
|
+
return (g = f.menuTopItem) == null ? void 0 : g.call(f, {
|
|
81
81
|
item: e
|
|
82
82
|
});
|
|
83
83
|
} : null
|
|
84
84
|
});
|
|
85
|
-
}, P = () => {
|
|
86
|
-
x("open");
|
|
87
85
|
}, E = () => {
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
w("open");
|
|
87
|
+
}, $ = () => {
|
|
88
|
+
w("close");
|
|
89
|
+
}, k = (e, u, a) => {
|
|
90
|
+
var L;
|
|
91
|
+
const c = e[o.value.path], r = e[o.value.title], n = e == null ? void 0 : e[o.value.children], p = e == null ? void 0 : e[o.value.index], h = e == null ? void 0 : e[o.value.icon], d = e == null ? void 0 : e.menuOrder, x = e == null ? void 0 : e.maxRowLength, g = !!(e != null && e[o.value.disabled]), U = t.disabledJudgeTurnOver ? !g : g, I = p || c || u + r, O = e.type === oe.TILE;
|
|
92
|
+
let i = [];
|
|
93
93
|
if (O)
|
|
94
|
-
if (
|
|
95
|
-
const l =
|
|
94
|
+
if (d) {
|
|
95
|
+
const l = d.flat();
|
|
96
96
|
if ((l == null ? void 0 : l.length) < n.length) {
|
|
97
97
|
const M = Math.max.apply(null, l);
|
|
98
|
-
for (let
|
|
99
|
-
|
|
98
|
+
for (let s = M + 1; s < n.length; s++)
|
|
99
|
+
d.push([s]);
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
i = d;
|
|
102
102
|
} else
|
|
103
103
|
for (let l = 0; l < n.length; l++)
|
|
104
|
-
|
|
105
|
-
return n != null && n.length || e != null && e.render ?
|
|
106
|
-
index: String(
|
|
107
|
-
key:
|
|
108
|
-
icon:
|
|
104
|
+
i.push([l]);
|
|
105
|
+
return n != null && n.length || e != null && e.render ? b(Z, J(t.subMenuCfg, e, {
|
|
106
|
+
index: String(I),
|
|
107
|
+
key: I,
|
|
108
|
+
icon: h,
|
|
109
109
|
showArrow: e.showArrow ?? t.subMenuCfg.showArrow,
|
|
110
|
-
disabled: t.openDisabled &&
|
|
110
|
+
disabled: t.openDisabled && U,
|
|
111
111
|
toolTipCfg: {
|
|
112
112
|
...t.subMenuCfg.toolTipCfg || {},
|
|
113
|
-
...((
|
|
113
|
+
...((L = e.subMenuCfg) == null ? void 0 : L.toolTipCfg) || {}
|
|
114
114
|
},
|
|
115
115
|
teleported: !1,
|
|
116
116
|
"popper-class": [O ? y.e("tile") : "", y.e("normal")]
|
|
117
117
|
}), {
|
|
118
|
-
default: () => [e != null && e.render ? e == null ? void 0 : e.render : O ?
|
|
118
|
+
default: () => [e != null && e.render ? e == null ? void 0 : e.render : O ? i.map((l, M) => b("div", {
|
|
119
119
|
class: "content-main",
|
|
120
120
|
key: M
|
|
121
|
-
}, [l.map((
|
|
122
|
-
var V, A;
|
|
123
|
-
const
|
|
124
|
-
return n != null && n.length ?
|
|
121
|
+
}, [l.map((s, q) => {
|
|
122
|
+
var N, V, A;
|
|
123
|
+
const v = (N = n == null ? void 0 : n[s]) == null ? void 0 : N[o.value.children], F = (V = n == null ? void 0 : n[s]) == null ? void 0 : V.maxRowLength;
|
|
124
|
+
return n != null && n.length ? b("div", {
|
|
125
125
|
class: "content-col",
|
|
126
|
-
key:
|
|
127
|
-
}, [
|
|
128
|
-
class:
|
|
129
|
-
}, [(A = n == null ? void 0 : n[
|
|
126
|
+
key: q
|
|
127
|
+
}, [b("span", {
|
|
128
|
+
class: v != null && v.length ? "title" : ""
|
|
129
|
+
}, [(A = n == null ? void 0 : n[s]) == null ? void 0 : A[o.value.title]]), v != null && v.length ? b("div", {
|
|
130
130
|
class: "content",
|
|
131
|
-
style:
|
|
132
|
-
}, [
|
|
131
|
+
style: D.value(n, s, F || x)
|
|
132
|
+
}, [v.map((G, K) => T(G, K, !0))]) : null]) : null;
|
|
133
133
|
})])) : n.map((l, M) => {
|
|
134
|
-
var
|
|
135
|
-
return (
|
|
134
|
+
var s;
|
|
135
|
+
return (s = l[o.value.children]) != null && s.length ? k(l, M, !0) : T(l, M, !0);
|
|
136
136
|
})],
|
|
137
137
|
title: () => r
|
|
138
138
|
}) : T(e, u, a);
|
|
139
139
|
};
|
|
140
|
-
async function
|
|
141
|
-
var u, a,
|
|
140
|
+
async function j(e) {
|
|
141
|
+
var u, a, c;
|
|
142
142
|
if (t.useRouterJump) {
|
|
143
143
|
const {
|
|
144
144
|
go: r
|
|
145
|
-
} =
|
|
146
|
-
let
|
|
147
|
-
e.indexPath.some((
|
|
148
|
-
const
|
|
149
|
-
r(
|
|
145
|
+
} = ne(S), n = e.route;
|
|
146
|
+
let p = e.route;
|
|
147
|
+
e.indexPath.some((d) => ee(d)) && (p = e.indexPath.slice(-2).join("/"));
|
|
148
|
+
const h = (c = (a = (u = S.getRoutes().filter((d) => d.path === p)) == null ? void 0 : u[0]) == null ? void 0 : a.meta) == null ? void 0 : c.linkTarget;
|
|
149
|
+
r(h ? {
|
|
150
150
|
url: n,
|
|
151
151
|
winOpenOpt: {
|
|
152
|
-
target:
|
|
152
|
+
target: h
|
|
153
153
|
}
|
|
154
154
|
} : n);
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
w("select", e);
|
|
157
157
|
}
|
|
158
|
-
const
|
|
158
|
+
const H = C(() => {
|
|
159
159
|
var e;
|
|
160
|
-
return (e =
|
|
160
|
+
return (e = R.value) == null ? void 0 : e.inSubMenu;
|
|
161
161
|
});
|
|
162
|
-
return
|
|
163
|
-
isInSubMenu:
|
|
164
|
-
}), () =>
|
|
165
|
-
ref:
|
|
166
|
-
onSelect:
|
|
167
|
-
onOpen:
|
|
168
|
-
onClose:
|
|
162
|
+
return z({
|
|
163
|
+
isInSubMenu: H
|
|
164
|
+
}), () => b(Y, {
|
|
165
|
+
ref: R,
|
|
166
|
+
onSelect: j,
|
|
167
|
+
onOpen: E,
|
|
168
|
+
onClose: $,
|
|
169
169
|
mode: "horizontal",
|
|
170
170
|
class: y.b(),
|
|
171
171
|
defaultActive: t.defaultActive,
|
|
@@ -173,11 +173,11 @@ const y = (
|
|
|
173
173
|
}, {
|
|
174
174
|
default: () => {
|
|
175
175
|
var e;
|
|
176
|
-
return [(e = t.menus) != null && e.length ? t.menus.map((u, a) =>
|
|
176
|
+
return [(e = t.menus) != null && e.length ? t.menus.map((u, a) => k(u, a, !1)) : null];
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
export {
|
|
182
|
-
|
|
182
|
+
ve as default
|
|
183
183
|
};
|