@aifuxi/semi-ui-vue 0.1.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 +22 -0
- package/dist/Button-RCaDTqHh.js +249 -0
- package/dist/Collapsible-DeV0aJ4n.js +199 -0
- package/dist/Cropper-Dy1LPBDN.js +587 -0
- package/dist/Divider-BQmwhGfH.js +57 -0
- package/dist/Input-BYWFIgNn.js +593 -0
- package/dist/InputNumber-BaeViVtG.js +856 -0
- package/dist/Modal-BhmFYVFw.js +975 -0
- package/dist/Pagination-4JvS-gHR.js +572 -0
- package/dist/Progress-BulSV_JR.js +523 -0
- package/dist/SBOM.spdx.json +165 -0
- package/dist/SelectOption-Ce-Lst-e.js +1473 -0
- package/dist/Slider-w9sbxzBw.js +707 -0
- package/dist/Spin-CuFLkqev.js +222 -0
- package/dist/THIRD_PARTY_LICENSES/Semi-Design.txt +83 -0
- package/dist/THIRD_PARTY_LICENSES/async-validator.txt +9 -0
- package/dist/THIRD_PARTY_LICENSES/bezier-easing.txt +22 -0
- package/dist/THIRD_PARTY_LICENSES/date-fns-tz.txt +21 -0
- package/dist/THIRD_PARTY_LICENSES/date-fns.txt +21 -0
- package/dist/THIRD_PARTY_LICENSES/lodash.txt +47 -0
- package/dist/THIRD_PARTY_LICENSES/scroll-into-view-if-needed.txt +21 -0
- package/dist/THIRD_PARTY_NOTICES.md +23 -0
- package/dist/Tooltip-Bq7HZwnS.js +1321 -0
- package/dist/Tree-tqy5xBYJ.js +1275 -0
- package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/anchor/Anchor.vue.d.ts +29 -0
- package/dist/anchor/AnchorLink.vue.d.ts +16 -0
- package/dist/anchor/AnchorNodeRenderer.d.ts +15 -0
- package/dist/anchor/anchor-context.d.ts +18 -0
- package/dist/anchor/index.d.ts +11 -0
- package/dist/anchor/index.js +2 -0
- package/dist/anchor/types.d.ts +43 -0
- package/dist/anchor-DW0p2t-I.js +503 -0
- package/dist/arrayMove-ByVCXfhS.js +7 -0
- package/dist/auto-complete/AutoComplete.vue.d.ts +33 -0
- package/dist/auto-complete/AutoCompleteNodeRenderer.d.ts +15 -0
- package/dist/auto-complete/AutoCompleteOption.vue.d.ts +19 -0
- package/dist/auto-complete/index.d.ts +10 -0
- package/dist/auto-complete/index.js +2 -0
- package/dist/auto-complete/types.d.ts +117 -0
- package/dist/auto-complete/use-auto-complete-foundation.d.ts +40 -0
- package/dist/auto-complete-BeahBlt9.js +765 -0
- package/dist/avatar/Avatar.vue.d.ts +26 -0
- package/dist/avatar/AvatarGroup.d.ts +54 -0
- package/dist/avatar/AvatarNodeRenderer.d.ts +15 -0
- package/dist/avatar/TopSlotSvg.vue.d.ts +7 -0
- package/dist/avatar/index.d.ts +10 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/types.d.ts +86 -0
- package/dist/avatar-B00xjEzD.js +551 -0
- package/dist/back-top/BackTop.vue.d.ts +19 -0
- package/dist/back-top/index.d.ts +3 -0
- package/dist/back-top/index.js +2 -0
- package/dist/back-top/types.d.ts +15 -0
- package/dist/back-top-C2XqUzoN.js +123 -0
- package/dist/badge/Badge.vue.d.ts +23 -0
- package/dist/badge/BadgeNodeRenderer.d.ts +15 -0
- package/dist/badge/index.d.ts +6 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge/types.d.ts +29 -0
- package/dist/badge-gWsDkzyt.js +120 -0
- package/dist/banner/Banner.vue.d.ts +19 -0
- package/dist/banner/BannerNodeRenderer.d.ts +15 -0
- package/dist/banner/index.d.ts +6 -0
- package/dist/banner/index.js +2 -0
- package/dist/banner/types.d.ts +25 -0
- package/dist/banner-B3O4uDoR.js +220 -0
- package/dist/breadcrumb/Breadcrumb.d.ts +129 -0
- package/dist/breadcrumb/BreadcrumbIconRenderer.d.ts +23 -0
- package/dist/breadcrumb/BreadcrumbItem.vue.d.ts +19 -0
- package/dist/breadcrumb/BreadcrumbNodeRenderer.d.ts +15 -0
- package/dist/breadcrumb/BreadcrumbPopover.vue.d.ts +17 -0
- package/dist/breadcrumb/BreadcrumbPopoverArrow.vue.d.ts +3 -0
- package/dist/breadcrumb/breadcrumb-context.d.ts +9 -0
- package/dist/breadcrumb/index.d.ts +11 -0
- package/dist/breadcrumb/index.js +2 -0
- package/dist/breadcrumb/types.d.ts +72 -0
- package/dist/breadcrumb-BmBbFmGK.js +451 -0
- package/dist/button/Button.vue.d.ts +34 -0
- package/dist/button/ButtonAiLoadingIcon.vue.d.ts +3 -0
- package/dist/button/ButtonGroup.d.ts +69 -0
- package/dist/button/ButtonIconRenderer.d.ts +28 -0
- package/dist/button/ButtonLoadingIcon.vue.d.ts +3 -0
- package/dist/button/SplitButtonGroup.vue.d.ts +16 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.js +3 -0
- package/dist/button/types.d.ts +57 -0
- package/dist/button-Rcn5pYGh.js +134 -0
- package/dist/calendar/Calendar.vue.d.ts +29 -0
- package/dist/calendar/CalendarDay.vue.d.ts +3 -0
- package/dist/calendar/CalendarMonth.vue.d.ts +3 -0
- package/dist/calendar/CalendarNodeRenderer.d.ts +15 -0
- package/dist/calendar/CalendarTimeColumn.vue.d.ts +6 -0
- package/dist/calendar/CalendarWeek.vue.d.ts +8 -0
- package/dist/calendar/index.d.ts +6 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/types.d.ts +67 -0
- package/dist/calendar-CJTrr4y5.js +1172 -0
- package/dist/card/Card.vue.d.ts +16 -0
- package/dist/card/CardGroup.vue.d.ts +13 -0
- package/dist/card/CardMeta.vue.d.ts +11 -0
- package/dist/card/CardNodeRenderer.d.ts +15 -0
- package/dist/card/CardSkeleton.vue.d.ts +3 -0
- package/dist/card/card-content.d.ts +2 -0
- package/dist/card/index.d.ts +11 -0
- package/dist/card/index.js +2 -0
- package/dist/card/types.d.ts +56 -0
- package/dist/card-DwMOFi6_.js +348 -0
- package/dist/carousel/Carousel.vue.d.ts +29 -0
- package/dist/carousel/CarouselArrow.vue.d.ts +15 -0
- package/dist/carousel/CarouselIndicator.vue.d.ts +17 -0
- package/dist/carousel/CarouselItemRenderer.d.ts +34 -0
- package/dist/carousel/CarouselNodeRenderer.d.ts +15 -0
- package/dist/carousel/index.d.ts +6 -0
- package/dist/carousel/index.js +2 -0
- package/dist/carousel/types.d.ts +70 -0
- package/dist/carousel/use-carousel-foundation.d.ts +19 -0
- package/dist/carousel-B4WlIRJH.js +458 -0
- package/dist/cascader/Cascader.vue.d.ts +71 -0
- package/dist/cascader/CascaderNodeRenderer.d.ts +15 -0
- package/dist/cascader/CascaderPanel.vue.d.ts +36 -0
- package/dist/cascader/index.d.ts +6 -0
- package/dist/cascader/index.js +2 -0
- package/dist/cascader/types.d.ts +192 -0
- package/dist/cascader-Ch6clCeh.js +1525 -0
- package/dist/checkbox/Checkbox.vue.d.ts +19 -0
- package/dist/checkbox/CheckboxGroup.d.ts +161 -0
- package/dist/checkbox/CheckboxNodeRenderer.d.ts +15 -0
- package/dist/checkbox/checkbox-context.d.ts +11 -0
- package/dist/checkbox/index.d.ts +10 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/types.d.ts +92 -0
- package/dist/checkbox-mJD1ou6k.js +479 -0
- package/dist/collapse/Collapse.vue.d.ts +140 -0
- package/dist/collapse/CollapseNodeRenderer.d.ts +15 -0
- package/dist/collapse/CollapsePanel.vue.d.ts +99 -0
- package/dist/collapse/collapse-context.d.ts +14 -0
- package/dist/collapse/index.d.ts +10 -0
- package/dist/collapse/index.js +2 -0
- package/dist/collapse/types.d.ts +50 -0
- package/dist/collapse-7YtQLWqt.js +278 -0
- package/dist/collapsible/Collapsible.vue.d.ts +136 -0
- package/dist/collapsible/index.d.ts +5 -0
- package/dist/collapsible/index.js +5 -0
- package/dist/collapsible/types.d.ts +28 -0
- package/dist/color-picker/AlphaSlider.vue.d.ts +14 -0
- package/dist/color-picker/ColorChooseArea.vue.d.ts +20 -0
- package/dist/color-picker/ColorDataPart.vue.d.ts +15 -0
- package/dist/color-picker/ColorPicker.vue.d.ts +28 -0
- package/dist/color-picker/ColorPickerNodeRenderer.d.ts +17 -0
- package/dist/color-picker/ColorPickerPanel.vue.d.ts +37 -0
- package/dist/color-picker/ColorSlider.vue.d.ts +13 -0
- package/dist/color-picker/index.d.ts +10 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/color-picker/types.d.ts +67 -0
- package/dist/color-picker-ChC7qsx0.js +885 -0
- package/dist/config-context-CyynTtDb.js +4 -0
- package/dist/config-provider/ConfigConsumer.vue.d.ts +11 -0
- package/dist/config-provider/ConfigProvider.vue.d.ts +16 -0
- package/dist/config-provider/config-context.d.ts +3 -0
- package/dist/config-provider/constants.d.ts +4 -0
- package/dist/config-provider/index.d.ts +13 -0
- package/dist/config-provider/index.js +3 -0
- package/dist/config-provider/semi-global.d.ts +6 -0
- package/dist/config-provider/types.d.ts +74 -0
- package/dist/config-provider/use-responsive-observe.d.ts +6 -0
- package/dist/config-provider-VMfNNSF1.js +188 -0
- package/dist/constants-BF9bZJyc.js +45 -0
- package/dist/constants-BNwzO87W.js +9 -0
- package/dist/cropper/Cropper.vue.d.ts +18 -0
- package/dist/cropper/index.d.ts +4 -0
- package/dist/cropper/index.js +5 -0
- package/dist/cropper/types.d.ts +51 -0
- package/dist/date-picker/DatePicker.vue.d.ts +41 -0
- package/dist/date-picker/DatePickerMonth.vue.d.ts +25 -0
- package/dist/date-picker/DatePickerNodeRenderer.d.ts +17 -0
- package/dist/date-picker/DatePickerPanel.vue.d.ts +33 -0
- package/dist/date-picker/index.d.ts +5 -0
- package/dist/date-picker/index.js +2 -0
- package/dist/date-picker/types.d.ts +211 -0
- package/dist/date-picker-B2lhlKHD.js +2207 -0
- package/dist/descriptions/Descriptions.vue.d.ts +96 -0
- package/dist/descriptions/DescriptionsItem.vue.d.ts +96 -0
- package/dist/descriptions/DescriptionsNodeRenderer.d.ts +15 -0
- package/dist/descriptions/descriptions-context.d.ts +7 -0
- package/dist/descriptions/index.d.ts +10 -0
- package/dist/descriptions/index.js +2 -0
- package/dist/descriptions/types.d.ts +45 -0
- package/dist/descriptions-BU6ahbge.js +272 -0
- package/dist/divider/Divider.vue.d.ts +15 -0
- package/dist/divider/DividerContentRenderer.d.ts +17 -0
- package/dist/divider/index.d.ts +3 -0
- package/dist/divider/index.js +3 -0
- package/dist/divider/types.d.ts +13 -0
- package/dist/divider-DA9U4uOl.js +8 -0
- package/dist/dropdown/Dropdown.vue.d.ts +23 -0
- package/dist/dropdown/DropdownDivider.vue.d.ts +4 -0
- package/dist/dropdown/DropdownItem.vue.d.ts +28 -0
- package/dist/dropdown/DropdownMenu.vue.d.ts +11 -0
- package/dist/dropdown/DropdownNodeRenderer.d.ts +15 -0
- package/dist/dropdown/DropdownTitle.vue.d.ts +11 -0
- package/dist/dropdown/DropdownTriggerRenderer.d.ts +45 -0
- package/dist/dropdown/dropdown-context.d.ts +8 -0
- package/dist/dropdown/index.d.ts +17 -0
- package/dist/dropdown/index.js +2 -0
- package/dist/dropdown/types.d.ts +98 -0
- package/dist/dropdown-D0-UWd65.js +665 -0
- package/dist/empty/Empty.vue.d.ts +13 -0
- package/dist/empty/EmptyNodeRenderer.d.ts +15 -0
- package/dist/empty/index.d.ts +6 -0
- package/dist/empty/index.js +2 -0
- package/dist/empty/types.d.ts +27 -0
- package/dist/empty-Bpms8Z5w.js +152 -0
- package/dist/env-BeIzjQx7.js +4 -0
- package/dist/es-CAWQuPuV.js +93 -0
- package/dist/float-button/FloatButton.vue.d.ts +20 -0
- package/dist/float-button/FloatButtonBadge.vue.d.ts +18 -0
- package/dist/float-button/FloatButtonGroup.vue.d.ts +17 -0
- package/dist/float-button/FloatButtonNodeRenderer.d.ts +17 -0
- package/dist/float-button/index.d.ts +4 -0
- package/dist/float-button/index.js +2 -0
- package/dist/float-button/types.d.ts +59 -0
- package/dist/float-button-qU3b0WBX.js +190 -0
- package/dist/form/ArrayField.d.ts +24 -0
- package/dist/form/Form.vue.d.ts +38 -0
- package/dist/form/FormErrorMessage.vue.d.ts +4 -0
- package/dist/form/FormField.d.ts +9 -0
- package/dist/form/FormInputGroup.d.ts +62 -0
- package/dist/form/FormLabel.vue.d.ts +18 -0
- package/dist/form/FormNodeRenderer.d.ts +15 -0
- package/dist/form/FormSection.vue.d.ts +16 -0
- package/dist/form/FormSlot.d.ts +3 -0
- package/dist/form/form-context.d.ts +4 -0
- package/dist/form/index.d.ts +68 -0
- package/dist/form/index.js +3 -0
- package/dist/form/internal-types.d.ts +67 -0
- package/dist/form/types.d.ts +273 -0
- package/dist/form/use-form.d.ts +11 -0
- package/dist/form/with-form.d.ts +3 -0
- package/dist/form-CLhGuORQ.js +2030 -0
- package/dist/foundation-Cawx37mp.js +1819 -0
- package/dist/grid/Col.vue.d.ts +13 -0
- package/dist/grid/Row.vue.d.ts +14 -0
- package/dist/grid/grid-context.d.ts +6 -0
- package/dist/grid/index.d.ts +5 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/media-query.d.ts +2 -0
- package/dist/grid/types.d.ts +44 -0
- package/dist/grid-Cn2uBhRd.js +161 -0
- package/dist/highlight/Highlight.vue.d.ts +10 -0
- package/dist/highlight/HighlightNodeRenderer.d.ts +49 -0
- package/dist/highlight/index.d.ts +4 -0
- package/dist/highlight/index.js +2 -0
- package/dist/highlight/internal-types.d.ts +8 -0
- package/dist/highlight/types.d.ts +17 -0
- package/dist/highlight-DHX3RV0C.js +158 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.js +2 -0
- package/dist/image/Image.vue.d.ts +21 -0
- package/dist/image/ImageNodeRenderer.d.ts +15 -0
- package/dist/image/ImagePreview.vue.d.ts +56 -0
- package/dist/image/ImagePreviewFooter.vue.d.ts +38 -0
- package/dist/image/ImagePreviewHeader.vue.d.ts +17 -0
- package/dist/image/ImagePreviewImage.vue.d.ts +27 -0
- package/dist/image/ImagePreviewInner.vue.d.ts +54 -0
- package/dist/image/image-context.d.ts +14 -0
- package/dist/image/index.d.ts +6 -0
- package/dist/image/index.js +2 -0
- package/dist/image/types.d.ts +183 -0
- package/dist/image-C-ifCh_9.js +1615 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +75 -0
- package/dist/input/Input.vue.d.ts +58 -0
- package/dist/input/InputGroup.d.ts +69 -0
- package/dist/input/InputNodeRenderer.d.ts +15 -0
- package/dist/input/TextArea.vue.d.ts +50 -0
- package/dist/input/index.d.ts +11 -0
- package/dist/input/index.js +2 -0
- package/dist/input/types.d.ts +168 -0
- package/dist/input-number/InputNumber.vue.d.ts +52 -0
- package/dist/input-number/index.d.ts +10 -0
- package/dist/input-number/index.js +5 -0
- package/dist/input-number/types.d.ts +56 -0
- package/dist/input-wf0nZCRS.js +747 -0
- package/dist/isBefore-BG1hiM9f.js +37 -0
- package/dist/isElement-Cx0AsIov.js +11 -0
- package/dist/isEnterPress-HTy0eCBp.js +8 -0
- package/dist/isNullOrUndefined-Cg6MZ8r3.js +6 -0
- package/dist/isPromise-D2v3Ejff.js +11 -0
- package/dist/keyCode-DMNg63wX.js +110 -0
- package/dist/layout/Layout.vue.d.ts +14 -0
- package/dist/layout/LayoutContent.vue.d.ts +14 -0
- package/dist/layout/LayoutFooter.vue.d.ts +14 -0
- package/dist/layout/LayoutHeader.vue.d.ts +14 -0
- package/dist/layout/LayoutSection.vue.d.ts +17 -0
- package/dist/layout/LayoutSider.vue.d.ts +18 -0
- package/dist/layout/index.d.ts +17 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout/layout-context.d.ts +6 -0
- package/dist/layout/media-query.d.ts +4 -0
- package/dist/layout/types.d.ts +31 -0
- package/dist/layout-tq-_l_O3.js +171 -0
- package/dist/list/List.vue.d.ts +22 -0
- package/dist/list/ListItem.vue.d.ts +88 -0
- package/dist/list/ListNodeRenderer.d.ts +15 -0
- package/dist/list/ListSpin.vue.d.ts +16 -0
- package/dist/list/index.d.ts +10 -0
- package/dist/list/index.js +2 -0
- package/dist/list/list-context.d.ts +8 -0
- package/dist/list/types.d.ts +66 -0
- package/dist/list-DHIOE2Y-.js +387 -0
- package/dist/modal/ConfirmModal.vue.d.ts +14 -0
- package/dist/modal/Modal.vue.d.ts +15 -0
- package/dist/modal/ModalDefaultFooter.vue.d.ts +22 -0
- package/dist/modal/ModalDialog.vue.d.ts +53 -0
- package/dist/modal/ModalInnerContent.vue.d.ts +38 -0
- package/dist/modal/ModalNodeRenderer.d.ts +15 -0
- package/dist/modal/imperative.d.ts +9 -0
- package/dist/modal/index.d.ts +8 -0
- package/dist/modal/index.js +2 -0
- package/dist/modal/types.d.ts +92 -0
- package/dist/modal/use-modal.d.ts +2 -0
- package/dist/modal-YVolL7Hz.js +221 -0
- package/dist/navigation/CollapseButton.vue.d.ts +12 -0
- package/dist/navigation/NavFooter.vue.d.ts +15 -0
- package/dist/navigation/NavHeader.vue.d.ts +13 -0
- package/dist/navigation/NavItem.d.ts +177 -0
- package/dist/navigation/Navigation.vue.d.ts +29 -0
- package/dist/navigation/NavigationContextProvider.d.ts +16 -0
- package/dist/navigation/NavigationIconRenderer.d.ts +45 -0
- package/dist/navigation/NavigationItemTree.vue.d.ts +8 -0
- package/dist/navigation/NavigationNodeRenderer.d.ts +18 -0
- package/dist/navigation/SubNav.vue.d.ts +18 -0
- package/dist/navigation/index.d.ts +14 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/navigation-context.d.ts +35 -0
- package/dist/navigation/types.d.ts +177 -0
- package/dist/navigation-DF8R5jFK.js +1479 -0
- package/dist/notification/NotificationHost.vue.d.ts +7 -0
- package/dist/notification/NotificationNodeRenderer.d.ts +15 -0
- package/dist/notification/NotificationNotice.vue.d.ts +16 -0
- package/dist/notification/imperative.d.ts +12 -0
- package/dist/notification/index.d.ts +6 -0
- package/dist/notification/index.js +2 -0
- package/dist/notification/notification-store.d.ts +24 -0
- package/dist/notification/types.d.ts +63 -0
- package/dist/notification/use-notification.d.ts +2 -0
- package/dist/notification-DIsvgiIO.js +445 -0
- package/dist/overflow-list/OverflowList.vue.d.ts +131 -0
- package/dist/overflow-list/OverflowListNodeRenderer.d.ts +35 -0
- package/dist/overflow-list/index.d.ts +5 -0
- package/dist/overflow-list/index.js +2 -0
- package/dist/overflow-list/types.d.ts +35 -0
- package/dist/overflow-list-Df6ixrtB.js +413 -0
- package/dist/pagination/Pagination.vue.d.ts +25 -0
- package/dist/pagination/PaginationNodeRenderer.d.ts +15 -0
- package/dist/pagination/PaginationPopover.vue.d.ts +25 -0
- package/dist/pagination/PaginationRestList.vue.d.ts +11 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.js +2 -0
- package/dist/pagination/types.d.ts +46 -0
- package/dist/pin-code/PinCode.vue.d.ts +20 -0
- package/dist/pin-code/index.d.ts +10 -0
- package/dist/pin-code/index.js +2 -0
- package/dist/pin-code/types.d.ts +25 -0
- package/dist/pin-code-wY5g0KLD.js +193 -0
- package/dist/popconfirm/Popconfirm.vue.d.ts +25 -0
- package/dist/popconfirm/PopconfirmNodeRenderer.d.ts +15 -0
- package/dist/popconfirm/index.d.ts +4 -0
- package/dist/popconfirm/index.js +2 -0
- package/dist/popconfirm/types.d.ts +57 -0
- package/dist/popconfirm-DQUtvI0A.js +389 -0
- package/dist/popover/Popover.vue.d.ts +23 -0
- package/dist/popover/PopoverArrow.vue.d.ts +10 -0
- package/dist/popover/index.d.ts +4 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/types.d.ts +35 -0
- package/dist/popover-hD77YpUM.js +292 -0
- package/dist/progress/Progress.vue.d.ts +24 -0
- package/dist/progress/ProgressCircle.vue.d.ts +26 -0
- package/dist/progress/ProgressLine.vue.d.ts +23 -0
- package/dist/progress/ProgressNodeRenderer.d.ts +15 -0
- package/dist/progress/index.d.ts +6 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/types.d.ts +44 -0
- package/dist/progress-DIIyWKKD.js +9 -0
- package/dist/radio/Radio.vue.d.ts +30 -0
- package/dist/radio/RadioGroup.d.ts +201 -0
- package/dist/radio/RadioNodeRenderer.d.ts +15 -0
- package/dist/radio/index.d.ts +10 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/radio-context.d.ts +15 -0
- package/dist/radio/types.d.ts +100 -0
- package/dist/radio-y9iAI359.js +565 -0
- package/dist/rating/Rating.vue.d.ts +39 -0
- package/dist/rating/RatingItem.vue.d.ts +33 -0
- package/dist/rating/RatingNodeRenderer.d.ts +17 -0
- package/dist/rating/index.d.ts +6 -0
- package/dist/rating/index.js +2 -0
- package/dist/rating/types.d.ts +57 -0
- package/dist/rating-CJkb4pkD.js +542 -0
- package/dist/resizable/Resizable.vue.d.ts +31 -0
- package/dist/resizable/ResizableNodeRenderer.d.ts +17 -0
- package/dist/resizable/ResizeGroup.vue.d.ts +13 -0
- package/dist/resizable/ResizeHandler.vue.d.ts +11 -0
- package/dist/resizable/ResizeItem.vue.d.ts +19 -0
- package/dist/resizable/SingleResizeHandle.vue.d.ts +21 -0
- package/dist/resizable/index.d.ts +6 -0
- package/dist/resizable/index.js +2 -0
- package/dist/resizable/resizable-context.d.ts +27 -0
- package/dist/resizable/types.d.ts +87 -0
- package/dist/resizable/use-resize-group.d.ts +21 -0
- package/dist/resizable/use-single-resize.d.ts +30 -0
- package/dist/resizable-CEB0ZdGT.js +814 -0
- package/dist/scroll-list/ScrollItem.vue.d.ts +21 -0
- package/dist/scroll-list/ScrollList.vue.d.ts +11 -0
- package/dist/scroll-list/ScrollListNodeRenderer.d.ts +15 -0
- package/dist/scroll-list/index.d.ts +10 -0
- package/dist/scroll-list/index.js +2 -0
- package/dist/scroll-list/types.d.ts +54 -0
- package/dist/scroll-list-BSXksNOR.js +466 -0
- package/dist/select/Select.vue.d.ts +39 -0
- package/dist/select/SelectFragment.d.ts +4 -0
- package/dist/select/SelectNodeRenderer.d.ts +15 -0
- package/dist/select/SelectOption.vue.d.ts +13 -0
- package/dist/select/SelectOptionCollector.d.ts +13 -0
- package/dist/select/SelectOptionGroup.vue.d.ts +14 -0
- package/dist/select/index.d.ts +12 -0
- package/dist/select/index.js +3 -0
- package/dist/select/types.d.ts +165 -0
- package/dist/select/use-select-foundation.d.ts +64 -0
- package/dist/select-BeM6gxAU.js +40 -0
- package/dist/side-sheet/SideSheet.vue.d.ts +19 -0
- package/dist/side-sheet/SideSheetContent.vue.d.ts +37 -0
- package/dist/side-sheet/SideSheetNodeRenderer.d.ts +15 -0
- package/dist/side-sheet/index.d.ts +4 -0
- package/dist/side-sheet/index.js +2 -0
- package/dist/side-sheet/types.d.ts +46 -0
- package/dist/side-sheet-9CBTk23r.js +542 -0
- package/dist/skeleton/Skeleton.vue.d.ts +15 -0
- package/dist/skeleton/SkeletonAvatar.vue.d.ts +9 -0
- package/dist/skeleton/SkeletonButton.vue.d.ts +7 -0
- package/dist/skeleton/SkeletonImage.vue.d.ts +7 -0
- package/dist/skeleton/SkeletonNodeRenderer.d.ts +15 -0
- package/dist/skeleton/SkeletonParagraph.vue.d.ts +8 -0
- package/dist/skeleton/SkeletonTitle.vue.d.ts +7 -0
- package/dist/skeleton/index.d.ts +18 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/types.d.ts +36 -0
- package/dist/skeleton-p61lfhoz.js +302 -0
- package/dist/slider/Slider.vue.d.ts +32 -0
- package/dist/slider/SliderFragment.d.ts +4 -0
- package/dist/slider/index.d.ts +5 -0
- package/dist/slider/index.js +5 -0
- package/dist/slider/types.d.ts +57 -0
- package/dist/slider/use-slider-foundation.d.ts +47 -0
- package/dist/space/Space.vue.d.ts +16 -0
- package/dist/space/index.d.ts +3 -0
- package/dist/space/index.js +2 -0
- package/dist/space/types.d.ts +15 -0
- package/dist/space-DVnFbkCz.js +63 -0
- package/dist/spin/Spin.vue.d.ts +105 -0
- package/dist/spin/SpinNodeRenderer.d.ts +15 -0
- package/dist/spin/index.d.ts +6 -0
- package/dist/spin/index.js +2 -0
- package/dist/spin/types.d.ts +20 -0
- package/dist/spin-D-1P0WMW.js +9 -0
- package/dist/src-DNBBthjO.js +490 -0
- package/dist/steps/Step.vue.d.ts +22 -0
- package/dist/steps/Steps.vue.d.ts +24 -0
- package/dist/steps/StepsNodeRenderer.d.ts +17 -0
- package/dist/steps/index.d.ts +9 -0
- package/dist/steps/index.js +2 -0
- package/dist/steps/steps-context.d.ts +6 -0
- package/dist/steps/types.d.ts +54 -0
- package/dist/steps-6p04q-Lz.js +303 -0
- package/dist/switch/Switch.vue.d.ts +27 -0
- package/dist/switch/SwitchNodeRenderer.d.ts +15 -0
- package/dist/switch/SwitchSpin.vue.d.ts +7 -0
- package/dist/switch/index.d.ts +7 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch/types.d.ts +28 -0
- package/dist/switch-Dte2Fl3l.js +284 -0
- package/dist/table/Table.vue.d.ts +29 -0
- package/dist/table/TableBody.vue.d.ts +70 -0
- package/dist/table/TableCell.vue.d.ts +37 -0
- package/dist/table/TableColumn.d.ts +81 -0
- package/dist/table/TableFilterMenu.vue.d.ts +18 -0
- package/dist/table/TableHeader.vue.d.ts +46 -0
- package/dist/table/TableNativeElement.d.ts +9 -0
- package/dist/table/TableNodeRenderer.d.ts +13 -0
- package/dist/table/TableSpin.vue.d.ts +16 -0
- package/dist/table/index.d.ts +13 -0
- package/dist/table/index.js +2 -0
- package/dist/table/table-utils.d.ts +43 -0
- package/dist/table/types.d.ts +323 -0
- package/dist/table-jZkHjf-W.js +2097 -0
- package/dist/tabs/TabBar.vue.d.ts +38 -0
- package/dist/tabs/TabItem.vue.d.ts +26 -0
- package/dist/tabs/TabPane.vue.d.ts +13 -0
- package/dist/tabs/Tabs.vue.d.ts +36 -0
- package/dist/tabs/TabsDropdown.vue.d.ts +27 -0
- package/dist/tabs/TabsNodeRenderer.d.ts +15 -0
- package/dist/tabs/index.d.ts +6 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/tabs-context.d.ts +12 -0
- package/dist/tabs/types.d.ts +110 -0
- package/dist/tabs-CezuYzIu.js +874 -0
- package/dist/tag/SplitTagGroup.d.ts +36 -0
- package/dist/tag/Tag.vue.d.ts +33 -0
- package/dist/tag/TagGroup.d.ts +115 -0
- package/dist/tag/TagNodeRenderer.d.ts +15 -0
- package/dist/tag/index.d.ts +8 -0
- package/dist/tag/index.js +2 -0
- package/dist/tag/types.d.ts +82 -0
- package/dist/tag-BPD0bELU.js +348 -0
- package/dist/tag-input/TagInput.vue.d.ts +51 -0
- package/dist/tag-input/TagInputNodeRenderer.d.ts +17 -0
- package/dist/tag-input/TagInputRestPopover.vue.d.ts +19 -0
- package/dist/tag-input/TagInputTag.vue.d.ts +27 -0
- package/dist/tag-input/index.d.ts +5 -0
- package/dist/tag-input/index.js +2 -0
- package/dist/tag-input/types.d.ts +95 -0
- package/dist/tag-input/use-tag-input-foundation.d.ts +47 -0
- package/dist/tag-input-SxUfNqF0.js +784 -0
- package/dist/time-picker/TimePicker.vue.d.ts +27 -0
- package/dist/time-picker/TimePickerColumn.vue.d.ts +29 -0
- package/dist/time-picker/TimePickerNodeRenderer.d.ts +17 -0
- package/dist/time-picker/TimePickerPanel.vue.d.ts +32 -0
- package/dist/time-picker/index.d.ts +5 -0
- package/dist/time-picker/index.js +2 -0
- package/dist/time-picker/types.d.ts +146 -0
- package/dist/time-picker/use-time-picker-foundation.d.ts +36 -0
- package/dist/time-picker-D6p36ea8.js +3587 -0
- package/dist/timeline/Timeline.vue.d.ts +69 -0
- package/dist/timeline/TimelineItem.vue.d.ts +100 -0
- package/dist/timeline/TimelineNodeRenderer.d.ts +15 -0
- package/dist/timeline/index.d.ts +10 -0
- package/dist/timeline/index.js +2 -0
- package/dist/timeline/types.d.ts +43 -0
- package/dist/timeline-2D5xCZsU.js +191 -0
- package/dist/toast/ToastHost.vue.d.ts +7 -0
- package/dist/toast/ToastIconRenderer.d.ts +17 -0
- package/dist/toast/ToastNodeRenderer.d.ts +15 -0
- package/dist/toast/ToastNotice.vue.d.ts +20 -0
- package/dist/toast/imperative.d.ts +3 -0
- package/dist/toast/index.d.ts +6 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/toast-store.d.ts +30 -0
- package/dist/toast/types.d.ts +65 -0
- package/dist/toast/use-toast.d.ts +2 -0
- package/dist/toast-s8nFLf8t.js +523 -0
- package/dist/tooltip/Tooltip.vue.d.ts +23 -0
- package/dist/tooltip/TooltipArrow.vue.d.ts +8 -0
- package/dist/tooltip/TooltipNodeRenderer.d.ts +15 -0
- package/dist/tooltip/TooltipPortal.vue.d.ts +44 -0
- package/dist/tooltip/TooltipTriggerRenderer.d.ts +66 -0
- package/dist/tooltip/index.d.ts +5 -0
- package/dist/tooltip/index.js +3 -0
- package/dist/tooltip/types.d.ts +117 -0
- package/dist/tooltip/use-tooltip-foundation.d.ts +25 -0
- package/dist/tooltip-en9bvXRp.js +28 -0
- package/dist/transfer/Transfer.vue.d.ts +35 -0
- package/dist/transfer/TransferNodeRenderer.d.ts +15 -0
- package/dist/transfer/index.d.ts +5 -0
- package/dist/transfer/index.js +2 -0
- package/dist/transfer/types.d.ts +159 -0
- package/dist/transfer-Doq1sI9z.js +695 -0
- package/dist/tree/Tree.vue.d.ts +73 -0
- package/dist/tree/TreeNode.vue.d.ts +77 -0
- package/dist/tree/TreeNodeMotion.vue.d.ts +20 -0
- package/dist/tree/TreeNodeRenderer.d.ts +15 -0
- package/dist/tree/index.d.ts +9 -0
- package/dist/tree/index.js +5 -0
- package/dist/tree/types.d.ts +180 -0
- package/dist/tree-select/TreeSelect.vue.d.ts +76 -0
- package/dist/tree-select/TreeSelectNodeRenderer.d.ts +15 -0
- package/dist/tree-select/index.d.ts +6 -0
- package/dist/tree-select/index.js +2 -0
- package/dist/tree-select/types.d.ts +156 -0
- package/dist/tree-select-BIu6Owuq.js +1237 -0
- package/dist/treeUtil-IUdRJ6Ws.js +277 -0
- package/dist/typography/Numeral.vue.d.ts +32 -0
- package/dist/typography/Paragraph.vue.d.ts +30 -0
- package/dist/typography/Text.vue.d.ts +30 -0
- package/dist/typography/Title.vue.d.ts +28 -0
- package/dist/typography/Typography.vue.d.ts +13 -0
- package/dist/typography/TypographyBase.vue.d.ts +40 -0
- package/dist/typography/TypographyCopyable.vue.d.ts +29 -0
- package/dist/typography/TypographyDecorations.d.ts +34 -0
- package/dist/typography/TypographyNodeRenderer.d.ts +17 -0
- package/dist/typography/index.d.ts +17 -0
- package/dist/typography/index.js +2 -0
- package/dist/typography/types.d.ts +108 -0
- package/dist/typography/typography-locale.d.ts +5 -0
- package/dist/typography/typography-utils.d.ts +4 -0
- package/dist/typography-DF8KwKuL.js +914 -0
- package/dist/upload/Upload.vue.d.ts +69 -0
- package/dist/upload/UploadFileCard.vue.d.ts +4 -0
- package/dist/upload/UploadNodeRenderer.d.ts +15 -0
- package/dist/upload/index.d.ts +10 -0
- package/dist/upload/index.js +2 -0
- package/dist/upload/types.d.ts +250 -0
- package/dist/upload-BzdpoGJX.js +1777 -0
- package/dist/uuid-BUHV1G8U.js +21 -0
- package/dist/warning-naSiE8G7.js +6 -0
- package/dist/zh-CN-CCu7YvUA.js +1623 -0
- package/package.json +336 -0
|
@@ -0,0 +1,1615 @@
|
|
|
1
|
+
import { r as e } from "./src-DNBBthjO.js";
|
|
2
|
+
import { E as t, P as n, g as r, t as i, v as a } from "./foundation-Cawx37mp.js";
|
|
3
|
+
import { r as o } from "./keyCode-DMNg63wX.js";
|
|
4
|
+
import { o as s, t as c } from "./Tooltip-Bq7HZwnS.js";
|
|
5
|
+
import { t as l } from "./Slider-w9sbxzBw.js";
|
|
6
|
+
import { t as u } from "./config-context-CyynTtDb.js";
|
|
7
|
+
import { t as d } from "./Divider-BQmwhGfH.js";
|
|
8
|
+
import { Comment as f, Fragment as p, Teleport as m, Text as h, cloneVNode as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createSlots as S, createStaticVNode as C, createVNode as w, defineComponent as T, getCurrentInstance as E, guardReactiveProps as D, h as O, inject as k, isVNode as A, markRaw as j, mergeProps as M, nextTick as ee, normalizeClass as N, normalizeProps as P, normalizeStyle as F, onBeforeUnmount as I, onMounted as te, onUpdated as L, openBlock as R, provide as ne, renderSlot as z, shallowReactive as B, shallowRef as re, unref as V, useAttrs as H, useSlots as U, useTemplateRef as W, watch as G, withCtx as K, withModifiers as q } from "vue";
|
|
9
|
+
import { IconArrowLeft as ie, IconArrowRight as ae, IconChevronLeft as oe, IconChevronRight as J, IconClose as se, IconDownload as Y, IconMinus as ce, IconPlus as le, IconRealSizeStroked as X, IconRotate as ue, IconUploadError as de, IconWindowAdaptionStroked as fe } from "@aifuxi/semi-icons-vue";
|
|
10
|
+
//#region bundled-foundation
|
|
11
|
+
var pe = class extends i {
|
|
12
|
+
constructor(e) {
|
|
13
|
+
super({ ...e }), this.handleClick = (e) => {
|
|
14
|
+
let { imageID: t, preview: n } = this.getProps();
|
|
15
|
+
if (n) {
|
|
16
|
+
if (this._adapter.getIsInGroup()) {
|
|
17
|
+
let { setCurrentIndex: e, handleVisibleChange: n } = this._adapter.getContexts();
|
|
18
|
+
e(t), n(!0);
|
|
19
|
+
} else this.handlePreviewVisibleChange(!0);
|
|
20
|
+
}
|
|
21
|
+
}, this.handleLoaded = (e) => {
|
|
22
|
+
let { onLoad: t } = this.getProps();
|
|
23
|
+
t && t(e), this.setState({ loadStatus: "success" });
|
|
24
|
+
}, this.handleError = (e) => {
|
|
25
|
+
let { onError: t } = this.getProps();
|
|
26
|
+
t && t(e), this.setState({ loadStatus: "error" });
|
|
27
|
+
}, this.handlePreviewVisibleChange = (e) => {
|
|
28
|
+
let { preview: t } = this.getProps();
|
|
29
|
+
if ((0, r.default)(t)) {
|
|
30
|
+
let { onVisibleChange: n } = t;
|
|
31
|
+
n && n(e), "visible" in t || this.setState({ previewVisible: e });
|
|
32
|
+
} else this.setState({ previewVisible: e });
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}, me = class extends i {
|
|
36
|
+
constructor(...e) {
|
|
37
|
+
super(...e), this.handleVisibleChange = (e) => {
|
|
38
|
+
let { visible: t, onVisibleChange: n } = this.getProps();
|
|
39
|
+
t in this.getProps() || this.setState({ visible: e }), n && n(e);
|
|
40
|
+
}, this.handleCurrentIndexChange = (e) => {
|
|
41
|
+
let { currentIndex: t, onChange: n } = this.getProps();
|
|
42
|
+
t in this.getProps() || this.setState({ currentIndex: e }), n && n(e);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}, he = class extends i {
|
|
46
|
+
constructor(...e) {
|
|
47
|
+
super(...e), this.changeSliderValue = (e) => {
|
|
48
|
+
let { zoom: t, step: n, min: r, max: i } = this.getProps(), a = e === "plus" ? t + n : t - n;
|
|
49
|
+
a > i ? a = i : a < r && (a = r), this.handleValueChange(a);
|
|
50
|
+
}, this.handleValueChange = (e) => {
|
|
51
|
+
let { onZoomIn: t, onZoomOut: n, zoom: r } = this.getProps();
|
|
52
|
+
e > r ? t(Number((e / 100).toFixed(2))) : n(Number((e / 100).toFixed(2)));
|
|
53
|
+
}, this.handleRatioClick = () => {
|
|
54
|
+
let { ratio: e, onAdjustRatio: t } = this.getProps();
|
|
55
|
+
t(e === "adaptation" ? "realSize" : "adaptation");
|
|
56
|
+
}, this.handleRotate = (e) => {
|
|
57
|
+
let { onRotate: t } = this.getProps();
|
|
58
|
+
t && t(e);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}, Z = (e, t) => {
|
|
62
|
+
let n = e?.composedPath();
|
|
63
|
+
return n?.slice(0, n.length - 4).some((e) => e.className && typeof e.className == "string" ? t.some((t) => e.className.includes(t)) : !1);
|
|
64
|
+
}, ge = async (e, t, n) => {
|
|
65
|
+
try {
|
|
66
|
+
let r = await fetch(e);
|
|
67
|
+
if (r.ok) {
|
|
68
|
+
let e = await r.blob(), n = URL.createObjectURL(e), i = document.createElement("a");
|
|
69
|
+
i.href = n, i.download = t, i.click(), URL.revokeObjectURL(n), i.remove();
|
|
70
|
+
} else n(e);
|
|
71
|
+
} catch {
|
|
72
|
+
n(e);
|
|
73
|
+
}
|
|
74
|
+
}, _e = (e = [], t = []) => {
|
|
75
|
+
let n = [], r = e.length, i = t.length;
|
|
76
|
+
return Array(r <= i ? r : i).fill(0).forEach((r, i) => {
|
|
77
|
+
n.push(t[i]), n.push(e[i]);
|
|
78
|
+
}), r > i ? n = n.concat(e.slice(i, r)) : r < i && (n = n.concat(t.slice(r, i))), n;
|
|
79
|
+
}, ve = (e, t, n, r) => {
|
|
80
|
+
let i = t - n, a = t + n, o = e.length, s = [], c = [];
|
|
81
|
+
n >= Math.floor(o / 2) ? r ? (s = e.concat(e).slice(i + o < 0 ? 0 : i + o, t + o), c = e.concat(e).slice(t + 1, a + 1 < 2 * o ? a + 1 : 2 * o)) : (s = e.slice(0, t), c = e.slice(t + 1, o)) : r ? (s = e.concat(e).slice(i + o, t + o), c = e.concat(e).slice(t + 1, a + 1)) : i >= 0 && a < o ? (s = e.slice(i, t), c = e.slice(t + 1, a + 1)) : i < 0 ? (s = e.slice(0, t), c = e.slice(t + 1, 2 * n + 1)) : (c = e.slice(t + 1, o), s = e.slice(o - 2 * n - 1, t));
|
|
82
|
+
let l = _e(s.reverse(), c);
|
|
83
|
+
return Array.from(new Set(l));
|
|
84
|
+
}, ye = ["icon", "footer"], be = class extends i {
|
|
85
|
+
constructor(e) {
|
|
86
|
+
super({ ...e }), this._timer = null, this._startMouseDown = {
|
|
87
|
+
x: 0,
|
|
88
|
+
y: 0
|
|
89
|
+
}, this.handleViewVisibleChange = () => {
|
|
90
|
+
let { viewerVisible: e } = this.getStates();
|
|
91
|
+
e && (this.setState({ viewerVisible: !1 }), this.clearTimer());
|
|
92
|
+
}, this.handleMouseMove = (e) => {
|
|
93
|
+
this._persistEvent(e), this.mouseMoveHandler(e);
|
|
94
|
+
}, this.mouseMoveHandler = (0, t.default)((e) => {
|
|
95
|
+
let { viewerVisible: t } = this.getStates();
|
|
96
|
+
this._adapter.isValidTarget(e) ? (t || this.setState({ viewerVisible: !0 }), this.updateTimer()) : this.clearTimer();
|
|
97
|
+
}, 50), this.updateTimer = () => {
|
|
98
|
+
let { viewerVisibleDelay: e } = this.getProps();
|
|
99
|
+
this.clearTimer(), this._timer = setTimeout(this.handleViewVisibleChange, e);
|
|
100
|
+
}, this.clearTimer = () => {
|
|
101
|
+
this._timer &&= (clearTimeout(this._timer), null);
|
|
102
|
+
}, this.handleWheel = (e) => {
|
|
103
|
+
this.onWheel(e), s(e);
|
|
104
|
+
}, this.onWheel = (e) => {
|
|
105
|
+
let { zoomStep: t, maxZoom: n, minZoom: r } = this.getProps(), { zoom: i } = this.getStates(), o;
|
|
106
|
+
e.deltaY < 0 ? i + t <= n && (o = Number((i + t).toFixed(2))) : e.deltaY > 0 && i - t >= r && (o = Number((i - t).toFixed(2))), (0, a.default)(o) || this.handleZoomImage(o, !0, e);
|
|
107
|
+
}, this.handleMouseUp = (e) => {
|
|
108
|
+
let { maskClosable: t } = this.getProps(), n = !Z(e, ye), { clientX: r, clientY: i } = e, { x: a, y: o } = this._startMouseDown;
|
|
109
|
+
(Math.abs(r - a) > 5 || Math.abs(o - i) > 5) && (n = !1), n && t && this._adapter.notifyVisibleChange(!1);
|
|
110
|
+
}, this.handleMouseDown = (e) => {
|
|
111
|
+
let { clientX: t, clientY: n } = e;
|
|
112
|
+
this._startMouseDown = {
|
|
113
|
+
x: t,
|
|
114
|
+
y: n
|
|
115
|
+
};
|
|
116
|
+
}, this.handleKeyDown = (e) => {
|
|
117
|
+
let { closeOnEsc: t } = this.getProps();
|
|
118
|
+
if (t && e.keyCode === o.ESC) {
|
|
119
|
+
e.stopPropagation(), this._adapter.notifyVisibleChange(!1), this._adapter.notifyClose();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
}, this.handleSwitchImage = (e) => {
|
|
123
|
+
let t = e === "prev" ? -1 : 1, { imgSrc: n, currentIndex: r } = this.getStates(), i = n.length, a = (r + t + i) % i;
|
|
124
|
+
"currentIndex" in this.getProps() ? this._adapter.getIsInGroup() && this._adapter.getContext("setCurrentIndex")(a) : this.setState({ currentIndex: a }), this._adapter.notifyChange(a, e), this.setState({
|
|
125
|
+
direction: e,
|
|
126
|
+
rotation: 0
|
|
127
|
+
});
|
|
128
|
+
}, this.handleDownload = () => {
|
|
129
|
+
let { currentIndex: e, imgSrc: t } = this.getStates(), n = this._adapter.getSetDownloadFunc(), r = t[e];
|
|
130
|
+
ge(r, n ? n(r) : r.slice(r.lastIndexOf("/") + 1).split("?")[0], this._adapter.notifyDownloadError), this._adapter.notifyDownload(r, e);
|
|
131
|
+
}, this.handlePreviewClose = (e) => {
|
|
132
|
+
this._adapter.notifyVisibleChange(!1), this._adapter.notifyClose(), s(e);
|
|
133
|
+
}, this.handleAdjustRatio = (e) => {
|
|
134
|
+
this.setState({ ratio: e }), this._adapter.notifyRatioChange(e);
|
|
135
|
+
}, this.handleRotateImage = (e) => {
|
|
136
|
+
let { rotation: t } = this.getStates(), n = t + (e === "left" ? -90 : 90);
|
|
137
|
+
this.setState({ rotation: n }), this._adapter.notifyRotateChange(n);
|
|
138
|
+
}, this.handleZoomImage = (e, t = !0, n) => {
|
|
139
|
+
let { zoom: r } = this.getStates(), i = this._clampZoom(e);
|
|
140
|
+
r !== i && (t && this._adapter.notifyZoom(i, i > r), this._adapter.changeImageZoom(i, n), this.setState({ zoom: i }));
|
|
141
|
+
}, this.preloadGapImage = () => {
|
|
142
|
+
let { preLoad: e, preLoadGap: t, infinite: n, currentIndex: r } = this.getProps(), { imgSrc: i } = this.getStates();
|
|
143
|
+
if (!e || typeof t != "number" || t < 1) return;
|
|
144
|
+
let a = ve(i, r, t, n);
|
|
145
|
+
if (a.length === 0) return;
|
|
146
|
+
let o = new Image(), s = 0;
|
|
147
|
+
function c(e) {
|
|
148
|
+
s++, s < a.length && (o.src = a[s]);
|
|
149
|
+
}
|
|
150
|
+
o.onload = (e) => {
|
|
151
|
+
this.setLoadSuccessStatus(o.src), c(e);
|
|
152
|
+
}, o.onerror = c, o.src = a[0];
|
|
153
|
+
}, this.preloadSingleImage = () => {
|
|
154
|
+
let { preLoad: e, preLoadGap: t, infinite: n } = this.getProps(), { imgSrc: r, currentIndex: i, direction: a, imgLoadStatus: o } = this.getStates();
|
|
155
|
+
if (!e || typeof t != "number" || t < 1) return;
|
|
156
|
+
let s = i + (a === "prev" ? -1 : 1) * t;
|
|
157
|
+
if (s < 0 || s >= r.length) {
|
|
158
|
+
if (n) s = (s + r.length) % r.length;
|
|
159
|
+
else return;
|
|
160
|
+
}
|
|
161
|
+
if (!o[s]) {
|
|
162
|
+
let e = new Image();
|
|
163
|
+
e.onload = (e) => {
|
|
164
|
+
this.setLoadSuccessStatus(r[s]);
|
|
165
|
+
}, e.src = r[s];
|
|
166
|
+
}
|
|
167
|
+
}, this.setLoadSuccessStatus = (e) => {
|
|
168
|
+
let { imgLoadStatus: t } = this.getStates(), n = { ...t };
|
|
169
|
+
n[e] = !0, this.setState({ imgLoadStatus: n });
|
|
170
|
+
}, this.onImageLoad = (e) => {
|
|
171
|
+
let { preloadAfterVisibleChange: t } = this.getStates();
|
|
172
|
+
this.setLoadSuccessStatus(e), t ? (this.preloadGapImage(), this.setState({ preloadAfterVisibleChange: !1 })) : this.preloadSingleImage();
|
|
173
|
+
}, this._clampZoom = (e) => {
|
|
174
|
+
let { maxZoom: t, minZoom: n } = this.getProps(), r = typeof t == "number" ? t : 5, i = typeof n == "number" ? n : .1;
|
|
175
|
+
return typeof e != "number" || !Number.isFinite(e) ? i : Math.min(r, Math.max(i, e));
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
beforeShow() {
|
|
179
|
+
this._adapter.registerKeyDownListener(), this._adapter.disabledBodyScroll(), this.updateTimer();
|
|
180
|
+
}
|
|
181
|
+
afterHide() {
|
|
182
|
+
this._adapter.unregisterKeyDownListener(), this._adapter.enabledBodyScroll(), this.clearTimer();
|
|
183
|
+
}
|
|
184
|
+
}, xe = class extends i {
|
|
185
|
+
constructor(e) {
|
|
186
|
+
super({ ...e }), this.startMouseClientPosition = {
|
|
187
|
+
x: 0,
|
|
188
|
+
y: 0
|
|
189
|
+
}, this.originImageWidth = null, this.originImageHeight = null, this.containerWidth = 0, this.containerHeight = 0, this._initialZoomApplied = !1, this._initialZoomAppliedSrc = void 0, this._syncInitialZoomFlagWithSrc = () => {
|
|
190
|
+
let e = this.getProp("src");
|
|
191
|
+
e !== this._initialZoomAppliedSrc && (this._initialZoomAppliedSrc = e, this._initialZoomApplied = !1);
|
|
192
|
+
}, this._clampZoom = (e) => {
|
|
193
|
+
let { maxZoom: t, minZoom: n } = this.getProps(), r = typeof t == "number" ? t : 5, i = typeof n == "number" ? n : .1;
|
|
194
|
+
return typeof e != "number" || !Number.isFinite(e) ? i : Math.min(r, Math.max(i, e));
|
|
195
|
+
}, this._isImageVertical = () => this.getProp("rotation") % 180 != 0, this._getContainerBoundingRectSize = () => {
|
|
196
|
+
let e = this._adapter.getContainer();
|
|
197
|
+
e && (this.containerWidth = e.clientWidth, this.containerHeight = e.clientHeight);
|
|
198
|
+
}, this._getAdaptationZoom = () => {
|
|
199
|
+
let e = 1;
|
|
200
|
+
if (this._adapter.getContainer() && this.originImageWidth && this.originImageHeight) {
|
|
201
|
+
let { rotation: t } = this.getProps(), { width: n, height: r } = this.calcBoundingRectSize(this.originImageWidth, this.originImageHeight, t), i = this.containerWidth - 80, a = this.containerHeight - 80;
|
|
202
|
+
e = Number(Math.min(i / n, a / r).toFixed(2));
|
|
203
|
+
}
|
|
204
|
+
return e;
|
|
205
|
+
}, this._getInitialZoom = () => {
|
|
206
|
+
let { ratio: e, initialZoom: t } = this.getProps(), n = 1;
|
|
207
|
+
return this._syncInitialZoomFlagWithSrc(), !this._initialZoomApplied && typeof t == "number" && Number.isFinite(t) && t > 0 ? (this._initialZoomApplied = !0, this._clampZoom(t)) : (e === "adaptation" && (n = this._getAdaptationZoom()), this._clampZoom(n));
|
|
208
|
+
}, this.setLoading = (e) => {
|
|
209
|
+
this._adapter.setLoading(e);
|
|
210
|
+
}, this.handleWindowResize = () => {
|
|
211
|
+
this._getContainerBoundingRectSize(), this.initializeImage();
|
|
212
|
+
}, this.handleLoad = (e) => {
|
|
213
|
+
if (e.target) {
|
|
214
|
+
let { naturalWidth: t, naturalHeight: n } = e.target;
|
|
215
|
+
this.originImageHeight = n, this.originImageWidth = t, this._syncInitialZoomFlagWithSrc(), this.setState({ loading: !1 }), this.initializeImage(!1);
|
|
216
|
+
}
|
|
217
|
+
let { src: t, onLoad: n } = this.getProps();
|
|
218
|
+
n && n(t);
|
|
219
|
+
}, this.handleError = (e) => {
|
|
220
|
+
let { onError: t, src: n } = this.getProps();
|
|
221
|
+
this.setState({ loading: !1 }), t && t(n);
|
|
222
|
+
}, this.handleRatioChange = () => {
|
|
223
|
+
this.initializeImage();
|
|
224
|
+
}, this.initializeImageZoom = (e = !0) => {
|
|
225
|
+
let { currZoom: t } = this.getStates(), { onZoom: n } = this.getProps(), r = this._getInitialZoom();
|
|
226
|
+
t === r ? this.changeZoom(r) : n(r, e);
|
|
227
|
+
}, this.initializeTranslate = () => {
|
|
228
|
+
this.setState({ translate: {
|
|
229
|
+
x: 0,
|
|
230
|
+
y: 0
|
|
231
|
+
} });
|
|
232
|
+
}, this.initializeImage = (e = !0) => {
|
|
233
|
+
this.initializeImageZoom(e), this.initializeTranslate();
|
|
234
|
+
}, this.handleRightClickImage = (e) => {
|
|
235
|
+
let { disableDownload: t } = this.getProps();
|
|
236
|
+
return !t || (e.preventDefault(), e.stopPropagation(), !1);
|
|
237
|
+
}, this.getCanDragDirection = (e, t) => {
|
|
238
|
+
let n = e > this.containerWidth;
|
|
239
|
+
return {
|
|
240
|
+
canDragVertical: t > this.containerHeight,
|
|
241
|
+
canDragHorizontal: n
|
|
242
|
+
};
|
|
243
|
+
}, this.changeZoom = (e, t) => {
|
|
244
|
+
let n = this._adapter.getImage(), { currZoom: r, translate: i, width: a, height: o } = this.getStates(), { rotation: s } = this.getProps(), c = e / (r || 1), l = Math.floor(this.originImageWidth * e), u = Math.floor(this.originImageHeight * e), d = Math.floor(i.x * c), f = Math.floor(i.y * c), p = this.calcBoundingRectSize(a, o, s), m = {
|
|
245
|
+
width: p.width * c,
|
|
246
|
+
height: p.height * c
|
|
247
|
+
};
|
|
248
|
+
if (t && n && t.target === n) {
|
|
249
|
+
let n = s % 360;
|
|
250
|
+
switch (n < 0 && (n = 360 + n), n) {
|
|
251
|
+
case 0:
|
|
252
|
+
d = (t.offsetX - .5 * a) * (1 - e / r) + i.x, f = (t.offsetY - .5 * o) * (1 - e / r) + i.y;
|
|
253
|
+
break;
|
|
254
|
+
case 90:
|
|
255
|
+
d = (.5 * o - t.offsetY) * (1 - e / r) + i.x, f = (t.offsetX - .5 * a) * (1 - e / r) + i.y;
|
|
256
|
+
break;
|
|
257
|
+
case 180:
|
|
258
|
+
d = (.5 * a - t.offsetX) * (1 - e / r) + i.x, f = (.5 * o - t.offsetY) * (1 - e / r) + i.y;
|
|
259
|
+
break;
|
|
260
|
+
case 270: d = (t.offsetY - .5 * o) * (1 - e / r) + i.x, f = (.5 * a - t.offsetX) * (1 - e / r) + i.y;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
let h = this.getSafeTranslate(m.width, m.height, d, f);
|
|
264
|
+
if (this.setState({
|
|
265
|
+
translate: h,
|
|
266
|
+
width: l,
|
|
267
|
+
height: u,
|
|
268
|
+
currZoom: e
|
|
269
|
+
}), n) {
|
|
270
|
+
let { canDragVertical: e, canDragHorizontal: t } = this.getCanDragDirection(m.width, m.height), n = e || t;
|
|
271
|
+
this._adapter.setImageCursor(n);
|
|
272
|
+
}
|
|
273
|
+
}, this.getExtremeTranslate = (e, t) => ({
|
|
274
|
+
x: (e - this.containerWidth) / 2,
|
|
275
|
+
y: (t - this.containerHeight) / 2
|
|
276
|
+
}), this.getSafeTranslate = (e, t, n, r) => {
|
|
277
|
+
let { x: i, y: a } = this.getExtremeTranslate(e, t), { canDragVertical: o, canDragHorizontal: s } = this.getCanDragDirection(e, t), c = 0, l = 0;
|
|
278
|
+
return s && (c = n > 0 ? Math.min(n, i) : Math.max(n, -i)), o && (l = r > 0 ? Math.min(r, a) : Math.max(r, -a)), {
|
|
279
|
+
x: c,
|
|
280
|
+
y: l
|
|
281
|
+
};
|
|
282
|
+
}, this.handleImageMove = (e) => {
|
|
283
|
+
e.buttons === 1 && this.moveImage(e);
|
|
284
|
+
}, this.moveImage = (e) => {
|
|
285
|
+
let { clientX: t, clientY: n } = e, { width: r, height: i, translate: a } = this.getStates(), { rotation: o } = this.getProps(), s = this.calcBoundingRectSize(r, i, o), { canDragVertical: c, canDragHorizontal: l } = this.getCanDragDirection(s.width, s.height);
|
|
286
|
+
if (c || l) {
|
|
287
|
+
let e = l ? a.x + t - this.startMouseClientPosition.x : a.x, r = c ? a.y + n - this.startMouseClientPosition.y : a.y, i = this.getSafeTranslate(s.width, s.height, e, r);
|
|
288
|
+
this.setState({ translate: i }), this.startMouseClientPosition = {
|
|
289
|
+
x: t,
|
|
290
|
+
y: n
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
}, this.handleImageMouseDown = (e) => {
|
|
294
|
+
this.startMouseClientPosition = {
|
|
295
|
+
x: e.clientX,
|
|
296
|
+
y: e.clientY
|
|
297
|
+
};
|
|
298
|
+
}, this.calcBoundingRectMouseOffset = (e) => {
|
|
299
|
+
let { width: t, height: n, offset: r, rotation: i = 0 } = e, a = i % 360;
|
|
300
|
+
a = a >= 0 ? a : 360 + a;
|
|
301
|
+
let o = 0, s = 0;
|
|
302
|
+
switch (a) {
|
|
303
|
+
case 0:
|
|
304
|
+
o = r.x, s = r.y;
|
|
305
|
+
break;
|
|
306
|
+
case 90:
|
|
307
|
+
o = n - r.y, s = r.x;
|
|
308
|
+
break;
|
|
309
|
+
case 180:
|
|
310
|
+
o = t - r.x, s = n - r.y;
|
|
311
|
+
break;
|
|
312
|
+
case 270: o = r.y, s = t - r.x;
|
|
313
|
+
}
|
|
314
|
+
return {
|
|
315
|
+
x: o,
|
|
316
|
+
y: s
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
init() {
|
|
321
|
+
this._getContainerBoundingRectSize();
|
|
322
|
+
}
|
|
323
|
+
calcBoundingRectSize(e = 0, t = 0, n = 0) {
|
|
324
|
+
let r = n * Math.PI / 180, i = Math.abs(Math.sin(r)), a = Math.abs(Math.cos(r));
|
|
325
|
+
return {
|
|
326
|
+
width: e * a + t * i,
|
|
327
|
+
height: e * i + t * a
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
}, Q = T({
|
|
331
|
+
name: "ImageNodeRenderer",
|
|
332
|
+
props: { content: {
|
|
333
|
+
type: null,
|
|
334
|
+
default: void 0
|
|
335
|
+
} },
|
|
336
|
+
setup: (e) => () => e.content
|
|
337
|
+
}), Se = /* @__PURE__ */ e(n(), 1), Ce = /* @__PURE__ */ T({
|
|
338
|
+
__name: "ImagePreviewFooter",
|
|
339
|
+
props: {
|
|
340
|
+
adaptiveTip: {},
|
|
341
|
+
className: {},
|
|
342
|
+
curPage: {},
|
|
343
|
+
disableDownload: { type: Boolean },
|
|
344
|
+
disabledNext: { type: Boolean },
|
|
345
|
+
disabledPrev: { type: Boolean },
|
|
346
|
+
downloadTip: {},
|
|
347
|
+
locale: {},
|
|
348
|
+
max: {},
|
|
349
|
+
min: {},
|
|
350
|
+
nextTip: {},
|
|
351
|
+
onAdjustRatio: { type: Function },
|
|
352
|
+
onDownload: { type: Function },
|
|
353
|
+
onNext: { type: Function },
|
|
354
|
+
onPrev: { type: Function },
|
|
355
|
+
onRotate: { type: Function },
|
|
356
|
+
onZoom: { type: Function },
|
|
357
|
+
originTip: {},
|
|
358
|
+
prevTip: {},
|
|
359
|
+
ratio: {},
|
|
360
|
+
renderPreviewMenu: { type: Function },
|
|
361
|
+
rotateTip: {},
|
|
362
|
+
showTooltip: { type: Boolean },
|
|
363
|
+
step: {},
|
|
364
|
+
totalNum: {},
|
|
365
|
+
zIndex: {},
|
|
366
|
+
zoom: {},
|
|
367
|
+
zoomInTip: {},
|
|
368
|
+
zoomOutTip: {}
|
|
369
|
+
},
|
|
370
|
+
setup(e, { expose: t }) {
|
|
371
|
+
let n = e, r = U(), i = W("root"), a = /* @__PURE__ */ new Map(), o = () => ({
|
|
372
|
+
...n,
|
|
373
|
+
onAdjustRatio: n.onAdjustRatio,
|
|
374
|
+
onRotate: n.onRotate,
|
|
375
|
+
onZoomIn: n.onZoom,
|
|
376
|
+
onZoomOut: n.onZoom
|
|
377
|
+
}), s = j(new he({
|
|
378
|
+
getContext: () => void 0,
|
|
379
|
+
getContexts: () => ({}),
|
|
380
|
+
getProp: (e) => o()[e],
|
|
381
|
+
getProps: o,
|
|
382
|
+
getState: () => void 0,
|
|
383
|
+
getStates: () => ({}),
|
|
384
|
+
setState: (e, t) => t?.(),
|
|
385
|
+
getCache: (e) => a.get(e),
|
|
386
|
+
getCaches: () => a,
|
|
387
|
+
setCache: (e, t) => a.set(e, t),
|
|
388
|
+
stopPropagation: (e) => e?.stopPropagation?.(),
|
|
389
|
+
persistEvent: () => void 0
|
|
390
|
+
})), u = (0, Se.default)((e) => {
|
|
391
|
+
s.handleValueChange(e);
|
|
392
|
+
}, 50);
|
|
393
|
+
function f(e, t) {
|
|
394
|
+
let r = O(e, {
|
|
395
|
+
class: [
|
|
396
|
+
t.className,
|
|
397
|
+
t.disabled ? "semi-image-preview-footer-disabled" : void 0,
|
|
398
|
+
t.gap && !n.showTooltip ? "semi-image-preview-footer-gap" : void 0
|
|
399
|
+
],
|
|
400
|
+
key: t.key,
|
|
401
|
+
onClick: t.disabled ? void 0 : t.onClick,
|
|
402
|
+
size: "large"
|
|
403
|
+
});
|
|
404
|
+
return n.showTooltip ? O(c, {
|
|
405
|
+
content: t.tip,
|
|
406
|
+
key: `tooltip-${t.key}`,
|
|
407
|
+
zIndex: n.zIndex + 1
|
|
408
|
+
}, { default: () => O("span", { class: ["semi-image-tooltip-children-wrapper", t.gap ? "semi-image-preview-footer-gap" : void 0] }, [r]) }) : r;
|
|
409
|
+
}
|
|
410
|
+
let p = _(() => {
|
|
411
|
+
let e = n.zoom === n.max, t = n.zoom === n.min;
|
|
412
|
+
return [
|
|
413
|
+
f(oe, {
|
|
414
|
+
disabled: n.disabledPrev,
|
|
415
|
+
key: "chevron-left",
|
|
416
|
+
onClick: n.onPrev,
|
|
417
|
+
tip: n.prevTip ?? n.locale.prevTip
|
|
418
|
+
}),
|
|
419
|
+
O("div", {
|
|
420
|
+
class: "semi-image-preview-footer-page",
|
|
421
|
+
key: "info"
|
|
422
|
+
}, [`${n.curPage}/${n.totalNum}`]),
|
|
423
|
+
f(J, {
|
|
424
|
+
disabled: n.disabledNext,
|
|
425
|
+
key: "chevron-right",
|
|
426
|
+
onClick: n.onNext,
|
|
427
|
+
tip: n.nextTip ?? n.locale.nextTip
|
|
428
|
+
}),
|
|
429
|
+
f(ce, {
|
|
430
|
+
disabled: t,
|
|
431
|
+
key: "minus",
|
|
432
|
+
onClick: () => s.changeSliderValue("minus"),
|
|
433
|
+
tip: n.zoomOutTip ?? n.locale.zoomOutTip
|
|
434
|
+
}),
|
|
435
|
+
O(l, {
|
|
436
|
+
key: "slider",
|
|
437
|
+
max: n.max,
|
|
438
|
+
min: n.min,
|
|
439
|
+
onChange: (e) => {
|
|
440
|
+
typeof e == "number" && u(e);
|
|
441
|
+
},
|
|
442
|
+
step: n.step,
|
|
443
|
+
tipFormatter: (e) => `${String(e)}%`,
|
|
444
|
+
tooltipVisible: n.showTooltip ? void 0 : !1,
|
|
445
|
+
value: n.zoom
|
|
446
|
+
}),
|
|
447
|
+
f(le, {
|
|
448
|
+
disabled: e,
|
|
449
|
+
key: "plus",
|
|
450
|
+
onClick: () => s.changeSliderValue("plus"),
|
|
451
|
+
tip: n.zoomInTip ?? n.locale.zoomInTip
|
|
452
|
+
}),
|
|
453
|
+
f(n.ratio === "adaptation" ? X : fe, {
|
|
454
|
+
gap: !0,
|
|
455
|
+
key: "ratio",
|
|
456
|
+
onClick: () => s.handleRatioClick(),
|
|
457
|
+
tip: n.ratio === "adaptation" ? n.originTip ?? n.locale.originTip : n.adaptiveTip ?? n.locale.adaptiveTip
|
|
458
|
+
}),
|
|
459
|
+
f(ue, {
|
|
460
|
+
key: "rotate",
|
|
461
|
+
onClick: () => s.handleRotate("left"),
|
|
462
|
+
tip: n.rotateTip ?? n.locale.rotateTip
|
|
463
|
+
}),
|
|
464
|
+
f(Y, {
|
|
465
|
+
disabled: n.disableDownload,
|
|
466
|
+
gap: !0,
|
|
467
|
+
key: "download",
|
|
468
|
+
onClick: n.onDownload,
|
|
469
|
+
tip: n.downloadTip ?? n.locale.downloadTip
|
|
470
|
+
})
|
|
471
|
+
];
|
|
472
|
+
}), m = _(() => {
|
|
473
|
+
let e = [...p.value];
|
|
474
|
+
return e.splice(3, 0, O(d, {
|
|
475
|
+
key: "divider-first",
|
|
476
|
+
layout: "vertical"
|
|
477
|
+
})), e.splice(8, 0, O(d, {
|
|
478
|
+
key: "divider-second",
|
|
479
|
+
layout: "vertical"
|
|
480
|
+
})), e;
|
|
481
|
+
}), h = _(() => ({
|
|
482
|
+
curPage: n.curPage,
|
|
483
|
+
disableDownload: n.disableDownload,
|
|
484
|
+
disabledNext: n.disabledNext,
|
|
485
|
+
disabledPrev: n.disabledPrev,
|
|
486
|
+
disabledZoomIn: n.zoom === n.max,
|
|
487
|
+
disabledZoomOut: n.zoom === n.min,
|
|
488
|
+
max: n.max,
|
|
489
|
+
menuItems: p.value,
|
|
490
|
+
min: n.min,
|
|
491
|
+
onDownload: n.onDownload,
|
|
492
|
+
onNext: n.onNext,
|
|
493
|
+
onPrev: n.onPrev,
|
|
494
|
+
onRatioClick: () => s.handleRatioClick(),
|
|
495
|
+
onRotateLeft: () => s.handleRotate("left"),
|
|
496
|
+
onRotateRight: () => s.handleRotate("right"),
|
|
497
|
+
onZoomIn: () => s.changeSliderValue("plus"),
|
|
498
|
+
onZoomOut: () => s.changeSliderValue("minus"),
|
|
499
|
+
ratio: n.ratio,
|
|
500
|
+
step: n.step,
|
|
501
|
+
totalNum: n.totalNum,
|
|
502
|
+
zoom: n.zoom
|
|
503
|
+
})), g = _(() => r.previewMenu?.(h.value) ?? n.renderPreviewMenu?.(h.value));
|
|
504
|
+
return I(() => {
|
|
505
|
+
u.cancel(), s.destroy();
|
|
506
|
+
}), t({ element: i }), (e, t) => (R(), b("section", {
|
|
507
|
+
ref_key: "root",
|
|
508
|
+
ref: i,
|
|
509
|
+
class: N([
|
|
510
|
+
"semi-image-preview-footer",
|
|
511
|
+
"semi-image-preview-footer-wrapper",
|
|
512
|
+
n.className,
|
|
513
|
+
g.value ? void 0 : "semi-image-preview-footer-content"
|
|
514
|
+
])
|
|
515
|
+
}, [w(V(Q), { content: g.value || m.value }, null, 8, ["content"])], 2));
|
|
516
|
+
}
|
|
517
|
+
}), we = { class: "semi-image-preview-header-title" }, Te = /* @__PURE__ */ T({
|
|
518
|
+
__name: "ImagePreviewHeader",
|
|
519
|
+
props: {
|
|
520
|
+
className: {},
|
|
521
|
+
closable: { type: Boolean },
|
|
522
|
+
renderCloseIcon: { type: [
|
|
523
|
+
Object,
|
|
524
|
+
String,
|
|
525
|
+
Number,
|
|
526
|
+
Boolean,
|
|
527
|
+
null,
|
|
528
|
+
Array,
|
|
529
|
+
Function
|
|
530
|
+
] },
|
|
531
|
+
renderHeader: { type: Function },
|
|
532
|
+
title: { type: [
|
|
533
|
+
Object,
|
|
534
|
+
String,
|
|
535
|
+
Number,
|
|
536
|
+
Boolean,
|
|
537
|
+
null,
|
|
538
|
+
Array
|
|
539
|
+
] }
|
|
540
|
+
},
|
|
541
|
+
emits: ["close"],
|
|
542
|
+
setup(e, { expose: t, emit: n }) {
|
|
543
|
+
let r = e, i = n, a = U(), o = W("root"), s = _(() => a.header?.({ title: r.title }) ?? r.renderHeader?.(r.title) ?? r.title), c = _(() => a.closeIcon?.() ?? (typeof r.renderCloseIcon == "function" ? r.renderCloseIcon() : r.renderCloseIcon));
|
|
544
|
+
return t({ element: o }), (e, t) => (R(), b("section", {
|
|
545
|
+
ref_key: "root",
|
|
546
|
+
ref: o,
|
|
547
|
+
class: N(["semi-image-preview-header", r.className])
|
|
548
|
+
}, [x("section", we, [w(V(Q), { content: s.value }, null, 8, ["content"])]), r.closable ? (R(), b("section", {
|
|
549
|
+
key: 0,
|
|
550
|
+
class: "semi-image-preview-header-close",
|
|
551
|
+
onMouseup: t[0] ||= (e) => i("close", e)
|
|
552
|
+
}, [c.value ? (R(), v(V(Q), {
|
|
553
|
+
key: 0,
|
|
554
|
+
content: c.value
|
|
555
|
+
}, null, 8, ["content"])) : (R(), v(V(se), { key: 1 }))], 32)) : y("", !0)], 2));
|
|
556
|
+
}
|
|
557
|
+
}), Ee = ["crossorigin", "src"], De = {
|
|
558
|
+
key: 0,
|
|
559
|
+
class: "semi-spin semi-spin-large semi-image-preview-image-spin"
|
|
560
|
+
}, Oe = /* @__PURE__ */ T({
|
|
561
|
+
__name: "ImagePreviewImage",
|
|
562
|
+
props: {
|
|
563
|
+
crossOrigin: {},
|
|
564
|
+
disableDownload: { type: Boolean },
|
|
565
|
+
initialZoom: {},
|
|
566
|
+
maxZoom: {},
|
|
567
|
+
minZoom: {},
|
|
568
|
+
ratio: {},
|
|
569
|
+
rotation: {},
|
|
570
|
+
src: {},
|
|
571
|
+
zoom: {}
|
|
572
|
+
},
|
|
573
|
+
emits: [
|
|
574
|
+
"error",
|
|
575
|
+
"load",
|
|
576
|
+
"ratio",
|
|
577
|
+
"zoom"
|
|
578
|
+
],
|
|
579
|
+
setup(e, { expose: t, emit: n }) {
|
|
580
|
+
let r = e, i = n, a = W("container"), o = W("image"), s = B({
|
|
581
|
+
currZoom: r.zoom,
|
|
582
|
+
height: 0,
|
|
583
|
+
loading: !0,
|
|
584
|
+
translate: {
|
|
585
|
+
x: 0,
|
|
586
|
+
y: 0
|
|
587
|
+
},
|
|
588
|
+
width: 0
|
|
589
|
+
}), c = /* @__PURE__ */ new Map();
|
|
590
|
+
function l() {
|
|
591
|
+
return {
|
|
592
|
+
...r,
|
|
593
|
+
onError: (e) => i("error", e),
|
|
594
|
+
onLoad: (e) => i("load", e),
|
|
595
|
+
onZoom: (e, t) => i("zoom", e, t),
|
|
596
|
+
setRatio: (e) => i("ratio", e)
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
let u = j(new xe({
|
|
600
|
+
getContext: () => void 0,
|
|
601
|
+
getContexts: () => ({}),
|
|
602
|
+
getProp: (e) => l()[e],
|
|
603
|
+
getProps: l,
|
|
604
|
+
getState: (e) => s[e],
|
|
605
|
+
getStates: () => s,
|
|
606
|
+
setState: (e, t) => {
|
|
607
|
+
Object.assign(s, e), t?.();
|
|
608
|
+
},
|
|
609
|
+
getCache: (e) => c.get(e),
|
|
610
|
+
getCaches: () => c,
|
|
611
|
+
setCache: (e, t) => c.set(e, t),
|
|
612
|
+
stopPropagation: (e) => e?.stopPropagation?.(),
|
|
613
|
+
persistEvent: () => void 0,
|
|
614
|
+
getContainer: () => a.value,
|
|
615
|
+
getImage: () => o.value,
|
|
616
|
+
setLoading: (e) => {
|
|
617
|
+
s.loading = e;
|
|
618
|
+
},
|
|
619
|
+
setImageCursor: (e) => {
|
|
620
|
+
o.value && (o.value.style.cursor = e ? "grab" : "default");
|
|
621
|
+
}
|
|
622
|
+
})), d = _(() => ({
|
|
623
|
+
height: `${s.height}px`,
|
|
624
|
+
position: "absolute",
|
|
625
|
+
transform: `translate(${s.translate.x}px, ${s.translate.y}px) rotate(${r.rotation}deg)`,
|
|
626
|
+
visibility: s.loading ? "hidden" : "visible",
|
|
627
|
+
width: `${s.width}px`
|
|
628
|
+
}));
|
|
629
|
+
function f(e) {
|
|
630
|
+
u.handleLoad(e);
|
|
631
|
+
}
|
|
632
|
+
return G(() => r.src, (e, t) => {
|
|
633
|
+
e && e !== t && u.setLoading(!0);
|
|
634
|
+
}), G(() => r.ratio, (e, t) => {
|
|
635
|
+
e !== t && u.handleRatioChange();
|
|
636
|
+
}), G(() => r.rotation, (e, t) => {
|
|
637
|
+
e !== t && u.handleWindowResize();
|
|
638
|
+
}), te(() => {
|
|
639
|
+
u.init(), window.addEventListener("resize", u.handleWindowResize);
|
|
640
|
+
}), I(() => {
|
|
641
|
+
window.removeEventListener("resize", u.handleWindowResize), u.destroy();
|
|
642
|
+
}), t({ changeZoom: u.changeZoom.bind(u) }), (e, t) => (R(), b("div", {
|
|
643
|
+
ref_key: "container",
|
|
644
|
+
ref: a,
|
|
645
|
+
class: "semi-image-preview-image"
|
|
646
|
+
}, [x("img", {
|
|
647
|
+
ref_key: "image",
|
|
648
|
+
ref: o,
|
|
649
|
+
alt: "previewImag",
|
|
650
|
+
class: "semi-image-preview-image-img",
|
|
651
|
+
crossorigin: r.crossOrigin,
|
|
652
|
+
src: r.src,
|
|
653
|
+
style: F(d.value),
|
|
654
|
+
onContextmenu: t[0] ||= (...e) => V(u).handleRightClickImage && V(u).handleRightClickImage(...e),
|
|
655
|
+
onDragstart: t[1] ||= q(() => {}, ["prevent"]),
|
|
656
|
+
onError: t[2] ||= (...e) => V(u).handleError && V(u).handleError(...e),
|
|
657
|
+
onLoad: f,
|
|
658
|
+
onMousedown: t[3] ||= (...e) => V(u).handleImageMouseDown && V(u).handleImageMouseDown(...e),
|
|
659
|
+
onMousemove: t[4] ||= (...e) => V(u).handleImageMove && V(u).handleImageMove(...e)
|
|
660
|
+
}, null, 44, Ee), V(s).loading ? (R(), b("div", De, [...t[5] ||= [C("<div class=\"semi-spin-wrapper\"><svg aria-hidden=\"true\" data-icon=\"spin\" height=\"48\" version=\"1.1\" viewBox=\"0 0 36 36\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\"><defs><linearGradient id=\"linearGradient-semi-image-preview-spin\" x1=\"0%\" x2=\"100%\" y1=\"100%\" y2=\"100%\"><stop offset=\"0%\" stop-color=\"currentColor\" stop-opacity=\"0\"></stop><stop offset=\"39.9430698%\" stop-color=\"currentColor\" stop-opacity=\"0.50\"></stop><stop offset=\"100%\" stop-color=\"currentColor\"></stop></linearGradient></defs><g fill=\"none\" fill-rule=\"evenodd\" stroke=\"none\" stroke-width=\"1\"><rect fill=\"none\" fill-opacity=\"0.01\" height=\"36\" width=\"36\" x=\"0\" y=\"0\"></rect><path d=\"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951\" stroke=\"url(#linearGradient-semi-image-preview-spin)\" stroke-linecap=\"round\" stroke-width=\"4\"></path></g></svg></div>", 1), x("div", {
|
|
661
|
+
class: "semi-spin-children",
|
|
662
|
+
"x-semi-prop": "children"
|
|
663
|
+
}, null, -1)]])) : y("", !0)], 512));
|
|
664
|
+
}
|
|
665
|
+
}), $ = Symbol("semi-image-preview-context"), ke = /* @__PURE__ */ T({
|
|
666
|
+
name: "ImagePreviewInner",
|
|
667
|
+
inheritAttrs: !1,
|
|
668
|
+
__name: "ImagePreviewInner",
|
|
669
|
+
props: {
|
|
670
|
+
adaptiveTip: {},
|
|
671
|
+
class: { type: [
|
|
672
|
+
Boolean,
|
|
673
|
+
null,
|
|
674
|
+
String,
|
|
675
|
+
Object,
|
|
676
|
+
Array
|
|
677
|
+
] },
|
|
678
|
+
className: {},
|
|
679
|
+
closable: {
|
|
680
|
+
type: Boolean,
|
|
681
|
+
default: !0
|
|
682
|
+
},
|
|
683
|
+
closeOnEsc: {
|
|
684
|
+
type: Boolean,
|
|
685
|
+
default: !0
|
|
686
|
+
},
|
|
687
|
+
crossOrigin: {},
|
|
688
|
+
currentIndex: {},
|
|
689
|
+
defaultCurrentIndex: {},
|
|
690
|
+
defaultVisible: { type: Boolean },
|
|
691
|
+
disableDownload: {
|
|
692
|
+
type: Boolean,
|
|
693
|
+
default: !1
|
|
694
|
+
},
|
|
695
|
+
downloadTip: {},
|
|
696
|
+
getPopupContainer: {},
|
|
697
|
+
infinite: {
|
|
698
|
+
type: Boolean,
|
|
699
|
+
default: !1
|
|
700
|
+
},
|
|
701
|
+
initialZoom: {},
|
|
702
|
+
lazyLoad: {
|
|
703
|
+
type: Boolean,
|
|
704
|
+
default: !1
|
|
705
|
+
},
|
|
706
|
+
lazyLoadMargin: {},
|
|
707
|
+
maskClosable: {
|
|
708
|
+
type: Boolean,
|
|
709
|
+
default: !0
|
|
710
|
+
},
|
|
711
|
+
maxZoom: { default: 5 },
|
|
712
|
+
minZoom: { default: .1 },
|
|
713
|
+
nextTip: {},
|
|
714
|
+
originTip: {},
|
|
715
|
+
preLoad: {
|
|
716
|
+
type: Boolean,
|
|
717
|
+
default: !0
|
|
718
|
+
},
|
|
719
|
+
preLoadGap: { default: 2 },
|
|
720
|
+
prevTip: {},
|
|
721
|
+
previewCls: {},
|
|
722
|
+
previewStyle: { type: [
|
|
723
|
+
Boolean,
|
|
724
|
+
null,
|
|
725
|
+
String,
|
|
726
|
+
Object,
|
|
727
|
+
Array
|
|
728
|
+
] },
|
|
729
|
+
previewTitle: { type: [
|
|
730
|
+
Object,
|
|
731
|
+
String,
|
|
732
|
+
Number,
|
|
733
|
+
Boolean,
|
|
734
|
+
null,
|
|
735
|
+
Array
|
|
736
|
+
] },
|
|
737
|
+
renderCloseIcon: { type: [
|
|
738
|
+
Object,
|
|
739
|
+
String,
|
|
740
|
+
Number,
|
|
741
|
+
Boolean,
|
|
742
|
+
null,
|
|
743
|
+
Array,
|
|
744
|
+
Function
|
|
745
|
+
] },
|
|
746
|
+
renderHeader: {},
|
|
747
|
+
renderLeftIcon: { type: [
|
|
748
|
+
Object,
|
|
749
|
+
String,
|
|
750
|
+
Number,
|
|
751
|
+
Boolean,
|
|
752
|
+
null,
|
|
753
|
+
Array,
|
|
754
|
+
Function
|
|
755
|
+
] },
|
|
756
|
+
renderPreviewMenu: {},
|
|
757
|
+
renderRightIcon: { type: [
|
|
758
|
+
Object,
|
|
759
|
+
String,
|
|
760
|
+
Number,
|
|
761
|
+
Boolean,
|
|
762
|
+
null,
|
|
763
|
+
Array,
|
|
764
|
+
Function
|
|
765
|
+
] },
|
|
766
|
+
rotateTip: {},
|
|
767
|
+
setDownloadName: {},
|
|
768
|
+
showTooltip: {
|
|
769
|
+
type: Boolean,
|
|
770
|
+
default: !1
|
|
771
|
+
},
|
|
772
|
+
src: {},
|
|
773
|
+
style: { type: [
|
|
774
|
+
Boolean,
|
|
775
|
+
null,
|
|
776
|
+
String,
|
|
777
|
+
Object,
|
|
778
|
+
Array
|
|
779
|
+
] },
|
|
780
|
+
viewerVisibleDelay: { default: 1e4 },
|
|
781
|
+
visible: { type: Boolean },
|
|
782
|
+
zIndex: { default: 1070 },
|
|
783
|
+
zoomInTip: {},
|
|
784
|
+
zoomOutTip: {},
|
|
785
|
+
zoomStep: { default: .1 }
|
|
786
|
+
},
|
|
787
|
+
emits: [
|
|
788
|
+
"change",
|
|
789
|
+
"close",
|
|
790
|
+
"download",
|
|
791
|
+
"downloadError",
|
|
792
|
+
"next",
|
|
793
|
+
"prev",
|
|
794
|
+
"ratioChange",
|
|
795
|
+
"rotateLeft",
|
|
796
|
+
"update:currentIndex",
|
|
797
|
+
"update:visible",
|
|
798
|
+
"visibleChange",
|
|
799
|
+
"zoomIn",
|
|
800
|
+
"zoomOut"
|
|
801
|
+
],
|
|
802
|
+
setup(e, { emit: t }) {
|
|
803
|
+
let n = Object.freeze({
|
|
804
|
+
adaptiveTip: "适应页面",
|
|
805
|
+
downloadTip: "下载",
|
|
806
|
+
loadError: "加载失败",
|
|
807
|
+
loading: "加载中",
|
|
808
|
+
nextTip: "下一张",
|
|
809
|
+
originTip: "原始尺寸",
|
|
810
|
+
prevTip: "上一张",
|
|
811
|
+
preview: "预览",
|
|
812
|
+
rotateTip: "旋转",
|
|
813
|
+
zoomInTip: "放大",
|
|
814
|
+
zoomOutTip: "缩小"
|
|
815
|
+
}), r = Object.freeze({
|
|
816
|
+
adaptiveTip: "Adapt to the page",
|
|
817
|
+
downloadTip: "Download",
|
|
818
|
+
loadError: "Failed to load",
|
|
819
|
+
loading: "Loading",
|
|
820
|
+
nextTip: "Next",
|
|
821
|
+
originTip: "Original size",
|
|
822
|
+
prevTip: "Previous",
|
|
823
|
+
preview: "Preview",
|
|
824
|
+
rotateTip: "Rotate",
|
|
825
|
+
zoomInTip: "Zoom in",
|
|
826
|
+
zoomOutTip: "Zoom out"
|
|
827
|
+
}), i = e, a = t, o = U(), s = k($, void 0), c = k(u, void 0), l = _(() => c ? c.value : {
|
|
828
|
+
direction: "ltr",
|
|
829
|
+
locale: { code: "zh-CN" }
|
|
830
|
+
}), d = _(() => ({
|
|
831
|
+
...l.value.locale.code === "en-US" ? r : n,
|
|
832
|
+
...l.value.locale.Image ?? {}
|
|
833
|
+
})), f = B({
|
|
834
|
+
currentIndex: i.currentIndex ?? 0,
|
|
835
|
+
direction: "",
|
|
836
|
+
imgLoadStatus: {},
|
|
837
|
+
imgSrc: [],
|
|
838
|
+
preloadAfterVisibleChange: !0,
|
|
839
|
+
ratio: "adaptation",
|
|
840
|
+
rotation: 0,
|
|
841
|
+
viewerVisible: !0,
|
|
842
|
+
visible: i.visible ?? !1,
|
|
843
|
+
zoom: .1
|
|
844
|
+
}), p = /* @__PURE__ */ new Map(), h = re(null), g = W("imageWrap"), C = W("header"), T = W("footer"), E = W("leftIcon"), O = W("rightIcon"), A = W("previewImage"), M = "", L = "", ne = 0, H = !1;
|
|
845
|
+
function q() {
|
|
846
|
+
let e = { ...i };
|
|
847
|
+
return i.currentIndex === void 0 && delete e.currentIndex, e;
|
|
848
|
+
}
|
|
849
|
+
function oe(e) {
|
|
850
|
+
return e?.element ?? null;
|
|
851
|
+
}
|
|
852
|
+
let J = j(new be({
|
|
853
|
+
getContext: (e) => e === "setCurrentIndex" ? s?.setCurrentIndex : void 0,
|
|
854
|
+
getContexts: () => ({ setCurrentIndex: s?.setCurrentIndex }),
|
|
855
|
+
getProp: (e) => q()[e],
|
|
856
|
+
getProps: q,
|
|
857
|
+
getState: (e) => f[e],
|
|
858
|
+
getStates: () => f,
|
|
859
|
+
setState: (e, t) => {
|
|
860
|
+
Object.assign(f, e), t?.();
|
|
861
|
+
},
|
|
862
|
+
getCache: (e) => p.get(e),
|
|
863
|
+
getCaches: () => p,
|
|
864
|
+
setCache: (e, t) => p.set(e, t),
|
|
865
|
+
stopPropagation: (e) => e?.stopPropagation?.(),
|
|
866
|
+
persistEvent: () => void 0,
|
|
867
|
+
getIsInGroup: () => !!s?.isGroup,
|
|
868
|
+
disabledBodyScroll: () => {
|
|
869
|
+
if (typeof document > "u") return;
|
|
870
|
+
let e = i.getPopupContainer ?? l.value.getPopupContainer;
|
|
871
|
+
M = document.body.style.overflow || "", !e && M !== "hidden" && (document.body.style.overflow = "hidden", document.body.style.width = `calc(${L || "100%"} - ${ne}px)`);
|
|
872
|
+
},
|
|
873
|
+
enabledBodyScroll: () => {
|
|
874
|
+
typeof document > "u" || !(i.getPopupContainer ?? l.value.getPopupContainer) && M !== "hidden" && (document.body.style.overflow = M, document.body.style.width = L);
|
|
875
|
+
},
|
|
876
|
+
notifyChange: (e, t) => {
|
|
877
|
+
a("change", e), a("update:currentIndex", e), a(t === "prev" ? "prev" : "next", e);
|
|
878
|
+
},
|
|
879
|
+
notifyZoom: (e, t) => {
|
|
880
|
+
a(t ? "zoomIn" : "zoomOut", e);
|
|
881
|
+
},
|
|
882
|
+
notifyClose: () => a("close"),
|
|
883
|
+
notifyVisibleChange: (e) => {
|
|
884
|
+
a("visibleChange", e), a("update:visible", e);
|
|
885
|
+
},
|
|
886
|
+
notifyRatioChange: (e) => a("ratioChange", e),
|
|
887
|
+
notifyRotateChange: (e) => a("rotateLeft", e),
|
|
888
|
+
notifyDownload: (e, t) => a("download", e, t),
|
|
889
|
+
notifyDownloadError: (e) => a("downloadError", e),
|
|
890
|
+
registerKeyDownListener: () => window.addEventListener("keydown", J.handleKeyDown),
|
|
891
|
+
unregisterKeyDownListener: () => window.removeEventListener("keydown", J.handleKeyDown),
|
|
892
|
+
getSetDownloadFunc: () => s?.setDownloadName.value ?? i.setDownloadName,
|
|
893
|
+
isValidTarget: (e) => {
|
|
894
|
+
let t = e.target;
|
|
895
|
+
return t instanceof Node ? ![
|
|
896
|
+
oe(C.value),
|
|
897
|
+
oe(T.value),
|
|
898
|
+
E.value,
|
|
899
|
+
O.value
|
|
900
|
+
].some((e) => e?.contains(t)) : !0;
|
|
901
|
+
},
|
|
902
|
+
changeImageZoom: (e, t) => A.value?.changeZoom(e, t)
|
|
903
|
+
})), se = _(() => f.visible ? Array.isArray(i.src) ? i.src : i.src ? [i.src] : [] : []), Y = _(() => f.imgSrc.length), ce = _(() => Y.value !== 1 && (i.infinite || f.currentIndex !== 0)), le = _(() => Y.value !== 1 && (i.infinite || f.currentIndex !== Y.value - 1)), X = _(() => f.viewerVisible ? void 0 : "semi-image-preview-hide"), ue = _(() => [
|
|
904
|
+
"semi-image-preview",
|
|
905
|
+
f.visible ? void 0 : "semi-image-hide",
|
|
906
|
+
i.getPopupContainer || l.value.getPopupContainer ? "semi-image-preview-popup" : void 0,
|
|
907
|
+
i.class,
|
|
908
|
+
i.className
|
|
909
|
+
]), de = _(() => ({
|
|
910
|
+
position: i.getPopupContainer || l.value.getPopupContainer ? "static" : void 0,
|
|
911
|
+
zIndex: i.zIndex
|
|
912
|
+
})), fe = _(() => s && typeof f.currentIndex == "number" ? s.titles.value[f.currentIndex] : i.previewTitle), pe = _(() => o.leftIcon?.({ index: f.currentIndex }) ?? (typeof i.renderLeftIcon == "function" ? i.renderLeftIcon(f.currentIndex) : i.renderLeftIcon)), me = _(() => o.rightIcon?.({ index: f.currentIndex }) ?? (typeof i.renderRightIcon == "function" ? i.renderRightIcon(f.currentIndex) : i.renderRightIcon));
|
|
913
|
+
function he() {
|
|
914
|
+
let e = i.getPopupContainer ?? l.value.getPopupContainer;
|
|
915
|
+
h.value = e?.() ?? document.body;
|
|
916
|
+
}
|
|
917
|
+
function Z(e) {
|
|
918
|
+
J.handleWheel(e);
|
|
919
|
+
}
|
|
920
|
+
return G(se, (e) => {
|
|
921
|
+
f.imgSrc = e;
|
|
922
|
+
}, { immediate: !0 }), G(() => i.currentIndex, (e) => {
|
|
923
|
+
e !== void 0 && e !== f.currentIndex && (f.currentIndex = e, f.ratio = "adaptation");
|
|
924
|
+
}), G(() => i.visible, async (e, t) => {
|
|
925
|
+
f.visible = !!e, e && (f.preloadAfterVisibleChange = !0, f.viewerVisible = !0, f.rotation = 0, f.ratio = "adaptation", typeof document < "u" && he()), H && (await ee(), !t && e && J.beforeShow(), t && !e && J.afterHide());
|
|
926
|
+
}), G(g, (e, t) => {
|
|
927
|
+
t?.removeEventListener("wheel", Z), e?.addEventListener("wheel", Z, { passive: !1 });
|
|
928
|
+
}), te(() => {
|
|
929
|
+
H = !0;
|
|
930
|
+
let e = document.documentElement.clientWidth;
|
|
931
|
+
ne = Math.max(0, window.innerWidth - e), L = document.body.style.width, i.visible && (he(), J.beforeShow());
|
|
932
|
+
}), I(() => {
|
|
933
|
+
g.value?.removeEventListener("wheel", Z), f.visible && J.afterHide(), J.clearTimer(), J.destroy();
|
|
934
|
+
}), (e, t) => V(f).visible && h.value ? (R(), v(m, {
|
|
935
|
+
key: 0,
|
|
936
|
+
to: h.value
|
|
937
|
+
}, [x("div", {
|
|
938
|
+
class: N(["semi-portal", l.value.direction === "rtl" ? "semi-portal-rtl" : void 0]),
|
|
939
|
+
style: F(de.value)
|
|
940
|
+
}, [x("div", {
|
|
941
|
+
ref_key: "imageWrap",
|
|
942
|
+
ref: g,
|
|
943
|
+
class: N(ue.value),
|
|
944
|
+
style: F(i.previewStyle ?? i.style),
|
|
945
|
+
onMousedown: t[2] ||= (...e) => V(J).handleMouseDown && V(J).handleMouseDown(...e),
|
|
946
|
+
onMousemove: t[3] ||= (...e) => V(J).handleMouseMove && V(J).handleMouseMove(...e),
|
|
947
|
+
onMouseup: t[4] ||= (...e) => V(J).handleMouseUp && V(J).handleMouseUp(...e)
|
|
948
|
+
}, [
|
|
949
|
+
w(Te, {
|
|
950
|
+
ref_key: "header",
|
|
951
|
+
ref: C,
|
|
952
|
+
"class-name": X.value,
|
|
953
|
+
closable: i.closable,
|
|
954
|
+
"render-close-icon": i.renderCloseIcon,
|
|
955
|
+
"render-header": i.renderHeader,
|
|
956
|
+
title: fe.value,
|
|
957
|
+
onClose: V(J).handlePreviewClose
|
|
958
|
+
}, S({ _: 2 }, [V(o).header ? {
|
|
959
|
+
name: "header",
|
|
960
|
+
fn: K((t) => [z(e.$slots, "header", P(D(t)))]),
|
|
961
|
+
key: "0"
|
|
962
|
+
} : void 0, V(o).closeIcon ? {
|
|
963
|
+
name: "closeIcon",
|
|
964
|
+
fn: K(() => [z(e.$slots, "closeIcon")]),
|
|
965
|
+
key: "1"
|
|
966
|
+
} : void 0]), 1032, [
|
|
967
|
+
"class-name",
|
|
968
|
+
"closable",
|
|
969
|
+
"render-close-icon",
|
|
970
|
+
"render-header",
|
|
971
|
+
"title",
|
|
972
|
+
"onClose"
|
|
973
|
+
]),
|
|
974
|
+
w(Oe, {
|
|
975
|
+
ref_key: "previewImage",
|
|
976
|
+
ref: A,
|
|
977
|
+
"cross-origin": i.crossOrigin,
|
|
978
|
+
"disable-download": i.disableDownload,
|
|
979
|
+
"initial-zoom": i.initialZoom,
|
|
980
|
+
"max-zoom": i.maxZoom,
|
|
981
|
+
"min-zoom": i.minZoom,
|
|
982
|
+
ratio: V(f).ratio,
|
|
983
|
+
rotation: V(f).rotation,
|
|
984
|
+
src: V(f).imgSrc[V(f).currentIndex],
|
|
985
|
+
zoom: V(f).zoom,
|
|
986
|
+
onError: V(J).preloadSingleImage,
|
|
987
|
+
onLoad: V(J).onImageLoad,
|
|
988
|
+
onRatio: V(J).handleAdjustRatio,
|
|
989
|
+
onZoom: V(J).handleZoomImage
|
|
990
|
+
}, null, 8, [
|
|
991
|
+
"cross-origin",
|
|
992
|
+
"disable-download",
|
|
993
|
+
"initial-zoom",
|
|
994
|
+
"max-zoom",
|
|
995
|
+
"min-zoom",
|
|
996
|
+
"ratio",
|
|
997
|
+
"rotation",
|
|
998
|
+
"src",
|
|
999
|
+
"zoom",
|
|
1000
|
+
"onError",
|
|
1001
|
+
"onLoad",
|
|
1002
|
+
"onRatio",
|
|
1003
|
+
"onZoom"
|
|
1004
|
+
]),
|
|
1005
|
+
ce.value ? (R(), b("div", {
|
|
1006
|
+
key: 0,
|
|
1007
|
+
ref_key: "leftIcon",
|
|
1008
|
+
ref: E,
|
|
1009
|
+
class: N([
|
|
1010
|
+
"semi-image-preview-icon",
|
|
1011
|
+
"semi-image-preview-prev",
|
|
1012
|
+
X.value
|
|
1013
|
+
]),
|
|
1014
|
+
onClick: t[0] ||= (e) => V(J).handleSwitchImage("prev")
|
|
1015
|
+
}, [pe.value ? (R(), v(V(Q), {
|
|
1016
|
+
key: 0,
|
|
1017
|
+
content: pe.value
|
|
1018
|
+
}, null, 8, ["content"])) : (R(), v(V(ie), {
|
|
1019
|
+
key: 1,
|
|
1020
|
+
size: "large"
|
|
1021
|
+
}))], 2)) : y("", !0),
|
|
1022
|
+
le.value ? (R(), b("div", {
|
|
1023
|
+
key: 1,
|
|
1024
|
+
ref_key: "rightIcon",
|
|
1025
|
+
ref: O,
|
|
1026
|
+
class: N([
|
|
1027
|
+
"semi-image-preview-icon",
|
|
1028
|
+
"semi-image-preview-next",
|
|
1029
|
+
X.value
|
|
1030
|
+
]),
|
|
1031
|
+
onClick: t[1] ||= (e) => V(J).handleSwitchImage("next")
|
|
1032
|
+
}, [me.value ? (R(), v(V(Q), {
|
|
1033
|
+
key: 0,
|
|
1034
|
+
content: me.value
|
|
1035
|
+
}, null, 8, ["content"])) : (R(), v(V(ae), {
|
|
1036
|
+
key: 1,
|
|
1037
|
+
size: "large"
|
|
1038
|
+
}))], 2)) : y("", !0),
|
|
1039
|
+
w(Ce, {
|
|
1040
|
+
ref_key: "footer",
|
|
1041
|
+
ref: T,
|
|
1042
|
+
"adaptive-tip": i.adaptiveTip,
|
|
1043
|
+
"class-name": X.value,
|
|
1044
|
+
"cur-page": V(f).currentIndex + 1,
|
|
1045
|
+
"disable-download": i.disableDownload,
|
|
1046
|
+
"disabled-next": !le.value,
|
|
1047
|
+
"disabled-prev": !ce.value,
|
|
1048
|
+
"download-tip": i.downloadTip,
|
|
1049
|
+
locale: d.value,
|
|
1050
|
+
max: i.maxZoom * 100,
|
|
1051
|
+
min: i.minZoom * 100,
|
|
1052
|
+
"next-tip": i.nextTip,
|
|
1053
|
+
"on-adjust-ratio": V(J).handleAdjustRatio,
|
|
1054
|
+
"on-download": V(J).handleDownload,
|
|
1055
|
+
"on-next": () => V(J).handleSwitchImage("next"),
|
|
1056
|
+
"on-prev": () => V(J).handleSwitchImage("prev"),
|
|
1057
|
+
"on-rotate": V(J).handleRotateImage,
|
|
1058
|
+
"on-zoom": V(J).handleZoomImage,
|
|
1059
|
+
"origin-tip": i.originTip,
|
|
1060
|
+
"prev-tip": i.prevTip,
|
|
1061
|
+
ratio: V(f).ratio,
|
|
1062
|
+
"render-preview-menu": i.renderPreviewMenu,
|
|
1063
|
+
"rotate-tip": i.rotateTip,
|
|
1064
|
+
"show-tooltip": i.showTooltip,
|
|
1065
|
+
step: i.zoomStep * 100,
|
|
1066
|
+
"total-num": Y.value,
|
|
1067
|
+
"z-index": i.zIndex,
|
|
1068
|
+
zoom: V(f).zoom * 100,
|
|
1069
|
+
"zoom-in-tip": i.zoomInTip,
|
|
1070
|
+
"zoom-out-tip": i.zoomOutTip
|
|
1071
|
+
}, S({ _: 2 }, [V(o).previewMenu ? {
|
|
1072
|
+
name: "previewMenu",
|
|
1073
|
+
fn: K((t) => [z(e.$slots, "previewMenu", P(D(t)))]),
|
|
1074
|
+
key: "0"
|
|
1075
|
+
} : void 0]), 1032, /* @__PURE__ */ "adaptive-tip.class-name.cur-page.disable-download.disabled-next.disabled-prev.download-tip.locale.max.min.next-tip.on-adjust-ratio.on-download.on-next.on-prev.on-rotate.on-zoom.origin-tip.prev-tip.ratio.render-preview-menu.rotate-tip.show-tooltip.step.total-num.z-index.zoom.zoom-in-tip.zoom-out-tip".split("."))
|
|
1076
|
+
], 38)], 6)], 8, ["to"])) : y("", !0);
|
|
1077
|
+
}
|
|
1078
|
+
}), Ae = [
|
|
1079
|
+
"alt",
|
|
1080
|
+
"crossorigin",
|
|
1081
|
+
"data-src",
|
|
1082
|
+
"height",
|
|
1083
|
+
"src",
|
|
1084
|
+
"width"
|
|
1085
|
+
], je = {
|
|
1086
|
+
key: 0,
|
|
1087
|
+
class: "semi-image-overlay"
|
|
1088
|
+
}, Me = {
|
|
1089
|
+
key: 0,
|
|
1090
|
+
class: "semi-image-status"
|
|
1091
|
+
}, Ne = {
|
|
1092
|
+
key: 1,
|
|
1093
|
+
class: "semi-image-status"
|
|
1094
|
+
}, Pe = ["src"], Fe = /* @__PURE__ */ T({
|
|
1095
|
+
name: "Image",
|
|
1096
|
+
inheritAttrs: !1,
|
|
1097
|
+
__name: "Image",
|
|
1098
|
+
props: {
|
|
1099
|
+
alt: {},
|
|
1100
|
+
class: { type: [
|
|
1101
|
+
Boolean,
|
|
1102
|
+
null,
|
|
1103
|
+
String,
|
|
1104
|
+
Object,
|
|
1105
|
+
Array
|
|
1106
|
+
] },
|
|
1107
|
+
className: {},
|
|
1108
|
+
crossOrigin: {},
|
|
1109
|
+
fallback: { type: [
|
|
1110
|
+
String,
|
|
1111
|
+
Object,
|
|
1112
|
+
Number,
|
|
1113
|
+
Boolean,
|
|
1114
|
+
null,
|
|
1115
|
+
Array
|
|
1116
|
+
] },
|
|
1117
|
+
height: {},
|
|
1118
|
+
imageID: {},
|
|
1119
|
+
imgCls: { type: [
|
|
1120
|
+
Boolean,
|
|
1121
|
+
null,
|
|
1122
|
+
String,
|
|
1123
|
+
Object,
|
|
1124
|
+
Array
|
|
1125
|
+
] },
|
|
1126
|
+
imgStyle: { type: [
|
|
1127
|
+
Boolean,
|
|
1128
|
+
null,
|
|
1129
|
+
String,
|
|
1130
|
+
Object,
|
|
1131
|
+
Array
|
|
1132
|
+
] },
|
|
1133
|
+
placeholder: { type: [
|
|
1134
|
+
Object,
|
|
1135
|
+
String,
|
|
1136
|
+
Number,
|
|
1137
|
+
Boolean,
|
|
1138
|
+
null,
|
|
1139
|
+
Array
|
|
1140
|
+
] },
|
|
1141
|
+
preview: {
|
|
1142
|
+
type: [Boolean, Object],
|
|
1143
|
+
default: !0
|
|
1144
|
+
},
|
|
1145
|
+
setDownloadName: {},
|
|
1146
|
+
src: {},
|
|
1147
|
+
style: { type: [
|
|
1148
|
+
Boolean,
|
|
1149
|
+
null,
|
|
1150
|
+
String,
|
|
1151
|
+
Object,
|
|
1152
|
+
Array
|
|
1153
|
+
] },
|
|
1154
|
+
width: {}
|
|
1155
|
+
},
|
|
1156
|
+
emits: [
|
|
1157
|
+
"click",
|
|
1158
|
+
"error",
|
|
1159
|
+
"load"
|
|
1160
|
+
],
|
|
1161
|
+
setup(e, { emit: t }) {
|
|
1162
|
+
let n = e, r = t, i = H(), a = U(), o = k($, void 0), s = B({
|
|
1163
|
+
loadStatus: "loading",
|
|
1164
|
+
previewVisible: typeof n.preview == "object" ? n.preview.visible ?? n.preview.defaultVisible ?? !1 : !1,
|
|
1165
|
+
src: n.src ?? ""
|
|
1166
|
+
}), c = /* @__PURE__ */ new Map();
|
|
1167
|
+
function l() {
|
|
1168
|
+
return {
|
|
1169
|
+
...n,
|
|
1170
|
+
onError: (e) => r("error", e),
|
|
1171
|
+
onLoad: (e) => r("load", e)
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
let u = j(new pe({
|
|
1175
|
+
getContext: (e) => {
|
|
1176
|
+
if (o) {
|
|
1177
|
+
if (e === "setCurrentIndex") return o.setCurrentIndex;
|
|
1178
|
+
if (e === "handleVisibleChange") return o.handleVisibleChange;
|
|
1179
|
+
}
|
|
1180
|
+
},
|
|
1181
|
+
getContexts: () => ({
|
|
1182
|
+
setCurrentIndex: o?.setCurrentIndex,
|
|
1183
|
+
handleVisibleChange: o?.handleVisibleChange
|
|
1184
|
+
}),
|
|
1185
|
+
getProp: (e) => l()[e],
|
|
1186
|
+
getProps: l,
|
|
1187
|
+
getState: (e) => s[e],
|
|
1188
|
+
getStates: () => s,
|
|
1189
|
+
setState: (e, t) => {
|
|
1190
|
+
Object.assign(s, e), t?.();
|
|
1191
|
+
},
|
|
1192
|
+
getCache: (e) => c.get(e),
|
|
1193
|
+
getCaches: () => c,
|
|
1194
|
+
setCache: (e, t) => c.set(e, t),
|
|
1195
|
+
stopPropagation: (e) => e?.stopPropagation?.(),
|
|
1196
|
+
persistEvent: () => void 0,
|
|
1197
|
+
getIsInGroup: () => !!o?.isGroup
|
|
1198
|
+
}));
|
|
1199
|
+
G(() => n.src, (e) => {
|
|
1200
|
+
(e ?? "") !== s.src && (s.src = e ?? "", s.loadStatus = "loading");
|
|
1201
|
+
}), G(() => typeof n.preview == "object" ? n.preview.visible : void 0, (e) => {
|
|
1202
|
+
typeof e == "boolean" && (s.previewVisible = e);
|
|
1203
|
+
});
|
|
1204
|
+
let d = _(() => !!o?.lazyLoad.value), f = _(() => s.loadStatus === "success" && !!n.preview && !o?.isGroup), m = _(() => s.loadStatus === "success" && !!n.preview), h = _(() => typeof n.preview == "object" ? n.preview : {}), g = _(() => Object.fromEntries(Object.entries(h.value).filter(([, e]) => e !== void 0))), S = _(() => h.value.src ?? s.src), C = _(() => Object.fromEntries(Object.entries(i).filter(([e]) => !["class", "style"].includes(e)))), T = _(() => {
|
|
1205
|
+
let e = {
|
|
1206
|
+
height: typeof n.height == "number" ? `${n.height}px` : n.height,
|
|
1207
|
+
width: typeof n.width == "number" ? `${n.width}px` : n.width
|
|
1208
|
+
}, t = F([i.style, n.style]);
|
|
1209
|
+
if (!t || typeof t != "object") return [e, t];
|
|
1210
|
+
let r = Object.fromEntries(Object.entries(t).filter(([, e]) => e != null));
|
|
1211
|
+
return {
|
|
1212
|
+
...e,
|
|
1213
|
+
...r
|
|
1214
|
+
};
|
|
1215
|
+
}), E = _(() => a.placeholder?.() ?? n.placeholder), D = _(() => a.fallback?.() ?? n.fallback);
|
|
1216
|
+
function O(e) {
|
|
1217
|
+
r("click", e), u.handleClick(e);
|
|
1218
|
+
}
|
|
1219
|
+
function A(e) {
|
|
1220
|
+
u.handlePreviewVisibleChange(e);
|
|
1221
|
+
}
|
|
1222
|
+
return (e, t) => (R(), b("div", {
|
|
1223
|
+
class: N(["semi-image", [
|
|
1224
|
+
V(i).class,
|
|
1225
|
+
n.class,
|
|
1226
|
+
n.className
|
|
1227
|
+
]]),
|
|
1228
|
+
style: F(T.value),
|
|
1229
|
+
onClick: O
|
|
1230
|
+
}, [
|
|
1231
|
+
x("img", M(C.value, {
|
|
1232
|
+
alt: n.alt,
|
|
1233
|
+
class: [
|
|
1234
|
+
"semi-image-img",
|
|
1235
|
+
m.value ? "semi-image-img-preview" : void 0,
|
|
1236
|
+
V(s).loadStatus === "error" ? "semi-image-img-error" : void 0,
|
|
1237
|
+
n.imgCls
|
|
1238
|
+
],
|
|
1239
|
+
crossorigin: n.crossOrigin,
|
|
1240
|
+
"data-src": V(s).src,
|
|
1241
|
+
height: n.height,
|
|
1242
|
+
src: d.value ? void 0 : V(s).src,
|
|
1243
|
+
style: n.imgStyle,
|
|
1244
|
+
width: n.width,
|
|
1245
|
+
onError: t[0] ||= (...e) => V(u).handleError && V(u).handleError(...e),
|
|
1246
|
+
onLoad: t[1] ||= (...e) => V(u).handleLoaded && V(u).handleLoaded(...e)
|
|
1247
|
+
}), null, 16, Ae),
|
|
1248
|
+
V(s).loadStatus === "success" ? y("", !0) : (R(), b("div", je, [V(s).loadStatus === "loading" ? (R(), b(p, { key: 0 }, [E.value ? (R(), b("div", Me, [w(V(Q), { content: E.value }, null, 8, ["content"])])) : (R(), b("div", {
|
|
1249
|
+
key: 1,
|
|
1250
|
+
class: "semi-skeleton-image",
|
|
1251
|
+
style: F({
|
|
1252
|
+
width: n.width,
|
|
1253
|
+
height: n.height
|
|
1254
|
+
})
|
|
1255
|
+
}, null, 4))], 64)) : (R(), b("div", Ne, [typeof D.value == "string" ? (R(), b("img", {
|
|
1256
|
+
key: 0,
|
|
1257
|
+
alt: "fallback",
|
|
1258
|
+
src: D.value,
|
|
1259
|
+
style: {
|
|
1260
|
+
width: "100%",
|
|
1261
|
+
height: "100%"
|
|
1262
|
+
}
|
|
1263
|
+
}, null, 8, Pe)) : D.value ? (R(), v(V(Q), {
|
|
1264
|
+
key: 1,
|
|
1265
|
+
content: D.value
|
|
1266
|
+
}, null, 8, ["content"])) : (R(), v(V(de), {
|
|
1267
|
+
key: 2,
|
|
1268
|
+
size: "extra-large"
|
|
1269
|
+
}))]))])),
|
|
1270
|
+
y("", !0),
|
|
1271
|
+
f.value ? (R(), v(ke, M({ key: 2 }, g.value, {
|
|
1272
|
+
"class-name": h.value.previewCls,
|
|
1273
|
+
"cross-origin": n.crossOrigin ?? h.value.crossOrigin,
|
|
1274
|
+
"set-download-name": n.setDownloadName,
|
|
1275
|
+
src: S.value,
|
|
1276
|
+
style: h.value.previewStyle,
|
|
1277
|
+
visible: V(s).previewVisible,
|
|
1278
|
+
onVisibleChange: A
|
|
1279
|
+
}), null, 16, [
|
|
1280
|
+
"class-name",
|
|
1281
|
+
"cross-origin",
|
|
1282
|
+
"set-download-name",
|
|
1283
|
+
"src",
|
|
1284
|
+
"style",
|
|
1285
|
+
"visible"
|
|
1286
|
+
])) : y("", !0)
|
|
1287
|
+
], 6));
|
|
1288
|
+
}
|
|
1289
|
+
}), Ie = /* @__PURE__ */ T({
|
|
1290
|
+
name: "ImagePreview",
|
|
1291
|
+
inheritAttrs: !1,
|
|
1292
|
+
__name: "ImagePreview",
|
|
1293
|
+
props: {
|
|
1294
|
+
adaptiveTip: {},
|
|
1295
|
+
class: { type: [
|
|
1296
|
+
Boolean,
|
|
1297
|
+
null,
|
|
1298
|
+
String,
|
|
1299
|
+
Object,
|
|
1300
|
+
Array
|
|
1301
|
+
] },
|
|
1302
|
+
className: {},
|
|
1303
|
+
closable: {
|
|
1304
|
+
type: Boolean,
|
|
1305
|
+
default: !0
|
|
1306
|
+
},
|
|
1307
|
+
closeOnEsc: {
|
|
1308
|
+
type: Boolean,
|
|
1309
|
+
default: !0
|
|
1310
|
+
},
|
|
1311
|
+
crossOrigin: {},
|
|
1312
|
+
currentIndex: {},
|
|
1313
|
+
defaultCurrentIndex: {},
|
|
1314
|
+
defaultVisible: { type: Boolean },
|
|
1315
|
+
disableDownload: {
|
|
1316
|
+
type: Boolean,
|
|
1317
|
+
default: !1
|
|
1318
|
+
},
|
|
1319
|
+
downloadTip: {},
|
|
1320
|
+
getPopupContainer: {},
|
|
1321
|
+
infinite: {
|
|
1322
|
+
type: Boolean,
|
|
1323
|
+
default: !1
|
|
1324
|
+
},
|
|
1325
|
+
initialZoom: {},
|
|
1326
|
+
lazyLoad: {
|
|
1327
|
+
type: Boolean,
|
|
1328
|
+
default: !0
|
|
1329
|
+
},
|
|
1330
|
+
lazyLoadMargin: { default: "0px 100px 100px 0px" },
|
|
1331
|
+
maskClosable: {
|
|
1332
|
+
type: Boolean,
|
|
1333
|
+
default: !0
|
|
1334
|
+
},
|
|
1335
|
+
maxZoom: { default: 5 },
|
|
1336
|
+
minZoom: { default: .1 },
|
|
1337
|
+
nextTip: {},
|
|
1338
|
+
originTip: {},
|
|
1339
|
+
preLoad: {
|
|
1340
|
+
type: Boolean,
|
|
1341
|
+
default: !0
|
|
1342
|
+
},
|
|
1343
|
+
preLoadGap: { default: 2 },
|
|
1344
|
+
prevTip: {},
|
|
1345
|
+
previewCls: {},
|
|
1346
|
+
previewStyle: { type: [
|
|
1347
|
+
Boolean,
|
|
1348
|
+
null,
|
|
1349
|
+
String,
|
|
1350
|
+
Object,
|
|
1351
|
+
Array
|
|
1352
|
+
] },
|
|
1353
|
+
previewTitle: { type: [
|
|
1354
|
+
Object,
|
|
1355
|
+
String,
|
|
1356
|
+
Number,
|
|
1357
|
+
Boolean,
|
|
1358
|
+
null,
|
|
1359
|
+
Array
|
|
1360
|
+
] },
|
|
1361
|
+
renderCloseIcon: { type: [
|
|
1362
|
+
Object,
|
|
1363
|
+
String,
|
|
1364
|
+
Number,
|
|
1365
|
+
Boolean,
|
|
1366
|
+
null,
|
|
1367
|
+
Array,
|
|
1368
|
+
Function
|
|
1369
|
+
] },
|
|
1370
|
+
renderHeader: {},
|
|
1371
|
+
renderLeftIcon: { type: [
|
|
1372
|
+
Object,
|
|
1373
|
+
String,
|
|
1374
|
+
Number,
|
|
1375
|
+
Boolean,
|
|
1376
|
+
null,
|
|
1377
|
+
Array,
|
|
1378
|
+
Function
|
|
1379
|
+
] },
|
|
1380
|
+
renderPreviewMenu: {},
|
|
1381
|
+
renderRightIcon: { type: [
|
|
1382
|
+
Object,
|
|
1383
|
+
String,
|
|
1384
|
+
Number,
|
|
1385
|
+
Boolean,
|
|
1386
|
+
null,
|
|
1387
|
+
Array,
|
|
1388
|
+
Function
|
|
1389
|
+
] },
|
|
1390
|
+
rotateTip: {},
|
|
1391
|
+
setDownloadName: {},
|
|
1392
|
+
showTooltip: {
|
|
1393
|
+
type: Boolean,
|
|
1394
|
+
default: !1
|
|
1395
|
+
},
|
|
1396
|
+
src: { default: () => [] },
|
|
1397
|
+
style: { type: [
|
|
1398
|
+
Boolean,
|
|
1399
|
+
null,
|
|
1400
|
+
String,
|
|
1401
|
+
Object,
|
|
1402
|
+
Array
|
|
1403
|
+
] },
|
|
1404
|
+
viewerVisibleDelay: { default: 1e4 },
|
|
1405
|
+
visible: { type: Boolean },
|
|
1406
|
+
zIndex: { default: 1070 },
|
|
1407
|
+
zoomInTip: {},
|
|
1408
|
+
zoomOutTip: {},
|
|
1409
|
+
zoomStep: { default: .1 }
|
|
1410
|
+
},
|
|
1411
|
+
emits: [
|
|
1412
|
+
"change",
|
|
1413
|
+
"close",
|
|
1414
|
+
"download",
|
|
1415
|
+
"downloadError",
|
|
1416
|
+
"next",
|
|
1417
|
+
"prev",
|
|
1418
|
+
"ratioChange",
|
|
1419
|
+
"rotateLeft",
|
|
1420
|
+
"update:currentIndex",
|
|
1421
|
+
"update:visible",
|
|
1422
|
+
"visibleChange",
|
|
1423
|
+
"zoomIn",
|
|
1424
|
+
"zoomOut"
|
|
1425
|
+
],
|
|
1426
|
+
setup(e, { emit: t }) {
|
|
1427
|
+
let n = e, r = t, i = H(), a = U(), o = E();
|
|
1428
|
+
function s(e) {
|
|
1429
|
+
let t = o?.vnode.props, n = e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
1430
|
+
return !!(t && (Object.prototype.hasOwnProperty.call(t, e) || Object.prototype.hasOwnProperty.call(t, n)));
|
|
1431
|
+
}
|
|
1432
|
+
let c = B({
|
|
1433
|
+
currentIndex: n.currentIndex ?? n.defaultCurrentIndex ?? 0,
|
|
1434
|
+
visible: s("visible") ? !!n.visible : !!n.defaultVisible
|
|
1435
|
+
}), l = /* @__PURE__ */ new Map();
|
|
1436
|
+
function u() {
|
|
1437
|
+
let e = { ...n };
|
|
1438
|
+
return s("currentIndex") || delete e.currentIndex, s("visible") || delete e.visible, Object.assign(e, {
|
|
1439
|
+
onChange: (e) => {
|
|
1440
|
+
r("change", e), r("update:currentIndex", e);
|
|
1441
|
+
},
|
|
1442
|
+
onVisibleChange: (e) => {
|
|
1443
|
+
r("visibleChange", e), r("update:visible", e);
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
let d = j(new me({
|
|
1448
|
+
getContext: () => void 0,
|
|
1449
|
+
getContexts: () => ({}),
|
|
1450
|
+
getProp: (e) => u()[e],
|
|
1451
|
+
getProps: u,
|
|
1452
|
+
getState: (e) => c[e],
|
|
1453
|
+
getStates: () => c,
|
|
1454
|
+
setState: (e, t) => {
|
|
1455
|
+
let n = { ...e };
|
|
1456
|
+
s("visible") && delete n.visible, s("currentIndex") && delete n.currentIndex, Object.assign(c, n), t?.();
|
|
1457
|
+
},
|
|
1458
|
+
getCache: (e) => l.get(e),
|
|
1459
|
+
getCaches: () => l,
|
|
1460
|
+
setCache: (e, t) => l.set(e, t),
|
|
1461
|
+
stopPropagation: (e) => e?.stopPropagation?.(),
|
|
1462
|
+
persistEvent: () => void 0
|
|
1463
|
+
}));
|
|
1464
|
+
function m(e) {
|
|
1465
|
+
return !A(e) || e.type === f ? !1 : e.type !== h || String(e.children ?? "").trim() !== "";
|
|
1466
|
+
}
|
|
1467
|
+
function v(e) {
|
|
1468
|
+
return !e.props || !Object.prototype.hasOwnProperty.call(e.props, "preview") || e.props.preview !== !1;
|
|
1469
|
+
}
|
|
1470
|
+
function y(e, t) {
|
|
1471
|
+
let n = [];
|
|
1472
|
+
for (let r of e) {
|
|
1473
|
+
if (Array.isArray(r)) {
|
|
1474
|
+
n.push(...y(r, t));
|
|
1475
|
+
continue;
|
|
1476
|
+
}
|
|
1477
|
+
if (m(r)) {
|
|
1478
|
+
if (r.type === p && Array.isArray(r.children)) {
|
|
1479
|
+
n.push(...y(r.children, t));
|
|
1480
|
+
continue;
|
|
1481
|
+
}
|
|
1482
|
+
if (r.type === Fe) {
|
|
1483
|
+
if (!v(r)) {
|
|
1484
|
+
n.push(r);
|
|
1485
|
+
continue;
|
|
1486
|
+
}
|
|
1487
|
+
let e = r.props?.preview, i = e && typeof e == "object" && "src" in e ? String(e.src ?? r.props?.src ?? "") : String(r.props?.src ?? ""), a = e && typeof e == "object" && "previewTitle" in e ? e.previewTitle : void 0, o = t.sources.length;
|
|
1488
|
+
t.sources.push(i), t.titles.push(a), n.push(g(r, { imageID: o }));
|
|
1489
|
+
continue;
|
|
1490
|
+
}
|
|
1491
|
+
if (Array.isArray(r.children)) {
|
|
1492
|
+
let e = g(r);
|
|
1493
|
+
e.children = y(r.children, t), n.push(e);
|
|
1494
|
+
continue;
|
|
1495
|
+
}
|
|
1496
|
+
n.push(r);
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
return n;
|
|
1500
|
+
}
|
|
1501
|
+
let C = _(() => {
|
|
1502
|
+
let e = {
|
|
1503
|
+
nodes: [],
|
|
1504
|
+
sources: [],
|
|
1505
|
+
titles: []
|
|
1506
|
+
};
|
|
1507
|
+
return e.nodes = y(a.default?.() ?? [], e), e;
|
|
1508
|
+
}), T = _(() => Array.isArray(n.src) ? n.src : typeof n.src == "string" ? [n.src] : []), O = _(() => [...T.value, ...C.value.sources]), k = { value: null }, N;
|
|
1509
|
+
function F(e) {
|
|
1510
|
+
k.value = e instanceof HTMLDivElement ? e : null;
|
|
1511
|
+
}
|
|
1512
|
+
function re() {
|
|
1513
|
+
N?.disconnect(), N = void 0;
|
|
1514
|
+
}
|
|
1515
|
+
function W() {
|
|
1516
|
+
if (re(), !n.lazyLoad || !k.value) return;
|
|
1517
|
+
let e = k.value.querySelectorAll(".semi-image-img[data-src]");
|
|
1518
|
+
if (typeof IntersectionObserver > "u") {
|
|
1519
|
+
e.forEach((e) => {
|
|
1520
|
+
e.src = e.dataset.src ?? "", e.removeAttribute("data-src");
|
|
1521
|
+
});
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
N = new IntersectionObserver((e) => {
|
|
1525
|
+
for (let t of e) {
|
|
1526
|
+
let e = t.target;
|
|
1527
|
+
if (!(e instanceof HTMLImageElement) || !t.isIntersecting) continue;
|
|
1528
|
+
let n = e.dataset.src;
|
|
1529
|
+
n && (e.src = n), e.removeAttribute("data-src"), N?.unobserve(e);
|
|
1530
|
+
}
|
|
1531
|
+
}, {
|
|
1532
|
+
root: k.value,
|
|
1533
|
+
rootMargin: n.lazyLoadMargin
|
|
1534
|
+
}), e.forEach((e) => N?.observe(e));
|
|
1535
|
+
}
|
|
1536
|
+
return ne($, {
|
|
1537
|
+
currentIndex: _(() => c.currentIndex),
|
|
1538
|
+
handleVisibleChange: (e) => d.handleVisibleChange(e),
|
|
1539
|
+
isGroup: !0,
|
|
1540
|
+
lazyLoad: _(() => n.lazyLoad),
|
|
1541
|
+
previewSrc: O,
|
|
1542
|
+
setCurrentIndex: (e) => d.handleCurrentIndexChange(e),
|
|
1543
|
+
setDownloadName: _(() => n.setDownloadName),
|
|
1544
|
+
titles: _(() => C.value.titles),
|
|
1545
|
+
visible: _(() => c.visible)
|
|
1546
|
+
}), G(() => n.currentIndex, (e) => {
|
|
1547
|
+
s("currentIndex") && e !== void 0 && (c.currentIndex = e);
|
|
1548
|
+
}), G(() => n.visible, (e) => {
|
|
1549
|
+
s("visible") && e !== void 0 && (c.visible = e);
|
|
1550
|
+
}), te(() => void ee(W)), L(() => void ee(W)), I(() => {
|
|
1551
|
+
re(), d.destroy();
|
|
1552
|
+
}), (e, t) => (R(), b(p, null, [x("div", M({ ref: F }, V(i), {
|
|
1553
|
+
class: [
|
|
1554
|
+
"semi-image-preview-group",
|
|
1555
|
+
n.class,
|
|
1556
|
+
n.className,
|
|
1557
|
+
V(i).class
|
|
1558
|
+
],
|
|
1559
|
+
style: [n.style, V(i).style]
|
|
1560
|
+
}), [w(V(Q), { content: C.value.nodes }, null, 8, ["content"])], 16), w(ke, M(n, {
|
|
1561
|
+
class: n.previewCls,
|
|
1562
|
+
"current-index": V(c).currentIndex,
|
|
1563
|
+
src: O.value,
|
|
1564
|
+
style: n.previewStyle,
|
|
1565
|
+
visible: V(c).visible,
|
|
1566
|
+
onChange: V(d).handleCurrentIndexChange,
|
|
1567
|
+
onClose: t[0] ||= (e) => r("close"),
|
|
1568
|
+
onDownload: t[1] ||= (e, t) => r("download", e, t),
|
|
1569
|
+
onDownloadError: t[2] ||= (e) => r("downloadError", e),
|
|
1570
|
+
onNext: t[3] ||= (e) => r("next", e),
|
|
1571
|
+
onPrev: t[4] ||= (e) => r("prev", e),
|
|
1572
|
+
onRatioChange: t[5] ||= (e) => r("ratioChange", e),
|
|
1573
|
+
onRotateLeft: t[6] ||= (e) => r("rotateLeft", e),
|
|
1574
|
+
onVisibleChange: V(d).handleVisibleChange,
|
|
1575
|
+
onZoomIn: t[7] ||= (e) => r("zoomIn", e),
|
|
1576
|
+
onZoomOut: t[8] ||= (e) => r("zoomOut", e)
|
|
1577
|
+
}), S({ _: 2 }, [
|
|
1578
|
+
V(a).header ? {
|
|
1579
|
+
name: "header",
|
|
1580
|
+
fn: K((t) => [z(e.$slots, "header", P(D(t)))]),
|
|
1581
|
+
key: "0"
|
|
1582
|
+
} : void 0,
|
|
1583
|
+
V(a).previewMenu ? {
|
|
1584
|
+
name: "previewMenu",
|
|
1585
|
+
fn: K((t) => [z(e.$slots, "previewMenu", P(D(t)))]),
|
|
1586
|
+
key: "1"
|
|
1587
|
+
} : void 0,
|
|
1588
|
+
V(a).leftIcon ? {
|
|
1589
|
+
name: "leftIcon",
|
|
1590
|
+
fn: K((t) => [z(e.$slots, "leftIcon", P(D(t)))]),
|
|
1591
|
+
key: "2"
|
|
1592
|
+
} : void 0,
|
|
1593
|
+
V(a).rightIcon ? {
|
|
1594
|
+
name: "rightIcon",
|
|
1595
|
+
fn: K((t) => [z(e.$slots, "rightIcon", P(D(t)))]),
|
|
1596
|
+
key: "3"
|
|
1597
|
+
} : void 0,
|
|
1598
|
+
V(a).closeIcon ? {
|
|
1599
|
+
name: "closeIcon",
|
|
1600
|
+
fn: K(() => [z(e.$slots, "closeIcon")]),
|
|
1601
|
+
key: "4"
|
|
1602
|
+
} : void 0
|
|
1603
|
+
]), 1040, [
|
|
1604
|
+
"class",
|
|
1605
|
+
"current-index",
|
|
1606
|
+
"src",
|
|
1607
|
+
"style",
|
|
1608
|
+
"visible",
|
|
1609
|
+
"onChange",
|
|
1610
|
+
"onVisibleChange"
|
|
1611
|
+
])], 64));
|
|
1612
|
+
}
|
|
1613
|
+
}), Le = Fe;
|
|
1614
|
+
//#endregion
|
|
1615
|
+
export { $ as i, Ie as n, Fe as r, Le as t };
|