@done-coding/admin-core 0.1.4 → 0.2.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.
Files changed (42) hide show
  1. package/es/components/misc/ActionBtn.vue.mjs +117 -0
  2. package/es/components/misc/ActionBtn.vue2.mjs +4 -0
  3. package/es/components/misc/ActionConfirm.vue.mjs +7 -0
  4. package/es/components/misc/ActionConfirm.vue2.mjs +113 -0
  5. package/es/components/misc/index.mjs +11 -5
  6. package/es/components/modal/ModalPorter.vue.mjs +52 -0
  7. package/es/components/modal/ModalPorter.vue2.mjs +4 -0
  8. package/es/components/modal/ModalShelf.vue.mjs +38 -0
  9. package/es/components/modal/ModalShelf.vue2.mjs +4 -0
  10. package/es/components/modal/index.mjs +17 -11
  11. package/es/components/modal/modal-shelf-core.mjs +52 -0
  12. package/es/components/modal/modal-shelf-hierarchy.mjs +21 -0
  13. package/es/components/panel/PanelEditSwitch.vue.mjs +7 -0
  14. package/es/components/panel/PanelEditSwitch.vue2.mjs +93 -0
  15. package/es/components/panel/PanelItem.vue.mjs +54 -0
  16. package/es/components/panel/PanelItem.vue2.mjs +4 -0
  17. package/es/components/panel/PanelMain.vue.mjs +80 -0
  18. package/es/components/panel/PanelMain.vue2.mjs +4 -0
  19. package/es/components/panel/index.mjs +20 -0
  20. package/es/index.mjs +126 -109
  21. package/es/inject/key.mjs +8 -4
  22. package/es/style.css +1 -1
  23. package/package.json +2 -2
  24. package/types/components/misc/ActionBtn.vue.d.ts +26 -0
  25. package/types/components/misc/ActionConfirm.vue.d.ts +41 -0
  26. package/types/components/misc/index.d.ts +4 -1
  27. package/types/components/misc/types.d.ts +80 -0
  28. package/types/components/modal/ConfirmModal.vue.d.ts +2 -2
  29. package/types/components/modal/ModalPorter.vue.d.ts +29 -0
  30. package/types/components/modal/ModalShelf.vue.d.ts +36 -0
  31. package/types/components/modal/index.d.ts +5 -1
  32. package/types/components/modal/modal-shelf-core.d.ts +10 -0
  33. package/types/components/modal/modal-shelf-hierarchy.d.ts +7 -0
  34. package/types/components/modal/modal-shelf-types.d.ts +74 -0
  35. package/types/components/panel/PanelEditSwitch.vue.d.ts +31 -0
  36. package/types/components/panel/PanelItem.vue.d.ts +21 -0
  37. package/types/components/panel/PanelMain.vue.d.ts +17 -0
  38. package/types/components/panel/index.d.ts +9 -0
  39. package/types/components/panel/types.d.ts +62 -0
  40. package/types/components/table/TableToolbar.vue.d.ts +8 -8
  41. package/types/index.d.ts +3 -1
  42. package/types/inject/key.d.ts +8 -0
@@ -0,0 +1,80 @@
1
+ import { ElRow as x, ElCol as R } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/row/style/css";
4
+ import "element-plus/es/components/col/style/css";
5
+ import { defineComponent as L, ref as B, computed as F, watch as M, openBlock as s, createBlock as f, withCtx as l, createElementBlock as P, Fragment as b, renderList as D, unref as u, withDirectives as S, mergeProps as U, createVNode as j, vShow as H } from "vue";
6
+ import N from "./PanelItem.vue.mjs";
7
+ import { resolveFormLayout as m } from "../form/utils.mjs";
8
+ const I = /* @__PURE__ */ L({
9
+ name: "PanelMain",
10
+ __name: "PanelMain",
11
+ props: {
12
+ data: {},
13
+ layout: { default: () => ({ span: 24 }) },
14
+ list: {}
15
+ },
16
+ emits: ["refresh"],
17
+ setup(c, { emit: p }) {
18
+ const n = c, d = p, g = (e) => e, h = (e) => e, a = B({}), y = F(
19
+ () => n.list.map((e, t) => ({ config: e, index: t })).sort((e, t) => {
20
+ const o = e.config.order ?? e.index, i = t.config.order ?? t.index;
21
+ return o - i;
22
+ })
23
+ ), _ = (e) => {
24
+ const { hide: t } = e;
25
+ if (typeof t == "function") {
26
+ const o = {
27
+ data: n.data,
28
+ value: n.data[e.key],
29
+ config: e
30
+ };
31
+ return !!t(o);
32
+ }
33
+ return !!t;
34
+ }, k = (e) => ({
35
+ ...m(n.layout),
36
+ ...m(e)
37
+ }), v = (e, t) => {
38
+ a.value = {}, t && (a.value[e] = t);
39
+ }, E = (e, t) => {
40
+ e && d("refresh", t);
41
+ }, w = () => d("refresh", n.data);
42
+ return M(
43
+ () => n.list,
44
+ (e) => {
45
+ const t = e.map((o) => o.key);
46
+ Object.keys(a.value).forEach((o) => {
47
+ t.includes(o) || delete a.value[o];
48
+ });
49
+ },
50
+ { immediate: !0 }
51
+ ), (e, t) => {
52
+ const o = R, i = x;
53
+ return s(), f(i, null, {
54
+ default: l(() => [
55
+ (s(!0), P(b, null, D(u(y), (r) => S((s(), f(o, U({
56
+ key: r.config.key
57
+ }, { ref_for: !0 }, k(r.config.layout)), {
58
+ default: l(() => [
59
+ j(N, {
60
+ data: g(c.data),
61
+ config: h(r.config),
62
+ editing: u(a)[r.config.key] ?? !1,
63
+ "onUpdate:editing": (C) => v(r.config.key, C),
64
+ onSubmitFinish: E,
65
+ onRefresh: w
66
+ }, null, 8, ["data", "config", "editing", "onUpdate:editing"])
67
+ ]),
68
+ _: 2
69
+ }, 1040)), [
70
+ [H, !_(r.config)]
71
+ ])), 128))
72
+ ]),
73
+ _: 1
74
+ });
75
+ };
76
+ }
77
+ });
78
+ export {
79
+ I as default
80
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./PanelMain.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,20 @@
1
+ import e from "./PanelMain.vue.mjs";
2
+ import o from "./PanelItem.vue.mjs";
3
+ import m from "./PanelEditSwitch.vue.mjs";
4
+ const i = {
5
+ PanelMain: e,
6
+ PanelItem: o,
7
+ PanelEditSwitch: m
8
+ }, r = {
9
+ install(n) {
10
+ Object.entries(i).forEach(([t, a]) => {
11
+ n.component(t, a);
12
+ });
13
+ }
14
+ };
15
+ export {
16
+ m as PanelEditSwitch,
17
+ o as PanelItem,
18
+ e as PanelMain,
19
+ r as panelInstall
20
+ };
package/es/index.mjs CHANGED
@@ -5,124 +5,141 @@ import { miscInstall as a } from "./components/misc/index.mjs";
5
5
  import { modalInstall as m } from "./components/modal/index.mjs";
6
6
  import { tableInstall as f } from "./components/table/index.mjs";
7
7
  import { listPageInstall as s } from "./components/list-page/index.mjs";
8
- import { createAdminBridge as g } from "./bridge/index.mjs";
9
- import { default as A } from "./components/misc/ActionButton.vue.mjs";
10
- import { default as C } from "./components/misc/ActionButtonDanger.vue.mjs";
11
- import { default as F } from "./components/misc/ActionButtonWarn.vue.mjs";
12
- import { default as R } from "./components/modal/DetailModal.vue.mjs";
13
- import { default as O } from "./components/form/FormMain.vue.mjs";
14
- import { default as D } from "./components/form/FormRadioGroup.vue.mjs";
15
- import { default as h } from "./components/form/FormSelect.vue.mjs";
16
- import { default as b } from "./components/form/FormTree.vue.mjs";
17
- import { default as v } from "./components/form/FormVerifyCode.vue.mjs";
18
- import { default as U } from "./components/display/HeightProvider.vue.mjs";
19
- import { default as w } from "./components/menu/MenuItemSub.vue.mjs";
20
- import { default as W } from "./components/menu/MenuTree.vue.mjs";
21
- import { default as k } from "./components/misc/TriggerAutoImport.vue.mjs";
22
- import { default as X } from "./components/display/WatchSize.vue.mjs";
23
- import { APP_API_LIST_MODEL_KEY_CONFIG as Q } from "./config/list-model.mjs";
24
- import { default as q } from "./components/misc/AutoRefresh.vue.mjs";
25
- import { BODY_CONTENT_VIEWPORT_HEIGHT as Z, FULLSCREEN_HEIGHT_CHANNEL as $ } from "./inject/key.mjs";
26
- import { default as te } from "./components/modal/ConfirmModal.vue.mjs";
27
- import { EXPORT_MAX_LIMIT as re, OPERATE_COLUMN_PROP as ae, exportCSV as me, pickExportColumns as fe } from "./utils/export.mjs";
28
- import { FORM_CONFIG_SELECT_ALL_VALUE as le, getConfirmPasswordRule as ue, passwordRule as ie, setFormComponentType as pe } from "./helpers/form.mjs";
29
- import { FORM_ITEM_CHANGE_LOADING as xe, generateFormData as de, getBlurSubmit as ce, getChangeSubmit as Ee, getDatePickerShortcuts as Ie, getEnterSubmit as ge, getPlaceholder as _e, getVModelSugar as Ae, parseFormData as Te, resolveFormLayout as Ce, setInputComponent as Me, setSelectComponent as Fe, stringifyFormData as Le, swiftFormItemConfig as Re } from "./components/form/utils.mjs";
30
- import { default as Oe } from "./components/form/FormSearch.vue.mjs";
31
- import { default as De } from "./components/form/FormVerifyImage.vue.mjs";
32
- import { default as he } from "./components/list-page/ListPage.vue.mjs";
33
- import { ROUTE_MODULE_LEVEL as be, TabsMainReplaceQueryKey as Ge } from "./config/route.mjs";
34
- import { default as He } from "./components/table/TableMain.vue.mjs";
35
- import { default as Ve } from "./components/display/TabsMain.vue.mjs";
36
- import { countAll as Be, createListApi as We, fetchListAll as Ke } from "./helpers/list-helper.mjs";
37
- import { createGenerateRouteMetaRawTree as ze } from "./helpers/route.mjs";
38
- import { createStorageWithNamespace as Ye } from "./helpers/storage.mjs";
39
- import { createUseState as je } from "./helpers/state.mjs";
40
- import { createUserStore as Je } from "./store/user.mjs";
41
- import { flatRouteMetaResolveRaw as $e, getRoutePermissionKey as et } from "./utils/router.mjs";
42
- import { getId as ot } from "./utils/id.mjs";
43
- import { timeCountDown as at } from "./utils/time.mjs";
44
- import { useActivated as ft, useActivatedEvent as st, useActivatedExec as lt } from "./hooks/activated.mjs";
45
- import { useFeelSize as it } from "./hooks/feel-size.mjs";
46
- import { useMenusDataDispatch as nt } from "./hooks/menus-dispatch.mjs";
47
- import { useTimeout as dt } from "./hooks/timeout.mjs";
48
- const c = {
8
+ import { panelInstall as l } from "./components/panel/index.mjs";
9
+ import { createAdminBridge as A } from "./bridge/index.mjs";
10
+ import { default as C } from "./components/misc/ActionBtn.vue.mjs";
11
+ import { default as T } from "./components/misc/ActionButton.vue.mjs";
12
+ import { default as L } from "./components/misc/ActionButtonDanger.vue.mjs";
13
+ import { default as R } from "./components/misc/ActionButtonWarn.vue.mjs";
14
+ import { default as h } from "./components/modal/DetailModal.vue.mjs";
15
+ import { default as N } from "./components/form/FormMain.vue.mjs";
16
+ import { default as b } from "./components/form/FormRadioGroup.vue.mjs";
17
+ import { default as v } from "./components/form/FormSelect.vue.mjs";
18
+ import { default as B } from "./components/form/FormTree.vue.mjs";
19
+ import { default as U } from "./components/form/FormVerifyCode.vue.mjs";
20
+ import { default as K } from "./components/display/HeightProvider.vue.mjs";
21
+ import { default as k } from "./components/menu/MenuItemSub.vue.mjs";
22
+ import { default as X } from "./components/menu/MenuTree.vue.mjs";
23
+ import { default as j } from "./components/modal/ModalPorter.vue.mjs";
24
+ import { default as q } from "./components/modal/ModalShelf.vue.mjs";
25
+ import { default as Z } from "./components/panel/PanelItem.vue.mjs";
26
+ import { default as ee } from "./components/panel/PanelMain.vue.mjs";
27
+ import { default as oe } from "./components/misc/TriggerAutoImport.vue.mjs";
28
+ import { default as ae } from "./components/display/WatchSize.vue.mjs";
29
+ import { APP_API_LIST_MODEL_KEY_CONFIG as fe } from "./config/list-model.mjs";
30
+ import { default as le } from "./components/misc/ActionConfirm.vue.mjs";
31
+ import { default as ie } from "./components/misc/AutoRefresh.vue.mjs";
32
+ import { BODY_CONTENT_VIEWPORT_HEIGHT as pe, FULLSCREEN_HEIGHT_CHANNEL as xe, getModalShelfInjectionKey as de } from "./inject/key.mjs";
33
+ import { default as Ie } from "./components/modal/ConfirmModal.vue.mjs";
34
+ import { EXPORT_MAX_LIMIT as ge, OPERATE_COLUMN_PROP as Me, exportCSV as Ae, pickExportColumns as _e } from "./utils/export.mjs";
35
+ import { FORM_CONFIG_SELECT_ALL_VALUE as Se, getConfirmPasswordRule as Te, passwordRule as Fe, setFormComponentType as Le } from "./helpers/form.mjs";
36
+ import { FORM_ITEM_CHANGE_LOADING as Re, generateFormData as Oe, getBlurSubmit as he, getChangeSubmit as De, getDatePickerShortcuts as Ne, getEnterSubmit as ye, getPlaceholder as be, getVModelSugar as Ge, parseFormData as ve, resolveFormLayout as we, setInputComponent as Be, setSelectComponent as He, stringifyFormData as Ue, swiftFormItemConfig as Ve } from "./components/form/utils.mjs";
37
+ import { default as We } from "./components/form/FormSearch.vue.mjs";
38
+ import { default as ze } from "./components/form/FormVerifyImage.vue.mjs";
39
+ import { default as Ye } from "./components/list-page/ListPage.vue.mjs";
40
+ import { default as Qe } from "./components/panel/PanelEditSwitch.vue.mjs";
41
+ import { ROUTE_MODULE_LEVEL as Je, TabsMainReplaceQueryKey as Ze } from "./config/route.mjs";
42
+ import { default as et } from "./components/table/TableMain.vue.mjs";
43
+ import { default as ot } from "./components/display/TabsMain.vue.mjs";
44
+ import { countAll as at, createListApi as mt, fetchListAll as ft } from "./helpers/list-helper.mjs";
45
+ import { createGenerateRouteMetaRawTree as lt } from "./helpers/route.mjs";
46
+ import { createStorageWithNamespace as it } from "./helpers/storage.mjs";
47
+ import { createUseState as pt } from "./helpers/state.mjs";
48
+ import { createUserStore as dt } from "./store/user.mjs";
49
+ import { flatRouteMetaResolveRaw as It, getRoutePermissionKey as Et } from "./utils/router.mjs";
50
+ import { getId as Mt } from "./utils/id.mjs";
51
+ import { timeCountDown as _t } from "./utils/time.mjs";
52
+ import { useActivated as St, useActivatedEvent as Tt, useActivatedExec as Ft } from "./hooks/activated.mjs";
53
+ import { useFeelSize as Pt } from "./hooks/feel-size.mjs";
54
+ import { useMenusDataDispatch as Ot } from "./hooks/menus-dispatch.mjs";
55
+ import { useTimeout as Dt } from "./hooks/timeout.mjs";
56
+ const E = {
49
57
  install(e) {
50
- e.use(t), e.use(o), e.use(r), e.use(a), e.use(m), e.use(f), e.use(s);
58
+ e.use(t), e.use(o), e.use(r), e.use(a), e.use(m), e.use(f), e.use(s), e.use(l);
51
59
  }
52
60
  };
53
61
  export {
54
- Q as APP_API_LIST_MODEL_KEY_CONFIG,
55
- A as ActionButton,
56
- C as ActionButtonDanger,
57
- F as ActionButtonWarn,
58
- q as AutoRefresh,
59
- Z as BODY_CONTENT_VIEWPORT_HEIGHT,
60
- te as ConfirmModal,
61
- R as DetailModal,
62
- re as EXPORT_MAX_LIMIT,
63
- le as FORM_CONFIG_SELECT_ALL_VALUE,
64
- xe as FORM_ITEM_CHANGE_LOADING,
65
- $ as FULLSCREEN_HEIGHT_CHANNEL,
66
- O as FormMain,
67
- D as FormRadioGroup,
68
- Oe as FormSearch,
69
- h as FormSelect,
70
- b as FormTree,
71
- v as FormVerifyCode,
72
- De as FormVerifyImage,
73
- U as HeightProvider,
74
- he as ListPage,
75
- w as MenuItemSub,
76
- W as MenuTree,
77
- ae as OPERATE_COLUMN_PROP,
78
- be as ROUTE_MODULE_LEVEL,
79
- He as TableMain,
80
- Ve as TabsMain,
81
- Ge as TabsMainReplaceQueryKey,
82
- k as TriggerAutoImport,
83
- X as WatchSize,
84
- Be as countAll,
85
- g as createAdminBridge,
86
- ze as createGenerateRouteMetaRawTree,
87
- We as createListApi,
88
- Ye as createStorageWithNamespace,
89
- je as createUseState,
90
- Je as createUserStore,
62
+ fe as APP_API_LIST_MODEL_KEY_CONFIG,
63
+ C as ActionBtn,
64
+ T as ActionButton,
65
+ L as ActionButtonDanger,
66
+ R as ActionButtonWarn,
67
+ le as ActionConfirm,
68
+ ie as AutoRefresh,
69
+ pe as BODY_CONTENT_VIEWPORT_HEIGHT,
70
+ Ie as ConfirmModal,
71
+ h as DetailModal,
72
+ ge as EXPORT_MAX_LIMIT,
73
+ Se as FORM_CONFIG_SELECT_ALL_VALUE,
74
+ Re as FORM_ITEM_CHANGE_LOADING,
75
+ xe as FULLSCREEN_HEIGHT_CHANNEL,
76
+ N as FormMain,
77
+ b as FormRadioGroup,
78
+ We as FormSearch,
79
+ v as FormSelect,
80
+ B as FormTree,
81
+ U as FormVerifyCode,
82
+ ze as FormVerifyImage,
83
+ K as HeightProvider,
84
+ Ye as ListPage,
85
+ k as MenuItemSub,
86
+ X as MenuTree,
87
+ j as ModalPorter,
88
+ q as ModalShelf,
89
+ Me as OPERATE_COLUMN_PROP,
90
+ Qe as PanelEditSwitch,
91
+ Z as PanelItem,
92
+ ee as PanelMain,
93
+ Je as ROUTE_MODULE_LEVEL,
94
+ et as TableMain,
95
+ ot as TabsMain,
96
+ Ze as TabsMainReplaceQueryKey,
97
+ oe as TriggerAutoImport,
98
+ ae as WatchSize,
99
+ at as countAll,
100
+ A as createAdminBridge,
101
+ lt as createGenerateRouteMetaRawTree,
102
+ mt as createListApi,
103
+ it as createStorageWithNamespace,
104
+ pt as createUseState,
105
+ dt as createUserStore,
91
106
  r as displayInstall,
92
- me as exportCSV,
93
- Ke as fetchListAll,
94
- $e as flatRouteMetaResolveRaw,
107
+ Ae as exportCSV,
108
+ ft as fetchListAll,
109
+ It as flatRouteMetaResolveRaw,
95
110
  t as formInstall,
96
- de as generateFormData,
97
- ce as getBlurSubmit,
98
- Ee as getChangeSubmit,
99
- ue as getConfirmPasswordRule,
100
- Ie as getDatePickerShortcuts,
101
- ge as getEnterSubmit,
102
- ot as getId,
103
- _e as getPlaceholder,
104
- et as getRoutePermissionKey,
105
- Ae as getVModelSugar,
106
- c as installComponents,
111
+ Oe as generateFormData,
112
+ he as getBlurSubmit,
113
+ De as getChangeSubmit,
114
+ Te as getConfirmPasswordRule,
115
+ Ne as getDatePickerShortcuts,
116
+ ye as getEnterSubmit,
117
+ Mt as getId,
118
+ de as getModalShelfInjectionKey,
119
+ be as getPlaceholder,
120
+ Et as getRoutePermissionKey,
121
+ Ge as getVModelSugar,
122
+ E as installComponents,
107
123
  s as listPageInstall,
108
124
  o as menuInstall,
109
125
  a as miscInstall,
110
126
  m as modalInstall,
111
- Te as parseFormData,
112
- ie as passwordRule,
113
- fe as pickExportColumns,
114
- Ce as resolveFormLayout,
115
- pe as setFormComponentType,
116
- Me as setInputComponent,
117
- Fe as setSelectComponent,
118
- Le as stringifyFormData,
119
- Re as swiftFormItemConfig,
127
+ l as panelInstall,
128
+ ve as parseFormData,
129
+ Fe as passwordRule,
130
+ _e as pickExportColumns,
131
+ we as resolveFormLayout,
132
+ Le as setFormComponentType,
133
+ Be as setInputComponent,
134
+ He as setSelectComponent,
135
+ Ue as stringifyFormData,
136
+ Ve as swiftFormItemConfig,
120
137
  f as tableInstall,
121
- at as timeCountDown,
122
- ft as useActivated,
123
- st as useActivatedEvent,
124
- lt as useActivatedExec,
125
- it as useFeelSize,
126
- nt as useMenusDataDispatch,
127
- dt as useTimeout
138
+ _t as timeCountDown,
139
+ St as useActivated,
140
+ Tt as useActivatedEvent,
141
+ Ft as useActivatedExec,
142
+ Pt as useFeelSize,
143
+ Ot as useMenusDataDispatch,
144
+ Dt as useTimeout
128
145
  };
package/es/inject/key.mjs CHANGED
@@ -1,9 +1,13 @@
1
- const E = Symbol.for(
1
+ const o = Symbol.for(
2
2
  "BODY_CONTENT_VIEWPORT_HEIGHT"
3
- ), H = Symbol.for(
3
+ ), _ = Symbol.for(
4
4
  "FULLSCREEN_HEIGHT_CHANNEL"
5
5
  );
6
+ function H(E) {
7
+ return Symbol.for(`MODAL_SHELF_${E}`);
8
+ }
6
9
  export {
7
- E as BODY_CONTENT_VIEWPORT_HEIGHT,
8
- H as FULLSCREEN_HEIGHT_CHANNEL
10
+ o as BODY_CONTENT_VIEWPORT_HEIGHT,
11
+ _ as FULLSCREEN_HEIGHT_CHANNEL,
12
+ H as getModalShelfInjectionKey
9
13
  };
package/es/style.css CHANGED
@@ -1 +1 @@
1
- .form-item-tip[data-v-0dd66b41]{text-align:left;line-height:1.5;font-size:12px}.form-item-label-hide[data-v-0dd66b41] .el-form-item__label-wrap{display:none}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.tabs-main-bar[data-v-c9b7515f]{position:relative;display:flex;align-items:center}.tabs-main-bar-item[data-v-c9b7515f]{padding:8px 16px;border:none;background:transparent;font-size:14px;color:var(--el-text-color-regular);cursor:pointer}.tabs-main-bar-item_active[data-v-c9b7515f]{color:var(--el-color-primary)}.tabs-main-bar-indicator[data-v-c9b7515f]{position:absolute;bottom:0;left:0;height:2px;background:var(--el-color-primary);transition:transform .2s,width .2s}.auto-refresh[data-v-9d78ca06]{display:flex;align-items:center;gap:8px}.auto-refresh-label[data-v-9d78ca06]{font-size:13px;color:var(--el-text-color-regular)}.auto-refresh-interval[data-v-9d78ca06]{width:80px}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-toolbar[data-v-90cd7b54]{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;gap:20px}.table-toolbar-left[data-v-90cd7b54],.table-toolbar-right[data-v-90cd7b54]{display:flex;align-items:center;gap:10px}.table-toolbar-icon--rotating[data-v-90cd7b54]{animation:table-toolbar-rotating-90cd7b54 1s linear infinite}@keyframes table-toolbar-rotating-90cd7b54{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.data-list-view[data-v-4c7d7547]{width:100%}.table-main-table[data-v-d70ba841]{--el-table-header-bg-color: var(--e731a8f2)}.table-main-pagination[data-v-d70ba841]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-e22c3b7c]{min-height:var(--v09e0228a)}.list-page-header[data-v-e22c3b7c],.list-page-operation[data-v-e22c3b7c]{margin-bottom:10px}.list-page[data-v-e22c3b7c] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}
1
+ .form-item-tip[data-v-0dd66b41]{text-align:left;line-height:1.5;font-size:12px}.form-item-label-hide[data-v-0dd66b41] .el-form-item__label-wrap{display:none}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.tabs-main-bar[data-v-c9b7515f]{position:relative;display:flex;align-items:center}.tabs-main-bar-item[data-v-c9b7515f]{padding:8px 16px;border:none;background:transparent;font-size:14px;color:var(--el-text-color-regular);cursor:pointer}.tabs-main-bar-item_active[data-v-c9b7515f]{color:var(--el-color-primary)}.tabs-main-bar-indicator[data-v-c9b7515f]{position:absolute;bottom:0;left:0;height:2px;background:var(--el-color-primary);transition:transform .2s,width .2s}.auto-refresh[data-v-9d78ca06]{display:flex;align-items:center;gap:8px}.auto-refresh-label[data-v-9d78ca06]{font-size:13px;color:var(--el-text-color-regular)}.auto-refresh-interval[data-v-9d78ca06]{width:80px}.action-confirm__title[data-v-1003e4cb]{font-weight:600;margin-bottom:6px}.action-confirm__content[data-v-1003e4cb]{margin-bottom:12px;color:var(--el-text-color-regular)}.action-confirm__actions[data-v-1003e4cb]{display:flex;justify-content:flex-end;gap:8px}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-toolbar[data-v-90cd7b54]{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;gap:20px}.table-toolbar-left[data-v-90cd7b54],.table-toolbar-right[data-v-90cd7b54]{display:flex;align-items:center;gap:10px}.table-toolbar-icon--rotating[data-v-90cd7b54]{animation:table-toolbar-rotating-90cd7b54 1s linear infinite}@keyframes table-toolbar-rotating-90cd7b54{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.data-list-view[data-v-4c7d7547]{width:100%}.table-main-table[data-v-d70ba841]{--el-table-header-bg-color: var(--e731a8f2)}.table-main-pagination[data-v-d70ba841]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-e22c3b7c]{min-height:var(--v09e0228a)}.list-page-header[data-v-e22c3b7c],.list-page-operation[data-v-e22c3b7c]{margin-bottom:10px}.list-page[data-v-e22c3b7c] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}.panel-edit-switch[data-v-ea2a07d5]{position:relative}.panel-edit-switch-edit-btn[data-v-ea2a07d5]{position:absolute;top:0;right:0;z-index:1}.panel-edit-switch-actions[data-v-ea2a07d5]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/admin-core",
3
- "version": "0.1.4",
3
+ "version": "0.2.1-alpha.0",
4
4
  "description": "后台管理核心",
5
5
  "private": false,
6
6
  "main": "lib/index.cjs",
@@ -77,5 +77,5 @@
77
77
  "node": ">=18.0.0",
78
78
  "pnpm": ">=9.0.0"
79
79
  },
80
- "gitHead": "1912bfff5786e8765a325c41a2f4f92a618a1628"
80
+ "gitHead": "7e05d5d863e8e481c0f477e60c0c68dcfcbb648f"
81
81
  }
@@ -0,0 +1,26 @@
1
+ import { ActionBtnProps } from './types';
2
+
3
+ declare function __VLS_template(): {
4
+ default?(_: {}): any;
5
+ };
6
+ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ActionBtnProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ click: (evt: MouseEvent) => void;
8
+ }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ActionBtnProps>>> & Readonly<{
9
+ onClick?: ((evt: MouseEvent) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
12
+ export default _default;
13
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
+ type __VLS_TypePropsToRuntimeProps<T> = {
15
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
16
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
+ } : {
18
+ type: import('vue').PropType<T[K]>;
19
+ required: true;
20
+ };
21
+ };
22
+ type __VLS_WithTemplateSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,41 @@
1
+ import { ActionConfirmProps } from './types';
2
+
3
+ declare function __VLS_template(): {
4
+ default?(_: {}): any;
5
+ };
6
+ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ActionConfirmProps>, {
7
+ confirmText: string;
8
+ cancelText: string;
9
+ }>>, {
10
+ run: () => Promise<boolean>;
11
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ActionConfirmProps>, {
12
+ confirmText: string;
13
+ cancelText: string;
14
+ }>>> & Readonly<{}>, {
15
+ cancelText: string;
16
+ confirmText: string;
17
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
19
+ export default _default;
20
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
+ type __VLS_TypePropsToRuntimeProps<T> = {
22
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
23
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
24
+ } : {
25
+ type: import('vue').PropType<T[K]>;
26
+ required: true;
27
+ };
28
+ };
29
+ type __VLS_WithDefaults<P, D> = {
30
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
31
+ default: D[K];
32
+ }> : P[K];
33
+ };
34
+ type __VLS_Prettify<T> = {
35
+ [K in keyof T]: T[K];
36
+ } & {};
37
+ type __VLS_WithTemplateSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -4,6 +4,9 @@ import { default as AutoRefresh } from './AutoRefresh.vue';
4
4
  import { default as ActionButton } from './ActionButton.vue';
5
5
  import { default as ActionButtonDanger } from './ActionButtonDanger.vue';
6
6
  import { default as ActionButtonWarn } from './ActionButtonWarn.vue';
7
+ import { default as ActionBtn } from './ActionBtn.vue';
8
+ import { default as ActionConfirm } from './ActionConfirm.vue';
7
9
 
8
- export { TriggerAutoImport, AutoRefresh, ActionButton, ActionButtonDanger, ActionButtonWarn, };
10
+ export * from './types';
11
+ export { TriggerAutoImport, AutoRefresh, ActionButton, ActionButtonDanger, ActionButtonWarn, ActionBtn, ActionConfirm, };
9
12
  export declare const miscInstall: Plugin;
@@ -0,0 +1,80 @@
1
+ import { VNode } from 'vue';
2
+ import { ButtonProps } from 'element-plus';
3
+
4
+ /** ActionConfirm 确认交互形态:弹层气泡 / 居中模态框 */
5
+ export type ActionConfirmMode = "popconfirm" | "messageConfirm";
6
+ /**
7
+ * ActionConfirm 文案解析器。
8
+ * - string:直接渲染
9
+ * - 无参函数:返回字符串或 VNode 数组(富文本);动态数据由调用方闭包捕获
10
+ */
11
+ export type ActionConfirmTextResolver = string | (() => string | VNode[]);
12
+ /**
13
+ * ActionBtn 的确认配置(嵌套对象;无此配置则为普通按钮,不触发确认)。
14
+ *
15
+ * ⚠️ 瞬时用户激活限制:配置本项后,点击与原始 `@click` handler 之间隔了一次
16
+ * 异步确认。原始点击的瞬时用户激活(transient user activation)此时已过期
17
+ * (注意:事件对象 `isTrusted` 仍为 true,失效的是激活窗口而非事件本身)。
18
+ * 故 confirm 后的 handler [MUST NOT] 调用依赖用户激活的 API——`window.open`、
19
+ * `navigator.clipboard.*`、`requestFullscreen` 等会被浏览器拦截。需要这类
20
+ * 操作时改用不带 confirmConfig 的 ActionBtn / 普通按钮。此为 confirm-gate
21
+ * 模式固有代价,组件层无法绕过。
22
+ */
23
+ export interface ActionBtnConfirmConfig {
24
+ /** 确认标题 */
25
+ title?: ActionConfirmTextResolver;
26
+ /** 确认正文内容 */
27
+ content?: ActionConfirmTextResolver;
28
+ /** 确认按钮文案,默认"确定" */
29
+ confirmText?: string;
30
+ /** 取消按钮文案,默认"取消" */
31
+ cancelText?: string;
32
+ /** 确认按钮 type */
33
+ type?: ButtonProps["type"];
34
+ }
35
+ /**
36
+ * ActionBtn 组件 props。
37
+ * 完全兼容 ElButton(继承 ButtonProps),仅一处改写 + 两个增量:
38
+ * - `loading` 被 Omit:有意的 ElButton 不兼容,唯一接管项——loading 由组件内部
39
+ * 独占,对接异步 confirm 的进行态(innerLoading),对外不可设置。
40
+ * - `disabled` 原生透传,不改写不扩展。
41
+ * - 增量:`confirmMode` / `confirmConfig`。无 `ctx`、无泛型——动态数据由调用方
42
+ * 在自身作用域闭包捕获,组件不做数据回环。
43
+ */
44
+ export type ActionBtnProps = Omit<ButtonProps, "loading"> & {
45
+ /** 确认交互形态,仅在 confirmConfig 存在时生效,默认 "popconfirm" */
46
+ confirmMode?: ActionConfirmMode;
47
+ /** 确认配置;存在时点击需经确认闸门,确认后才触发 click */
48
+ confirmConfig?: ActionBtnConfirmConfig;
49
+ };
50
+ /**
51
+ * ActionConfirm 组件 props(扁平,confirm 原语;可独立于 ActionBtn 消费)。
52
+ * 触发元素由默认 slot 提供;确认流程经 defineExpose 的 `run()` 命令式驱动。
53
+ */
54
+ export interface ActionConfirmProps {
55
+ /** 确认交互形态 */
56
+ mode: ActionConfirmMode;
57
+ /** 确认标题 */
58
+ title?: ActionConfirmTextResolver;
59
+ /** 确认正文内容 */
60
+ content?: ActionConfirmTextResolver;
61
+ /** 确认按钮文案,默认"确定" */
62
+ confirmText?: string;
63
+ /** 取消按钮文案,默认"取消" */
64
+ cancelText?: string;
65
+ /** 确认按钮 type */
66
+ type?: ButtonProps["type"];
67
+ /**
68
+ * 被确认闸住的待执行动作。用户点确认后调用;返回 Promise 时弹层保持不关、
69
+ * 确认按钮 loading,直到 settle(成功或失败均结束)。
70
+ */
71
+ action: () => unknown | Promise<unknown>;
72
+ }
73
+ /** ActionConfirm 实例(defineExpose) */
74
+ export interface ActionConfirmInstance {
75
+ /**
76
+ * 驱动一次确认流程。
77
+ * @returns 已确认并完成 action → true;用户取消 → false
78
+ */
79
+ run: () => Promise<boolean>;
80
+ }
@@ -72,12 +72,12 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
72
72
  }>>> & Readonly<{
73
73
  "onUpdate:show"?: ((value: boolean) => any) | undefined;
74
74
  }>, {
75
- width: number | string;
76
- reverse: boolean;
77
75
  showClose: boolean;
78
76
  cancelText: string | (() => VNode);
79
77
  confirmText: string | (() => VNode);
80
78
  hiddenCancel: boolean;
79
+ width: number | string;
80
+ reverse: boolean;
81
81
  closeOnPressEscape: boolean;
82
82
  closeOnClickModal: boolean;
83
83
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,29 @@
1
+ import { EvokeHandle, ModalShelfMap, RegisterEntry } from './modal-shelf-types';
2
+
3
+ declare function evoke<K extends keyof ModalShelfMap>(key: K, payload: ModalShelfMap[K]): EvokeHandle | null;
4
+ declare function __VLS_template(): {
5
+ default?(_: {}): any;
6
+ };
7
+ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modalList: RegisterEntry[];
9
+ }>>, {
10
+ evoke: typeof evoke;
11
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
12
+ modalList: RegisterEntry[];
13
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
15
+ export default _default;
16
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
17
+ type __VLS_TypePropsToRuntimeProps<T> = {
18
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
19
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
20
+ } : {
21
+ type: import('vue').PropType<T[K]>;
22
+ required: true;
23
+ };
24
+ };
25
+ type __VLS_WithTemplateSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };