@ithinkdt/ui 4.0.6 → 4.0.7
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/components.js +6 -6
- package/dist/index.js +42 -41
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -6,9 +6,9 @@ import { Fragment as w, computed as T, createTextVNode as E, createVNode as D, d
|
|
|
6
6
|
import { until as se } from "@vueuse/core";
|
|
7
7
|
import { NAnchor as ce, NAnchorLink as le, NAvatar as R, NAvatarGroup as ue, NButton as z, NCard as de, NCheckbox as B, NCheckboxGroup as fe, NDropdown as V, NEllipsis as pe, NEmpty as me, NFlex as H, NForm as he, NFormItem as ge, NGi as U, NGrid as _e, NIcon as W, NInput as ve, NList as ye, NListItem as be, NPagination as xe, NPopover as Se, NRadio as Ce, NRadioButton as we, NRadioGroup as Te, NSelect as Ee, NSpin as De, NTag as Oe, NText as ke, NTooltip as Ae, NTransfer as je, NTree as Me, NTreeSelect as Ne, formProps as Pe, useDialog as Fe } from "ithinkdt-ui";
|
|
8
8
|
import { nanoid as Ie } from "nanoid";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { isNullish as Le, pickProps as G } from "@ithinkdt/common/object";
|
|
10
|
+
import { VOverflow as Re, VResizeObserver as ze } from "vueuc";
|
|
11
|
+
import { Sortable as Be } from "sortablejs/modular/sortable.core.esm.js";
|
|
12
12
|
import { useFormItem as Ve } from "ithinkdt-ui/es/_mixins";
|
|
13
13
|
import { measureText as He } from "@ithinkdt/common/string";
|
|
14
14
|
import { useFormModal as Ue } from "@ithinkdt/page";
|
|
@@ -130,7 +130,7 @@ const qe = k({
|
|
|
130
130
|
}, { default: () => [e.text] }), p = (e, t) => {
|
|
131
131
|
t.onClick?.();
|
|
132
132
|
};
|
|
133
|
-
return () => D(
|
|
133
|
+
return () => D(ze, { onResize: r }, { default: () => [D(Re, {
|
|
134
134
|
ref: t,
|
|
135
135
|
getCounter: a,
|
|
136
136
|
onUpdateCount: s,
|
|
@@ -264,7 +264,7 @@ const Xe = k({
|
|
|
264
264
|
}
|
|
265
265
|
let o = F();
|
|
266
266
|
return L(o, (e) => {
|
|
267
|
-
e.$el &&
|
|
267
|
+
e.$el && Be.create(e.$el, {
|
|
268
268
|
animation: 150,
|
|
269
269
|
ghostClass: "ghost",
|
|
270
270
|
handle: ".icon-drag",
|
|
@@ -371,7 +371,7 @@ const tt = k({
|
|
|
371
371
|
affix: !0
|
|
372
372
|
}, e.anchor && typeof e.anchor == "object" ? e.anchor : {}));
|
|
373
373
|
return () => {
|
|
374
|
-
let t, { cols: n, title: i, data: a, items: c, anchor: l } = e, u =
|
|
374
|
+
let t, { cols: n, title: i, data: a, items: c, anchor: l } = e, u = Le(i) ? void 0 : D("div", { class: `${r}__header` }, [typeof i == "string" ? D("span", null, [i]) : i(a ?? void 0)]), d = c.filter((e) => !e.hiddden).map((e) => et(e, n, a, r)), f = l === !1 ? void 0 : D(ce, s.value, Ze(t = c.map((e) => A(Qe(e, a), { key: e.prop }))) ? t : { default: () => [t] });
|
|
375
375
|
return D("div", {
|
|
376
376
|
class: r,
|
|
377
377
|
style: o.value
|
package/dist/index.js
CHANGED
|
@@ -7,12 +7,13 @@ import { NAvatar as A, NBadge as oe, NBreadcrumb as se, NBreadcrumbItem as ce, N
|
|
|
7
7
|
import { useAtomicBroadcast as ue } from "@ithinkdt/common/composables";
|
|
8
8
|
import { RouterLink as de, useRouter as G } from "vue-router";
|
|
9
9
|
import { walkTree as fe } from "@ithinkdt/common/tree";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { isNullish as pe } from "@ithinkdt/common/object";
|
|
11
|
+
import { getOpaqueColor as me } from "@ithinkdt/common/color";
|
|
12
|
+
import { format as he } from "date-fns";
|
|
12
13
|
function K(e) {
|
|
13
14
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
14
15
|
}
|
|
15
|
-
const
|
|
16
|
+
const ge = m({
|
|
16
17
|
name: "AppAccount",
|
|
17
18
|
props: {
|
|
18
19
|
username: String,
|
|
@@ -115,7 +116,7 @@ const he = m({
|
|
|
115
116
|
]]) : void 0
|
|
116
117
|
]);
|
|
117
118
|
}
|
|
118
|
-
}),
|
|
119
|
+
}), _e = m({
|
|
119
120
|
name: "AppAppearance",
|
|
120
121
|
props: { mode: String },
|
|
121
122
|
emit: ["update:mode"],
|
|
@@ -175,10 +176,10 @@ const he = m({
|
|
|
175
176
|
fill: "currentColor",
|
|
176
177
|
d: "m17 18l-5-2.18L7 18V5h10m0-2H7a2 2 0 0 0-2 2v16l7-3l7 3V5a2 2 0 0 0-2-2Z"
|
|
177
178
|
}, null)]), Y = "__APP_CTX__", X = () => h(Y);
|
|
178
|
-
function
|
|
179
|
+
function ve(e) {
|
|
179
180
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
180
181
|
}
|
|
181
|
-
const
|
|
182
|
+
const ye = m({
|
|
182
183
|
name: "AppBreadcrumb",
|
|
183
184
|
props: {
|
|
184
185
|
items: {
|
|
@@ -198,7 +199,7 @@ const ve = m({
|
|
|
198
199
|
});
|
|
199
200
|
}, { immediate: !0 }), () => {
|
|
200
201
|
let n;
|
|
201
|
-
return p(se, null,
|
|
202
|
+
return p(se, null, ve(n = e.items.map((e) => p(ce, {
|
|
202
203
|
clickable: e.href?.length > 0,
|
|
203
204
|
separator: e.separator,
|
|
204
205
|
onClick: e.href && ((n) => {
|
|
@@ -207,7 +208,7 @@ const ve = m({
|
|
|
207
208
|
}, { default: () => [e.icon ? p(d, null, [p(F, { component: e[r] }, null), " "]) : void 0, C(e.title)] }))) ? n : { default: () => [n] });
|
|
208
209
|
};
|
|
209
210
|
}
|
|
210
|
-
}),
|
|
211
|
+
}), be = m({
|
|
211
212
|
name: "AppFullscreen",
|
|
212
213
|
props: {},
|
|
213
214
|
emit: ["change"],
|
|
@@ -250,7 +251,7 @@ const ve = m({
|
|
|
250
251
|
{ bottom: !0 }
|
|
251
252
|
]]);
|
|
252
253
|
}
|
|
253
|
-
}),
|
|
254
|
+
}), xe = m({
|
|
254
255
|
name: "AppLanguage",
|
|
255
256
|
props: {
|
|
256
257
|
lang: String,
|
|
@@ -282,7 +283,7 @@ const ve = m({
|
|
|
282
283
|
}, [p("path", { d: "M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2S2 6.477 2 12Z" }, null), p("path", { d: "M13 2.05S16 6 16 12c0 6-3 9.95-3 9.95m-2 0S8 18 8 12c0-6 3-9.95 3-9.95M2.63 15.5h18.74m-18.74-7h18.74" }, null)])])] })] })] });
|
|
283
284
|
}
|
|
284
285
|
});
|
|
285
|
-
var
|
|
286
|
+
var Se = r([
|
|
286
287
|
i("layout", {
|
|
287
288
|
display: "grid",
|
|
288
289
|
gridTemplateAreas: "\n 'sider header'\n 'sider content'\n 'sider footer'\n ",
|
|
@@ -333,7 +334,7 @@ var xe = r([
|
|
|
333
334
|
textAlign: "center",
|
|
334
335
|
color: "gray"
|
|
335
336
|
})
|
|
336
|
-
]),
|
|
337
|
+
]), Ce = () => p("svg", {
|
|
337
338
|
xmlns: "http://www.w3.org/2000/svg",
|
|
338
339
|
width: "1em",
|
|
339
340
|
height: "1em",
|
|
@@ -346,7 +347,7 @@ var xe = r([
|
|
|
346
347
|
"stroke-width": "1.5",
|
|
347
348
|
d: "M11.5 18s-6-4.419-6-6s6-6 6-6m7 12s-6-4.419-6-6s6-6 6-6",
|
|
348
349
|
color: "currentColor"
|
|
349
|
-
}, null)]),
|
|
350
|
+
}, null)]), we = () => p("svg", {
|
|
350
351
|
xmlns: "http://www.w3.org/2000/svg",
|
|
351
352
|
width: "1em",
|
|
352
353
|
height: "1em",
|
|
@@ -360,7 +361,7 @@ var xe = r([
|
|
|
360
361
|
d: "M12.5 18s6-4.419 6-6s-6-6-6-6m-7 12s6-4.419 6-6s-6-6-6-6",
|
|
361
362
|
color: "currentColor"
|
|
362
363
|
}, null)]);
|
|
363
|
-
const
|
|
364
|
+
const Te = m({
|
|
364
365
|
name: "AppLayout",
|
|
365
366
|
props: {
|
|
366
367
|
layout: {
|
|
@@ -370,7 +371,7 @@ const we = m({
|
|
|
370
371
|
fullContent: Boolean
|
|
371
372
|
},
|
|
372
373
|
setup(e, { slots: t }) {
|
|
373
|
-
n("-layout",
|
|
374
|
+
n("-layout", Se, b("app"), !1);
|
|
374
375
|
let r = y({
|
|
375
376
|
siderWidth: "0px",
|
|
376
377
|
headerHeight: "0px",
|
|
@@ -393,7 +394,7 @@ const we = m({
|
|
|
393
394
|
}, [x(t, "default")]);
|
|
394
395
|
};
|
|
395
396
|
}
|
|
396
|
-
}),
|
|
397
|
+
}), Ee = m({
|
|
397
398
|
name: "AppHeader",
|
|
398
399
|
props: { height: {
|
|
399
400
|
type: Number,
|
|
@@ -403,7 +404,7 @@ const we = m({
|
|
|
403
404
|
let n = X();
|
|
404
405
|
return () => (n.headerHeight = e.height + "px", p("div", { class: "app-header" }, [x(t, "default")]));
|
|
405
406
|
}
|
|
406
|
-
}),
|
|
407
|
+
}), De = m({
|
|
407
408
|
name: "AppSidebar",
|
|
408
409
|
props: {
|
|
409
410
|
showCollapseBtn: {
|
|
@@ -430,14 +431,14 @@ const we = m({
|
|
|
430
431
|
onClick: () => {
|
|
431
432
|
n("update:collapsed", !t.collapsed);
|
|
432
433
|
}
|
|
433
|
-
}, { default: () => [p(F, { size: "20" }, { default: () => [t.collapsed ? p(
|
|
434
|
+
}, { default: () => [p(F, { size: "20" }, { default: () => [t.collapsed ? p(we, null, null) : p(Ce, null, null)] })] }), [[s, t.collapsed ? i("common.layout.sider.expand") : i("common.layout.sider.collapse")]]) : void 0]));
|
|
434
435
|
}
|
|
435
|
-
}),
|
|
436
|
+
}), Oe = m({
|
|
436
437
|
name: "AppContent",
|
|
437
438
|
setup(e, { slots: t }) {
|
|
438
439
|
return () => p("div", { class: "app-content" }, [x(t, "default")]);
|
|
439
440
|
}
|
|
440
|
-
}),
|
|
441
|
+
}), ke = m({
|
|
441
442
|
name: "AppFooter",
|
|
442
443
|
props: { height: {
|
|
443
444
|
type: Number,
|
|
@@ -448,10 +449,10 @@ const we = m({
|
|
|
448
449
|
return () => (n.footerHeight = e.height + "px", p("div", { class: "app-footer" }, [x(t, "default")]));
|
|
449
450
|
}
|
|
450
451
|
});
|
|
451
|
-
function
|
|
452
|
+
function Z(e) {
|
|
452
453
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
453
454
|
}
|
|
454
|
-
const
|
|
455
|
+
const Ae = m({
|
|
455
456
|
name: "AppLogo",
|
|
456
457
|
props: {
|
|
457
458
|
src: [String, Function],
|
|
@@ -504,14 +505,14 @@ const Z = m({
|
|
|
504
505
|
}, null)]), i ? p(H, {
|
|
505
506
|
class: "app-logo__name",
|
|
506
507
|
style: "font-size: var(--app-logo-name-size); font-weight: bold; white-space: nowrap; flex: 0 1 auto; overflow: hidden"
|
|
507
|
-
},
|
|
508
|
+
}, Z(i) ? i : { default: () => [i] }) : ""]);
|
|
508
509
|
};
|
|
509
510
|
}
|
|
510
511
|
});
|
|
511
512
|
function Q(e) {
|
|
512
513
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
513
514
|
}
|
|
514
|
-
const
|
|
515
|
+
const je = m({
|
|
515
516
|
name: "AppMenu",
|
|
516
517
|
props: {
|
|
517
518
|
menus: Array,
|
|
@@ -546,7 +547,7 @@ const Ae = m({
|
|
|
546
547
|
_: o,
|
|
547
548
|
key: o.key,
|
|
548
549
|
label: () => e.renderLabel?.(o) ?? o.name,
|
|
549
|
-
icon: n === 0 || o.icon ? typeof o.icon == "string" ? e.getIcon?.(o.icon, o) ?? J : o.icon : void 0,
|
|
550
|
+
icon: n === 0 || o.icon ? pe(o.icon) || typeof o.icon == "string" ? e.getIcon?.(o.icon, o) ?? J : o.icon : void 0,
|
|
550
551
|
children: r ? void 0 : t,
|
|
551
552
|
path: o.path || (r ? t?.[0]?.path : void 0),
|
|
552
553
|
depth: n
|
|
@@ -609,7 +610,7 @@ const Ae = m({
|
|
|
609
610
|
};
|
|
610
611
|
}
|
|
611
612
|
});
|
|
612
|
-
function
|
|
613
|
+
function Me(t, n, r) {
|
|
613
614
|
let { t: i } = e(), a = y({
|
|
614
615
|
visible: !1,
|
|
615
616
|
x: 0,
|
|
@@ -781,7 +782,7 @@ function je(t, n, r) {
|
|
|
781
782
|
}
|
|
782
783
|
};
|
|
783
784
|
}
|
|
784
|
-
function
|
|
785
|
+
function Ne(e, t, n) {
|
|
785
786
|
function r(n) {
|
|
786
787
|
if (n === -1 || !t.value?.children.length) return;
|
|
787
788
|
let r = t.value.children[n];
|
|
@@ -799,7 +800,7 @@ function Me(e, t, n) {
|
|
|
799
800
|
content: t
|
|
800
801
|
};
|
|
801
802
|
}
|
|
802
|
-
var
|
|
803
|
+
var Pe = (e) => p("svg", e, [
|
|
803
804
|
p("defs", null, [
|
|
804
805
|
p("symbol", {
|
|
805
806
|
id: "geometry-left",
|
|
@@ -835,7 +836,7 @@ var Ne = (e) => p("svg", e, [
|
|
|
835
836
|
height: "36",
|
|
836
837
|
fill: "currentColor"
|
|
837
838
|
}, null)])])
|
|
838
|
-
]),
|
|
839
|
+
]), Fe = m({
|
|
839
840
|
name: "AppTab",
|
|
840
841
|
props: {
|
|
841
842
|
path: String,
|
|
@@ -862,7 +863,7 @@ var Ne = (e) => p("svg", e, [
|
|
|
862
863
|
top: "0",
|
|
863
864
|
left: "-14px",
|
|
864
865
|
zIndex: e.isCurrent ? -1 : -2,
|
|
865
|
-
color: e.isCurrent ?
|
|
866
|
+
color: e.isCurrent ? me(c.value.primaryColor, e.dark ? .3 : .12, e.dark ? "#000" : "#fff") : i.value ? c.value.borderColor : "transparent"
|
|
866
867
|
}));
|
|
867
868
|
return () => p("div", {
|
|
868
869
|
ref: r,
|
|
@@ -889,11 +890,11 @@ var Ne = (e) => p("svg", e, [
|
|
|
889
890
|
d: "m6.4 18.308l-.708-.708l5.6-5.6l-5.6-5.6l.708-.708l5.6 5.6l5.6-5.6l.708.708l-5.6 5.6l5.6 5.6l-.708.708l-5.6-5.6z"
|
|
890
891
|
}, null)])] })] })]) : void 0])]),
|
|
891
892
|
p("span", { style: "height: 50%; width: 1px; background: #aaa; display: inline-block; position: absolute; top: 20%; right: -4px; z-index: -3" }, null),
|
|
892
|
-
p(
|
|
893
|
+
p(Pe, { style: u.value }, null)
|
|
893
894
|
]);
|
|
894
895
|
}
|
|
895
896
|
});
|
|
896
|
-
const
|
|
897
|
+
const Ie = m({
|
|
897
898
|
name: "AppMultiTabs",
|
|
898
899
|
props: {
|
|
899
900
|
fullTab: Boolean,
|
|
@@ -906,8 +907,8 @@ const Fe = m({
|
|
|
906
907
|
setup(e, { emit: t, slots: n }) {
|
|
907
908
|
let r = X();
|
|
908
909
|
r.hasMultiTab = !0;
|
|
909
|
-
let i = G(), { ctx: a, onCtx: o, onClickOutside: s, options: c, onSelect: l } =
|
|
910
|
-
return
|
|
910
|
+
let i = G(), { ctx: a, onCtx: o, onClickOutside: s, options: c, onSelect: l } = Me(S(e, "tabs"), f(() => e.current?.key), () => t("update:fullTab", !e.fullTab)), u = f(() => e.current ? e.tabs.findIndex((t) => t.key === e.current?.key) : -1), d = b(), m = b();
|
|
911
|
+
return Ne(d, m, u), () => p("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [p("div", {
|
|
911
912
|
ref: d,
|
|
912
913
|
style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
|
|
913
914
|
}, [
|
|
@@ -918,7 +919,7 @@ const Fe = m({
|
|
|
918
919
|
onContextmenu: (e) => o(e)
|
|
919
920
|
}, [e.tabs.map((t, r, a) => {
|
|
920
921
|
let s = e.current?.key === t.key, c = t.title ?? t.path;
|
|
921
|
-
return p(
|
|
922
|
+
return p(Fe, {
|
|
922
923
|
key: t.key,
|
|
923
924
|
isCurrent: s,
|
|
924
925
|
isLast: r === a.length - 1,
|
|
@@ -951,7 +952,7 @@ const Fe = m({
|
|
|
951
952
|
function $(e) {
|
|
952
953
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
953
954
|
}
|
|
954
|
-
const
|
|
955
|
+
const Le = m({
|
|
955
956
|
name: "AppNotification",
|
|
956
957
|
inheritAttrs: !1,
|
|
957
958
|
props: {
|
|
@@ -1086,7 +1087,7 @@ const Ie = m({
|
|
|
1086
1087
|
}, $(r = i("common.notification.markDelete")) ? r : { default: () => [r] })]) : void 0;
|
|
1087
1088
|
},
|
|
1088
1089
|
default: e.content,
|
|
1089
|
-
footer: () => p("span", { style: "color: gray" }, [e.hover ?
|
|
1090
|
+
footer: () => p("span", { style: "color: gray" }, [e.hover ? he(e.date, i("common.notification.time")) : i("common.timeago", { time: e.date })])
|
|
1090
1091
|
})] }), h = () => {
|
|
1091
1092
|
let e;
|
|
1092
1093
|
return D(l.records.length > 0 ? p(I, {
|
|
@@ -1143,7 +1144,7 @@ const Ie = m({
|
|
|
1143
1144
|
};
|
|
1144
1145
|
}
|
|
1145
1146
|
});
|
|
1146
|
-
var
|
|
1147
|
+
var Re = (e) => p("svg", _({
|
|
1147
1148
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1148
1149
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
1149
1150
|
role: "img",
|
|
@@ -1154,7 +1155,7 @@ var Le = (e) => p("svg", _({
|
|
|
1154
1155
|
fill: "currentColor",
|
|
1155
1156
|
d: "m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"
|
|
1156
1157
|
}, null)]);
|
|
1157
|
-
const
|
|
1158
|
+
const ze = m({
|
|
1158
1159
|
name: "AppTenant",
|
|
1159
1160
|
props: {
|
|
1160
1161
|
options: Array,
|
|
@@ -1166,7 +1167,7 @@ const Re = m({
|
|
|
1166
1167
|
round: !0,
|
|
1167
1168
|
size: 22,
|
|
1168
1169
|
color: "var(--color-primary-hover)"
|
|
1169
|
-
}, { default: () => [e.icon?.() || e.name[0]] }), p("span", { style: e.id === t.current ? "color: var(--color-primary)" : "" }, [e.name])]), e.id === t.current ? p(
|
|
1170
|
+
}, { default: () => [e.icon?.() || e.name[0]] }), p("span", { style: e.id === t.current ? "color: var(--color-primary)" : "" }, [e.name])]), e.id === t.current ? p(Re, { style: "color: var(--color-primary); font-size: 20px" }, null) : p("div", null, null)]), a = f(() => [{
|
|
1170
1171
|
id: "___",
|
|
1171
1172
|
name: r("common.account.changeTenant"),
|
|
1172
1173
|
disabled: !0
|
|
@@ -1201,11 +1202,11 @@ const Re = m({
|
|
|
1201
1202
|
})] });
|
|
1202
1203
|
};
|
|
1203
1204
|
}
|
|
1204
|
-
}),
|
|
1205
|
+
}), Be = m({
|
|
1205
1206
|
name: "UIProvider",
|
|
1206
1207
|
props: { i18n: Function },
|
|
1207
1208
|
setup(e, { slots: n }) {
|
|
1208
1209
|
return v(t, S(e, "i18n")), () => n.default();
|
|
1209
1210
|
}
|
|
1210
1211
|
});
|
|
1211
|
-
export {
|
|
1212
|
+
export { ge as AppAccount, _e as AppAppearance, ye as AppBreadcrumb, Oe as AppContent, ke as AppFooter, be as AppFullscreen, Ee as AppHeader, xe as AppLanguage, Te as AppLayout, Ae as AppLogo, je as AppMenu, Ie as AppMultiTabs, Le as AppNotification, De as AppSidebar, ze as AppTenant, u as SpinDirectiveProvider, l as TooltipDirectiveProvider, Be as UIProvider, c as vSpin, s as vTooltip };
|