@done-coding/admin-core 0.30.0 → 0.30.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 (66) hide show
  1. package/es/bridge/badge.mjs +7 -1
  2. package/es/components/app-layout/AppPage.vue.mjs +1 -1
  3. package/es/components/app-layout/AppPage.vue2.mjs +15 -8
  4. package/es/components/app-layout/app-page-geometry.mjs +7 -3
  5. package/es/components/app-layout/use-slot-misuse-warn.mjs +40 -0
  6. package/es/components/data-view/DataGridView.vue.mjs +1 -1
  7. package/es/components/data-view/DataGridView.vue2.mjs +83 -32
  8. package/es/components/data-view/DataGridViewCard.vue.mjs +41 -0
  9. package/es/components/data-view/DataGridViewCard.vue2.mjs +4 -0
  10. package/es/components/data-view/InfiniteListView.vue.mjs +1 -1
  11. package/es/components/data-view/InfiniteListView.vue2.mjs +38 -11
  12. package/es/components/display/BadgeMark.vue.mjs +1 -1
  13. package/es/components/display/BadgeMark.vue2.mjs +31 -33
  14. package/es/components/display/use-badge.mjs +37 -33
  15. package/es/components/form/FormGroupTitle.vue.mjs +1 -1
  16. package/es/components/form/FormItem.vue.mjs +1 -1
  17. package/es/components/form/FormItemNestForm.vue.mjs +1 -1
  18. package/es/components/form/FormItemNestFormList.vue.mjs +1 -1
  19. package/es/components/form/FormTree.vue.mjs +5 -30
  20. package/es/components/form/FormTree.vue2.mjs +30 -1
  21. package/es/components/form/FormUpload.vue.mjs +1 -1
  22. package/es/components/modal/ModalPorter.vue.mjs +2 -0
  23. package/es/components/modal/use-slot-misuse-warn.mjs +22 -0
  24. package/es/components/page-layout/AppPageListDetailSplit.vue.mjs +1 -1
  25. package/es/components/page-layout/AppPageListDetailSplit.vue2.mjs +7 -7
  26. package/es/components/view-layout/ViewLayout.vue.mjs +1 -1
  27. package/es/components/view-layout/ViewLayout.vue2.mjs +71 -91
  28. package/es/components/view-layout/ViewLayoutToolbar.vue.mjs +7 -0
  29. package/es/components/view-layout/ViewLayoutToolbar.vue2.mjs +189 -0
  30. package/es/config/slot-region.mjs +23 -1
  31. package/es/hooks/use-custom-breakpoint.mjs +12 -2
  32. package/es/hooks/use-is-dev.mjs +16 -0
  33. package/es/hooks/use-theme-apply.mjs +2 -2
  34. package/es/index.mjs +90 -88
  35. package/es/style.css +138 -87
  36. package/package.json +2 -2
  37. package/src/bridge/docs/README.md +34 -4
  38. package/src/components/app-layout/docs/README-AppPage.md +68 -0
  39. package/src/components/data-view/docs/README-DataGridView.md +83 -1
  40. package/src/components/data-view/docs/README-DataListView.md +5 -2
  41. package/src/components/display/docs/README-BadgeMark.md +102 -41
  42. package/src/components/form/README.md +14 -0
  43. package/src/components/form/docs/README-FormItemNestForm.md +3 -0
  44. package/src/components/form/docs/README-FormItemNestFormList.md +3 -0
  45. package/src/components/form/docs/README-FormUpload.md +3 -0
  46. package/src/components/modal/docs/README-ModalPorter.md +26 -0
  47. package/src/components/page-layout/docs/README-AppPageListDetailLayout.md +1 -1
  48. package/src/components/view-layout/docs/README-ViewLayout.md +152 -9
  49. package/src/hooks/docs/README.md +37 -1
  50. package/types/bridge/badge.d.ts +38 -2
  51. package/types/components/app-layout/AppPage.vue.d.ts +16 -0
  52. package/types/components/app-layout/app-page-geometry.d.ts +26 -2
  53. package/types/components/app-layout/use-slot-misuse-warn.d.ts +19 -0
  54. package/types/components/data-view/DataGridView.vue.d.ts +9 -0
  55. package/types/components/data-view/DataGridViewCard.vue.d.ts +25 -0
  56. package/types/components/data-view/types.d.ts +63 -0
  57. package/types/components/display/BadgeMark.vue.d.ts +9 -8
  58. package/types/components/display/use-badge.d.ts +22 -14
  59. package/types/components/modal/use-slot-misuse-warn.d.ts +21 -0
  60. package/types/components/view-layout/ViewLayout.vue.d.ts +16 -0
  61. package/types/components/view-layout/ViewLayoutToolbar.vue.d.ts +52 -0
  62. package/types/components/view-layout/types.d.ts +56 -0
  63. package/types/config/slot-region.d.ts +12 -0
  64. package/types/hooks/use-custom-breakpoint.d.ts +1 -12
  65. package/types/hooks/use-is-dev.d.ts +24 -0
  66. package/types/injectInfo.json.d.ts +1 -1
@@ -1,29 +1,17 @@
1
- import { inject, computed, onScopeDispose, markRaw, ref } from "vue";
2
- import { Lock, Warning, Calendar, MoonNight, Opportunity, RefreshRight, Sunny } from "@element-plus/icons-vue";
1
+ import { inject, computed, onScopeDispose, ref } from "vue";
3
2
  import { CORE_BRIDGE_KEY } from "../../inject/key.mjs";
3
+ import { BADGE_MASK_KINDS } from "../../bridge/badge.mjs";
4
4
  const BADGE_BUILTIN_PRESET = {
5
- // 上新:整圆 + 放射(团)。[MUST NOT] 改回 `Star` —— wip 的 MoonNight 自带小星星,
6
- // 两者在 12px 下会互相干扰;`Sunny` 是「团」、`MoonNight` 是「钩」,小尺寸才拉得开。
7
- new: { text: "新上线", type: "success", icon: markRaw(Sunny) },
8
- // 更新:闭合环 + 箭头(七档里唯一的环)
9
- updated: { text: "已更新", type: "primary", icon: markRaw(RefreshRight) },
10
- // 内测:钟形灯泡(还在试)。[MUST NOT] 改回 `Aim` —— 靶心是同心圆,会与 `Sunny` 撞成两个团。
11
- beta: { text: "内测中", type: "warning", icon: markRaw(Opportunity) },
12
- // 开发中:月牙(甲方 2026-09-18 指定 MoonNight,替下自绘的 IconHammer)。
13
- // 视觉重量比其余几档满 ⇒ 逐档缩到 0.8。
14
- wip: {
15
- text: "开发中",
16
- type: "info",
17
- icon: markRaw(MoonNight),
18
- iconScale: 0.8
19
- },
20
- // 规划中:方框 + 顶部两耳(排期表)。与 wip 同为 info 档,靠形状区分(实测可辨)。
21
- planned: { text: "规划中", type: "info", icon: markRaw(Calendar) },
22
- // 待下线:三角
23
- deprecated: { text: "待下线", type: "danger", icon: markRaw(Warning) },
24
- // 未开通:拱 + 方体
25
- locked: { text: "未开通", type: "warning", icon: markRaw(Lock) }
5
+ new: { text: "新上线", type: "success" },
6
+ updated: { text: "已更新", type: "primary" },
7
+ beta: { text: "内测中", type: "warning" },
8
+ wip: { text: "开发中", type: "info" },
9
+ // 规划中:比 wip 更靠前(还没开工)。与 wip 同为 info 档,靠文案区分。
10
+ planned: { text: "规划中", type: "info" },
11
+ deprecated: { text: "待下线", type: "danger" },
12
+ locked: { text: "未开通", type: "warning" }
26
13
  };
14
+ const badgeMaskKindSet = new Set(BADGE_MASK_KINDS);
27
15
  const BADGE_TICK_INTERVAL = 6e4;
28
16
  const badgeNow = ref(Date.now());
29
17
  let badgeTickTimer;
@@ -48,6 +36,7 @@ function useBadgeNow() {
48
36
  });
49
37
  return badgeNow;
50
38
  }
39
+ const badgeHideRefusedWarned = /* @__PURE__ */ new Set();
51
40
  const toBadgeKeyList = (input) => {
52
41
  if (!input) return [];
53
42
  if (typeof input === "string") return [input];
@@ -69,27 +58,42 @@ function useBadgeHit(getKey) {
69
58
  return void 0;
70
59
  });
71
60
  }
72
- function badgeResolveDisplay(entry) {
61
+ const badgeResolveHidden = (entry, defaultVisible, onRefuse) => {
62
+ if (entry.kind === "anchor") return true;
63
+ const wantHidden = !(entry.visible ?? defaultVisible);
64
+ if (!wantHidden) return false;
65
+ if (badgeMaskKindSet.has(entry.kind)) {
66
+ onRefuse == null ? void 0 : onRefuse();
67
+ return false;
68
+ }
69
+ return true;
70
+ };
71
+ function badgeResolveDisplay(entry, defaultVisible = true, onRefuseHide) {
73
72
  if (!entry) return void 0;
73
+ const hidden = badgeResolveHidden(entry, defaultVisible, onRefuseHide);
74
74
  if (entry.kind === "count") {
75
- return { value: entry.value, max: entry.max, type: "danger" };
75
+ return { value: entry.value, max: entry.max, type: "danger", hidden };
76
76
  }
77
77
  if (entry.kind === "custom") {
78
- return { value: entry.text, type: entry.type ?? "primary" };
78
+ return { value: entry.text, type: entry.type ?? "primary", hidden };
79
79
  }
80
80
  if (entry.kind === "anchor") {
81
81
  return { value: "", type: "primary", hidden: true };
82
82
  }
83
83
  const preset = BADGE_BUILTIN_PRESET[entry.kind];
84
- return {
85
- value: preset.text,
86
- type: preset.type,
87
- icon: preset.icon,
88
- label: preset.text,
89
- iconScale: preset.iconScale
90
- };
84
+ return { value: preset.text, type: preset.type, hidden };
91
85
  }
86
+ const badgeWarnHideRefused = (key, kind) => {
87
+ if (badgeHideRefusedWarned.has(key)) return;
88
+ badgeHideRefusedWarned.add(key);
89
+ console.warn(
90
+ `[BadgeMark] 徽标 "${key}"(kind="${kind}")要求隐藏,但**遮挡档拒绝隐藏**,已忽略。
91
+ 遮挡是功能不是资讯:藏了只会变成「点不动又没有任何说明的按钮」,或者「未开通的功能变成可点」。
92
+ [MUST] 要么让它显示,要么改挂一个不遮挡的 kind(如 wip / planned)。`
93
+ );
94
+ };
92
95
  export {
93
96
  badgeResolveDisplay,
97
+ badgeWarnHideRefused,
94
98
  useBadgeHit
95
99
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./FormGroupTitle.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const FormGroupTitle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c6148d68"]]);
4
+ const FormGroupTitle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ee226102"]]);
5
5
  export {
6
6
  FormGroupTitle as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./FormItem.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8b508d64"]]);
4
+ const FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-940abdf9"]]);
5
5
  export {
6
6
  FormItem as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./FormItemNestForm.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const FormItemNestForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-46959572"]]);
4
+ const FormItemNestForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-358d6905"]]);
5
5
  export {
6
6
  FormItemNestForm as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./FormItemNestFormList.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const FormItemNestFormList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f9ac937e"]]);
4
+ const FormItemNestFormList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b6b79293"]]);
5
5
  export {
6
6
  FormItemNestFormList as default
7
7
  };
@@ -1,32 +1,7 @@
1
- import { defineComponent, openBlock, createBlock, unref } from "vue";
2
- import { ElTree } from "element-plus";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- __name: "FormTree",
5
- props: {
6
- modelValue: {},
7
- tree: { default: () => [] },
8
- showCheckbox: { type: Boolean },
9
- defaultExpandAll: { type: Boolean }
10
- },
11
- emits: ["update:modelValue"],
12
- setup(__props, { emit: __emit }) {
13
- const emits = __emit;
14
- const handleCheck = (_data, { checkedKeys }) => {
15
- emits("update:modelValue", checkedKeys);
16
- };
17
- return (_ctx, _cache) => {
18
- return openBlock(), createBlock(unref(ElTree), {
19
- ref: "elTree",
20
- data: __props.tree,
21
- showCheckbox: __props.showCheckbox,
22
- nodeKey: "id",
23
- defaultCheckedKeys: __props.modelValue,
24
- defaultExpandAll: __props.defaultExpandAll,
25
- onCheck: handleCheck
26
- }, null, 8, ["data", "showCheckbox", "defaultCheckedKeys", "defaultExpandAll"]);
27
- };
28
- }
29
- });
1
+ import _sfc_main from "./FormTree.vue2.mjs";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const FormTree = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e64f6895"]]);
30
5
  export {
31
- _sfc_main as default
6
+ FormTree as default
32
7
  };
@@ -1,4 +1,33 @@
1
- import _sfc_main from "./FormTree.vue.mjs";
1
+ import { defineComponent, openBlock, createBlock, unref } from "vue";
2
+ import { ElTree } from "element-plus";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "FormTree",
5
+ props: {
6
+ modelValue: {},
7
+ tree: { default: () => [] },
8
+ showCheckbox: { type: Boolean },
9
+ defaultExpandAll: { type: Boolean }
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(__props, { emit: __emit }) {
13
+ const emits = __emit;
14
+ const handleCheck = (_data, { checkedKeys }) => {
15
+ emits("update:modelValue", checkedKeys);
16
+ };
17
+ return (_ctx, _cache) => {
18
+ return openBlock(), createBlock(unref(ElTree), {
19
+ ref: "elTree",
20
+ class: "dc-form-tree",
21
+ data: __props.tree,
22
+ showCheckbox: __props.showCheckbox,
23
+ nodeKey: "id",
24
+ defaultCheckedKeys: __props.modelValue,
25
+ defaultExpandAll: __props.defaultExpandAll,
26
+ onCheck: handleCheck
27
+ }, null, 8, ["data", "showCheckbox", "defaultCheckedKeys", "defaultExpandAll"]);
28
+ };
29
+ }
30
+ });
2
31
  export {
3
32
  _sfc_main as default
4
33
  };
@@ -2,7 +2,7 @@ import _sfc_main from "./FormUpload.vue2.mjs";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
5
- const FormUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9f186e75"]]);
5
+ const FormUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1b155db4"]]);
6
6
  export {
7
7
  FormUpload as default
8
8
  };
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, getCurrentInstance, inject, watch, renderSlot } from "vue";
2
2
  import { APP_GLOBAL_MODAL_PORTER_SYMBOL } from "./modal-global-symbol.mjs";
3
+ import { useModalPorterSlotMisuseWarn } from "./use-slot-misuse-warn.mjs";
3
4
  import { getModalShelfInjectionKey } from "../../inject/key.mjs";
4
5
  import { useActivated } from "../../hooks/activated.mjs";
5
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -11,6 +12,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
11
12
  setup(__props, { expose: __expose }) {
12
13
  var _a;
13
14
  const props = __props;
15
+ useModalPorterSlotMisuseWarn();
14
16
  const uid = ((_a = getCurrentInstance()) == null ? void 0 : _a.uid) ?? Math.floor(Math.random() * 1e9);
15
17
  const namedShelves = {
16
18
  app: inject(getModalShelfInjectionKey("app"), null),
@@ -0,0 +1,22 @@
1
+ import { getCurrentInstance } from "vue";
2
+ import { useActivated } from "../../hooks/activated.mjs";
3
+ import { DC_SLOT_ATTR, resolveAppPageSlotName, parseSlotRegion } from "../../config/slot-region.mjs";
4
+ const useModalPorterSlotMisuseWarn = () => {
5
+ const instance = getCurrentInstance();
6
+ let reported = false;
7
+ useActivated((info) => {
8
+ var _a, _b;
9
+ if (!info.isActivated || reported) return;
10
+ const el = (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.$el;
11
+ const raw = (_b = el == null ? void 0 : el.parentElement) == null ? void 0 : _b.getAttribute(DC_SLOT_ATTR);
12
+ const slot = resolveAppPageSlotName(parseSlotRegion(raw));
13
+ if (!slot) return;
14
+ reported = true;
15
+ console.error(
16
+ `[ModalPorter] 它被放在 AppPage 的 #${slot} 槽里 —— 方位槽是 ModalShelf 的兄弟节点,provide 够不到,evoke() 恒为 null(表现为「点按钮毫无反应」,不报错不崩)。[MUST] 移到**默认槽**(page 架子就住在默认槽里;与 AppPage 并列同样够不到)。Porter 自身零 DOM 输出,放默认槽里不占任何版面。`
17
+ );
18
+ });
19
+ };
20
+ export {
21
+ useModalPorterSlotMisuseWarn
22
+ };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AppPageListDetailSplit.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const AppPageListDetailSplit = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7aa91bcb"]]);
4
+ const AppPageListDetailSplit = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-68dc7b6b"]]);
5
5
  export {
6
6
  AppPageListDetailSplit as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, openBlock, createBlock, unref, createSlots, withCtx, createVNode, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, normalizeStyle } from "vue";
1
+ import { defineComponent, openBlock, createBlock, unref, createSlots, withCtx, createVNode, renderSlot, normalizeProps, guardReactiveProps, createElementVNode } from "vue";
2
2
  import AppPage from "../app-layout/AppPage.vue.mjs";
3
3
  import { APP_PAGE_LIST_LAYOUT_RECOMMENDED } from "../app-layout/app-page-recommended.mjs";
4
4
  import AppPageDetail from "./AppPageDetail.vue.mjs";
@@ -19,21 +19,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  viewLayoutProps: {}
20
20
  },
21
21
  setup(__props) {
22
- const props = __props;
23
- const listStyle = computed(() => ({ width: props.listWidth }));
24
22
  return (_ctx, _cache) => {
25
- return openBlock(), createBlock(unref(AppPage), { class: "dc-app-page-list-detail dc-app-page-list-detail_split" }, createSlots({
23
+ return openBlock(), createBlock(unref(AppPage), {
24
+ class: "dc-app-page-list-detail dc-app-page-list-detail_split",
25
+ leftWidth: __props.listWidth
26
+ }, createSlots({
26
27
  left: withCtx(() => [
27
28
  createElementVNode("div", {
28
29
  class: "dc-app-page-list-detail-split__list",
29
- style: normalizeStyle(listStyle.value),
30
30
  "data-dc-slot": unref(SlotRegion).AppPage_Left
31
31
  }, [
32
32
  renderSlot(_ctx.$slots, "list", {
33
33
  listProps: __props.listProps,
34
34
  listLayoutRecommended: unref(APP_PAGE_LIST_LAYOUT_RECOMMENDED)
35
35
  }, void 0, true)
36
- ], 12, _hoisted_1)
36
+ ], 8, _hoisted_1)
37
37
  ]),
38
38
  default: withCtx(() => [
39
39
  createVNode(AppPageDetail, {
@@ -90,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
90
90
  ]),
91
91
  key: "2"
92
92
  } : void 0
93
- ]), 1024);
93
+ ]), 1032, ["leftWidth"]);
94
94
  };
95
95
  }
96
96
  });
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./ViewLayout.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const ViewLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3c6fd3fe"]]);
4
+ const ViewLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f386aec7"]]);
5
5
  export {
6
6
  ViewLayout as default
7
7
  };
@@ -1,33 +1,17 @@
1
- import { defineComponent, useCssVars, shallowRef, ref, useModel, computed, inject, watch, provide, useSlots, withDirectives, openBlock, createElementBlock, unref, createBlock, createSlots, withCtx, createElementVNode, normalizeStyle, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, vShow, Fragment, mergeModels } from "vue";
1
+ import { defineComponent, useCssVars, shallowRef, ref, useModel, computed, inject, watch, provide, useSlots, withDirectives, openBlock, createElementBlock, unref, createBlock, createSlots, withCtx, createElementVNode, normalizeStyle, renderSlot, createVNode, mergeProps, createTextVNode, toDisplayString, Fragment, createCommentVNode, mergeModels } from "vue";
2
2
  import { vLoading } from "element-plus";
3
- import AutoRefreshGroup from "../misc/AutoRefreshGroup.vue.mjs";
4
3
  import _sfc_main$1 from "../display/HeightProvider.vue.mjs";
5
- import _sfc_main$2 from "../display/ActionBtnGroup.vue.mjs";
6
4
  import { useContextDefaults } from "../../hooks/use-context-defaults.mjs";
7
- import ViewLayoutNavigation from "./ViewLayoutNavigation.vue.mjs";
5
+ import ViewLayoutToolbar from "./ViewLayoutToolbar.vue.mjs";
8
6
  import { useChannelViewportHeight } from "../../hooks/use-channel-viewport-height.mjs";
9
7
  import { APP_PAGE_LIST_DETAIL_CONTEXT, APP_LAYOUT_BRIDGE_KEY, SCOPE_VIEWPORT_MAX_HEIGHT } from "../../inject/key.mjs";
10
8
  import { useActivated } from "../../hooks/activated.mjs";
11
9
  import { gapScaleValue } from "../../utils/gap-scale.mjs";
12
10
  import { SlotRegion } from "../../config/slot-region.mjs";
13
11
  const _hoisted_1 = { class: "dc-view-layout view-layout" };
14
- const _hoisted_2 = { class: "view-layout-toolbar" };
15
- const _hoisted_3 = { class: "view-layout-toolbar__left" };
12
+ const _hoisted_2 = { class: "dc-view-layout__bottom" };
13
+ const _hoisted_3 = { class: "view-layout-content" };
16
14
  const _hoisted_4 = {
17
- key: 0,
18
- class: "dc-view-layout__header view-layout-header"
19
- };
20
- const _hoisted_5 = { class: "view-layout-toolbar__right" };
21
- const _hoisted_6 = { class: "dc-view-layout__bottom" };
22
- const _hoisted_7 = { class: "view-layout-toolbar" };
23
- const _hoisted_8 = { class: "view-layout-toolbar__left" };
24
- const _hoisted_9 = {
25
- key: 0,
26
- class: "dc-view-layout__header view-layout-header"
27
- };
28
- const _hoisted_10 = { class: "view-layout-toolbar__right" };
29
- const _hoisted_11 = { class: "view-layout-content" };
30
- const _hoisted_12 = {
31
15
  key: 0,
32
16
  class: "dc-view-layout__bottom"
33
17
  };
@@ -49,7 +33,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
33
  title: {},
50
34
  showNavigation: { type: Boolean, default: true },
51
35
  leftExtraButtons: { default: () => [] },
52
- rightExtraButtons: { default: () => [] }
36
+ rightExtraButtons: { default: () => [] },
37
+ appBar: { type: Boolean },
38
+ back: {},
39
+ moreOptions: {},
40
+ onMoreSelect: {},
41
+ onMore: {}
53
42
  }, {
54
43
  "isAutoRefresh": { type: Boolean },
55
44
  "isAutoRefreshModifiers": {}
@@ -57,8 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
57
46
  emits: ["update:isAutoRefresh"],
58
47
  setup(__props) {
59
48
  useCssVars((_ctx) => ({
60
- "v72fb5e44": gapUnitPx.value,
61
- "v7243a29e": padLeftPx.value
49
+ "v5975c734": padXPx.value
62
50
  }));
63
51
  const props = __props;
64
52
  const { ctxRefine } = useContextDefaults({
@@ -101,6 +89,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
101
89
  }));
102
90
  const hasHeader = computed(() => !!slots.header || !!props.title);
103
91
  const hasBottom = computed(() => !!slots.bottom);
92
+ const toolbarProps = computed(() => ({
93
+ visible: !!(hasToolbarContent.value || hasHeader.value),
94
+ hasHeader: hasHeader.value,
95
+ ctx: toolbarCtx.value,
96
+ leftExtraButtons: props.leftExtraButtons,
97
+ rightExtraButtons: props.rightExtraButtons,
98
+ showNavigation: showNavigationFinal.value,
99
+ navigationCtx: listDetailCtx,
100
+ refreshFn: fetch,
101
+ loading: loading.value,
102
+ showAutoRefresh: props.showAutoRefresh,
103
+ showRefresh: props.showRefresh,
104
+ padXPx: padXPx.value,
105
+ // appBar 形态四件套原样下传(gate 判定收在子组件里,见其 showBack / showMore)
106
+ appBar: props.appBar,
107
+ back: props.back,
108
+ moreOptions: props.moreOptions,
109
+ onMoreSelect: props.onMoreSelect,
110
+ onMore: props.onMore
111
+ }));
104
112
  const hasToolbarContent = computed(
105
113
  () => {
106
114
  var _a, _b;
@@ -126,7 +134,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
126
134
  )
127
135
  );
128
136
  const gapUnitPx = computed(() => `${gapUnit.value}px`);
129
- const padLeftPx = computed(() => `${gapUnit.value * 2}px`);
137
+ const padXPx = computed(() => gapUnitPx.value);
130
138
  const contentPaddingVertical = computed(() => gapUnit.value * 2);
131
139
  const heightProviderViewportHeight = computed(
132
140
  () => Math.max(viewportHeightFinal.value - contentPaddingVertical.value, 0)
@@ -161,44 +169,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
161
169
  onChildViewportHeightChange
162
170
  }, createSlots({
163
171
  header: withCtx(() => [
164
- withDirectives(createElementVNode("div", _hoisted_2, [
165
- createElementVNode("div", _hoisted_3, [
166
- hasHeader.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
172
+ createVNode(ViewLayoutToolbar, mergeProps(toolbarProps.value, {
173
+ isAutoRefresh: isAutoRefresh.value,
174
+ "onUpdate:isAutoRefresh": _cache[0] || (_cache[0] = ($event) => isAutoRefresh.value = $event)
175
+ }), createSlots({ _: 2 }, [
176
+ hasHeader.value ? {
177
+ name: "header",
178
+ fn: withCtx(() => [
167
179
  renderSlot(_ctx.$slots, "header", {
168
180
  data: data.value,
169
181
  loading: loading.value
170
182
  }, () => [
171
183
  createTextVNode(toDisplayString(__props.title), 1)
172
184
  ], true)
173
- ])) : createCommentVNode("", true),
174
- createVNode(unref(_sfc_main$2), {
175
- configs: __props.leftExtraButtons,
176
- ctx: toolbarCtx.value,
177
- "default-size": "small"
178
- }, null, 8, ["configs", "ctx"])
179
- ]),
180
- createElementVNode("div", _hoisted_5, [
181
- showNavigationFinal.value ? (openBlock(), createBlock(ViewLayoutNavigation, {
182
- key: 0,
183
- ctx: unref(listDetailCtx)
184
- }, null, 8, ["ctx"])) : createCommentVNode("", true),
185
- createVNode(unref(_sfc_main$2), {
186
- configs: __props.rightExtraButtons,
187
- ctx: toolbarCtx.value,
188
- "default-size": "small"
189
- }, null, 8, ["configs", "ctx"]),
190
- createVNode(unref(AutoRefreshGroup), {
191
- isAutoRefresh: isAutoRefresh.value,
192
- "onUpdate:isAutoRefresh": _cache[0] || (_cache[0] = ($event) => isAutoRefresh.value = $event),
193
- refreshFn: fetch,
194
- loading: loading.value,
195
- showAutoRefresh: __props.showAutoRefresh,
196
- showRefresh: __props.showRefresh
197
- }, null, 8, ["isAutoRefresh", "loading", "showAutoRefresh", "showRefresh"])
198
- ])
199
- ], 512), [
200
- [vShow, hasToolbarContent.value || hasHeader.value]
201
- ])
185
+ ]),
186
+ key: "0"
187
+ } : void 0,
188
+ _ctx.$slots.more ? {
189
+ name: "more",
190
+ fn: withCtx(() => [
191
+ renderSlot(_ctx.$slots, "more", {}, void 0, true)
192
+ ]),
193
+ key: "1"
194
+ } : void 0
195
+ ]), 1040, ["isAutoRefresh"])
202
196
  ]),
203
197
  default: withCtx(({ viewportHeight }) => [
204
198
  createElementVNode("div", {
@@ -219,7 +213,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
219
213
  hasBottom.value ? {
220
214
  name: "footer",
221
215
  fn: withCtx(() => [
222
- createElementVNode("div", _hoisted_6, [
216
+ createElementVNode("div", _hoisted_2, [
223
217
  renderSlot(_ctx.$slots, "bottom", {
224
218
  data: data.value,
225
219
  loading: loading.value,
@@ -230,45 +224,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
230
224
  key: "0"
231
225
  } : void 0
232
226
  ]), 1032, ["viewportHeight", "minHeight"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
233
- withDirectives(createElementVNode("div", _hoisted_7, [
234
- createElementVNode("div", _hoisted_8, [
235
- hasHeader.value ? (openBlock(), createElementBlock("div", _hoisted_9, [
227
+ createVNode(ViewLayoutToolbar, mergeProps(toolbarProps.value, {
228
+ isAutoRefresh: isAutoRefresh.value,
229
+ "onUpdate:isAutoRefresh": _cache[1] || (_cache[1] = ($event) => isAutoRefresh.value = $event)
230
+ }), createSlots({ _: 2 }, [
231
+ hasHeader.value ? {
232
+ name: "header",
233
+ fn: withCtx(() => [
236
234
  renderSlot(_ctx.$slots, "header", {
237
235
  data: data.value,
238
236
  loading: loading.value
239
237
  }, () => [
240
238
  createTextVNode(toDisplayString(__props.title), 1)
241
239
  ], true)
242
- ])) : createCommentVNode("", true),
243
- createVNode(unref(_sfc_main$2), {
244
- configs: __props.leftExtraButtons,
245
- ctx: toolbarCtx.value,
246
- "default-size": "small"
247
- }, null, 8, ["configs", "ctx"])
248
- ]),
249
- createElementVNode("div", _hoisted_10, [
250
- showNavigationFinal.value ? (openBlock(), createBlock(ViewLayoutNavigation, {
251
- key: 0,
252
- ctx: unref(listDetailCtx)
253
- }, null, 8, ["ctx"])) : createCommentVNode("", true),
254
- createVNode(unref(_sfc_main$2), {
255
- configs: __props.rightExtraButtons,
256
- ctx: toolbarCtx.value,
257
- "default-size": "small"
258
- }, null, 8, ["configs", "ctx"]),
259
- createVNode(unref(AutoRefreshGroup), {
260
- isAutoRefresh: isAutoRefresh.value,
261
- "onUpdate:isAutoRefresh": _cache[1] || (_cache[1] = ($event) => isAutoRefresh.value = $event),
262
- refreshFn: fetch,
263
- loading: loading.value,
264
- showAutoRefresh: __props.showAutoRefresh,
265
- showRefresh: __props.showRefresh
266
- }, null, 8, ["isAutoRefresh", "loading", "showAutoRefresh", "showRefresh"])
267
- ])
268
- ], 512), [
269
- [vShow, hasToolbarContent.value || hasHeader.value]
270
- ]),
271
- createElementVNode("div", _hoisted_11, [
240
+ ]),
241
+ key: "0"
242
+ } : void 0,
243
+ _ctx.$slots.more ? {
244
+ name: "more",
245
+ fn: withCtx(() => [
246
+ renderSlot(_ctx.$slots, "more", {}, void 0, true)
247
+ ]),
248
+ key: "1"
249
+ } : void 0
250
+ ]), 1040, ["isAutoRefresh"]),
251
+ createElementVNode("div", _hoisted_3, [
272
252
  renderSlot(_ctx.$slots, "default", {
273
253
  data: data.value,
274
254
  loading: loading.value,
@@ -277,7 +257,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
277
257
  fetchSeq: fetchSeq.value
278
258
  }, void 0, true)
279
259
  ]),
280
- hasBottom.value ? (openBlock(), createElementBlock("div", _hoisted_12, [
260
+ hasBottom.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
281
261
  renderSlot(_ctx.$slots, "bottom", {
282
262
  data: data.value,
283
263
  loading: loading.value,
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./ViewLayoutToolbar.vue2.mjs";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const ViewLayoutToolbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-99d466e9"]]);
5
+ export {
6
+ ViewLayoutToolbar as default
7
+ };