@moubing/bing-ui 0.11.2 → 0.12.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/README.md +300 -171
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/bing-ui.css +1 -1
- package/dist/components/BingAnimatedText/BingAnimatedText.js +7 -0
- package/dist/components/BingAnimatedText/BingAnimatedText.vue_vue_type_script_setup_true_lang.js +194 -0
- package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.js +7 -0
- package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BingAutocomplete/BingAutocomplete.js +7 -0
- package/dist/components/BingAutocomplete/BingAutocomplete.vue.d.ts +4 -4
- package/dist/components/BingAutocomplete/BingAutocomplete.vue_vue_type_script_setup_true_lang.js +560 -0
- package/dist/components/BingButton/BingButton.js +7 -0
- package/dist/components/BingButton/BingButton.vue.d.ts +2 -2
- package/dist/components/BingButton/BingButton.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BingCard/BingCard.js +7 -0
- package/dist/components/BingCard/BingCard.vue_vue_type_script_setup_true_lang.js +481 -0
- package/dist/components/BingCarouselTransition/BingCarouselTransition.js +7 -0
- package/dist/components/BingCarouselTransition/BingCarouselTransition.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/components/BingCheckbox/BingCheckbox.js +7 -0
- package/dist/components/BingCheckbox/BingCheckbox.vue.d.ts +4 -4
- package/dist/components/BingCheckbox/BingCheckbox.vue_vue_type_script_setup_true_lang.js +233 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.context.js +4 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.js +7 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.highlight.js +78 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.js +7 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.vue_vue_type_script_setup_true_lang.js +347 -0
- package/dist/components/BingColorPicker/BingColorPicker.js +7 -0
- package/dist/components/BingColorPicker/BingColorPicker.utils.d.ts +70 -0
- package/dist/components/BingColorPicker/BingColorPicker.utils.js +265 -0
- package/dist/components/BingColorPicker/BingColorPicker.vue.d.ts +7 -7
- package/dist/components/BingColorPicker/BingColorPicker.vue_vue_type_script_setup_true_lang.js +540 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.js +7 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue.d.ts +27 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.js +7 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue.d.ts +26 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.js +5 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.types.d.ts +5 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.vue.d.ts +18 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/BingConfigProvider/index.d.ts +3 -0
- package/dist/components/BingCursor/BingCursor.controller.js +240 -0
- package/dist/components/BingCursor/BingCursor.js +7 -0
- package/dist/components/BingCursor/BingCursor.native.js +20 -0
- package/dist/components/BingCursor/BingCursor.presets.js +60 -0
- package/dist/components/BingCursor/BingCursor.shapes.js +83 -0
- package/dist/components/BingCursor/BingCursor.styleSource.js +83 -0
- package/dist/components/BingCursor/BingCursor.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/BingDatePicker/BingDatePicker.js +7 -0
- package/dist/components/BingDatePicker/BingDatePicker.utils.d.ts +26 -0
- package/dist/components/BingDatePicker/BingDatePicker.utils.js +137 -0
- package/dist/components/BingDatePicker/BingDatePicker.vue.d.ts +14 -14
- package/dist/components/BingDatePicker/BingDatePicker.vue_vue_type_script_setup_true_lang.js +804 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.js +7 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.vue.d.ts +37 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.vue_vue_type_script_setup_true_lang.js +248 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.js +7 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue.d.ts +26 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue_vue_type_script_setup_true_lang.js +97 -0
- package/dist/components/BingDeckTransition/BingDeckTransition.js +7 -0
- package/dist/components/BingDeckTransition/BingDeckTransition.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/BingDialog/BingDialog.js +7 -0
- package/dist/components/BingDialog/BingDialog.vue.d.ts +4 -5
- package/dist/components/BingDialog/BingDialog.vue_vue_type_script_setup_true_lang.js +558 -0
- package/dist/components/BingDropDown/BingDropDown.context.js +4 -0
- package/dist/components/BingDropDown/BingDropDown.js +7 -0
- package/dist/components/BingDropDown/BingDropDown.vue.d.ts +1 -2
- package/dist/components/BingDropDown/BingDropDown.vue_vue_type_script_setup_true_lang.js +649 -0
- package/dist/components/BingDropDown/BingDropDownItem.js +7 -0
- package/dist/components/BingDropDown/BingDropDownItem.vue.d.ts +1 -1
- package/dist/components/BingDropDown/BingDropDownItem.vue_vue_type_script_setup_true_lang.js +308 -0
- package/dist/components/BingFilePreview/BingFilePreview.js +7 -0
- package/dist/components/BingFilePreview/BingFilePreview.vue.d.ts +4 -5
- package/dist/components/BingFilePreview/BingFilePreview.vue_vue_type_script_setup_true_lang.js +589 -0
- package/dist/components/BingForm/BingForm.context.js +7 -0
- package/dist/components/BingForm/BingForm.js +7 -0
- package/dist/components/BingForm/BingForm.vue.d.ts +0 -1
- package/dist/components/BingForm/BingForm.vue_vue_type_script_setup_true_lang.js +300 -0
- package/dist/components/BingForm/formFocus.js +13 -0
- package/dist/components/BingForm/formTabOrder.js +27 -0
- package/dist/components/BingForm/useFormControl.d.ts +1 -1
- package/dist/components/BingForm/useFormControl.js +24 -0
- package/dist/components/BingForm/useFormNextHint.js +135 -0
- package/dist/components/BingFormItem/BingFormItem.js +7 -0
- package/dist/components/BingFormItem/BingFormItem.vue.d.ts +1 -1
- package/dist/components/BingFormItem/BingFormItem.vue_vue_type_script_setup_true_lang.js +252 -0
- package/dist/components/BingIcon/BingIcon.js +7 -0
- package/dist/components/BingIcon/BingIcon.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/BingImage/BingImage.js +7 -0
- package/dist/components/BingImage/BingImage.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BingImagePreview/BingImagePreview.js +7 -0
- package/dist/components/BingImagePreview/BingImagePreview.vue.d.ts +4 -5
- package/dist/components/BingImagePreview/BingImagePreview.vue_vue_type_script_setup_true_lang.js +699 -0
- package/dist/components/BingInput/BingInput.js +7 -0
- package/dist/components/BingInput/BingInput.vue.d.ts +6 -6
- package/dist/components/BingInput/BingInput.vue_vue_type_script_setup_true_lang.js +311 -0
- package/dist/components/BingRadio/BingRadio.js +7 -0
- package/dist/components/BingRadio/BingRadio.vue.d.ts +4 -4
- package/dist/components/BingRadio/BingRadio.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.context.js +4 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.js +7 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.vue.d.ts +4 -4
- package/dist/components/BingRadioGroup/BingRadioGroup.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/components/BingResizable/BingResizable.js +7 -0
- package/dist/components/BingResizable/BingResizable.vue.d.ts +1 -1
- package/dist/components/BingResizable/BingResizable.vue_vue_type_script_setup_true_lang.js +555 -0
- package/dist/components/BingScrollbar/BingScrollbar.js +7 -0
- package/dist/components/BingScrollbar/BingScrollbar.vue.d.ts +2 -2
- package/dist/components/BingScrollbar/BingScrollbar.vue_vue_type_script_setup_true_lang.js +398 -0
- package/dist/components/BingSelect/BingSelect.js +7 -0
- package/dist/components/BingSelect/BingSelect.vue.d.ts +7 -7
- package/dist/components/BingSelect/BingSelect.vue_vue_type_script_setup_true_lang.js +1066 -0
- package/dist/components/BingSlider/BingSlider.js +7 -0
- package/dist/components/BingSlider/BingSlider.vue.d.ts +6 -6
- package/dist/components/BingSlider/BingSlider.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/components/BingSortableList/BingSortableList.js +7 -0
- package/dist/components/BingSortableList/BingSortableList.vue_vue_type_script_setup_true_lang.js +334 -0
- package/dist/components/BingSortableList/BingSortableListItem.js +7 -0
- package/dist/components/BingSortableList/BingSortableListItem.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/components/BingSplitPane/BingSplitPane.js +7 -0
- package/dist/components/BingSplitPane/BingSplitPane.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/BingTable/BingTable.js +7 -0
- package/dist/components/BingTable/BingTable.measurements.js +72 -0
- package/dist/components/BingTable/BingTable.vue.d.ts +1 -2
- package/dist/components/BingTable/BingTable.vue_vue_type_script_setup_true_lang.js +1416 -0
- package/dist/components/BingTable/BingTableCellValue.js +7 -0
- package/dist/components/BingTable/BingTableCellValue.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/components/BingTable/BingTableHeaderCell.js +5 -0
- package/dist/components/BingTable/BingTableHeaderCell.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/BingTable/BingTableHeaderContent.js +7 -0
- package/dist/components/BingTable/BingTableHeaderContent.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/components/BingTable/useTableColumns.js +126 -0
- package/dist/components/BingTableColumnControls/BingTableColumnControls.js +7 -0
- package/dist/components/BingTableColumnControls/BingTableColumnControls.vue.d.ts +1 -1
- package/dist/components/BingTableColumnControls/BingTableColumnControls.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/BingTabs/BingTabs.js +7 -0
- package/dist/components/BingTabs/BingTabs.vue.d.ts +2 -3
- package/dist/components/BingTabs/BingTabs.vue_vue_type_script_setup_true_lang.js +320 -0
- package/dist/components/BingTag/BingTag.js +7 -0
- package/dist/components/BingTag/BingTag.vue.d.ts +0 -1
- package/dist/components/BingTag/BingTag.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/BingTextarea/BingTextarea.js +7 -0
- package/dist/components/BingTextarea/BingTextarea.vue.d.ts +6 -6
- package/dist/components/BingTextarea/BingTextarea.vue_vue_type_script_setup_true_lang.js +243 -0
- package/dist/components/BingToast/BingToast.js +7 -0
- package/dist/components/BingToast/BingToast.service.js +132 -0
- package/dist/components/BingToast/BingToast.types.d.ts +1 -1
- package/dist/components/BingToast/BingToast.types.js +19 -0
- package/dist/components/BingToast/BingToast.vue.d.ts +0 -1
- package/dist/components/BingToast/BingToast.vue_vue_type_script_setup_true_lang.js +307 -0
- package/dist/components/BingTooltip/BingTooltip.js +7 -0
- package/dist/components/BingTooltip/BingTooltip.shared.js +14 -0
- package/dist/components/BingTooltip/BingTooltip.vue.d.ts +4 -5
- package/dist/components/BingTooltip/BingTooltip.vue_vue_type_script_setup_true_lang.js +572 -0
- package/dist/components/BingTreeSelect/BingTreeSelect.js +7 -0
- package/dist/components/BingTreeSelect/BingTreeSelect.vue.d.ts +7 -7
- package/dist/components/BingTreeSelect/BingTreeSelect.vue_vue_type_script_setup_true_lang.js +1274 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/icons/LICENSE-lucide.txt +39 -0
- package/dist/icons/createIcon.d.ts +8 -0
- package/dist/icons/createIcon.js +36 -0
- package/dist/icons/icons.d.ts +51 -0
- package/dist/icons/icons.js +252 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/index.js +48 -0
- package/dist/motion/clickParticles.d.ts +1 -1
- package/dist/motion/clickParticles2.js +66 -0
- package/dist/motion/index.d.ts +1 -1
- package/dist/motion/index.js +17 -0
- package/dist/motion/liquidHover.js +36 -0
- package/dist/motion/optionDetailMotion.d.ts +7 -1
- package/dist/motion/optionDetailMotion.js +74 -0
- package/dist/motion/panelMotion.js +19 -0
- package/dist/motion/reducedMotion.d.ts +16 -0
- package/dist/motion/reducedMotion.js +28 -0
- package/dist/motion/selectPanelMotion.js +115 -0
- package/dist/motion/smoothScroll.d.ts +2 -0
- package/dist/motion/smoothScroll.js +276 -0
- package/dist/motion/useClickFeedback.js +47 -0
- package/dist/motion/useTextControlCaret.js +136 -0
- package/dist/utils/clipboard.d.ts +9 -0
- package/dist/utils/clipboard.js +16 -0
- package/dist/utils/config.d.ts +42 -0
- package/dist/utils/config.js +37 -0
- package/dist/utils/controlAttrs.js +37 -0
- package/dist/utils/floating.d.ts +86 -0
- package/dist/utils/floating.js +99 -0
- package/dist/utils/glass.js +25 -0
- package/dist/utils/overlay.js +94 -0
- package/dist/utils/scrollLock.js +44 -0
- package/dist/utils/search.d.ts +16 -0
- package/dist/utils/search.js +23 -0
- package/dist/utils/useClientReady.js +10 -0
- package/dist/utils/useDeferredBlurValidation.d.ts +18 -0
- package/dist/utils/useDeferredBlurValidation.js +34 -0
- package/dist/utils/useKeyboardScrollSync.d.ts +11 -0
- package/dist/utils/useKeyboardScrollSync.js +28 -0
- package/dist/utils/useOptionDetailPanel.d.ts +50 -0
- package/dist/utils/useOptionDetailPanel.js +180 -0
- package/dist/utils/useOutsidePointerDown.d.ts +8 -0
- package/dist/utils/useOutsidePointerDown.js +17 -0
- package/dist/utils/useSearchShortcutFocus.d.ts +18 -0
- package/dist/utils/useSearchShortcutFocus.js +47 -0
- package/dist/utils/useVirtualList.d.ts +42 -0
- package/dist/utils/useVirtualList.js +74 -0
- package/package.json +15 -9
- package/dist/bing-ui.es.js +0 -31278
- package/dist/bing-ui.umd.js +0 -229
package/dist/components/BingImagePreview/BingImagePreview.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
import { useConfigZIndex as e } from "../../utils/config.js";
|
|
2
|
+
import { useReducedMotion as t } from "../../motion/reducedMotion.js";
|
|
3
|
+
import n from "../BingButton/BingButton.js";
|
|
4
|
+
import { ChevronLeft as r, ChevronRight as i, Download as a, RefreshCcw as ee, RotateCcw as te, RotateCw as o, X as ne, ZoomIn as re, ZoomOut as ie } from "../../icons/icons.js";
|
|
5
|
+
import s from "../BingIcon/BingIcon.js";
|
|
6
|
+
import { useOverlay as ae } from "../../utils/overlay.js";
|
|
7
|
+
import { useClientReady as oe } from "../../utils/useClientReady.js";
|
|
8
|
+
import { createGlassCssVariables as se, defaultGlassEffect as c } from "../../utils/glass.js";
|
|
9
|
+
import { createScrollLock as ce } from "../../utils/scrollLock.js";
|
|
10
|
+
import { Teleport as le, Transition as ue, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as de, nextTick as fe, normalizeClass as pe, normalizeStyle as me, onBeforeUnmount as he, openBlock as h, reactive as ge, ref as g, toDisplayString as _e, unref as _, watch as ve, withCtx as v } from "vue";
|
|
11
|
+
import { gsap as y } from "gsap";
|
|
12
|
+
//#region src/components/BingImagePreview/BingImagePreview.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
+
var ye = ["aria-label"], be = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "bing-image-preview__toolbar",
|
|
16
|
+
"aria-label": "图片预览工具栏"
|
|
17
|
+
}, xe = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "bing-image-preview__status"
|
|
20
|
+
}, Se = ["aria-label"], Ce = {
|
|
21
|
+
class: "bing-image-preview__counter-current",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, we = {
|
|
24
|
+
class: "bing-image-preview__counter-total",
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}, Te = {
|
|
27
|
+
class: "bing-image-preview__loading-slot",
|
|
28
|
+
"aria-live": "polite"
|
|
29
|
+
}, Ee = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "bing-image-preview__loading",
|
|
32
|
+
role: "status",
|
|
33
|
+
"aria-label": "正在加载图片"
|
|
34
|
+
}, De = { class: "bing-image-preview__toolbar-group" }, Oe = { class: "bing-image-preview__stage" }, ke = ["src", "alt"], Ae = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "bing-image-preview__empty"
|
|
37
|
+
}, je = {
|
|
38
|
+
key: 1,
|
|
39
|
+
class: "bing-image-preview__error",
|
|
40
|
+
role: "status"
|
|
41
|
+
}, Me = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "bing-image-preview__caption"
|
|
44
|
+
}, Ne = 180, Pe = 4, Fe = 180, Ie = 220, b = /* @__PURE__ */ de({
|
|
45
|
+
__name: "BingImagePreview",
|
|
46
|
+
props: {
|
|
47
|
+
modelValue: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !1
|
|
50
|
+
},
|
|
51
|
+
items: { default: () => [] },
|
|
52
|
+
initialIndex: { default: 0 },
|
|
53
|
+
currentIndex: { default: void 0 },
|
|
54
|
+
zIndex: {},
|
|
55
|
+
minScale: { default: .5 },
|
|
56
|
+
maxScale: { default: 5 },
|
|
57
|
+
zoomStep: { default: .25 },
|
|
58
|
+
downloadable: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
loop: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: !0
|
|
65
|
+
},
|
|
66
|
+
lockScroll: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !0
|
|
69
|
+
},
|
|
70
|
+
closeOnEsc: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: !0
|
|
73
|
+
},
|
|
74
|
+
closeOnOverlay: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !0
|
|
77
|
+
},
|
|
78
|
+
showToolbar: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: !0
|
|
81
|
+
},
|
|
82
|
+
showCounter: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: !0
|
|
85
|
+
},
|
|
86
|
+
teleportTo: { default: "body" },
|
|
87
|
+
ariaLabel: { default: "图片预览" },
|
|
88
|
+
glass: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: c.glass
|
|
91
|
+
},
|
|
92
|
+
glassBlur: { default: void 0 },
|
|
93
|
+
glassOpacity: { default: void 0 },
|
|
94
|
+
glassSaturation: { default: void 0 }
|
|
95
|
+
},
|
|
96
|
+
emits: [
|
|
97
|
+
"update:modelValue",
|
|
98
|
+
"update:currentIndex",
|
|
99
|
+
"close",
|
|
100
|
+
"change",
|
|
101
|
+
"download"
|
|
102
|
+
],
|
|
103
|
+
setup(c, { emit: de }) {
|
|
104
|
+
let b = t(), x = c, S = de, Le = e("imagePreview", () => x.zIndex), Re = oe(), C = g(null), ze = g(null), w = g(x.modelValue), T = g(!1), E = g(0), D = g(), Be = g(!1), O = g("loading"), k = g(!1), Ve = g(1), A = ge({
|
|
105
|
+
scale: 1,
|
|
106
|
+
x: 0,
|
|
107
|
+
y: 0,
|
|
108
|
+
rotation: 0
|
|
109
|
+
}), j = !1, M = 0, N, P, He, Ue = 0, We = 0, F, I, L, R, z, B, V, H, Ge = !1, U = !1, W, Ke, qe = 0, Je = 0, Ye = 0, Xe = 0, Ze = !1, Qe = l(() => x.items.filter((e) => !!(e.src || e.previewSrc))), G = l(() => Qe.value.length), K = l(() => G.value > 0), q = l(() => Qe.value[E.value]), $e = l(() => q.value?.previewSrc || q.value?.src || ""), et = l(() => q.value?.alt ?? ""), tt = l(() => G.value > 1), nt = l(() => x.downloadable && !!q.value), rt = l(() => Math.max(.1, Math.min(x.minScale, x.maxScale))), it = l(() => Math.max(rt.value, x.maxScale)), at = l(() => Math.max(.05, x.zoomStep)), ot = l(() => A.scale <= rt.value + .001), st = l(() => A.scale >= it.value - .001), J = l(() => D.value ?? E.value), ct = l(() => O.value === "loading" || D.value !== void 0), lt = l(() => ["bing-image-preview-root", {
|
|
110
|
+
"is-active": T.value,
|
|
111
|
+
"is-dragging": Be.value,
|
|
112
|
+
"is-loading": ct.value,
|
|
113
|
+
"is-error": O.value === "error"
|
|
114
|
+
}]), ut = ae({
|
|
115
|
+
open: () => Re.value && w.value,
|
|
116
|
+
elements: () => [C.value],
|
|
117
|
+
zIndex: () => Le.value,
|
|
118
|
+
modal: !0,
|
|
119
|
+
closeOnEscape: () => x.modelValue && x.closeOnEsc,
|
|
120
|
+
onEscape: () => At("escape")
|
|
121
|
+
}), dt = l(() => ({
|
|
122
|
+
...se("bing-image-preview", {
|
|
123
|
+
glass: x.glass,
|
|
124
|
+
glassBlur: x.glassBlur,
|
|
125
|
+
glassOpacity: x.glassOpacity,
|
|
126
|
+
glassSaturation: x.glassSaturation
|
|
127
|
+
}),
|
|
128
|
+
zIndex: ut.zIndex.value
|
|
129
|
+
})), ft = l(() => ({ transform: `translate3d(${A.x}px, ${A.y}px, 0) scale(${A.scale}) rotate(${A.rotation}deg)` })), pt = l(() => {
|
|
130
|
+
let e = J.value + 1, t = Math.max(2, String(G.value).length);
|
|
131
|
+
return {
|
|
132
|
+
current: String(e).padStart(t, "0"),
|
|
133
|
+
total: String(G.value).padStart(t, "0"),
|
|
134
|
+
label: `第 ${e} 张,共 ${G.value} 张`
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
function Y() {
|
|
138
|
+
return typeof window < "u" && typeof document < "u";
|
|
139
|
+
}
|
|
140
|
+
function mt() {
|
|
141
|
+
Y() && (P &&= (window.clearTimeout(P), void 0), He &&= (window.clearTimeout(He), void 0));
|
|
142
|
+
}
|
|
143
|
+
function ht() {
|
|
144
|
+
Y() && (mt(), !k.value && (P = window.setTimeout(() => {
|
|
145
|
+
P = void 0, Ue = Date.now(), k.value = !0;
|
|
146
|
+
}, Fe)));
|
|
147
|
+
}
|
|
148
|
+
function X(e = !1) {
|
|
149
|
+
if (!Y()) {
|
|
150
|
+
k.value = !1;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (P &&= (window.clearTimeout(P), void 0), !k.value) return;
|
|
154
|
+
if (e) {
|
|
155
|
+
mt(), k.value = !1;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
let t = Math.max(0, Ie - (Date.now() - Ue));
|
|
159
|
+
He = window.setTimeout(() => {
|
|
160
|
+
He = void 0, k.value = !1;
|
|
161
|
+
}, t);
|
|
162
|
+
}
|
|
163
|
+
function gt(e, t, n) {
|
|
164
|
+
return Math.min(n, Math.max(t, e));
|
|
165
|
+
}
|
|
166
|
+
let { lock: _t, unlock: vt } = ce();
|
|
167
|
+
function yt(e) {
|
|
168
|
+
return G.value === 0 ? 0 : gt(e, 0, G.value - 1);
|
|
169
|
+
}
|
|
170
|
+
function bt() {
|
|
171
|
+
return yt(x.currentIndex ?? x.initialIndex);
|
|
172
|
+
}
|
|
173
|
+
function xt() {
|
|
174
|
+
I?.kill(), I = void 0;
|
|
175
|
+
}
|
|
176
|
+
function Z(e, t = !0) {
|
|
177
|
+
xt();
|
|
178
|
+
let n = {
|
|
179
|
+
scale: e.scale ?? A.scale,
|
|
180
|
+
x: e.x ?? A.x,
|
|
181
|
+
y: e.y ?? A.y,
|
|
182
|
+
rotation: e.rotation ?? A.rotation
|
|
183
|
+
};
|
|
184
|
+
if (!t || b()) {
|
|
185
|
+
A.scale = n.scale, A.x = n.x, A.y = n.y, A.rotation = n.rotation;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
I = y.to(A, {
|
|
189
|
+
...n,
|
|
190
|
+
duration: .22,
|
|
191
|
+
ease: "power3.out",
|
|
192
|
+
overwrite: !0,
|
|
193
|
+
onComplete: () => {
|
|
194
|
+
I = void 0;
|
|
195
|
+
},
|
|
196
|
+
onInterrupt: () => {
|
|
197
|
+
I = void 0;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function St(e = !0) {
|
|
202
|
+
Z({
|
|
203
|
+
scale: 1,
|
|
204
|
+
x: 0,
|
|
205
|
+
y: 0,
|
|
206
|
+
rotation: 0
|
|
207
|
+
}, e);
|
|
208
|
+
}
|
|
209
|
+
function Ct(e, t = !0) {
|
|
210
|
+
let n = gt(e, rt.value, it.value), r = A.scale === 0 ? 1 : n / A.scale;
|
|
211
|
+
Z({
|
|
212
|
+
scale: n,
|
|
213
|
+
x: n <= 1 ? 0 : A.x * r,
|
|
214
|
+
y: n <= 1 ? 0 : A.y * r
|
|
215
|
+
}, t);
|
|
216
|
+
}
|
|
217
|
+
function wt() {
|
|
218
|
+
Ct(A.scale + at.value);
|
|
219
|
+
}
|
|
220
|
+
function Tt() {
|
|
221
|
+
Ct(A.scale - at.value);
|
|
222
|
+
}
|
|
223
|
+
function Et(e) {
|
|
224
|
+
Z({ rotation: A.rotation + e });
|
|
225
|
+
}
|
|
226
|
+
function Q() {
|
|
227
|
+
We += 1, F &&= (F.onload = null, F.onerror = null, void 0), D.value = void 0;
|
|
228
|
+
}
|
|
229
|
+
function Dt(e, t = !1) {
|
|
230
|
+
if (E.value = e, D.value = void 0, O.value = t ? "error" : "loading", St(!1), t) {
|
|
231
|
+
X();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
fe(() => {
|
|
235
|
+
let e = ze.value;
|
|
236
|
+
if (e?.complete) {
|
|
237
|
+
if (e.naturalWidth > 0) {
|
|
238
|
+
Mt();
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
Nt();
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
function $(e, t) {
|
|
246
|
+
let n = yt(e), r = J.value, i = D.value !== void 0;
|
|
247
|
+
if (D.value === n || E.value === n && !i) return;
|
|
248
|
+
if (Q(), Ve.value = t ?? (n >= r ? 1 : -1), E.value === n) {
|
|
249
|
+
if (X(), i) {
|
|
250
|
+
S("update:currentIndex", n);
|
|
251
|
+
let e = q.value;
|
|
252
|
+
e && S("change", n, e);
|
|
253
|
+
}
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
let a = Qe.value[n], ee = a?.previewSrc || a?.src || "";
|
|
257
|
+
if (D.value = n, ht(), S("update:currentIndex", n), a && S("change", n, a), !Y() || !ee) {
|
|
258
|
+
Dt(n, !ee);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
let te = ++We, o = new Image();
|
|
262
|
+
F = o, o.decoding = "async", o.onload = () => {
|
|
263
|
+
te === We && (F = void 0, Dt(n));
|
|
264
|
+
}, o.onerror = () => {
|
|
265
|
+
te === We && (F = void 0, Dt(n, !0));
|
|
266
|
+
}, o.src = ee;
|
|
267
|
+
}
|
|
268
|
+
function Ot() {
|
|
269
|
+
if (tt.value) {
|
|
270
|
+
if (J.value === 0) {
|
|
271
|
+
x.loop && $(G.value - 1, -1);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
$(J.value - 1, -1);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function kt() {
|
|
278
|
+
if (tt.value) {
|
|
279
|
+
if (J.value === G.value - 1) {
|
|
280
|
+
x.loop && $(0, 1);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
$(J.value + 1, 1);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function At(e) {
|
|
287
|
+
S("update:modelValue", !1), S("close", e);
|
|
288
|
+
}
|
|
289
|
+
function jt() {
|
|
290
|
+
x.closeOnOverlay && At("overlay");
|
|
291
|
+
}
|
|
292
|
+
function Mt() {
|
|
293
|
+
O.value = "loaded", U = !0, X();
|
|
294
|
+
}
|
|
295
|
+
function Nt() {
|
|
296
|
+
O.value = "error", X();
|
|
297
|
+
}
|
|
298
|
+
function Pt() {
|
|
299
|
+
let e = R;
|
|
300
|
+
R = void 0, L?.kill(), L = void 0, e?.();
|
|
301
|
+
}
|
|
302
|
+
function Ft() {
|
|
303
|
+
if (Ge = !1, !z || !V) return;
|
|
304
|
+
Pt();
|
|
305
|
+
let e = z, t = B, n = V, r = H, i = !1;
|
|
306
|
+
z = void 0, B = void 0, V = void 0, H = void 0;
|
|
307
|
+
let a = () => {
|
|
308
|
+
i || (i = !0, y.set(e, { clearProps: "opacity,visibility,transform" }), t && y.set(t, { clearProps: "opacity,visibility,transform" }), n(), r?.(), U = !0, R === a && (R = void 0, L = void 0));
|
|
309
|
+
};
|
|
310
|
+
if (R = a, b()) {
|
|
311
|
+
a();
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
L = y.timeline({
|
|
315
|
+
defaults: { overwrite: "auto" },
|
|
316
|
+
onComplete: a
|
|
317
|
+
}), t && L.to(t, {
|
|
318
|
+
autoAlpha: 0,
|
|
319
|
+
x: Ve.value * -18,
|
|
320
|
+
scale: .992,
|
|
321
|
+
duration: .22,
|
|
322
|
+
ease: "power2.inOut"
|
|
323
|
+
}, 0), L.to(e, {
|
|
324
|
+
autoAlpha: 1,
|
|
325
|
+
x: 0,
|
|
326
|
+
y: 0,
|
|
327
|
+
scale: 1,
|
|
328
|
+
duration: t ? .34 : .28,
|
|
329
|
+
ease: "power3.out"
|
|
330
|
+
}, t ? .04 : 0);
|
|
331
|
+
}
|
|
332
|
+
function It() {
|
|
333
|
+
Ge || (Ge = !0, queueMicrotask(Ft));
|
|
334
|
+
}
|
|
335
|
+
function Lt(e) {
|
|
336
|
+
let t = e;
|
|
337
|
+
y.set(t, {
|
|
338
|
+
autoAlpha: 0,
|
|
339
|
+
x: U ? Ve.value * 24 : 0,
|
|
340
|
+
y: U ? 0 : 10,
|
|
341
|
+
scale: .985
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
function Rt(e, t) {
|
|
345
|
+
z = e, V = t, It();
|
|
346
|
+
}
|
|
347
|
+
function zt(e, t) {
|
|
348
|
+
B = e, H = t, It();
|
|
349
|
+
}
|
|
350
|
+
function Bt(e) {
|
|
351
|
+
if (e.preventDefault(), K.value) {
|
|
352
|
+
if (e.deltaY < 0) {
|
|
353
|
+
wt();
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
Tt();
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function Vt(e) {
|
|
360
|
+
if (!(e.button !== 0 || !K.value || O.value === "error")) {
|
|
361
|
+
xt(), Be.value = !0, Ze = !1, Ke = e.pointerId, qe = e.clientX, Je = e.clientY, Ye = A.x, Xe = A.y;
|
|
362
|
+
try {
|
|
363
|
+
e.currentTarget?.setPointerCapture?.(e.pointerId);
|
|
364
|
+
} catch {}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function Ht(e) {
|
|
368
|
+
if (!Be.value || e.pointerId !== Ke) return;
|
|
369
|
+
let t = e.clientX - qe, n = e.clientY - Je;
|
|
370
|
+
Math.hypot(t, n) > Pe && (Ze = !0), A.x = Ye + t, A.y = Xe + n;
|
|
371
|
+
}
|
|
372
|
+
function Ut() {
|
|
373
|
+
Be.value = !1, Ke = void 0;
|
|
374
|
+
}
|
|
375
|
+
function Wt() {
|
|
376
|
+
if (!(Ze || O.value === "error")) {
|
|
377
|
+
if (A.scale <= 1.01) {
|
|
378
|
+
Ct(Math.min(2, it.value));
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
Z({
|
|
382
|
+
scale: 1,
|
|
383
|
+
x: 0,
|
|
384
|
+
y: 0
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function Gt() {
|
|
389
|
+
let e = q.value;
|
|
390
|
+
if (!e || (S("download", {
|
|
391
|
+
item: e,
|
|
392
|
+
index: E.value
|
|
393
|
+
}), !Y())) return;
|
|
394
|
+
let t = document.createElement("a");
|
|
395
|
+
t.href = e.downloadUrl || e.previewSrc || e.src, t.download = e.downloadName || "", t.rel = "noopener", document.body.appendChild(t), t.click(), t.remove();
|
|
396
|
+
}
|
|
397
|
+
function Kt(e) {
|
|
398
|
+
if (!(!x.modelValue || !ut.isTop(e) || e.defaultPrevented)) {
|
|
399
|
+
if (e.key === "ArrowLeft") {
|
|
400
|
+
e.preventDefault(), Ot();
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (e.key === "ArrowRight") {
|
|
404
|
+
e.preventDefault(), kt();
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
if (e.key === "+" || e.key === "=") {
|
|
408
|
+
e.preventDefault(), wt();
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
if (e.key === "-") {
|
|
412
|
+
e.preventDefault(), Tt();
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
e.key === "0" && (e.preventDefault(), St());
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function qt() {
|
|
419
|
+
if (Y()) {
|
|
420
|
+
if (x.modelValue && !j) {
|
|
421
|
+
window.addEventListener("keydown", Kt), j = !0;
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
!x.modelValue && j && (window.removeEventListener("keydown", Kt), j = !1);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
function Jt() {
|
|
428
|
+
Y() && (M &&= (window.cancelAnimationFrame(M), 0), N &&= (window.clearTimeout(N), void 0));
|
|
429
|
+
}
|
|
430
|
+
function Yt() {
|
|
431
|
+
C.value && (W?.revert(), W = y.context(() => {
|
|
432
|
+
let e = C.value?.querySelector(".bing-image-preview__media"), t = C.value?.querySelector(".bing-image-preview__toolbar");
|
|
433
|
+
!e || b() || (y.fromTo(e, {
|
|
434
|
+
autoAlpha: 0,
|
|
435
|
+
scale: .96,
|
|
436
|
+
y: 16
|
|
437
|
+
}, {
|
|
438
|
+
autoAlpha: 1,
|
|
439
|
+
scale: 1,
|
|
440
|
+
y: 0,
|
|
441
|
+
duration: .28,
|
|
442
|
+
ease: "power3.out",
|
|
443
|
+
clearProps: "opacity,visibility,transform"
|
|
444
|
+
}), t && y.fromTo(t, {
|
|
445
|
+
autoAlpha: 0,
|
|
446
|
+
y: -8
|
|
447
|
+
}, {
|
|
448
|
+
autoAlpha: 1,
|
|
449
|
+
y: 0,
|
|
450
|
+
duration: .22,
|
|
451
|
+
ease: "power2.out",
|
|
452
|
+
clearProps: "opacity,visibility,transform"
|
|
453
|
+
}));
|
|
454
|
+
}, C.value));
|
|
455
|
+
}
|
|
456
|
+
async function Xt(e) {
|
|
457
|
+
if (!Y()) {
|
|
458
|
+
w.value = e, T.value = e;
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
if (Jt(), e) {
|
|
462
|
+
Q(), X(!0), U = !1, E.value = bt(), O.value = "loading", ht(), St(!1), x.lockScroll && _t(), w.value = !0, T.value = !1, await fe(), ut.isTop() && C.value?.focus(), Yt(), M = window.requestAnimationFrame(() => {
|
|
463
|
+
M = 0, T.value = !0;
|
|
464
|
+
});
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
T.value = !1, Q(), X(!0), Pt(), W?.revert(), W = void 0, Ut(), xt(), N = window.setTimeout(() => {
|
|
468
|
+
N = void 0, w.value = !1, vt();
|
|
469
|
+
}, b() ? 0 : Ne);
|
|
470
|
+
}
|
|
471
|
+
return ve([Re, () => x.modelValue], ([e, t]) => {
|
|
472
|
+
e && (Xt(t), qt());
|
|
473
|
+
}, { immediate: !0 }), ve(() => x.currentIndex, (e) => {
|
|
474
|
+
e === void 0 || !x.modelValue || $(e);
|
|
475
|
+
}), ve(() => G.value, () => {
|
|
476
|
+
D.value !== void 0 && D.value >= G.value && (Q(), X()), E.value = yt(E.value);
|
|
477
|
+
}), he(() => {
|
|
478
|
+
Jt(), Q(), X(!0), L?.kill(), L = void 0, R = void 0, z = void 0, B = void 0, V = void 0, H = void 0, W?.revert(), W = void 0, xt(), vt(), Y() && j && (window.removeEventListener("keydown", Kt), j = !1);
|
|
479
|
+
}), (e, t) => _(Re) ? (h(), u(le, {
|
|
480
|
+
key: 0,
|
|
481
|
+
to: c.teleportTo
|
|
482
|
+
}, [w.value ? (h(), f("div", {
|
|
483
|
+
key: 0,
|
|
484
|
+
ref_key: "rootRef",
|
|
485
|
+
ref: C,
|
|
486
|
+
class: pe(lt.value),
|
|
487
|
+
style: me(dt.value),
|
|
488
|
+
tabindex: "-1",
|
|
489
|
+
role: "dialog",
|
|
490
|
+
"aria-modal": "true",
|
|
491
|
+
"aria-label": c.ariaLabel,
|
|
492
|
+
onWheel: Bt
|
|
493
|
+
}, [
|
|
494
|
+
p("div", {
|
|
495
|
+
class: "bing-image-preview__backdrop",
|
|
496
|
+
"aria-hidden": "true",
|
|
497
|
+
onClick: jt
|
|
498
|
+
}),
|
|
499
|
+
c.showToolbar ? (h(), f("div", be, [K.value ? (h(), f("div", xe, [c.showCounter ? (h(), f("span", {
|
|
500
|
+
key: 0,
|
|
501
|
+
class: "bing-image-preview__counter",
|
|
502
|
+
role: "status",
|
|
503
|
+
"aria-live": "polite",
|
|
504
|
+
"aria-atomic": "true",
|
|
505
|
+
"aria-label": pt.value.label
|
|
506
|
+
}, [
|
|
507
|
+
p("span", Ce, _e(pt.value.current), 1),
|
|
508
|
+
t[4] ||= p("span", {
|
|
509
|
+
class: "bing-image-preview__counter-divider",
|
|
510
|
+
"aria-hidden": "true"
|
|
511
|
+
}, "/", -1),
|
|
512
|
+
p("span", we, _e(pt.value.total), 1)
|
|
513
|
+
], 8, Se)) : d("", !0), p("span", Te, [m(ue, { name: "bing-image-preview-loading" }, {
|
|
514
|
+
default: v(() => [k.value ? (h(), f("span", Ee, [...t[5] ||= [p("span", {
|
|
515
|
+
class: "bing-image-preview__spinner",
|
|
516
|
+
"aria-hidden": "true"
|
|
517
|
+
}, null, -1)]])) : d("", !0)]),
|
|
518
|
+
_: 1
|
|
519
|
+
})])])) : d("", !0), p("div", De, [
|
|
520
|
+
m(n, {
|
|
521
|
+
variant: "ghost",
|
|
522
|
+
size: "xs",
|
|
523
|
+
rounded: "sm",
|
|
524
|
+
throttle: !1,
|
|
525
|
+
class: "bing-image-preview__tool bing-image-preview__tool--zoom-out",
|
|
526
|
+
"aria-label": "缩小",
|
|
527
|
+
disabled: ot.value,
|
|
528
|
+
onClick: Tt
|
|
529
|
+
}, {
|
|
530
|
+
prefix: v(() => [m(s, {
|
|
531
|
+
icon: _(ie),
|
|
532
|
+
size: "sm"
|
|
533
|
+
}, null, 8, ["icon"])]),
|
|
534
|
+
_: 1
|
|
535
|
+
}, 8, ["disabled"]),
|
|
536
|
+
m(n, {
|
|
537
|
+
variant: "ghost",
|
|
538
|
+
size: "xs",
|
|
539
|
+
rounded: "sm",
|
|
540
|
+
throttle: !1,
|
|
541
|
+
class: "bing-image-preview__tool bing-image-preview__tool--zoom-in",
|
|
542
|
+
"aria-label": "放大",
|
|
543
|
+
disabled: st.value,
|
|
544
|
+
onClick: wt
|
|
545
|
+
}, {
|
|
546
|
+
prefix: v(() => [m(s, {
|
|
547
|
+
icon: _(re),
|
|
548
|
+
size: "sm"
|
|
549
|
+
}, null, 8, ["icon"])]),
|
|
550
|
+
_: 1
|
|
551
|
+
}, 8, ["disabled"]),
|
|
552
|
+
m(n, {
|
|
553
|
+
variant: "ghost",
|
|
554
|
+
size: "xs",
|
|
555
|
+
rounded: "sm",
|
|
556
|
+
throttle: !1,
|
|
557
|
+
class: "bing-image-preview__tool",
|
|
558
|
+
"aria-label": "向左旋转",
|
|
559
|
+
onClick: t[0] ||= (e) => Et(-90)
|
|
560
|
+
}, {
|
|
561
|
+
prefix: v(() => [m(s, {
|
|
562
|
+
icon: _(te),
|
|
563
|
+
size: "sm"
|
|
564
|
+
}, null, 8, ["icon"])]),
|
|
565
|
+
_: 1
|
|
566
|
+
}),
|
|
567
|
+
m(n, {
|
|
568
|
+
variant: "ghost",
|
|
569
|
+
size: "xs",
|
|
570
|
+
rounded: "sm",
|
|
571
|
+
throttle: !1,
|
|
572
|
+
class: "bing-image-preview__tool",
|
|
573
|
+
"aria-label": "向右旋转",
|
|
574
|
+
onClick: t[1] ||= (e) => Et(90)
|
|
575
|
+
}, {
|
|
576
|
+
prefix: v(() => [m(s, {
|
|
577
|
+
icon: _(o),
|
|
578
|
+
size: "sm"
|
|
579
|
+
}, null, 8, ["icon"])]),
|
|
580
|
+
_: 1
|
|
581
|
+
}),
|
|
582
|
+
m(n, {
|
|
583
|
+
variant: "ghost",
|
|
584
|
+
size: "xs",
|
|
585
|
+
rounded: "sm",
|
|
586
|
+
throttle: !1,
|
|
587
|
+
class: "bing-image-preview__tool",
|
|
588
|
+
"aria-label": "重置图片",
|
|
589
|
+
onClick: t[2] ||= (e) => St()
|
|
590
|
+
}, {
|
|
591
|
+
prefix: v(() => [m(s, {
|
|
592
|
+
icon: _(ee),
|
|
593
|
+
size: "sm"
|
|
594
|
+
}, null, 8, ["icon"])]),
|
|
595
|
+
_: 1
|
|
596
|
+
}),
|
|
597
|
+
nt.value ? (h(), u(n, {
|
|
598
|
+
key: 0,
|
|
599
|
+
variant: "ghost",
|
|
600
|
+
size: "xs",
|
|
601
|
+
rounded: "sm",
|
|
602
|
+
throttle: !1,
|
|
603
|
+
class: "bing-image-preview__tool",
|
|
604
|
+
"aria-label": "下载图片",
|
|
605
|
+
onClick: Gt
|
|
606
|
+
}, {
|
|
607
|
+
prefix: v(() => [m(s, {
|
|
608
|
+
icon: _(a),
|
|
609
|
+
size: "sm"
|
|
610
|
+
}, null, 8, ["icon"])]),
|
|
611
|
+
_: 1
|
|
612
|
+
})) : d("", !0),
|
|
613
|
+
m(n, {
|
|
614
|
+
variant: "ghost",
|
|
615
|
+
size: "xs",
|
|
616
|
+
rounded: "sm",
|
|
617
|
+
throttle: !1,
|
|
618
|
+
class: "bing-image-preview__tool",
|
|
619
|
+
"aria-label": "关闭预览",
|
|
620
|
+
onClick: t[3] ||= (e) => At("close")
|
|
621
|
+
}, {
|
|
622
|
+
prefix: v(() => [m(s, {
|
|
623
|
+
icon: _(ne),
|
|
624
|
+
size: "sm"
|
|
625
|
+
}, null, 8, ["icon"])]),
|
|
626
|
+
_: 1
|
|
627
|
+
})
|
|
628
|
+
])])) : d("", !0),
|
|
629
|
+
tt.value ? (h(), u(n, {
|
|
630
|
+
key: 1,
|
|
631
|
+
variant: "ghost",
|
|
632
|
+
size: "xs",
|
|
633
|
+
rounded: "sm",
|
|
634
|
+
throttle: !1,
|
|
635
|
+
class: "bing-image-preview__nav bing-image-preview__nav--prev",
|
|
636
|
+
"aria-label": "上一张图片",
|
|
637
|
+
onClick: Ot
|
|
638
|
+
}, {
|
|
639
|
+
prefix: v(() => [m(s, {
|
|
640
|
+
icon: _(r),
|
|
641
|
+
size: "lg"
|
|
642
|
+
}, null, 8, ["icon"])]),
|
|
643
|
+
_: 1
|
|
644
|
+
})) : d("", !0),
|
|
645
|
+
tt.value ? (h(), u(n, {
|
|
646
|
+
key: 2,
|
|
647
|
+
variant: "ghost",
|
|
648
|
+
size: "xs",
|
|
649
|
+
rounded: "sm",
|
|
650
|
+
throttle: !1,
|
|
651
|
+
class: "bing-image-preview__nav bing-image-preview__nav--next",
|
|
652
|
+
"aria-label": "下一张图片",
|
|
653
|
+
onClick: kt
|
|
654
|
+
}, {
|
|
655
|
+
prefix: v(() => [m(s, {
|
|
656
|
+
icon: _(i),
|
|
657
|
+
size: "lg"
|
|
658
|
+
}, null, 8, ["icon"])]),
|
|
659
|
+
_: 1
|
|
660
|
+
})) : d("", !0),
|
|
661
|
+
p("div", Oe, [p("div", {
|
|
662
|
+
class: "bing-image-preview__media",
|
|
663
|
+
onPointerdown: Vt,
|
|
664
|
+
onPointermove: Ht,
|
|
665
|
+
onPointerup: Ut,
|
|
666
|
+
onPointercancel: Ut,
|
|
667
|
+
onLostpointercapture: Ut,
|
|
668
|
+
onDblclick: Wt
|
|
669
|
+
}, [
|
|
670
|
+
m(ue, {
|
|
671
|
+
css: !1,
|
|
672
|
+
onBeforeEnter: Lt,
|
|
673
|
+
onEnter: Rt,
|
|
674
|
+
onLeave: zt
|
|
675
|
+
}, {
|
|
676
|
+
default: v(() => [K.value ? (h(), f("div", {
|
|
677
|
+
key: $e.value,
|
|
678
|
+
class: "bing-image-preview__image-frame"
|
|
679
|
+
}, [p("img", {
|
|
680
|
+
ref_key: "imageRef",
|
|
681
|
+
ref: ze,
|
|
682
|
+
class: "bing-image-preview__img",
|
|
683
|
+
src: $e.value,
|
|
684
|
+
alt: et.value,
|
|
685
|
+
draggable: "false",
|
|
686
|
+
style: me(ft.value),
|
|
687
|
+
onLoad: Mt,
|
|
688
|
+
onError: Nt
|
|
689
|
+
}, null, 44, ke)])) : d("", !0)]),
|
|
690
|
+
_: 1
|
|
691
|
+
}),
|
|
692
|
+
K.value ? d("", !0) : (h(), f("div", Ae, "暂无图片")),
|
|
693
|
+
O.value === "error" ? (h(), f("div", je, " 图片加载失败 ")) : d("", !0)
|
|
694
|
+
], 32), q.value?.caption ? (h(), f("div", Me, _e(q.value.caption), 1)) : d("", !0)])
|
|
695
|
+
], 46, ye)) : d("", !0)], 8, ["to"])) : d("", !0);
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
//#endregion
|
|
699
|
+
export { b as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./BingInput.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/BingInput/BingInput.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-bdbb0f63"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|