@done-coding/admin-core 0.12.0 → 0.12.2-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 (130) hide show
  1. package/README.md +1 -48
  2. package/es/bridge/index.mjs +75 -72
  3. package/es/bridge/layout.mjs +51 -0
  4. package/es/bridge/theme/index.mjs +1 -1
  5. package/es/bridge/theme/persist.mjs +1 -1
  6. package/es/components/app-layout/AppAside.vue.mjs +2 -2
  7. package/es/components/app-layout/AppAside.vue2.mjs +27 -10
  8. package/es/components/app-layout/AppCollapseToggle.vue.mjs +7 -0
  9. package/es/components/app-layout/AppCollapseToggle.vue2.mjs +54 -0
  10. package/es/components/app-layout/AppFooter.vue.mjs +1 -1
  11. package/es/components/app-layout/AppHeader.vue.mjs +3 -3
  12. package/es/components/app-layout/AppHeader.vue2.mjs +1 -1
  13. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  14. package/es/components/app-layout/AppLayout.vue2.mjs +3 -3
  15. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  16. package/es/components/app-layout/AppSidebar.vue2.mjs +41 -61
  17. package/es/components/app-layout/AppTheme.vue.mjs +3 -3
  18. package/es/components/app-layout/viewport.mjs +3 -3
  19. package/es/components/display/TabsHeader.vue.mjs +4 -4
  20. package/es/components/form/FormItemNestForm.vue.mjs +2 -2
  21. package/es/components/form/FormItemNestFormList.vue.mjs +2 -2
  22. package/es/components/form/FormSubmitPanel.vue.mjs +1 -1
  23. package/es/components/form/FormVerifyImage.vue.mjs +1 -1
  24. package/es/components/table/TableToolbar.vue.mjs +3 -3
  25. package/es/hooks/use-theme-apply.mjs +255 -0
  26. package/es/hooks/use-viewport-apply.mjs +39 -0
  27. package/es/index.mjs +92 -91
  28. package/es/inject/key.mjs +13 -13
  29. package/es/store/app.mjs +69 -62
  30. package/es/style.css +1 -1
  31. package/es/utils/theme-scale.mjs +1 -0
  32. package/package.json +6 -8
  33. package/types/bridge/config-hook.d.ts +0 -68
  34. package/types/bridge/index.d.ts +18 -417
  35. package/types/bridge/layout.d.ts +25 -0
  36. package/types/bridge/plugin.d.ts +12 -30
  37. package/types/bridge/route.d.ts +1 -20
  38. package/types/bridge/state.d.ts +0 -14
  39. package/types/bridge/storage.d.ts +0 -9
  40. package/types/bridge/theme/index.d.ts +1 -8
  41. package/types/bridge/theme/persist.d.ts +3 -15
  42. package/types/bridge/theme/system-dark.d.ts +0 -12
  43. package/types/bridge/theme/types.d.ts +27 -265
  44. package/types/components/app-layout/AppAside.vue.d.ts +0 -1
  45. package/types/components/app-layout/AppCollapseToggle.vue.d.ts +11 -0
  46. package/types/components/app-layout/AppHeader.vue.d.ts +0 -3
  47. package/types/components/app-layout/AppLayout.vue.d.ts +0 -12
  48. package/types/components/app-layout/AppPage.vue.d.ts +0 -2
  49. package/types/components/app-layout/AppSidebar.vue.d.ts +0 -2
  50. package/types/components/app-layout/types.d.ts +2 -127
  51. package/types/components/app-layout/viewport.d.ts +2 -30
  52. package/types/components/data-view/DataListViewItem.vue.d.ts +0 -8
  53. package/types/components/data-view/index.d.ts +0 -4
  54. package/types/components/data-view/types.d.ts +0 -41
  55. package/types/components/data-view/utils.d.ts +0 -3
  56. package/types/components/display/TabsHeader.vue.d.ts +0 -2
  57. package/types/components/display/TabsMain.vue.d.ts +0 -2
  58. package/types/components/display/TabsRefineFlow.vue.d.ts +0 -1
  59. package/types/components/display/index.d.ts +1 -37
  60. package/types/components/display/types.d.ts +0 -131
  61. package/types/components/form/FormItemNestForm.vue.d.ts +0 -5
  62. package/types/components/form/FormItemNestFormList.vue.d.ts +0 -17
  63. package/types/components/form/FormVerifyCode.vue.d.ts +0 -9
  64. package/types/components/form/FormVerifyImage.vue.d.ts +0 -1
  65. package/types/components/form/form-search-utils.d.ts +0 -14
  66. package/types/components/form/nest-form-item-list.d.ts +0 -28
  67. package/types/components/form/nest-form-item.d.ts +0 -21
  68. package/types/components/form/nest-registry.d.ts +0 -14
  69. package/types/components/form/types.d.ts +8 -185
  70. package/types/components/form/use-form-submit.d.ts +0 -12
  71. package/types/components/form/use-nest-form-list.d.ts +0 -13
  72. package/types/components/form/use-nest-form.d.ts +0 -15
  73. package/types/components/form/use-nest-layout-scale.d.ts +0 -12
  74. package/types/components/form/utils.d.ts +1 -56
  75. package/types/components/list-page/ListPage.vue.d.ts +0 -6
  76. package/types/components/list-page/types.d.ts +2 -19
  77. package/types/components/misc/index.d.ts +1 -6
  78. package/types/components/misc/types.d.ts +0 -6
  79. package/types/components/modal/ConfirmModal.vue.d.ts +0 -10
  80. package/types/components/modal/modal-shelf-core.d.ts +0 -3
  81. package/types/components/modal/modal-shelf-hierarchy.d.ts +0 -4
  82. package/types/components/modal/modal-shelf-types.d.ts +0 -34
  83. package/types/components/modal/types.d.ts +1 -20
  84. package/types/components/panel/PanelItemNestForm.vue.d.ts +0 -6
  85. package/types/components/panel/PanelItemNestPanel.vue.d.ts +0 -5
  86. package/types/components/panel/nest-panel-form.d.ts +0 -21
  87. package/types/components/panel/nest-panel-item.d.ts +0 -14
  88. package/types/components/panel/types.d.ts +1 -49
  89. package/types/components/table/types.d.ts +9 -124
  90. package/types/config/list-model.d.ts +0 -29
  91. package/types/config/route.d.ts +0 -2
  92. package/types/helpers/form.d.ts +0 -5
  93. package/types/helpers/list-helper.d.ts +0 -26
  94. package/types/helpers/types.d.ts +0 -11
  95. package/types/hooks/activated.d.ts +0 -10
  96. package/types/hooks/feel-size.d.ts +0 -2
  97. package/types/hooks/index.d.ts +2 -2
  98. package/types/hooks/menus-dispatch.d.ts +0 -4
  99. package/types/hooks/timeout.d.ts +0 -4
  100. package/types/hooks/use-channel-viewport-height.d.ts +0 -14
  101. package/types/hooks/use-theme-apply.d.ts +11 -0
  102. package/types/hooks/use-viewport-apply.d.ts +8 -0
  103. package/types/inject/key.d.ts +2 -87
  104. package/types/router/guard/index.d.ts +0 -13
  105. package/types/router/guard/login.d.ts +0 -1
  106. package/types/router/guard/permission.d.ts +0 -1
  107. package/types/router/guard/types.d.ts +2 -5
  108. package/types/store/app.d.ts +10 -31
  109. package/types/store/router-permission.d.ts +2 -55
  110. package/types/store/user.d.ts +2 -26
  111. package/types/types/dot-path.d.ts +0 -8
  112. package/types/types/route.d.ts +0 -45
  113. package/types/types/utility-types.d.ts +0 -7
  114. package/types/utils/export.d.ts +1 -16
  115. package/types/utils/id.d.ts +0 -1
  116. package/types/utils/router.d.ts +0 -2
  117. package/types/utils/theme-scale.d.ts +1 -30
  118. package/types/utils/time.d.ts +0 -1
  119. package/docs/TECH_SNAPSHOT.md +0 -146
  120. package/docs/nested-config-paradigm.md +0 -80
  121. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/RETROSPECTIVE.md +0 -63
  122. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/design.md +0 -575
  123. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/landing-authorizations/2026-05-09-080900-/346/234/2371-/345/205/245/345/256/236/346/226/275/346/216/210/346/235/203.md +0 -107
  124. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/project-orchestration.md +0 -58
  125. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/requirements.md +0 -238
  126. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/tasks.md +0 -290
  127. package/es/hooks/use-admin-theme-apply.mjs +0 -213
  128. package/es/hooks/use-admin-viewport-apply.mjs +0 -39
  129. package/types/hooks/use-admin-theme-apply.d.ts +0 -34
  130. package/types/hooks/use-admin-viewport-apply.d.ts +0 -20
@@ -1,10 +1,9 @@
1
- import { defineComponent as k, useCssVars as A, inject as v, computed as e, ref as b, openBlock as f, createElementBlock as T, normalizeStyle as g, createVNode as a, unref as o, withCtx as i, renderSlot as h, createElementVNode as C, createBlock as H, createCommentVNode as L } from "vue";
2
- import w from "../menu/MenuTree.vue.mjs";
3
- import y from "../display/WatchSize.vue.mjs";
4
- import { ElTooltip as F, ElIcon as I } from "element-plus";
5
- import { ArrowRightBold as V } from "@element-plus/icons-vue";
6
- import { APP_LAYOUT_APP_STORE_KEY as Y, APP_LAYOUT_BRIDGE_KEY as N } from "../../inject/key.mjs";
7
- const O = { class: "app-sidebar-shim" }, D = /* @__PURE__ */ k({
1
+ import { defineComponent as P, useCssVars as A, inject as m, computed as e, ref as v, openBlock as B, createElementBlock as E, normalizeStyle as H, createVNode as l, unref as p, withCtx as b, renderSlot as g, createElementVNode as L } from "vue";
2
+ import $ from "../menu/MenuTree.vue.mjs";
3
+ import f from "../display/WatchSize.vue.mjs";
4
+ import w from "./AppCollapseToggle.vue.mjs";
5
+ import { APP_LAYOUT_APP_STORE_KEY as F, APP_LAYOUT_BRIDGE_KEY as k } from "../../inject/key.mjs";
6
+ const Y = { class: "app-sidebar-shim" }, N = /* @__PURE__ */ P({
8
7
  __name: "AppSidebar",
9
8
  props: {
10
9
  show: { type: Boolean },
@@ -12,80 +11,61 @@ const O = { class: "app-sidebar-shim" }, D = /* @__PURE__ */ k({
12
11
  menus: {},
13
12
  menuFlatList: {}
14
13
  },
15
- setup(s) {
16
- A((d) => ({
17
- v368510bd: E.value,
18
- v7b09fce5: _.value,
19
- v1098f49b: B.value,
20
- cc02eed6: l.value.bodyColor,
21
- v56d0884d: l.value.primaryColor
14
+ setup(t) {
15
+ A((o) => ({
16
+ v769c523e: _.value,
17
+ v2fe699b4: x.value,
18
+ v819fea8c: S.value
22
19
  }));
23
- const S = s, u = v(Y), c = e(() => u.sidebarStyle), p = b(0), m = b(0), x = e(() => parseFloat(String(c.value.paddingTop ?? "")) || 0), _ = e(
24
- () => `${Math.max(x.value, p.value)}px`
25
- ), B = e(() => `${m.value}px`), E = e(() => S.aboveHeader ? 2 : 0), r = e(() => u.sidebarIsCollapse), P = e(() => ({
26
- transform: `rotate(${r.value ? 0 : 180}deg)`
27
- })), $ = v(N), l = e(() => $.themeColors.value);
28
- return (d, t) => (f(), T("div", {
20
+ const h = t, s = m(F), u = e(() => s.sidebarStyle), c = v(0), d = v(0), C = e(() => parseFloat(String(u.value.paddingTop ?? "")) || 0), x = e(
21
+ () => `${Math.max(C.value, c.value)}px`
22
+ ), S = e(() => `${d.value}px`), _ = e(() => h.aboveHeader ? 2 : 0), r = e(() => s.sidebarIsCollapse), y = () => {
23
+ const o = !r.value;
24
+ s.changeSidebarCollapseStatus(o);
25
+ }, T = m(k), n = e(() => T.themeColors.value);
26
+ return (o, a) => (B(), E("div", {
29
27
  class: "app-sidebar",
30
- style: g(c.value)
28
+ style: H(u.value)
31
29
  }, [
32
- a(o(y), {
30
+ l(p(f), {
33
31
  class: "app-sidebar-top",
34
- onHeightChange: t[0] || (t[0] = (n) => p.value = n)
32
+ onHeightChange: a[0] || (a[0] = (i) => c.value = i)
35
33
  }, {
36
- default: i(() => [
37
- h(d.$slots, "top", {}, void 0, !0)
34
+ default: b(() => [
35
+ g(o.$slots, "top", {}, void 0, !0)
38
36
  ]),
39
37
  _: 3
40
38
  }),
41
- C("div", O, [
42
- a(o(w), {
39
+ L("div", Y, [
40
+ l(p($), {
43
41
  collapse: r.value,
44
- menus: s.menus,
42
+ menus: t.menus,
45
43
  style: { height: "100%" },
46
- "background-color": l.value.bodyColor,
47
- "text-color": l.value.baseColor,
48
- "active-text-color": l.value.primaryColor,
49
- menuFlatList: s.menuFlatList,
44
+ "background-color": n.value.bodyColor,
45
+ "text-color": n.value.baseColor,
46
+ "active-text-color": n.value.primaryColor,
47
+ menuFlatList: t.menuFlatList,
50
48
  routerMode: ""
51
49
  }, null, 8, ["collapse", "menus", "background-color", "text-color", "active-text-color", "menuFlatList"])
52
50
  ]),
53
- a(o(y), {
51
+ l(p(f), {
54
52
  class: "app-sidebar-bottom",
55
- onHeightChange: t[1] || (t[1] = (n) => m.value = n)
53
+ onHeightChange: a[1] || (a[1] = (i) => d.value = i)
56
54
  }, {
57
- default: i(() => [
58
- h(d.$slots, "bottom", {}, void 0, !0)
55
+ default: b(() => [
56
+ g(o.$slots, "bottom", {}, void 0, !0)
59
57
  ]),
60
58
  _: 3
61
59
  }),
62
- s.show ? (f(), H(o(F), {
63
- key: 0,
64
- content: r.value ? "展开" : "收起",
65
- placement: "right",
66
- "show-after": 200
67
- }, {
68
- default: i(() => [
69
- C("div", {
70
- class: "app-sidebar-toggle",
71
- onClick: t[2] || (t[2] = (n) => o(u).changeSidebarCollapseStatus(!r.value))
72
- }, [
73
- a(o(I), null, {
74
- default: i(() => [
75
- a(o(V), {
76
- class: "app-sidebar-toggle-icon",
77
- style: g(P.value)
78
- }, null, 8, ["style"])
79
- ]),
80
- _: 1
81
- })
82
- ])
83
- ]),
84
- _: 1
85
- }, 8, ["content"])) : L("", !0)
60
+ l(w, {
61
+ side: "sidebar",
62
+ show: t.show,
63
+ collapse: r.value,
64
+ onToggle: y
65
+ }, null, 8, ["show", "collapse"])
86
66
  ], 4));
87
67
  }
88
68
  });
89
69
  export {
90
- D as default
70
+ N as default
91
71
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AppTheme.vue2.mjs";
2
2
  /* empty css */
3
- import e from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-e4f0fe3b"]]);
3
+ import p from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-06ca4822"]]);
5
5
  export {
6
- m as default
6
+ a as default
7
7
  };
@@ -1,5 +1,5 @@
1
- const E = 800, _ = 1e4;
1
+ const E = 800, O = 1e4;
2
2
  export {
3
- _ as ADMIN_CORE_VIEWPORT_DECOR_ZINDEX_ABOVE,
4
- E as ADMIN_CORE_VIEWPORT_DECOR_ZINDEX_BELOW
3
+ O as CORE_VIEWPORT_DECOR_ZINDEX_ABOVE,
4
+ E as CORE_VIEWPORT_DECOR_ZINDEX_BELOW
5
5
  };
@@ -1,7 +1,7 @@
1
- import a from "./TabsHeader.vue2.mjs";
1
+ import o from "./TabsHeader.vue2.mjs";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const e = /* @__PURE__ */ o(a, [["__scopeId", "data-v-3faa57f5"]]);
3
+ import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-6b4fc73b"]]);
5
5
  export {
6
- e as default
6
+ f as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormItemNestForm.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-12b77b02"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a413a382"]]);
5
5
  export {
6
- p as default
6
+ e as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormItemNestFormList.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9fa02cbe"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-68118cbf"]]);
5
5
  export {
6
- s as default
6
+ e as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormSubmitPanel.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-93bc9096"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1505775a"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormVerifyImage.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-669b7ad9"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7a70397e"]]);
5
5
  export {
6
6
  e as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./TableToolbar.vue2.mjs";
2
2
  /* empty css */
3
- import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-6f2937e1"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-0175f1a9"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -0,0 +1,255 @@
1
+ import { watch as s } from "vue";
2
+ import { themeScaleDerive as C, themeScaleParseHex as S, themeScaleMix as $, themeScaleToRgba as _ } from "../utils/theme-scale.mjs";
3
+ const m = "dc-core-theme", y = [
4
+ ["primaryColor", { scale: !0, el: "--el-color-primary" }],
5
+ ["successColor", { scale: !0, el: "--el-color-success" }],
6
+ ["warningColor", { scale: !0, el: "--el-color-warning" }],
7
+ ["dangerColor", { scale: !0, el: "--el-color-danger" }],
8
+ ["errorColor", { scale: !0, el: "--el-color-error" }],
9
+ ["infoColor", { scale: !0, el: "--el-color-info" }],
10
+ ["bodyColor", { el: ["--el-bg-color-page", "--el-bg-color"] }],
11
+ ["baseColor", { el: "--el-text-color-primary" }],
12
+ ["radius", { el: "--el-border-radius-base" }],
13
+ ["borderColor", { el: "--el-border-color" }],
14
+ ["shadow", { el: "--el-box-shadow" }],
15
+ ["borderWidth", { el: "--el-border-width" }],
16
+ ["accent", {}],
17
+ ["glow", {}],
18
+ ["blur", {}],
19
+ ["focusRing", {}],
20
+ ["surface", {}]
21
+ ], p = [
22
+ "light-3",
23
+ "light-5",
24
+ "light-7",
25
+ "light-8",
26
+ "light-9",
27
+ "dark-2"
28
+ ], L = (r) => r.replace(/([A-Z])/g, "-$1").toLowerCase(), g = (r, t) => {
29
+ const e = [];
30
+ for (const [c, n] of y) {
31
+ const o = r[c];
32
+ if (o === void 0 || o === "") continue;
33
+ const l = `--dc-core-${L(c)}`, a = n.el === void 0 ? [] : Array.isArray(n.el) ? n.el : [n.el];
34
+ if (n.scale) {
35
+ const d = C(o, t);
36
+ e.push(`${l}: ${o};`);
37
+ for (const i of p)
38
+ e.push(`${l}-${i}: ${d[i]};`);
39
+ for (const i of a) {
40
+ e.push(`${i}: ${o};`);
41
+ for (const u of p)
42
+ e.push(`${i}-${u}: ${d[u]};`);
43
+ }
44
+ } else {
45
+ e.push(`${l}: ${o};`);
46
+ for (const d of a) e.push(`${d}: ${o};`);
47
+ }
48
+ }
49
+ return e.join(`
50
+ `);
51
+ }, A = 0.4, T = 10, v = {
52
+ light: 0.5,
53
+ dark: 0.72
54
+ }, f = (r, t) => {
55
+ if (!r) return "";
56
+ const e = S(r);
57
+ if (!e) return "";
58
+ const c = Math.max(...e), n = c === 0 ? 0 : Math.min(A, T / c), o = $(r, "#000000", n);
59
+ return `--el-overlay-color-lighter: ${_(
60
+ o,
61
+ v[t]
62
+ )};`;
63
+ }, I = { light: 0.9, dark: 0.8 }, h = (r, t) => {
64
+ if (!r) return "";
65
+ const e = _(r, I[t]);
66
+ return e === r ? "" : `--el-mask-color: ${e};`;
67
+ }, P = 0.88, k = (r, t) => !r || !S(r) ? "" : `--dc-core-dialog-surface: ${$(r, "#ffffff", P)};`, D = (r) => {
68
+ const t = r.light, e = r.dark, c = g(t, "light"), n = g(e, "dark"), l = [
69
+ c,
70
+ "color: var(--dc-core-base-color);",
71
+ f(t.bodyColor, "light"),
72
+ h(t.bodyColor, "light")
73
+ ].filter(Boolean), a = [
74
+ n,
75
+ f(e.bodyColor, "dark"),
76
+ h(e.bodyColor, "dark"),
77
+ k(e.bodyColor)
78
+ ].filter(Boolean);
79
+ return `:root {
80
+ ${l.join(
81
+ `
82
+ `
83
+ )}
84
+ }
85
+ :root.dark {
86
+ ${a.join(`
87
+ `)}
88
+ }
89
+ `;
90
+ }, E = "dc-core-rhythm", b = "dc-core-ep-bridge", x = "dc-core-ep-structural", B = [
91
+ ".el-dialog,",
92
+ ".el-message-box {",
93
+ // elevation:暗色下用提亮过的面板底(--dc-core-dialog-surface,仅 :root.dark 派生),
94
+ // 让整块面板亮于页面底而浮起;缺省(亮色 / 非 hex)退 --el-bg-color,亮色零改动。
95
+ " background-color: var(--dc-core-dialog-surface, var(--el-bg-color));",
96
+ " border: 1px solid var(--dc-core-border-color, var(--el-border-color));",
97
+ "}"
98
+ ].join(`
99
+ `), R = [
100
+ // T1 必纳:表格行密度(垂直经 td padding,水平经 .cell padding)
101
+ ".el-table .el-table__cell {",
102
+ " padding-top: var(--dc-core-cell-padding-y, 8px);",
103
+ " padding-bottom: var(--dc-core-cell-padding-y, 8px);",
104
+ "}",
105
+ ".el-table .cell {",
106
+ " padding-left: var(--dc-core-cell-padding-x, 12px);",
107
+ " padding-right: var(--dc-core-cell-padding-x, 12px);",
108
+ "}",
109
+ // T1 必纳:表单项间距
110
+ ".el-form-item {",
111
+ " margin-bottom: var(--dc-core-form-item-gap, 18px);",
112
+ "}"
113
+ // 注:dialog/card 内距撤到期二——其 EP 原生值(dialog 16 / card 20)与单一
114
+ // content-gap 无法同时对齐,本期纳入会破"默认档零漂移";期二用专属 var 补。
115
+ ].join(`
116
+ `), w = {
117
+ compact: {
118
+ spaceUnit: "4px",
119
+ gap: "8px",
120
+ controlHeight: "28px",
121
+ cellPaddingY: "6px",
122
+ cellPaddingX: "12px",
123
+ formItemGap: "12px",
124
+ fontSizeBase: "13px",
125
+ fontScale: "1.15"
126
+ },
127
+ cozy: {
128
+ // cozy = 默认档:取值 [MUST] 与 EP 原生对齐(控件 32 / 字号 14 / 行垂距 8 /
129
+ // 横距 12 / form-item 18),保证未 opt-in 的存量应用零视觉漂移。
130
+ spaceUnit: "4px",
131
+ gap: "12px",
132
+ controlHeight: "32px",
133
+ cellPaddingY: "8px",
134
+ cellPaddingX: "12px",
135
+ formItemGap: "18px",
136
+ fontSizeBase: "14px",
137
+ fontScale: "1.2"
138
+ },
139
+ comfortable: {
140
+ spaceUnit: "4px",
141
+ gap: "20px",
142
+ controlHeight: "40px",
143
+ cellPaddingY: "14px",
144
+ cellPaddingX: "12px",
145
+ formItemGap: "26px",
146
+ fontSizeBase: "15px",
147
+ fontScale: "1.25"
148
+ }
149
+ }, H = {
150
+ snappy: {
151
+ duration: "120ms",
152
+ durationSlow: "180ms",
153
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)"
154
+ },
155
+ standard: {
156
+ // standard = 默认档:duration 200 / durationSlow 300 对齐 EP 原生
157
+ // (--el-transition-duration-fast .2s / --el-transition-duration .3s),默认零漂移。
158
+ duration: "200ms",
159
+ durationSlow: "300ms",
160
+ easing: "cubic-bezier(0.25, 0.1, 0.25, 1)"
161
+ },
162
+ calm: {
163
+ duration: "320ms",
164
+ durationSlow: "420ms",
165
+ easing: "cubic-bezier(0.22, 0.61, 0.36, 1)"
166
+ }
167
+ };
168
+ function Y(r, t) {
169
+ const e = w[r], c = H[t], n = [
170
+ `--dc-core-space-unit: ${e.spaceUnit};`,
171
+ `--dc-core-content-gap: ${e.gap};`,
172
+ `--dc-core-control-height: ${e.controlHeight};`,
173
+ `--el-component-size: ${e.controlHeight};`,
174
+ `--dc-core-cell-padding-y: ${e.cellPaddingY};`,
175
+ `--dc-core-cell-padding-x: ${e.cellPaddingX};`,
176
+ `--dc-core-form-item-gap: ${e.formItemGap};`,
177
+ `--dc-core-font-size-base: ${e.fontSizeBase};`,
178
+ `--el-font-size-base: ${e.fontSizeBase};`,
179
+ `--dc-core-font-scale: ${e.fontScale};`,
180
+ `--dc-core-motion-duration: ${c.duration};`,
181
+ `--el-transition-duration-fast: ${c.duration};`,
182
+ `--dc-core-motion-duration-slow: ${c.durationSlow};`,
183
+ `--el-transition-duration: ${c.durationSlow};`,
184
+ // easing 仅挂 dc-core,[MUST NOT] dual-write 覆盖 EP 两条 bezier——
185
+ // EP ease-in-out / fast 曲线各异,覆盖会让默认档动画曲线漂移;motion 档对 EP 只经 duration 生效。
186
+ `--dc-core-motion-easing: ${c.easing};`
187
+ ], o = [
188
+ "--dc-core-motion-duration: 0.01ms;",
189
+ "--dc-core-motion-duration-slow: 0.01ms;",
190
+ "--el-transition-duration: 0.01ms;",
191
+ "--el-transition-duration-fast: 0.01ms;"
192
+ ];
193
+ return `:root {
194
+ ${n.join(`
195
+ `)}
196
+ }
197
+ @media (prefers-reduced-motion: reduce) {
198
+ :root {
199
+ ${o.join(
200
+ `
201
+ `
202
+ )}
203
+ }
204
+ }
205
+ `;
206
+ }
207
+ function U(r) {
208
+ const t = r.document ?? (typeof document < "u" ? document : void 0);
209
+ if (!t) return;
210
+ const e = () => {
211
+ let o = t.getElementById(m);
212
+ return o || (o = t.createElement("style"), o.id = m, t.head.appendChild(o)), o;
213
+ };
214
+ if (!t.getElementById(x)) {
215
+ const o = t.createElement("style");
216
+ o.id = x, o.textContent = B, t.head.appendChild(o);
217
+ }
218
+ s(
219
+ r.getThemeConfig,
220
+ (o) => {
221
+ e().textContent = D(o);
222
+ },
223
+ { deep: !0, immediate: !0 }
224
+ ), s(
225
+ r.getThemeIsDark,
226
+ (o) => {
227
+ t.documentElement.classList.toggle("dark", o);
228
+ },
229
+ { immediate: !0 }
230
+ );
231
+ const { getThemeDensity: c, getThemeMotion: n } = r;
232
+ if (c && n) {
233
+ if (!t.getElementById(b)) {
234
+ const l = t.createElement("style");
235
+ l.id = b, l.textContent = R, t.head.appendChild(l);
236
+ }
237
+ const o = () => {
238
+ let l = t.getElementById(
239
+ E
240
+ );
241
+ return l || (l = t.createElement("style"), l.id = E, t.head.appendChild(l)), l;
242
+ };
243
+ s(
244
+ () => [c(), n()],
245
+ ([l, a]) => {
246
+ o().textContent = Y(l, a);
247
+ },
248
+ { immediate: !0 }
249
+ );
250
+ }
251
+ }
252
+ export {
253
+ Y as buildRhythmCss,
254
+ U as useThemeApply
255
+ };
@@ -0,0 +1,39 @@
1
+ import { watch as i } from "vue";
2
+ const r = "dc-core-viewport", c = (e, d) => {
3
+ const p = e.paddingLeft + e.paddingRight, t = e.paddingTop + e.paddingBottom;
4
+ return `:root {
5
+ --dc-core-viewport-width: calc(100vw - ${p}px);
6
+ --dc-core-viewport-height: calc(100vh - ${t}px);
7
+ --dc-core-viewport-padding-top: ${e.paddingTop}px;
8
+ --dc-core-viewport-padding-right: ${e.paddingRight}px;
9
+ --dc-core-viewport-padding-bottom: ${e.paddingBottom}px;
10
+ --dc-core-viewport-padding-left: ${e.paddingLeft}px;
11
+ ` + // gap 内缝 var:仅当提供 getGapConfig 时注入(纯对外暴露,core 不读)。
12
+ (d ? ` --dc-core-gap: ${d.size}px;
13
+ ` : "") + `}
14
+ `;
15
+ };
16
+ function a(e) {
17
+ const d = e.document ?? (typeof document < "u" ? document : void 0);
18
+ if (!d) return;
19
+ const p = () => {
20
+ let t = d.getElementById(r);
21
+ return t || (t = d.createElement("style"), t.id = r, d.head.appendChild(t)), t;
22
+ };
23
+ i(
24
+ () => {
25
+ var t;
26
+ return {
27
+ viewport: e.getViewportConfig(),
28
+ gap: (t = e.getGapConfig) == null ? void 0 : t.call(e)
29
+ };
30
+ },
31
+ ({ viewport: t, gap: o }) => {
32
+ p().textContent = c(t, o);
33
+ },
34
+ { deep: !0, immediate: !0 }
35
+ );
36
+ }
37
+ export {
38
+ a as useViewportApply
39
+ };