foucui 1.0.1
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/README.md +43 -0
- package/components/QiuAffix/index.vue +186 -0
- package/components/QiuAlert/index.vue +208 -0
- package/components/QiuAnchor/context.ts +18 -0
- package/components/QiuAnchor/index.vue +180 -0
- package/components/QiuAnchorLink/index.vue +67 -0
- package/components/QiuApp/index.vue +9 -0
- package/components/QiuAutocomplete/index.vue +408 -0
- package/components/QiuAvatar/index.vue +140 -0
- package/components/QiuBacktop/index.vue +121 -0
- package/components/QiuBadge/api/index.ts +389 -0
- package/components/QiuBadge/components/BadgeImagePickerDialog.vue +243 -0
- package/components/QiuBadge/components/BadgeLibraryManagerDialog.vue +30 -0
- package/components/QiuBadge/components/BadgeLibraryPanel.vue +182 -0
- package/components/QiuBadge/composables/useTableHostHeight.ts +53 -0
- package/components/QiuBadge/index.ts +18 -0
- package/components/QiuBadge/shared/BadgeTemplateRenderer.vue +32 -0
- package/components/QiuBadge/shared/assetUrl.ts +26 -0
- package/components/QiuBadge/shared/badgeTemplate.ts +309 -0
- package/components/QiuBadge/utils/chinaAreaData.ts +44 -0
- package/components/QiuBadge/utils/hostRegion.ts +22 -0
- package/components/QiuBadge/utils/pca-code.json +1 -0
- package/components/QiuBadge/utils/pdfFromElement.ts +348 -0
- package/components/QiuBadge/views/BadgeLibraryView.vue +32 -0
- package/components/QiuBadge/views/BadgeManageView.vue +1364 -0
- package/components/QiuBadge/views/BadgeTemplateEditorView.vue +10 -0
- package/components/QiuBadge/views/BadgeTemplateListView.vue +229 -0
- package/components/QiuBadge/views/DeskLabelTemplateListView.vue +227 -0
- package/components/QiuBadge/views/DeskLabelView.vue +683 -0
- package/components/QiuBadgeDot/index.vue +87 -0
- package/components/QiuButton/index.vue +247 -0
- package/components/QiuButtonGroup/index.vue +63 -0
- package/components/QiuCanvasKit/QiuCanvasEditor.vue +5503 -0
- package/components/QiuCanvasKit/QiuCanvasRenderer.vue +348 -0
- package/components/QiuCanvasKit/assetUrl.ts +11 -0
- package/components/QiuCanvasKit/components/DataModulesPanel.vue +352 -0
- package/components/QiuCanvasKit/export/html.ts +132 -0
- package/components/QiuCanvasKit/export/pdf.ts +48 -0
- package/components/QiuCanvasKit/export/png.ts +50 -0
- package/components/QiuCanvasKit/index.ts +20 -0
- package/components/QiuCanvasKit/modules/badgeCompat.ts +84 -0
- package/components/QiuCanvasKit/modules/dataRegistry.ts +207 -0
- package/components/QiuCanvasKit/modules/merge.ts +71 -0
- package/components/QiuCanvasKit/presets/badge.ts +67 -0
- package/components/QiuCanvasKit/presets/banner.ts +79 -0
- package/components/QiuCanvasKit/types.ts +138 -0
- package/components/QiuCard/index.vue +104 -0
- package/components/QiuCarousel/context.ts +16 -0
- package/components/QiuCarousel/index.vue +343 -0
- package/components/QiuCarouselItem/index.vue +47 -0
- package/components/QiuCascader/index.vue +879 -0
- package/components/QiuCascader/types.ts +48 -0
- package/components/QiuCheckbox/QiuCheckboxGroup.vue +78 -0
- package/components/QiuCheckbox/index.vue +231 -0
- package/components/QiuCheckbox/types.ts +8 -0
- package/components/QiuCode/index.vue +64 -0
- package/components/QiuCol/col.scss +55 -0
- package/components/QiuCol/index.vue +64 -0
- package/components/QiuCollapse/context.ts +10 -0
- package/components/QiuCollapse/index.vue +70 -0
- package/components/QiuCollapseItem/index.vue +167 -0
- package/components/QiuColorField/index.vue +296 -0
- package/components/QiuColorPicker/README.md +118 -0
- package/components/QiuColorPicker/index.vue +60 -0
- package/components/QiuColorfulCard/index.vue +101 -0
- package/components/QiuCombobox/index.vue +277 -0
- package/components/QiuConfigProvider/index.vue +31 -0
- package/components/QiuContextMenu/index.vue +209 -0
- package/components/QiuDate/index.vue +1134 -0
- package/components/QiuDescriptions/context.ts +20 -0
- package/components/QiuDescriptions/index.vue +115 -0
- package/components/QiuDescriptionsItem/index.vue +103 -0
- package/components/QiuDialog/index.vue +828 -0
- package/components/QiuDigitalCard/index.vue +159 -0
- package/components/QiuDivider/index.vue +185 -0
- package/components/QiuDot/index.vue +83 -0
- package/components/QiuDrawer/index.vue +350 -0
- package/components/QiuDropdown/QiuDropdownItem.vue +74 -0
- package/components/QiuDropdown/QiuDropdownMenu.vue +22 -0
- package/components/QiuDropdown/context.ts +9 -0
- package/components/QiuDropdown/index.vue +189 -0
- package/components/QiuEmpty/index.vue +73 -0
- package/components/QiuForm/index.vue +172 -0
- package/components/QiuForm/types.ts +39 -0
- package/components/QiuFormItem/index.vue +276 -0
- package/components/QiuFullscreen/index.vue +11 -0
- package/components/QiuGrid/index.vue +408 -0
- package/components/QiuHoverCard/index.vue +192 -0
- package/components/QiuIcon/index.vue +117 -0
- package/components/QiuIconPicker/iconify.libraries.ts +182 -0
- package/components/QiuIconPicker/icons.catalog.ts +3072 -0
- package/components/QiuIconPicker/index.vue +488 -0
- package/components/QiuImage/index.vue +177 -0
- package/components/QiuInput/index.vue +328 -0
- package/components/QiuInputNumber/index.vue +295 -0
- package/components/QiuInputOtp/index.vue +190 -0
- package/components/QiuKbd/index.vue +57 -0
- package/components/QiuLayoutContainer/index.vue +50 -0
- package/components/QiuLinkPreview/index.vue +224 -0
- package/components/QiuLoading/index.ts +176 -0
- package/components/QiuLoading/spinner.vue +820 -0
- package/components/QiuLoading/types.ts +44 -0
- package/components/QiuMention/index.vue +299 -0
- package/components/QiuMenu/QiuMenuRoot.vue +241 -0
- package/components/QiuMenu/components/QiuMenuItem.vue +340 -0
- package/components/QiuMenu/components/QiuSubMenu.vue +504 -0
- package/components/QiuMenu/context.ts +21 -0
- package/components/QiuMenu/index.vue +43 -0
- package/components/QiuMenuNav/QiuMenuNavItem.vue +100 -0
- package/components/QiuMenuNav/QiuMenuNavSub.vue +120 -0
- package/components/QiuMenuNav/context.ts +14 -0
- package/components/QiuMenuNav/index.vue +148 -0
- package/components/QiuMsg/QiuMsgItem.vue +180 -0
- package/components/QiuMsg/index.ts +158 -0
- package/components/QiuMsg/types.ts +23 -0
- package/components/QiuMsgBox/index.ts +147 -0
- package/components/QiuNotification/QiuNotificationItem.vue +168 -0
- package/components/QiuNotification/index.ts +155 -0
- package/components/QiuNotification/types.ts +14 -0
- package/components/QiuPage/index.vue +12 -0
- package/components/QiuPageHeader/index.vue +115 -0
- package/components/QiuPageMain/index.vue +78 -0
- package/components/QiuPagination/index.vue +421 -0
- package/components/QiuPasswordStrength/index.vue +101 -0
- package/components/QiuPopconfirm/index.vue +196 -0
- package/components/QiuPopover/index.vue +277 -0
- package/components/QiuProgress/index.vue +235 -0
- package/components/QiuQrcode/index.vue +302 -0
- package/components/QiuQueryForm/components/QiuQueryFormBottomPanel.vue +13 -0
- package/components/QiuQueryForm/components/QiuQueryFormLeftPanel.vue +37 -0
- package/components/QiuQueryForm/components/QiuQueryFormRightPanel.vue +37 -0
- package/components/QiuQueryForm/components/QiuQueryFormTopPanel.vue +13 -0
- package/components/QiuQueryForm/index.vue +117 -0
- package/components/QiuRadio/QiuRadioGroup.vue +75 -0
- package/components/QiuRadio/index.vue +191 -0
- package/components/QiuRadio/types.ts +9 -0
- package/components/QiuRate/index.vue +184 -0
- package/components/QiuRefresh/index.vue +32 -0
- package/components/QiuResult/index.vue +103 -0
- package/components/QiuRow/index.vue +60 -0
- package/components/QiuRow/types.ts +5 -0
- package/components/QiuScrollbar/index.vue +107 -0
- package/components/QiuSearchBar/index.vue +154 -0
- package/components/QiuSegmented/index.vue +120 -0
- package/components/QiuSelect/QiuOption.vue +93 -0
- package/components/QiuSelect/index.vue +452 -0
- package/components/QiuSelect/types.ts +15 -0
- package/components/QiuSkeleton/index.vue +78 -0
- package/components/QiuSlider/index.vue +266 -0
- package/components/QiuSpace/index.vue +95 -0
- package/components/QiuSparkline/index.vue +92 -0
- package/components/QiuStatistic/index.vue +4 -0
- package/components/QiuStatistics/index.vue +123 -0
- package/components/QiuStep/index.vue +220 -0
- package/components/QiuSteps/context.ts +25 -0
- package/components/QiuSteps/index.vue +84 -0
- package/components/QiuSwitch/index.vue +145 -0
- package/components/QiuTabBar/index.vue +218 -0
- package/components/QiuTabBar/types.ts +19 -0
- package/components/QiuTabPane/index.vue +82 -0
- package/components/QiuTable/columns.ts +16 -0
- package/components/QiuTable/export.ts +102 -0
- package/components/QiuTable/index.ts +24 -0
- package/components/QiuTable/index.vue +3503 -0
- package/components/QiuTable/registry.ts +75 -0
- package/components/QiuTable/styles/table.scss +1230 -0
- package/components/QiuTable/types.ts +413 -0
- package/components/QiuTable/useArea.ts +202 -0
- package/components/QiuTable/useColumns.ts +325 -0
- package/components/QiuTable/useEdit.ts +136 -0
- package/components/QiuTable/useExtras.ts +115 -0
- package/components/QiuTable/useHistory.ts +77 -0
- package/components/QiuTable/useMerge.ts +105 -0
- package/components/QiuTable/useResize.ts +86 -0
- package/components/QiuTable/useScrollSync.ts +152 -0
- package/components/QiuTable/useVirtual.ts +97 -0
- package/components/QiuTable/utils.ts +165 -0
- package/components/QiuTableColumn/index.vue +101 -0
- package/components/QiuTag/index.vue +143 -0
- package/components/QiuText/index.vue +99 -0
- package/components/QiuTime/index.vue +548 -0
- package/components/QiuTimeAgo/index.vue +103 -0
- package/components/QiuTimeline/index.vue +54 -0
- package/components/QiuTimelineItem/index.vue +140 -0
- package/components/QiuTips/index.vue +323 -0
- package/components/QiuTooltip/index.vue +237 -0
- package/components/QiuTransfer/index.vue +277 -0
- package/components/QiuTree/QiuTreeNode.vue +146 -0
- package/components/QiuTree/index.vue +143 -0
- package/components/QiuTree/types.ts +30 -0
- package/components/QiuTreeSelect/index.vue +259 -0
- package/components/QiuTrend/index.vue +92 -0
- package/components/QiuUpload/index.vue +628 -0
- package/components/QiuUploadCrop/index.vue +1267 -0
- package/components/QiuWatermark/index.vue +121 -0
- package/components/useBodyScrollLock.ts +28 -0
- package/dist/components/QiuAnchor/context.d.ts +15 -0
- package/dist/components/QiuAnchorLink/index.vue.d.ts +23 -0
- package/dist/components/QiuBadge/api/index.d.ts +110 -0
- package/dist/components/QiuBadge/components/BadgeImagePickerDialog.vue.d.ts +16 -0
- package/dist/components/QiuBadge/components/BadgeLibraryManagerDialog.vue.d.ts +9 -0
- package/dist/components/QiuBadge/components/BadgeLibraryPanel.vue.d.ts +5 -0
- package/dist/components/QiuBadge/composables/useTableHostHeight.d.ts +7 -0
- package/dist/components/QiuBadge/index.d.ts +18 -0
- package/dist/components/QiuBadge/shared/BadgeTemplateRenderer.vue.d.ts +14 -0
- package/dist/components/QiuBadge/shared/assetUrl.d.ts +1 -0
- package/dist/components/QiuBadge/shared/badgeTemplate.d.ts +132 -0
- package/dist/components/QiuBadge/utils/chinaAreaData.d.ts +9 -0
- package/dist/components/QiuBadge/utils/hostRegion.d.ts +3 -0
- package/dist/components/QiuBadge/utils/pca-code.json.d.ts +3 -0
- package/dist/components/QiuBadge/utils/pdfFromElement.d.ts +14 -0
- package/dist/components/QiuBadge/views/BadgeLibraryView.vue.d.ts +2 -0
- package/dist/components/QiuBadge/views/BadgeManageView.vue.d.ts +7 -0
- package/dist/components/QiuBadge/views/BadgeTemplateListView.vue.d.ts +4 -0
- package/dist/components/QiuBadge/views/DeskLabelTemplateListView.vue.d.ts +4 -0
- package/dist/components/QiuBadge/views/DeskLabelView.vue.d.ts +4 -0
- package/dist/components/QiuButton/index.vue.d.ts +52 -0
- package/dist/components/QiuCanvasKit/QiuCanvasEditor.vue.d.ts +24 -0
- package/dist/components/QiuCanvasKit/QiuCanvasRenderer.vue.d.ts +13 -0
- package/dist/components/QiuCanvasKit/assetUrl.d.ts +7 -0
- package/dist/components/QiuCanvasKit/components/DataModulesPanel.vue.d.ts +23 -0
- package/dist/components/QiuCanvasKit/export/html.d.ts +12 -0
- package/dist/components/QiuCanvasKit/export/pdf.d.ts +9 -0
- package/dist/components/QiuCanvasKit/export/png.d.ts +8 -0
- package/dist/components/QiuCanvasKit/index.d.ts +19 -0
- package/dist/components/QiuCanvasKit/modules/badgeCompat.d.ts +8 -0
- package/dist/components/QiuCanvasKit/modules/dataRegistry.d.ts +23 -0
- package/dist/components/QiuCanvasKit/modules/merge.d.ts +12 -0
- package/dist/components/QiuCanvasKit/presets/badge.d.ts +12 -0
- package/dist/components/QiuCanvasKit/presets/banner.d.ts +4 -0
- package/dist/components/QiuCanvasKit/types.d.ts +119 -0
- package/dist/components/QiuCarousel/context.d.ts +13 -0
- package/dist/components/QiuCarouselItem/index.vue.d.ts +20 -0
- package/dist/components/QiuCascader/types.d.ts +25 -0
- package/dist/components/QiuCheckbox/QiuCheckboxGroup.vue.d.ts +33 -0
- package/dist/components/QiuCheckbox/index.vue.d.ts +38 -0
- package/dist/components/QiuCheckbox/types.d.ts +7 -0
- package/dist/components/QiuCode/index.vue.d.ts +15 -0
- package/dist/components/QiuCollapse/context.d.ts +8 -0
- package/dist/components/QiuCollapseItem/index.vue.d.ts +30 -0
- package/dist/components/QiuColorField/index.vue.d.ts +23 -0
- package/dist/components/QiuColorPicker/index.vue.d.ts +21 -0
- package/dist/components/QiuCombobox/index.vue.d.ts +54 -0
- package/dist/components/QiuContextMenu/index.vue.d.ts +46 -0
- package/dist/components/QiuDescriptions/context.d.ts +16 -0
- package/dist/components/QiuDescriptionsItem/index.vue.d.ts +25 -0
- package/dist/components/QiuDigitalCard/index.vue.d.ts +45 -0
- package/dist/components/QiuDropdown/QiuDropdownItem.vue.d.ts +30 -0
- package/dist/components/QiuDropdown/QiuDropdownMenu.vue.d.ts +17 -0
- package/dist/components/QiuDropdown/context.d.ts +7 -0
- package/dist/components/QiuDropdown/index.vue.d.ts +46 -0
- package/dist/components/QiuForm/types.d.ts +31 -0
- package/dist/components/QiuHoverCard/index.vue.d.ts +44 -0
- package/dist/components/QiuIcon/index.vue.d.ts +18 -0
- package/dist/components/QiuIconPicker/iconify.libraries.d.ts +18 -0
- package/dist/components/QiuIconPicker/icons.catalog.d.ts +12 -0
- package/dist/components/QiuInput/index.vue.d.ts +71 -0
- package/dist/components/QiuInputNumber/index.vue.d.ts +38 -0
- package/dist/components/QiuInputOtp/index.vue.d.ts +28 -0
- package/dist/components/QiuKbd/index.vue.d.ts +22 -0
- package/dist/components/QiuLayoutContainer/index.vue.d.ts +29 -0
- package/dist/components/QiuLinkPreview/index.vue.d.ts +43 -0
- package/dist/components/QiuLoading/index.d.ts +26 -0
- package/dist/components/QiuLoading/spinner.vue.d.ts +14 -0
- package/dist/components/QiuLoading/types.d.ts +2 -0
- package/dist/components/QiuMention/index.vue.d.ts +35 -0
- package/dist/components/QiuMenu/QiuMenuRoot.vue.d.ts +36 -0
- package/dist/components/QiuMenu/context.d.ts +19 -0
- package/dist/components/QiuMenuNav/QiuMenuNavItem.vue.d.ts +26 -0
- package/dist/components/QiuMenuNav/QiuMenuNavSub.vue.d.ts +25 -0
- package/dist/components/QiuMenuNav/context.d.ts +12 -0
- package/dist/components/QiuMenuNav/index.vue.d.ts +35 -0
- package/dist/components/QiuMsg/QiuMsgItem.vue.d.ts +15 -0
- package/dist/components/QiuMsg/index.d.ts +30 -0
- package/dist/components/QiuMsg/types.d.ts +12 -0
- package/dist/components/QiuMsgBox/index.d.ts +14 -0
- package/dist/components/QiuNotification/QiuNotificationItem.vue.d.ts +16 -0
- package/dist/components/QiuNotification/index.d.ts +30 -0
- package/dist/components/QiuNotification/types.d.ts +12 -0
- package/dist/components/QiuPageMain/index.vue.d.ts +27 -0
- package/dist/components/QiuPagination/index.vue.d.ts +44 -0
- package/dist/components/QiuPasswordStrength/index.vue.d.ts +9 -0
- package/dist/components/QiuQrcode/index.vue.d.ts +20 -0
- package/dist/components/QiuRadio/QiuRadioGroup.vue.d.ts +33 -0
- package/dist/components/QiuRadio/types.d.ts +8 -0
- package/dist/components/QiuRow/types.d.ts +4 -0
- package/dist/components/QiuSearchBar/index.vue.d.ts +38 -0
- package/dist/components/QiuSelect/QiuOption.vue.d.ts +24 -0
- package/dist/components/QiuSelect/index.vue.d.ts +52 -0
- package/dist/components/QiuSelect/types.d.ts +13 -0
- package/dist/components/QiuSparkline/index.vue.d.ts +18 -0
- package/dist/components/QiuStep/index.vue.d.ts +31 -0
- package/dist/components/QiuSteps/context.d.ts +21 -0
- package/dist/components/QiuSwitch/index.vue.d.ts +25 -0
- package/dist/components/QiuTabBar/index.vue.d.ts +32 -0
- package/dist/components/QiuTabBar/types.d.ts +16 -0
- package/dist/components/QiuTabPane/index.vue.d.ts +25 -0
- package/dist/components/QiuTable/columns.d.ts +1 -0
- package/dist/components/QiuTable/export.d.ts +18 -0
- package/dist/components/QiuTable/index.d.ts +3 -0
- package/dist/components/QiuTable/index.vue.d.ts +322 -0
- package/dist/components/QiuTable/registry.d.ts +39 -0
- package/dist/components/QiuTable/types.d.ts +353 -0
- package/dist/components/QiuTable/useArea.d.ts +51 -0
- package/dist/components/QiuTable/useColumns.d.ts +67 -0
- package/dist/components/QiuTable/useEdit.d.ts +36 -0
- package/dist/components/QiuTable/useExtras.d.ts +38 -0
- package/dist/components/QiuTable/useHistory.d.ts +44 -0
- package/dist/components/QiuTable/useMerge.d.ts +28 -0
- package/dist/components/QiuTable/useResize.d.ts +19 -0
- package/dist/components/QiuTable/useScrollSync.d.ts +25 -0
- package/dist/components/QiuTable/useVirtual.d.ts +30 -0
- package/dist/components/QiuTable/utils.d.ts +54 -0
- package/dist/components/QiuTime/index.vue.d.ts +43 -0
- package/dist/components/QiuTimeAgo/index.vue.d.ts +35 -0
- package/dist/components/QiuTimelineItem/index.vue.d.ts +35 -0
- package/dist/components/QiuTooltip/index.vue.d.ts +38 -0
- package/dist/components/QiuTree/types.d.ts +13 -0
- package/dist/components/QiuTrend/index.vue.d.ts +34 -0
- package/dist/components/QiuUpload/index.vue.d.ts +86 -0
- package/dist/components/QiuUploadCrop/index.vue.d.ts +136 -0
- package/dist/components/useBodyScrollLock.d.ts +4 -0
- package/dist/foucui.css +1 -0
- package/dist/foucui.js +26509 -0
- package/dist/foucui.umd.cjs +125 -0
- package/dist/index.d.ts +46 -0
- package/dist/src/bridge/@/api/media.d.ts +7 -0
- package/dist/src/bridge/@/api/notice.d.ts +5 -0
- package/dist/src/bridge/@/config/index.d.ts +29 -0
- package/dist/src/bridge/@/config/media.config.d.ts +15 -0
- package/dist/src/bridge/@/config/security.config.d.ts +7 -0
- package/dist/src/bridge/@/i18n/index.d.ts +7 -0
- package/dist/src/bridge/@/store/modules/bing.d.ts +3 -0
- package/dist/src/bridge/@/store/modules/errorLog.d.ts +3 -0
- package/dist/src/bridge/@/store/modules/media.d.ts +4 -0
- package/dist/src/bridge/@/store/modules/routes.d.ts +3 -0
- package/dist/src/bridge/@/store/modules/settings.d.ts +3 -0
- package/dist/src/bridge/@/store/modules/tabs.d.ts +3 -0
- package/dist/src/bridge/@/store/modules/user.d.ts +3 -0
- package/dist/src/bridge/@/utils/convertToCamelCase.d.ts +2 -0
- package/dist/src/bridge/@/utils/index.d.ts +5 -0
- package/dist/src/bridge/@/utils/pageTitle.d.ts +1 -0
- package/dist/src/bridge/@/utils/routes.d.ts +11 -0
- package/dist/src/bridge/@/utils/validate.d.ts +13 -0
- package/dist/src/bridge/@qiu/plugins/shortcuts.d.ts +2 -0
- package/dist/src/i18n.d.ts +2 -0
- package/package.json +83 -0
- package/plugins/qiu.ts +83 -0
- package/plugins/shortcuts.ts +69 -0
- package/src/bridge/@/api/media.ts +8 -0
- package/src/bridge/@/api/notice.ts +5 -0
- package/src/bridge/@/config/index.ts +38 -0
- package/src/bridge/@/config/media.config.ts +37 -0
- package/src/bridge/@/config/security.config.ts +8 -0
- package/src/bridge/@/i18n/index.ts +6 -0
- package/src/bridge/@/store/modules/bing.ts +9 -0
- package/src/bridge/@/store/modules/errorLog.ts +9 -0
- package/src/bridge/@/store/modules/media.ts +10 -0
- package/src/bridge/@/store/modules/routes.ts +10 -0
- package/src/bridge/@/store/modules/settings.ts +9 -0
- package/src/bridge/@/store/modules/tabs.ts +9 -0
- package/src/bridge/@/store/modules/user.ts +9 -0
- package/src/bridge/@/utils/convertToCamelCase.ts +11 -0
- package/src/bridge/@/utils/index.ts +9 -0
- package/src/bridge/@/utils/pageTitle.ts +4 -0
- package/src/bridge/@/utils/routes.ts +14 -0
- package/src/bridge/@/utils/validate.ts +17 -0
- package/src/bridge/@qiu/plugins/shortcuts.ts +3 -0
- package/src/i18n.ts +8 -0
- package/src/icons/qiu-logo.svg +1 -0
- package/styles/dark.scss +194 -0
- package/styles/normalize.css +349 -0
- package/styles/plain.scss +423 -0
- package/styles/qiu-tokens.scss +40 -0
- package/styles/qiu.scss +1149 -0
- package/styles/technology.scss +452 -0
- package/styles/var.scss +382 -0
- package/styles/variables.scss +77 -0
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Teleport :to="teleportTo" :disabled="!appendToBody">
|
|
3
|
+
<div
|
|
4
|
+
v-if="!props.destroyOnClose || contentAlive || dialogVisible"
|
|
5
|
+
v-show="dialogVisible"
|
|
6
|
+
class="qiu-dialog-root"
|
|
7
|
+
:class="[rootClass, attrs.class]"
|
|
8
|
+
v-bind="attrsWithoutClass"
|
|
9
|
+
:style="{ zIndex: props.zIndex }"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-if="modal && !isMinimized"
|
|
13
|
+
class="qiu-dialog__mask"
|
|
14
|
+
:class="modalClass"
|
|
15
|
+
@mousedown.self="onMaskMouseDown"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<div
|
|
19
|
+
ref="panelRef"
|
|
20
|
+
class="qiu-dialog"
|
|
21
|
+
:class="panelClass"
|
|
22
|
+
:style="panelStyle"
|
|
23
|
+
role="dialog"
|
|
24
|
+
aria-modal="true"
|
|
25
|
+
@mousedown="bringToFront"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class="qiu-dialog__header"
|
|
29
|
+
:class="{ 'is-movable': canDrag, 'is-minimized-bar': isMinimized }"
|
|
30
|
+
@mousedown="onHeaderMouseDown"
|
|
31
|
+
@dblclick="onHeaderDblClick"
|
|
32
|
+
@click="onMinimizedBarClick"
|
|
33
|
+
>
|
|
34
|
+
<div class="qiu-dialog__title">{{ title }}</div>
|
|
35
|
+
<div class="qiu-dialog__actions" @mousedown.stop @click.stop>
|
|
36
|
+
<button
|
|
37
|
+
v-if="canMinimize && !isMinimized"
|
|
38
|
+
type="button"
|
|
39
|
+
class="qiu-dialog__btn"
|
|
40
|
+
:title="translate('最小化')"
|
|
41
|
+
@click.stop="minimize"
|
|
42
|
+
>
|
|
43
|
+
<qiu-icon icon="subtract-line" />
|
|
44
|
+
</button>
|
|
45
|
+
<button
|
|
46
|
+
v-if="canMaximize"
|
|
47
|
+
type="button"
|
|
48
|
+
class="qiu-dialog__btn"
|
|
49
|
+
:title="translate(isMinimized || isFullscreen ? '还原' : '最大化')"
|
|
50
|
+
@click.stop="isMinimized ? restoreFromMinimize() : toggleMaximize()"
|
|
51
|
+
>
|
|
52
|
+
<qiu-icon
|
|
53
|
+
:icon="
|
|
54
|
+
isMinimized
|
|
55
|
+
? 'picture-in-picture-2-line'
|
|
56
|
+
: isFullscreen
|
|
57
|
+
? 'fullscreen-exit-line'
|
|
58
|
+
: 'fullscreen-line'
|
|
59
|
+
"
|
|
60
|
+
/>
|
|
61
|
+
</button>
|
|
62
|
+
<button
|
|
63
|
+
v-if="showClose"
|
|
64
|
+
type="button"
|
|
65
|
+
class="qiu-dialog__btn"
|
|
66
|
+
:title="translate('关闭')"
|
|
67
|
+
@click.stop="requestClose"
|
|
68
|
+
>
|
|
69
|
+
<qiu-icon icon="close-line" />
|
|
70
|
+
</button>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div
|
|
75
|
+
v-show="!isMinimized"
|
|
76
|
+
class="qiu-dialog__body"
|
|
77
|
+
:class="{ 'is-loading': loading }"
|
|
78
|
+
>
|
|
79
|
+
<div v-if="loading" class="qiu-dialog__loading">
|
|
80
|
+
<span class="qiu-dialog__spinner" />
|
|
81
|
+
<span v-if="loadingText" class="qiu-dialog__loading-text">{{ loadingText }}</span>
|
|
82
|
+
</div>
|
|
83
|
+
<slot />
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div v-if="!isMinimized && $slots.footer" class="qiu-dialog__footer">
|
|
87
|
+
<slot name="footer" />
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<!-- 拉伸条放在面板外侧,不覆盖 body 滚动条 -->
|
|
91
|
+
<template v-if="resizable && !isFullscreen && !isMinimized">
|
|
92
|
+
<div
|
|
93
|
+
v-for="dir in resizeDirs"
|
|
94
|
+
:key="dir"
|
|
95
|
+
class="qiu-dialog__resize"
|
|
96
|
+
:class="`qiu-dialog__resize--${dir}`"
|
|
97
|
+
@mousedown.prevent.stop="startResize($event, dir)"
|
|
98
|
+
/>
|
|
99
|
+
</template>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</Teleport>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<script lang="ts" setup>
|
|
106
|
+
import { translate } from '../../src/i18n'
|
|
107
|
+
import { useBodyScrollLock } from '../useBodyScrollLock'
|
|
108
|
+
|
|
109
|
+
defineOptions({ name: 'QiuDialog', inheritAttrs: false })
|
|
110
|
+
|
|
111
|
+
type ResizeDir = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw'
|
|
112
|
+
type Box = { left: number; top: number; width: number; height: number }
|
|
113
|
+
|
|
114
|
+
const props = withDefaults(
|
|
115
|
+
defineProps<{
|
|
116
|
+
modelValue?: boolean
|
|
117
|
+
title?: string
|
|
118
|
+
width?: string | number
|
|
119
|
+
top?: string
|
|
120
|
+
/** 打开时垂直水平居中;false 时用 top */
|
|
121
|
+
alignCenter?: boolean
|
|
122
|
+
modal?: boolean
|
|
123
|
+
modalClass?: string
|
|
124
|
+
appendToBody?: boolean
|
|
125
|
+
appendTo?: string | HTMLElement
|
|
126
|
+
lockScroll?: boolean
|
|
127
|
+
closeOnClickModal?: boolean
|
|
128
|
+
closeOnPressEscape?: boolean
|
|
129
|
+
destroyOnClose?: boolean
|
|
130
|
+
beforeClose?: (done: () => void) => void
|
|
131
|
+
showFullscreen?: boolean
|
|
132
|
+
showMinimize?: boolean
|
|
133
|
+
/** 别名:优先于 showFullscreen */
|
|
134
|
+
maximizable?: boolean
|
|
135
|
+
/** 别名:优先于 showMinimize */
|
|
136
|
+
minimizable?: boolean
|
|
137
|
+
showClose?: boolean
|
|
138
|
+
fullscreen?: boolean
|
|
139
|
+
loading?: boolean
|
|
140
|
+
loadingText?: string
|
|
141
|
+
animated?: boolean
|
|
142
|
+
theme?: string
|
|
143
|
+
draggable?: boolean
|
|
144
|
+
/**
|
|
145
|
+
* 拖拽边界:
|
|
146
|
+
* - viewport / true:限制在可视窗口内(默认)
|
|
147
|
+
* - none / false:可拖出可视窗口外
|
|
148
|
+
*/
|
|
149
|
+
dragBound?: boolean | 'viewport' | 'none'
|
|
150
|
+
resizable?: boolean
|
|
151
|
+
openInTab?: boolean
|
|
152
|
+
minWidth?: number
|
|
153
|
+
minHeight?: number
|
|
154
|
+
zIndex?: number
|
|
155
|
+
}>(),
|
|
156
|
+
{
|
|
157
|
+
modelValue: false,
|
|
158
|
+
title: '',
|
|
159
|
+
width: '520px',
|
|
160
|
+
top: '15vh',
|
|
161
|
+
alignCenter: true,
|
|
162
|
+
modal: true,
|
|
163
|
+
modalClass: '',
|
|
164
|
+
appendToBody: true,
|
|
165
|
+
lockScroll: true,
|
|
166
|
+
closeOnClickModal: false,
|
|
167
|
+
closeOnPressEscape: false,
|
|
168
|
+
destroyOnClose: false,
|
|
169
|
+
showFullscreen: true,
|
|
170
|
+
showMinimize: true,
|
|
171
|
+
maximizable: undefined,
|
|
172
|
+
minimizable: undefined,
|
|
173
|
+
showClose: true,
|
|
174
|
+
fullscreen: false,
|
|
175
|
+
loading: false,
|
|
176
|
+
animated: true,
|
|
177
|
+
theme: 'default',
|
|
178
|
+
draggable: true,
|
|
179
|
+
dragBound: 'viewport',
|
|
180
|
+
resizable: true,
|
|
181
|
+
openInTab: false,
|
|
182
|
+
minWidth: 320,
|
|
183
|
+
minHeight: 180,
|
|
184
|
+
zIndex: 2000,
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
const emit = defineEmits<{
|
|
189
|
+
'update:modelValue': [boolean]
|
|
190
|
+
open: []
|
|
191
|
+
opened: []
|
|
192
|
+
close: []
|
|
193
|
+
closed: []
|
|
194
|
+
minimize: []
|
|
195
|
+
maximize: []
|
|
196
|
+
restore: []
|
|
197
|
+
}>()
|
|
198
|
+
|
|
199
|
+
const attrs = useAttrs()
|
|
200
|
+
const attrsWithoutClass = computed(() => {
|
|
201
|
+
const { class: _c, style: _s, ...rest } = attrs as Record<string, unknown>
|
|
202
|
+
return rest
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
const dialogVisible = useVModel(props, 'modelValue', emit)
|
|
206
|
+
const panelRef = ref<HTMLElement | null>(null)
|
|
207
|
+
const isFullscreen = ref(false)
|
|
208
|
+
const isMinimized = ref(false)
|
|
209
|
+
const box = ref<Box | null>(null)
|
|
210
|
+
const restoreBox = ref<Box | null>(null)
|
|
211
|
+
const dragging = ref(false)
|
|
212
|
+
const resizing = ref(false)
|
|
213
|
+
const closing = ref(false)
|
|
214
|
+
const zBoost = ref(0)
|
|
215
|
+
const contentAlive = ref(true)
|
|
216
|
+
|
|
217
|
+
const resizeDirs: ResizeDir[] = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw']
|
|
218
|
+
|
|
219
|
+
const teleportTo = computed(() => {
|
|
220
|
+
if (typeof props.appendTo === 'string') return props.appendTo
|
|
221
|
+
if (props.appendTo instanceof HTMLElement) return props.appendTo
|
|
222
|
+
return 'body'
|
|
223
|
+
})
|
|
224
|
+
const appendToBody = computed(() => props.appendToBody !== false)
|
|
225
|
+
|
|
226
|
+
const canMaximize = computed(() => props.maximizable ?? props.showFullscreen)
|
|
227
|
+
const canMinimize = computed(() => props.minimizable ?? props.showMinimize)
|
|
228
|
+
const canDrag = computed(() => props.draggable && !isFullscreen.value && !isMinimized.value)
|
|
229
|
+
const interacted = computed(() => !!box.value)
|
|
230
|
+
/** 是否限制拖拽在可视窗口内 */
|
|
231
|
+
const isViewportBound = computed(() => {
|
|
232
|
+
const v = props.dragBound
|
|
233
|
+
return v === true || v === 'viewport' || v === undefined
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
const rootClass = computed(() => ({
|
|
237
|
+
'is-open-in-tab': props.openInTab,
|
|
238
|
+
'is-minimized-root': isMinimized.value,
|
|
239
|
+
}))
|
|
240
|
+
|
|
241
|
+
const panelClass = computed(() => ({
|
|
242
|
+
[`qiu-dialog--${props.theme}`]: true,
|
|
243
|
+
'qiu-dialog--minimized': isMinimized.value,
|
|
244
|
+
'qiu-dialog--fullscreen': isFullscreen.value,
|
|
245
|
+
'qiu-dialog--centered': !interacted.value && !isFullscreen.value && !isMinimized.value && props.alignCenter,
|
|
246
|
+
'qiu-dialog--topped': !interacted.value && !isFullscreen.value && !isMinimized.value && !props.alignCenter,
|
|
247
|
+
'qiu-dialog--fixed-box': interacted.value && !isFullscreen.value && !isMinimized.value,
|
|
248
|
+
'qiu-dialog--unbounded': !isViewportBound.value && interacted.value && !isFullscreen.value && !isMinimized.value,
|
|
249
|
+
'qiu-dialog--dragging': dragging.value,
|
|
250
|
+
'qiu-dialog--resizing': resizing.value,
|
|
251
|
+
'qiu-dialog--animated': props.animated && !dragging.value && !resizing.value && !closing.value,
|
|
252
|
+
}))
|
|
253
|
+
|
|
254
|
+
const panelStyle = computed(() => {
|
|
255
|
+
const style: Record<string, string> = {
|
|
256
|
+
zIndex: String(props.zIndex + zBoost.value + (isMinimized.value ? 100 : 0)),
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (isMinimized.value) {
|
|
260
|
+
Object.assign(style, {
|
|
261
|
+
left: '16px',
|
|
262
|
+
bottom: '16px',
|
|
263
|
+
top: 'auto',
|
|
264
|
+
width: '240px',
|
|
265
|
+
height: '48px',
|
|
266
|
+
transform: 'none',
|
|
267
|
+
})
|
|
268
|
+
return style
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (isFullscreen.value) {
|
|
272
|
+
Object.assign(style, {
|
|
273
|
+
left: '0',
|
|
274
|
+
top: '0',
|
|
275
|
+
width: '100vw',
|
|
276
|
+
height: '100vh',
|
|
277
|
+
transform: 'none',
|
|
278
|
+
borderRadius: '0',
|
|
279
|
+
})
|
|
280
|
+
return style
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (box.value) {
|
|
284
|
+
Object.assign(style, {
|
|
285
|
+
left: `${box.value.left}px`,
|
|
286
|
+
top: `${box.value.top}px`,
|
|
287
|
+
width: `${box.value.width}px`,
|
|
288
|
+
height: `${box.value.height}px`,
|
|
289
|
+
transform: 'none',
|
|
290
|
+
})
|
|
291
|
+
return style
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// 未交互:居中或 top 定位
|
|
295
|
+
style.width = typeof props.width === 'number' ? `${props.width}px` : String(props.width || '520px')
|
|
296
|
+
if (!props.alignCenter) {
|
|
297
|
+
style.top = props.top || '15vh'
|
|
298
|
+
style.left = '50%'
|
|
299
|
+
style.transform = 'translateX(-50%)'
|
|
300
|
+
}
|
|
301
|
+
return style
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
const clampBox = (next: Box, mode: 'drag' | 'resize' = 'resize'): Box => {
|
|
305
|
+
const vw = window.innerWidth
|
|
306
|
+
const vh = window.innerHeight
|
|
307
|
+
const width = Math.max(props.minWidth, next.width)
|
|
308
|
+
const height = Math.max(props.minHeight, next.height)
|
|
309
|
+
|
|
310
|
+
// 允许拖出可视区:位置不限制;拉伸仍保证最小尺寸
|
|
311
|
+
if (!isViewportBound.value) {
|
|
312
|
+
return {
|
|
313
|
+
left: next.left,
|
|
314
|
+
top: next.top,
|
|
315
|
+
width: mode === 'resize' ? width : Math.max(props.minWidth, next.width),
|
|
316
|
+
height: mode === 'resize' ? height : Math.max(props.minHeight, next.height),
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// 可视窗口内:位置与尺寸都限制在窗口内
|
|
321
|
+
const maxW = Math.max(props.minWidth, vw - 8)
|
|
322
|
+
const maxH = Math.max(props.minHeight, vh - 8)
|
|
323
|
+
const w = Math.min(width, maxW)
|
|
324
|
+
const h = Math.min(height, maxH)
|
|
325
|
+
const left = Math.min(Math.max(0, next.left), Math.max(0, vw - w))
|
|
326
|
+
const top = Math.min(Math.max(0, next.top), Math.max(0, vh - h))
|
|
327
|
+
return { left, top, width: w, height: h }
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** 从当前 DOM 量出像素盒(首次拖拽/拉伸时调用) */
|
|
331
|
+
const captureBox = () => {
|
|
332
|
+
const el = panelRef.value
|
|
333
|
+
if (!el) return null
|
|
334
|
+
const rect = el.getBoundingClientRect()
|
|
335
|
+
const next = clampBox({
|
|
336
|
+
left: rect.left,
|
|
337
|
+
top: rect.top,
|
|
338
|
+
width: rect.width,
|
|
339
|
+
height: Math.max(rect.height, props.minHeight),
|
|
340
|
+
})
|
|
341
|
+
box.value = next
|
|
342
|
+
return next
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const ensureBox = () => box.value || captureBox()
|
|
346
|
+
|
|
347
|
+
const { lock: lockScroll, unlock: unlockScroll } = useBodyScrollLock()
|
|
348
|
+
const lockBodyScroll = (lock: boolean) => {
|
|
349
|
+
if (!props.lockScroll) return
|
|
350
|
+
if (lock) lockScroll()
|
|
351
|
+
else unlockScroll()
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const doClose = () => {
|
|
355
|
+
closing.value = true
|
|
356
|
+
emit('close')
|
|
357
|
+
dialogVisible.value = false
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const requestClose = () => {
|
|
361
|
+
if (props.beforeClose) {
|
|
362
|
+
props.beforeClose(() => doClose())
|
|
363
|
+
return
|
|
364
|
+
}
|
|
365
|
+
doClose()
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const onMaskMouseDown = () => {
|
|
369
|
+
if (props.closeOnClickModal) requestClose()
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const bringToFront = () => {
|
|
373
|
+
zBoost.value += 1
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
const toggleMaximize = () => {
|
|
377
|
+
if (isMinimized.value) {
|
|
378
|
+
restoreFromMinimize()
|
|
379
|
+
return
|
|
380
|
+
}
|
|
381
|
+
if (!isFullscreen.value) {
|
|
382
|
+
ensureBox()
|
|
383
|
+
if (box.value) restoreBox.value = { ...box.value }
|
|
384
|
+
isFullscreen.value = true
|
|
385
|
+
emit('maximize')
|
|
386
|
+
} else {
|
|
387
|
+
isFullscreen.value = false
|
|
388
|
+
if (restoreBox.value) box.value = { ...restoreBox.value }
|
|
389
|
+
emit('restore')
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const minimize = () => {
|
|
394
|
+
if (isFullscreen.value) isFullscreen.value = false
|
|
395
|
+
ensureBox()
|
|
396
|
+
if (box.value) restoreBox.value = { ...box.value }
|
|
397
|
+
isMinimized.value = true
|
|
398
|
+
emit('minimize')
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const restoreFromMinimize = () => {
|
|
402
|
+
isMinimized.value = false
|
|
403
|
+
if (restoreBox.value) box.value = { ...restoreBox.value }
|
|
404
|
+
emit('restore')
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const onMinimizedBarClick = () => {
|
|
408
|
+
if (isMinimized.value) restoreFromMinimize()
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
const onHeaderDblClick = () => {
|
|
412
|
+
if (isMinimized.value) restoreFromMinimize()
|
|
413
|
+
else toggleMaximize()
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
const onHeaderMouseDown = (e: MouseEvent) => {
|
|
417
|
+
if (!canDrag.value) return
|
|
418
|
+
if ((e.target as HTMLElement).closest('.qiu-dialog__actions')) return
|
|
419
|
+
e.preventDefault()
|
|
420
|
+
const origin = ensureBox()
|
|
421
|
+
if (!origin) return
|
|
422
|
+
|
|
423
|
+
dragging.value = true
|
|
424
|
+
const startX = e.clientX
|
|
425
|
+
const startY = e.clientY
|
|
426
|
+
|
|
427
|
+
const onMove = (ev: MouseEvent) => {
|
|
428
|
+
box.value = clampBox(
|
|
429
|
+
{
|
|
430
|
+
...origin,
|
|
431
|
+
left: origin.left + ev.clientX - startX,
|
|
432
|
+
top: origin.top + ev.clientY - startY,
|
|
433
|
+
},
|
|
434
|
+
'drag'
|
|
435
|
+
)
|
|
436
|
+
}
|
|
437
|
+
const onUp = () => {
|
|
438
|
+
dragging.value = false
|
|
439
|
+
document.removeEventListener('mousemove', onMove)
|
|
440
|
+
document.removeEventListener('mouseup', onUp)
|
|
441
|
+
}
|
|
442
|
+
document.addEventListener('mousemove', onMove)
|
|
443
|
+
document.addEventListener('mouseup', onUp)
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
const startResize = (e: MouseEvent, dir: ResizeDir) => {
|
|
447
|
+
const origin = ensureBox()
|
|
448
|
+
if (!origin) return
|
|
449
|
+
resizing.value = true
|
|
450
|
+
const startX = e.clientX
|
|
451
|
+
const startY = e.clientY
|
|
452
|
+
|
|
453
|
+
const onMove = (ev: MouseEvent) => {
|
|
454
|
+
const dx = ev.clientX - startX
|
|
455
|
+
const dy = ev.clientY - startY
|
|
456
|
+
let { left, top, width, height } = origin
|
|
457
|
+
|
|
458
|
+
if (dir.includes('e')) width = origin.width + dx
|
|
459
|
+
if (dir.includes('s')) height = origin.height + dy
|
|
460
|
+
if (dir.includes('w')) {
|
|
461
|
+
width = origin.width - dx
|
|
462
|
+
left = origin.left + dx
|
|
463
|
+
if (width < props.minWidth) {
|
|
464
|
+
width = props.minWidth
|
|
465
|
+
left = origin.left + origin.width - props.minWidth
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (dir.includes('n')) {
|
|
469
|
+
height = origin.height - dy
|
|
470
|
+
top = origin.top + dy
|
|
471
|
+
if (height < props.minHeight) {
|
|
472
|
+
height = props.minHeight
|
|
473
|
+
top = origin.top + origin.height - props.minHeight
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
box.value = clampBox({ left, top, width, height }, 'resize')
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
const onUp = () => {
|
|
480
|
+
resizing.value = false
|
|
481
|
+
document.removeEventListener('mousemove', onMove)
|
|
482
|
+
document.removeEventListener('mouseup', onUp)
|
|
483
|
+
}
|
|
484
|
+
document.addEventListener('mousemove', onMove)
|
|
485
|
+
document.addEventListener('mouseup', onUp)
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
const onKeydown = (e: KeyboardEvent) => {
|
|
489
|
+
if (!dialogVisible.value || isMinimized.value) return
|
|
490
|
+
if (props.closeOnPressEscape && e.key === 'Escape') requestClose()
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
const resetState = () => {
|
|
494
|
+
isMinimized.value = false
|
|
495
|
+
isFullscreen.value = !!props.fullscreen
|
|
496
|
+
box.value = null
|
|
497
|
+
restoreBox.value = null
|
|
498
|
+
closing.value = false
|
|
499
|
+
dragging.value = false
|
|
500
|
+
resizing.value = false
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
watch(
|
|
504
|
+
() => props.fullscreen,
|
|
505
|
+
(v) => {
|
|
506
|
+
isFullscreen.value = !!v
|
|
507
|
+
},
|
|
508
|
+
{ immediate: true }
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
watch(dialogVisible, async (v) => {
|
|
512
|
+
if (v) {
|
|
513
|
+
closing.value = false
|
|
514
|
+
if (props.destroyOnClose) contentAlive.value = true
|
|
515
|
+
lockBodyScroll(true)
|
|
516
|
+
emit('open')
|
|
517
|
+
await nextTick()
|
|
518
|
+
// 居中模式下预计算像素盒会破坏 CSS 居中;保持 CSS,直到用户拖拽/拉伸
|
|
519
|
+
if (!props.alignCenter && !box.value && panelRef.value) {
|
|
520
|
+
// top 模式也等用户交互再固化
|
|
521
|
+
}
|
|
522
|
+
emit('opened')
|
|
523
|
+
} else {
|
|
524
|
+
lockBodyScroll(false)
|
|
525
|
+
emit('closed')
|
|
526
|
+
// 关闭完成后再清状态,避免关闭瞬间尺寸跳动
|
|
527
|
+
resetState()
|
|
528
|
+
if (props.destroyOnClose) contentAlive.value = false
|
|
529
|
+
}
|
|
530
|
+
})
|
|
531
|
+
|
|
532
|
+
onMounted(() => {
|
|
533
|
+
document.addEventListener('keydown', onKeydown)
|
|
534
|
+
if (dialogVisible.value) lockBodyScroll(true)
|
|
535
|
+
})
|
|
536
|
+
|
|
537
|
+
onBeforeUnmount(() => {
|
|
538
|
+
document.removeEventListener('keydown', onKeydown)
|
|
539
|
+
lockBodyScroll(false)
|
|
540
|
+
})
|
|
541
|
+
</script>
|
|
542
|
+
|
|
543
|
+
<style lang="scss" scoped>
|
|
544
|
+
.qiu-dialog-root {
|
|
545
|
+
position: fixed;
|
|
546
|
+
inset: 0;
|
|
547
|
+
pointer-events: none;
|
|
548
|
+
|
|
549
|
+
&.is-open-in-tab {
|
|
550
|
+
position: absolute;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
&.is-minimized-root {
|
|
554
|
+
.qiu-dialog__mask {
|
|
555
|
+
display: none;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.qiu-dialog__mask {
|
|
561
|
+
position: absolute;
|
|
562
|
+
inset: 0;
|
|
563
|
+
pointer-events: auto;
|
|
564
|
+
background: var(--qiu-overlay-color-lighter, rgba(0, 0, 0, 0.45));
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.qiu-dialog {
|
|
568
|
+
position: fixed;
|
|
569
|
+
display: flex;
|
|
570
|
+
flex-direction: column;
|
|
571
|
+
max-width: calc(100vw - 8px);
|
|
572
|
+
max-height: calc(100vh - 8px);
|
|
573
|
+
pointer-events: auto;
|
|
574
|
+
background: var(--qiu-bg-color, #fff);
|
|
575
|
+
border: 1px solid var(--qiu-border-color-lighter, #ebeef5);
|
|
576
|
+
border-radius: 8px;
|
|
577
|
+
box-shadow: var(--qiu-box-shadow, 0 12px 32px rgba(0, 0, 0, 0.12));
|
|
578
|
+
box-sizing: border-box;
|
|
579
|
+
overflow: visible;
|
|
580
|
+
|
|
581
|
+
&.qiu-dialog--animated {
|
|
582
|
+
transition: box-shadow 0.2s ease, opacity 0.2s ease;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
&.qiu-dialog--centered {
|
|
586
|
+
top: 50%;
|
|
587
|
+
left: 50%;
|
|
588
|
+
transform: translate(-50%, -50%);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
&.qiu-dialog--topped {
|
|
592
|
+
/* left/transform 由 inline style 控制 */
|
|
593
|
+
top: auto;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
&.qiu-dialog--fixed-box,
|
|
597
|
+
&.qiu-dialog--fullscreen {
|
|
598
|
+
transform: none;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
&.qiu-dialog--minimized {
|
|
602
|
+
overflow: hidden;
|
|
603
|
+
border-radius: 8px;
|
|
604
|
+
|
|
605
|
+
.qiu-dialog__header {
|
|
606
|
+
height: 48px;
|
|
607
|
+
min-height: 48px;
|
|
608
|
+
padding: 0 8px 0 12px;
|
|
609
|
+
cursor: pointer;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
&.qiu-dialog--fullscreen {
|
|
614
|
+
border-radius: 0;
|
|
615
|
+
max-width: none;
|
|
616
|
+
max-height: none;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/* 允许拖出可视区时取消 max 限制,否则会被 CSS 卡住 */
|
|
620
|
+
&.qiu-dialog--unbounded {
|
|
621
|
+
max-width: none;
|
|
622
|
+
max-height: none;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.qiu-dialog__header {
|
|
627
|
+
position: relative;
|
|
628
|
+
z-index: 2;
|
|
629
|
+
display: flex;
|
|
630
|
+
flex-shrink: 0;
|
|
631
|
+
align-items: center;
|
|
632
|
+
min-height: 48px;
|
|
633
|
+
padding: 10px 108px 10px 16px;
|
|
634
|
+
border-bottom: 1px solid var(--qiu-border-color-lighter, #ebeef5);
|
|
635
|
+
user-select: none;
|
|
636
|
+
box-sizing: border-box;
|
|
637
|
+
|
|
638
|
+
&.is-movable {
|
|
639
|
+
cursor: move;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.qiu-dialog__title {
|
|
644
|
+
flex: 1;
|
|
645
|
+
min-width: 0;
|
|
646
|
+
overflow: hidden;
|
|
647
|
+
font-size: 16px;
|
|
648
|
+
font-weight: 600;
|
|
649
|
+
line-height: 1.4;
|
|
650
|
+
color: var(--qiu-text-color-primary, #303133);
|
|
651
|
+
text-overflow: ellipsis;
|
|
652
|
+
white-space: nowrap;
|
|
653
|
+
pointer-events: none;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.qiu-dialog__actions {
|
|
657
|
+
position: absolute;
|
|
658
|
+
top: 50%;
|
|
659
|
+
right: 8px;
|
|
660
|
+
display: inline-flex;
|
|
661
|
+
gap: 2px;
|
|
662
|
+
align-items: center;
|
|
663
|
+
transform: translateY(-50%);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.qiu-dialog__btn {
|
|
667
|
+
display: inline-flex;
|
|
668
|
+
align-items: center;
|
|
669
|
+
justify-content: center;
|
|
670
|
+
width: 32px;
|
|
671
|
+
height: 32px;
|
|
672
|
+
padding: 0;
|
|
673
|
+
color: var(--qiu-color-info, #909399);
|
|
674
|
+
cursor: pointer;
|
|
675
|
+
background: transparent;
|
|
676
|
+
border: 0;
|
|
677
|
+
border-radius: 4px;
|
|
678
|
+
outline: none;
|
|
679
|
+
|
|
680
|
+
&:hover {
|
|
681
|
+
color: var(--qiu-color-primary, #409eff);
|
|
682
|
+
background: var(--qiu-fill-color-light, #f5f7fa);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
:deep(.qiu-icon) {
|
|
686
|
+
font-size: 16px;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.qiu-dialog__body {
|
|
691
|
+
position: relative;
|
|
692
|
+
z-index: 2;
|
|
693
|
+
display: flex;
|
|
694
|
+
flex-direction: column;
|
|
695
|
+
flex: 1 1 auto;
|
|
696
|
+
min-width: 0;
|
|
697
|
+
min-height: 0;
|
|
698
|
+
padding: 16px;
|
|
699
|
+
overflow: auto;
|
|
700
|
+
box-sizing: border-box;
|
|
701
|
+
color: var(--qiu-text-color-regular, #606266);
|
|
702
|
+
font-size: 14px;
|
|
703
|
+
|
|
704
|
+
&.is-loading {
|
|
705
|
+
pointer-events: none;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.qiu-dialog__loading {
|
|
710
|
+
position: absolute;
|
|
711
|
+
inset: 0;
|
|
712
|
+
z-index: 5;
|
|
713
|
+
display: flex;
|
|
714
|
+
flex-direction: column;
|
|
715
|
+
gap: 8px;
|
|
716
|
+
align-items: center;
|
|
717
|
+
justify-content: center;
|
|
718
|
+
background: color-mix(in srgb, var(--qiu-bg-color, #fff) 72%, transparent);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.qiu-dialog__spinner {
|
|
722
|
+
width: 28px;
|
|
723
|
+
height: 28px;
|
|
724
|
+
border: 2px solid var(--qiu-color-primary, #0f766e);
|
|
725
|
+
border-right-color: transparent;
|
|
726
|
+
border-radius: 50%;
|
|
727
|
+
animation: qiu-dialog-spin 0.7s linear infinite;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.qiu-dialog__loading-text {
|
|
731
|
+
font-size: 13px;
|
|
732
|
+
color: var(--qiu-text-color-secondary, #909399);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
@keyframes qiu-dialog-spin {
|
|
736
|
+
to {
|
|
737
|
+
transform: rotate(360deg);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.qiu-dialog__footer {
|
|
742
|
+
position: relative;
|
|
743
|
+
z-index: 2;
|
|
744
|
+
display: flex;
|
|
745
|
+
flex-shrink: 0;
|
|
746
|
+
gap: 8px;
|
|
747
|
+
align-items: center;
|
|
748
|
+
justify-content: flex-end;
|
|
749
|
+
padding: 12px 16px;
|
|
750
|
+
border-top: 1px solid var(--qiu-border-color-lighter, #ebeef5);
|
|
751
|
+
box-sizing: border-box;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/*
|
|
755
|
+
拉伸热区全部贴在面板「外侧」:
|
|
756
|
+
- 右边用 left:100%(从右边界向外),绝不压到纵向滚动条
|
|
757
|
+
- 下边用 top:100%,不压横向滚动条
|
|
758
|
+
*/
|
|
759
|
+
.qiu-dialog__resize {
|
|
760
|
+
position: absolute;
|
|
761
|
+
z-index: 5;
|
|
762
|
+
background: transparent;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.qiu-dialog__resize--n {
|
|
766
|
+
bottom: 100%;
|
|
767
|
+
left: 8px;
|
|
768
|
+
right: 8px;
|
|
769
|
+
height: 8px;
|
|
770
|
+
cursor: ns-resize;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.qiu-dialog__resize--s {
|
|
774
|
+
top: 100%;
|
|
775
|
+
left: 8px;
|
|
776
|
+
right: 8px;
|
|
777
|
+
height: 8px;
|
|
778
|
+
cursor: ns-resize;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.qiu-dialog__resize--e {
|
|
782
|
+
left: 100%;
|
|
783
|
+
top: 8px;
|
|
784
|
+
bottom: 8px;
|
|
785
|
+
width: 8px;
|
|
786
|
+
cursor: ew-resize;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.qiu-dialog__resize--w {
|
|
790
|
+
right: 100%;
|
|
791
|
+
top: 8px;
|
|
792
|
+
bottom: 8px;
|
|
793
|
+
width: 8px;
|
|
794
|
+
cursor: ew-resize;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.qiu-dialog__resize--ne {
|
|
798
|
+
left: 100%;
|
|
799
|
+
bottom: 100%;
|
|
800
|
+
width: 12px;
|
|
801
|
+
height: 12px;
|
|
802
|
+
cursor: nesw-resize;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.qiu-dialog__resize--nw {
|
|
806
|
+
right: 100%;
|
|
807
|
+
bottom: 100%;
|
|
808
|
+
width: 12px;
|
|
809
|
+
height: 12px;
|
|
810
|
+
cursor: nwse-resize;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.qiu-dialog__resize--se {
|
|
814
|
+
left: 100%;
|
|
815
|
+
top: 100%;
|
|
816
|
+
width: 12px;
|
|
817
|
+
height: 12px;
|
|
818
|
+
cursor: nwse-resize;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.qiu-dialog__resize--sw {
|
|
822
|
+
right: 100%;
|
|
823
|
+
top: 100%;
|
|
824
|
+
width: 12px;
|
|
825
|
+
height: 12px;
|
|
826
|
+
cursor: nesw-resize;
|
|
827
|
+
}
|
|
828
|
+
</style>
|