@done-coding/admin-core 0.1.4-alpha.0 → 0.2.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.
@@ -0,0 +1,117 @@
1
+ import { defineComponent as A, getCurrentInstance as b, ref as s, computed as P, openBlock as g, createBlock as v, withCtx as f, createVNode as T, unref as k, mergeProps as B, renderSlot as C } from "vue";
2
+ import { ElButton as h } from "element-plus";
3
+ import w from "./ActionConfirm.vue.mjs";
4
+ const E = /* @__PURE__ */ A({
5
+ inheritAttrs: !1,
6
+ __name: "ActionBtn",
7
+ props: {
8
+ size: {},
9
+ disabled: { type: Boolean },
10
+ type: {},
11
+ icon: {},
12
+ nativeType: {},
13
+ loadingIcon: {},
14
+ plain: { type: Boolean },
15
+ text: { type: Boolean },
16
+ link: { type: Boolean },
17
+ bg: { type: Boolean },
18
+ autofocus: { type: Boolean },
19
+ round: { type: Boolean },
20
+ circle: { type: Boolean },
21
+ dashed: { type: Boolean },
22
+ color: {},
23
+ dark: { type: Boolean },
24
+ autoInsertSpace: { type: Boolean },
25
+ tag: {},
26
+ confirmMode: {},
27
+ confirmConfig: {}
28
+ },
29
+ emits: ["click"],
30
+ setup(x) {
31
+ const t = x, n = b(), u = s(), r = s(!1), a = s(!1);
32
+ let p;
33
+ const m = P(() => {
34
+ const e = t, o = {}, l = [
35
+ "type",
36
+ "size",
37
+ "plain",
38
+ "text",
39
+ "bg",
40
+ "link",
41
+ "round",
42
+ "circle",
43
+ "color",
44
+ "dark",
45
+ "disabled",
46
+ "autofocus",
47
+ "nativeType",
48
+ "autoInsertSpace",
49
+ "tag",
50
+ "icon",
51
+ "loadingIcon"
52
+ ];
53
+ for (const i of l) e[i] !== void 0 && (o[i] = e[i]);
54
+ return { ...n == null ? void 0 : n.attrs, ...o };
55
+ }), _ = (e) => !!e && typeof e.then == "function", I = () => {
56
+ var o;
57
+ const e = (o = n == null ? void 0 : n.vnode.props) == null ? void 0 : o.onClick;
58
+ return e ? Array.isArray(e) ? e : [e] : [];
59
+ }, d = () => {
60
+ const e = I();
61
+ if (!e.length) return;
62
+ const o = p;
63
+ let l;
64
+ try {
65
+ l = e.map((c) => c(o));
66
+ } catch (c) {
67
+ throw r.value = !1, c;
68
+ }
69
+ const i = l.filter(_);
70
+ if (i.length)
71
+ return r.value = !0, Promise.all(i).finally(() => {
72
+ r.value = !1;
73
+ });
74
+ }, y = (e) => {
75
+ var o;
76
+ r.value || a.value || (p = e, t.confirmConfig ? (a.value = !0, Promise.resolve((o = u.value) == null ? void 0 : o.run()).finally(() => {
77
+ a.value = !1;
78
+ })) : d());
79
+ };
80
+ return (e, o) => t.confirmConfig ? (g(), v(w, {
81
+ key: 0,
82
+ ref_key: "confirmRef",
83
+ ref: u,
84
+ mode: t.confirmMode || "popconfirm",
85
+ title: t.confirmConfig.title,
86
+ content: t.confirmConfig.content,
87
+ "confirm-text": t.confirmConfig.confirmText,
88
+ "cancel-text": t.confirmConfig.cancelText,
89
+ type: t.confirmConfig.type,
90
+ action: d
91
+ }, {
92
+ default: f(() => [
93
+ T(k(h), B(m.value, {
94
+ loading: r.value,
95
+ onClick: y
96
+ }), {
97
+ default: f(() => [
98
+ C(e.$slots, "default")
99
+ ]),
100
+ _: 3
101
+ }, 16, ["loading"])
102
+ ]),
103
+ _: 3
104
+ }, 8, ["mode", "title", "content", "confirm-text", "cancel-text", "type"])) : (g(), v(k(h), B({ key: 1 }, m.value, {
105
+ loading: r.value,
106
+ onClick: y
107
+ }), {
108
+ default: f(() => [
109
+ C(e.$slots, "default")
110
+ ]),
111
+ _: 3
112
+ }, 16, ["loading"]));
113
+ }
114
+ });
115
+ export {
116
+ E as default
117
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ActionBtn.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./ActionConfirm.vue2.mjs";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1003e4cb"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,113 @@
1
+ import { defineComponent as S, ref as _, computed as x, openBlock as i, createBlock as u, unref as f, withCtx as s, createElementVNode as g, createElementBlock as C, resolveDynamicComponent as w, createCommentVNode as T, createVNode as h, createTextVNode as k, toDisplayString as B, renderSlot as N, h as b } from "vue";
2
+ import { ElPopover as $, ElButton as E, ElMessageBox as j } from "element-plus";
3
+ const q = { class: "action-confirm" }, F = {
4
+ key: 0,
5
+ class: "action-confirm__title"
6
+ }, G = {
7
+ key: 1,
8
+ class: "action-confirm__content"
9
+ }, H = { class: "action-confirm__actions" }, O = /* @__PURE__ */ S({
10
+ __name: "ActionConfirm",
11
+ props: {
12
+ mode: {},
13
+ title: {},
14
+ content: {},
15
+ confirmText: { default: "确定" },
16
+ cancelText: { default: "取消" },
17
+ type: {},
18
+ action: {}
19
+ },
20
+ setup(a, { expose: P }) {
21
+ const e = a, c = _(!1), l = _(!1);
22
+ let n = null;
23
+ const r = (t) => {
24
+ if (t != null)
25
+ return typeof t == "function" ? t() : t;
26
+ }, m = (t) => {
27
+ if (!(t == null || t === ""))
28
+ return typeof t == "string" ? () => b("span", t) : () => t;
29
+ }, d = x(() => m(r(e.title))), y = x(() => m(r(e.content))), V = async () => {
30
+ l.value = !0;
31
+ try {
32
+ await Promise.resolve(e.action());
33
+ } finally {
34
+ l.value = !1;
35
+ }
36
+ }, z = async () => {
37
+ await V(), c.value = !1, n == null || n(!0), n = null;
38
+ }, A = () => {
39
+ c.value = !1, n == null || n(!1), n = null;
40
+ }, D = async () => {
41
+ const t = r(e.title), o = r(e.content), L = typeof o == "string" ? o : o ? b("div", o) : "";
42
+ try {
43
+ return await j.confirm(L, {
44
+ title: typeof t == "string" ? t : void 0,
45
+ confirmButtonText: e.confirmText,
46
+ cancelButtonText: e.cancelText,
47
+ type: e.type === "danger" ? "warning" : void 0,
48
+ beforeClose: async (M, v, p) => {
49
+ if (M !== "confirm") return p();
50
+ v.confirmButtonLoading = !0;
51
+ try {
52
+ await Promise.resolve(e.action());
53
+ } finally {
54
+ v.confirmButtonLoading = !1;
55
+ }
56
+ p();
57
+ }
58
+ }), !0;
59
+ } catch {
60
+ return !1;
61
+ }
62
+ };
63
+ return P({ run: () => e.mode === "messageConfirm" ? D() : (c.value = !0, new Promise((t) => {
64
+ n = t;
65
+ })) }), (t, o) => e.mode === "popconfirm" ? (i(), u(f($), {
66
+ key: 0,
67
+ visible: c.value,
68
+ width: 240,
69
+ persistent: !1
70
+ }, {
71
+ reference: s(() => [
72
+ N(t.$slots, "default", {}, void 0, !0)
73
+ ]),
74
+ default: s(() => [
75
+ g("div", q, [
76
+ d.value ? (i(), C("div", F, [
77
+ (i(), u(w(d.value)))
78
+ ])) : T("", !0),
79
+ y.value ? (i(), C("div", G, [
80
+ (i(), u(w(y.value)))
81
+ ])) : T("", !0),
82
+ g("div", H, [
83
+ h(f(E), {
84
+ size: "small",
85
+ disabled: l.value,
86
+ onClick: A
87
+ }, {
88
+ default: s(() => [
89
+ k(B(a.cancelText), 1)
90
+ ]),
91
+ _: 1
92
+ }, 8, ["disabled"]),
93
+ h(f(E), {
94
+ size: "small",
95
+ type: a.type,
96
+ loading: l.value,
97
+ onClick: z
98
+ }, {
99
+ default: s(() => [
100
+ k(B(a.confirmText), 1)
101
+ ]),
102
+ _: 1
103
+ }, 8, ["type", "loading"])
104
+ ])
105
+ ])
106
+ ]),
107
+ _: 3
108
+ }, 8, ["visible"])) : N(t.$slots, "default", { key: 1 }, void 0, !0);
109
+ }
110
+ });
111
+ export {
112
+ O as default
113
+ };
@@ -3,24 +3,30 @@ import i from "./AutoRefresh.vue.mjs";
3
3
  import m from "./ActionButton.vue.mjs";
4
4
  import c from "./ActionButtonDanger.vue.mjs";
5
5
  import s from "./ActionButtonWarn.vue.mjs";
6
- const a = {
6
+ import a from "./ActionBtn.vue.mjs";
7
+ import f from "./ActionConfirm.vue.mjs";
8
+ const e = {
7
9
  TriggerAutoImport: r,
8
10
  AutoRefresh: i,
9
11
  ActionButton: m,
10
12
  ActionButtonDanger: c,
11
- ActionButtonWarn: s
12
- }, _ = {
13
+ ActionButtonWarn: s,
14
+ ActionBtn: a,
15
+ ActionConfirm: f
16
+ }, $ = {
13
17
  install(t) {
14
- Object.entries(a).forEach(([o, n]) => {
18
+ Object.entries(e).forEach(([o, n]) => {
15
19
  t.component(o, n);
16
20
  });
17
21
  }
18
22
  };
19
23
  export {
24
+ a as ActionBtn,
20
25
  m as ActionButton,
21
26
  c as ActionButtonDanger,
22
27
  s as ActionButtonWarn,
28
+ f as ActionConfirm,
23
29
  i as AutoRefresh,
24
30
  r as TriggerAutoImport,
25
- _ as miscInstall
31
+ $ as miscInstall
26
32
  };
package/es/index.mjs CHANGED
@@ -6,123 +6,127 @@ 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
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";
9
+ import { default as _ } from "./components/misc/ActionBtn.vue.mjs";
10
+ import { default as T } from "./components/misc/ActionButton.vue.mjs";
11
+ import { default as F } from "./components/misc/ActionButtonDanger.vue.mjs";
12
+ import { default as R } from "./components/misc/ActionButtonWarn.vue.mjs";
13
+ import { default as O } from "./components/modal/DetailModal.vue.mjs";
14
+ import { default as D } from "./components/form/FormMain.vue.mjs";
15
+ import { default as h } from "./components/form/FormRadioGroup.vue.mjs";
16
+ import { default as b } from "./components/form/FormSelect.vue.mjs";
17
+ import { default as v } from "./components/form/FormTree.vue.mjs";
18
+ import { default as H } from "./components/form/FormVerifyCode.vue.mjs";
19
+ import { default as V } from "./components/display/HeightProvider.vue.mjs";
20
+ import { default as W } from "./components/menu/MenuItemSub.vue.mjs";
21
+ import { default as k } from "./components/menu/MenuTree.vue.mjs";
22
+ import { default as X } from "./components/misc/TriggerAutoImport.vue.mjs";
23
+ import { default as Q } from "./components/display/WatchSize.vue.mjs";
24
+ import { APP_API_LIST_MODEL_KEY_CONFIG as q } from "./config/list-model.mjs";
25
+ import { default as Z } from "./components/misc/ActionConfirm.vue.mjs";
26
+ import { default as ee } from "./components/misc/AutoRefresh.vue.mjs";
27
+ import { BODY_CONTENT_VIEWPORT_HEIGHT as oe, FULLSCREEN_HEIGHT_CHANNEL as re } from "./inject/key.mjs";
28
+ import { default as me } from "./components/modal/ConfirmModal.vue.mjs";
29
+ import { EXPORT_MAX_LIMIT as se, OPERATE_COLUMN_PROP as le, exportCSV as ue, pickExportColumns as ie } from "./utils/export.mjs";
30
+ import { FORM_CONFIG_SELECT_ALL_VALUE as ne, getConfirmPasswordRule as xe, passwordRule as de, setFormComponentType as ce } from "./helpers/form.mjs";
31
+ import { FORM_ITEM_CHANGE_LOADING as Ie, generateFormData as ge, getBlurSubmit as Ae, getChangeSubmit as _e, getDatePickerShortcuts as Ce, getEnterSubmit as Te, getPlaceholder as Me, getVModelSugar as Fe, parseFormData as Le, resolveFormLayout as Re, setInputComponent as Se, setSelectComponent as Oe, stringifyFormData as Pe, swiftFormItemConfig as De } from "./components/form/utils.mjs";
32
+ import { default as he } from "./components/form/FormSearch.vue.mjs";
33
+ import { default as be } from "./components/form/FormVerifyImage.vue.mjs";
34
+ import { default as ve } from "./components/list-page/ListPage.vue.mjs";
35
+ import { ROUTE_MODULE_LEVEL as He, TabsMainReplaceQueryKey as Ue } from "./config/route.mjs";
36
+ import { default as we } from "./components/table/TableMain.vue.mjs";
37
+ import { default as Ke } from "./components/display/TabsMain.vue.mjs";
38
+ import { countAll as ze, createListApi as Xe, fetchListAll as Ye } from "./helpers/list-helper.mjs";
39
+ import { createGenerateRouteMetaRawTree as je } from "./helpers/route.mjs";
40
+ import { createStorageWithNamespace as Je } from "./helpers/storage.mjs";
41
+ import { createUseState as $e } from "./helpers/state.mjs";
42
+ import { createUserStore as tt } from "./store/user.mjs";
43
+ import { flatRouteMetaResolveRaw as rt, getRoutePermissionKey as at } from "./utils/router.mjs";
44
+ import { getId as ft } from "./utils/id.mjs";
45
+ import { timeCountDown as lt } from "./utils/time.mjs";
46
+ import { useActivated as it, useActivatedEvent as pt, useActivatedExec as nt } from "./hooks/activated.mjs";
47
+ import { useFeelSize as dt } from "./hooks/feel-size.mjs";
48
+ import { useMenusDataDispatch as Et } from "./hooks/menus-dispatch.mjs";
49
+ import { useTimeout as gt } from "./hooks/timeout.mjs";
48
50
  const c = {
49
51
  install(e) {
50
52
  e.use(t), e.use(o), e.use(r), e.use(a), e.use(m), e.use(f), e.use(s);
51
53
  }
52
54
  };
53
55
  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,
56
+ q as APP_API_LIST_MODEL_KEY_CONFIG,
57
+ _ as ActionBtn,
58
+ T as ActionButton,
59
+ F as ActionButtonDanger,
60
+ R as ActionButtonWarn,
61
+ Z as ActionConfirm,
62
+ ee as AutoRefresh,
63
+ oe as BODY_CONTENT_VIEWPORT_HEIGHT,
64
+ me as ConfirmModal,
65
+ O as DetailModal,
66
+ se as EXPORT_MAX_LIMIT,
67
+ ne as FORM_CONFIG_SELECT_ALL_VALUE,
68
+ Ie as FORM_ITEM_CHANGE_LOADING,
69
+ re as FULLSCREEN_HEIGHT_CHANNEL,
70
+ D as FormMain,
71
+ h as FormRadioGroup,
72
+ he as FormSearch,
73
+ b as FormSelect,
74
+ v as FormTree,
75
+ H as FormVerifyCode,
76
+ be as FormVerifyImage,
77
+ V as HeightProvider,
78
+ ve as ListPage,
79
+ W as MenuItemSub,
80
+ k as MenuTree,
81
+ le as OPERATE_COLUMN_PROP,
82
+ He as ROUTE_MODULE_LEVEL,
83
+ we as TableMain,
84
+ Ke as TabsMain,
85
+ Ue as TabsMainReplaceQueryKey,
86
+ X as TriggerAutoImport,
87
+ Q as WatchSize,
88
+ ze as countAll,
85
89
  g as createAdminBridge,
86
- ze as createGenerateRouteMetaRawTree,
87
- We as createListApi,
88
- Ye as createStorageWithNamespace,
89
- je as createUseState,
90
- Je as createUserStore,
90
+ je as createGenerateRouteMetaRawTree,
91
+ Xe as createListApi,
92
+ Je as createStorageWithNamespace,
93
+ $e as createUseState,
94
+ tt as createUserStore,
91
95
  r as displayInstall,
92
- me as exportCSV,
93
- Ke as fetchListAll,
94
- $e as flatRouteMetaResolveRaw,
96
+ ue as exportCSV,
97
+ Ye as fetchListAll,
98
+ rt as flatRouteMetaResolveRaw,
95
99
  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,
100
+ ge as generateFormData,
101
+ Ae as getBlurSubmit,
102
+ _e as getChangeSubmit,
103
+ xe as getConfirmPasswordRule,
104
+ Ce as getDatePickerShortcuts,
105
+ Te as getEnterSubmit,
106
+ ft as getId,
107
+ Me as getPlaceholder,
108
+ at as getRoutePermissionKey,
109
+ Fe as getVModelSugar,
106
110
  c as installComponents,
107
111
  s as listPageInstall,
108
112
  o as menuInstall,
109
113
  a as miscInstall,
110
114
  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,
115
+ Le as parseFormData,
116
+ de as passwordRule,
117
+ ie as pickExportColumns,
118
+ Re as resolveFormLayout,
119
+ ce as setFormComponentType,
120
+ Se as setInputComponent,
121
+ Oe as setSelectComponent,
122
+ Pe as stringifyFormData,
123
+ De as swiftFormItemConfig,
120
124
  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
125
+ lt as timeCountDown,
126
+ it as useActivated,
127
+ pt as useActivatedEvent,
128
+ nt as useActivatedExec,
129
+ dt as useFeelSize,
130
+ Et as useMenusDataDispatch,
131
+ gt as useTimeout
128
132
  };
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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/admin-core",
3
- "version": "0.1.4-alpha.0",
3
+ "version": "0.2.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": "e53455556dc0b6be614016fc8db37a028ec48986"
80
+ "gitHead": "f4a73c50566857dfab79b6dc2ab3c8421d5ea100"
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
+ confirmText: string;
16
+ cancelText: 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
+ }
@@ -75,8 +75,8 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
75
75
  width: number | string;
76
76
  reverse: boolean;
77
77
  showClose: boolean;
78
- cancelText: string | (() => VNode);
79
78
  confirmText: string | (() => VNode);
79
+ cancelText: string | (() => VNode);
80
80
  hiddenCancel: boolean;
81
81
  closeOnPressEscape: boolean;
82
82
  closeOnClickModal: boolean;