@done-coding/forge-core 0.0.0-placeholder.0 → 0.100.0-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 (283) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
  4. package/es/bridge/badge.mjs +37 -0
  5. package/es/bridge/config-hook.mjs +58 -0
  6. package/es/bridge/contracts/event.mjs +102 -0
  7. package/es/bridge/contracts/index.mjs +5 -0
  8. package/es/bridge/event.mjs +87 -0
  9. package/es/bridge/index.mjs +331 -0
  10. package/es/bridge/layout.mjs +100 -0
  11. package/es/bridge/permission.mjs +91 -0
  12. package/es/bridge/plugin.mjs +39 -0
  13. package/es/bridge/route.mjs +78 -0
  14. package/es/bridge/state.mjs +61 -0
  15. package/es/bridge/storage.mjs +26 -0
  16. package/es/bridge/theme/index.mjs +233 -0
  17. package/es/bridge/theme/persist.mjs +18 -0
  18. package/es/bridge/theme/system-dark.mjs +18 -0
  19. package/es/components/basic/AppCollapseToggle.vue.mjs +7 -0
  20. package/es/components/basic/AppCollapseToggle.vue2.mjs +63 -0
  21. package/es/components/basic/action-btn/ActionBtn.vue.mjs +200 -0
  22. package/es/components/basic/action-btn/ActionBtn.vue2.mjs +4 -0
  23. package/es/components/basic/action-btn/index.mjs +4 -0
  24. package/es/components/basic/action-btn/use-action-btn-report.mjs +54 -0
  25. package/es/components/basic/action-btn-group/ActionBtnGroup.vue.mjs +69 -0
  26. package/es/components/basic/action-btn-group/ActionBtnGroup.vue2.mjs +4 -0
  27. package/es/components/basic/action-btn-group/index.mjs +4 -0
  28. package/es/components/basic/action-btn-group/use-action-btn-group-report.mjs +30 -0
  29. package/es/components/basic/display-contracts/index.mjs +1 -0
  30. package/es/components/basic/drag-float/DragFloat.vue.mjs +7 -0
  31. package/es/components/basic/drag-float/DragFloat.vue2.mjs +109 -0
  32. package/es/components/basic/drag-float/index.mjs +4 -0
  33. package/es/components/basic/height-provider/HeightProvider.vue.mjs +62 -0
  34. package/es/components/basic/height-provider/HeightProvider.vue2.mjs +4 -0
  35. package/es/components/basic/height-provider/index.mjs +4 -0
  36. package/es/components/basic/index.mjs +4 -0
  37. package/es/components/basic/shadow-clone/ShadowClone.vue.mjs +32 -0
  38. package/es/components/basic/shadow-clone/ShadowClone.vue2.mjs +4 -0
  39. package/es/components/basic/shadow-clone/index.mjs +4 -0
  40. package/es/components/basic/shadow-clone/use-shadow-target.mjs +76 -0
  41. package/es/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue.mjs +7 -0
  42. package/es/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue2.mjs +68 -0
  43. package/es/components/basic/slot-layout-flow-aside/index.mjs +4 -0
  44. package/es/components/basic/slot-layout-template/SlotLayoutTemplate.vue.mjs +30 -0
  45. package/es/components/basic/slot-layout-template/SlotLayoutTemplate.vue2.mjs +4 -0
  46. package/es/components/basic/slot-layout-template/index.mjs +4 -0
  47. package/es/components/basic/watch-size/WatchSize.vue.mjs +73 -0
  48. package/es/components/basic/watch-size/WatchSize.vue2.mjs +4 -0
  49. package/es/components/basic/watch-size/index.mjs +4 -0
  50. package/es/components/config/app-theme/AppTheme.vue.mjs +7 -0
  51. package/es/components/config/app-theme/AppTheme.vue2.mjs +82 -0
  52. package/es/components/config/app-theme/index.mjs +4 -0
  53. package/es/components/data/badge-mark/BadgeMark.vue.mjs +7 -0
  54. package/es/components/data/badge-mark/BadgeMark.vue2.mjs +80 -0
  55. package/es/components/data/badge-mark/index.mjs +4 -0
  56. package/es/components/data/badge-mark/use-badge-mask.mjs +82 -0
  57. package/es/components/data/badge-mark/use-badge.mjs +106 -0
  58. package/es/components/data/boolean-tag/BooleanTag.vue.mjs +36 -0
  59. package/es/components/data/boolean-tag/BooleanTag.vue2.mjs +4 -0
  60. package/es/components/data/boolean-tag/index.mjs +4 -0
  61. package/es/components/data/image-preview-trigger/ImagePreviewTrigger.vue.mjs +38 -0
  62. package/es/components/data/image-preview-trigger/ImagePreviewTrigger.vue2.mjs +4 -0
  63. package/es/components/data/image-preview-trigger/index.mjs +4 -0
  64. package/es/components/data/modal-image-preview/ModalImagePreview.vue.mjs +52 -0
  65. package/es/components/data/modal-image-preview/ModalImagePreview.vue2.mjs +4 -0
  66. package/es/components/data/modal-image-preview/index.mjs +4 -0
  67. package/es/components/feedback/action-confirm/ActionConfirm.vue.mjs +7 -0
  68. package/es/components/feedback/action-confirm/ActionConfirm.vue2.mjs +143 -0
  69. package/es/components/feedback/action-confirm/index.mjs +4 -0
  70. package/es/components/feedback/modal-confirm/ModalConfirm.vue.mjs +8 -0
  71. package/es/components/feedback/modal-confirm/ModalConfirm.vue2.mjs +243 -0
  72. package/es/components/feedback/modal-confirm/index.mjs +4 -0
  73. package/es/components/feedback/modal-video-preview/ModalVideoPreview.vue.mjs +8 -0
  74. package/es/components/feedback/modal-video-preview/ModalVideoPreview.vue2.mjs +93 -0
  75. package/es/components/feedback/modal-video-preview/index.mjs +4 -0
  76. package/es/components/feedback/preview-keys/index.mjs +7 -0
  77. package/es/components/feedback/preview-keys/keys.mjs +7 -0
  78. package/es/components/feedback/shelf-contracts/index.mjs +1 -0
  79. package/es/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue.mjs +7 -0
  80. package/es/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue2.mjs +133 -0
  81. package/es/components/feedback/video-preview-trigger/index.mjs +4 -0
  82. package/es/components/other/TriggerAutoImport.vue.mjs +12 -0
  83. package/es/components/other/TriggerAutoImport.vue2.mjs +4 -0
  84. package/es/components/other/auto-refresh/AutoRefresh.vue.mjs +7 -0
  85. package/es/components/other/auto-refresh/AutoRefresh.vue2.mjs +96 -0
  86. package/es/components/other/auto-refresh/index.mjs +4 -0
  87. package/es/components/other/auto-refresh/use-auto-refresh-report.mjs +31 -0
  88. package/es/components/other/auto-refresh-contracts/index.mjs +1 -0
  89. package/es/components/other/auto-refresh-group/AutoRefreshGroup.vue.mjs +7 -0
  90. package/es/components/other/auto-refresh-group/AutoRefreshGroup.vue2.mjs +69 -0
  91. package/es/components/other/auto-refresh-group/index.mjs +4 -0
  92. package/es/components/other/auto-refresh-group/use-auto-refresh-group-report.mjs +12 -0
  93. package/es/components/other/index.mjs +4 -0
  94. package/es/config/badge-attr.mjs +6 -0
  95. package/es/config/index.mjs +19 -0
  96. package/es/config/list-model.mjs +13 -0
  97. package/es/config/modal-keys.mjs +6 -0
  98. package/es/config/route.mjs +6 -0
  99. package/es/config/slot-region.mjs +45 -0
  100. package/es/helpers/form.mjs +25 -0
  101. package/es/helpers/index.mjs +10 -0
  102. package/es/helpers/list-helper.mjs +77 -0
  103. package/es/hooks/activated.mjs +64 -0
  104. package/es/hooks/feel-size.mjs +46 -0
  105. package/es/hooks/index.mjs +31 -0
  106. package/es/hooks/menus-dispatch.mjs +85 -0
  107. package/es/hooks/timeout.mjs +36 -0
  108. package/es/hooks/use-active-record.mjs +104 -0
  109. package/es/hooks/use-breakpoint.mjs +48 -0
  110. package/es/hooks/use-bridge-report.mjs +12 -0
  111. package/es/hooks/use-channel-viewport-height.mjs +43 -0
  112. package/es/hooks/use-context-defaults.mjs +44 -0
  113. package/es/hooks/use-custom-breakpoint.mjs +69 -0
  114. package/es/hooks/use-is-dev.mjs +16 -0
  115. package/es/hooks/use-observe-size.mjs +43 -0
  116. package/es/hooks/use-permission.mjs +12 -0
  117. package/es/hooks/use-surface.mjs +35 -0
  118. package/es/hooks/use-theme-apply.mjs +496 -0
  119. package/es/hooks/use-viewport-apply.mjs +52 -0
  120. package/es/index.mjs +179 -0
  121. package/es/inject/index.mjs +19 -0
  122. package/es/inject/key.mjs +70 -0
  123. package/es/injection-namespace.mjs +4 -0
  124. package/es/internals/index.mjs +16 -0
  125. package/es/router/group-redirect.mjs +26 -0
  126. package/es/router/guard/index.mjs +36 -0
  127. package/es/router/guard/login.mjs +6 -0
  128. package/es/router/guard/permission.mjs +6 -0
  129. package/es/router/index.mjs +10 -0
  130. package/es/store/app.mjs +306 -0
  131. package/es/store/index.mjs +8 -0
  132. package/es/store/router-permission.mjs +94 -0
  133. package/es/store/user.mjs +128 -0
  134. package/es/style.css +339 -0
  135. package/es/types/index.mjs +1 -0
  136. package/es/utils/dom.mjs +42 -0
  137. package/es/utils/export.mjs +39 -0
  138. package/es/utils/gap-scale.mjs +25 -0
  139. package/es/utils/id.mjs +7 -0
  140. package/es/utils/index.mjs +37 -0
  141. package/es/utils/permission.mjs +31 -0
  142. package/es/utils/router.mjs +42 -0
  143. package/es/utils/theme-scale.mjs +86 -0
  144. package/es/utils/time.mjs +24 -0
  145. package/package.json +232 -1
  146. package/types/bridge/badge.d.ts +215 -0
  147. package/types/bridge/config-hook.d.ts +12 -0
  148. package/types/bridge/contracts/bridge.d.ts +339 -0
  149. package/types/bridge/contracts/config.d.ts +519 -0
  150. package/types/bridge/contracts/event.d.ts +546 -0
  151. package/types/bridge/contracts/index.d.ts +3 -0
  152. package/types/bridge/event.d.ts +3 -0
  153. package/types/bridge/index.d.ts +28 -0
  154. package/types/bridge/layout.d.ts +102 -0
  155. package/types/bridge/permission.d.ts +31 -0
  156. package/types/bridge/plugin.d.ts +11 -0
  157. package/types/bridge/route.d.ts +36 -0
  158. package/types/bridge/state.d.ts +26 -0
  159. package/types/bridge/storage.d.ts +10 -0
  160. package/types/bridge/theme/index.d.ts +10 -0
  161. package/types/bridge/theme/persist.d.ts +23 -0
  162. package/types/bridge/theme/system-dark.d.ts +14 -0
  163. package/types/bridge/theme/types.d.ts +346 -0
  164. package/types/components/basic/AppCollapseToggle.vue.d.ts +14 -0
  165. package/types/components/basic/action-btn/ActionBtn.vue.d.ts +19 -0
  166. package/types/components/basic/action-btn/index.d.ts +1 -0
  167. package/types/components/basic/action-btn/use-action-btn-report.d.ts +12 -0
  168. package/types/components/basic/action-btn-group/ActionBtnGroup.vue.d.ts +18 -0
  169. package/types/components/basic/action-btn-group/index.d.ts +1 -0
  170. package/types/components/basic/action-btn-group/use-action-btn-group-report.d.ts +6 -0
  171. package/types/components/basic/display-contracts/index.d.ts +1 -0
  172. package/types/components/basic/display-contracts/types.d.ts +280 -0
  173. package/types/components/basic/drag-float/DragFloat.vue.d.ts +35 -0
  174. package/types/components/basic/drag-float/index.d.ts +1 -0
  175. package/types/components/basic/height-provider/HeightProvider.vue.d.ts +28 -0
  176. package/types/components/basic/height-provider/index.d.ts +1 -0
  177. package/types/components/basic/index.d.ts +1 -0
  178. package/types/components/basic/shadow-clone/ShadowClone.vue.d.ts +20 -0
  179. package/types/components/basic/shadow-clone/index.d.ts +1 -0
  180. package/types/components/basic/shadow-clone/use-shadow-target.d.ts +9 -0
  181. package/types/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue.d.ts +32 -0
  182. package/types/components/basic/slot-layout-flow-aside/index.d.ts +2 -0
  183. package/types/components/basic/slot-layout-flow-aside/types.d.ts +10 -0
  184. package/types/components/basic/slot-layout-template/SlotLayoutTemplate.vue.d.ts +48 -0
  185. package/types/components/basic/slot-layout-template/index.d.ts +1 -0
  186. package/types/components/basic/watch-size/WatchSize.vue.d.ts +45 -0
  187. package/types/components/basic/watch-size/index.d.ts +1 -0
  188. package/types/components/config/app-theme/AppTheme.vue.d.ts +2 -0
  189. package/types/components/config/app-theme/index.d.ts +1 -0
  190. package/types/components/data/badge-mark/BadgeMark.vue.d.ts +212 -0
  191. package/types/components/data/badge-mark/index.d.ts +1 -0
  192. package/types/components/data/badge-mark/use-badge-mask.d.ts +8 -0
  193. package/types/components/data/badge-mark/use-badge.d.ts +78 -0
  194. package/types/components/data/boolean-tag/BooleanTag.vue.d.ts +8 -0
  195. package/types/components/data/boolean-tag/index.d.ts +1 -0
  196. package/types/components/data/image-preview-trigger/ImagePreviewTrigger.vue.d.ts +41 -0
  197. package/types/components/data/image-preview-trigger/index.d.ts +1 -0
  198. package/types/components/data/modal-image-preview/ModalImagePreview.vue.d.ts +31 -0
  199. package/types/components/data/modal-image-preview/index.d.ts +1 -0
  200. package/types/components/feedback/action-confirm/ActionConfirm.vue.d.ts +33 -0
  201. package/types/components/feedback/action-confirm/index.d.ts +1 -0
  202. package/types/components/feedback/modal-confirm/ModalConfirm.vue.d.ts +120 -0
  203. package/types/components/feedback/modal-confirm/index.d.ts +2 -0
  204. package/types/components/feedback/modal-confirm/types.d.ts +4 -0
  205. package/types/components/feedback/modal-video-preview/ModalVideoPreview.vue.d.ts +40 -0
  206. package/types/components/feedback/modal-video-preview/index.d.ts +1 -0
  207. package/types/components/feedback/preview-keys/index.d.ts +2 -0
  208. package/types/components/feedback/preview-keys/keys.d.ts +14 -0
  209. package/types/components/feedback/shelf-contracts/index.d.ts +1 -0
  210. package/types/components/feedback/shelf-contracts/types.d.ts +1 -0
  211. package/types/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue.d.ts +46 -0
  212. package/types/components/feedback/video-preview-trigger/index.d.ts +1 -0
  213. package/types/components/other/TriggerAutoImport.vue.d.ts +17 -0
  214. package/types/components/other/auto-refresh/AutoRefresh.vue.d.ts +14 -0
  215. package/types/components/other/auto-refresh/index.d.ts +1 -0
  216. package/types/components/other/auto-refresh/use-auto-refresh-report.d.ts +1 -0
  217. package/types/components/other/auto-refresh-contracts/index.d.ts +1 -0
  218. package/types/components/other/auto-refresh-contracts/types.d.ts +17 -0
  219. package/types/components/other/auto-refresh-group/AutoRefreshGroup.vue.d.ts +18 -0
  220. package/types/components/other/auto-refresh-group/index.d.ts +1 -0
  221. package/types/components/other/auto-refresh-group/use-auto-refresh-group-report.d.ts +3 -0
  222. package/types/components/other/index.d.ts +1 -0
  223. package/types/config/badge-attr.d.ts +26 -0
  224. package/types/config/index.d.ts +5 -0
  225. package/types/config/list-model.d.ts +49 -0
  226. package/types/config/modal-keys.d.ts +12 -0
  227. package/types/config/route.d.ts +4 -0
  228. package/types/config/slot-region.d.ts +72 -0
  229. package/types/helpers/form.d.ts +8 -0
  230. package/types/helpers/index.d.ts +3 -0
  231. package/types/helpers/list-helper.d.ts +35 -0
  232. package/types/helpers/types.d.ts +15 -0
  233. package/types/hooks/activated.d.ts +36 -0
  234. package/types/hooks/feel-size.d.ts +10 -0
  235. package/types/hooks/index.d.ts +12 -0
  236. package/types/hooks/menus-dispatch.d.ts +35 -0
  237. package/types/hooks/timeout.d.ts +7 -0
  238. package/types/hooks/use-active-record.d.ts +64 -0
  239. package/types/hooks/use-breakpoint.d.ts +4 -0
  240. package/types/hooks/use-bridge-report.d.ts +3 -0
  241. package/types/hooks/use-channel-viewport-height.d.ts +22 -0
  242. package/types/hooks/use-context-defaults.d.ts +39 -0
  243. package/types/hooks/use-custom-breakpoint.d.ts +17 -0
  244. package/types/hooks/use-is-dev.d.ts +24 -0
  245. package/types/hooks/use-observe-size.d.ts +36 -0
  246. package/types/hooks/use-permission.d.ts +14 -0
  247. package/types/hooks/use-surface.d.ts +45 -0
  248. package/types/hooks/use-theme-apply.d.ts +34 -0
  249. package/types/hooks/use-viewport-apply.d.ts +20 -0
  250. package/types/index.d.ts +33 -0
  251. package/types/inject/index.d.ts +1 -0
  252. package/types/inject/key.d.ts +247 -0
  253. package/types/injection-namespace.d.ts +4 -0
  254. package/types/internals/index.d.ts +6 -0
  255. package/types/router/group-redirect.d.ts +14 -0
  256. package/types/router/guard/index.d.ts +20 -0
  257. package/types/router/guard/login.d.ts +4 -0
  258. package/types/router/guard/permission.d.ts +4 -0
  259. package/types/router/guard/types.d.ts +14 -0
  260. package/types/router/index.d.ts +2 -0
  261. package/types/store/app.d.ts +219 -0
  262. package/types/store/index.d.ts +3 -0
  263. package/types/store/router-permission.d.ts +79 -0
  264. package/types/store/user.d.ts +64 -0
  265. package/types/types/app-layout.d.ts +42 -0
  266. package/types/types/dc-path.d.ts +2 -0
  267. package/types/types/dot-path.d.ts +13 -0
  268. package/types/types/index.d.ts +9 -0
  269. package/types/types/list-api.d.ts +17 -0
  270. package/types/types/modal-shelf.d.ts +123 -0
  271. package/types/types/nest-form.d.ts +8 -0
  272. package/types/types/permission.d.ts +31 -0
  273. package/types/types/route.d.ts +141 -0
  274. package/types/types/utility-types.d.ts +25 -0
  275. package/types/utils/dom.d.ts +61 -0
  276. package/types/utils/export.d.ts +35 -0
  277. package/types/utils/gap-scale.d.ts +46 -0
  278. package/types/utils/id.d.ts +2 -0
  279. package/types/utils/index.d.ts +8 -0
  280. package/types/utils/permission.d.ts +16 -0
  281. package/types/utils/router.d.ts +18 -0
  282. package/types/utils/theme-scale.d.ts +78 -0
  283. package/types/utils/time.d.ts +2 -0
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./VideoPreviewTrigger.vue.mjs";
2
+ export {
3
+ default2 as VideoPreviewTrigger
4
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent, createCommentVNode } from "vue";
2
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3
+ __name: "TriggerAutoImport",
4
+ setup(__props) {
5
+ return (_ctx, _cache) => {
6
+ return createCommentVNode("", true);
7
+ };
8
+ }
9
+ });
10
+ export {
11
+ _sfc_main as default
12
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./TriggerAutoImport.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./AutoRefresh.vue2.mjs";
2
+ /* empty css */
3
+ import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const AutoRefresh = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-64294ae8"]]);
5
+ export {
6
+ AutoRefresh as default
7
+ };
@@ -0,0 +1,96 @@
1
+ import { defineComponent, useModel, computed, watch, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, mergeModels } from "vue";
2
+ import { useAutoRefreshReport } from "./use-auto-refresh-report.mjs";
3
+ import { ElPopover, ElInputNumber, ElSwitch } from "element-plus";
4
+ import { Refresh } from "@element-plus/icons-vue";
5
+ import { useActivated } from "../../../hooks/activated.mjs";
6
+ import { useTimeout } from "../../../hooks/timeout.mjs";
7
+ const _hoisted_1 = { class: "auto-refresh" };
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ __name: "AutoRefresh",
10
+ props: /* @__PURE__ */ mergeModels({
11
+ refreshFn: {},
12
+ disabled: { type: Boolean }
13
+ }, {
14
+ "modelValue": { type: Boolean, ...{ default: false } },
15
+ "modelModifiers": {},
16
+ "interval": { default: 5 },
17
+ "intervalModifiers": {}
18
+ }),
19
+ emits: ["update:modelValue", "update:interval"],
20
+ setup(__props) {
21
+ const props = __props;
22
+ const modelValue = useModel(__props, "modelValue");
23
+ const intervalModel = useModel(__props, "interval");
24
+ useAutoRefreshReport(
25
+ () => modelValue.value,
26
+ () => intervalModel.value
27
+ );
28
+ const openRefresh = computed(() => modelValue.value && !props.disabled);
29
+ const [setTimer, clearTimer] = useTimeout();
30
+ let _refreshPromise = null;
31
+ const doRefresh = () => {
32
+ if (!_refreshPromise) {
33
+ _refreshPromise = props.refreshFn().catch(() => {
34
+ }).finally(() => {
35
+ _refreshPromise = null;
36
+ });
37
+ }
38
+ return _refreshPromise;
39
+ };
40
+ const scheduleRefresh = () => {
41
+ setTimer(async () => {
42
+ await doRefresh();
43
+ if (openRefresh.value) scheduleRefresh();
44
+ }, intervalModel.value * 1e3);
45
+ };
46
+ watch([openRefresh, intervalModel], ([open]) => {
47
+ open ? scheduleRefresh() : clearTimer();
48
+ });
49
+ useActivated(({ isActivated, triggerType }) => {
50
+ if (!isActivated) {
51
+ return;
52
+ }
53
+ if (openRefresh.value) {
54
+ if (triggerType === "activated") {
55
+ clearTimer();
56
+ doRefresh();
57
+ }
58
+ scheduleRefresh();
59
+ }
60
+ });
61
+ return (_ctx, _cache) => {
62
+ return openBlock(), createBlock(unref(ElPopover), {
63
+ trigger: "hover",
64
+ placement: "bottom-start"
65
+ }, {
66
+ reference: withCtx(() => [
67
+ createVNode(unref(ElSwitch), {
68
+ modelValue: modelValue.value,
69
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
70
+ "aria-label": "自动刷新",
71
+ "active-action-icon": unref(Refresh),
72
+ "inactive-action-icon": unref(Refresh)
73
+ }, null, 8, ["modelValue", "active-action-icon", "inactive-action-icon"])
74
+ ]),
75
+ default: withCtx(() => [
76
+ createElementVNode("div", _hoisted_1, [
77
+ _cache[2] || (_cache[2] = createElementVNode("div", { class: "auto-refresh-label" }, "自动刷新间隔(秒)", -1)),
78
+ createVNode(unref(ElInputNumber), {
79
+ modelValue: intervalModel.value,
80
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => intervalModel.value = $event),
81
+ "aria-label": "自动刷新间隔(秒)",
82
+ min: 1,
83
+ step: 1,
84
+ size: "small",
85
+ class: "auto-refresh-interval"
86
+ }, null, 8, ["modelValue"])
87
+ ])
88
+ ]),
89
+ _: 1
90
+ });
91
+ };
92
+ }
93
+ });
94
+ export {
95
+ _sfc_main as default
96
+ };
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./AutoRefresh.vue.mjs";
2
+ export {
3
+ default2 as AutoRefresh
4
+ };
@@ -0,0 +1,31 @@
1
+ import { inject, watch } from "vue";
2
+ import { CORE_BRIDGE_KEY } from "../../../inject/key.mjs";
3
+ import { useActivated } from "../../../hooks/activated.mjs";
4
+ import { useBridgeReport } from "../../../hooks/use-bridge-report.mjs";
5
+ function useAutoRefreshReport(getEnabled, getInterval) {
6
+ const bridge = inject(CORE_BRIDGE_KEY, void 0);
7
+ const report = useBridgeReport();
8
+ let stopDemand;
9
+ let stopToggle;
10
+ const reportToggle = (enabled) => {
11
+ report("auto-refresh-toggle", () => ({ enabled, interval: getInterval() }));
12
+ };
13
+ useActivated(({ isActivated }) => {
14
+ stopDemand == null ? void 0 : stopDemand();
15
+ stopToggle == null ? void 0 : stopToggle();
16
+ stopDemand = void 0;
17
+ stopToggle = void 0;
18
+ if (!isActivated || !bridge) return;
19
+ stopDemand = watch(
20
+ bridge.eventCollecting,
21
+ (collecting) => {
22
+ stopToggle == null ? void 0 : stopToggle();
23
+ stopToggle = collecting ? watch(getEnabled, reportToggle, { flush: "sync" }) : void 0;
24
+ },
25
+ { immediate: true, flush: "sync" }
26
+ );
27
+ });
28
+ }
29
+ export {
30
+ useAutoRefreshReport
31
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./AutoRefreshGroup.vue2.mjs";
2
+ /* empty css */
3
+ import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const AutoRefreshGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5a86b4f5"]]);
5
+ export {
6
+ AutoRefreshGroup as default
7
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent, useModel, openBlock, createBlock, unref, withCtx, createCommentVNode, createVNode, normalizeClass, mergeModels } from "vue";
2
+ import { useAutoRefreshGroupReport } from "./use-auto-refresh-group-report.mjs";
3
+ import AutoRefresh from "../auto-refresh/AutoRefresh.vue.mjs";
4
+ import { ElButton, ElIcon } from "element-plus";
5
+ import { Refresh } from "@element-plus/icons-vue";
6
+ import _sfc_main$1 from "../../basic/slot-layout-template/SlotLayoutTemplate.vue.mjs";
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "AutoRefreshGroup",
9
+ props: /* @__PURE__ */ mergeModels({
10
+ showAutoRefresh: { type: Boolean, default: true },
11
+ showRefresh: { type: Boolean, default: true },
12
+ loading: { type: Boolean },
13
+ needRootNode: { type: Boolean, default: true },
14
+ refreshFn: {}
15
+ }, {
16
+ "isAutoRefresh": { type: Boolean },
17
+ "isAutoRefreshModifiers": {},
18
+ "interval": { default: 5 },
19
+ "intervalModifiers": {}
20
+ }),
21
+ emits: ["update:isAutoRefresh", "update:interval"],
22
+ setup(__props) {
23
+ const props = __props;
24
+ const { refreshManually } = useAutoRefreshGroupReport(() => props.refreshFn);
25
+ const isAutoRefresh = useModel(__props, "isAutoRefresh");
26
+ const refreshInterval = useModel(__props, "interval");
27
+ return (_ctx, _cache) => {
28
+ return openBlock(), createBlock(unref(_sfc_main$1), {
29
+ disabled: !__props.needRootNode,
30
+ class: "auto-refresh-group-root"
31
+ }, {
32
+ default: withCtx(() => [
33
+ __props.showAutoRefresh ? (openBlock(), createBlock(unref(AutoRefresh), {
34
+ key: 0,
35
+ modelValue: isAutoRefresh.value,
36
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isAutoRefresh.value = $event),
37
+ interval: refreshInterval.value,
38
+ "onUpdate:interval": _cache[1] || (_cache[1] = ($event) => refreshInterval.value = $event),
39
+ refreshFn: __props.refreshFn,
40
+ disabled: __props.loading
41
+ }, null, 8, ["modelValue", "interval", "refreshFn", "disabled"])) : createCommentVNode("", true),
42
+ __props.showRefresh ? (openBlock(), createBlock(unref(ElButton), {
43
+ key: 1,
44
+ "aria-label": "刷新",
45
+ size: "small",
46
+ circle: "",
47
+ onClick: _cache[2] || (_cache[2] = ($event) => unref(refreshManually)())
48
+ }, {
49
+ default: withCtx(() => [
50
+ createVNode(unref(ElIcon), {
51
+ class: normalizeClass({ "auto-refresh-group-icon--rotating": __props.loading })
52
+ }, {
53
+ default: withCtx(() => [
54
+ createVNode(unref(Refresh))
55
+ ]),
56
+ _: 1
57
+ }, 8, ["class"])
58
+ ]),
59
+ _: 1
60
+ })) : createCommentVNode("", true)
61
+ ]),
62
+ _: 1
63
+ }, 8, ["disabled"]);
64
+ };
65
+ }
66
+ });
67
+ export {
68
+ _sfc_main as default
69
+ };
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./AutoRefreshGroup.vue.mjs";
2
+ export {
3
+ default2 as AutoRefreshGroup
4
+ };
@@ -0,0 +1,12 @@
1
+ import { useBridgeReport } from "../../../hooks/use-bridge-report.mjs";
2
+ function useAutoRefreshGroupReport(getRefresh) {
3
+ const report = useBridgeReport();
4
+ const refreshManually = () => {
5
+ report("refresh");
6
+ return getRefresh()();
7
+ };
8
+ return { refreshManually };
9
+ }
10
+ export {
11
+ useAutoRefreshGroupReport
12
+ };
@@ -0,0 +1,4 @@
1
+ import { default as default2 } from "./TriggerAutoImport.vue.mjs";
2
+ export {
3
+ default2 as TriggerAutoImport
4
+ };
@@ -0,0 +1,6 @@
1
+ const BADGE_HOST_ATTR = "data-dc-badge-host";
2
+ const BADGE_KEY_ATTR = "data-dc-badge-key";
3
+ export {
4
+ BADGE_HOST_ATTR,
5
+ BADGE_KEY_ATTR
6
+ };
@@ -0,0 +1,19 @@
1
+ import { BADGE_HOST_ATTR, BADGE_KEY_ATTR } from "./badge-attr.mjs";
2
+ import { APP_API_LIST_MODEL_KEY_CONFIG } from "./list-model.mjs";
3
+ import { ROUTE_MODULE_LEVEL, TabsMainReplaceQueryKey } from "./route.mjs";
4
+ import { APP_PAGE_SIDE_SLOTS, DC_SLOT_ATTR, SlotRegion, parseSlotRegion, resolveAppPageSlotName } from "./slot-region.mjs";
5
+ import { APP_GLOBAL_IMAGE_PREVIEW_KEY, APP_GLOBAL_VIDEO_PREVIEW_KEY } from "./modal-keys.mjs";
6
+ export {
7
+ APP_API_LIST_MODEL_KEY_CONFIG,
8
+ APP_GLOBAL_IMAGE_PREVIEW_KEY,
9
+ APP_GLOBAL_VIDEO_PREVIEW_KEY,
10
+ APP_PAGE_SIDE_SLOTS,
11
+ BADGE_HOST_ATTR,
12
+ BADGE_KEY_ATTR,
13
+ DC_SLOT_ATTR,
14
+ ROUTE_MODULE_LEVEL,
15
+ SlotRegion,
16
+ TabsMainReplaceQueryKey,
17
+ parseSlotRegion,
18
+ resolveAppPageSlotName
19
+ };
@@ -0,0 +1,13 @@
1
+ const APP_API_LIST_MODEL_KEY_CONFIG = Object.freeze({
2
+ /** 当前页码 key */
3
+ CURRENT_PAGE_KEY: "page.page",
4
+ /** 每页条数 key */
5
+ PAGE_SIZE_KEY: "page.pageSize",
6
+ /** 总数 key */
7
+ TOTAL_KEY: "page.totalRecord",
8
+ /** 数据列表 key */
9
+ LIST_KEY: "items"
10
+ });
11
+ export {
12
+ APP_API_LIST_MODEL_KEY_CONFIG
13
+ };
@@ -0,0 +1,6 @@
1
+ const APP_GLOBAL_IMAGE_PREVIEW_KEY = "appGlobalImagePreview";
2
+ const APP_GLOBAL_VIDEO_PREVIEW_KEY = "appGlobalVideoPreview";
3
+ export {
4
+ APP_GLOBAL_IMAGE_PREVIEW_KEY,
5
+ APP_GLOBAL_VIDEO_PREVIEW_KEY
6
+ };
@@ -0,0 +1,6 @@
1
+ const ROUTE_MODULE_LEVEL = 1;
2
+ const TabsMainReplaceQueryKey = "_tab";
3
+ export {
4
+ ROUTE_MODULE_LEVEL,
5
+ TabsMainReplaceQueryKey
6
+ };
@@ -0,0 +1,45 @@
1
+ const DC_SLOT_ATTR = "data-dc-slot";
2
+ var SlotRegion = /* @__PURE__ */ ((SlotRegion2) => {
3
+ SlotRegion2[SlotRegion2["AppPage_Default"] = 1] = "AppPage_Default";
4
+ SlotRegion2[SlotRegion2["AppPage_Top"] = 2] = "AppPage_Top";
5
+ SlotRegion2[SlotRegion2["AppPage_Right"] = 3] = "AppPage_Right";
6
+ SlotRegion2[SlotRegion2["AppPage_Bottom"] = 4] = "AppPage_Bottom";
7
+ SlotRegion2[SlotRegion2["AppPage_Left"] = 5] = "AppPage_Left";
8
+ SlotRegion2[SlotRegion2["TabsMain_Item"] = 6] = "TabsMain_Item";
9
+ SlotRegion2[SlotRegion2["ModalConfirm_Body"] = 7] = "ModalConfirm_Body";
10
+ SlotRegion2[SlotRegion2["ModalConfirm_DrawerBody"] = 8] = "ModalConfirm_DrawerBody";
11
+ return SlotRegion2;
12
+ })(SlotRegion || {});
13
+ const parseSlotRegion = (raw) => {
14
+ if (raw === null || raw === void 0 || raw === "") return void 0;
15
+ const num = Number(raw);
16
+ if (!Number.isInteger(num)) return void 0;
17
+ return num in SlotRegion ? num : void 0;
18
+ };
19
+ const APP_PAGE_SIDE_SLOTS = [
20
+ "top",
21
+ "right",
22
+ "bottom",
23
+ "left"
24
+ ];
25
+ const resolveAppPageSlotName = (region) => {
26
+ switch (region) {
27
+ case 2:
28
+ return "top";
29
+ case 3:
30
+ return "right";
31
+ case 4:
32
+ return "bottom";
33
+ case 5:
34
+ return "left";
35
+ default:
36
+ return void 0;
37
+ }
38
+ };
39
+ export {
40
+ APP_PAGE_SIDE_SLOTS,
41
+ DC_SLOT_ATTR,
42
+ SlotRegion,
43
+ parseSlotRegion,
44
+ resolveAppPageSlotName
45
+ };
@@ -0,0 +1,25 @@
1
+ const passwordRule = {
2
+ message: "限定20个以内字母、数字",
3
+ pattern: /^[0-9a-zA-Z]{0,20}$/,
4
+ trigger: "blur"
5
+ };
6
+ const getConfirmPasswordRule = (getPassword) => {
7
+ return {
8
+ validator: (_rule, value, callback) => {
9
+ if (value !== getPassword()) {
10
+ callback("两次输入密码不一致!");
11
+ } else {
12
+ callback();
13
+ }
14
+ },
15
+ trigger: "blur"
16
+ };
17
+ };
18
+ const FORM_CONFIG_SELECT_ALL_VALUE = `SELECT_ALL_${Date.now().toString(
19
+ 36
20
+ )}`;
21
+ export {
22
+ FORM_CONFIG_SELECT_ALL_VALUE,
23
+ getConfirmPasswordRule,
24
+ passwordRule
25
+ };
@@ -0,0 +1,10 @@
1
+ import { FORM_CONFIG_SELECT_ALL_VALUE, getConfirmPasswordRule, passwordRule } from "./form.mjs";
2
+ import { countAll, createListApi, fetchListAll } from "./list-helper.mjs";
3
+ export {
4
+ FORM_CONFIG_SELECT_ALL_VALUE,
5
+ countAll,
6
+ createListApi,
7
+ fetchListAll,
8
+ getConfirmPasswordRule,
9
+ passwordRule
10
+ };
@@ -0,0 +1,77 @@
1
+ const DEFAULT_PAGE_SIZE = 100;
2
+ const DEFAULT_LIMIT = 1e4;
3
+ async function fetchListAll(api, baseParams, opts) {
4
+ var _a;
5
+ const pageSize = (opts == null ? void 0 : opts.pageSize) ?? DEFAULT_PAGE_SIZE;
6
+ const limit = (opts == null ? void 0 : opts.limit) ?? DEFAULT_LIMIT;
7
+ if (pageSize < 1 || pageSize > 1e3) {
8
+ throw new Error(
9
+ `fetchListAll: pageSize 必须在 [1, 1000] 范围内(实际 ${pageSize})`
10
+ );
11
+ }
12
+ const all = [];
13
+ let page = 1;
14
+ while (true) {
15
+ const params = {
16
+ ...baseParams,
17
+ page: { page, pageSize }
18
+ };
19
+ const resp = await api(params);
20
+ const items = resp.items;
21
+ const totalRecord = ((_a = resp.page) == null ? void 0 : _a.totalRecord) ?? 0;
22
+ all.push(...items);
23
+ if (all.length >= limit) break;
24
+ if (items.length < pageSize) break;
25
+ if (all.length >= totalRecord) break;
26
+ page += 1;
27
+ }
28
+ return all.slice(0, limit);
29
+ }
30
+ function createListApi(source) {
31
+ return async (params) => {
32
+ const page = params.page;
33
+ if (!page) {
34
+ throw new Error("createListApi: params.page 必填(含 page / pageSize)");
35
+ }
36
+ const { page: pageNum, pageSize } = page;
37
+ if (!pageSize || pageSize <= 0) {
38
+ throw new Error("createListApi: pageSize 必须 > 0");
39
+ }
40
+ let list;
41
+ if (Array.isArray(source)) {
42
+ list = source;
43
+ } else {
44
+ const r = source();
45
+ if (r instanceof Promise) {
46
+ const awaited = await r;
47
+ if (!Array.isArray(awaited)) {
48
+ throw new Error("createListApi: 异步 source 返回值必须为数组");
49
+ }
50
+ list = awaited;
51
+ } else {
52
+ list = r;
53
+ }
54
+ }
55
+ const start = (pageNum - 1) * pageSize;
56
+ const end = start + pageSize;
57
+ return {
58
+ items: list.slice(start, end),
59
+ page: {
60
+ totalRecord: list.length,
61
+ pageSize,
62
+ totalPage: Math.ceil(list.length / pageSize)
63
+ }
64
+ };
65
+ };
66
+ }
67
+ function countAll(api, baseParams) {
68
+ return api({
69
+ ...baseParams,
70
+ page: { page: 1, pageSize: 1 }
71
+ }).then((r) => r.page.totalRecord);
72
+ }
73
+ export {
74
+ countAll,
75
+ createListApi,
76
+ fetchListAll
77
+ };
@@ -0,0 +1,64 @@
1
+ import { ref, computed, readonly, onMounted, onActivated, onDeactivated, onBeforeUnmount, watch } from "vue";
2
+ const useActivated = (watchFn) => {
3
+ const activatedInfo = ref({
4
+ isActivated: false,
5
+ triggerType: "mounted"
6
+ });
7
+ const isActivated = computed(() => activatedInfo.value.isActivated);
8
+ const activatedInfoReadonly = computed(() => readonly(activatedInfo.value));
9
+ const changeActivatedInfo = (info) => {
10
+ activatedInfo.value = info;
11
+ watchFn == null ? void 0 : watchFn(info);
12
+ };
13
+ onMounted(() => {
14
+ changeActivatedInfo({ isActivated: true, triggerType: "mounted" });
15
+ onActivated(() => {
16
+ changeActivatedInfo({ isActivated: true, triggerType: "activated" });
17
+ });
18
+ });
19
+ onDeactivated(() => {
20
+ changeActivatedInfo({ isActivated: false, triggerType: "deactivated" });
21
+ });
22
+ onBeforeUnmount(() => {
23
+ changeActivatedInfo({ isActivated: false, triggerType: "unmounted" });
24
+ });
25
+ return {
26
+ isActivated,
27
+ activatedInfo: activatedInfoReadonly
28
+ };
29
+ };
30
+ const useActivatedExec = (callback) => {
31
+ const { activatedInfo } = useActivated();
32
+ watch(
33
+ activatedInfo,
34
+ (info) => {
35
+ if (info.isActivated) {
36
+ callback(info);
37
+ }
38
+ },
39
+ {
40
+ immediate: true
41
+ }
42
+ );
43
+ };
44
+ const useActivatedEvent = (bind, unbind) => {
45
+ const { activatedInfo } = useActivated();
46
+ watch(
47
+ activatedInfo,
48
+ (info) => {
49
+ if (info.isActivated) {
50
+ bind(info);
51
+ } else {
52
+ unbind(info);
53
+ }
54
+ },
55
+ {
56
+ immediate: true
57
+ }
58
+ );
59
+ };
60
+ export {
61
+ useActivated,
62
+ useActivatedEvent,
63
+ useActivatedExec
64
+ };
@@ -0,0 +1,46 @@
1
+ import { shallowRef, ref, onBeforeMount, computed } from "vue";
2
+ const useFeelSize = () => {
3
+ const el = shallowRef();
4
+ const sizeInfo = ref();
5
+ const resizeObserver = new ResizeObserver((entries) => {
6
+ for (const entry of entries) {
7
+ const { target, contentRect } = entry;
8
+ if (target === el.value) {
9
+ sizeInfo.value = {
10
+ width: contentRect.width,
11
+ height: contentRect.height
12
+ };
13
+ }
14
+ }
15
+ });
16
+ const unwatchDom = () => {
17
+ if (el.value) {
18
+ resizeObserver.unobserve(el.value);
19
+ el.value = void 0;
20
+ sizeInfo.value = void 0;
21
+ }
22
+ };
23
+ const watchDom = (dom) => {
24
+ if (dom === el.value) return;
25
+ unwatchDom();
26
+ resizeObserver.observe(dom);
27
+ el.value = dom;
28
+ sizeInfo.value = {
29
+ width: dom.offsetWidth,
30
+ height: dom.offsetHeight
31
+ };
32
+ };
33
+ onBeforeMount(() => {
34
+ unwatchDom();
35
+ resizeObserver.disconnect();
36
+ });
37
+ return {
38
+ unwatchDom,
39
+ watchDom,
40
+ /** 元素尺寸信息只读属性 */
41
+ sizeInfo: computed(() => sizeInfo.value)
42
+ };
43
+ };
44
+ export {
45
+ useFeelSize
46
+ };
@@ -0,0 +1,31 @@
1
+ import { useBreakpoint } from "./use-breakpoint.mjs";
2
+ import { resolveBreakpointByWidth, resolveRootEl, useCustomBreakpoint } from "./use-custom-breakpoint.mjs";
3
+ import { useActivated, useActivatedEvent, useActivatedExec } from "./activated.mjs";
4
+ import { useFeelSize } from "./feel-size.mjs";
5
+ import { useMenusDataDispatch } from "./menus-dispatch.mjs";
6
+ import { useTimeout } from "./timeout.mjs";
7
+ import { useChannelViewportHeight } from "./use-channel-viewport-height.mjs";
8
+ import { useObserveSize } from "./use-observe-size.mjs";
9
+ import { usePermission } from "./use-permission.mjs";
10
+ import { buildRhythmCss, useCoreThemeApply } from "./use-theme-apply.mjs";
11
+ import { useCoreViewportApply } from "./use-viewport-apply.mjs";
12
+ import { useBridgeReport } from "./use-bridge-report.mjs";
13
+ export {
14
+ buildRhythmCss,
15
+ resolveBreakpointByWidth,
16
+ resolveRootEl,
17
+ useActivated,
18
+ useActivatedEvent,
19
+ useActivatedExec,
20
+ useBreakpoint,
21
+ useBridgeReport,
22
+ useChannelViewportHeight,
23
+ useCoreThemeApply,
24
+ useCoreViewportApply,
25
+ useCustomBreakpoint,
26
+ useFeelSize,
27
+ useMenusDataDispatch,
28
+ useObserveSize,
29
+ usePermission,
30
+ useTimeout
31
+ };