@done-coding/admin-core 0.5.0 → 0.5.1-alpha.1

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 (124) hide show
  1. package/es/bridge/index.mjs +30 -42
  2. package/es/components/app-layout/AppHeader.vue.mjs +2 -2
  3. package/es/components/app-layout/AppHeader.vue2.mjs +16 -19
  4. package/es/components/data-view/DataListView.vue.mjs +2 -2
  5. package/es/components/data-view/DataListView.vue2.mjs +64 -53
  6. package/es/components/data-view/utils.mjs +36 -0
  7. package/es/components/display/TabsHeader.vue.mjs +2 -2
  8. package/es/components/display/TabsMain.vue.mjs +1 -1
  9. package/es/components/list-page/ListPage.vue.mjs +2 -2
  10. package/es/components/list-page/ListPage.vue2.mjs +44 -44
  11. package/es/components/misc/ActionConfirm.vue2.mjs +16 -16
  12. package/es/components/modal/ConfirmModal.vue.mjs +2 -2
  13. package/es/components/modal/DetailModal.vue.mjs +10 -10
  14. package/es/components/table/TableMain.vue.mjs +3 -3
  15. package/es/components/table/TableMain.vue2.mjs +167 -177
  16. package/es/components/table/TableToolbar.vue.mjs +3 -3
  17. package/es/components/table/TableToolbar.vue2.mjs +8 -4
  18. package/es/index.mjs +150 -180
  19. package/es/style.css +1 -1
  20. package/package.json +6 -5
  21. package/types/bridge/index.d.ts +3 -6
  22. package/types/bridge/route.d.ts +0 -1
  23. package/types/components/app-layout/AppBody.vue.d.ts +14 -34
  24. package/types/components/app-layout/AppBreadcrumb.vue.d.ts +6 -19
  25. package/types/components/app-layout/AppFooter.vue.d.ts +1 -1
  26. package/types/components/app-layout/AppHeader.vue.d.ts +15 -39
  27. package/types/components/app-layout/AppLayout.vue.d.ts +17 -50
  28. package/types/components/app-layout/AppPage.vue.d.ts +14 -39
  29. package/types/components/app-layout/AppSidebar.vue.d.ts +15 -37
  30. package/types/components/app-layout/index.d.ts +1 -19
  31. package/types/components/app-layout/types.d.ts +0 -1
  32. package/types/components/data-view/DataListView.vue.d.ts +9 -9
  33. package/types/components/data-view/DataListViewItem.vue.d.ts +19 -17
  34. package/types/components/data-view/index.d.ts +0 -1
  35. package/types/components/data-view/types.d.ts +9 -18
  36. package/types/components/data-view/utils.d.ts +5 -0
  37. package/types/components/display/ActionBtnGroup.vue.d.ts +8 -6
  38. package/types/components/display/HeightProvider.vue.d.ts +15 -31
  39. package/types/components/display/TabsHeader.vue.d.ts +27 -34
  40. package/types/components/display/TabsMain.vue.d.ts +33 -73
  41. package/types/components/display/TabsNaturalFlow.vue.d.ts +11 -5
  42. package/types/components/display/TabsRefineFlow.vue.d.ts +13 -31
  43. package/types/components/display/WatchSize.vue.d.ts +20 -32
  44. package/types/components/display/index.d.ts +0 -3
  45. package/types/components/display/types.d.ts +1 -2
  46. package/types/components/form/FormItem.vue.d.ts +208 -33
  47. package/types/components/form/FormMain.vue.d.ts +6 -7
  48. package/types/components/form/FormRadioGroup.vue.d.ts +14 -31
  49. package/types/components/form/FormSearch.vue.d.ts +5 -6
  50. package/types/components/form/FormSelect.vue.d.ts +19 -40
  51. package/types/components/form/FormTree.vue.d.ts +2037 -32
  52. package/types/components/form/FormVerifyCode.vue.d.ts +6 -6
  53. package/types/components/form/FormVerifyImage.vue.d.ts +6 -6
  54. package/types/components/form/form-search-utils.d.ts +0 -1
  55. package/types/components/form/index.d.ts +0 -3
  56. package/types/components/form/types.d.ts +0 -1
  57. package/types/components/form/utils.d.ts +0 -1
  58. package/types/components/list-page/ListPage.vue.d.ts +32 -33
  59. package/types/components/list-page/index.d.ts +0 -3
  60. package/types/components/list-page/types.d.ts +0 -1
  61. package/types/components/menu/MenuItemSub.vue.d.ts +3 -15
  62. package/types/components/menu/MenuTree.vue.d.ts +117 -19
  63. package/types/components/menu/index.d.ts +0 -3
  64. package/types/components/misc/ActionBtn.vue.d.ts +10 -11
  65. package/types/components/misc/ActionConfirm.vue.d.ts +21 -60
  66. package/types/components/misc/AutoRefresh.vue.d.ts +18 -24
  67. package/types/components/misc/TriggerAutoImport.vue.d.ts +8 -2
  68. package/types/components/misc/index.d.ts +4 -14
  69. package/types/components/misc/types.d.ts +0 -1
  70. package/types/components/modal/ConfirmModal.vue.d.ts +26 -83
  71. package/types/components/modal/DetailModal.vue.d.ts +5 -6
  72. package/types/components/modal/ModalPorter.vue.d.ts +13 -18
  73. package/types/components/modal/ModalShelf.vue.d.ts +13 -18
  74. package/types/components/modal/index.d.ts +0 -4
  75. package/types/components/modal/modal-shelf-core.d.ts +0 -1
  76. package/types/components/modal/modal-shelf-hierarchy.d.ts +0 -1
  77. package/types/components/modal/modal-shelf-types.d.ts +0 -1
  78. package/types/components/modal/types.d.ts +0 -1
  79. package/types/components/panel/PanelEditSwitch.vue.d.ts +17 -20
  80. package/types/components/panel/PanelItem.vue.d.ts +7 -16
  81. package/types/components/panel/PanelMain.vue.d.ts +5 -6
  82. package/types/components/panel/index.d.ts +0 -4
  83. package/types/components/panel/types.d.ts +0 -1
  84. package/types/components/table/TableMain.vue.d.ts +12 -12
  85. package/types/components/table/TableToolbar.vue.d.ts +17 -108
  86. package/types/components/table/ToolbarButtons.vue.d.ts +15 -17
  87. package/types/components/table/index.d.ts +0 -3
  88. package/types/components/table/types.d.ts +59 -19
  89. package/types/config/list-model.d.ts +0 -1
  90. package/types/helpers/form.d.ts +0 -1
  91. package/types/helpers/index.d.ts +0 -10
  92. package/types/helpers/list-helper.d.ts +0 -1
  93. package/types/hooks/menus-dispatch.d.ts +0 -1
  94. package/types/hooks/use-channel-viewport-height.d.ts +0 -1
  95. package/types/index.d.ts +0 -13
  96. package/types/inject/key.d.ts +0 -1
  97. package/types/router/guard/index.d.ts +0 -1
  98. package/types/router/guard/login.d.ts +0 -1
  99. package/types/router/guard/permission.d.ts +0 -1
  100. package/types/router/guard/types.d.ts +0 -1
  101. package/types/store/app.d.ts +1 -2
  102. package/types/store/router-permission.d.ts +0 -1
  103. package/types/store/user.d.ts +0 -1
  104. package/types/types/route.d.ts +0 -1
  105. package/types/utils/export.d.ts +11 -10
  106. package/types/utils/router.d.ts +0 -1
  107. package/es/components/app-layout/index.mjs +0 -32
  108. package/es/components/display/index.mjs +0 -18
  109. package/es/components/form/index.mjs +0 -32
  110. package/es/components/list-page/index.mjs +0 -14
  111. package/es/components/menu/index.mjs +0 -12
  112. package/es/components/misc/ActionButton.vue.mjs +0 -52
  113. package/es/components/misc/ActionButton.vue2.mjs +0 -4
  114. package/es/components/misc/ActionButtonDanger.vue.mjs +0 -32
  115. package/es/components/misc/ActionButtonDanger.vue2.mjs +0 -4
  116. package/es/components/misc/ActionButtonWarn.vue.mjs +0 -32
  117. package/es/components/misc/ActionButtonWarn.vue2.mjs +0 -4
  118. package/es/components/misc/index.mjs +0 -32
  119. package/es/components/modal/index.mjs +0 -23
  120. package/es/components/panel/index.mjs +0 -20
  121. package/es/components/table/index.mjs +0 -14
  122. package/types/components/misc/ActionButton.vue.d.ts +0 -24
  123. package/types/components/misc/ActionButtonDanger.vue.d.ts +0 -19
  124. package/types/components/misc/ActionButtonWarn.vue.d.ts +0 -19
@@ -1,73 +1,58 @@
1
- import { createStorageWithNamespace as u } from "./storage.mjs";
1
+ import { createStorageWithNamespace as U } from "./storage.mjs";
2
2
  import { createUseState as a } from "./state.mjs";
3
- import { createGenerateRouteMetaRawTree as L } from "./route.mjs";
4
- function l(e) {
5
- const n = e.APP_CACHE_CONFIG.namespace;
3
+ import { createGenerateRouteMetaRawTree as G } from "./route.mjs";
4
+ function L(e) {
5
+ const F = e.APP_CACHE_CONFIG.namespace;
6
6
  let _;
7
- n === "" ? (console.error(
7
+ F === "" ? (console.error(
8
8
  "[adminBridge] APP_CACHE_CONFIG.namespace 为空,已兜底为 'ADMIN_CORE'"
9
- ), _ = "ADMIN_CORE") : _ = n, Object.freeze(e);
10
- let N = u(_), f = e.routes, g = e.getUserInfoInitFn;
11
- const U = a(_), R = L(
9
+ ), _ = "ADMIN_CORE") : _ = F, Object.freeze(e);
10
+ let g = U(_), C = e.routes, N = e.getUserInfoInitFn;
11
+ const i = a(_), u = G(
12
12
  e.APP_ROUTER_META_DEFAULT_CONFIG
13
- ), G = Object.freeze({
13
+ ), R = Object.freeze({
14
14
  header: e.APP_LAYOUT_HEADER_CONFIG,
15
15
  footer: e.APP_LAYOUT_FOOTER_CONFIG,
16
16
  sidebar: e.APP_LAYOUT_SIDEBAR_CONFIG,
17
17
  breadcrumb: e.APP_LAYOUT_BREADCRUMB_CONFIG,
18
18
  body: e.APP_LAYOUT_BODY_CONFIG
19
19
  });
20
- let P, O, T, t, E, I, F, C;
20
+ let t, P, O, n, T, I, f, E;
21
21
  const A = (r) => `admin bridge: ${r} 未注册`;
22
22
  return {
23
23
  register(r) {
24
- r.getToken && (P = r.getToken), r.goToLogin && (O = r.goToLogin), r.refreshToken && (T = r.refreshToken), r.refreshAuth && (t = r.refreshAuth), r.loginApi && (E = r.loginApi), r.logoutApi && (I = r.logoutApi), r.getUserInfoApi && (F = r.getUserInfoApi), r.refreshTokenApi && (C = r.refreshTokenApi);
24
+ r.getToken && (t = r.getToken), r.goToLogin && (P = r.goToLogin), r.refreshToken && (O = r.refreshToken), r.refreshAuth && (n = r.refreshAuth), r.loginApi && (T = r.loginApi), r.logoutApi && (I = r.logoutApi), r.getUserInfoApi && (f = r.getUserInfoApi), r.refreshTokenApi && (E = r.refreshTokenApi);
25
25
  },
26
26
  // 已注册返回 undefined 是合法业务态不 throw
27
27
  // v3 终锁 Δ8b:零参 facade(BR-1 ③ 终裁——core 对 UserInfo 不透明 + 拦截器无 info 源)
28
28
  getToken() {
29
- if (!P) throw new Error(A("getToken"));
30
- return P();
29
+ if (!t) throw new Error(A("getToken"));
30
+ return t();
31
31
  },
32
32
  goToLogin() {
33
- if (!O) throw new Error(A("goToLogin"));
34
- O();
33
+ if (!P) throw new Error(A("goToLogin"));
34
+ P();
35
35
  },
36
36
  // 异步对:未注册才返回 rejected Promise(既有降级语义保留)。
37
37
  refreshToken() {
38
- return T ? T().then(() => {
38
+ return O ? O().then(() => {
39
39
  }) : Promise.reject(new Error(A("refreshToken")));
40
40
  },
41
41
  refreshAuth() {
42
- return t ? t().then(() => {
42
+ return n ? n().then(() => {
43
43
  }) : Promise.reject(new Error(A("refreshAuth")));
44
44
  },
45
- // #2.5 期 ADR-4 候选 b:getAppConfig facade 保留 + 内部从 12 readonly 属性组装聚合对象
46
- // 每次调用产新对象(多次调用 !== 引用不等),与原 facade 返回 options.appConfig 引用语义不同;
47
- // store/app.ts:18 解构后丢弃返回引用,引用相等性不被消费,行为对等 ✅
48
- getAppConfig() {
49
- return Object.freeze({
50
- APP_BASE_INFO: e.APP_BASE_INFO,
51
- APP_LAYOUT_HEADER_CONFIG: e.APP_LAYOUT_HEADER_CONFIG,
52
- APP_LAYOUT_FOOTER_CONFIG: e.APP_LAYOUT_FOOTER_CONFIG,
53
- APP_LAYOUT_SIDEBAR_CONFIG: e.APP_LAYOUT_SIDEBAR_CONFIG,
54
- APP_LAYOUT_BODY_CONFIG: e.APP_LAYOUT_BODY_CONFIG,
55
- APP_THEME_CONFIG: e.APP_THEME_CONFIG,
56
- APP_ROUTER_META_DEFAULT_CONFIG: e.APP_ROUTER_META_DEFAULT_CONFIG,
57
- APP_CACHE_CONFIG: e.APP_CACHE_CONFIG
58
- });
59
- },
60
45
  getStorage() {
61
- return N;
46
+ return g;
62
47
  },
63
48
  getRoutes() {
64
- return f;
49
+ return C;
65
50
  },
66
51
  getUserInfoInitFn() {
67
- return g;
52
+ return N;
68
53
  },
69
- useState: U,
70
- generateRouteMetaRawTree: R,
54
+ useState: i,
55
+ generateRouteMetaRawTree: u,
71
56
  // ============ #2.5 期 12 readonly 属性值挂载(per ADR-1 sibling pattern 复用 useState / generateRouteMetaRawTree) ============
72
57
  /** 应用基础信息(per #2.5 期 REQ-1 直接挂载形态) */
73
58
  APP_BASE_INFO: e.APP_BASE_INFO,
@@ -86,7 +71,7 @@ function l(e) {
86
71
  /** 应用布局-页面主体配置(per #2.5 期 REQ-1) */
87
72
  APP_LAYOUT_BODY_CONFIG: e.APP_LAYOUT_BODY_CONFIG,
88
73
  /** 应用布局聚合配置(per #2.5 期 ADR-3 bridge 内部聚合派生) */
89
- APP_LAYOUT_CONFIG: G,
74
+ APP_LAYOUT_CONFIG: R,
90
75
  /** 应用路由元信息默认配置(per #2.5 期 REQ-1) */
91
76
  APP_ROUTER_META_DEFAULT_CONFIG: e.APP_ROUTER_META_DEFAULT_CONFIG,
92
77
  /** 应用路由配置(per #2.5 期 REQ-1) */
@@ -97,19 +82,22 @@ function l(e) {
97
82
  APP_THEME_CONFIG: e.APP_THEME_CONFIG,
98
83
  // 异步对:未注册返回 rejected 原生 Error(#4a-2 per-method 降级)
99
84
  loginApi(r) {
100
- return E ? E(r) : Promise.reject(new Error(A("loginApi")));
85
+ return T ? T(r) : Promise.reject(new Error(A("loginApi")));
101
86
  },
102
87
  logoutApi() {
103
88
  return I ? I() : Promise.reject(new Error(A("logoutApi")));
104
89
  },
105
90
  getUserInfoApi() {
106
- return F ? F() : Promise.reject(new Error(A("getUserInfoApi")));
91
+ return f ? f() : Promise.reject(new Error(A("getUserInfoApi")));
107
92
  },
108
93
  refreshTokenApi(r) {
109
- return C ? C(r) : Promise.reject(new Error(A("refreshTokenApi")));
94
+ return E ? E(r) : Promise.reject(new Error(A("refreshTokenApi")));
110
95
  }
111
96
  };
112
97
  }
113
98
  export {
114
- l as createAdminBridge
99
+ L as createAdminBridge,
100
+ G as createGenerateRouteMetaRawTree,
101
+ U as createStorageWithNamespace,
102
+ a as createUseState
115
103
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppHeader.vue2.mjs";
2
2
  /* empty css */
3
3
  import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-55cf55e9"]]);
4
+ const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-ef3cc8a6"]]);
5
5
  export {
6
- a as default
6
+ e as default
7
7
  };
@@ -1,15 +1,12 @@
1
- import { ElIcon as E, ElSwitch as g } from "element-plus/es";
1
+ import { ElIcon as w, ElSwitch as E } from "element-plus/es";
2
2
  import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/switch/style/css";
4
4
  import "element-plus/es/components/icon/style/css";
5
- import { defineComponent as w, useCssVars as I, unref as o, inject as B, toRefs as P, computed as m, watch as V, nextTick as $, openBlock as r, createElementBlock as s, normalizeStyle as T, createElementVNode as d, renderSlot as v, normalizeClass as _, Fragment as b, renderList as x, createBlock as f, withCtx as A, resolveDynamicComponent as D, createCommentVNode as y, toDisplayString as L, createVNode as N } from "vue";
5
+ import { defineComponent as I, useCssVars as g, unref as o, inject as B, toRefs as P, computed as m, watch as V, nextTick as $, openBlock as r, createElementBlock as s, normalizeStyle as T, createElementVNode as d, renderSlot as v, normalizeClass as _, Fragment as b, renderList as x, createBlock as f, withCtx as A, resolveDynamicComponent as D, createCommentVNode as y, toDisplayString as L, createVNode as N } from "vue";
6
6
  import { Sunny as R, Moon as q } from "@element-plus/icons-vue";
7
7
  import { useRouter as z } from "vue-router";
8
8
  import { APP_LAYOUT_APP_STORE_KEY as F } from "../../inject/key.mjs";
9
- const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
10
- class: "app-header-userInfo",
11
- pl20: ""
12
- }, ee = /* @__PURE__ */ w({
9
+ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = { class: "app-header-userInfo" }, ee = /* @__PURE__ */ I({
13
10
  __name: "AppHeader",
14
11
  props: {
15
12
  show: { type: Boolean },
@@ -19,9 +16,9 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
19
16
  menuFlatList: {}
20
17
  },
21
18
  setup(p) {
22
- I((e) => ({
23
- v4db2d700: o(u).baseColor,
24
- v23ceefd3: o(u).primaryColor
19
+ g((e) => ({
20
+ v3dfae5bc: o(u).baseColor,
21
+ v158cd0d2: o(u).primaryColor
25
22
  }));
26
23
  const c = p, i = B(F), { theme: u } = P(i), S = m(() => i.headerStyle), k = z(), h = `app-header-module_${Math.random().toString(36).substring(2)}`, C = m(() => c.menus), l = m({
27
24
  get() {
@@ -29,16 +26,16 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
29
26
  return (e = c.activeModuleMenu) == null ? void 0 : e.path;
30
27
  },
31
28
  set(e) {
32
- var n, a;
33
- ((a = (n = c.activeMenu) == null ? void 0 : n.parentPathList) == null ? void 0 : a[0]) !== e && k.push(e);
29
+ var a, n;
30
+ ((n = (a = c.activeMenu) == null ? void 0 : a.parentPathList) == null ? void 0 : n[0]) !== e && k.push(e);
34
31
  }
35
32
  });
36
33
  return V(
37
34
  l,
38
35
  (e) => {
39
36
  e && $(() => {
40
- var n, a;
41
- (a = (n = document.querySelector(`.${h}`)) == null ? void 0 : n.querySelector(`[name="${e}"]`)) == null || a.scrollIntoView({
37
+ var a, n;
38
+ (n = (a = document.querySelector(`.${h}`)) == null ? void 0 : a.querySelector(`[name="${e}"]`)) == null || n.scrollIntoView({
42
39
  behavior: "smooth"
43
40
  });
44
41
  });
@@ -46,8 +43,8 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
46
43
  {
47
44
  immediate: !0
48
45
  }
49
- ), (e, n) => {
50
- const a = E, M = g;
46
+ ), (e, a) => {
47
+ const n = w, M = E;
51
48
  return r(), s("div", {
52
49
  class: "app-header",
53
50
  style: T(o(S))
@@ -67,9 +64,9 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
67
64
  ]),
68
65
  onClick: (j) => l.value = t.path
69
66
  }, [
70
- t.menuIcon ? (r(), f(a, {
67
+ t.menuIcon ? (r(), f(n, {
71
68
  key: 0,
72
- mr2: ""
69
+ class: "app-header-module-item__icon"
73
70
  }, {
74
71
  default: A(() => [
75
72
  (r(), f(D(t.menuIcon)))
@@ -82,10 +79,10 @@ const O = { class: "app-header-shim" }, U = ["name", "onClick"], Y = {
82
79
  d("div", Y, [
83
80
  N(M, {
84
81
  "model-value": o(i).isDarkTheme,
85
- mr3: "",
82
+ class: "app-header-userInfo__theme-switch",
86
83
  "active-action-icon": o(q),
87
84
  "inactive-action-icon": o(R),
88
- "onUpdate:modelValue": n[0] || (n[0] = (t) => o(i).changeIsDarkTheme(!!t))
85
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => o(i).changeIsDarkTheme(!!t))
89
86
  }, null, 8, ["model-value", "active-action-icon", "inactive-action-icon"]),
90
87
  v(e.$slots, "right", {}, void 0, !0)
91
88
  ])
@@ -1,7 +1,7 @@
1
1
  import t from "./DataListView.vue2.mjs";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-4c7d7547"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-83a69ab1"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,6 +1,11 @@
1
- import { defineComponent as x, computed as w, ref as V, watch as $, openBlock as d, createElementBlock as S, normalizeStyle as F, unref as h, Fragment as H, renderList as K, createBlock as q, withCtx as z, renderSlot as M, markRaw as O, h as s } from "vue";
2
- import j from "./DataListViewItem.vue.mjs";
3
- const N = /* @__PURE__ */ x({
1
+ import { defineComponent as v, computed as m, ref as F, watch as H, openBlock as s, createElementBlock as p, normalizeStyle as z, unref as f, Fragment as E, renderList as K, createBlock as R, withCtx as q, renderSlot as k, createVNode as I, markRaw as M, h as c } from "vue";
2
+ import { ElEmpty as N } from "element-plus";
3
+ import O from "./DataListViewItem.vue.mjs";
4
+ import { createDataListViewInstance as j } from "./utils.mjs";
5
+ const Y = {
6
+ key: 1,
7
+ class: "data-list-view-empty"
8
+ }, T = /* @__PURE__ */ v({
4
9
  __name: "DataListView",
5
10
  props: {
6
11
  data: {},
@@ -10,31 +15,26 @@ const N = /* @__PURE__ */ x({
10
15
  selectable: { type: Boolean, default: !1 }
11
16
  },
12
17
  emits: ["selectionChange"],
13
- setup(u, { expose: v, emit: k }) {
14
- const o = u, C = k, i = (t) => {
18
+ setup(r, { expose: C, emit: b }) {
19
+ const o = r, V = b, i = (t) => {
15
20
  const e = o.rowKey;
16
21
  return typeof e == "function" ? e(t) : String(t[e]);
17
- }, b = w(
22
+ }, D = m(
18
23
  () => o.maxHeight ? { maxHeight: `${o.maxHeight}px`, overflowY: "auto" } : void 0
19
- ), a = V(/* @__PURE__ */ new Set()), p = (t) => o.selectable && a.value.has(i(t)), c = () => {
20
- C("selectionChange", f());
21
- }, f = () => o.selectable ? o.data.filter((t) => a.value.has(i(t))) : [], m = () => {
22
- a.value = /* @__PURE__ */ new Set(), c();
23
- }, _ = (t) => {
24
- o.selectable && (a.value = t ? new Set(o.data.map((e) => i(e))) : /* @__PURE__ */ new Set(), c());
25
- }, B = (t) => {
24
+ ), l = F(/* @__PURE__ */ new Set()), L = m(() => l.value.size === o.data.length), g = (t) => o.selectable && l.value.has(i(t)), d = () => {
25
+ V("selectionChange", y());
26
+ }, y = () => o.selectable ? o.data.filter((t) => l.value.has(i(t))) : [], w = () => {
27
+ l.value = /* @__PURE__ */ new Set(), d();
28
+ }, _ = () => {
26
29
  if (!o.selectable) return;
27
- const e = i(t), n = new Set(a.value);
28
- n.has(e) ? n.delete(e) : n.add(e), a.value = n, c();
29
- };
30
- $(
31
- () => o.data,
32
- () => {
33
- a.value.size && m();
34
- }
35
- );
36
- const D = (t) => O(
37
- x({
30
+ const t = !L.value;
31
+ l.value = t ? new Set(o.data.map((e) => i(e))) : /* @__PURE__ */ new Set(), d();
32
+ }, x = (t) => {
33
+ if (!o.selectable) return;
34
+ const e = i(t), n = new Set(l.value);
35
+ n.has(e) ? n.delete(e) : n.add(e), l.value = n, d();
36
+ }, $ = (t) => M(
37
+ v({
38
38
  name: "DataViewField",
39
39
  props: {
40
40
  row: { type: Object, required: !0 },
@@ -44,32 +44,32 @@ const N = /* @__PURE__ */ x({
44
44
  },
45
45
  setup(e) {
46
46
  return () => {
47
- const { type: n, render: l, prop: y } = t;
47
+ const { type: n, render: a, prop: S } = t;
48
48
  if (n === "index")
49
- return s("span", String(e.index + 1));
49
+ return c("span", String(e.index + 1));
50
50
  if (n === "selection")
51
- return s("input", {
51
+ return c("input", {
52
52
  type: "checkbox",
53
53
  checked: e.selected,
54
54
  onChange: () => {
55
- var g;
56
- return (g = e.toggleSelect) == null ? void 0 : g.call(e);
55
+ var h;
56
+ return (h = e.toggleSelect) == null ? void 0 : h.call(e);
57
57
  }
58
58
  });
59
- if (typeof l == "function")
60
- return l({
59
+ if (typeof a == "function")
60
+ return a({
61
61
  row: e.row,
62
62
  index: e.index,
63
63
  _index: e.index
64
64
  });
65
- if (l)
66
- return s(l);
67
- const r = y ? e.row[y] : void 0;
68
- return s("span", r == null ? "" : String(r));
65
+ if (a)
66
+ return c(a);
67
+ const u = S ? e.row[S] : void 0;
68
+ return c("span", u == null ? "" : String(u));
69
69
  };
70
70
  }
71
71
  })
72
- ), L = w(() => {
72
+ ), B = m(() => {
73
73
  const t = {};
74
74
  for (const e of o.columns) {
75
75
  if (e.type === "expand") continue;
@@ -81,36 +81,47 @@ const N = /* @__PURE__ */ x({
81
81
  );
82
82
  continue;
83
83
  }
84
- t[n] && console.warn(`[DataListView] 列 key 重复 "${n}",后者覆盖前者`), t[n] = D(e);
84
+ t[n] && console.warn(`[DataListView] 列 key 重复 "${n}",后者覆盖前者`), t[n] = $(e);
85
85
  }
86
86
  return t;
87
+ }), A = j({
88
+ clearSelection: w,
89
+ getSelectionRows: y,
90
+ toggleRowSelection: x,
91
+ toggleAllSelection: _,
92
+ columns: o.columns
87
93
  });
88
- return v({
89
- getSelected: f,
90
- clearSelection: m,
91
- toggleAll: _
92
- }), (t, e) => (d(), S("div", {
94
+ return C(A), H(
95
+ () => o.data,
96
+ () => {
97
+ l.value.size && w();
98
+ }
99
+ ), (t, e) => (s(), p("div", {
93
100
  class: "data-list-view",
94
- style: F(h(b))
101
+ style: z(f(D))
95
102
  }, [
96
- (d(!0), S(H, null, K(u.data, (n, l) => (d(), q(j, {
103
+ r.data.length ? (s(!0), p(E, { key: 0 }, K(r.data, (n, a) => (s(), R(O, {
97
104
  key: i(n),
98
- selected: p(n)
105
+ selected: g(n)
99
106
  }, {
100
- default: z(() => [
101
- M(t.$slots, "item", {
102
- fieldComponentMap: h(L),
107
+ default: q(() => [
108
+ k(t.$slots, "item", {
109
+ fieldComponentMap: f(B),
103
110
  row: n,
104
- index: l,
105
- selected: p(n),
106
- toggleSelect: () => B(n)
111
+ index: a,
112
+ selected: g(n),
113
+ toggleSelect: () => x(n)
107
114
  }, void 0, !0)
108
115
  ]),
109
116
  _: 2
110
- }, 1032, ["selected"]))), 128))
117
+ }, 1032, ["selected"]))), 128)) : (s(), p("div", Y, [
118
+ k(t.$slots, "empty", {}, () => [
119
+ I(f(N))
120
+ ], !0)
121
+ ]))
111
122
  ], 4));
112
123
  }
113
124
  });
114
125
  export {
115
- N as default
126
+ T as default
116
127
  };
@@ -0,0 +1,36 @@
1
+ const o = (r) => ({
2
+ toggleRowExpansion: () => {
3
+ throw new Error("toggleRowExpansion not supported");
4
+ },
5
+ setCurrentRow: () => {
6
+ throw new Error("setCurrentRow not supported");
7
+ },
8
+ clearSort: () => {
9
+ throw new Error("clearSort not supported");
10
+ },
11
+ clearFilter: () => {
12
+ throw new Error("clearFilter not supported");
13
+ },
14
+ doLayout: () => {
15
+ throw new Error("doLayout not supported");
16
+ },
17
+ sort: () => {
18
+ throw new Error("sort not supported");
19
+ },
20
+ scrollTo: () => {
21
+ throw new Error("scrollTo not supported");
22
+ },
23
+ setScrollTop: () => {
24
+ throw new Error("setScrollTop not supported");
25
+ },
26
+ setScrollLeft: () => {
27
+ throw new Error("setScrollLeft not supported");
28
+ },
29
+ updateKeyChildren: () => {
30
+ throw new Error("updateKeyChildren not supported");
31
+ },
32
+ ...r
33
+ });
34
+ export {
35
+ o as createDataListViewInstance
36
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./TabsHeader.vue2.mjs";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-dbdd01cb"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d6937179"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -12,7 +12,7 @@ const oe = /* @__PURE__ */ m({
12
12
  channel: {},
13
13
  parentChannel: {},
14
14
  padding: {},
15
- refine: { type: Boolean, default: !0 },
15
+ refine: { type: Boolean, default: !1 },
16
16
  refineReduceHeight: { default: 0 },
17
17
  variant: {}
18
18
  }, {
@@ -1,7 +1,7 @@
1
1
  import o from "./ListPage.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d8d188e5"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8547b0b7"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };