@done-coding/admin-core 0.8.2 → 0.9.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/config-hook.mjs +37 -0
- package/es/bridge/index.mjs +157 -62
- package/es/bridge/plugin.mjs +29 -0
- package/es/bridge/theme.mjs +62 -0
- package/es/components/app-layout/AppBody.vue.mjs +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +47 -49
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
- package/es/components/app-layout/AppFooter.vue.mjs +2 -2
- package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
- package/es/components/app-layout/AppTheme.vue.mjs +7 -0
- package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +36 -36
- package/es/components/display/ActionConfirm.vue2.mjs +16 -16
- package/es/components/display/HeightProvider.vue.mjs +10 -10
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +34 -34
- package/es/components/display/TabsMain.vue.mjs +40 -39
- package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
- package/es/components/form/FormItem.vue.mjs +1 -1
- package/es/components/form/FormItem.vue2.mjs +75 -81
- package/es/components/form/FormMain.vue.mjs +81 -88
- package/es/components/form/FormRadioGroup.vue.mjs +42 -49
- package/es/components/form/FormSearch.vue.mjs +1 -1
- package/es/components/form/FormSearch.vue2.mjs +116 -123
- package/es/components/form/FormSelect.vue.mjs +34 -40
- package/es/components/form/FormSubmitBtn.vue.mjs +24 -35
- package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue2.mjs +75 -55
- package/es/components/form/FormTree.vue.mjs +16 -21
- package/es/components/form/FormVerifyCode.vue.mjs +37 -43
- package/es/components/form/FormVerifyImage.vue.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
- package/es/components/form/use-form-submit.mjs +21 -0
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +134 -139
- package/es/components/menu/MenuItemSub.vue.mjs +41 -48
- package/es/components/menu/MenuTree.vue.mjs +58 -65
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
- package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
- package/es/components/modal/ConfirmModal.vue.mjs +3 -3
- package/es/components/modal/ConfirmModal.vue2.mjs +93 -100
- package/es/components/modal/DetailModal.vue.mjs +38 -41
- package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
- package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
- package/es/components/panel/PanelMain.vue.mjs +2 -2
- package/es/components/panel/PanelMain.vue2.mjs +67 -74
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +221 -229
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +115 -126
- package/es/hooks/use-admin-theme-apply.mjs +84 -0
- package/es/hooks/use-admin-viewport-apply.mjs +27 -0
- package/es/index.mjs +125 -117
- package/es/inject/key.mjs +7 -4
- package/es/store/app.mjs +75 -84
- package/es/style.css +1 -1
- package/es/utils/theme-scale.mjs +37 -0
- package/package.json +2 -4
- package/types/bridge/config-hook.d.ts +91 -0
- package/types/bridge/index.d.ts +110 -10
- package/types/bridge/plugin.d.ts +39 -0
- package/types/bridge/theme.d.ts +66 -0
- package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
- package/types/components/app-layout/types.d.ts +1 -1
- package/types/components/form/FormItem.vue.d.ts +12 -12
- package/types/components/form/FormSubmitPanel.vue.d.ts +4 -0
- package/types/components/form/FormTree.vue.d.ts +50 -50
- package/types/components/form/types.d.ts +17 -0
- package/types/components/form/use-form-submit.d.ts +25 -0
- package/types/components/menu/MenuTree.vue.d.ts +10 -10
- package/types/components/modal/ModalShelf.vue.d.ts +1 -1
- package/types/components/table/TableMain.vue.d.ts +1 -1
- package/types/hooks/activated.d.ts +2 -2
- package/types/hooks/feel-size.d.ts +1 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +5 -5
- package/types/hooks/use-admin-theme-apply.d.ts +17 -0
- package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
- package/types/hooks/use-breakpoint.d.ts +1 -1
- package/types/inject/key.d.ts +18 -0
- package/types/store/app.d.ts +138 -59
- package/types/store/user.d.ts +3 -3
- package/types/utils/index.d.ts +1 -0
- package/types/utils/theme-scale.d.ts +35 -0
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
import "element-plus/es/components/switch/style/css";
|
|
4
|
-
import "element-plus/es/components/dropdown/style/css";
|
|
5
|
-
import "element-plus/es/components/dropdown-menu/style/css";
|
|
6
|
-
import "element-plus/es/components/dropdown-item/style/css";
|
|
7
|
-
import "element-plus/es/components/button/style/css";
|
|
8
|
-
import "element-plus/es/components/icon/style/css";
|
|
9
|
-
import { defineComponent as N, useModel as x, computed as w, ref as U, withDirectives as G, openBlock as v, createElementBlock as X, createElementVNode as y, createBlock as A, withCtx as a, createVNode as r, createTextVNode as m, unref as g, createCommentVNode as V, vShow as q, mergeModels as O } from "vue";
|
|
10
|
-
import { ElMessageBox as j, ElMessage as H } from "element-plus";
|
|
1
|
+
import { defineComponent as L, useModel as x, computed as w, ref as $, withDirectives as D, openBlock as p, createElementBlock as P, createElementVNode as C, createBlock as y, unref as a, withCtx as i, createVNode as n, createTextVNode as c, createCommentVNode as A, vShow as z, mergeModels as N } from "vue";
|
|
2
|
+
import { ElDropdown as U, ElButton as G, ElIcon as X, ElDropdownMenu as q, ElDropdownItem as v, ElSwitch as O, ElMessageBox as j, ElMessage as H } from "element-plus";
|
|
11
3
|
import { ArrowDown as J, Calendar as K, Grid as Q } from "@element-plus/icons-vue";
|
|
12
|
-
import
|
|
4
|
+
import V from "./ToolbarButtons.vue.mjs";
|
|
13
5
|
import W from "../misc/AutoRefreshGroup.vue.mjs";
|
|
14
6
|
import { countAll as Y, fetchListAll as M } from "../../helpers/list-helper.mjs";
|
|
15
7
|
import { EXPORT_MAX_LIMIT as d, exportCSV as Z } from "../../utils/export.mjs";
|
|
16
|
-
const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te = { class: "table-toolbar-right" },
|
|
8
|
+
const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te = { class: "table-toolbar-right" }, ue = /* @__PURE__ */ L({
|
|
17
9
|
__name: "TableToolbar",
|
|
18
|
-
props: /* @__PURE__ */
|
|
10
|
+
props: /* @__PURE__ */ N({
|
|
19
11
|
exportByFe: { type: Boolean, default: !0 },
|
|
20
12
|
exportFn: {},
|
|
21
13
|
exportColumns: {},
|
|
@@ -38,11 +30,11 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
|
|
|
38
30
|
customViewModifiers: {}
|
|
39
31
|
}),
|
|
40
32
|
emits: ["update:isAutoRefresh", "update:refreshInterval", "update:customView"],
|
|
41
|
-
setup(
|
|
42
|
-
const t =
|
|
33
|
+
setup(o) {
|
|
34
|
+
const t = o, g = x(o, "isAutoRefresh"), b = x(o, "refreshInterval"), E = x(o, "customView"), B = w(() => {
|
|
43
35
|
var l;
|
|
44
36
|
return !!((l = t.exportColumns) != null && l.length);
|
|
45
|
-
}),
|
|
37
|
+
}), R = w(() => ({
|
|
46
38
|
tableExpose: t.tableExpose,
|
|
47
39
|
loading: t.loading,
|
|
48
40
|
exportContext: t.exportContext,
|
|
@@ -56,30 +48,30 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
|
|
|
56
48
|
() => {
|
|
57
49
|
var l, e;
|
|
58
50
|
return [
|
|
59
|
-
|
|
51
|
+
B.value,
|
|
60
52
|
t.showAutoRefresh,
|
|
61
53
|
t.showRefresh,
|
|
62
54
|
(l = t.leftExtraButtons) == null ? void 0 : l.length,
|
|
63
55
|
(e = t.rightExtraButtons) == null ? void 0 : e.length
|
|
64
56
|
].filter(Boolean).length;
|
|
65
57
|
}
|
|
66
|
-
), f =
|
|
67
|
-
const { selectedList: e, currentPageList:
|
|
68
|
-
let
|
|
58
|
+
), f = $(!1), k = async (l) => {
|
|
59
|
+
const { selectedList: e, currentPageList: r, api: m, query: h } = t.exportContext, T = t.exportColumns;
|
|
60
|
+
let u;
|
|
69
61
|
switch (l) {
|
|
70
62
|
case "selected":
|
|
71
|
-
|
|
63
|
+
u = e;
|
|
72
64
|
break;
|
|
73
65
|
case "current":
|
|
74
|
-
|
|
66
|
+
u = r;
|
|
75
67
|
break;
|
|
76
68
|
case "all":
|
|
77
69
|
try {
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
70
|
+
const s = await Y(m, h);
|
|
71
|
+
if (s > d) {
|
|
80
72
|
try {
|
|
81
73
|
await j.confirm(
|
|
82
|
-
`数据量超过 ${d} 条(共 ${
|
|
74
|
+
`数据量超过 ${d} 条(共 ${s} 条),是否只导出前 ${d} 条?`,
|
|
83
75
|
"提示",
|
|
84
76
|
{
|
|
85
77
|
confirmButtonText: "导出",
|
|
@@ -90,124 +82,121 @@ const _ = { class: "table-toolbar" }, ee = { class: "table-toolbar-left" }, te =
|
|
|
90
82
|
} catch {
|
|
91
83
|
return;
|
|
92
84
|
}
|
|
93
|
-
|
|
85
|
+
u = await M(m, h, {
|
|
94
86
|
limit: d
|
|
95
87
|
});
|
|
96
88
|
} else
|
|
97
|
-
|
|
89
|
+
u = await M(m, h, {
|
|
98
90
|
limit: d
|
|
99
91
|
});
|
|
100
|
-
} catch (
|
|
101
|
-
H.error(`导出失败:${(
|
|
92
|
+
} catch (s) {
|
|
93
|
+
H.error(`导出失败:${(s == null ? void 0 : s.message) || (s == null ? void 0 : s.toString())}`);
|
|
102
94
|
return;
|
|
103
95
|
}
|
|
104
96
|
break;
|
|
105
97
|
}
|
|
106
|
-
const
|
|
107
|
-
Z({ columns:
|
|
108
|
-
},
|
|
109
|
-
var
|
|
98
|
+
const F = `${document.title}-${Date.now()}`;
|
|
99
|
+
Z({ columns: T, list: u, filename: F });
|
|
100
|
+
}, I = (l) => {
|
|
101
|
+
var r;
|
|
110
102
|
if (f.value) return;
|
|
111
103
|
f.value = !0;
|
|
112
|
-
const e = t.exportByFe ? k(l) : (
|
|
104
|
+
const e = t.exportByFe ? k(l) : (r = t.exportFn) == null ? void 0 : r.call(t, l);
|
|
113
105
|
Promise.resolve(e).catch(() => {
|
|
114
106
|
}).finally(() => {
|
|
115
107
|
f.value = !1;
|
|
116
108
|
});
|
|
117
109
|
};
|
|
118
|
-
return (l, e) =>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
r
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
[q, S.value]
|
|
207
|
-
]);
|
|
208
|
-
};
|
|
110
|
+
return (l, e) => D((p(), P("div", _, [
|
|
111
|
+
C("div", ee, [
|
|
112
|
+
B.value ? (p(), y(a(U), {
|
|
113
|
+
key: 0,
|
|
114
|
+
disabled: !o.exportContext.total,
|
|
115
|
+
onCommand: I
|
|
116
|
+
}, {
|
|
117
|
+
dropdown: i(() => [
|
|
118
|
+
n(a(q), null, {
|
|
119
|
+
default: i(() => [
|
|
120
|
+
n(a(v), {
|
|
121
|
+
disabled: o.exportContext.hasSelection && !o.exportContext.selectedList.length,
|
|
122
|
+
command: "selected"
|
|
123
|
+
}, {
|
|
124
|
+
default: i(() => [...e[4] || (e[4] = [
|
|
125
|
+
c(" 导出选择 ", -1)
|
|
126
|
+
])]),
|
|
127
|
+
_: 1
|
|
128
|
+
}, 8, ["disabled"]),
|
|
129
|
+
n(a(v), { command: "current" }, {
|
|
130
|
+
default: i(() => [...e[5] || (e[5] = [
|
|
131
|
+
c("导出本页", -1)
|
|
132
|
+
])]),
|
|
133
|
+
_: 1
|
|
134
|
+
}),
|
|
135
|
+
n(a(v), { command: "all" }, {
|
|
136
|
+
default: i(() => [...e[6] || (e[6] = [
|
|
137
|
+
c("导出全部", -1)
|
|
138
|
+
])]),
|
|
139
|
+
_: 1
|
|
140
|
+
})
|
|
141
|
+
]),
|
|
142
|
+
_: 1
|
|
143
|
+
})
|
|
144
|
+
]),
|
|
145
|
+
default: i(() => [
|
|
146
|
+
n(a(G), {
|
|
147
|
+
size: "small",
|
|
148
|
+
type: "primary",
|
|
149
|
+
loading: f.value
|
|
150
|
+
}, {
|
|
151
|
+
default: i(() => [
|
|
152
|
+
e[3] || (e[3] = c(" 导出 ", -1)),
|
|
153
|
+
n(a(X), null, {
|
|
154
|
+
default: i(() => [
|
|
155
|
+
n(a(J))
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
})
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
}, 8, ["loading"])
|
|
162
|
+
]),
|
|
163
|
+
_: 1
|
|
164
|
+
}, 8, ["disabled"])) : A("", !0),
|
|
165
|
+
n(V, {
|
|
166
|
+
buttons: o.leftExtraButtons,
|
|
167
|
+
ctx: R.value
|
|
168
|
+
}, null, 8, ["buttons", "ctx"])
|
|
169
|
+
]),
|
|
170
|
+
C("div", te, [
|
|
171
|
+
n(V, {
|
|
172
|
+
buttons: o.rightExtraButtons,
|
|
173
|
+
ctx: R.value
|
|
174
|
+
}, null, 8, ["buttons", "ctx"]),
|
|
175
|
+
o.showSwitchView ? (p(), y(a(O), {
|
|
176
|
+
key: 0,
|
|
177
|
+
modelValue: E.value,
|
|
178
|
+
"onUpdate:modelValue": e[0] || (e[0] = (r) => E.value = r),
|
|
179
|
+
class: "table-toolbar-switch-view",
|
|
180
|
+
"inline-prompt": "",
|
|
181
|
+
"active-icon": a(Q),
|
|
182
|
+
"inactive-icon": a(K)
|
|
183
|
+
}, null, 8, ["modelValue", "active-icon", "inactive-icon"])) : A("", !0),
|
|
184
|
+
n(W, {
|
|
185
|
+
isAutoRefresh: g.value,
|
|
186
|
+
"onUpdate:isAutoRefresh": e[1] || (e[1] = (r) => g.value = r),
|
|
187
|
+
interval: b.value,
|
|
188
|
+
"onUpdate:interval": e[2] || (e[2] = (r) => b.value = r),
|
|
189
|
+
showAutoRefresh: o.showAutoRefresh,
|
|
190
|
+
showRefresh: o.showRefresh,
|
|
191
|
+
refreshFn: o.tableExpose.refresh,
|
|
192
|
+
loading: o.loading
|
|
193
|
+
}, null, 8, ["isAutoRefresh", "interval", "showAutoRefresh", "showRefresh", "refreshFn", "loading"])
|
|
194
|
+
])
|
|
195
|
+
], 512)), [
|
|
196
|
+
[z, S.value]
|
|
197
|
+
]);
|
|
209
198
|
}
|
|
210
199
|
});
|
|
211
200
|
export {
|
|
212
|
-
|
|
201
|
+
ue as default
|
|
213
202
|
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { watch as u } from "vue";
|
|
2
|
+
import { themeScaleDerive as g } from "../utils/theme-scale.mjs";
|
|
3
|
+
const h = "admin-core-theme", p = [
|
|
4
|
+
["primaryColor", { scale: !0, el: "--el-color-primary" }],
|
|
5
|
+
["successColor", { scale: !0, el: "--el-color-success" }],
|
|
6
|
+
["warningColor", { scale: !0, el: "--el-color-warning" }],
|
|
7
|
+
["dangerColor", { scale: !0, el: "--el-color-danger" }],
|
|
8
|
+
["errorColor", { scale: !0, el: "--el-color-error" }],
|
|
9
|
+
["infoColor", { scale: !0, el: "--el-color-info" }],
|
|
10
|
+
["bodyColor", { el: ["--el-bg-color-page", "--el-bg-color"] }],
|
|
11
|
+
["baseColor", { el: "--el-text-color-primary" }],
|
|
12
|
+
["radius", { el: "--el-border-radius-base" }],
|
|
13
|
+
["borderColor", { el: "--el-border-color" }],
|
|
14
|
+
["shadow", { el: "--el-box-shadow" }],
|
|
15
|
+
["borderWidth", { el: "--el-border-width" }],
|
|
16
|
+
["accent", {}],
|
|
17
|
+
["glow", {}],
|
|
18
|
+
["blur", {}],
|
|
19
|
+
["focusRing", {}],
|
|
20
|
+
["surface", {}]
|
|
21
|
+
], m = [
|
|
22
|
+
"light-3",
|
|
23
|
+
"light-5",
|
|
24
|
+
"light-7",
|
|
25
|
+
"light-8",
|
|
26
|
+
"light-9",
|
|
27
|
+
"dark-2"
|
|
28
|
+
], $ = (r) => r.replace(/([A-Z])/g, "-$1").toLowerCase(), f = (r, l) => {
|
|
29
|
+
const o = [];
|
|
30
|
+
for (const [e, s] of p) {
|
|
31
|
+
const t = r[e];
|
|
32
|
+
if (t === void 0 || t === "") continue;
|
|
33
|
+
const a = `--admin-core-${$(e)}`, i = s.el === void 0 ? [] : Array.isArray(s.el) ? s.el : [s.el];
|
|
34
|
+
if (s.scale) {
|
|
35
|
+
const n = g(t, l);
|
|
36
|
+
o.push(`${a}: ${t};`);
|
|
37
|
+
for (const c of m)
|
|
38
|
+
o.push(`${a}-${c}: ${n[c]};`);
|
|
39
|
+
for (const c of i) {
|
|
40
|
+
o.push(`${c}: ${t};`);
|
|
41
|
+
for (const d of m)
|
|
42
|
+
o.push(`${c}-${d}: ${n[d]};`);
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
o.push(`${a}: ${t};`);
|
|
46
|
+
for (const n of i) o.push(`${n}: ${t};`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return o.join(`
|
|
50
|
+
`);
|
|
51
|
+
}, b = (r) => {
|
|
52
|
+
const l = f(r.light, "light"), o = f(r.dark, "dark");
|
|
53
|
+
return `:root {
|
|
54
|
+
${l}
|
|
55
|
+
}
|
|
56
|
+
:root.dark {
|
|
57
|
+
${o}
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
};
|
|
61
|
+
function E(r) {
|
|
62
|
+
const l = r.document ?? (typeof document < "u" ? document : void 0);
|
|
63
|
+
if (!l) return;
|
|
64
|
+
const o = () => {
|
|
65
|
+
let e = l.getElementById(h);
|
|
66
|
+
return e || (e = l.createElement("style"), e.id = h, l.head.appendChild(e)), e;
|
|
67
|
+
};
|
|
68
|
+
u(
|
|
69
|
+
r.getThemeConfig,
|
|
70
|
+
(e) => {
|
|
71
|
+
o().textContent = b(e);
|
|
72
|
+
},
|
|
73
|
+
{ deep: !0, immediate: !0 }
|
|
74
|
+
), u(
|
|
75
|
+
r.getThemeIsDark,
|
|
76
|
+
(e) => {
|
|
77
|
+
l.documentElement.classList.toggle("dark", e);
|
|
78
|
+
},
|
|
79
|
+
{ immediate: !0 }
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
E as useAdminThemeApply
|
|
84
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { watch as i } from "vue";
|
|
2
|
+
const n = "admin-core-viewport", r = (e) => {
|
|
3
|
+
const o = e.paddingLeft + e.paddingRight, d = e.paddingTop + e.paddingBottom;
|
|
4
|
+
return `:root {
|
|
5
|
+
--admin-core-viewport-width: calc(100vw - ${o}px);
|
|
6
|
+
--admin-core-viewport-height: calc(100vh - ${d}px);
|
|
7
|
+
}
|
|
8
|
+
`;
|
|
9
|
+
};
|
|
10
|
+
function c(e) {
|
|
11
|
+
const o = e.document ?? (typeof document < "u" ? document : void 0);
|
|
12
|
+
if (!o) return;
|
|
13
|
+
const d = () => {
|
|
14
|
+
let t = o.getElementById(n);
|
|
15
|
+
return t || (t = o.createElement("style"), t.id = n, o.head.appendChild(t)), t;
|
|
16
|
+
};
|
|
17
|
+
i(
|
|
18
|
+
e.getViewportConfig,
|
|
19
|
+
(t) => {
|
|
20
|
+
d().textContent = r(t);
|
|
21
|
+
},
|
|
22
|
+
{ deep: !0, immediate: !0 }
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
c as useAdminViewportApply
|
|
27
|
+
};
|