@done-coding/admin-core 0.3.0 → 0.3.1-alpha.0
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/bridge/index.mjs +24 -40
- package/es/components/display/HeightProvider.vue.mjs +26 -26
- package/es/components/display/TabsHeader.vue.mjs +7 -0
- package/es/components/display/TabsHeader.vue2.mjs +76 -0
- package/es/components/display/TabsMain.vue.mjs +100 -5
- package/es/components/display/TabsMain.vue2.mjs +2 -95
- package/es/components/display/TabsNaturalFlow.vue.mjs +17 -0
- package/es/components/display/TabsNaturalFlow.vue2.mjs +4 -0
- package/es/components/display/TabsRefineFlow.vue.mjs +62 -0
- package/es/components/display/TabsRefineFlow.vue2.mjs +4 -0
- package/es/components/display/index.mjs +11 -11
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +107 -63
- package/es/components/form/form-search-utils.mjs +25 -0
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +82 -76
- package/es/components/table/TableMain.vue.mjs +3 -3
- package/es/components/table/TableMain.vue2.mjs +103 -102
- package/es/hooks/use-breakpoint.mjs +40 -0
- package/es/hooks/use-channel-viewport-height.mjs +18 -0
- package/es/index.mjs +88 -84
- package/es/inject/key.mjs +7 -6
- package/es/style.css +1 -1
- package/package.json +3 -2
- package/types/bridge/index.d.ts +23 -23
- package/types/components/display/HeightProvider.vue.d.ts +10 -6
- package/types/components/display/TabsHeader.vue.d.ts +42 -0
- package/types/components/display/TabsMain.vue.d.ts +49 -7
- package/types/components/display/TabsNaturalFlow.vue.d.ts +16 -0
- package/types/components/display/TabsRefineFlow.vue.d.ts +53 -0
- package/types/components/display/index.d.ts +6 -12
- package/types/components/display/types.d.ts +46 -31
- package/types/components/form/form-search-utils.d.ts +24 -0
- package/types/components/form/types.d.ts +7 -1
- package/types/components/list-page/types.d.ts +1 -1
- package/types/components/misc/index.d.ts +10 -1
- package/types/components/modal/ConfirmModal.vue.d.ts +2 -2
- package/types/components/table/TableToolbar.vue.d.ts +8 -8
- package/types/components/table/types.d.ts +4 -0
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/use-breakpoint.d.ts +4 -0
- package/types/hooks/use-channel-viewport-height.d.ts +28 -0
- package/types/inject/key.d.ts +11 -11
package/es/bridge/index.mjs
CHANGED
|
@@ -1,75 +1,59 @@
|
|
|
1
|
-
function
|
|
2
|
-
let
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
}, a = {
|
|
6
|
-
init(e) {
|
|
7
|
-
return l = e.appConfig, h = e.storage, c = e.routes, T = e.userInfoAccess, I = e.getUserInfoInitFn, k = !0, a;
|
|
8
|
-
},
|
|
1
|
+
function F(n) {
|
|
2
|
+
let h = n.appConfig, l = n.storage, c = n.routes, T = n.userInfoAccess, I = n.getUserInfoInitFn, t, i, g, o, f, u, s, A;
|
|
3
|
+
const r = (e) => `admin bridge: ${e} 未注册`;
|
|
4
|
+
return {
|
|
9
5
|
register(e) {
|
|
10
|
-
|
|
6
|
+
e.getToken && (t = e.getToken), e.goToLogin && (i = e.goToLogin), e.refreshToken && (g = e.refreshToken), e.refreshAuth && (o = e.refreshAuth), e.loginApi && (f = e.loginApi), e.logoutApi && (u = e.logoutApi), e.getUserInfoApi && (s = e.getUserInfoApi), e.refreshTokenApi && (A = e.refreshTokenApi);
|
|
11
7
|
},
|
|
12
|
-
//
|
|
8
|
+
// 已注册返回 undefined 是合法业务态不 throw
|
|
13
9
|
// v3 终锁 Δ8b:零参 facade(BR-1 ③ 终裁——core 对 UserInfo 不透明 + 拦截器无 info 源)
|
|
14
10
|
getToken() {
|
|
15
|
-
if (
|
|
11
|
+
if (!t) throw new Error(r("getToken"));
|
|
16
12
|
return t();
|
|
17
13
|
},
|
|
18
|
-
// pre-init 同步 throw;post-init 同步对
|
|
19
14
|
goToLogin() {
|
|
20
|
-
if (
|
|
15
|
+
if (!i) throw new Error(r("goToLogin"));
|
|
21
16
|
i();
|
|
22
17
|
},
|
|
23
|
-
//
|
|
24
|
-
// post-init 未注册才返回 rejected Promise(既有降级语义保留)。
|
|
18
|
+
// 异步对:未注册才返回 rejected Promise(既有降级语义保留)。
|
|
25
19
|
refreshToken() {
|
|
26
|
-
return
|
|
27
|
-
}) : Promise.reject(new Error(
|
|
20
|
+
return g ? g().then(() => {
|
|
21
|
+
}) : Promise.reject(new Error(r("refreshToken")));
|
|
28
22
|
},
|
|
29
|
-
// 异步对:同上
|
|
30
23
|
refreshAuth() {
|
|
31
|
-
return
|
|
32
|
-
}) : Promise.reject(new Error(
|
|
24
|
+
return o ? o().then(() => {
|
|
25
|
+
}) : Promise.reject(new Error(r("refreshAuth")));
|
|
33
26
|
},
|
|
34
|
-
// pre-init 同步 throw;post-init 返回 init 注册引用
|
|
35
27
|
getAppConfig() {
|
|
36
|
-
return
|
|
28
|
+
return h;
|
|
37
29
|
},
|
|
38
|
-
// pre-init 同步 throw;post-init 返回 init 注册引用
|
|
39
30
|
getStorage() {
|
|
40
|
-
return
|
|
31
|
+
return l;
|
|
41
32
|
},
|
|
42
|
-
// pre-init 同步 throw;post-init 返回 init 注册引用
|
|
43
33
|
getRoutes() {
|
|
44
|
-
return
|
|
34
|
+
return c;
|
|
45
35
|
},
|
|
46
|
-
// pre-init 同步 throw;post-init 返回 init 注册引用(v3 终锁 Δ0d,镜像 getRoutes 范式)
|
|
47
36
|
getUserInfoAccess() {
|
|
48
|
-
return
|
|
37
|
+
return T;
|
|
49
38
|
},
|
|
50
|
-
// pre-init 同步 throw;post-init 返回 init 注册引用(v3 终锁 Δ0d,镜像 getRoutes 范式)
|
|
51
39
|
getUserInfoInitFn() {
|
|
52
|
-
return
|
|
40
|
+
return I;
|
|
53
41
|
},
|
|
54
|
-
//
|
|
42
|
+
// 异步对:未注册返回 rejected 原生 Error(#4a-2 per-method 降级)
|
|
55
43
|
loginApi(e) {
|
|
56
|
-
return
|
|
44
|
+
return f ? f(e) : Promise.reject(new Error(r("loginApi")));
|
|
57
45
|
},
|
|
58
|
-
// 异步对:同上
|
|
59
46
|
logoutApi() {
|
|
60
|
-
return
|
|
47
|
+
return u ? u() : Promise.reject(new Error(r("logoutApi")));
|
|
61
48
|
},
|
|
62
|
-
// 异步对:同上
|
|
63
49
|
getUserInfoApi() {
|
|
64
|
-
return
|
|
50
|
+
return s ? s() : Promise.reject(new Error(r("getUserInfoApi")));
|
|
65
51
|
},
|
|
66
|
-
// 异步对:同上
|
|
67
52
|
refreshTokenApi(e) {
|
|
68
|
-
return
|
|
53
|
+
return A ? A(e) : Promise.reject(new Error(r("refreshTokenApi")));
|
|
69
54
|
}
|
|
70
55
|
};
|
|
71
|
-
return a;
|
|
72
56
|
}
|
|
73
57
|
export {
|
|
74
|
-
|
|
58
|
+
F as createAdminBridge
|
|
75
59
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const S = /* @__PURE__ */ f({
|
|
1
|
+
import { defineComponent as p, ref as u, computed as a, watch as d, openBlock as i, createElementBlock as g, Fragment as f, createBlock as H, withCtx as v, renderSlot as n, createCommentVNode as w, normalizeProps as C, guardReactiveProps as _, unref as k } from "vue";
|
|
2
|
+
import P from "./WatchSize.vue.mjs";
|
|
3
|
+
const S = /* @__PURE__ */ p({
|
|
5
4
|
__name: "HeightProvider",
|
|
6
5
|
props: {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
viewportHeight: {},
|
|
7
|
+
minHeight: { default: 0 }
|
|
9
8
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
emits: ["childViewportHeightChange"],
|
|
10
|
+
setup(s, { emit: l }) {
|
|
11
|
+
const t = s, h = l, o = u(0), r = a(
|
|
12
|
+
() => Math.max(t.viewportHeight - o.value, t.minHeight)
|
|
13
|
+
), m = (e) => {
|
|
14
|
+
o.value = e;
|
|
15
|
+
}, c = a(
|
|
16
|
+
() => ({
|
|
17
|
+
viewportHeight: r.value
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
return d(r, (e) => h("childViewportHeightChange", e), {
|
|
21
|
+
immediate: !0
|
|
22
|
+
}), (e, $) => (i(), g(f, null, [
|
|
23
|
+
e.$slots.header ? (i(), H(P, {
|
|
19
24
|
key: 0,
|
|
20
|
-
|
|
21
|
-
onHeightChange: s[0] || (s[0] = (u) => l.value = u)
|
|
25
|
+
onHeightChange: m
|
|
22
26
|
}, {
|
|
23
|
-
default:
|
|
24
|
-
|
|
27
|
+
default: v(() => [
|
|
28
|
+
n(e.$slots, "header")
|
|
25
29
|
]),
|
|
26
30
|
_: 3
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
c(n.$slots, "default", { height: e(t) })
|
|
32
|
-
], 4)
|
|
33
|
-
], 4));
|
|
31
|
+
})) : w("", !0),
|
|
32
|
+
n(e.$slots, "default", C(_(k(c))))
|
|
33
|
+
], 64));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
export {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent as $, toRefs as z, useModel as K, ref as T, computed as n, onMounted as g, onBeforeUnmount as B, watch as R, openBlock as i, createElementBlock as r, normalizeClass as b, unref as o, Fragment as S, renderList as D, renderSlot as H, createTextVNode as I, toDisplayString as N, normalizeStyle as V, createCommentVNode as F, mergeModels as U, nextTick as W } from "vue";
|
|
2
|
+
const X = ["onClick"], q = /* @__PURE__ */ $({
|
|
3
|
+
__name: "TabsHeader",
|
|
4
|
+
props: /* @__PURE__ */ U({
|
|
5
|
+
tabs: {},
|
|
6
|
+
level: { default: 1 },
|
|
7
|
+
variant: {}
|
|
8
|
+
}, {
|
|
9
|
+
activeKey: {},
|
|
10
|
+
activeKeyModifiers: {}
|
|
11
|
+
}),
|
|
12
|
+
emits: ["update:activeKey"],
|
|
13
|
+
setup(v) {
|
|
14
|
+
const d = v, { tabs: k, level: h, variant: M } = z(d), s = K(v, "activeKey"), l = /* @__PURE__ */ new Map(), m = T(0), f = n(
|
|
15
|
+
() => Math.min(Math.max(Math.floor(h.value), 1), 4)
|
|
16
|
+
), w = n(() => `tabs-main-bar--l${f.value}`), C = {
|
|
17
|
+
1: "card",
|
|
18
|
+
2: "indicator",
|
|
19
|
+
3: "indicator-compact",
|
|
20
|
+
4: "plain"
|
|
21
|
+
}, c = n(
|
|
22
|
+
() => M.value ?? C[f.value]
|
|
23
|
+
), x = n(
|
|
24
|
+
() => `tabs-main-bar--variant-${c.value}`
|
|
25
|
+
), _ = n(
|
|
26
|
+
() => c.value === "indicator" || c.value === "indicator-compact"
|
|
27
|
+
), E = n(() => {
|
|
28
|
+
const [, t] = [m.value, s.value], a = t ? l.get(t) : void 0;
|
|
29
|
+
return a ? {
|
|
30
|
+
width: `${a.offsetWidth}px`,
|
|
31
|
+
transform: `translateX(${a.offsetLeft}px)`
|
|
32
|
+
} : { width: "0px" };
|
|
33
|
+
}), L = (t, a) => {
|
|
34
|
+
a instanceof HTMLElement ? l.set(t, a) : l.delete(t);
|
|
35
|
+
}, u = () => {
|
|
36
|
+
W(() => {
|
|
37
|
+
m.value++;
|
|
38
|
+
});
|
|
39
|
+
}, p = () => u();
|
|
40
|
+
return g(() => {
|
|
41
|
+
u(), window.addEventListener("resize", p);
|
|
42
|
+
}), B(() => {
|
|
43
|
+
window.removeEventListener("resize", p);
|
|
44
|
+
}), R(
|
|
45
|
+
() => d.tabs,
|
|
46
|
+
() => u(),
|
|
47
|
+
{ flush: "post" }
|
|
48
|
+
), (t, a) => (i(), r("div", {
|
|
49
|
+
class: b(["tabs-main-bar", [o(w), o(x)]])
|
|
50
|
+
}, [
|
|
51
|
+
(i(!0), r(S, null, D(o(k), (e) => (i(), r("button", {
|
|
52
|
+
key: e.key,
|
|
53
|
+
ref_for: !0,
|
|
54
|
+
ref: (y) => L(e.key, y),
|
|
55
|
+
type: "button",
|
|
56
|
+
class: b(["tabs-main-bar-item", { "tabs-main-bar-item_active": e.key === s.value }]),
|
|
57
|
+
onClick: (y) => s.value = e.key
|
|
58
|
+
}, [
|
|
59
|
+
H(t.$slots, e.key, {
|
|
60
|
+
tab: e,
|
|
61
|
+
active: e.key === s.value
|
|
62
|
+
}, () => [
|
|
63
|
+
I(N(e.title), 1)
|
|
64
|
+
], !0)
|
|
65
|
+
], 10, X))), 128)),
|
|
66
|
+
o(_) ? (i(), r("div", {
|
|
67
|
+
key: 0,
|
|
68
|
+
class: "tabs-main-bar-indicator",
|
|
69
|
+
style: V(o(E))
|
|
70
|
+
}, null, 4)) : F("", !0)
|
|
71
|
+
], 2));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
q as default
|
|
76
|
+
};
|
|
@@ -1,7 +1,102 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as m, inject as R, toRefs as T, useModel as A, useSlots as N, ref as P, computed as f, h as $, provide as q, watch as x, openBlock as i, createBlock as l, resolveDynamicComponent as E, unref as r, mergeProps as I, withCtx as s, KeepAlive as U, createCommentVNode as j, createVNode as z, createSlots as D, renderList as F, renderSlot as G, normalizeProps as J, guardReactiveProps as O, mergeModels as Q } from "vue";
|
|
2
|
+
import W from "./TabsRefineFlow.vue.mjs";
|
|
3
|
+
import X from "./TabsNaturalFlow.vue.mjs";
|
|
4
|
+
import Y from "./TabsHeader.vue.mjs";
|
|
5
|
+
import { TABS_MAIN_VISUAL_LEVEL as h } from "../../inject/key.mjs";
|
|
6
|
+
const oe = /* @__PURE__ */ m({
|
|
7
|
+
__name: "TabsMain",
|
|
8
|
+
props: /* @__PURE__ */ Q({
|
|
9
|
+
tabs: {},
|
|
10
|
+
viewportHeight: {},
|
|
11
|
+
minHeight: { default: 100 },
|
|
12
|
+
channel: {},
|
|
13
|
+
parentChannel: {},
|
|
14
|
+
padding: {},
|
|
15
|
+
refine: { type: Boolean, default: !0 },
|
|
16
|
+
refineReduceHeight: { default: 0 },
|
|
17
|
+
variant: {}
|
|
18
|
+
}, {
|
|
19
|
+
modelValue: {},
|
|
20
|
+
modelModifiers: {}
|
|
21
|
+
}),
|
|
22
|
+
emits: ["update:modelValue"],
|
|
23
|
+
setup(u) {
|
|
24
|
+
const o = u, p = R(h, 0) + 1, {
|
|
25
|
+
viewportHeight: g,
|
|
26
|
+
minHeight: y,
|
|
27
|
+
channel: H,
|
|
28
|
+
parentChannel: w,
|
|
29
|
+
padding: b,
|
|
30
|
+
refine: v,
|
|
31
|
+
refineReduceHeight: k,
|
|
32
|
+
variant: V,
|
|
33
|
+
tabs: d
|
|
34
|
+
} = T(o), a = A(u, "modelValue"), _ = N(), c = P(void 0), C = f(
|
|
35
|
+
() => v.value ? W : X
|
|
36
|
+
), L = f(
|
|
37
|
+
() => v.value ? {
|
|
38
|
+
viewportHeight: g.value,
|
|
39
|
+
minHeight: y.value,
|
|
40
|
+
channel: H.value,
|
|
41
|
+
parentChannel: w.value,
|
|
42
|
+
padding: b.value,
|
|
43
|
+
refineReduceHeight: k.value
|
|
44
|
+
} : {}
|
|
45
|
+
), K = (e) => o.tabs.find((n) => n.key === e), M = (e) => {
|
|
46
|
+
c.value = e;
|
|
47
|
+
}, S = m({
|
|
48
|
+
name: "TabsMainPane",
|
|
49
|
+
props: {
|
|
50
|
+
paneKey: { type: String, required: !0 },
|
|
51
|
+
viewportHeight: { type: Number, required: !1 }
|
|
52
|
+
},
|
|
53
|
+
setup(e) {
|
|
54
|
+
return () => {
|
|
55
|
+
const n = _[e.paneKey], t = K(e.paneKey);
|
|
56
|
+
return n ? n({
|
|
57
|
+
tab: t,
|
|
58
|
+
active: !0,
|
|
59
|
+
viewportHeight: e.viewportHeight
|
|
60
|
+
}) : t != null && t.component ? $(t.component) : null;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return q(h, p), x(
|
|
65
|
+
[a, () => o.tabs],
|
|
66
|
+
() => {
|
|
67
|
+
!(!!a.value && o.tabs.some((n) => n.key === a.value)) && o.tabs.length && (a.value = o.tabs[0].key);
|
|
68
|
+
},
|
|
69
|
+
{ immediate: !0 }
|
|
70
|
+
), (e, n) => (i(), l(E(r(C)), I(r(L), { onViewportHeightChange: M }), {
|
|
71
|
+
header: s(() => [
|
|
72
|
+
z(Y, {
|
|
73
|
+
"active-key": a.value,
|
|
74
|
+
"onUpdate:activeKey": n[0] || (n[0] = (t) => a.value = t),
|
|
75
|
+
tabs: r(d),
|
|
76
|
+
level: p,
|
|
77
|
+
variant: r(V)
|
|
78
|
+
}, D({ _: 2 }, [
|
|
79
|
+
F(r(d), (t) => ({
|
|
80
|
+
name: t.key,
|
|
81
|
+
fn: s((B) => [
|
|
82
|
+
G(e.$slots, `header-${t.key}`, J(O(B)))
|
|
83
|
+
])
|
|
84
|
+
}))
|
|
85
|
+
]), 1032, ["active-key", "tabs", "variant"])
|
|
86
|
+
]),
|
|
87
|
+
default: s(() => [
|
|
88
|
+
(i(), l(U, null, [
|
|
89
|
+
a.value ? (i(), l(r(S), {
|
|
90
|
+
key: a.value,
|
|
91
|
+
"pane-key": a.value,
|
|
92
|
+
"viewport-height": r(c)
|
|
93
|
+
}, null, 8, ["pane-key", "viewport-height"])) : j("", !0)
|
|
94
|
+
], 1024))
|
|
95
|
+
]),
|
|
96
|
+
_: 3
|
|
97
|
+
}, 16));
|
|
98
|
+
}
|
|
99
|
+
});
|
|
5
100
|
export {
|
|
6
|
-
|
|
101
|
+
oe as default
|
|
7
102
|
};
|
|
@@ -1,97 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import G from "./HeightProvider.vue.mjs";
|
|
3
|
-
import { FULLSCREEN_HEIGHT_CHANNEL as P } from "../../inject/key.mjs";
|
|
4
|
-
const W = { class: "tabs-main-bar" }, X = ["onClick"], Q = /* @__PURE__ */ y({
|
|
5
|
-
__name: "TabsMain",
|
|
6
|
-
props: /* @__PURE__ */ q({
|
|
7
|
-
tabs: {},
|
|
8
|
-
channel: { default: P },
|
|
9
|
-
height: {}
|
|
10
|
-
}, {
|
|
11
|
-
modelValue: {},
|
|
12
|
-
modelModifiers: {}
|
|
13
|
-
}),
|
|
14
|
-
emits: ["update:modelValue"],
|
|
15
|
-
setup(d) {
|
|
16
|
-
const o = d, s = T(d, "modelValue"), E = x(), w = (e) => o.tabs.find((t) => t.key === e), m = (e) => !!e && o.tabs.some((t) => t.key === e), r = v(() => m(s.value) ? s.value : o.tabs.length ? o.tabs[0].key : void 0);
|
|
17
|
-
b(
|
|
18
|
-
[s, () => o.tabs],
|
|
19
|
-
() => {
|
|
20
|
-
!m(s.value) && o.tabs.length && (s.value = o.tabs[0].key);
|
|
21
|
-
},
|
|
22
|
-
{ immediate: !0 }
|
|
23
|
-
);
|
|
24
|
-
const M = y({
|
|
25
|
-
name: "TabsMainPane",
|
|
26
|
-
props: { paneKey: { type: String, required: !0 } },
|
|
27
|
-
setup(e) {
|
|
28
|
-
return () => {
|
|
29
|
-
const t = E[e.paneKey], n = w(e.paneKey);
|
|
30
|
-
return t ? t({ tab: n, active: !0 }) : n != null && n.component ? K(n.component) : null;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}), i = /* @__PURE__ */ new Map(), C = (e, t) => {
|
|
34
|
-
t instanceof HTMLElement ? i.set(e, t) : i.delete(e);
|
|
35
|
-
}, f = S(0), L = v(() => {
|
|
36
|
-
const [, e] = [f.value, r.value], t = e ? i.get(e) : void 0;
|
|
37
|
-
return t ? {
|
|
38
|
-
width: `${t.offsetWidth}px`,
|
|
39
|
-
transform: `translateX(${t.offsetLeft}px)`
|
|
40
|
-
} : { width: "0px" };
|
|
41
|
-
}), c = () => {
|
|
42
|
-
D(() => {
|
|
43
|
-
f.value++;
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
b(
|
|
47
|
-
() => o.tabs,
|
|
48
|
-
() => c(),
|
|
49
|
-
{ flush: "post" }
|
|
50
|
-
);
|
|
51
|
-
const p = () => c();
|
|
52
|
-
return V(() => {
|
|
53
|
-
c(), window.addEventListener("resize", p);
|
|
54
|
-
}), N(() => {
|
|
55
|
-
window.removeEventListener("resize", p);
|
|
56
|
-
}), (e, t) => (l(), u(G, {
|
|
57
|
-
height: o.height,
|
|
58
|
-
channel: o.channel
|
|
59
|
-
}, {
|
|
60
|
-
header: k(() => [
|
|
61
|
-
_("div", W, [
|
|
62
|
-
(l(!0), g(B, null, H(o.tabs, (n) => (l(), g("button", {
|
|
63
|
-
key: n.key,
|
|
64
|
-
ref_for: !0,
|
|
65
|
-
ref: (h) => C(n.key, h),
|
|
66
|
-
type: "button",
|
|
67
|
-
class: F(["tabs-main-bar-item", { "tabs-main-bar-item_active": n.key === a(r) }]),
|
|
68
|
-
onClick: (h) => s.value = n.key
|
|
69
|
-
}, [
|
|
70
|
-
R(e.$slots, `header-${n.key}`, {
|
|
71
|
-
tab: n,
|
|
72
|
-
active: n.key === a(r)
|
|
73
|
-
}, () => [
|
|
74
|
-
A(I(n.title), 1)
|
|
75
|
-
], !0)
|
|
76
|
-
], 10, X))), 128)),
|
|
77
|
-
_("div", {
|
|
78
|
-
class: "tabs-main-bar-indicator",
|
|
79
|
-
style: U(a(L))
|
|
80
|
-
}, null, 4)
|
|
81
|
-
])
|
|
82
|
-
]),
|
|
83
|
-
default: k(() => [
|
|
84
|
-
(l(), u($, null, [
|
|
85
|
-
a(r) ? (l(), u(a(M), {
|
|
86
|
-
key: a(r),
|
|
87
|
-
"pane-key": a(r)
|
|
88
|
-
}, null, 8, ["pane-key"])) : z("", !0)
|
|
89
|
-
], 1024))
|
|
90
|
-
]),
|
|
91
|
-
_: 3
|
|
92
|
-
}, 8, ["height", "channel"]));
|
|
93
|
-
}
|
|
94
|
-
});
|
|
1
|
+
import f from "./TabsMain.vue.mjs";
|
|
95
2
|
export {
|
|
96
|
-
|
|
3
|
+
f as default
|
|
97
4
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent as s, onMounted as a, openBlock as r, createElementBlock as i, renderSlot as t } from "vue";
|
|
2
|
+
const l = { class: "tabs-natural-flow" }, p = /* @__PURE__ */ s({
|
|
3
|
+
__name: "TabsNaturalFlow",
|
|
4
|
+
emits: ["viewportHeightChange"],
|
|
5
|
+
setup(c, { emit: o }) {
|
|
6
|
+
const n = o;
|
|
7
|
+
return a(() => {
|
|
8
|
+
n("viewportHeightChange", void 0);
|
|
9
|
+
}), (e, d) => (r(), i("div", l, [
|
|
10
|
+
t(e.$slots, "header"),
|
|
11
|
+
t(e.$slots, "default")
|
|
12
|
+
]));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
p as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { defineComponent as w, ref as C, computed as n, provide as b, watch as y, openBlock as S, createBlock as V, unref as l, createSlots as $, withCtx as h, createElementVNode as x, normalizeStyle as _, renderSlot as d } from "vue";
|
|
2
|
+
import k from "./HeightProvider.vue.mjs";
|
|
3
|
+
import { useChannelViewportHeight as L } from "../../hooks/use-channel-viewport-height.mjs";
|
|
4
|
+
const M = /* @__PURE__ */ w({
|
|
5
|
+
__name: "TabsRefineFlow",
|
|
6
|
+
props: {
|
|
7
|
+
viewportHeight: {},
|
|
8
|
+
minHeight: {},
|
|
9
|
+
channel: {},
|
|
10
|
+
parentChannel: {},
|
|
11
|
+
padding: { default: () => [10, 10, 0, 10] },
|
|
12
|
+
refineReduceHeight: { default: 0 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["viewportHeightChange"],
|
|
15
|
+
setup(i, { emit: p }) {
|
|
16
|
+
const e = i, c = p, o = e.channel ? Symbol.for(e.channel) : void 0, { viewportHeightFinal: s, parentLevel: a } = L(e), r = C(0), g = n(() => e.padding[0] + e.padding[2]), m = n(() => ({
|
|
17
|
+
padding: e.padding.map((t) => `${t}px`).join(" "),
|
|
18
|
+
boxSizing: "border-box"
|
|
19
|
+
})), v = n(
|
|
20
|
+
() => Math.max(
|
|
21
|
+
s.value - g.value - e.refineReduceHeight,
|
|
22
|
+
0
|
|
23
|
+
)
|
|
24
|
+
), u = n(
|
|
25
|
+
() => a.value > 0 ? a.value : 1
|
|
26
|
+
), f = n(() => u.value + 1), H = (t) => {
|
|
27
|
+
r.value = t, c("viewportHeightChange", t);
|
|
28
|
+
};
|
|
29
|
+
return o && b(o, {
|
|
30
|
+
viewportHeight: n(() => r.value),
|
|
31
|
+
level: f.value
|
|
32
|
+
}), y(
|
|
33
|
+
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
34
|
+
() => e.channel,
|
|
35
|
+
() => console.error("[TabsMain] channel 不支持响应式变更,当前值已忽略。")
|
|
36
|
+
), (t, R) => (S(), V(k, {
|
|
37
|
+
viewportHeight: l(v),
|
|
38
|
+
minHeight: i.minHeight,
|
|
39
|
+
onChildViewportHeightChange: H
|
|
40
|
+
}, $({
|
|
41
|
+
default: h(() => [
|
|
42
|
+
x("div", {
|
|
43
|
+
style: _(l(m))
|
|
44
|
+
}, [
|
|
45
|
+
d(t.$slots, "default")
|
|
46
|
+
], 4)
|
|
47
|
+
]),
|
|
48
|
+
_: 2
|
|
49
|
+
}, [
|
|
50
|
+
t.$slots.header ? {
|
|
51
|
+
name: "header",
|
|
52
|
+
fn: h(() => [
|
|
53
|
+
d(t.$slots, "header")
|
|
54
|
+
]),
|
|
55
|
+
key: "0"
|
|
56
|
+
} : void 0
|
|
57
|
+
]), 1032, ["viewportHeight", "minHeight"]));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
export {
|
|
61
|
+
M as default
|
|
62
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
install(
|
|
6
|
-
Object.entries(
|
|
7
|
-
|
|
1
|
+
import t from "./WatchSize.vue.mjs";
|
|
2
|
+
import s from "./TabsMain.vue.mjs";
|
|
3
|
+
import n from "./HeightProvider.vue.mjs";
|
|
4
|
+
const r = { WatchSize: t, TabsMain: s, HeightProvider: n }, f = {
|
|
5
|
+
install(i) {
|
|
6
|
+
Object.entries(r).forEach(([a, o]) => {
|
|
7
|
+
i.component(a, o);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
n as HeightProvider,
|
|
13
|
+
s as TabsMain,
|
|
14
|
+
t as WatchSize,
|
|
15
|
+
f as displayInstall
|
|
16
16
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormSearch.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-996aa2dc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|