china-mobile-international-custom-components 0.0.26 → 0.0.28
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/es/ApplicationIcon.mjs +85 -0
- package/es/AvailableRangePreview.mjs +1 -1
- package/es/AvailableRangeSetting.mjs +68 -63
- package/es/CustomSidebar.mjs +1 -1
- package/es/assets/AvailableRangePreview.css +1 -0
- package/es/assets/AvailableRangeSetting.css +1 -0
- package/es/assets/CustomSidebar.css +1 -0
- package/es/assets/layout2.css +1 -1
- package/es/chunks/AvailableRangePreview.D4mZe1lQ.js +217 -0
- package/es/chunks/AvailableRangeSetting.BkSLnQ6N.js +215 -0
- package/es/chunks/CustomSidebar.BWGoPtLi.js +506 -0
- package/es/chunks/CustomTitle.BLZ7evms.js +5 -0
- package/es/chunks/CustomToggle.CP3M2_f3.js +165 -0
- package/es/chunks/PageContainer.D-G32lvP.js +329 -0
- package/es/chunks/_plugin-vue_export-helper.CVVE_0_F.js +13 -0
- package/es/chunks/_plugin-vue_export-helper.Cf-_TWPK.js +6 -0
- package/es/chunks/index.AHEDCg43.js +160 -0
- package/es/chunks/index.B67AnSJI.js +154 -0
- package/es/chunks/index.B9F4VYQK.js +118 -0
- package/es/chunks/index.BPxF6Amx.js +157 -0
- package/es/chunks/index.C2gKjqoA.js +209 -0
- package/es/chunks/index.DTtNnKDH.js +288 -0
- package/es/chunks/index.Dh5IGfxO.js +290 -0
- package/es/chunks/index.DtBeJlu6.js +142 -0
- package/es/chunks/index.kR57MtNP.js +211 -0
- package/es/chunks/index.wQj5YKPy.js +288 -0
- package/es/chunks/layout.BE8_kCeR.js +619 -0
- package/es/chunks/layout.C0EtkrZg.js +639 -0
- package/es/chunks/layout.C6AMos7n.js +17 -0
- package/es/chunks/layout.CWFXohJu.js +622 -0
- package/es/chunks/layout.R5FQNRjS.js +619 -0
- package/es/chunks/layout.nKB_kc-U.js +26 -0
- package/es/chunks/utils.BhlZXNZ6.js +19 -0
- package/es/index.mjs +643 -630
- package/lib/ApplicationIcon.js +1 -0
- package/lib/AvailableRangePreview.js +1 -1
- package/lib/AvailableRangeSetting.js +1 -1
- package/lib/CustomSidebar.js +1 -1
- package/lib/assets/AvailableRangePreview.css +1 -0
- package/lib/assets/AvailableRangeSetting.css +1 -0
- package/lib/assets/CustomSidebar.css +1 -0
- package/lib/assets/layout2.css +1 -1
- package/lib/chunks/AvailableRangePreview.CkgZsXP0.js +1 -0
- package/lib/chunks/AvailableRangeSetting.CF-jHm4x.js +1 -0
- package/lib/chunks/CustomSidebar.CMYJFb2P.js +1 -0
- package/lib/chunks/CustomTitle.BkFZ-ZIq.js +1 -0
- package/lib/chunks/CustomToggle.C0PpzKPP.js +1 -0
- package/lib/chunks/PageContainer.GH56wASV.js +1 -0
- package/lib/chunks/_plugin-vue_export-helper.C55-DZV2.js +1 -0
- package/lib/chunks/_plugin-vue_export-helper.DAGvX2Jf.js +1 -0
- package/lib/chunks/index.BfHfKST0.js +1 -0
- package/lib/chunks/index.Bk55us0s.js +1 -0
- package/lib/chunks/index.BlXappa4.js +1 -0
- package/lib/chunks/index.CCxHaoi4.js +1 -0
- package/lib/chunks/index.CSYGhK9M.js +1 -0
- package/lib/chunks/index.C_IlZrzE.js +1 -0
- package/lib/chunks/index.DUGtabLJ.js +1 -0
- package/lib/chunks/index.Dakz8S3g.js +1 -0
- package/lib/chunks/index.DydPD8Lc.js +1 -0
- package/lib/chunks/index.k_hSuA6i.js +1 -0
- package/lib/chunks/layout.BJjU9nKW.js +1 -0
- package/lib/chunks/layout.BO1q-dAZ.js +1 -0
- package/lib/chunks/layout.BQigNrr5.js +1 -0
- package/lib/chunks/layout.ClFtiz-t.js +1 -0
- package/lib/chunks/layout.CmDwUHZo.js +1 -0
- package/lib/chunks/layout.CqbDoD_v.js +1 -0
- package/lib/chunks/layout.CwJgDGuR.js +1 -0
- package/lib/chunks/utils.BT5Uuz2Q.js +1 -0
- package/lib/index.js +6 -6
- package/package.json +4 -4
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
|
|
2
|
+
import { Fragment, Transition, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, nextTick, normalizeClass, normalizeStyle, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
3
|
+
import { ElAutoResizer, ElIcon, ElTreeV2 } from "element-plus";
|
|
4
|
+
import { IconRenderer, iconLibraryMap } from "color-star-custom-components";
|
|
5
|
+
import '../assets/CustomSidebar.css';var _hoisted_1$4 = { class: "nav-title overflow-hidden" }, _hoisted_2$3 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "title-logo"
|
|
8
|
+
}, NavTitle_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "NavTitle" }, {
|
|
9
|
+
__name: "NavTitle",
|
|
10
|
+
props: {
|
|
11
|
+
title: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
logo: {
|
|
16
|
+
type: [Object, String],
|
|
17
|
+
default: null
|
|
18
|
+
},
|
|
19
|
+
logoSize: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 30
|
|
22
|
+
},
|
|
23
|
+
titleStyle: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: () => ({ fontSize: "16px" })
|
|
26
|
+
},
|
|
27
|
+
showToggle: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !0
|
|
30
|
+
},
|
|
31
|
+
toggleIcon: {
|
|
32
|
+
type: [Object, String],
|
|
33
|
+
default: null
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
emits: ["toggle"],
|
|
37
|
+
setup(a, { emit: P }) {
|
|
38
|
+
let F = P, z = () => {
|
|
39
|
+
F("toggle");
|
|
40
|
+
};
|
|
41
|
+
return (P, F) => (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
42
|
+
a.logo ? (openBlock(), createElementBlock("div", _hoisted_2$3, [createVNode(unref(ElIcon), { size: a.logoSize }, {
|
|
43
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(a.logo)))]),
|
|
44
|
+
_: 1
|
|
45
|
+
}, 8, ["size"])])) : createCommentVNode("", !0),
|
|
46
|
+
createElementVNode("span", {
|
|
47
|
+
class: "weight-500 text-1f2329 title-text",
|
|
48
|
+
style: normalizeStyle(a.titleStyle)
|
|
49
|
+
}, toDisplayString(a.title), 5),
|
|
50
|
+
a.showToggle ? (openBlock(), createBlock(unref(ElIcon), {
|
|
51
|
+
key: 1,
|
|
52
|
+
size: 20,
|
|
53
|
+
class: "collapse-unfold-icon",
|
|
54
|
+
onClick: z
|
|
55
|
+
}, {
|
|
56
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(a.toggleIcon)))]),
|
|
57
|
+
_: 1
|
|
58
|
+
})) : createCommentVNode("", !0)
|
|
59
|
+
]));
|
|
60
|
+
}
|
|
61
|
+
}), [["__scopeId", "data-v-56e35473"]]);
|
|
62
|
+
const MENU_TYPE = {
|
|
63
|
+
DIR: "DIR",
|
|
64
|
+
MENU: "MENU",
|
|
65
|
+
BUTTON: "BUTTON"
|
|
66
|
+
}, MENU_COLOR_STRATEGY = new Map([
|
|
67
|
+
["active", "#3271FE"],
|
|
68
|
+
["parent_active", "#3271FE"],
|
|
69
|
+
["normal", "#666666"]
|
|
70
|
+
]), isPathInMenu = (a, P) => !Array.isArray(a) || !P ? !1 : a.some((a) => a.path === P ? !0 : a.children?.length > 0 ? isPathInMenu(a.children, P) : !1), transformMenuData = (a, P = 1) => a.filter((a) => [MENU_TYPE.DIR, MENU_TYPE.MENU].includes(a.type)).map((a) => ({
|
|
71
|
+
...a,
|
|
72
|
+
id: a.bnid,
|
|
73
|
+
name: a.name,
|
|
74
|
+
path: a?.path || "",
|
|
75
|
+
children: a.children?.length > 0 ? transformMenuData(a.children || [], P + 1) : [],
|
|
76
|
+
level: P
|
|
77
|
+
})), isParentRouteActive = (a, P) => a?.children?.length ? a.children.some((a) => a?.path === P || a.children?.length && isParentRouteActive(a, P)) : !1, isParentMenuActive = (a, P) => a?.children?.length ? a.children.some((a) => a?.id === P || a.children?.length && isParentMenuActive(a, P)) : !1, getMenuIconColorById = (a, P) => {
|
|
78
|
+
let F = a?.id === P, I = isParentMenuActive(a, P), L = "normal";
|
|
79
|
+
return F ? L = "active" : I && (L = "parent_active"), MENU_COLOR_STRATEGY.get(L);
|
|
80
|
+
}, expandNodeKeys = (a, P) => a.includes(P) ? a : [...a, P], collapseNodeKeys = (a, P) => a.filter((a) => a !== P), findExpandPath = (a, P, F = []) => a.some((a) => {
|
|
81
|
+
if (a?.path === P) return !0;
|
|
82
|
+
if (a.children?.length > 0) {
|
|
83
|
+
F.push(a.id);
|
|
84
|
+
let I = findExpandPath(a.children, P, F);
|
|
85
|
+
return !I && F.pop(), I;
|
|
86
|
+
}
|
|
87
|
+
return !1;
|
|
88
|
+
}), findExpandPathById = (a, P, F = []) => a.some((a) => {
|
|
89
|
+
if (a?.id === P) return !0;
|
|
90
|
+
if (a.children?.length > 0) {
|
|
91
|
+
F.push(a.id);
|
|
92
|
+
let I = findExpandPathById(a.children, P, F);
|
|
93
|
+
return !I && F.pop(), I;
|
|
94
|
+
}
|
|
95
|
+
return !1;
|
|
96
|
+
}), getParentNodeIdsById = (a, P) => {
|
|
97
|
+
let F = [];
|
|
98
|
+
return findExpandPathById(a, P, F), F;
|
|
99
|
+
}, findMenuByPath = (a, P) => {
|
|
100
|
+
if (!Array.isArray(a) || !P) return null;
|
|
101
|
+
for (let F of a) {
|
|
102
|
+
if (F.path === P) return F;
|
|
103
|
+
if (F.children?.length > 0) {
|
|
104
|
+
let a = findMenuByPath(F.children, P);
|
|
105
|
+
if (a) return a;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}, processMenuTreeWithLeaf = (a) => Array.isArray(a) ? a.map((a) => {
|
|
110
|
+
let P = { ...a };
|
|
111
|
+
return P.children && Array.isArray(P.children) && P.children.length > 0 ? P.children = processMenuTreeWithLeaf(P.children) : P.isLeaf = !0, P;
|
|
112
|
+
}) : [], getFirstLeafMenu = (a) => {
|
|
113
|
+
if (!Array.isArray(a) || a.length === 0) return null;
|
|
114
|
+
for (let P of a) {
|
|
115
|
+
if (P.isLeaf && P.path) return P;
|
|
116
|
+
if (P.children?.length > 0) {
|
|
117
|
+
let a = getFirstLeafMenu(P.children);
|
|
118
|
+
if (a) return a;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}, SPECIAL_ROUTES = [
|
|
123
|
+
"/404",
|
|
124
|
+
"/login",
|
|
125
|
+
"/unauthorized"
|
|
126
|
+
], TREE_PROPS = {
|
|
127
|
+
label: "name",
|
|
128
|
+
children: "children",
|
|
129
|
+
isLeaf: "isLeaf"
|
|
130
|
+
}, NODE_CLICK_TYPES = {
|
|
131
|
+
PARENT: "parent",
|
|
132
|
+
LEAF: "leaf"
|
|
133
|
+
}, MENU_LOADING_STATES = {
|
|
134
|
+
IDLE: "idle",
|
|
135
|
+
LOADING: "loading",
|
|
136
|
+
LOADED: "loaded",
|
|
137
|
+
ERROR: "error"
|
|
138
|
+
};
|
|
139
|
+
var _hoisted_1$3 = { class: "node-label" }, _hoisted_2$2 = ["onClick"], MenuList_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "MenuList" }, {
|
|
140
|
+
__name: "MenuList",
|
|
141
|
+
props: {
|
|
142
|
+
menuData: {
|
|
143
|
+
type: Array,
|
|
144
|
+
default: () => []
|
|
145
|
+
},
|
|
146
|
+
currentMenuId: {
|
|
147
|
+
type: String,
|
|
148
|
+
default: null
|
|
149
|
+
},
|
|
150
|
+
expandedKeys: {
|
|
151
|
+
type: Array,
|
|
152
|
+
default: () => []
|
|
153
|
+
},
|
|
154
|
+
treeProps: {
|
|
155
|
+
type: Object,
|
|
156
|
+
default: () => TREE_PROPS
|
|
157
|
+
},
|
|
158
|
+
itemHeight: {
|
|
159
|
+
type: Number,
|
|
160
|
+
default: 36
|
|
161
|
+
},
|
|
162
|
+
indent: {
|
|
163
|
+
type: Number,
|
|
164
|
+
default: 24
|
|
165
|
+
},
|
|
166
|
+
iconSize: {
|
|
167
|
+
type: Number,
|
|
168
|
+
default: 16
|
|
169
|
+
},
|
|
170
|
+
expandedIcon: {
|
|
171
|
+
type: [Object, String],
|
|
172
|
+
default: null
|
|
173
|
+
},
|
|
174
|
+
collapsedIcon: {
|
|
175
|
+
type: [Object, String],
|
|
176
|
+
default: null
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
emits: [
|
|
180
|
+
"node-click",
|
|
181
|
+
"node-expand",
|
|
182
|
+
"node-collapse"
|
|
183
|
+
],
|
|
184
|
+
setup(a, { emit: P }) {
|
|
185
|
+
let F = a, V = P, U = ref(null), K = (a) => a?.icon && a.level === 1 || !a.isLeaf, J = (a) => getMenuIconColorById(a, F.currentMenuId), X = (a) => {
|
|
186
|
+
V("node-click", a, a.isLeaf ? NODE_CLICK_TYPES.LEAF : NODE_CLICK_TYPES.PARENT);
|
|
187
|
+
}, Z = (a) => {
|
|
188
|
+
V("node-expand", a.id, a);
|
|
189
|
+
}, Q = (a) => {
|
|
190
|
+
V("node-collapse", a.id, a);
|
|
191
|
+
}, $ = (a) => {
|
|
192
|
+
U.value && (F.expandedKeys.includes(a.data.id) ? U.value.collapseNode(a) : U.value.expandNode(a));
|
|
193
|
+
};
|
|
194
|
+
return watch(() => F.expandedKeys, (a) => {
|
|
195
|
+
nextTick(() => {
|
|
196
|
+
U.value && U.value.setExpandedKeys([...a]);
|
|
197
|
+
});
|
|
198
|
+
}, { deep: !0 }), (P, F) => (openBlock(), createBlock(unref(ElAutoResizer), { class: "flex-1 overflow-hidden" }, {
|
|
199
|
+
default: withCtx(({ height: P }) => [createVNode(unref(ElTreeV2), {
|
|
200
|
+
ref_key: "treeRef",
|
|
201
|
+
ref: U,
|
|
202
|
+
"node-key": "id",
|
|
203
|
+
data: a.menuData,
|
|
204
|
+
props: a.treeProps,
|
|
205
|
+
height: P,
|
|
206
|
+
"current-node-key": a.currentMenuId,
|
|
207
|
+
"highlight-current": !0,
|
|
208
|
+
"expanded-keys": a.expandedKeys,
|
|
209
|
+
"show-checkbox": !1,
|
|
210
|
+
"item-size": a.itemHeight,
|
|
211
|
+
"expand-on-click-node": !1,
|
|
212
|
+
indent: a.indent,
|
|
213
|
+
onNodeClick: X,
|
|
214
|
+
onNodeExpand: Z,
|
|
215
|
+
onNodeCollapse: Q,
|
|
216
|
+
class: "custom-tree"
|
|
217
|
+
}, {
|
|
218
|
+
default: withCtx(({ node: P, data: F }) => [createElementVNode("div", { class: normalizeClass(["tree-node-content-custom", {
|
|
219
|
+
"has-children": !F.isLeaf,
|
|
220
|
+
"is-current": F.id === a.currentMenuId && F.isLeaf,
|
|
221
|
+
"is-parent-active": unref(isParentMenuActive)(F, a.currentMenuId) && !F.isLeaf
|
|
222
|
+
}]) }, [
|
|
223
|
+
K(F) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
224
|
+
key: 0,
|
|
225
|
+
size: a.iconSize,
|
|
226
|
+
class: "node-icon",
|
|
227
|
+
color: J(F)
|
|
228
|
+
}, {
|
|
229
|
+
default: withCtx(() => [createVNode(unref(IconRenderer), {
|
|
230
|
+
"icon-name": F?.icon,
|
|
231
|
+
"icon-library": unref(iconLibraryMap).aibox
|
|
232
|
+
}, null, 8, ["icon-name", "icon-library"])]),
|
|
233
|
+
_: 2
|
|
234
|
+
}, 1032, ["size", "color"])) : createCommentVNode("", !0),
|
|
235
|
+
createElementVNode("span", _hoisted_1$3, toDisplayString(P.label), 1),
|
|
236
|
+
F.isLeaf ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
237
|
+
key: 1,
|
|
238
|
+
class: "expand-arrow",
|
|
239
|
+
onClick: withModifiers((a) => $(P), ["stop"])
|
|
240
|
+
}, [createVNode(unref(ElIcon), {
|
|
241
|
+
size: a.iconSize,
|
|
242
|
+
color: J(F)
|
|
243
|
+
}, {
|
|
244
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(a.expandedKeys.includes(F.id) ? a.expandedIcon : a.collapsedIcon)))]),
|
|
245
|
+
_: 2
|
|
246
|
+
}, 1032, ["size", "color"])], 8, _hoisted_2$2))
|
|
247
|
+
], 2)]),
|
|
248
|
+
_: 1
|
|
249
|
+
}, 8, [
|
|
250
|
+
"data",
|
|
251
|
+
"props",
|
|
252
|
+
"height",
|
|
253
|
+
"current-node-key",
|
|
254
|
+
"expanded-keys",
|
|
255
|
+
"item-size",
|
|
256
|
+
"indent"
|
|
257
|
+
])]),
|
|
258
|
+
_: 1
|
|
259
|
+
}));
|
|
260
|
+
}
|
|
261
|
+
}), [["__scopeId", "data-v-0a105c70"]]), _hoisted_1$2 = { class: "user-popup-content" }, _hoisted_2$1 = ["onClick"], UserPopup_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "UserPopup" }, {
|
|
262
|
+
__name: "UserPopup",
|
|
263
|
+
props: { actions: {
|
|
264
|
+
type: Array,
|
|
265
|
+
default: () => [],
|
|
266
|
+
validator: (a) => a.every((a) => a.key && (a.icon || a.iconName))
|
|
267
|
+
} },
|
|
268
|
+
emits: ["action-click"],
|
|
269
|
+
setup(a, { emit: F }) {
|
|
270
|
+
let z = F, B = (a) => {
|
|
271
|
+
z("action-click", a.key, a);
|
|
272
|
+
};
|
|
273
|
+
return (F, z) => (openBlock(), createElementBlock("div", _hoisted_1$2, [(openBlock(!0), createElementBlock(Fragment, null, renderList(a.actions, (a, F) => (openBlock(), createElementBlock(Fragment, { key: F }, [a.hidden ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
274
|
+
key: 0,
|
|
275
|
+
class: "list__item",
|
|
276
|
+
onClick: (P) => B(a)
|
|
277
|
+
}, [createVNode(unref(ElIcon), {
|
|
278
|
+
class: "list__item-icon",
|
|
279
|
+
size: a.iconSize || 20,
|
|
280
|
+
color: "#262626"
|
|
281
|
+
}, {
|
|
282
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(a.icon)))]),
|
|
283
|
+
_: 2
|
|
284
|
+
}, 1032, ["size"]), createElementVNode("span", null, toDisplayString(a.label), 1)], 8, _hoisted_2$1))], 64))), 128))]));
|
|
285
|
+
}
|
|
286
|
+
}), [["__scopeId", "data-v-70783670"]]), _hoisted_1$1 = { class: "navbar-box__footer__left" }, _hoisted_2 = { class: "name-first" }, _hoisted_3 = { class: "name-text" }, _hoisted_4 = { class: "user-id" }, NavFooter_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "NavFooter" }, {
|
|
287
|
+
__name: "NavFooter",
|
|
288
|
+
props: {
|
|
289
|
+
userInfo: {
|
|
290
|
+
type: Object,
|
|
291
|
+
default: null,
|
|
292
|
+
validator: (a) => a ? a.name !== void 0 : !0
|
|
293
|
+
},
|
|
294
|
+
actions: {
|
|
295
|
+
type: Array,
|
|
296
|
+
default: () => []
|
|
297
|
+
},
|
|
298
|
+
popupDelay: {
|
|
299
|
+
type: Number,
|
|
300
|
+
default: 200
|
|
301
|
+
},
|
|
302
|
+
popupLeft: {
|
|
303
|
+
type: Number,
|
|
304
|
+
default: 240
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
emits: ["action-click"],
|
|
308
|
+
setup(a, { emit: I }) {
|
|
309
|
+
let z = a, B = I, U = ref(null), W = ref(!1), G = (a) => a && a[0] ? a[0] : "", q = (a) => {
|
|
310
|
+
a || (U.value = setTimeout(() => {
|
|
311
|
+
W.value = !1;
|
|
312
|
+
}, z.popupDelay)), a && (W.value = a, clearTimeout(U.value));
|
|
313
|
+
}, Y = (a, P) => {
|
|
314
|
+
W.value = !1, B("action-click", a, P);
|
|
315
|
+
};
|
|
316
|
+
return (I, z) => (openBlock(), createElementBlock(Fragment, null, [a.userInfo ? (openBlock(), createElementBlock("div", {
|
|
317
|
+
key: 0,
|
|
318
|
+
class: "navbar-box__footer",
|
|
319
|
+
onMouseenter: z[0] ||= (a) => q(!0),
|
|
320
|
+
onMouseleave: z[1] ||= (a) => q(!1)
|
|
321
|
+
}, [createElementVNode("div", _hoisted_1$1, [createElementVNode("div", _hoisted_2, toDisplayString(G(a.userInfo?.name)), 1), createElementVNode("div", null, [createElementVNode("div", _hoisted_3, toDisplayString(a.userInfo?.name), 1), createElementVNode("div", _hoisted_4, toDisplayString(a.userInfo?.bnid || a.userInfo?.id || ""), 1)])])], 32)) : createCommentVNode("", !0), createVNode(Transition, { name: "fade" }, {
|
|
322
|
+
default: withCtx(() => [withDirectives(createElementVNode("div", {
|
|
323
|
+
class: "footer-popup content-bg",
|
|
324
|
+
style: normalizeStyle({ left: a.popupLeft + "px" }),
|
|
325
|
+
onMouseenter: z[2] ||= (a) => q(!0),
|
|
326
|
+
onMouseleave: z[3] ||= (a) => q(!1)
|
|
327
|
+
}, [createVNode(UserPopup_default, {
|
|
328
|
+
actions: a.actions,
|
|
329
|
+
onActionClick: Y
|
|
330
|
+
}, null, 8, ["actions"])], 36), [[vShow, W.value]])]),
|
|
331
|
+
_: 1
|
|
332
|
+
})], 64));
|
|
333
|
+
}
|
|
334
|
+
}), [["__scopeId", "data-v-d1e53517"]]), _hoisted_1 = { class: "sidebar h-full pd-l-12 pd-r-12 flex flex-col overflow-hidden" }, layout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "CustomSidebar" }, {
|
|
335
|
+
__name: "layout",
|
|
336
|
+
props: {
|
|
337
|
+
menuData: {
|
|
338
|
+
type: Array,
|
|
339
|
+
default: () => []
|
|
340
|
+
},
|
|
341
|
+
currentMenuId: {
|
|
342
|
+
type: String,
|
|
343
|
+
default: null
|
|
344
|
+
},
|
|
345
|
+
expandedKeys: {
|
|
346
|
+
type: Array,
|
|
347
|
+
default: () => []
|
|
348
|
+
},
|
|
349
|
+
title: {
|
|
350
|
+
type: String,
|
|
351
|
+
default: ""
|
|
352
|
+
},
|
|
353
|
+
logo: {
|
|
354
|
+
type: [Object, String],
|
|
355
|
+
default: null
|
|
356
|
+
},
|
|
357
|
+
logoSize: {
|
|
358
|
+
type: Number,
|
|
359
|
+
default: 30
|
|
360
|
+
},
|
|
361
|
+
showToggle: {
|
|
362
|
+
type: Boolean,
|
|
363
|
+
default: !0
|
|
364
|
+
},
|
|
365
|
+
toggleIcon: {
|
|
366
|
+
type: [Object, String],
|
|
367
|
+
default: null
|
|
368
|
+
},
|
|
369
|
+
treeProps: {
|
|
370
|
+
type: Object,
|
|
371
|
+
default: () => TREE_PROPS
|
|
372
|
+
},
|
|
373
|
+
itemHeight: {
|
|
374
|
+
type: Number,
|
|
375
|
+
default: 36
|
|
376
|
+
},
|
|
377
|
+
indent: {
|
|
378
|
+
type: Number,
|
|
379
|
+
default: 24
|
|
380
|
+
},
|
|
381
|
+
iconSize: {
|
|
382
|
+
type: Number,
|
|
383
|
+
default: 16
|
|
384
|
+
},
|
|
385
|
+
titleStyle: {
|
|
386
|
+
type: Object,
|
|
387
|
+
default: () => ({ fontSize: "16px" })
|
|
388
|
+
},
|
|
389
|
+
expandedIcon: {
|
|
390
|
+
type: [Object, String],
|
|
391
|
+
default: null
|
|
392
|
+
},
|
|
393
|
+
collapsedIcon: {
|
|
394
|
+
type: [Object, String],
|
|
395
|
+
default: null
|
|
396
|
+
},
|
|
397
|
+
iconRenderer: {
|
|
398
|
+
type: [Object, String],
|
|
399
|
+
default: null
|
|
400
|
+
},
|
|
401
|
+
iconLibrary: {
|
|
402
|
+
type: [String, Object],
|
|
403
|
+
default: null
|
|
404
|
+
},
|
|
405
|
+
showFooter: {
|
|
406
|
+
type: Boolean,
|
|
407
|
+
default: !0
|
|
408
|
+
},
|
|
409
|
+
userInfo: {
|
|
410
|
+
type: Object,
|
|
411
|
+
default: null
|
|
412
|
+
},
|
|
413
|
+
userActions: {
|
|
414
|
+
type: Array,
|
|
415
|
+
default: () => []
|
|
416
|
+
},
|
|
417
|
+
popupDelay: {
|
|
418
|
+
type: Number,
|
|
419
|
+
default: 200
|
|
420
|
+
},
|
|
421
|
+
popupLeft: {
|
|
422
|
+
type: Number,
|
|
423
|
+
default: 240
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
emits: [
|
|
427
|
+
"toggle",
|
|
428
|
+
"node-click",
|
|
429
|
+
"node-expand",
|
|
430
|
+
"node-collapse",
|
|
431
|
+
"user-action-click"
|
|
432
|
+
],
|
|
433
|
+
setup(a, { emit: P }) {
|
|
434
|
+
let F = P, R = () => {
|
|
435
|
+
F("toggle");
|
|
436
|
+
}, z = (a, P) => {
|
|
437
|
+
F("node-click", a, P);
|
|
438
|
+
}, B = (a, P) => {
|
|
439
|
+
F("node-expand", a, P);
|
|
440
|
+
}, V = (a, P) => {
|
|
441
|
+
F("node-collapse", a, P);
|
|
442
|
+
}, H = (a, P) => {
|
|
443
|
+
F("user-action-click", a, P);
|
|
444
|
+
};
|
|
445
|
+
return (P, F) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
446
|
+
createVNode(NavTitle_default, {
|
|
447
|
+
"title-style": a.titleStyle,
|
|
448
|
+
title: a.title,
|
|
449
|
+
logo: a.logo,
|
|
450
|
+
"logo-size": a.logoSize,
|
|
451
|
+
"show-toggle": a.showToggle,
|
|
452
|
+
"toggle-icon": a.toggleIcon,
|
|
453
|
+
onToggle: R
|
|
454
|
+
}, null, 8, [
|
|
455
|
+
"title-style",
|
|
456
|
+
"title",
|
|
457
|
+
"logo",
|
|
458
|
+
"logo-size",
|
|
459
|
+
"show-toggle",
|
|
460
|
+
"toggle-icon"
|
|
461
|
+
]),
|
|
462
|
+
createVNode(MenuList_default, {
|
|
463
|
+
"menu-data": a.menuData,
|
|
464
|
+
"current-menu-id": a.currentMenuId,
|
|
465
|
+
"expanded-keys": a.expandedKeys,
|
|
466
|
+
"tree-props": a.treeProps,
|
|
467
|
+
"item-height": a.itemHeight,
|
|
468
|
+
indent: a.indent,
|
|
469
|
+
"icon-size": a.iconSize,
|
|
470
|
+
"expanded-icon": a.expandedIcon,
|
|
471
|
+
"collapsed-icon": a.collapsedIcon,
|
|
472
|
+
"icon-renderer": a.iconRenderer,
|
|
473
|
+
"icon-library": a.iconLibrary,
|
|
474
|
+
onNodeClick: z,
|
|
475
|
+
onNodeExpand: B,
|
|
476
|
+
onNodeCollapse: V
|
|
477
|
+
}, null, 8, [
|
|
478
|
+
"menu-data",
|
|
479
|
+
"current-menu-id",
|
|
480
|
+
"expanded-keys",
|
|
481
|
+
"tree-props",
|
|
482
|
+
"item-height",
|
|
483
|
+
"indent",
|
|
484
|
+
"icon-size",
|
|
485
|
+
"expanded-icon",
|
|
486
|
+
"collapsed-icon",
|
|
487
|
+
"icon-renderer",
|
|
488
|
+
"icon-library"
|
|
489
|
+
]),
|
|
490
|
+
a.showFooter ? (openBlock(), createBlock(NavFooter_default, {
|
|
491
|
+
key: 0,
|
|
492
|
+
"popup-left": a.popupLeft,
|
|
493
|
+
"user-info": a.userInfo,
|
|
494
|
+
actions: a.userActions,
|
|
495
|
+
"popup-delay": a.popupDelay,
|
|
496
|
+
onActionClick: H
|
|
497
|
+
}, null, 8, [
|
|
498
|
+
"popup-left",
|
|
499
|
+
"user-info",
|
|
500
|
+
"actions",
|
|
501
|
+
"popup-delay"
|
|
502
|
+
])) : createCommentVNode("", !0)
|
|
503
|
+
]));
|
|
504
|
+
}
|
|
505
|
+
}), [["__scopeId", "data-v-736b2e19"]]);
|
|
506
|
+
export { isParentRouteActive as _, TREE_PROPS as a, transformMenuData as b, collapseNodeKeys as c, findExpandPathById as d, findMenuByPath as f, isParentMenuActive as g, getParentNodeIdsById as h, SPECIAL_ROUTES as i, expandNodeKeys as l, getMenuIconColorById as m, MENU_LOADING_STATES as n, MENU_COLOR_STRATEGY as o, getFirstLeafMenu as p, NODE_CLICK_TYPES as r, MENU_TYPE as s, layout_default as t, findExpandPath as u, isPathInMenu as v, processMenuTreeWithLeaf as y };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { t as withInstall } from "./utils.BhlZXNZ6.js";
|
|
2
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, nextTick, normalizeClass, normalizeStyle, openBlock, ref, renderList, toDisplayString, unref, watch, withCtx } from "vue";
|
|
4
|
+
import { ElDropdown, ElDropdownItem, ElDropdownMenu, ElIcon } from "element-plus";
|
|
5
|
+
import { emitsMap } from "color-star-custom-methods";
|
|
6
|
+
import { IconZuoCopy } from "color-message-aibox-vue";
|
|
7
|
+
import '../assets/CustomToggle.css';var _hoisted_1 = { class: "toggle-container flex w-full relative" }, _hoisted_2 = [
|
|
8
|
+
"id",
|
|
9
|
+
"data-option-value",
|
|
10
|
+
"onClick"
|
|
11
|
+
], _hoisted_3 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "order-number fz-12 text-center mg-r-10 pd-l-8 pd-r-8"
|
|
14
|
+
}, _hoisted_4 = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "divider"
|
|
17
|
+
}, _hoisted_5 = { class: "toggle-item toggle-action flex items-center justify-center weight-500" }, _hoisted_6 = { class: "dropdown-label" };
|
|
18
|
+
const CustomToggle = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "CustomToggle" }, {
|
|
19
|
+
__name: "layout",
|
|
20
|
+
props: {
|
|
21
|
+
options: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: [
|
|
27
|
+
String,
|
|
28
|
+
Number,
|
|
29
|
+
Object
|
|
30
|
+
],
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
maxVisible: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
fieldMapping: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: () => ({
|
|
40
|
+
value: "value",
|
|
41
|
+
label: "label"
|
|
42
|
+
})
|
|
43
|
+
},
|
|
44
|
+
showOrderNumber: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
emits: [emitsMap.updateModelValue, emitsMap.change],
|
|
50
|
+
setup(i, { emit: k }) {
|
|
51
|
+
let M = i, N = k, P = ref(null), F = [], I = computed(() => M.maxVisible === void 0 ? M.options.length : M.maxVisible), L = computed(() => B.value.length > 0);
|
|
52
|
+
computed(() => B.value.length);
|
|
53
|
+
let R = computed(() => {
|
|
54
|
+
if (!M.modelValue || M.options.length <= I.value) {
|
|
55
|
+
let i = M.options.slice(0, I.value);
|
|
56
|
+
return F = i, i;
|
|
57
|
+
}
|
|
58
|
+
let i = M.options.findIndex((i, k) => V(i, k) === M.modelValue);
|
|
59
|
+
if (i === -1) {
|
|
60
|
+
let i = M.options.slice(0, I.value);
|
|
61
|
+
return F = i, i;
|
|
62
|
+
}
|
|
63
|
+
if (F.map((i, k) => V(i, k)).includes(M.modelValue) && F.length > 0) return F;
|
|
64
|
+
let k = Math.max(0, i - I.value + 1), A = Math.min(M.options.length, k + I.value), j = M.options.slice(k, A);
|
|
65
|
+
return F = j, j;
|
|
66
|
+
}), z = computed(() => `${100 / I.value}%`), B = computed(() => {
|
|
67
|
+
let i = new Set(R.value.map((i, k) => V(i, k)));
|
|
68
|
+
return M.options.filter((k, A) => {
|
|
69
|
+
let j = V(k, A);
|
|
70
|
+
return !i.has(j);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
computed(() => M.options.slice(0, I.value));
|
|
74
|
+
let V = (i, k) => {
|
|
75
|
+
if (typeof i == "object" && i) {
|
|
76
|
+
let A = M.fieldMapping.value;
|
|
77
|
+
return i[A] === void 0 ? k : i[A];
|
|
78
|
+
}
|
|
79
|
+
return i;
|
|
80
|
+
}, H = (i) => {
|
|
81
|
+
if (typeof i == "object" && i) {
|
|
82
|
+
let k = M.fieldMapping.label, A = M.fieldMapping.value;
|
|
83
|
+
return i[k] || i[A] || i;
|
|
84
|
+
}
|
|
85
|
+
return i;
|
|
86
|
+
}, U = (i, k) => {
|
|
87
|
+
let A = V(i, k);
|
|
88
|
+
return M.options.findIndex((i, k) => V(i, k) === A) + 1;
|
|
89
|
+
}, W = (i, k) => V(i, k) === M.modelValue, G = (i, k) => {
|
|
90
|
+
if (k >= R.value.length - 1 || W(i, k)) return !1;
|
|
91
|
+
let A = R.value.findIndex((i, k) => W(i, k));
|
|
92
|
+
return !(A === -1 || k === A - 1);
|
|
93
|
+
}, K = (i, k) => {
|
|
94
|
+
Y(V(i, k));
|
|
95
|
+
}, q = (i) => {
|
|
96
|
+
Y(i), setTimeout(() => {
|
|
97
|
+
J(i);
|
|
98
|
+
}, 50);
|
|
99
|
+
}, J = (i) => {
|
|
100
|
+
let k = `toggle-option-${i}`, A = document.getElementById(k);
|
|
101
|
+
A && A.scrollIntoView({
|
|
102
|
+
behavior: "smooth",
|
|
103
|
+
block: "nearest",
|
|
104
|
+
inline: "center"
|
|
105
|
+
});
|
|
106
|
+
}, Y = (i) => {
|
|
107
|
+
N(emitsMap.updateModelValue, i), nextTick(() => {
|
|
108
|
+
N(emitsMap.change, i);
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
return watch(() => M.options, (i) => {
|
|
112
|
+
if (i && i.length > 0 && M.modelValue === null) {
|
|
113
|
+
let k = i[0];
|
|
114
|
+
Y(V(k, 0));
|
|
115
|
+
}
|
|
116
|
+
}, { immediate: !0 }), watch(() => M.modelValue, (i) => {
|
|
117
|
+
if (i === null && M.options.length > 0) {
|
|
118
|
+
let i = M.options?.[0];
|
|
119
|
+
Y(V(i, 0));
|
|
120
|
+
}
|
|
121
|
+
}), (i, k) => (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
122
|
+
ref_key: "optionsContainer",
|
|
123
|
+
ref: P,
|
|
124
|
+
class: "visible-options flex-1 overflow-x-auto overflow-y-hidden relative flex"
|
|
125
|
+
}, [(openBlock(!0), createElementBlock(Fragment, null, renderList(R.value, (i, k) => (openBlock(), createElementBlock("div", {
|
|
126
|
+
key: V(i, k),
|
|
127
|
+
id: `toggle-option-${V(i, k)}`,
|
|
128
|
+
"data-option-value": V(i, k),
|
|
129
|
+
class: normalizeClass(["toggle-item pointer text-center flex items-center justify-center ellipsis-1 relative pointer", {
|
|
130
|
+
active: W(i, k),
|
|
131
|
+
"first-active": W(i, k) && k === 0,
|
|
132
|
+
"last-active": W(i, k) && k === R.value.length - 1
|
|
133
|
+
}]),
|
|
134
|
+
style: normalizeStyle({ width: z.value }),
|
|
135
|
+
onClick: (A) => K(i, k)
|
|
136
|
+
}, [
|
|
137
|
+
M.showOrderNumber ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(U(i, k)), 1)) : createCommentVNode("", !0),
|
|
138
|
+
createTextVNode(" " + toDisplayString(H(i)) + " ", 1),
|
|
139
|
+
G(i, k) ? (openBlock(), createElementBlock("span", _hoisted_4, "|")) : createCommentVNode("", !0)
|
|
140
|
+
], 14, _hoisted_2))), 128))], 512), L.value ? (openBlock(), createBlock(unref(ElDropdown), {
|
|
141
|
+
key: 0,
|
|
142
|
+
trigger: "click",
|
|
143
|
+
onCommand: q
|
|
144
|
+
}, {
|
|
145
|
+
dropdown: withCtx(() => [createVNode(unref(ElDropdownMenu), null, {
|
|
146
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(B.value, (i, k) => (openBlock(), createBlock(unref(ElDropdownItem), {
|
|
147
|
+
key: V(i, k),
|
|
148
|
+
command: V(i, k),
|
|
149
|
+
class: normalizeClass({ "is-active": W(i, k) })
|
|
150
|
+
}, {
|
|
151
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_6, toDisplayString(H(i)), 1)]),
|
|
152
|
+
_: 2
|
|
153
|
+
}, 1032, ["command", "class"]))), 128))]),
|
|
154
|
+
_: 1
|
|
155
|
+
})]),
|
|
156
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_5, [createVNode(unref(ElIcon), null, {
|
|
157
|
+
default: withCtx(() => [createVNode(unref(IconZuoCopy))]),
|
|
158
|
+
_: 1
|
|
159
|
+
})])]),
|
|
160
|
+
_: 1
|
|
161
|
+
})) : createCommentVNode("", !0)]));
|
|
162
|
+
}
|
|
163
|
+
}), [["__scopeId", "data-v-ecd737a7"]]));
|
|
164
|
+
var CustomToggle_default = CustomToggle;
|
|
165
|
+
export { CustomToggle_default as n, CustomToggle as t };
|