@done-coding/admin-core 0.27.0 → 0.27.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.
- package/es/bridge/index.mjs +11 -3
- package/es/components/app-layout/AppBody.vue.mjs +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +14 -5
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +7 -5
- package/es/components/app-layout/AppLayout.vue.mjs +1 -1
- package/es/components/app-layout/AppLayout.vue2.mjs +2 -1
- package/es/components/app-layout/AppPage.vue.mjs +1 -1
- package/es/components/app-layout/AppPage.vue2.mjs +35 -32
- package/es/components/app-layout/app-page-geometry.mjs +16 -16
- package/es/components/app-layout/app-page-recommended.mjs +10 -0
- package/es/components/data-view/DataGridView.vue.mjs +1 -1
- package/es/components/data-view/DataGridView.vue2.mjs +29 -17
- package/es/components/data-view/DataListView.vue.mjs +1 -1
- package/es/components/data-view/DataListView.vue2.mjs +10 -0
- package/es/components/data-view/InfiniteListView.vue.mjs +1 -1
- package/es/components/data-view/InfiniteListView.vue2.mjs +9 -3
- package/es/components/data-view/use-active-scroll.mjs +15 -0
- package/es/components/display/DragFloat.vue.mjs +7 -0
- package/es/components/display/DragFloat.vue2.mjs +109 -0
- package/es/components/display/TabsHeader.vue.mjs +1 -1
- package/es/components/display/TabsHeader.vue2.mjs +9 -10
- package/es/components/display/TabsMain.vue.mjs +22 -7
- package/es/components/display/tabs-variant.mjs +14 -0
- package/es/components/form/FormDivider.vue.mjs +7 -0
- package/es/components/form/FormDivider.vue2.mjs +14 -0
- package/es/components/form/FormGroupTitle.vue.mjs +7 -0
- package/es/components/form/FormGroupTitle.vue2.mjs +59 -0
- package/es/components/form/FormItemNestForm.vue.mjs +1 -1
- package/es/components/form/FormItemNestFormList.vue.mjs +1 -1
- package/es/components/form/FormMain.vue.mjs +1 -1
- package/es/components/form/FormMain.vue2.mjs +69 -9
- package/es/components/form/FormSearch.vue.mjs +1 -1
- package/es/components/form/FormSearch.vue2.mjs +15 -3
- package/es/components/form/FormSubmitPanel.vue.mjs +1 -1
- package/es/components/form/FormSubmitPanel.vue2.mjs +14 -1
- package/es/components/form/ai-schema.mjs +139 -0
- package/es/components/form/group.mjs +81 -0
- package/es/components/form/use-ai-fill.mjs +71 -0
- package/es/components/form/utils.mjs +15 -4
- package/es/components/list-layout/ListLayout.vue.mjs +1 -1
- package/es/components/list-layout/ListLayout.vue2.mjs +103 -62
- package/es/components/modal/ImagePreviewTrigger.vue.mjs +5 -1
- package/es/components/modal/ModalConfirm.vue.mjs +1 -1
- package/es/components/modal/ModalConfirm.vue2.mjs +8 -5
- package/es/components/modal/VideoPreviewTrigger.vue.mjs +1 -1
- package/es/components/modal/VideoPreviewTrigger.vue2.mjs +2 -1
- package/es/components/page-layout/AppPageDetail.vue.mjs +1 -1
- package/es/components/page-layout/AppPageDetail.vue2.mjs +17 -13
- package/es/components/page-layout/AppPageListDetailLayout.vue.mjs +7 -4
- package/es/components/page-layout/AppPageListDetailSheet.vue.mjs +12 -4
- package/es/components/page-layout/AppPageListDetailSplit.vue.mjs +1 -1
- package/es/components/page-layout/AppPageListDetailSplit.vue2.mjs +10 -3
- package/es/components/table/TableMain.vue.mjs +1 -1
- package/es/components/table/TableMain.vue2.mjs +45 -25
- package/es/components/view-layout/ViewLayout.vue.mjs +1 -1
- package/es/components/view-layout/ViewLayout.vue2.mjs +46 -15
- package/es/config/slot-region.mjs +1 -0
- package/es/hooks/use-active-record.mjs +5 -1
- package/es/hooks/use-surface.mjs +27 -0
- package/es/hooks/use-theme-apply.mjs +52 -18
- package/es/index.mjs +81 -59
- package/es/inject/key.mjs +4 -0
- package/es/store/app.mjs +51 -17
- package/es/style.css +361 -184
- package/es/utils/dom.mjs +7 -1
- package/es/utils/gap-scale.mjs +25 -0
- package/es/utils/theme-scale.mjs +27 -0
- package/package.json +2 -2
- package/src/bridge/docs/README.md +30 -0
- package/src/components/app-layout/docs/README-AppBody.md +21 -0
- package/src/components/app-layout/docs/README-AppPage.md +20 -3
- package/src/components/data-view/docs/README-DataGridView.md +15 -0
- package/src/components/data-view/docs/README-DataListView.md +13 -0
- package/src/components/data-view/docs/README-InfiniteListView.md +15 -0
- package/src/components/display/README.md +1 -0
- package/src/components/display/docs/README-DragFloat.md +68 -0
- package/src/components/form/README.md +4 -2
- package/src/components/form/docs/README-FormItemNestForm.md +5 -3
- package/src/components/form/docs/README-FormItemNestFormList.md +7 -1
- package/src/components/form/docs/README-FormMain.md +102 -1
- package/src/components/form/docs/README-FormSearch.md +5 -0
- package/src/components/list-layout/docs/README-ListLayout.md +61 -1
- package/src/components/modal/docs/README-ImagePreviewTrigger.md +2 -0
- package/src/components/modal/docs/README-VideoPreviewTrigger.md +4 -1
- package/src/components/page-layout/docs/README-AppPageDetail.md +11 -1
- package/src/components/page-layout/docs/README-AppPageListDetailLayout.md +64 -6
- package/src/components/table/docs/README-TableMain.md +22 -0
- package/src/components/view-layout/docs/README-ViewLayout.md +27 -2
- package/src/hooks/docs/README.md +30 -1
- package/types/bridge/index.d.ts +69 -10
- package/types/components/app-layout/AppPage.vue.d.ts +15 -7
- package/types/components/app-layout/app-page-geometry.d.ts +19 -10
- package/types/components/app-layout/app-page-recommended.d.ts +12 -0
- package/types/components/app-layout/index.d.ts +1 -0
- package/types/components/data-view/types.d.ts +18 -0
- package/types/components/data-view/use-active-scroll.d.ts +30 -0
- package/types/components/display/BadgeMark.vue.d.ts +2 -2
- package/types/components/display/DragFloat.vue.d.ts +35 -0
- package/types/components/display/TabsHeader.vue.d.ts +7 -0
- package/types/components/display/index.d.ts +8 -1
- package/types/components/display/tabs-variant.d.ts +17 -0
- package/types/components/display/types.d.ts +6 -0
- package/types/components/form/FormDivider.vue.d.ts +2 -0
- package/types/components/form/FormGroupTitle.vue.d.ts +22 -0
- package/types/components/form/FormItemNestForm.vue.d.ts +2 -0
- package/types/components/form/ai-schema.d.ts +24 -0
- package/types/components/form/group.d.ts +36 -0
- package/types/components/form/index.d.ts +2 -0
- package/types/components/form/types.d.ts +94 -3
- package/types/components/form/use-ai-fill.d.ts +59 -0
- package/types/components/form/utils.d.ts +19 -0
- package/types/components/list-layout/ListLayout.vue.d.ts +3 -0
- package/types/components/list-layout/types.d.ts +28 -0
- package/types/components/modal/ModalConfirm.vue.d.ts +1 -1
- package/types/components/modal/VideoPreviewTrigger.vue.d.ts +1 -1
- package/types/components/page-layout/AppPageDetail.vue.d.ts +2 -2
- package/types/components/page-layout/AppPageListDetailLayout.vue.d.ts +3 -7
- package/types/components/page-layout/AppPageListDetailSheet.vue.d.ts +4 -8
- package/types/components/page-layout/AppPageListDetailSplit.vue.d.ts +4 -8
- package/types/components/page-layout/types.d.ts +42 -0
- package/types/components/panel/PanelItemNestForm.vue.d.ts +2 -0
- package/types/components/table/types.d.ts +9 -0
- package/types/components/view-layout/ViewLayout.vue.d.ts +18 -0
- package/types/components/view-layout/types.d.ts +15 -0
- package/types/config/slot-region.d.ts +10 -1
- package/types/hooks/use-surface.d.ts +34 -0
- package/types/inject/key.d.ts +10 -0
- package/types/injectInfo.json.d.ts +1 -1
- package/types/store/app.d.ts +3 -0
- package/types/utils/dom.d.ts +31 -0
- package/types/utils/gap-scale.d.ts +46 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/theme-scale.d.ts +33 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent, useCssVars, unref, useModel, useAttrs, ref, computed, markRaw, shallowRef, watch, onMounted, onActivated, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, createVNode, mergeProps, createCommentVNode, resolveDynamicComponent, Fragment, renderList, createSlots, renderSlot, createTextVNode, toDisplayString, normalizeProps, guardReactiveProps, withDirectives,
|
|
1
|
+
import { defineComponent, useCssVars, unref, useModel, useAttrs, ref, computed, markRaw, shallowRef, watch, onMounted, onActivated, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, createVNode, mergeProps, createCommentVNode, resolveDynamicComponent, Fragment, renderList, createSlots, renderSlot, createTextVNode, toDisplayString, normalizeProps, guardReactiveProps, withDirectives, vShow, mergeModels } from "vue";
|
|
2
2
|
import { useActiveRecord, activeRecordValueOf } from "../../hooks/use-active-record.mjs";
|
|
3
3
|
import _cloneDeep from "lodash/cloneDeep";
|
|
4
4
|
import _omit from "lodash/omit";
|
|
5
5
|
import _set from "lodash/set";
|
|
6
6
|
import _get from "lodash/get";
|
|
7
|
+
import { useSurface } from "../../hooks/use-surface.mjs";
|
|
7
8
|
import TableToolbar from "./TableToolbar.vue.mjs";
|
|
8
9
|
import TableSkeleton from "./TableSkeleton.vue.mjs";
|
|
9
10
|
import { useTableSkeleton } from "./use-table-skeleton.mjs";
|
|
@@ -15,10 +16,11 @@ import _sfc_main$2 from "./TableEmpty.vue.mjs";
|
|
|
15
16
|
import { pickExportColumns } from "../../utils/export.mjs";
|
|
16
17
|
import { useChannelViewportHeight } from "../../hooks/use-channel-viewport-height.mjs";
|
|
17
18
|
import { APP_API_LIST_MODEL_KEY_CONFIG } from "../../config/list-model.mjs";
|
|
18
|
-
const
|
|
19
|
+
const PAGER_MARGIN_TOP = 10;
|
|
19
20
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
21
|
__name: "TableMain",
|
|
21
22
|
props: /* @__PURE__ */ mergeModels({
|
|
23
|
+
surface: { type: Boolean, default: void 0 },
|
|
22
24
|
showPager: { type: Boolean, default: true },
|
|
23
25
|
initialSearch: { type: Boolean, default: true },
|
|
24
26
|
showSwitchView: { type: Boolean },
|
|
@@ -59,12 +61,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
59
61
|
emits: /* @__PURE__ */ mergeModels(["pageChange", "pageSizeChange", "dataChange", "loadingChange", "pageInfoChange"], ["update:activeId", "update:activeData", "update:isAutoRefresh", "update:refreshInterval", "update:customView"]),
|
|
60
62
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
61
63
|
useCssVars((_ctx) => ({
|
|
62
|
-
"
|
|
64
|
+
"v02eff1c8": unref(surfacePadCss),
|
|
65
|
+
"v75a7164e": unref(fillMinHeightCss)
|
|
63
66
|
}));
|
|
64
67
|
const props = __props;
|
|
65
68
|
const emits = __emit;
|
|
66
69
|
const activeId = useModel(__props, "activeId");
|
|
67
70
|
const activeData = useModel(__props, "activeData");
|
|
71
|
+
const { surfaceActive, surfacePad, surfacePadCss } = useSurface(() => props);
|
|
68
72
|
const isAutoRefresh = useModel(__props, "isAutoRefresh");
|
|
69
73
|
const refreshInterval = useModel(__props, "refreshInterval");
|
|
70
74
|
const customView = useModel(__props, "customView");
|
|
@@ -99,29 +103,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
99
103
|
() => props.columns.some((c) => c.type === "selection")
|
|
100
104
|
);
|
|
101
105
|
const { viewportHeightFinal } = useChannelViewportHeight(props);
|
|
106
|
+
const pagerHeight = ref(0);
|
|
107
|
+
const onPagerHeightChange = (height) => {
|
|
108
|
+
pagerHeight.value = height;
|
|
109
|
+
};
|
|
102
110
|
const pagerHeightAdjust = computed(() => {
|
|
103
|
-
if (props.showPager)
|
|
104
|
-
|
|
105
|
-
} else {
|
|
106
|
-
return 0;
|
|
107
|
-
}
|
|
111
|
+
if (!props.showPager) return 0;
|
|
112
|
+
return (pagerHeight.value || 24) + PAGER_MARGIN_TOP;
|
|
108
113
|
});
|
|
109
114
|
const toolbarHeightAdjust = computed(
|
|
110
115
|
() => props.showToolbar ? toolbarHeight.value : 0
|
|
111
116
|
);
|
|
112
117
|
const rawAvailableHeight = computed(() => {
|
|
113
118
|
const { maxHeight, refine } = props;
|
|
119
|
+
const pad = surfacePad.value * 2;
|
|
114
120
|
if (maxHeight) {
|
|
115
|
-
return maxHeight - pagerHeightAdjust.value - toolbarHeightAdjust.value;
|
|
121
|
+
return maxHeight - pad - pagerHeightAdjust.value - toolbarHeightAdjust.value;
|
|
116
122
|
}
|
|
117
123
|
if (refine) {
|
|
118
|
-
return viewportHeightFinal.value - pagerHeightAdjust.value - toolbarHeightAdjust.value - props.refineReduceHeight;
|
|
124
|
+
return viewportHeightFinal.value - pad - pagerHeightAdjust.value - toolbarHeightAdjust.value - props.refineReduceHeight;
|
|
119
125
|
}
|
|
120
126
|
return void 0;
|
|
121
127
|
});
|
|
128
|
+
const hasHeightSource = computed(
|
|
129
|
+
() => props.maxHeight !== void 0 || viewportHeightFinal.value > 0
|
|
130
|
+
);
|
|
122
131
|
const tableMaxHeight = computed(() => {
|
|
123
132
|
const raw = rawAvailableHeight.value;
|
|
124
133
|
if (raw === void 0) return void 0;
|
|
134
|
+
if (hasHeightSource.value) return Math.max(raw, 0);
|
|
125
135
|
return Math.max(raw, props.dataViewMaxHeightMinValue);
|
|
126
136
|
});
|
|
127
137
|
const { fillActive, fillMinHeight, fillMinHeightCss } = useFillHeight({
|
|
@@ -359,7 +369,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
359
369
|
});
|
|
360
370
|
return (_ctx, _cache) => {
|
|
361
371
|
return openBlock(), createElementBlock("div", {
|
|
362
|
-
class: normalizeClass(["dc-table-main table-main", {
|
|
372
|
+
class: normalizeClass(["dc-table-main table-main", {
|
|
373
|
+
"table-main_fill": unref(fillActive),
|
|
374
|
+
"table-main_surface": unref(surfaceActive)
|
|
375
|
+
}])
|
|
363
376
|
}, [
|
|
364
377
|
__props.showToolbar ? (openBlock(), createBlock(unref(_sfc_main$1), {
|
|
365
378
|
key: 0,
|
|
@@ -454,20 +467,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
454
467
|
]),
|
|
455
468
|
_: 3
|
|
456
469
|
}, 16, ["maxHeight", "data", "rowKey"])),
|
|
457
|
-
withDirectives(
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
470
|
+
withDirectives(createVNode(unref(_sfc_main$1), {
|
|
471
|
+
mode: "height",
|
|
472
|
+
class: "dc-table-main__pagination table-main-pagination",
|
|
473
|
+
onHeightChange: onPagerHeightChange
|
|
474
|
+
}, {
|
|
475
|
+
default: withCtx(() => [
|
|
476
|
+
createVNode(unref(ElPagination), {
|
|
477
|
+
"current-page": currentPage.value,
|
|
478
|
+
"onUpdate:currentPage": _cache[3] || (_cache[3] = ($event) => currentPage.value = $event),
|
|
479
|
+
"page-size": pageSize.value,
|
|
480
|
+
"onUpdate:pageSize": _cache[4] || (_cache[4] = ($event) => pageSize.value = $event),
|
|
481
|
+
"page-sizes": __props.pageSizeOptions,
|
|
482
|
+
size: "small",
|
|
483
|
+
background: __props.paginationBackground,
|
|
484
|
+
layout: __props.pageLayout,
|
|
485
|
+
total: total.value,
|
|
486
|
+
onSizeChange
|
|
487
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "background", "layout", "total"])
|
|
488
|
+
]),
|
|
489
|
+
_: 1
|
|
490
|
+
}, 512), [
|
|
471
491
|
[vShow, __props.showPager]
|
|
472
492
|
])
|
|
473
493
|
], 2);
|
|
@@ -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-
|
|
4
|
+
const ViewLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0507f728"]]);
|
|
5
5
|
export {
|
|
6
6
|
ViewLayout as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, shallowRef, ref, useModel, computed, inject, watch, provide, withDirectives, openBlock, createElementBlock, unref, createBlock, withCtx, createElementVNode, normalizeStyle, renderSlot,
|
|
1
|
+
import { defineComponent, shallowRef, ref, useModel, computed, inject, watch, provide, useSlots, withDirectives, openBlock, createElementBlock, unref, createBlock, withCtx, createElementVNode, normalizeStyle, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, vShow, Fragment, mergeModels } from "vue";
|
|
2
2
|
import { vLoading } from "element-plus";
|
|
3
3
|
import AutoRefreshGroup from "../misc/AutoRefreshGroup.vue.mjs";
|
|
4
4
|
import _sfc_main$1 from "../display/HeightProvider.vue.mjs";
|
|
@@ -12,11 +12,19 @@ import { SlotRegion } from "../../config/slot-region.mjs";
|
|
|
12
12
|
const _hoisted_1 = { class: "dc-view-layout view-layout" };
|
|
13
13
|
const _hoisted_2 = { class: "view-layout-toolbar" };
|
|
14
14
|
const _hoisted_3 = { class: "view-layout-toolbar__left" };
|
|
15
|
-
const _hoisted_4 = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
15
|
+
const _hoisted_4 = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "dc-view-layout__header view-layout-header"
|
|
18
|
+
};
|
|
19
|
+
const _hoisted_5 = { class: "view-layout-toolbar__right" };
|
|
20
|
+
const _hoisted_6 = { class: "view-layout-toolbar" };
|
|
21
|
+
const _hoisted_7 = { class: "view-layout-toolbar__left" };
|
|
22
|
+
const _hoisted_8 = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "dc-view-layout__header view-layout-header"
|
|
25
|
+
};
|
|
26
|
+
const _hoisted_9 = { class: "view-layout-toolbar__right" };
|
|
27
|
+
const _hoisted_10 = { class: "view-layout-content" };
|
|
20
28
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
29
|
__name: "ViewLayout",
|
|
22
30
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -30,6 +38,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
38
|
minHeight: { default: 100 },
|
|
31
39
|
showAutoRefresh: { type: Boolean, default: true },
|
|
32
40
|
showRefresh: { type: Boolean, default: true },
|
|
41
|
+
title: {},
|
|
33
42
|
showNavigation: { type: Boolean, default: true },
|
|
34
43
|
leftExtraButtons: { default: () => [] },
|
|
35
44
|
rightExtraButtons: { default: () => [] }
|
|
@@ -49,11 +58,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
58
|
const { viewportHeightFinal, nearestScope } = useChannelViewportHeight(props);
|
|
50
59
|
const data = shallowRef(void 0);
|
|
51
60
|
const loading = ref(false);
|
|
61
|
+
const fetchSeq = ref(0);
|
|
52
62
|
const isAutoRefresh = useModel(__props, "isAutoRefresh");
|
|
53
63
|
const fetch = async () => {
|
|
54
64
|
loading.value = true;
|
|
55
65
|
try {
|
|
56
66
|
data.value = await props.api(props.params);
|
|
67
|
+
fetchSeq.value += 1;
|
|
57
68
|
} finally {
|
|
58
69
|
loading.value = false;
|
|
59
70
|
}
|
|
@@ -76,6 +87,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
76
87
|
goNext: listDetailCtx == null ? void 0 : listDetailCtx.goNext,
|
|
77
88
|
refreshList: listDetailCtx == null ? void 0 : listDetailCtx.refreshList
|
|
78
89
|
}));
|
|
90
|
+
const hasHeader = computed(() => !!slots.header || !!props.title);
|
|
79
91
|
const hasToolbarContent = computed(
|
|
80
92
|
() => {
|
|
81
93
|
var _a, _b;
|
|
@@ -112,6 +124,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
112
124
|
() => props.channel,
|
|
113
125
|
() => console.error("[ViewLayout] channel 不支持响应式变更,当前值已忽略。")
|
|
114
126
|
);
|
|
127
|
+
const slots = useSlots();
|
|
115
128
|
return (_ctx, _cache) => {
|
|
116
129
|
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
117
130
|
unref(ctxRefine) ? (openBlock(), createBlock(unref(_sfc_main$1), {
|
|
@@ -123,13 +136,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
123
136
|
header: withCtx(() => [
|
|
124
137
|
withDirectives(createElementVNode("div", _hoisted_2, [
|
|
125
138
|
createElementVNode("div", _hoisted_3, [
|
|
139
|
+
hasHeader.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
140
|
+
renderSlot(_ctx.$slots, "header", {
|
|
141
|
+
data: data.value,
|
|
142
|
+
loading: loading.value
|
|
143
|
+
}, () => [
|
|
144
|
+
createTextVNode(toDisplayString(__props.title), 1)
|
|
145
|
+
], true)
|
|
146
|
+
])) : createCommentVNode("", true),
|
|
126
147
|
createVNode(unref(_sfc_main$2), {
|
|
127
148
|
configs: __props.leftExtraButtons,
|
|
128
149
|
ctx: toolbarCtx.value,
|
|
129
150
|
"default-size": "small"
|
|
130
151
|
}, null, 8, ["configs", "ctx"])
|
|
131
152
|
]),
|
|
132
|
-
createElementVNode("div",
|
|
153
|
+
createElementVNode("div", _hoisted_5, [
|
|
133
154
|
showNavigationFinal.value ? (openBlock(), createBlock(ViewLayoutNavigation, {
|
|
134
155
|
key: 0,
|
|
135
156
|
ctx: unref(listDetailCtx)
|
|
@@ -149,7 +170,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
149
170
|
}, null, 8, ["isAutoRefresh", "loading", "showAutoRefresh", "showRefresh"])
|
|
150
171
|
])
|
|
151
172
|
], 512), [
|
|
152
|
-
[vShow, hasToolbarContent.value]
|
|
173
|
+
[vShow, hasToolbarContent.value || hasHeader.value]
|
|
153
174
|
])
|
|
154
175
|
]),
|
|
155
176
|
default: withCtx(({ viewportHeight }) => [
|
|
@@ -161,21 +182,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
161
182
|
data: data.value,
|
|
162
183
|
loading: loading.value,
|
|
163
184
|
refresh: unref(refresh),
|
|
164
|
-
viewportHeight
|
|
185
|
+
viewportHeight,
|
|
186
|
+
fetchSeq: fetchSeq.value
|
|
165
187
|
}, void 0, true)
|
|
166
188
|
], 4)
|
|
167
189
|
]),
|
|
168
190
|
_: 3
|
|
169
191
|
}, 8, ["viewportHeight", "minHeight"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
170
|
-
withDirectives(createElementVNode("div",
|
|
171
|
-
createElementVNode("div",
|
|
192
|
+
withDirectives(createElementVNode("div", _hoisted_6, [
|
|
193
|
+
createElementVNode("div", _hoisted_7, [
|
|
194
|
+
hasHeader.value ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
195
|
+
renderSlot(_ctx.$slots, "header", {
|
|
196
|
+
data: data.value,
|
|
197
|
+
loading: loading.value
|
|
198
|
+
}, () => [
|
|
199
|
+
createTextVNode(toDisplayString(__props.title), 1)
|
|
200
|
+
], true)
|
|
201
|
+
])) : createCommentVNode("", true),
|
|
172
202
|
createVNode(unref(_sfc_main$2), {
|
|
173
203
|
configs: __props.leftExtraButtons,
|
|
174
204
|
ctx: toolbarCtx.value,
|
|
175
205
|
"default-size": "small"
|
|
176
206
|
}, null, 8, ["configs", "ctx"])
|
|
177
207
|
]),
|
|
178
|
-
createElementVNode("div",
|
|
208
|
+
createElementVNode("div", _hoisted_9, [
|
|
179
209
|
showNavigationFinal.value ? (openBlock(), createBlock(ViewLayoutNavigation, {
|
|
180
210
|
key: 0,
|
|
181
211
|
ctx: unref(listDetailCtx)
|
|
@@ -195,14 +225,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
195
225
|
}, null, 8, ["isAutoRefresh", "loading", "showAutoRefresh", "showRefresh"])
|
|
196
226
|
])
|
|
197
227
|
], 512), [
|
|
198
|
-
[vShow, hasToolbarContent.value]
|
|
228
|
+
[vShow, hasToolbarContent.value || hasHeader.value]
|
|
199
229
|
]),
|
|
200
|
-
createElementVNode("div",
|
|
230
|
+
createElementVNode("div", _hoisted_10, [
|
|
201
231
|
renderSlot(_ctx.$slots, "default", {
|
|
202
232
|
data: data.value,
|
|
203
233
|
loading: loading.value,
|
|
204
234
|
refresh: unref(refresh),
|
|
205
|
-
viewportHeight: void 0
|
|
235
|
+
viewportHeight: void 0,
|
|
236
|
+
fetchSeq: fetchSeq.value
|
|
206
237
|
}, void 0, true)
|
|
207
238
|
])
|
|
208
239
|
], 64))
|
|
@@ -6,6 +6,7 @@ var SlotRegion = /* @__PURE__ */ ((SlotRegion2) => {
|
|
|
6
6
|
SlotRegion2[SlotRegion2["AppPage_Bottom"] = 4] = "AppPage_Bottom";
|
|
7
7
|
SlotRegion2[SlotRegion2["AppPage_Left"] = 5] = "AppPage_Left";
|
|
8
8
|
SlotRegion2[SlotRegion2["TabsMain_Item"] = 6] = "TabsMain_Item";
|
|
9
|
+
SlotRegion2[SlotRegion2["ModalConfirm_Body"] = 7] = "ModalConfirm_Body";
|
|
9
10
|
return SlotRegion2;
|
|
10
11
|
})(SlotRegion || {});
|
|
11
12
|
const parseSlotRegion = (raw) => {
|
|
@@ -70,6 +70,7 @@ function useActiveRecord(options) {
|
|
|
70
70
|
});
|
|
71
71
|
useActivated((info) => {
|
|
72
72
|
if (!info.isActivated || !enabled()) return;
|
|
73
|
+
if (data().length === 0) return;
|
|
73
74
|
if (activeId.value !== void 0) applyId(activeId.value);
|
|
74
75
|
else if (activeData.value !== void 0) applyData(activeData.value);
|
|
75
76
|
});
|
|
@@ -78,7 +79,10 @@ function useActiveRecord(options) {
|
|
|
78
79
|
() => {
|
|
79
80
|
if (!enabled()) return;
|
|
80
81
|
const id = activeId.value;
|
|
81
|
-
if (id === void 0)
|
|
82
|
+
if (id === void 0) {
|
|
83
|
+
if (activeData.value !== void 0) applyData(activeData.value);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
82
86
|
const row = findRow(id);
|
|
83
87
|
if (row) {
|
|
84
88
|
lastValidData = row;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { inject, computed } from "vue";
|
|
2
|
+
import { useContextDefaults } from "./use-context-defaults.mjs";
|
|
3
|
+
import { SlotRegion } from "../config/slot-region.mjs";
|
|
4
|
+
import { APP_LAYOUT_BRIDGE_KEY } from "../inject/key.mjs";
|
|
5
|
+
import { gapScaleValue } from "../utils/gap-scale.mjs";
|
|
6
|
+
const useSurface = (getProps) => {
|
|
7
|
+
const { ctxSurface } = useContextDefaults({
|
|
8
|
+
getProps,
|
|
9
|
+
defaults: {
|
|
10
|
+
surface: ({ parentInfo, props: rawProps }) => rawProps.surface ?? parentInfo !== SlotRegion.ModalConfirm_Body
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const layoutBridge = inject(APP_LAYOUT_BRIDGE_KEY, void 0);
|
|
14
|
+
const surfaceActive = computed(() => !!ctxSurface.value);
|
|
15
|
+
const surfacePad = computed(
|
|
16
|
+
() => surfaceActive.value ? gapScaleValue(
|
|
17
|
+
(layoutBridge == null ? void 0 : layoutBridge.APP_LAYOUT_GAP_CONFIG.size) ?? 8,
|
|
18
|
+
"breath",
|
|
19
|
+
layoutBridge == null ? void 0 : layoutBridge.themeDensity.value
|
|
20
|
+
) : 0
|
|
21
|
+
);
|
|
22
|
+
const surfacePadCss = computed(() => `${surfacePad.value}px`);
|
|
23
|
+
return { surfaceActive, surfacePad, surfacePadCss };
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
useSurface
|
|
27
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { watch, onScopeDispose } from "vue";
|
|
2
|
-
import { themeScaleDerive, themeScaleParseHex, themeScaleMix, themeScaleToRgba } from "../utils/theme-scale.mjs";
|
|
2
|
+
import { themeScaleDerive, themeScaleParseHex, themeScaleIsNearBlack, themeScaleSurfaceColor, themeScalePageColor, themeScaleMix, themeScaleToRgba } from "../utils/theme-scale.mjs";
|
|
3
3
|
const STYLE_EL_ID = "dc-core-theme";
|
|
4
4
|
const randomStyleSuffix = () => Math.random().toString(36).slice(2, 9);
|
|
5
5
|
const THEME_FIELD_SPECS = [
|
|
@@ -9,7 +9,9 @@ const THEME_FIELD_SPECS = [
|
|
|
9
9
|
["dangerColor", { scale: true, el: "--el-color-danger" }],
|
|
10
10
|
["errorColor", { scale: true, el: "--el-color-error" }],
|
|
11
11
|
["infoColor", { scale: true, el: "--el-color-info" }],
|
|
12
|
-
|
|
12
|
+
// bodyColor = 面(默认背景色),只挂 --el-bg-color;底 --el-bg-color-page 由
|
|
13
|
+
// buildElevationDecls 派生([MUST NOT] 再拉平三档,见 elevation 注释)。
|
|
14
|
+
["bodyColor", { el: "--el-bg-color" }],
|
|
13
15
|
["baseColor", { el: "--el-text-color-primary" }],
|
|
14
16
|
["radius", { el: "--el-border-radius-base" }],
|
|
15
17
|
["borderColor", { el: "--el-border-color" }],
|
|
@@ -19,7 +21,11 @@ const THEME_FIELD_SPECS = [
|
|
|
19
21
|
["glow", {}],
|
|
20
22
|
["blur", {}],
|
|
21
23
|
["focusRing", {}],
|
|
22
|
-
|
|
24
|
+
// surface = 抬升面(overlay 档):preset 显式给值时双挂(与派生兜底同口径)
|
|
25
|
+
["surface", { el: "--el-bg-color-overlay" }],
|
|
26
|
+
// ground = 底(page 档):同 surface 的「显式优先」范式——preset 给了就双挂,
|
|
27
|
+
// 没给才由 buildElevationDecls 派生。⚠️ 与 bodyColor(面)是两档,[MUST NOT] 混。
|
|
28
|
+
["ground", { el: "--el-bg-color-page" }]
|
|
23
29
|
];
|
|
24
30
|
const THEME_SCALE_SUFFIXES = [
|
|
25
31
|
"light-3",
|
|
@@ -74,19 +80,48 @@ const buildOverlayDecl = (bodyColor, mode) => {
|
|
|
74
80
|
OVERLAY_ALPHA[mode]
|
|
75
81
|
)};`;
|
|
76
82
|
};
|
|
77
|
-
const MASK_ALPHA = { light: 0.
|
|
83
|
+
const MASK_ALPHA = { light: 0.5, dark: 0.6 };
|
|
78
84
|
const buildMaskDecl = (bodyColor, mode) => {
|
|
79
85
|
if (!bodyColor) return "";
|
|
80
86
|
const veil = themeScaleToRgba(bodyColor, MASK_ALPHA[mode]);
|
|
81
87
|
if (veil === bodyColor) return "";
|
|
82
88
|
return `--el-mask-color: ${veil};`;
|
|
83
89
|
};
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
const warnNearBlackFlip = (body, face, mode) => {
|
|
91
|
+
console.warn(
|
|
92
|
+
`[dc-theme] ${mode} 档的 bodyColor ${body} 已近黑,向黑派生「底」无余量可压(底会等于面、模块间距的缝不可见)。已自动翻转基准:底取 ${body}、面提亮为 ${face}。建议在该档显式给 ground(底)与 bodyColor(面),[MUST NOT] 依赖本兜底猜出来的面色。`
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
const buildElevationDecls = (color, mode) => {
|
|
96
|
+
const body = color.bodyColor;
|
|
97
|
+
if (!body || !themeScaleParseHex(body)) return [];
|
|
98
|
+
const hasGround = color.ground !== void 0 && color.ground !== "";
|
|
99
|
+
const lines = [];
|
|
100
|
+
const flip = !hasGround && themeScaleIsNearBlack(body);
|
|
101
|
+
const face = flip ? themeScaleSurfaceColor(body, "dark") : body;
|
|
102
|
+
if (flip) {
|
|
103
|
+
lines.push(
|
|
104
|
+
`--el-bg-color-page: ${body};`,
|
|
105
|
+
`--dc-core-ground: ${body};`,
|
|
106
|
+
`--el-bg-color: ${face};`,
|
|
107
|
+
`--dc-core-body-color: ${face};`
|
|
108
|
+
);
|
|
109
|
+
warnNearBlackFlip(body, face, mode);
|
|
110
|
+
} else if (!hasGround) {
|
|
111
|
+
const ground = themeScalePageColor(body);
|
|
112
|
+
lines.push(
|
|
113
|
+
`--el-bg-color-page: ${ground};`,
|
|
114
|
+
`--dc-core-ground: ${ground};`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
if (color.surface === void 0 || color.surface === "") {
|
|
118
|
+
const surface = themeScaleSurfaceColor(face, flip ? "dark" : mode);
|
|
119
|
+
lines.push(
|
|
120
|
+
`--dc-core-surface: ${surface};`,
|
|
121
|
+
`--el-bg-color-overlay: ${surface};`
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
return lines;
|
|
90
125
|
};
|
|
91
126
|
const buildThemeCss = (config) => {
|
|
92
127
|
const lightColor = config.light;
|
|
@@ -94,17 +129,20 @@ const buildThemeCss = (config) => {
|
|
|
94
129
|
const lightBody = buildThemeBlockBody(lightColor, "light");
|
|
95
130
|
const darkBody = buildThemeBlockBody(darkColor, "dark");
|
|
96
131
|
const rootColorDecl = "color: var(--dc-core-base-color);";
|
|
132
|
+
const rootBackgroundDecl = "background: var(--el-bg-color-page, #f2f3f5);";
|
|
97
133
|
const lightLines = [
|
|
98
134
|
lightBody,
|
|
99
135
|
rootColorDecl,
|
|
136
|
+
rootBackgroundDecl,
|
|
137
|
+
...buildElevationDecls(lightColor, "light"),
|
|
100
138
|
buildOverlayDecl(lightColor.bodyColor, "light"),
|
|
101
139
|
buildMaskDecl(lightColor.bodyColor, "light")
|
|
102
140
|
].filter(Boolean);
|
|
103
141
|
const darkLines = [
|
|
104
142
|
darkBody,
|
|
143
|
+
...buildElevationDecls(darkColor, "dark"),
|
|
105
144
|
buildOverlayDecl(darkColor.bodyColor, "dark"),
|
|
106
|
-
buildMaskDecl(darkColor.bodyColor, "dark")
|
|
107
|
-
buildDialogSurfaceDecl(darkColor.bodyColor)
|
|
145
|
+
buildMaskDecl(darkColor.bodyColor, "dark")
|
|
108
146
|
].filter(Boolean);
|
|
109
147
|
return `:root {
|
|
110
148
|
${lightLines.join(
|
|
@@ -120,15 +158,11 @@ const RHYTHM_STYLE_EL_ID = "dc-core-rhythm";
|
|
|
120
158
|
const EP_BRIDGE_STYLE_EL_ID = "dc-core-ep-bridge";
|
|
121
159
|
const EP_STRUCTURAL_STYLE_EL_ID = "dc-core-ep-structural";
|
|
122
160
|
const EP_STRUCTURAL_CSS = [
|
|
123
|
-
// 居中浮层(Dialog / MessageBox)+ 抽屉(Drawer
|
|
124
|
-
//
|
|
125
|
-
// ① elevation 提亮面(--dc-core-dialog-surface,仅暗色派生;亮色退 --el-bg-color 零改动);
|
|
126
|
-
// ② 1px 主题描边硬边界(--el-border-color 类明暗自换:亮色浅灰近隐形、暗色中灰清晰)——
|
|
127
|
-
// 融不融底都有区别度,不再仅靠提亮(抽屉与弹窗保底一致)。
|
|
161
|
+
// 居中浮层(Dialog / MessageBox)+ 抽屉(Drawer):1px 主题描边硬边界
|
|
162
|
+
// (--el-border-color 类明暗自换:亮色浅灰近隐形、暗色中灰清晰)。
|
|
128
163
|
".el-dialog,",
|
|
129
164
|
".el-message-box,",
|
|
130
165
|
".el-drawer {",
|
|
131
|
-
" background-color: var(--dc-core-dialog-surface, var(--el-bg-color));",
|
|
132
166
|
" border: 1px solid var(--dc-core-border-color, var(--el-border-color));",
|
|
133
167
|
"}",
|
|
134
168
|
// 表格固定列分隔阴影:EP 原值 inset ±10px 0 10px -10px rgba(0,0,0,.15) 为黑投影,暗色近黑底
|