@done-coding/admin-core 0.20.1-alpha.0 → 0.21.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 (136) hide show
  1. package/es/components/app-layout/AppLayout.vue.mjs +1 -1
  2. package/es/components/app-layout/AppLayout.vue2.mjs +51 -6
  3. package/es/components/app-layout/AppPage.vue.mjs +1 -1
  4. package/es/components/app-layout/AppPage.vue2.mjs +16 -9
  5. package/es/components/display/ShadowClone.vue.mjs +32 -0
  6. package/es/components/display/ShadowClone.vue2.mjs +4 -0
  7. package/es/components/display/use-shadow-target.mjs +76 -0
  8. package/es/components/form/FormActiveFilter.vue.mjs +7 -0
  9. package/es/components/form/FormActiveFilter.vue2.mjs +62 -0
  10. package/es/components/form/FormInput.vue.mjs +27 -0
  11. package/es/components/form/FormInput.vue2.mjs +4 -0
  12. package/es/components/form/FormInputShadowClone.vue.mjs +47 -0
  13. package/es/components/form/FormInputShadowClone.vue2.mjs +4 -0
  14. package/es/components/form/FormMain.vue.mjs +1 -1
  15. package/es/components/form/FormMain.vue2.mjs +5 -25
  16. package/es/components/form/FormSelectShadowClone.vue.mjs +57 -0
  17. package/es/components/form/FormSelectShadowClone.vue2.mjs +4 -0
  18. package/es/components/form/FormShadowCloneDispatch.vue.mjs +7 -0
  19. package/es/components/form/FormShadowCloneDispatch.vue2.mjs +74 -0
  20. package/es/components/form/FormSortSwitch.vue.mjs +7 -0
  21. package/es/components/form/FormSortSwitch.vue2.mjs +188 -0
  22. package/es/components/form/FormSortSwitchGroup.vue.mjs +7 -0
  23. package/es/components/form/FormSortSwitchGroup.vue2.mjs +68 -0
  24. package/es/components/form/FormUpload.vue.mjs +8 -0
  25. package/es/components/form/FormUpload.vue2.mjs +112 -0
  26. package/es/components/form/FormUploadAudio.vue.mjs +7 -0
  27. package/es/components/form/FormUploadAudio.vue2.mjs +88 -0
  28. package/es/components/form/FormUploadCard.vue.mjs +7 -0
  29. package/es/components/form/FormUploadCard.vue2.mjs +56 -0
  30. package/es/components/form/FormUploadFileInfo.vue.mjs +7 -0
  31. package/es/components/form/FormUploadFileInfo.vue2.mjs +36 -0
  32. package/es/components/form/FormUploadImage.vue.mjs +7 -0
  33. package/es/components/form/FormUploadImage.vue2.mjs +77 -0
  34. package/es/components/form/FormUploadTrigger.vue.mjs +7 -0
  35. package/es/components/form/FormUploadTrigger.vue2.mjs +34 -0
  36. package/es/components/form/FormUploadVideo.vue.mjs +7 -0
  37. package/es/components/form/FormUploadVideo.vue2.mjs +74 -0
  38. package/es/components/form/use-password-autofill.mjs +34 -0
  39. package/es/components/form/use-upload-state.mjs +98 -0
  40. package/es/components/list-layout/ListLayout.vue.mjs +1 -1
  41. package/es/components/list-layout/ListLayout.vue2.mjs +36 -9
  42. package/es/components/list-layout/use-active-filter.mjs +133 -0
  43. package/es/components/modal/ImagePreviewTrigger.vue.mjs +34 -0
  44. package/es/components/modal/ImagePreviewTrigger.vue2.mjs +4 -0
  45. package/es/components/modal/ModalImagePreview.vue.mjs +52 -0
  46. package/es/components/modal/ModalImagePreview.vue2.mjs +4 -0
  47. package/es/components/modal/ModalPorter.vue.mjs +49 -2
  48. package/es/components/modal/ModalShelf.vue.mjs +13 -4
  49. package/es/components/modal/ModalVideoPreview.vue.mjs +8 -0
  50. package/es/components/modal/ModalVideoPreview.vue2.mjs +93 -0
  51. package/es/components/modal/VideoPreviewTrigger.vue.mjs +7 -0
  52. package/es/components/modal/VideoPreviewTrigger.vue2.mjs +96 -0
  53. package/es/components/modal/modal-global-keys.mjs +11 -0
  54. package/es/components/modal/modal-global-symbol.mjs +6 -0
  55. package/es/components/modal/modal-shelf-core.mjs +53 -4
  56. package/es/components/table/TableEmpty.vue.mjs +36 -0
  57. package/es/components/table/TableEmpty.vue2.mjs +4 -0
  58. package/es/components/table/TableMain.vue.mjs +1 -1
  59. package/es/components/table/TableMain.vue2.mjs +21 -8
  60. package/es/components/view-layout/ViewLayout.vue.mjs +1 -1
  61. package/es/components/view-layout/ViewLayout.vue2.mjs +1 -1
  62. package/es/hooks/menus-dispatch.mjs +8 -3
  63. package/es/index.mjs +127 -91
  64. package/es/style.css +412 -33
  65. package/package.json +2 -2
  66. package/src/components/app-layout/docs/README-AppLayout.md +48 -0
  67. package/src/components/app-layout/docs/README-AppPage.md +40 -2
  68. package/src/components/display/README.md +9 -3
  69. package/src/components/display/docs/README-ShadowClone.md +75 -0
  70. package/src/components/form/README.md +15 -2
  71. package/src/components/form/docs/README-FormActiveFilter.md +57 -0
  72. package/src/components/form/docs/README-FormInput.md +66 -0
  73. package/src/components/form/docs/README-FormSelect.md +77 -0
  74. package/src/components/form/docs/README-FormShadowCloneDispatch.md +65 -0
  75. package/src/components/form/docs/README-FormSortSwitchGroup.md +131 -0
  76. package/src/components/form/docs/README-FormUpload.md +108 -0
  77. package/src/components/form/docs/README-FormUploadAudio.md +80 -0
  78. package/src/components/form/docs/README-FormUploadImage.md +83 -0
  79. package/src/components/form/docs/README-FormUploadVideo.md +82 -0
  80. package/src/components/list-layout/README.md +6 -2
  81. package/src/components/list-layout/docs/README-ListLayout.md +1 -0
  82. package/src/components/modal/README.md +7 -2
  83. package/src/components/modal/docs/README-ImagePreviewTrigger.md +78 -0
  84. package/src/components/modal/docs/README-ModalImagePreview.md +78 -0
  85. package/src/components/modal/docs/README-ModalPorter.md +10 -0
  86. package/src/components/modal/docs/README-ModalShelf.md +11 -2
  87. package/src/components/modal/docs/README-ModalVideoPreview.md +89 -0
  88. package/src/components/modal/docs/README-VideoPreviewTrigger.md +91 -0
  89. package/src/components/table/docs/README-TableMain.md +3 -0
  90. package/types/components/app-layout/AppLayout.vue.d.ts +31 -1
  91. package/types/components/app-layout/AppPage.vue.d.ts +7 -2
  92. package/types/components/app-layout/types.d.ts +25 -0
  93. package/types/components/display/ShadowClone.vue.d.ts +20 -0
  94. package/types/components/display/TabsTile.vue.d.ts +2 -2
  95. package/types/components/display/index.d.ts +8 -1
  96. package/types/components/display/types.d.ts +7 -0
  97. package/types/components/display/use-shadow-target.d.ts +9 -0
  98. package/types/components/form/FormActiveFilter.vue.d.ts +9 -0
  99. package/types/components/form/FormInput.vue.d.ts +3 -0
  100. package/types/components/form/FormInputShadowClone.vue.d.ts +7 -0
  101. package/types/components/form/FormSearch.vue.d.ts +1 -1
  102. package/types/components/form/FormSelectShadowClone.vue.d.ts +39 -0
  103. package/types/components/form/FormShadowCloneDispatch.vue.d.ts +44 -0
  104. package/types/components/form/FormSortSwitch.vue.d.ts +17 -0
  105. package/types/components/form/FormSortSwitchGroup.vue.d.ts +15 -0
  106. package/types/components/form/FormUpload.vue.d.ts +57 -0
  107. package/types/components/form/FormUploadAudio.vue.d.ts +30 -0
  108. package/types/components/form/FormUploadCard.vue.d.ts +24 -0
  109. package/types/components/form/FormUploadFileInfo.vue.d.ts +10 -0
  110. package/types/components/form/FormUploadImage.vue.d.ts +34 -0
  111. package/types/components/form/FormUploadTrigger.vue.d.ts +11 -0
  112. package/types/components/form/FormUploadVideo.vue.d.ts +34 -0
  113. package/types/components/form/index.d.ts +12 -1
  114. package/types/components/form/types.d.ts +158 -0
  115. package/types/components/form/use-password-autofill.d.ts +11 -0
  116. package/types/components/form/use-upload-state.d.ts +29 -0
  117. package/types/components/list-layout/ListLayout.vue.d.ts +3 -0
  118. package/types/components/list-layout/types.d.ts +16 -0
  119. package/types/components/list-layout/use-active-filter.d.ts +27 -0
  120. package/types/components/modal/ImagePreviewTrigger.vue.d.ts +41 -0
  121. package/types/components/modal/ModalConfirm.vue.d.ts +1 -1
  122. package/types/components/modal/ModalImagePreview.vue.d.ts +31 -0
  123. package/types/components/modal/ModalPorter.vue.d.ts +7 -0
  124. package/types/components/modal/ModalShelf.vue.d.ts +12 -3
  125. package/types/components/modal/ModalVideoPreview.vue.d.ts +40 -0
  126. package/types/components/modal/VideoPreviewTrigger.vue.d.ts +43 -0
  127. package/types/components/modal/index.d.ts +6 -1
  128. package/types/components/modal/modal-global-keys.d.ts +25 -0
  129. package/types/components/modal/modal-global-symbol.d.ts +8 -0
  130. package/types/components/modal/modal-shelf-core.d.ts +11 -3
  131. package/types/components/modal/modal-shelf-types.d.ts +50 -0
  132. package/types/components/table/TableEmpty.vue.d.ts +11 -0
  133. package/types/components/table/types.d.ts +11 -0
  134. package/types/components/view-layout/types.d.ts +1 -1
  135. package/types/injectInfo.json.d.ts +1 -1
  136. package/types/store/app.d.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AppLayout.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const AppLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f6f87b30"]]);
4
+ const AppLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b45bcdfd"]]);
5
5
  export {
6
6
  AppLayout as default
7
7
  };
@@ -1,9 +1,14 @@
1
- import { defineComponent, computed, provide, markRaw, watch, openBlock, createElementBlock, normalizeClass, createVNode, unref, withCtx, createBlock, resolveDynamicComponent, createSlots, normalizeStyle, createCommentVNode, renderList, renderSlot } from "vue";
1
+ import { defineComponent, useModel, computed, provide, markRaw, watch, openBlock, createElementBlock, normalizeClass, createVNode, unref, withCtx, createBlock, createCommentVNode, resolveDynamicComponent, createSlots, normalizeStyle, renderList, renderSlot, mergeModels } from "vue";
2
2
  import { ElWatermark } from "element-plus";
3
3
  import { useRoute, useRouter } from "vue-router";
4
4
  import AppBody from "./AppBody.vue.mjs";
5
5
  import _sfc_main$1 from "./AppShell.vue.mjs";
6
6
  import _sfc_main$2 from "../modal/ModalShelf.vue.mjs";
7
+ import _sfc_main$3 from "../modal/ModalPorter.vue.mjs";
8
+ import _sfc_main$4 from "../modal/ModalImagePreview.vue.mjs";
9
+ import ModalVideoPreview from "../modal/ModalVideoPreview.vue.mjs";
10
+ import { APP_GLOBAL_IMAGE_PREVIEW_KEY, APP_GLOBAL_VIDEO_PREVIEW_KEY } from "../modal/modal-global-keys.mjs";
11
+ import { APP_GLOBAL_MODAL_PORTER_SYMBOL } from "../modal/modal-global-symbol.mjs";
7
12
  import { themeScaleToRgba } from "../../utils/theme-scale.mjs";
8
13
  import { APP_LAYOUT_BRIDGE_KEY, APP_LAYOUT_APP_STORE_KEY, APP_LAYOUT_USER_STORE_KEY } from "../../inject/key.mjs";
9
14
  import { useCoreThemeApply } from "../../hooks/use-theme-apply.mjs";
@@ -12,15 +17,46 @@ import { flatRouteMetaResolveRaw } from "../../utils/router.mjs";
12
17
  import { useMenusDataDispatch } from "../../hooks/menus-dispatch.mjs";
13
18
  const _sfc_main = /* @__PURE__ */ defineComponent({
14
19
  __name: "AppLayout",
15
- props: {
20
+ props: /* @__PURE__ */ mergeModels({
16
21
  bridge: {},
17
22
  appStore: {},
18
23
  userStore: {},
19
24
  watermarkContent: {},
20
- sidebarAboveHeader: { type: Boolean, default: false }
21
- },
25
+ sidebarAboveHeader: { type: Boolean, default: false },
26
+ globalModalConfig: {},
27
+ enableGlobalImagePreview: { type: Boolean, default: false },
28
+ enableGlobalVideoPreview: { type: Boolean, default: false }
29
+ }, {
30
+ "globalModalRemote": {
31
+ // 初始空壳即带 modalKey 清单(挂载前 remote.modalKey 恒存在,消费方零判空)。
32
+ // 字面量直注 GlobalModalRemote 被 Record 索引签名拒绝,断言只作用于类型。
33
+ default: () => ({ modalKey: [] })
34
+ },
35
+ "globalModalRemoteModifiers": {}
36
+ }),
37
+ emits: ["update:globalModalRemote"],
22
38
  setup(__props) {
23
39
  const props = __props;
40
+ const globalModalRemote = useModel(__props, "globalModalRemote");
41
+ const resolvedGlobalModalConfig = computed(() => {
42
+ const base = props.globalModalConfig ?? [];
43
+ const extra = [];
44
+ if (props.enableGlobalImagePreview) {
45
+ extra.push({
46
+ key: APP_GLOBAL_IMAGE_PREVIEW_KEY,
47
+ component: _sfc_main$4,
48
+ shelf: "app"
49
+ });
50
+ }
51
+ if (props.enableGlobalVideoPreview) {
52
+ extra.push({
53
+ key: APP_GLOBAL_VIDEO_PREVIEW_KEY,
54
+ component: ModalVideoPreview,
55
+ shelf: "app"
56
+ });
57
+ }
58
+ return extra.length ? [...base, ...extra] : base;
59
+ });
24
60
  const watermarkFont = computed(() => ({
25
61
  color: themeScaleToRgba(props.bridge.themeColors.value.baseColor, 0.12),
26
62
  fontSize: 12
@@ -131,8 +167,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
131
167
  zIndex: 1e4
132
168
  }, {
133
169
  default: withCtx(() => [
134
- createVNode(unref(_sfc_main$2), { level: "app" }, {
170
+ createVNode(unref(_sfc_main$2), {
171
+ remote: globalModalRemote.value,
172
+ "onUpdate:remote": _cache[0] || (_cache[0] = ($event) => globalModalRemote.value = $event),
173
+ level: "app"
174
+ }, {
135
175
  default: withCtx(() => [
176
+ resolvedGlobalModalConfig.value.length ? (openBlock(), createBlock(unref(_sfc_main$3), {
177
+ key: 0,
178
+ "modal-list": resolvedGlobalModalConfig.value,
179
+ "global-only": unref(APP_GLOBAL_MODAL_PORTER_SYMBOL)
180
+ }, null, 8, ["modal-list", "global-only"])) : createCommentVNode("", true),
136
181
  (openBlock(), createBlock(resolveDynamicComponent(resolvedShell.value), {
137
182
  menus: menus.value,
138
183
  menuFlatList: menuFlatList.value,
@@ -171,7 +216,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
171
216
  ]), 1032, ["menus", "menuFlatList", "sidebarMenus", "headerMenus", "activeMenu", "activeModuleMenu", "showHeader", "showSidebar", "showAside", "sidebarAboveHeader"]))
172
217
  ]),
173
218
  _: 3
174
- })
219
+ }, 8, ["remote"])
175
220
  ]),
176
221
  _: 3
177
222
  }, 8, ["content", "font"])
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AppPage.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const AppPage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8fb8acc9"]]);
4
+ const AppPage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2d4bb608"]]);
5
5
  export {
6
6
  AppPage as default
7
7
  };
@@ -28,13 +28,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
28
  },
29
29
  setup(__props) {
30
30
  useCssVars((_ctx) => ({
31
- "v292949d5": pageCssVars.value.top,
32
- "v45d97caa": pageCssVars.value.bottom,
33
- "v0807b0f2": pageCssVars.value.left,
34
- "f841aac8": pageCssVars.value.right,
35
- "f7b4d374": pageCssVars.value.width,
36
- "v32838eb2": pageCssVars.value.height,
37
- "v5c736bbc": props.nextViewportMaxHeight
31
+ "v68a1d5b5": pageCssVars.value.top,
32
+ "v0a30a9cb": pageCssVars.value.bottom,
33
+ "a8d5d0b2": pageCssVars.value.left,
34
+ "v71378308": pageCssVars.value.right,
35
+ "v70aaabb4": pageCssVars.value.width,
36
+ "v13dba0c7": pageCssVars.value.height,
37
+ "v746c0602": props.nextViewportMaxHeight
38
38
  }));
39
39
  const props = __props;
40
40
  const style = computed(() => {
@@ -46,6 +46,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
46
46
  };
47
47
  });
48
48
  const slots = useSlots();
49
+ const listLayoutRecommended = {
50
+ customView: true,
51
+ tableMainProps: {
52
+ pageLayout: "prev, pager, next",
53
+ paginationBackground: false
54
+ }
55
+ };
49
56
  const hasTop = computed(() => !!slots.top);
50
57
  const hasBottom = computed(() => !!slots.bottom);
51
58
  const hasLeft = computed(() => !!slots.left);
@@ -266,7 +273,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
266
273
  class: "app-page-slot-shim",
267
274
  style: normalizeStyle(shimStyles.value.left)
268
275
  }, [
269
- renderSlot(_ctx.$slots, "left", {}, void 0, true)
276
+ renderSlot(_ctx.$slots, "left", { listLayoutRecommended }, void 0, true)
270
277
  ], 4)
271
278
  ]),
272
279
  _: 3
@@ -284,7 +291,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
284
291
  class: "app-page-slot-shim",
285
292
  style: normalizeStyle(shimStyles.value.right)
286
293
  }, [
287
- renderSlot(_ctx.$slots, "right", {}, void 0, true)
294
+ renderSlot(_ctx.$slots, "right", { listLayoutRecommended }, void 0, true)
288
295
  ], 4)
289
296
  ]),
290
297
  _: 3
@@ -0,0 +1,32 @@
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, renderSlot, unref, createBlock, Teleport, createCommentVNode } from "vue";
2
+ import { useShadowTarget } from "./use-shadow-target.mjs";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "ShadowClone",
5
+ props: {
6
+ to: {},
7
+ disabled: { type: Boolean }
8
+ },
9
+ setup(__props) {
10
+ const props = __props;
11
+ const { targetValid } = useShadowTarget({
12
+ to: () => props.to,
13
+ disabled: () => !!props.disabled
14
+ });
15
+ return (_ctx, _cache) => {
16
+ return openBlock(), createElementBlock(Fragment, null, [
17
+ renderSlot(_ctx.$slots, "default"),
18
+ unref(targetValid) ? (openBlock(), createBlock(Teleport, {
19
+ key: 0,
20
+ to: __props.to
21
+ }, [
22
+ renderSlot(_ctx.$slots, "clone", {}, () => [
23
+ renderSlot(_ctx.$slots, "default")
24
+ ])
25
+ ], 8, ["to"])) : createCommentVNode("", true)
26
+ ], 64);
27
+ };
28
+ }
29
+ });
30
+ export {
31
+ _sfc_main as default
32
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./ShadowClone.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,76 @@
1
+ import { ref, watch, nextTick } from "vue";
2
+ import { useActivated } from "../../hooks/activated.mjs";
3
+ function useShadowTarget(options) {
4
+ const { to, disabled } = options;
5
+ const targetValid = ref(false);
6
+ let mo;
7
+ let lastTarget = null;
8
+ function resolveTarget() {
9
+ const t = to();
10
+ if (!t || disabled()) {
11
+ return null;
12
+ }
13
+ if (typeof t === "string") {
14
+ return t.trim() ? document.querySelector(t) : null;
15
+ }
16
+ return t;
17
+ }
18
+ function startWatch() {
19
+ if (mo) {
20
+ return;
21
+ }
22
+ mo = new MutationObserver(() => {
23
+ if (lastTarget && lastTarget.isConnected) {
24
+ return;
25
+ }
26
+ const found = resolveTarget();
27
+ if (found && found !== lastTarget) {
28
+ targetValid.value = false;
29
+ nextTick(() => {
30
+ targetValid.value = true;
31
+ });
32
+ } else {
33
+ targetValid.value = !!found;
34
+ }
35
+ lastTarget = found;
36
+ });
37
+ mo.observe(document.body, { childList: true, subtree: true });
38
+ }
39
+ function stopAll() {
40
+ mo == null ? void 0 : mo.disconnect();
41
+ mo = void 0;
42
+ }
43
+ function bind() {
44
+ const target = resolveTarget();
45
+ lastTarget = target;
46
+ if (target) {
47
+ targetValid.value = true;
48
+ } else {
49
+ targetValid.value = false;
50
+ }
51
+ startWatch();
52
+ }
53
+ function unbind() {
54
+ stopAll();
55
+ lastTarget = null;
56
+ targetValid.value = false;
57
+ }
58
+ useActivated((info) => {
59
+ if (info.isActivated) {
60
+ bind();
61
+ } else {
62
+ unbind();
63
+ }
64
+ });
65
+ watch(disabled, (off) => {
66
+ if (off) {
67
+ unbind();
68
+ } else {
69
+ bind();
70
+ }
71
+ });
72
+ return { targetValid };
73
+ }
74
+ export {
75
+ useShadowTarget
76
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./FormActiveFilter.vue2.mjs";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const FormActiveFilter = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6d2d37c2"]]);
5
+ export {
6
+ FormActiveFilter as default
7
+ };
@@ -0,0 +1,62 @@
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createBlock, unref, withCtx, createElementVNode, toDisplayString, createTextVNode, createCommentVNode } from "vue";
2
+ import { ElTag } from "element-plus";
3
+ import _sfc_main$1 from "../display/ActionBtn.vue.mjs";
4
+ const _hoisted_1 = { class: "dc-form-active-filter form-active-filter" };
5
+ const _hoisted_2 = {
6
+ key: 0,
7
+ class: "form-active-filter__empty"
8
+ };
9
+ const _hoisted_3 = { class: "form-active-filter__label" };
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
+ __name: "FormActiveFilter",
12
+ props: {
13
+ filters: {},
14
+ allowClear: { type: Boolean }
15
+ },
16
+ emits: ["remove", "clear"],
17
+ setup(__props, { emit: __emit }) {
18
+ const emit = __emit;
19
+ function emitRemove(entry) {
20
+ emit("remove", entry);
21
+ }
22
+ function emitClear() {
23
+ emit("clear");
24
+ }
25
+ return (_ctx, _cache) => {
26
+ return openBlock(), createElementBlock("div", _hoisted_1, [
27
+ !__props.filters.length ? (openBlock(), createElementBlock("span", _hoisted_2, " 暂无生效筛选条件 ")) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
28
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.filters, (f) => {
29
+ return openBlock(), createBlock(unref(ElTag), {
30
+ key: f.field,
31
+ class: "form-active-filter__tag",
32
+ closable: "",
33
+ onClose: ($event) => emitRemove(f)
34
+ }, {
35
+ default: withCtx(() => [
36
+ createElementVNode("span", _hoisted_3, toDisplayString(f.label), 1),
37
+ createTextVNode(": " + toDisplayString(f.displayValue), 1)
38
+ ]),
39
+ _: 2
40
+ }, 1032, ["onClose"]);
41
+ }), 128)),
42
+ __props.allowClear ? (openBlock(), createBlock(unref(_sfc_main$1), {
43
+ key: 0,
44
+ size: "small",
45
+ text: "",
46
+ type: "primary",
47
+ class: "form-active-filter__clear",
48
+ onClick: emitClear
49
+ }, {
50
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
51
+ createTextVNode(" 清除全部 ", -1)
52
+ ])]),
53
+ _: 1
54
+ })) : createCommentVNode("", true)
55
+ ], 64))
56
+ ]);
57
+ };
58
+ }
59
+ });
60
+ export {
61
+ _sfc_main as default
62
+ };
@@ -0,0 +1,27 @@
1
+ import { defineComponent, openBlock, createBlock, unref, mergeProps } from "vue";
2
+ import { ElInput } from "element-plus";
3
+ import { usePasswordAutofill } from "./use-password-autofill.mjs";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{ inheritAttrs: false },
6
+ __name: "FormInput",
7
+ props: {
8
+ type: {},
9
+ showPassword: { type: Boolean },
10
+ passwordAutoComplete: {}
11
+ },
12
+ setup(__props) {
13
+ const props = __props;
14
+ const { inputType, autocompleteOut, showPasswordOut } = usePasswordAutofill(props);
15
+ return (_ctx, _cache) => {
16
+ return openBlock(), createBlock(unref(ElInput), mergeProps(_ctx.$attrs, {
17
+ class: "dc-form-input",
18
+ type: unref(inputType),
19
+ autocomplete: unref(autocompleteOut),
20
+ "show-password": unref(showPasswordOut)
21
+ }), null, 16, ["type", "autocomplete", "show-password"]);
22
+ };
23
+ }
24
+ });
25
+ export {
26
+ _sfc_main as default
27
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./FormInput.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,47 @@
1
+ import { defineComponent, useAttrs, computed, openBlock, createBlock, withCtx, createVNode, mergeProps, unref } from "vue";
2
+ import _sfc_main$1 from "./FormInput.vue.mjs";
3
+ import FormShadowCloneDispatch from "./FormShadowCloneDispatch.vue.mjs";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{ inheritAttrs: false },
6
+ __name: "FormInputShadowClone",
7
+ props: {
8
+ modelValue: {},
9
+ shadowClone: { type: Boolean },
10
+ teleportTo: {},
11
+ label: {},
12
+ isHighlighted: {}
13
+ },
14
+ emits: ["update:modelValue"],
15
+ setup(__props, { emit: __emit }) {
16
+ const props = __props;
17
+ const emit = __emit;
18
+ const attrsCast = useAttrs();
19
+ const highlighted = computed(() => {
20
+ const v = props.modelValue;
21
+ return props.isHighlighted ? props.isHighlighted(v) : v !== null && v !== void 0 && v !== "";
22
+ });
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createBlock(FormShadowCloneDispatch, {
25
+ "shadow-clone": __props.shadowClone,
26
+ "teleport-to": __props.teleportTo,
27
+ label: __props.label,
28
+ highlighted: highlighted.value
29
+ }, {
30
+ clone: withCtx(() => [
31
+ createVNode(_sfc_main$1, mergeProps({ "model-value": __props.modelValue }, unref(attrsCast), {
32
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", $event))
33
+ }), null, 16, ["model-value"])
34
+ ]),
35
+ default: withCtx(() => [
36
+ createVNode(_sfc_main$1, mergeProps({ "model-value": __props.modelValue }, unref(attrsCast), {
37
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event))
38
+ }), null, 16, ["model-value"])
39
+ ]),
40
+ _: 1
41
+ }, 8, ["shadow-clone", "teleport-to", "label", "highlighted"]);
42
+ };
43
+ }
44
+ });
45
+ export {
46
+ _sfc_main as default
47
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./FormInputShadowClone.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./FormMain.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const FormMain = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cc2ea388"]]);
4
+ const FormMain = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fca51c0e"]]);
5
5
  export {
6
6
  FormMain as default
7
7
  };
@@ -53,6 +53,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
53
53
  };
54
54
  const validate = async () => {
55
55
  if (!elForm.value) return Promise.reject(new Error(`实例化未完成`));
56
+ if (loadingList.value.length) {
57
+ const first = loadingList.value[0];
58
+ return Promise.reject(new Error(`${first.label}${first.message}`));
59
+ }
56
60
  const selfValidate = new Promise((resolve, reject) => {
57
61
  var _a;
58
62
  (_a = elForm.value) == null ? void 0 : _a.validate((valid, error) => {
@@ -114,31 +118,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
114
118
  return prev;
115
119
  }, {});
116
120
  });
117
- const loadingRules = computed(() => {
118
- return loadingList.value.reduce(
119
- (prev, cur) => {
120
- prev[cur.key] = [
121
- {
122
- validator: () => [new Error(`${cur.label}${cur.message}`)]
123
- }
124
- ];
125
- return prev;
126
- },
127
- {}
128
- );
129
- });
130
- const rules = computed(() => {
131
- const defaultKeys = Object.keys(defaultRules.value);
132
- const loadingKeys = Object.keys(loadingRules.value);
133
- const keys = [...new Set(defaultKeys.concat(loadingKeys))];
134
- return keys.reduce((prev, cur) => {
135
- prev[cur] = [
136
- ...defaultRules.value[cur] || [],
137
- ...loadingRules.value[cur] || []
138
- ];
139
- return prev;
140
- }, {});
141
- });
121
+ const rules = computed(() => defaultRules.value);
142
122
  const changeLoading = ({ key, message }) => {
143
123
  if (!key) {
144
124
  return console.error(`更新状态未传入key, 此处忽略`);
@@ -0,0 +1,57 @@
1
+ import { defineComponent, useAttrs, computed, openBlock, createBlock, withCtx, createVNode, mergeProps, unref, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
+ import FormShadowCloneDispatch from "./FormShadowCloneDispatch.vue.mjs";
3
+ import _sfc_main$1 from "./FormSelect.vue.mjs";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{ inheritAttrs: false },
6
+ __name: "FormSelectShadowClone",
7
+ props: {
8
+ modelValue: {},
9
+ shadowClone: { type: Boolean },
10
+ teleportTo: {},
11
+ label: {},
12
+ isHighlighted: {}
13
+ },
14
+ emits: ["update:modelValue"],
15
+ setup(__props, { emit: __emit }) {
16
+ const props = __props;
17
+ const emit = __emit;
18
+ const attrsCast = useAttrs();
19
+ const highlighted = computed(() => {
20
+ const v = props.modelValue;
21
+ return props.isHighlighted ? props.isHighlighted(v) : v !== null && v !== void 0 && v !== "";
22
+ });
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createBlock(FormShadowCloneDispatch, {
25
+ "shadow-clone": __props.shadowClone,
26
+ "teleport-to": __props.teleportTo,
27
+ label: __props.label,
28
+ highlighted: highlighted.value
29
+ }, {
30
+ clone: withCtx(() => [
31
+ createVNode(_sfc_main$1, mergeProps({ "model-value": __props.modelValue }, unref(attrsCast), {
32
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", $event))
33
+ }), {
34
+ option: withCtx((scope) => [
35
+ renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps(scope)))
36
+ ]),
37
+ _: 3
38
+ }, 16, ["model-value"])
39
+ ]),
40
+ default: withCtx(() => [
41
+ createVNode(_sfc_main$1, mergeProps({ "model-value": __props.modelValue }, unref(attrsCast), {
42
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event))
43
+ }), {
44
+ option: withCtx((scope) => [
45
+ renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps(scope)))
46
+ ]),
47
+ _: 3
48
+ }, 16, ["model-value"])
49
+ ]),
50
+ _: 3
51
+ }, 8, ["shadow-clone", "teleport-to", "label", "highlighted"]);
52
+ };
53
+ }
54
+ });
55
+ export {
56
+ _sfc_main as default
57
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./FormSelectShadowClone.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./FormShadowCloneDispatch.vue2.mjs";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const FormShadowCloneDispatch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5096627a"]]);
5
+ export {
6
+ FormShadowCloneDispatch as default
7
+ };
@@ -0,0 +1,74 @@
1
+ import { defineComponent, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, createElementVNode, normalizeClass, createElementBlock, toDisplayString, createCommentVNode } from "vue";
2
+ import { ElPopover, ElButton, ElIcon } from "element-plus";
3
+ import { Filter } from "@element-plus/icons-vue";
4
+ import _sfc_main$1 from "../display/ShadowClone.vue.mjs";
5
+ const _hoisted_1 = {
6
+ key: 0,
7
+ class: "dc-form-shadow-clone-dispatch__label"
8
+ };
9
+ const _sfc_main = /* @__PURE__ */ defineComponent({
10
+ __name: "FormShadowCloneDispatch",
11
+ props: {
12
+ shadowClone: { type: Boolean, default: false },
13
+ teleportTo: {},
14
+ label: {},
15
+ highlighted: { type: Boolean, default: false },
16
+ popoverWidth: { default: 220 }
17
+ },
18
+ setup(__props) {
19
+ return (_ctx, _cache) => {
20
+ return __props.shadowClone && __props.teleportTo ? (openBlock(), createBlock(unref(_sfc_main$1), {
21
+ key: 0,
22
+ to: __props.teleportTo
23
+ }, {
24
+ clone: withCtx(() => [
25
+ createVNode(unref(ElPopover), {
26
+ trigger: "click",
27
+ placement: "bottom-start",
28
+ width: __props.popoverWidth
29
+ }, {
30
+ reference: withCtx(() => [
31
+ createElementVNode("span", {
32
+ class: normalizeClass(["dc-form-shadow-clone-dispatch", { "dc-form-shadow-clone-dispatch--active": __props.highlighted }])
33
+ }, [
34
+ __props.label ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
35
+ createVNode(unref(ElButton), {
36
+ class: "dc-form-filter-funnel",
37
+ size: "small",
38
+ text: "",
39
+ circle: ""
40
+ }, {
41
+ default: withCtx(() => [
42
+ createVNode(unref(ElIcon), null, {
43
+ default: withCtx(() => [
44
+ createVNode(unref(Filter))
45
+ ]),
46
+ _: 1
47
+ })
48
+ ]),
49
+ _: 1
50
+ })
51
+ ], 2)
52
+ ]),
53
+ default: withCtx(() => [
54
+ renderSlot(_ctx.$slots, "clone", { highlighted: __props.highlighted }, () => [
55
+ renderSlot(_ctx.$slots, "default", { highlighted: __props.highlighted }, void 0, true)
56
+ ], true)
57
+ ]),
58
+ _: 3
59
+ }, 8, ["width"])
60
+ ]),
61
+ default: withCtx(() => [
62
+ renderSlot(_ctx.$slots, "default", { highlighted: __props.highlighted }, void 0, true)
63
+ ]),
64
+ _: 3
65
+ }, 8, ["to"])) : renderSlot(_ctx.$slots, "default", {
66
+ key: 1,
67
+ highlighted: __props.highlighted
68
+ }, void 0, true);
69
+ };
70
+ }
71
+ });
72
+ export {
73
+ _sfc_main as default
74
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./FormSortSwitch.vue2.mjs";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const FormSortSwitch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9aa4f615"]]);
5
+ export {
6
+ FormSortSwitch as default
7
+ };