@done-coding/admin-core 0.9.1-alpha.0 → 0.10.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/config-hook.mjs +32 -26
- package/es/bridge/index.mjs +129 -83
- package/es/bridge/theme/index.mjs +103 -0
- package/es/bridge/theme/persist.mjs +14 -0
- package/es/bridge/theme/system-dark.mjs +11 -0
- package/es/components/app-layout/AppAside.vue.mjs +7 -0
- package/es/components/app-layout/AppAside.vue2.mjs +22 -0
- package/es/components/app-layout/AppFooter.vue.mjs +2 -2
- package/es/components/app-layout/AppHeader.vue.mjs +2 -2
- package/es/components/app-layout/AppHeader.vue2.mjs +35 -41
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +106 -88
- package/es/components/app-layout/AppShell.vue.mjs +60 -0
- package/es/components/app-layout/AppShell.vue2.mjs +4 -0
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +44 -47
- package/es/components/app-layout/AppTheme.vue.mjs +2 -2
- package/es/components/app-layout/AppTheme.vue2.mjs +55 -25
- package/es/components/app-layout/viewport.mjs +5 -0
- package/es/components/form/FormItemNestForm.vue.mjs +1 -1
- package/es/components/form/FormItemNestFormList.vue.mjs +1 -1
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +1 -1
- package/es/hooks/use-admin-theme-apply.mjs +16 -15
- package/es/hooks/use-admin-viewport-apply.mjs +29 -17
- package/es/index.mjs +182 -175
- package/es/store/app.mjs +133 -77
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/bridge/config-hook.d.ts +10 -2
- package/types/bridge/index.d.ts +105 -5
- package/types/bridge/theme/index.d.ts +10 -0
- package/types/bridge/theme/persist.d.ts +23 -0
- package/types/bridge/theme/system-dark.d.ts +14 -0
- package/types/bridge/theme/types.d.ts +258 -0
- package/types/components/app-layout/AppAside.vue.d.ts +21 -0
- package/types/components/app-layout/AppLayout.vue.d.ts +2 -7
- package/types/components/app-layout/AppShell.vue.d.ts +27 -0
- package/types/components/app-layout/index.d.ts +4 -1
- package/types/components/app-layout/types.d.ts +117 -1
- package/types/components/app-layout/viewport.d.ts +30 -0
- package/types/hooks/use-admin-viewport-apply.d.ts +6 -1
- package/types/store/app.d.ts +24 -83
- package/types/types/route.d.ts +2 -0
- package/es/bridge/theme.mjs +0 -65
- package/types/bridge/theme.d.ts +0 -85
package/es/index.mjs
CHANGED
|
@@ -1,197 +1,204 @@
|
|
|
1
|
-
import { createAdminBridge as
|
|
1
|
+
import { createAdminBridge as r } from "./bridge/index.mjs";
|
|
2
2
|
import { default as a } from "./components/display/ActionBtn.vue.mjs";
|
|
3
3
|
import { default as f } from "./components/display/ActionBtnGroup.vue.mjs";
|
|
4
4
|
import { default as s } from "./components/display/BooleanTag.vue.mjs";
|
|
5
5
|
import { default as l } from "./components/modal/DetailModal.vue.mjs";
|
|
6
6
|
import { default as d } from "./components/form/FormRadioGroup.vue.mjs";
|
|
7
7
|
import { default as n } from "./components/form/FormSelect.vue.mjs";
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
8
|
+
import { default as A } from "./components/form/FormSubmitBtn.vue.mjs";
|
|
9
|
+
import { default as c } from "./components/form/FormTree.vue.mjs";
|
|
10
10
|
import { default as T } from "./components/form/FormVerifyCode.vue.mjs";
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
11
|
+
import { default as P } from "./components/display/HeightProvider.vue.mjs";
|
|
12
|
+
import { default as F } from "./components/menu/MenuItemSub.vue.mjs";
|
|
13
|
+
import { default as M } from "./components/menu/MenuTree.vue.mjs";
|
|
14
|
+
import { default as g } from "./components/modal/ModalPorter.vue.mjs";
|
|
15
|
+
import { default as C } from "./components/modal/ModalShelf.vue.mjs";
|
|
16
16
|
import { default as D } from "./components/panel/PanelItem.vue.mjs";
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
17
|
+
import { default as B } from "./components/panel/PanelItemNestPanel.vue.mjs";
|
|
18
|
+
import { default as Y } from "./components/misc/SelectModule.vue.mjs";
|
|
19
|
+
import { default as U } from "./components/display/TabsMain.vue.mjs";
|
|
20
20
|
import { default as K } from "./components/misc/TriggerAutoImport.vue.mjs";
|
|
21
21
|
import { default as w } from "./components/display/WatchSize.vue.mjs";
|
|
22
|
-
import { ADMIN_BRIDGE_KEY as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
46
|
-
import { default as Ao } from "./components/
|
|
47
|
-
import { default as co } from "./components/
|
|
48
|
-
import {
|
|
49
|
-
import { default as
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
22
|
+
import { ADMIN_BRIDGE_KEY as W, APP_LAYOUT_APP_STORE_KEY as k, APP_LAYOUT_BRIDGE_KEY as X, APP_LAYOUT_USER_STORE_KEY as z, BODY_CONTENT_VIEWPORT_HEIGHT as Z, FORM_NEST_REGISTRY_KEY as j, NEST_LAYOUT_SCALE_KEY as Q, TABS_MAIN_VISUAL_LEVEL as q, getModalShelfInjectionKey as J } from "./inject/key.mjs";
|
|
23
|
+
import { ADMIN_CORE_VIEWPORT_DECOR_ZINDEX_ABOVE as ee, ADMIN_CORE_VIEWPORT_DECOR_ZINDEX_BELOW as oe } from "./components/app-layout/viewport.mjs";
|
|
24
|
+
import { APP_API_LIST_MODEL_KEY_CONFIG as te } from "./config/list-model.mjs";
|
|
25
|
+
import { default as me } from "./components/display/ActionConfirm.vue.mjs";
|
|
26
|
+
import { default as pe } from "./components/app-layout/AppAside.vue.mjs";
|
|
27
|
+
import { default as ue } from "./components/app-layout/AppBody.vue.mjs";
|
|
28
|
+
import { default as xe } from "./components/app-layout/AppBreadcrumb.vue.mjs";
|
|
29
|
+
import { default as ie } from "./components/app-layout/AppFooter.vue.mjs";
|
|
30
|
+
import { default as _e } from "./components/app-layout/AppHeader.vue.mjs";
|
|
31
|
+
import { default as Ee } from "./components/app-layout/AppLayout.vue.mjs";
|
|
32
|
+
import { default as Se } from "./components/app-layout/AppPage.vue.mjs";
|
|
33
|
+
import { default as Ie } from "./components/app-layout/AppSidebar.vue.mjs";
|
|
34
|
+
import { default as Re } from "./components/app-layout/AppTheme.vue.mjs";
|
|
35
|
+
import { default as Le } from "./components/misc/AutoRefresh.vue.mjs";
|
|
36
|
+
import { default as Oe } from "./components/misc/AutoRefreshGroup.vue.mjs";
|
|
37
|
+
import { default as Ne } from "./components/modal/ConfirmModal.vue.mjs";
|
|
38
|
+
import { EXPORT_MAX_LIMIT as he, OPERATE_COLUMN_PROP as De, exportCSV as ye, pickExportColumns as Be } from "./utils/export.mjs";
|
|
39
|
+
import { FORM_CONFIG_SELECT_ALL_VALUE as Ye, getConfirmPasswordRule as Ge, passwordRule as Ue, setFormComponentType as be } from "./helpers/form.mjs";
|
|
40
|
+
import { FORM_ITEM_CHANGE_LOADING as ve, NEST_LAYOUT_TIERS as we, ceilToTier as He, generateFormData as We, getBlurSubmit as ke, getChangeSubmit as Xe, getDatePickerShortcuts as ze, getEnterSubmit as Ze, getPlaceholder as je, getVModelSugar as Qe, parseFormData as qe, resolveFormLayout as Je, resolveLayoutSpan as $e, setInputComponent as eo, setSelectComponent as oo, stringifyFormData as ro, swiftFormItemConfig as to } from "./components/form/utils.mjs";
|
|
41
|
+
import { default as mo } from "./components/form/FormItemNestForm.vue.mjs";
|
|
42
|
+
import { default as po } from "./components/form/FormItemNestFormList.vue.mjs";
|
|
43
|
+
import { default as uo } from "./components/form/FormMain.vue.mjs";
|
|
44
|
+
import { default as xo } from "./components/form/FormSearch.vue.mjs";
|
|
45
|
+
import { default as no } from "./components/form/FormSubmitPanel.vue.mjs";
|
|
46
|
+
import { default as Ao } from "./components/form/FormVerifyImage.vue.mjs";
|
|
47
|
+
import { default as co } from "./components/list-page/ListPage.vue.mjs";
|
|
48
|
+
import { default as To } from "./components/panel/PanelEditSwitch.vue.mjs";
|
|
49
|
+
import { default as Po } from "./components/panel/PanelItemNestForm.vue.mjs";
|
|
50
|
+
import { default as Fo } from "./components/panel/PanelMain.vue.mjs";
|
|
51
|
+
import { ROUTE_MODULE_LEVEL as Mo, TabsMainReplaceQueryKey as Oo } from "./config/route.mjs";
|
|
52
|
+
import { default as No } from "./components/table/TableMain.vue.mjs";
|
|
53
|
+
import { checkLogin as ho } from "./router/guard/login.mjs";
|
|
54
|
+
import { checkPermission as yo } from "./router/guard/permission.mjs";
|
|
55
|
+
import { countAll as Vo, createListApi as Yo, fetchListAll as Go } from "./helpers/list-helper.mjs";
|
|
56
|
+
import { createAppStore as bo } from "./store/app.mjs";
|
|
57
|
+
import { createGenerateRouteMetaRawTree as vo } from "./bridge/route.mjs";
|
|
58
|
+
import { createGuard as Ho } from "./router/guard/index.mjs";
|
|
59
|
+
import { createNestFormExposeMap as ko } from "./components/form/nest-registry.mjs";
|
|
60
|
+
import { createRoutePermissionStore as zo } from "./store/router-permission.mjs";
|
|
61
|
+
import { createStorageWithNamespace as jo } from "./bridge/storage.mjs";
|
|
62
|
+
import { createUseState as qo } from "./bridge/state.mjs";
|
|
63
|
+
import { createUserStore as $o } from "./store/user.mjs";
|
|
64
|
+
import { flatRouteMetaResolveRaw as or, getRoutePermissionKey as rr } from "./utils/router.mjs";
|
|
65
|
+
import { getId as ar } from "./utils/id.mjs";
|
|
66
|
+
import { nestFormItem as fr } from "./components/form/nest-form-item.mjs";
|
|
67
|
+
import { nestFormItemList as sr } from "./components/form/nest-form-item-list.mjs";
|
|
68
|
+
import { nestPanelForm as lr } from "./components/panel/nest-panel-form.mjs";
|
|
69
|
+
import { nestPanelItem as dr } from "./components/panel/nest-panel-item.mjs";
|
|
70
|
+
import { themeScaleDerive as nr, themeScaleMix as _r } from "./utils/theme-scale.mjs";
|
|
71
|
+
import { timeCountDown as Er } from "./utils/time.mjs";
|
|
72
|
+
import { useActivated as Sr, useActivatedEvent as Tr, useActivatedExec as Ir } from "./hooks/activated.mjs";
|
|
73
|
+
import { useAdminThemeApply as Rr } from "./hooks/use-admin-theme-apply.mjs";
|
|
74
|
+
import { useAdminViewportApply as Lr } from "./hooks/use-admin-viewport-apply.mjs";
|
|
75
|
+
import { useBreakpoint as Or } from "./hooks/use-breakpoint.mjs";
|
|
76
|
+
import { useChannelViewportHeight as Nr } from "./hooks/use-channel-viewport-height.mjs";
|
|
77
|
+
import { useFeelSize as hr } from "./hooks/feel-size.mjs";
|
|
78
|
+
import { useMenusDataDispatch as yr } from "./hooks/menus-dispatch.mjs";
|
|
79
|
+
import { useNestForm as Vr } from "./components/form/use-nest-form.mjs";
|
|
80
|
+
import { useNestFormList as Gr } from "./components/form/use-nest-form-list.mjs";
|
|
81
|
+
import { useNestLayoutScale as br } from "./components/form/use-nest-layout-scale.mjs";
|
|
82
|
+
import { useTimeout as vr } from "./hooks/timeout.mjs";
|
|
80
83
|
export {
|
|
81
|
-
|
|
82
|
-
ee as
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
W as ADMIN_BRIDGE_KEY,
|
|
85
|
+
ee as ADMIN_CORE_VIEWPORT_DECOR_ZINDEX_ABOVE,
|
|
86
|
+
oe as ADMIN_CORE_VIEWPORT_DECOR_ZINDEX_BELOW,
|
|
87
|
+
te as APP_API_LIST_MODEL_KEY_CONFIG,
|
|
88
|
+
k as APP_LAYOUT_APP_STORE_KEY,
|
|
89
|
+
X as APP_LAYOUT_BRIDGE_KEY,
|
|
90
|
+
z as APP_LAYOUT_USER_STORE_KEY,
|
|
86
91
|
a as ActionBtn,
|
|
87
92
|
f as ActionBtnGroup,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
me as ActionConfirm,
|
|
94
|
+
pe as AppAside,
|
|
95
|
+
ue as AppBody,
|
|
96
|
+
xe as AppBreadcrumb,
|
|
97
|
+
ie as AppFooter,
|
|
98
|
+
_e as AppHeader,
|
|
99
|
+
Ee as AppLayout,
|
|
100
|
+
Se as AppPage,
|
|
101
|
+
Ie as AppSidebar,
|
|
102
|
+
Re as AppTheme,
|
|
103
|
+
Le as AutoRefresh,
|
|
104
|
+
Oe as AutoRefreshGroup,
|
|
105
|
+
Z as BODY_CONTENT_VIEWPORT_HEIGHT,
|
|
99
106
|
s as BooleanTag,
|
|
100
|
-
|
|
107
|
+
Ne as ConfirmModal,
|
|
101
108
|
l as DetailModal,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
he as EXPORT_MAX_LIMIT,
|
|
110
|
+
Ye as FORM_CONFIG_SELECT_ALL_VALUE,
|
|
111
|
+
ve as FORM_ITEM_CHANGE_LOADING,
|
|
112
|
+
j as FORM_NEST_REGISTRY_KEY,
|
|
113
|
+
mo as FormItemNestForm,
|
|
114
|
+
po as FormItemNestFormList,
|
|
115
|
+
uo as FormMain,
|
|
109
116
|
d as FormRadioGroup,
|
|
110
|
-
|
|
117
|
+
xo as FormSearch,
|
|
111
118
|
n as FormSelect,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
A as FormSubmitBtn,
|
|
120
|
+
no as FormSubmitPanel,
|
|
121
|
+
c as FormTree,
|
|
115
122
|
T as FormVerifyCode,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
Ao as FormVerifyImage,
|
|
124
|
+
P as HeightProvider,
|
|
125
|
+
co as ListPage,
|
|
126
|
+
F as MenuItemSub,
|
|
127
|
+
M as MenuTree,
|
|
128
|
+
g as ModalPorter,
|
|
129
|
+
C as ModalShelf,
|
|
130
|
+
Q as NEST_LAYOUT_SCALE_KEY,
|
|
131
|
+
we as NEST_LAYOUT_TIERS,
|
|
132
|
+
De as OPERATE_COLUMN_PROP,
|
|
133
|
+
To as PanelEditSwitch,
|
|
127
134
|
D as PanelItem,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
Po as PanelItemNestForm,
|
|
136
|
+
B as PanelItemNestPanel,
|
|
137
|
+
Fo as PanelMain,
|
|
138
|
+
Mo as ROUTE_MODULE_LEVEL,
|
|
139
|
+
Y as SelectModule,
|
|
140
|
+
q as TABS_MAIN_VISUAL_LEVEL,
|
|
141
|
+
No as TableMain,
|
|
142
|
+
U as TabsMain,
|
|
143
|
+
Oo as TabsMainReplaceQueryKey,
|
|
137
144
|
K as TriggerAutoImport,
|
|
138
145
|
w as WatchSize,
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
146
|
+
He as ceilToTier,
|
|
147
|
+
ho as checkLogin,
|
|
148
|
+
yo as checkPermission,
|
|
149
|
+
Vo as countAll,
|
|
150
|
+
r as createAdminBridge,
|
|
151
|
+
bo as createAppStore,
|
|
152
|
+
vo as createGenerateRouteMetaRawTree,
|
|
153
|
+
Ho as createGuard,
|
|
154
|
+
Yo as createListApi,
|
|
155
|
+
ko as createNestFormExposeMap,
|
|
156
|
+
zo as createRoutePermissionStore,
|
|
157
|
+
jo as createStorageWithNamespace,
|
|
158
|
+
qo as createUseState,
|
|
159
|
+
$o as createUserStore,
|
|
160
|
+
ye as exportCSV,
|
|
161
|
+
Go as fetchListAll,
|
|
162
|
+
or as flatRouteMetaResolveRaw,
|
|
163
|
+
We as generateFormData,
|
|
164
|
+
ke as getBlurSubmit,
|
|
165
|
+
Xe as getChangeSubmit,
|
|
166
|
+
Ge as getConfirmPasswordRule,
|
|
167
|
+
ze as getDatePickerShortcuts,
|
|
168
|
+
Ze as getEnterSubmit,
|
|
169
|
+
ar as getId,
|
|
170
|
+
J as getModalShelfInjectionKey,
|
|
171
|
+
je as getPlaceholder,
|
|
172
|
+
rr as getRoutePermissionKey,
|
|
173
|
+
Qe as getVModelSugar,
|
|
174
|
+
fr as nestFormItem,
|
|
175
|
+
sr as nestFormItemList,
|
|
176
|
+
lr as nestPanelForm,
|
|
177
|
+
dr as nestPanelItem,
|
|
178
|
+
qe as parseFormData,
|
|
179
|
+
Ue as passwordRule,
|
|
180
|
+
Be as pickExportColumns,
|
|
181
|
+
Je as resolveFormLayout,
|
|
182
|
+
$e as resolveLayoutSpan,
|
|
183
|
+
be as setFormComponentType,
|
|
184
|
+
eo as setInputComponent,
|
|
185
|
+
oo as setSelectComponent,
|
|
186
|
+
ro as stringifyFormData,
|
|
187
|
+
to as swiftFormItemConfig,
|
|
188
|
+
nr as themeScaleDerive,
|
|
189
|
+
_r as themeScaleMix,
|
|
190
|
+
Er as timeCountDown,
|
|
191
|
+
Sr as useActivated,
|
|
192
|
+
Tr as useActivatedEvent,
|
|
193
|
+
Ir as useActivatedExec,
|
|
194
|
+
Rr as useAdminThemeApply,
|
|
195
|
+
Lr as useAdminViewportApply,
|
|
196
|
+
Or as useBreakpoint,
|
|
197
|
+
Nr as useChannelViewportHeight,
|
|
198
|
+
hr as useFeelSize,
|
|
199
|
+
yr as useMenusDataDispatch,
|
|
200
|
+
Vr as useNestForm,
|
|
201
|
+
Gr as useNestFormList,
|
|
202
|
+
br as useNestLayoutScale,
|
|
203
|
+
vr as useTimeout
|
|
197
204
|
};
|
package/es/store/app.mjs
CHANGED
|
@@ -1,94 +1,150 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { computed as
|
|
4
|
-
function
|
|
5
|
-
const { bridge:
|
|
6
|
-
return
|
|
7
|
-
const
|
|
1
|
+
import { defineStore as D } from "pinia";
|
|
2
|
+
import { useRoute as k } from "vue-router";
|
|
3
|
+
import { computed as o, ref as I } from "vue";
|
|
4
|
+
function W(E) {
|
|
5
|
+
const { bridge: a } = E;
|
|
6
|
+
return D("APP", () => {
|
|
7
|
+
const _ = o(() => a.APP_LAYOUT_HEADER_CONFIG.height), p = o(() => a.APP_LAYOUT_FOOTER_CONFIG.height), F = o(() => a.APP_BASE_INFO.name), r = I(!1), A = I(!1), f = o(() => r.value ? a.APP_LAYOUT_SIDEBAR_CONFIG.collapseWidth : a.APP_LAYOUT_SIDEBAR_CONFIG.width), C = k(), u = o(() => a.themeColors.value), g = o(() => C.meta), c = o(() => g.value.layout), S = o(() => g.value.keepAlive), s = o(
|
|
8
8
|
() => {
|
|
9
|
-
var
|
|
10
|
-
return ((
|
|
9
|
+
var e;
|
|
10
|
+
return ((e = c.value) == null ? void 0 : e.header) ?? a.APP_ROUTER_META_DEFAULT_CONFIG.showHeader;
|
|
11
11
|
}
|
|
12
|
-
),
|
|
12
|
+
), n = o(
|
|
13
13
|
() => {
|
|
14
|
-
var
|
|
15
|
-
return ((
|
|
14
|
+
var e;
|
|
15
|
+
return ((e = c.value) == null ? void 0 : e.footer) ?? a.APP_ROUTER_META_DEFAULT_CONFIG.showFooter;
|
|
16
16
|
}
|
|
17
|
-
),
|
|
17
|
+
), $ = o(
|
|
18
|
+
() => s.value && _.value > 0
|
|
19
|
+
), P = o(
|
|
20
|
+
() => n.value && p.value > 0
|
|
21
|
+
), v = o(
|
|
18
22
|
() => {
|
|
19
|
-
var
|
|
20
|
-
return (((
|
|
23
|
+
var e;
|
|
24
|
+
return (((e = c.value) == null ? void 0 : e.sidebar) ?? a.APP_ROUTER_META_DEFAULT_CONFIG.showSidebar) && A.value;
|
|
21
25
|
}
|
|
22
|
-
),
|
|
26
|
+
), d = o(
|
|
23
27
|
() => {
|
|
24
|
-
var
|
|
25
|
-
return ((
|
|
28
|
+
var e;
|
|
29
|
+
return ((e = c.value) == null ? void 0 : e.aside) ?? a.APP_ROUTER_META_DEFAULT_CONFIG.showAside ?? !1;
|
|
26
30
|
}
|
|
27
|
-
),
|
|
31
|
+
), R = o(
|
|
28
32
|
() => {
|
|
29
|
-
var
|
|
30
|
-
return ((
|
|
33
|
+
var e;
|
|
34
|
+
return ((e = c.value) == null ? void 0 : e.breadcrumb) ?? a.APP_ROUTER_META_DEFAULT_CONFIG.showBreadcrumb;
|
|
31
35
|
}
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
36
|
+
), O = o(
|
|
37
|
+
() => {
|
|
38
|
+
var e;
|
|
39
|
+
return ((e = c.value) == null ? void 0 : e.bodyShimPadding) ?? a.APP_LAYOUT_BODY_CONFIG.shimPadding;
|
|
40
|
+
}
|
|
41
|
+
), l = o(() => ({
|
|
42
|
+
top: `${a.APP_LAYOUT_VIEWPORT_CONFIG.paddingTop}px`,
|
|
43
|
+
right: `${a.APP_LAYOUT_VIEWPORT_CONFIG.paddingRight}px`,
|
|
44
|
+
bottom: `${a.APP_LAYOUT_VIEWPORT_CONFIG.paddingBottom}px`,
|
|
45
|
+
left: `${a.APP_LAYOUT_VIEWPORT_CONFIG.paddingLeft}px`
|
|
46
|
+
})), U = o(() => a.APP_LAYOUT_GAP_CONFIG.size), t = o(() => `${U.value}px`), i = o(() => {
|
|
47
|
+
const e = a.APP_LAYOUT_HEADER_CONFIG;
|
|
48
|
+
return {
|
|
49
|
+
...e.style,
|
|
50
|
+
position: "fixed",
|
|
51
|
+
// 通栏悬浮:三外边各让外缝 gap(底边朝内容,由下方模块 top 让内缝)。
|
|
52
|
+
top: `calc(${l.value.top} + ${t.value})`,
|
|
53
|
+
left: `calc(${l.value.left} + ${t.value})`,
|
|
54
|
+
right: `calc(${l.value.right} + ${t.value})`,
|
|
55
|
+
height: `${s.value ? _.value : 0}px`,
|
|
56
|
+
background: e.background ?? u.value.bodyColor,
|
|
57
|
+
...e.color ? { color: e.color } : {}
|
|
58
|
+
};
|
|
59
|
+
}), h = o(
|
|
60
|
+
() => $.value ? `calc(${l.value.top} + ${t.value} + ${i.value.height} + ${t.value})` : `calc(${l.value.top} + ${t.value})`
|
|
61
|
+
), T = o(() => {
|
|
62
|
+
const e = a.APP_LAYOUT_FOOTER_CONFIG;
|
|
63
|
+
return {
|
|
64
|
+
...e.style,
|
|
65
|
+
height: `${n.value ? p.value : 0}px`,
|
|
66
|
+
// footer 在 body 流内:marginTop 与内容 shim 隔内缝;底边悬浮由 body paddingBottom 承担。
|
|
67
|
+
// 用 hasFooter:footer 收起到 0 高时不留死内缝 gap(对称 hasHeader)。
|
|
68
|
+
marginTop: P.value ? t.value : "0px",
|
|
69
|
+
background: e.background ?? u.value.bodyColor,
|
|
70
|
+
...e.color ? { color: e.color } : {}
|
|
71
|
+
};
|
|
72
|
+
}), b = o(() => {
|
|
73
|
+
const e = a.APP_LAYOUT_SIDEBAR_CONFIG;
|
|
74
|
+
return {
|
|
75
|
+
...e.style,
|
|
76
|
+
position: "fixed",
|
|
77
|
+
width: `${v.value ? f.value : 0}px`,
|
|
78
|
+
// 悬浮:左/下各让外缝 gap;顶 = 内容行顶(外缝 + header 高 + 内缝);paddingTop 归 0(让位已由 top 承担)。
|
|
79
|
+
top: h.value,
|
|
80
|
+
left: `calc(${l.value.left} + ${t.value})`,
|
|
81
|
+
bottom: `calc(${l.value.bottom} + ${t.value})`,
|
|
82
|
+
paddingTop: "0px",
|
|
83
|
+
background: e.background ?? u.value.bodyColor,
|
|
84
|
+
...e.color ? { color: e.color } : {}
|
|
85
|
+
};
|
|
86
|
+
}), m = o(() => {
|
|
87
|
+
const e = a.APP_LAYOUT_ASIDE_CONFIG;
|
|
88
|
+
return {
|
|
89
|
+
...e.style,
|
|
90
|
+
position: "fixed",
|
|
91
|
+
width: `${d.value ? e.width : 0}px`,
|
|
92
|
+
// 对称 sidebar:右/下各让外缝 gap;顶 = 内容行顶。
|
|
93
|
+
top: h.value,
|
|
94
|
+
right: `calc(${l.value.right} + ${t.value})`,
|
|
95
|
+
bottom: `calc(${l.value.bottom} + ${t.value})`,
|
|
96
|
+
paddingTop: "0px",
|
|
97
|
+
background: e.background ?? u.value.bodyColor,
|
|
98
|
+
...e.color ? { color: e.color } : {}
|
|
99
|
+
};
|
|
100
|
+
}), L = o(() => ({
|
|
101
|
+
// 内容左让位:外框左 + 外缝;有 sidebar 再加 sidebar 宽 + 内缝。
|
|
102
|
+
paddingLeft: v.value ? `calc(${l.value.left} + ${t.value} + ${b.value.width} + ${t.value})` : `calc(${l.value.left} + ${t.value})`,
|
|
103
|
+
// 顶让位 = 内容行顶(与 sidebar/aside 同行)。
|
|
104
|
+
paddingTop: h.value,
|
|
105
|
+
// 右让位(对称左):外框右 + 外缝;有 aside 再加 aside 宽 + 内缝。
|
|
106
|
+
paddingRight: d.value ? `calc(${l.value.right} + ${t.value} + ${m.value.width} + ${t.value})` : `calc(${l.value.right} + ${t.value})`,
|
|
107
|
+
// 底让位:外框下 + 外缝(footer 在流内,其底悬浮由此承担)。
|
|
108
|
+
paddingBottom: `calc(${l.value.bottom} + ${t.value})`,
|
|
109
|
+
backgroundColor: u.value.bodyColor
|
|
110
|
+
})), y = o(() => {
|
|
111
|
+
const e = $.value ? ` - ${i.value.height} - ${t.value}` : "", x = P.value ? ` - ${T.value.height} - ${t.value}` : "";
|
|
112
|
+
return {
|
|
113
|
+
minHeight: `calc(100vh - ${l.value.top} - ${l.value.bottom} - ${t.value} - ${t.value}${e}${x})`,
|
|
114
|
+
padding: `${O.value}px`
|
|
115
|
+
};
|
|
116
|
+
}), G = (e) => {
|
|
117
|
+
r.value = e;
|
|
118
|
+
}, N = (e) => {
|
|
119
|
+
A.value = e;
|
|
120
|
+
}, w = (e) => {
|
|
121
|
+
a.theme.setDark(e);
|
|
67
122
|
};
|
|
68
123
|
return {
|
|
69
|
-
name:
|
|
70
|
-
isDarkTheme:
|
|
71
|
-
theme:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
showBreadcrumb:
|
|
77
|
-
keepAlive:
|
|
78
|
-
headerStyle:
|
|
79
|
-
footerStyle:
|
|
80
|
-
sidebarStyle:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
124
|
+
name: F,
|
|
125
|
+
isDarkTheme: o(() => a.themeIsDark.value),
|
|
126
|
+
theme: u,
|
|
127
|
+
showHeader: s,
|
|
128
|
+
showFooter: n,
|
|
129
|
+
showSidebar: v,
|
|
130
|
+
showAside: d,
|
|
131
|
+
showBreadcrumb: R,
|
|
132
|
+
keepAlive: S,
|
|
133
|
+
headerStyle: i,
|
|
134
|
+
footerStyle: T,
|
|
135
|
+
sidebarStyle: b,
|
|
136
|
+
asideStyle: m,
|
|
137
|
+
bodyStyle: L,
|
|
138
|
+
bodyShimPadding: O,
|
|
139
|
+
bodyShimStyle: y,
|
|
140
|
+
viewportPadding: l,
|
|
141
|
+
sidebarIsCollapse: o(() => r.value),
|
|
142
|
+
changeSidebarCollapseStatus: G,
|
|
143
|
+
changeSidebarHasMenusStatus: N,
|
|
144
|
+
changeIsDarkTheme: w
|
|
89
145
|
};
|
|
90
146
|
});
|
|
91
147
|
}
|
|
92
148
|
export {
|
|
93
|
-
|
|
149
|
+
W as createAppStore
|
|
94
150
|
};
|