@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.
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/es/bridge/badge.mjs +37 -0
- package/es/bridge/config-hook.mjs +58 -0
- package/es/bridge/contracts/event.mjs +102 -0
- package/es/bridge/contracts/index.mjs +5 -0
- package/es/bridge/event.mjs +87 -0
- package/es/bridge/index.mjs +331 -0
- package/es/bridge/layout.mjs +100 -0
- package/es/bridge/permission.mjs +91 -0
- package/es/bridge/plugin.mjs +39 -0
- package/es/bridge/route.mjs +78 -0
- package/es/bridge/state.mjs +61 -0
- package/es/bridge/storage.mjs +26 -0
- package/es/bridge/theme/index.mjs +233 -0
- package/es/bridge/theme/persist.mjs +18 -0
- package/es/bridge/theme/system-dark.mjs +18 -0
- package/es/components/basic/AppCollapseToggle.vue.mjs +7 -0
- package/es/components/basic/AppCollapseToggle.vue2.mjs +63 -0
- package/es/components/basic/action-btn/ActionBtn.vue.mjs +200 -0
- package/es/components/basic/action-btn/ActionBtn.vue2.mjs +4 -0
- package/es/components/basic/action-btn/index.mjs +4 -0
- package/es/components/basic/action-btn/use-action-btn-report.mjs +54 -0
- package/es/components/basic/action-btn-group/ActionBtnGroup.vue.mjs +69 -0
- package/es/components/basic/action-btn-group/ActionBtnGroup.vue2.mjs +4 -0
- package/es/components/basic/action-btn-group/index.mjs +4 -0
- package/es/components/basic/action-btn-group/use-action-btn-group-report.mjs +30 -0
- package/es/components/basic/display-contracts/index.mjs +1 -0
- package/es/components/basic/drag-float/DragFloat.vue.mjs +7 -0
- package/es/components/basic/drag-float/DragFloat.vue2.mjs +109 -0
- package/es/components/basic/drag-float/index.mjs +4 -0
- package/es/components/basic/height-provider/HeightProvider.vue.mjs +62 -0
- package/es/components/basic/height-provider/HeightProvider.vue2.mjs +4 -0
- package/es/components/basic/height-provider/index.mjs +4 -0
- package/es/components/basic/index.mjs +4 -0
- package/es/components/basic/shadow-clone/ShadowClone.vue.mjs +32 -0
- package/es/components/basic/shadow-clone/ShadowClone.vue2.mjs +4 -0
- package/es/components/basic/shadow-clone/index.mjs +4 -0
- package/es/components/basic/shadow-clone/use-shadow-target.mjs +76 -0
- package/es/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue.mjs +7 -0
- package/es/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue2.mjs +68 -0
- package/es/components/basic/slot-layout-flow-aside/index.mjs +4 -0
- package/es/components/basic/slot-layout-template/SlotLayoutTemplate.vue.mjs +30 -0
- package/es/components/basic/slot-layout-template/SlotLayoutTemplate.vue2.mjs +4 -0
- package/es/components/basic/slot-layout-template/index.mjs +4 -0
- package/es/components/basic/watch-size/WatchSize.vue.mjs +73 -0
- package/es/components/basic/watch-size/WatchSize.vue2.mjs +4 -0
- package/es/components/basic/watch-size/index.mjs +4 -0
- package/es/components/config/app-theme/AppTheme.vue.mjs +7 -0
- package/es/components/config/app-theme/AppTheme.vue2.mjs +82 -0
- package/es/components/config/app-theme/index.mjs +4 -0
- package/es/components/data/badge-mark/BadgeMark.vue.mjs +7 -0
- package/es/components/data/badge-mark/BadgeMark.vue2.mjs +80 -0
- package/es/components/data/badge-mark/index.mjs +4 -0
- package/es/components/data/badge-mark/use-badge-mask.mjs +82 -0
- package/es/components/data/badge-mark/use-badge.mjs +106 -0
- package/es/components/data/boolean-tag/BooleanTag.vue.mjs +36 -0
- package/es/components/data/boolean-tag/BooleanTag.vue2.mjs +4 -0
- package/es/components/data/boolean-tag/index.mjs +4 -0
- package/es/components/data/image-preview-trigger/ImagePreviewTrigger.vue.mjs +38 -0
- package/es/components/data/image-preview-trigger/ImagePreviewTrigger.vue2.mjs +4 -0
- package/es/components/data/image-preview-trigger/index.mjs +4 -0
- package/es/components/data/modal-image-preview/ModalImagePreview.vue.mjs +52 -0
- package/es/components/data/modal-image-preview/ModalImagePreview.vue2.mjs +4 -0
- package/es/components/data/modal-image-preview/index.mjs +4 -0
- package/es/components/feedback/action-confirm/ActionConfirm.vue.mjs +7 -0
- package/es/components/feedback/action-confirm/ActionConfirm.vue2.mjs +143 -0
- package/es/components/feedback/action-confirm/index.mjs +4 -0
- package/es/components/feedback/modal-confirm/ModalConfirm.vue.mjs +8 -0
- package/es/components/feedback/modal-confirm/ModalConfirm.vue2.mjs +243 -0
- package/es/components/feedback/modal-confirm/index.mjs +4 -0
- package/es/components/feedback/modal-video-preview/ModalVideoPreview.vue.mjs +8 -0
- package/es/components/feedback/modal-video-preview/ModalVideoPreview.vue2.mjs +93 -0
- package/es/components/feedback/modal-video-preview/index.mjs +4 -0
- package/es/components/feedback/preview-keys/index.mjs +7 -0
- package/es/components/feedback/preview-keys/keys.mjs +7 -0
- package/es/components/feedback/shelf-contracts/index.mjs +1 -0
- package/es/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue.mjs +7 -0
- package/es/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue2.mjs +133 -0
- package/es/components/feedback/video-preview-trigger/index.mjs +4 -0
- package/es/components/other/TriggerAutoImport.vue.mjs +12 -0
- package/es/components/other/TriggerAutoImport.vue2.mjs +4 -0
- package/es/components/other/auto-refresh/AutoRefresh.vue.mjs +7 -0
- package/es/components/other/auto-refresh/AutoRefresh.vue2.mjs +96 -0
- package/es/components/other/auto-refresh/index.mjs +4 -0
- package/es/components/other/auto-refresh/use-auto-refresh-report.mjs +31 -0
- package/es/components/other/auto-refresh-contracts/index.mjs +1 -0
- package/es/components/other/auto-refresh-group/AutoRefreshGroup.vue.mjs +7 -0
- package/es/components/other/auto-refresh-group/AutoRefreshGroup.vue2.mjs +69 -0
- package/es/components/other/auto-refresh-group/index.mjs +4 -0
- package/es/components/other/auto-refresh-group/use-auto-refresh-group-report.mjs +12 -0
- package/es/components/other/index.mjs +4 -0
- package/es/config/badge-attr.mjs +6 -0
- package/es/config/index.mjs +19 -0
- package/es/config/list-model.mjs +13 -0
- package/es/config/modal-keys.mjs +6 -0
- package/es/config/route.mjs +6 -0
- package/es/config/slot-region.mjs +45 -0
- package/es/helpers/form.mjs +25 -0
- package/es/helpers/index.mjs +10 -0
- package/es/helpers/list-helper.mjs +77 -0
- package/es/hooks/activated.mjs +64 -0
- package/es/hooks/feel-size.mjs +46 -0
- package/es/hooks/index.mjs +31 -0
- package/es/hooks/menus-dispatch.mjs +85 -0
- package/es/hooks/timeout.mjs +36 -0
- package/es/hooks/use-active-record.mjs +104 -0
- package/es/hooks/use-breakpoint.mjs +48 -0
- package/es/hooks/use-bridge-report.mjs +12 -0
- package/es/hooks/use-channel-viewport-height.mjs +43 -0
- package/es/hooks/use-context-defaults.mjs +44 -0
- package/es/hooks/use-custom-breakpoint.mjs +69 -0
- package/es/hooks/use-is-dev.mjs +16 -0
- package/es/hooks/use-observe-size.mjs +43 -0
- package/es/hooks/use-permission.mjs +12 -0
- package/es/hooks/use-surface.mjs +35 -0
- package/es/hooks/use-theme-apply.mjs +496 -0
- package/es/hooks/use-viewport-apply.mjs +52 -0
- package/es/index.mjs +179 -0
- package/es/inject/index.mjs +19 -0
- package/es/inject/key.mjs +70 -0
- package/es/injection-namespace.mjs +4 -0
- package/es/internals/index.mjs +16 -0
- package/es/router/group-redirect.mjs +26 -0
- package/es/router/guard/index.mjs +36 -0
- package/es/router/guard/login.mjs +6 -0
- package/es/router/guard/permission.mjs +6 -0
- package/es/router/index.mjs +10 -0
- package/es/store/app.mjs +306 -0
- package/es/store/index.mjs +8 -0
- package/es/store/router-permission.mjs +94 -0
- package/es/store/user.mjs +128 -0
- package/es/style.css +339 -0
- package/es/types/index.mjs +1 -0
- package/es/utils/dom.mjs +42 -0
- package/es/utils/export.mjs +39 -0
- package/es/utils/gap-scale.mjs +25 -0
- package/es/utils/id.mjs +7 -0
- package/es/utils/index.mjs +37 -0
- package/es/utils/permission.mjs +31 -0
- package/es/utils/router.mjs +42 -0
- package/es/utils/theme-scale.mjs +86 -0
- package/es/utils/time.mjs +24 -0
- package/package.json +232 -1
- package/types/bridge/badge.d.ts +215 -0
- package/types/bridge/config-hook.d.ts +12 -0
- package/types/bridge/contracts/bridge.d.ts +339 -0
- package/types/bridge/contracts/config.d.ts +519 -0
- package/types/bridge/contracts/event.d.ts +546 -0
- package/types/bridge/contracts/index.d.ts +3 -0
- package/types/bridge/event.d.ts +3 -0
- package/types/bridge/index.d.ts +28 -0
- package/types/bridge/layout.d.ts +102 -0
- package/types/bridge/permission.d.ts +31 -0
- package/types/bridge/plugin.d.ts +11 -0
- package/types/bridge/route.d.ts +36 -0
- package/types/bridge/state.d.ts +26 -0
- package/types/bridge/storage.d.ts +10 -0
- package/types/bridge/theme/index.d.ts +10 -0
- package/types/bridge/theme/persist.d.ts +23 -0
- package/types/bridge/theme/system-dark.d.ts +14 -0
- package/types/bridge/theme/types.d.ts +346 -0
- package/types/components/basic/AppCollapseToggle.vue.d.ts +14 -0
- package/types/components/basic/action-btn/ActionBtn.vue.d.ts +19 -0
- package/types/components/basic/action-btn/index.d.ts +1 -0
- package/types/components/basic/action-btn/use-action-btn-report.d.ts +12 -0
- package/types/components/basic/action-btn-group/ActionBtnGroup.vue.d.ts +18 -0
- package/types/components/basic/action-btn-group/index.d.ts +1 -0
- package/types/components/basic/action-btn-group/use-action-btn-group-report.d.ts +6 -0
- package/types/components/basic/display-contracts/index.d.ts +1 -0
- package/types/components/basic/display-contracts/types.d.ts +280 -0
- package/types/components/basic/drag-float/DragFloat.vue.d.ts +35 -0
- package/types/components/basic/drag-float/index.d.ts +1 -0
- package/types/components/basic/height-provider/HeightProvider.vue.d.ts +28 -0
- package/types/components/basic/height-provider/index.d.ts +1 -0
- package/types/components/basic/index.d.ts +1 -0
- package/types/components/basic/shadow-clone/ShadowClone.vue.d.ts +20 -0
- package/types/components/basic/shadow-clone/index.d.ts +1 -0
- package/types/components/basic/shadow-clone/use-shadow-target.d.ts +9 -0
- package/types/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue.d.ts +32 -0
- package/types/components/basic/slot-layout-flow-aside/index.d.ts +2 -0
- package/types/components/basic/slot-layout-flow-aside/types.d.ts +10 -0
- package/types/components/basic/slot-layout-template/SlotLayoutTemplate.vue.d.ts +48 -0
- package/types/components/basic/slot-layout-template/index.d.ts +1 -0
- package/types/components/basic/watch-size/WatchSize.vue.d.ts +45 -0
- package/types/components/basic/watch-size/index.d.ts +1 -0
- package/types/components/config/app-theme/AppTheme.vue.d.ts +2 -0
- package/types/components/config/app-theme/index.d.ts +1 -0
- package/types/components/data/badge-mark/BadgeMark.vue.d.ts +212 -0
- package/types/components/data/badge-mark/index.d.ts +1 -0
- package/types/components/data/badge-mark/use-badge-mask.d.ts +8 -0
- package/types/components/data/badge-mark/use-badge.d.ts +78 -0
- package/types/components/data/boolean-tag/BooleanTag.vue.d.ts +8 -0
- package/types/components/data/boolean-tag/index.d.ts +1 -0
- package/types/components/data/image-preview-trigger/ImagePreviewTrigger.vue.d.ts +41 -0
- package/types/components/data/image-preview-trigger/index.d.ts +1 -0
- package/types/components/data/modal-image-preview/ModalImagePreview.vue.d.ts +31 -0
- package/types/components/data/modal-image-preview/index.d.ts +1 -0
- package/types/components/feedback/action-confirm/ActionConfirm.vue.d.ts +33 -0
- package/types/components/feedback/action-confirm/index.d.ts +1 -0
- package/types/components/feedback/modal-confirm/ModalConfirm.vue.d.ts +120 -0
- package/types/components/feedback/modal-confirm/index.d.ts +2 -0
- package/types/components/feedback/modal-confirm/types.d.ts +4 -0
- package/types/components/feedback/modal-video-preview/ModalVideoPreview.vue.d.ts +40 -0
- package/types/components/feedback/modal-video-preview/index.d.ts +1 -0
- package/types/components/feedback/preview-keys/index.d.ts +2 -0
- package/types/components/feedback/preview-keys/keys.d.ts +14 -0
- package/types/components/feedback/shelf-contracts/index.d.ts +1 -0
- package/types/components/feedback/shelf-contracts/types.d.ts +1 -0
- package/types/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue.d.ts +46 -0
- package/types/components/feedback/video-preview-trigger/index.d.ts +1 -0
- package/types/components/other/TriggerAutoImport.vue.d.ts +17 -0
- package/types/components/other/auto-refresh/AutoRefresh.vue.d.ts +14 -0
- package/types/components/other/auto-refresh/index.d.ts +1 -0
- package/types/components/other/auto-refresh/use-auto-refresh-report.d.ts +1 -0
- package/types/components/other/auto-refresh-contracts/index.d.ts +1 -0
- package/types/components/other/auto-refresh-contracts/types.d.ts +17 -0
- package/types/components/other/auto-refresh-group/AutoRefreshGroup.vue.d.ts +18 -0
- package/types/components/other/auto-refresh-group/index.d.ts +1 -0
- package/types/components/other/auto-refresh-group/use-auto-refresh-group-report.d.ts +3 -0
- package/types/components/other/index.d.ts +1 -0
- package/types/config/badge-attr.d.ts +26 -0
- package/types/config/index.d.ts +5 -0
- package/types/config/list-model.d.ts +49 -0
- package/types/config/modal-keys.d.ts +12 -0
- package/types/config/route.d.ts +4 -0
- package/types/config/slot-region.d.ts +72 -0
- package/types/helpers/form.d.ts +8 -0
- package/types/helpers/index.d.ts +3 -0
- package/types/helpers/list-helper.d.ts +35 -0
- package/types/helpers/types.d.ts +15 -0
- package/types/hooks/activated.d.ts +36 -0
- package/types/hooks/feel-size.d.ts +10 -0
- package/types/hooks/index.d.ts +12 -0
- package/types/hooks/menus-dispatch.d.ts +35 -0
- package/types/hooks/timeout.d.ts +7 -0
- package/types/hooks/use-active-record.d.ts +64 -0
- package/types/hooks/use-breakpoint.d.ts +4 -0
- package/types/hooks/use-bridge-report.d.ts +3 -0
- package/types/hooks/use-channel-viewport-height.d.ts +22 -0
- package/types/hooks/use-context-defaults.d.ts +39 -0
- package/types/hooks/use-custom-breakpoint.d.ts +17 -0
- package/types/hooks/use-is-dev.d.ts +24 -0
- package/types/hooks/use-observe-size.d.ts +36 -0
- package/types/hooks/use-permission.d.ts +14 -0
- package/types/hooks/use-surface.d.ts +45 -0
- package/types/hooks/use-theme-apply.d.ts +34 -0
- package/types/hooks/use-viewport-apply.d.ts +20 -0
- package/types/index.d.ts +33 -0
- package/types/inject/index.d.ts +1 -0
- package/types/inject/key.d.ts +247 -0
- package/types/injection-namespace.d.ts +4 -0
- package/types/internals/index.d.ts +6 -0
- package/types/router/group-redirect.d.ts +14 -0
- package/types/router/guard/index.d.ts +20 -0
- package/types/router/guard/login.d.ts +4 -0
- package/types/router/guard/permission.d.ts +4 -0
- package/types/router/guard/types.d.ts +14 -0
- package/types/router/index.d.ts +2 -0
- package/types/store/app.d.ts +219 -0
- package/types/store/index.d.ts +3 -0
- package/types/store/router-permission.d.ts +79 -0
- package/types/store/user.d.ts +64 -0
- package/types/types/app-layout.d.ts +42 -0
- package/types/types/dc-path.d.ts +2 -0
- package/types/types/dot-path.d.ts +13 -0
- package/types/types/index.d.ts +9 -0
- package/types/types/list-api.d.ts +17 -0
- package/types/types/modal-shelf.d.ts +123 -0
- package/types/types/nest-form.d.ts +8 -0
- package/types/types/permission.d.ts +31 -0
- package/types/types/route.d.ts +141 -0
- package/types/types/utility-types.d.ts +25 -0
- package/types/utils/dom.d.ts +61 -0
- package/types/utils/export.d.ts +35 -0
- package/types/utils/gap-scale.d.ts +46 -0
- package/types/utils/id.d.ts +2 -0
- package/types/utils/index.d.ts +8 -0
- package/types/utils/permission.d.ts +16 -0
- package/types/utils/router.d.ts +18 -0
- package/types/utils/theme-scale.d.ts +78 -0
- package/types/utils/time.d.ts +2 -0
package/es/style.css
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
.confirm-modal__title[data-v-5833c7fa] {
|
|
2
|
+
font-size: 16px;
|
|
3
|
+
font-weight: 600;
|
|
4
|
+
line-height: 24px;
|
|
5
|
+
color: var(--el-text-color-primary);
|
|
6
|
+
text-align: left;
|
|
7
|
+
}
|
|
8
|
+
.confirm-modal__content[data-v-5833c7fa] {
|
|
9
|
+
overflow-x: hidden;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
max-height: calc(100vh - 200px);
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
line-height: 22px;
|
|
14
|
+
color: var(--el-text-color-regular);
|
|
15
|
+
text-align: left;
|
|
16
|
+
word-break: break-word;
|
|
17
|
+
}
|
|
18
|
+
.confirm-modal__content_drawer[data-v-5833c7fa] {
|
|
19
|
+
max-height: none;
|
|
20
|
+
height: 100%;
|
|
21
|
+
}
|
|
22
|
+
.confirm-modal__footer[data-v-5833c7fa] {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
}
|
|
28
|
+
.confirm-modal__footer[data-v-5833c7fa] .el-button {
|
|
29
|
+
min-width: 72px;
|
|
30
|
+
}
|
|
31
|
+
.confirm-modal__footer[reverse="true"][data-v-5833c7fa] {
|
|
32
|
+
flex-direction: row-reverse;
|
|
33
|
+
}
|
|
34
|
+
.dc-confirm-modal.el-drawer .el-drawer__header {
|
|
35
|
+
margin-bottom: 0;
|
|
36
|
+
padding: var(--dc-confirm-modal-pad-chrome-y, 12px) var(--dc-confirm-modal-pad-x, 16px);
|
|
37
|
+
color: var(--el-text-color-primary);
|
|
38
|
+
background: var(--dc-core-surface, var(--el-bg-color));
|
|
39
|
+
}
|
|
40
|
+
.dc-confirm-modal.el-drawer .el-drawer__body {
|
|
41
|
+
padding: var(--dc-confirm-modal-pad-body-y, 16px) var(--dc-confirm-modal-pad-x, 16px);
|
|
42
|
+
background: var(--dc-core-ground, var(--el-bg-color-page));
|
|
43
|
+
}
|
|
44
|
+
.dc-confirm-modal.el-drawer .el-drawer__footer {
|
|
45
|
+
padding: var(--dc-confirm-modal-pad-chrome-y, 12px) var(--dc-confirm-modal-pad-x, 16px);
|
|
46
|
+
background: var(--dc-core-surface, var(--el-bg-color));
|
|
47
|
+
}
|
|
48
|
+
.dc-confirm-modal.confirm-modal_hidden-header .el-dialog__header {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
.dc-confirm-modal.confirm-modal_header-divider .el-drawer__header,
|
|
52
|
+
.dc-confirm-modal.confirm-modal_header-divider .el-dialog__header {
|
|
53
|
+
border-bottom: 1px solid var(--dc-core-border-color, var(--el-border-color));
|
|
54
|
+
}
|
|
55
|
+
.dc-confirm-modal.confirm-modal_footer-divider .el-drawer__footer,
|
|
56
|
+
.dc-confirm-modal.confirm-modal_footer-divider .el-dialog__footer {
|
|
57
|
+
border-top: 1px solid var(--dc-core-border-color, var(--el-border-color));
|
|
58
|
+
}
|
|
59
|
+
.action-confirm__title[data-v-c0d5aca5] {
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
margin-bottom: 6px;
|
|
62
|
+
}
|
|
63
|
+
.action-confirm__content[data-v-c0d5aca5] {
|
|
64
|
+
margin-bottom: 12px;
|
|
65
|
+
color: var(--el-text-color-regular);
|
|
66
|
+
}
|
|
67
|
+
.action-confirm__actions[data-v-c0d5aca5] {
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
gap: 8px;
|
|
71
|
+
}
|
|
72
|
+
.badge-mark[data-v-7cf20885] .el-badge__content.is-fixed {
|
|
73
|
+
right: 0;
|
|
74
|
+
transform: translateY(-50%) translateX(calc(100% + 2px));
|
|
75
|
+
}
|
|
76
|
+
.badge-mark_middle[data-v-7cf20885] .el-badge__content.is-fixed {
|
|
77
|
+
top: 50%;
|
|
78
|
+
}
|
|
79
|
+
.badge-mark_hidden[data-v-7cf20885] .el-badge__content {
|
|
80
|
+
width: 0;
|
|
81
|
+
height: 0;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
padding: 0;
|
|
84
|
+
border-width: 0;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
}
|
|
88
|
+
.drag-float[data-v-77c2e755] {
|
|
89
|
+
position: absolute;
|
|
90
|
+
z-index: 3;
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
touch-action: none;
|
|
96
|
+
user-select: none;
|
|
97
|
+
}
|
|
98
|
+
.drag-float_dragging[data-v-77c2e755] {
|
|
99
|
+
cursor: grabbing;
|
|
100
|
+
}
|
|
101
|
+
.drag-float_breathing[data-v-77c2e755]::after {
|
|
102
|
+
content: "";
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset: 0;
|
|
105
|
+
border-radius: inherit;
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
box-shadow: 0 0 10px 3px var(--dc-core-primary-color-light-5, var(--el-color-primary-light-5));
|
|
108
|
+
animation: dc-drag-float-breath-77c2e755 2.6s ease-in-out infinite;
|
|
109
|
+
}
|
|
110
|
+
@keyframes dc-drag-float-breath-77c2e755 {
|
|
111
|
+
0%,
|
|
112
|
+
100% {
|
|
113
|
+
opacity: 0.15;
|
|
114
|
+
}
|
|
115
|
+
50% {
|
|
116
|
+
opacity: 0.7;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
@media (prefers-reduced-motion: reduce) {
|
|
120
|
+
.drag-float_breathing[data-v-77c2e755]::after {
|
|
121
|
+
animation: none;
|
|
122
|
+
opacity: 0.3;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
.app-collapse-toggle[data-v-eb97134e] {
|
|
126
|
+
position: absolute;
|
|
127
|
+
top: 50%;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
width: 14px;
|
|
130
|
+
height: 44px;
|
|
131
|
+
border-radius: 7px;
|
|
132
|
+
background-color: var(--dc-core-surface, var(--el-bg-color-overlay));
|
|
133
|
+
border: 1px solid var(--dc-core-border-color, var(--el-border-color));
|
|
134
|
+
color: var(--el-text-color-regular);
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
font-size: 12px;
|
|
139
|
+
z-index: 1;
|
|
140
|
+
opacity: 1;
|
|
141
|
+
box-shadow: none;
|
|
142
|
+
transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
|
|
143
|
+
}
|
|
144
|
+
.app-collapse-toggle--sidebar[data-v-eb97134e] {
|
|
145
|
+
left: 100%;
|
|
146
|
+
transform: translate(-50%, -50%);
|
|
147
|
+
}
|
|
148
|
+
.app-collapse-toggle--aside[data-v-eb97134e] {
|
|
149
|
+
right: 100%;
|
|
150
|
+
transform: translate(50%, -50%);
|
|
151
|
+
}
|
|
152
|
+
.app-collapse-toggle[data-v-eb97134e]:hover,
|
|
153
|
+
.app-collapse-toggle[data-v-eb97134e]:focus-visible {
|
|
154
|
+
opacity: 1;
|
|
155
|
+
color: var(--el-text-color-primary);
|
|
156
|
+
border-color: var(--dc-core-border-color, var(--el-border-color));
|
|
157
|
+
box-shadow: var(--el-box-shadow-lighter);
|
|
158
|
+
}
|
|
159
|
+
.app-collapse-toggle[data-v-eb97134e]:active {
|
|
160
|
+
border-color: var(--dc-core-primary-color, var(--el-color-primary));
|
|
161
|
+
}
|
|
162
|
+
.app-collapse-toggle__icon[data-v-eb97134e] {
|
|
163
|
+
transition: transform 0.3s;
|
|
164
|
+
}
|
|
165
|
+
.dc-slot-layout-flow-aside_separate[data-v-822351cd] {
|
|
166
|
+
position: relative;
|
|
167
|
+
}
|
|
168
|
+
.dc-slot-layout-flow-aside_separate_left[data-v-822351cd] {
|
|
169
|
+
padding-left: calc(var(--v7c7b61da) - 1px);
|
|
170
|
+
}
|
|
171
|
+
.dc-slot-layout-flow-aside_separate_right[data-v-822351cd] {
|
|
172
|
+
padding-right: calc(var(--v7c7b61da) - 1px);
|
|
173
|
+
}
|
|
174
|
+
.dc-slot-layout-flow-aside-aside[data-v-822351cd] {
|
|
175
|
+
width: var(--v7c7b61da);
|
|
176
|
+
}
|
|
177
|
+
.dc-slot-layout-flow-aside-aside_left[data-v-822351cd],
|
|
178
|
+
.dc-slot-layout-flow-aside-aside_right[data-v-822351cd] {
|
|
179
|
+
position: absolute;
|
|
180
|
+
top: 0;
|
|
181
|
+
max-height: min(100%, var(--v11c8dc82));
|
|
182
|
+
overflow-y: auto;
|
|
183
|
+
}
|
|
184
|
+
.dc-slot-layout-flow-aside-aside_left[data-v-822351cd] {
|
|
185
|
+
left: 0;
|
|
186
|
+
}
|
|
187
|
+
.dc-slot-layout-flow-aside-aside_right[data-v-822351cd] {
|
|
188
|
+
right: 0;
|
|
189
|
+
}
|
|
190
|
+
.dc-slot-layout-flow-aside-main[data-v-822351cd] {
|
|
191
|
+
width: var(--v6a96241f);
|
|
192
|
+
}
|
|
193
|
+
.app-theme[data-v-003295e9] {
|
|
194
|
+
display: inline-flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: 12px;
|
|
197
|
+
margin-right: 12px;
|
|
198
|
+
}
|
|
199
|
+
.app-theme__style-select[data-v-003295e9] {
|
|
200
|
+
width: 120px;
|
|
201
|
+
}
|
|
202
|
+
.modal-video-preview__stage[data-v-285cb9d9] {
|
|
203
|
+
height: 100vh;
|
|
204
|
+
display: flex;
|
|
205
|
+
align-items: center;
|
|
206
|
+
justify-content: center;
|
|
207
|
+
background: var(--el-color-black);
|
|
208
|
+
}
|
|
209
|
+
.modal-video-preview__shim[data-v-285cb9d9] {
|
|
210
|
+
width: min(960px, 100%);
|
|
211
|
+
aspect-ratio: 16 / 9;
|
|
212
|
+
}
|
|
213
|
+
.modal-video-preview__video[data-v-285cb9d9] {
|
|
214
|
+
display: block;
|
|
215
|
+
width: 100%;
|
|
216
|
+
height: 100%;
|
|
217
|
+
background: var(--el-color-black);
|
|
218
|
+
}
|
|
219
|
+
.dc-modal-video-preview.el-dialog {
|
|
220
|
+
background: transparent;
|
|
221
|
+
box-shadow: none;
|
|
222
|
+
border: none;
|
|
223
|
+
border-radius: 0;
|
|
224
|
+
overflow: visible;
|
|
225
|
+
padding: 0;
|
|
226
|
+
}
|
|
227
|
+
.dc-modal-video-preview.el-dialog .el-dialog__header {
|
|
228
|
+
padding: 0;
|
|
229
|
+
}
|
|
230
|
+
.dc-modal-video-preview.el-dialog .el-dialog__body {
|
|
231
|
+
padding: 0;
|
|
232
|
+
}
|
|
233
|
+
.dc-modal-video-preview.el-dialog .el-dialog__headerbtn {
|
|
234
|
+
top: 40px;
|
|
235
|
+
right: 40px;
|
|
236
|
+
width: 44px;
|
|
237
|
+
height: 44px;
|
|
238
|
+
border-radius: 50%;
|
|
239
|
+
background: #606266;
|
|
240
|
+
color: var(--el-color-white);
|
|
241
|
+
opacity: 0.9;
|
|
242
|
+
transition: opacity 0.2s;
|
|
243
|
+
}
|
|
244
|
+
.dc-modal-video-preview.el-dialog .el-dialog__headerbtn:hover {
|
|
245
|
+
opacity: 1;
|
|
246
|
+
}
|
|
247
|
+
.dc-modal-video-preview.el-dialog .el-dialog__headerbtn .el-dialog__close {
|
|
248
|
+
color: inherit;
|
|
249
|
+
font-size: 24px;
|
|
250
|
+
}
|
|
251
|
+
.dc-modal-video-preview__overlay {
|
|
252
|
+
background: var(--el-overlay-color-dark, rgba(0, 0, 0, 0.7));
|
|
253
|
+
}
|
|
254
|
+
.video-preview-trigger_placeholder[data-v-0ea80546] {
|
|
255
|
+
display: flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
justify-content: center;
|
|
258
|
+
width: 100%;
|
|
259
|
+
aspect-ratio: 16 / 9;
|
|
260
|
+
max-width: 360px;
|
|
261
|
+
background: var(--el-fill-color-dark);
|
|
262
|
+
border-radius: var(--dc-core-radius, var(--el-border-radius-base));
|
|
263
|
+
cursor: pointer;
|
|
264
|
+
transition: background-color 0.2s;
|
|
265
|
+
}
|
|
266
|
+
.video-preview-trigger_placeholder[data-v-0ea80546]:hover {
|
|
267
|
+
background: var(--el-fill-color-darker);
|
|
268
|
+
}
|
|
269
|
+
.video-preview-trigger_cover[data-v-0ea80546],
|
|
270
|
+
.video-preview-trigger_frame[data-v-0ea80546] {
|
|
271
|
+
position: relative;
|
|
272
|
+
display: inline-block;
|
|
273
|
+
line-height: 0;
|
|
274
|
+
border-radius: var(--dc-core-radius, var(--el-border-radius-base));
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
cursor: pointer;
|
|
277
|
+
}
|
|
278
|
+
.video-preview-trigger_cover .video-preview-trigger__cover[data-v-0ea80546],
|
|
279
|
+
.video-preview-trigger_frame .video-preview-trigger__cover[data-v-0ea80546] {
|
|
280
|
+
display: block;
|
|
281
|
+
}
|
|
282
|
+
.video-preview-trigger_frame[data-v-0ea80546] {
|
|
283
|
+
width: 100%;
|
|
284
|
+
max-width: 360px;
|
|
285
|
+
aspect-ratio: 16 / 9;
|
|
286
|
+
background: var(--el-fill-color-dark);
|
|
287
|
+
}
|
|
288
|
+
.video-preview-trigger_frame .video-preview-trigger__frame[data-v-0ea80546] {
|
|
289
|
+
display: block;
|
|
290
|
+
width: 100%;
|
|
291
|
+
height: 100%;
|
|
292
|
+
object-fit: cover;
|
|
293
|
+
}
|
|
294
|
+
.video-preview-trigger__play-badge[data-v-0ea80546] {
|
|
295
|
+
position: absolute;
|
|
296
|
+
top: 50%;
|
|
297
|
+
left: 50%;
|
|
298
|
+
transform: translate(-50%, -50%);
|
|
299
|
+
display: flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
justify-content: center;
|
|
302
|
+
width: 48px;
|
|
303
|
+
height: 48px;
|
|
304
|
+
border-radius: 50%;
|
|
305
|
+
background: var(--el-overlay-color-light, rgba(0, 0, 0, 0.35));
|
|
306
|
+
color: var(--el-color-white);
|
|
307
|
+
pointer-events: none;
|
|
308
|
+
transition: transform 0.2s;
|
|
309
|
+
}
|
|
310
|
+
.video-preview-trigger_cover:hover .video-preview-trigger__play-badge[data-v-0ea80546],
|
|
311
|
+
.video-preview-trigger_frame:hover .video-preview-trigger__play-badge[data-v-0ea80546] {
|
|
312
|
+
transform: translate(-50%, -50%) scale(1.08);
|
|
313
|
+
}
|
|
314
|
+
.video-preview-trigger__play-icon[data-v-0ea80546] {
|
|
315
|
+
color: var(--dc-core-primary-color, var(--el-color-primary));
|
|
316
|
+
}
|
|
317
|
+
[data-v-64294ae8] .auto-refresh-label {
|
|
318
|
+
display: flex;
|
|
319
|
+
font-size: 13px;
|
|
320
|
+
color: var(--el-text-color-regular);
|
|
321
|
+
margin-bottom: 8px;
|
|
322
|
+
}
|
|
323
|
+
/* 有根节点时(needRootNode)按钮组横向排列 + 间距(参照 TableToolbar 按钮组内 gap:10px) */
|
|
324
|
+
.auto-refresh-group-root[data-v-5a86b4f5] {
|
|
325
|
+
display: flex;
|
|
326
|
+
align-items: center;
|
|
327
|
+
gap: 10px;
|
|
328
|
+
}
|
|
329
|
+
.auto-refresh-group-icon--rotating[data-v-5a86b4f5] {
|
|
330
|
+
animation: auto-refresh-rotating-5a86b4f5 1s linear infinite;
|
|
331
|
+
}
|
|
332
|
+
@keyframes auto-refresh-rotating-5a86b4f5 {
|
|
333
|
+
from {
|
|
334
|
+
transform: rotate(0deg);
|
|
335
|
+
}
|
|
336
|
+
to {
|
|
337
|
+
transform: rotate(360deg);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/es/utils/dom.mjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function domClosestScrollableAncestor(el) {
|
|
2
|
+
let cur = el == null ? void 0 : el.parentElement;
|
|
3
|
+
while (cur && cur !== document.body && cur !== document.documentElement) {
|
|
4
|
+
const { overflowY } = getComputedStyle(cur);
|
|
5
|
+
if (/(auto|scroll|overlay)/.test(overflowY) && cur.scrollHeight > cur.clientHeight) {
|
|
6
|
+
return cur;
|
|
7
|
+
}
|
|
8
|
+
cur = cur.parentElement;
|
|
9
|
+
}
|
|
10
|
+
return void 0;
|
|
11
|
+
}
|
|
12
|
+
function domClosestStickyScrollport(el) {
|
|
13
|
+
let cur = el == null ? void 0 : el.parentElement;
|
|
14
|
+
while (cur && cur !== document.body && cur !== document.documentElement) {
|
|
15
|
+
const cs = getComputedStyle(cur);
|
|
16
|
+
if (cs.display !== "contents" && /(auto|scroll|overlay|hidden)/.test(cs.overflowY)) {
|
|
17
|
+
return cur;
|
|
18
|
+
}
|
|
19
|
+
cur = cur.parentElement;
|
|
20
|
+
}
|
|
21
|
+
return void 0;
|
|
22
|
+
}
|
|
23
|
+
function domPreferredScrollBehavior() {
|
|
24
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
25
|
+
return "smooth";
|
|
26
|
+
}
|
|
27
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
|
|
28
|
+
}
|
|
29
|
+
function domScrollIntoViewport(target, options = {}) {
|
|
30
|
+
if (!target || typeof target.scrollIntoView !== "function") return;
|
|
31
|
+
const { block = "nearest", inline = "nearest" } = options;
|
|
32
|
+
target.scrollIntoView({
|
|
33
|
+
behavior: options.behavior ?? domPreferredScrollBehavior(),
|
|
34
|
+
block,
|
|
35
|
+
inline
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
domClosestScrollableAncestor,
|
|
40
|
+
domClosestStickyScrollport,
|
|
41
|
+
domScrollIntoViewport
|
|
42
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const OPERATE_COLUMN_PROP = "OPERATE";
|
|
2
|
+
const EXPORT_MAX_LIMIT = 1e4;
|
|
3
|
+
const pickExportColumns = (columns) => columns.filter((col) => {
|
|
4
|
+
if (!col.prop) return false;
|
|
5
|
+
if (col.prop === OPERATE_COLUMN_PROP) return false;
|
|
6
|
+
if (col.type && col.type !== "default") return false;
|
|
7
|
+
return true;
|
|
8
|
+
}).map((col) => ({
|
|
9
|
+
prop: col.prop,
|
|
10
|
+
label: col.label
|
|
11
|
+
}));
|
|
12
|
+
const BOM = "\uFEFF";
|
|
13
|
+
const exportCSV = ({
|
|
14
|
+
columns,
|
|
15
|
+
list,
|
|
16
|
+
filename = "导出数据"
|
|
17
|
+
}) => {
|
|
18
|
+
const header = columns.map((c) => c.label).join(",");
|
|
19
|
+
const rows = list.map(
|
|
20
|
+
(row) => columns.map((c) => {
|
|
21
|
+
const raw = c.valueMap ? c.valueMap(row) : row[c.prop] ?? "";
|
|
22
|
+
return `"${String(raw).replace(/"/g, '""')}"`;
|
|
23
|
+
}).join(",")
|
|
24
|
+
);
|
|
25
|
+
const csv = BOM + [header, ...rows].join("\n");
|
|
26
|
+
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|
|
27
|
+
const url = URL.createObjectURL(blob);
|
|
28
|
+
const link = document.createElement("a");
|
|
29
|
+
link.href = url;
|
|
30
|
+
link.download = `${filename}.csv`;
|
|
31
|
+
link.click();
|
|
32
|
+
URL.revokeObjectURL(url);
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
EXPORT_MAX_LIMIT,
|
|
36
|
+
OPERATE_COLUMN_PROP,
|
|
37
|
+
exportCSV,
|
|
38
|
+
pickExportColumns
|
|
39
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const GAP_SCALE_RUNG = {
|
|
2
|
+
/** 外圈:内容 ↔ chrome、内容 ↔ viewport 边、悬浮插槽 ↔ 默认内容 */
|
|
3
|
+
outer: 2,
|
|
4
|
+
/** 卡片内边距(呼吸) */
|
|
5
|
+
breath: 1.5,
|
|
6
|
+
/** 模块 / 卡之间 */
|
|
7
|
+
module: 1,
|
|
8
|
+
/** 同一张卡内的分段 */
|
|
9
|
+
section: 0.5
|
|
10
|
+
};
|
|
11
|
+
const DENSITY_FACTOR = {
|
|
12
|
+
compact: 0.75,
|
|
13
|
+
cozy: 1,
|
|
14
|
+
comfortable: 1.5
|
|
15
|
+
};
|
|
16
|
+
const gapScaleBase = (size, density) => {
|
|
17
|
+
const factor = (density && DENSITY_FACTOR[density]) ?? DENSITY_FACTOR.cozy;
|
|
18
|
+
return Math.round(size * factor);
|
|
19
|
+
};
|
|
20
|
+
const gapScaleValue = (size, rung, density) => Math.round(gapScaleBase(size, density) * GAP_SCALE_RUNG[rung]);
|
|
21
|
+
export {
|
|
22
|
+
GAP_SCALE_RUNG,
|
|
23
|
+
gapScaleBase,
|
|
24
|
+
gapScaleValue
|
|
25
|
+
};
|
package/es/utils/id.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { timeCountDown } from "./time.mjs";
|
|
2
|
+
import { getId } from "./id.mjs";
|
|
3
|
+
import { domClosestScrollableAncestor, domClosestStickyScrollport, domScrollIntoViewport } from "./dom.mjs";
|
|
4
|
+
import { flatRouteMetaResolveRaw, getRoutePermissionKey, getRoutePermissionRequirement, routerOpenInNewTab } from "./router.mjs";
|
|
5
|
+
import { checkPermissionRule, permissionCheckAll, permissionCheckAny, resolvePermissionRule } from "./permission.mjs";
|
|
6
|
+
import { EXPORT_MAX_LIMIT, OPERATE_COLUMN_PROP, exportCSV, pickExportColumns } from "./export.mjs";
|
|
7
|
+
import { themeScaleDerive, themeScaleIsNearBlack, themeScaleMix, themeScalePageColor, themeScaleParseHex, themeScaleSurfaceColor, themeScaleToRgba } from "./theme-scale.mjs";
|
|
8
|
+
import { GAP_SCALE_RUNG, gapScaleBase, gapScaleValue } from "./gap-scale.mjs";
|
|
9
|
+
export {
|
|
10
|
+
EXPORT_MAX_LIMIT,
|
|
11
|
+
GAP_SCALE_RUNG,
|
|
12
|
+
OPERATE_COLUMN_PROP,
|
|
13
|
+
checkPermissionRule,
|
|
14
|
+
domClosestScrollableAncestor,
|
|
15
|
+
domClosestStickyScrollport,
|
|
16
|
+
domScrollIntoViewport,
|
|
17
|
+
exportCSV,
|
|
18
|
+
flatRouteMetaResolveRaw,
|
|
19
|
+
gapScaleBase,
|
|
20
|
+
gapScaleValue,
|
|
21
|
+
getId,
|
|
22
|
+
getRoutePermissionKey,
|
|
23
|
+
getRoutePermissionRequirement,
|
|
24
|
+
permissionCheckAll,
|
|
25
|
+
permissionCheckAny,
|
|
26
|
+
pickExportColumns,
|
|
27
|
+
resolvePermissionRule,
|
|
28
|
+
routerOpenInNewTab,
|
|
29
|
+
themeScaleDerive,
|
|
30
|
+
themeScaleIsNearBlack,
|
|
31
|
+
themeScaleMix,
|
|
32
|
+
themeScalePageColor,
|
|
33
|
+
themeScaleParseHex,
|
|
34
|
+
themeScaleSurfaceColor,
|
|
35
|
+
themeScaleToRgba,
|
|
36
|
+
timeCountDown
|
|
37
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const permissionCheckAny = (results) => results.some((r) => r.pass);
|
|
2
|
+
const permissionCheckAll = (results) => results.every((r) => r.pass);
|
|
3
|
+
const resolvePermissionRule = (target) => {
|
|
4
|
+
if (target === null || target === void 0) return;
|
|
5
|
+
const isRule = typeof target === "object" && !Array.isArray(target);
|
|
6
|
+
const rawKey = isRule ? target.key : target;
|
|
7
|
+
if (rawKey === null || rawKey === void 0) return;
|
|
8
|
+
const key = Array.isArray(rawKey) ? rawKey : [rawKey];
|
|
9
|
+
if (!key.length) return;
|
|
10
|
+
return { key, check: isRule && target.check || permissionCheckAny };
|
|
11
|
+
};
|
|
12
|
+
const checkPermissionRule = (target, permissionList) => {
|
|
13
|
+
const requirement = resolvePermissionRule(target);
|
|
14
|
+
if (!requirement) return true;
|
|
15
|
+
const results = requirement.key.map((key) => ({
|
|
16
|
+
key,
|
|
17
|
+
pass: permissionList.includes(key)
|
|
18
|
+
}));
|
|
19
|
+
try {
|
|
20
|
+
return !!requirement.check(results);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error("[permission] check 抛错,按无权处理", error);
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
checkPermissionRule,
|
|
28
|
+
permissionCheckAll,
|
|
29
|
+
permissionCheckAny,
|
|
30
|
+
resolvePermissionRule
|
|
31
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { resolvePermissionRule } from "./permission.mjs";
|
|
2
|
+
const getRoutePermissionKey = ({
|
|
3
|
+
path,
|
|
4
|
+
permission: permissionConfig
|
|
5
|
+
}) => {
|
|
6
|
+
if (!permissionConfig) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const { key, keyUsePath } = permissionConfig;
|
|
10
|
+
if (Array.isArray(key)) {
|
|
11
|
+
return key.length || !keyUsePath ? void 0 : path;
|
|
12
|
+
}
|
|
13
|
+
if (key) {
|
|
14
|
+
return key;
|
|
15
|
+
} else if (keyUsePath) {
|
|
16
|
+
return path;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const getRoutePermissionRequirement = (params) => {
|
|
20
|
+
const { key, check } = params.permission ?? {};
|
|
21
|
+
const scalar = getRoutePermissionKey(params);
|
|
22
|
+
const target = Array.isArray(key) && key.length ? key : scalar;
|
|
23
|
+
return resolvePermissionRule(
|
|
24
|
+
target === void 0 ? void 0 : { key: target, check }
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
const flatRouteMetaResolveRaw = (list, arr = []) => {
|
|
28
|
+
list.forEach((item) => {
|
|
29
|
+
arr.push(item);
|
|
30
|
+
flatRouteMetaResolveRaw(item.children, arr);
|
|
31
|
+
});
|
|
32
|
+
return arr;
|
|
33
|
+
};
|
|
34
|
+
const routerOpenInNewTab = (router, path) => {
|
|
35
|
+
window.open(router.resolve(path).href, "_blank", "noopener");
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
flatRouteMetaResolveRaw,
|
|
39
|
+
getRoutePermissionKey,
|
|
40
|
+
getRoutePermissionRequirement,
|
|
41
|
+
routerOpenInNewTab
|
|
42
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const themeScaleParseHex = (hex) => {
|
|
2
|
+
const m = hex.trim().replace(/^#/, "");
|
|
3
|
+
if (m.length === 3) {
|
|
4
|
+
const r = parseInt(m[0] + m[0], 16);
|
|
5
|
+
const g = parseInt(m[1] + m[1], 16);
|
|
6
|
+
const b = parseInt(m[2] + m[2], 16);
|
|
7
|
+
return [r, g, b].some(Number.isNaN) ? null : [r, g, b];
|
|
8
|
+
}
|
|
9
|
+
if (m.length === 6) {
|
|
10
|
+
const r = parseInt(m.slice(0, 2), 16);
|
|
11
|
+
const g = parseInt(m.slice(2, 4), 16);
|
|
12
|
+
const b = parseInt(m.slice(4, 6), 16);
|
|
13
|
+
return [r, g, b].some(Number.isNaN) ? null : [r, g, b];
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
const themeScaleToHex = (r, g, b) => {
|
|
18
|
+
const h = (n) => {
|
|
19
|
+
const v = Math.min(255, Math.max(0, Math.round(n)));
|
|
20
|
+
return v.toString(16).padStart(2, "0");
|
|
21
|
+
};
|
|
22
|
+
return `#${h(r)}${h(g)}${h(b)}`;
|
|
23
|
+
};
|
|
24
|
+
const themeScaleMix = (c1, c2, w1) => {
|
|
25
|
+
const a = themeScaleParseHex(c1);
|
|
26
|
+
const b = themeScaleParseHex(c2);
|
|
27
|
+
if (!a || !b) return c2;
|
|
28
|
+
return themeScaleToHex(
|
|
29
|
+
a[0] * w1 + b[0] * (1 - w1),
|
|
30
|
+
a[1] * w1 + b[1] * (1 - w1),
|
|
31
|
+
a[2] * w1 + b[2] * (1 - w1)
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
const themeScaleToRgba = (hex, alpha) => {
|
|
35
|
+
const rgb = themeScaleParseHex(hex);
|
|
36
|
+
if (!rgb) return hex;
|
|
37
|
+
const a = Math.min(1, Math.max(0, alpha));
|
|
38
|
+
return `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${a})`;
|
|
39
|
+
};
|
|
40
|
+
const ELEVATION_STEP_CH = 10;
|
|
41
|
+
const PAGE_STEP_CH = 18;
|
|
42
|
+
const ELEVATION_REL_MAX = 0.5;
|
|
43
|
+
const themeScalePageColor = (bodyColor) => {
|
|
44
|
+
const rgb = themeScaleParseHex(bodyColor);
|
|
45
|
+
if (!rgb) return bodyColor;
|
|
46
|
+
const maxCh = Math.max(...rgb);
|
|
47
|
+
const k = maxCh === 0 ? 0 : Math.min(ELEVATION_REL_MAX, PAGE_STEP_CH / maxCh);
|
|
48
|
+
return themeScaleMix(bodyColor, "#000000", 1 - k);
|
|
49
|
+
};
|
|
50
|
+
const themeScaleSurfaceColor = (bodyColor, mode) => {
|
|
51
|
+
if (mode === "light") return bodyColor;
|
|
52
|
+
const rgb = themeScaleParseHex(bodyColor);
|
|
53
|
+
if (!rgb) return bodyColor;
|
|
54
|
+
const headroom = 255 - Math.max(...rgb);
|
|
55
|
+
const k = headroom === 0 ? 0 : Math.min(ELEVATION_REL_MAX, ELEVATION_STEP_CH / headroom);
|
|
56
|
+
return themeScaleMix(bodyColor, "#ffffff", 1 - k);
|
|
57
|
+
};
|
|
58
|
+
const themeScaleDerive = (base, mode) => {
|
|
59
|
+
const lightMix = mode === "light" ? "#ffffff" : "#141414";
|
|
60
|
+
const darkMix = mode === "light" ? "#000000" : "#ffffff";
|
|
61
|
+
const li = (i) => themeScaleMix(lightMix, base, i / 10);
|
|
62
|
+
return {
|
|
63
|
+
base,
|
|
64
|
+
"light-3": li(3),
|
|
65
|
+
"light-5": li(5),
|
|
66
|
+
"light-7": li(7),
|
|
67
|
+
"light-8": li(8),
|
|
68
|
+
"light-9": li(9),
|
|
69
|
+
"dark-2": themeScaleMix(darkMix, base, 0.2)
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
const NEAR_BLACK_MAX_CH = 12;
|
|
73
|
+
const themeScaleIsNearBlack = (bodyColor) => {
|
|
74
|
+
const rgb = themeScaleParseHex(bodyColor);
|
|
75
|
+
if (!rgb) return false;
|
|
76
|
+
return Math.max(...rgb) < NEAR_BLACK_MAX_CH;
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
themeScaleDerive,
|
|
80
|
+
themeScaleIsNearBlack,
|
|
81
|
+
themeScaleMix,
|
|
82
|
+
themeScalePageColor,
|
|
83
|
+
themeScaleParseHex,
|
|
84
|
+
themeScaleSurfaceColor,
|
|
85
|
+
themeScaleToRgba
|
|
86
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const timeCountDown = (time, handler, endHandler) => {
|
|
2
|
+
let timer;
|
|
3
|
+
const initTimeStamp = Date.now();
|
|
4
|
+
const targetTimeStamp = initTimeStamp + time * 1e3;
|
|
5
|
+
const timeStep = 1e3;
|
|
6
|
+
function main() {
|
|
7
|
+
timer = setTimeout(() => {
|
|
8
|
+
const nowTimeStamp = Date.now();
|
|
9
|
+
if (targetTimeStamp - nowTimeStamp > 0) {
|
|
10
|
+
const newTime = Math.round((targetTimeStamp - nowTimeStamp) / 1e3);
|
|
11
|
+
handler(Math.max(newTime, 0));
|
|
12
|
+
main();
|
|
13
|
+
} else {
|
|
14
|
+
handler(0);
|
|
15
|
+
endHandler();
|
|
16
|
+
}
|
|
17
|
+
}, timeStep);
|
|
18
|
+
}
|
|
19
|
+
main();
|
|
20
|
+
return () => clearTimeout(timer);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
timeCountDown
|
|
24
|
+
};
|