x-next 1.6.0 → 1.8.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/AI_USAGE.md +182 -4
- package/CHANGELOG.md +74 -0
- package/dist/_hooks/use-chart-size.d.ts +25 -0
- package/dist/_utils/chart/index.d.ts +6 -0
- package/dist/_utils/chart/padding.d.ts +15 -0
- package/dist/_utils/chart/path.d.ts +34 -0
- package/dist/_utils/chart/scale.d.ts +55 -0
- package/dist/components/_components/chart/ChartAxis.d.ts +85 -0
- package/dist/components/_components/chart/ChartLegend.d.ts +26 -0
- package/dist/components/_components/chart/ChartTooltip.d.ts +76 -0
- package/dist/components/_components/chart/colors.d.ts +10 -0
- package/dist/components/_components/chart/interface.d.ts +38 -0
- package/dist/components/bar-chart/BarChart.d.ts +278 -0
- package/dist/components/bar-chart/helpers/layout.d.ts +55 -0
- package/dist/components/bar-chart/index.d.ts +600 -0
- package/dist/components/bar-chart/interface.d.ts +74 -0
- package/dist/components/bar-chart/props.d.ts +145 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/draggable/Draggable.d.ts +1 -1
- package/dist/components/draggable/index.d.ts +2 -2
- package/dist/components/drawer/index.d.ts +6 -6
- package/dist/components/drawer/src/Drawer.vue.d.ts +3 -3
- package/dist/components/dropdown/Dropdown.vue.d.ts +4 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +5 -5
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
- package/dist/components/dropdown/index.d.ts +29 -29
- package/dist/components/form/FormItem.vue.d.ts +12 -12
- package/dist/components/form/form-item-label.vue.d.ts +3 -3
- package/dist/components/form/index.d.ts +24 -24
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/index.d.ts +6 -6
- package/dist/components/form-slider/Slider.vue.d.ts +3 -3
- package/dist/components/form-slider/index.d.ts +6 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
- package/dist/components/grid/Row.vue.d.ts +3 -3
- package/dist/components/grid/index.d.ts +9 -9
- package/dist/components/heatmap/Heatmap.d.ts +10 -0
- package/dist/components/heatmap/index.d.ts +30 -0
- package/dist/components/image/Image.vue.d.ts +125 -17
- package/dist/components/image/ImagePreview.vue.d.ts +97 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +100 -7
- package/dist/components/image/hooks/use-image-drag.d.ts +2 -2
- package/dist/components/image/index.d.ts +712 -124
- package/dist/components/image/interface.d.ts +9 -1
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/index.d.ts +4 -0
- package/dist/components/line-chart/LineChart.d.ts +295 -0
- package/dist/components/line-chart/helpers/layout.d.ts +74 -0
- package/dist/components/line-chart/index.d.ts +614 -0
- package/dist/components/line-chart/interface.d.ts +76 -0
- package/dist/components/line-chart/props.d.ts +173 -0
- package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/pie-chart/PieChart.d.ts +219 -0
- package/dist/components/pie-chart/index.d.ts +470 -0
- package/dist/components/pie-chart/interface.d.ts +58 -0
- package/dist/components/pie-chart/props.d.ts +107 -0
- package/dist/components/popconfirm/src/popup.vue.d.ts +3 -3
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/space/Space.d.ts +1 -1
- package/dist/components/space/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
- package/dist/components/time-picker/index.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trend-chart/components/TrendChart.d.ts +19 -96
- package/dist/components/trend-chart/index.d.ts +33 -187
- package/dist/components/trend-chart/props.d.ts +9 -78
- package/dist/components/trend-chart/themes.d.ts +0 -1
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/components/upload/Upload.d.ts +372 -0
- package/dist/components/upload/context.d.ts +28 -0
- package/dist/components/upload/index.d.ts +656 -0
- package/dist/components/upload/interface.d.ts +110 -0
- package/dist/components/upload/props.d.ts +321 -0
- package/dist/components/upload/upload-list-item.d.ts +15 -0
- package/dist/components/upload/upload-list.d.ts +11 -0
- package/dist/components/upload/upload-picture-item.d.ts +20 -0
- package/dist/components/upload/upload-trigger.d.ts +8 -0
- package/dist/components/upload/utils.d.ts +48 -0
- package/dist/es/_hooks/use-chart-size.js +25 -0
- package/dist/es/_styles/palette-aliases.js +7 -4
- package/dist/es/_utils/chart/padding.js +22 -0
- package/dist/es/_utils/chart/path.js +69 -0
- package/dist/es/_utils/chart/scale.js +77 -0
- package/dist/es/components/_components/chart/ChartAxis.js +79 -0
- package/dist/es/components/_components/chart/ChartLegend.js +53 -0
- package/dist/es/components/_components/chart/ChartTooltip.js +64 -0
- package/dist/es/components/_components/chart/colors.js +12 -0
- package/dist/es/components/bar-chart/BarChart.js +470 -0
- package/dist/es/components/bar-chart/helpers/layout.js +53 -0
- package/dist/es/components/bar-chart/index.js +8 -0
- package/dist/es/components/bar-chart/props.js +148 -0
- package/dist/es/components/heatmap/Heatmap.js +244 -169
- package/dist/es/components/image/Image.vue.js +55 -45
- package/dist/es/components/image/Image.vue2.js +113 -92
- package/dist/es/components/image/ImagePreview.vue.js +66 -53
- package/dist/es/components/image/ImagePreview.vue2.js +219 -171
- package/dist/es/components/image/ImagePreviewAction.js +12 -15
- package/dist/es/components/image/ImagePreviewGroup.vue.js +21 -20
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +45 -39
- package/dist/es/components/image/hooks/use-image-drag.js +16 -14
- package/dist/es/components/index.js +136 -128
- package/dist/es/components/line-chart/LineChart.js +532 -0
- package/dist/es/components/line-chart/helpers/layout.js +80 -0
- package/dist/es/components/line-chart/index.js +8 -0
- package/dist/es/components/line-chart/props.js +178 -0
- package/dist/es/components/pie-chart/PieChart.js +397 -0
- package/dist/es/components/pie-chart/index.js +8 -0
- package/dist/es/components/pie-chart/props.js +104 -0
- package/dist/es/components/trend-chart/components/TrendChart.js +143 -183
- package/dist/es/components/trend-chart/components/trend-chart-curve.js +85 -81
- package/dist/es/components/trend-chart/props.js +28 -74
- package/dist/es/components/trend-chart/themes.js +30 -31
- package/dist/es/components/upload/Upload.js +420 -0
- package/dist/es/components/upload/context.js +4 -0
- package/dist/es/components/upload/index.js +8 -0
- package/dist/es/components/upload/props.js +321 -0
- package/dist/es/components/upload/upload-list-item.js +138 -0
- package/dist/es/components/upload/upload-list.js +48 -0
- package/dist/es/components/upload/upload-picture-item.js +109 -0
- package/dist/es/components/upload/upload-trigger.js +89 -0
- package/dist/es/components/upload/utils.js +195 -0
- package/dist/es/icons/_self/upload-icons.js +103 -0
- package/dist/es/index.js +197 -189
- package/dist/es/locale/en-US.js +30 -1
- package/dist/es/locale/zh-CN.js +30 -1
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/upload-icons.d.ts +523 -0
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +45 -0
- package/dist/style/bar-chart.css +1 -0
- package/dist/style/bar-chart.js +2 -0
- package/dist/style/base.css +1 -1
- package/dist/style/heatmap.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/line-chart.css +1 -0
- package/dist/style/line-chart.js +2 -0
- package/dist/style/pie-chart.css +1 -0
- package/dist/style/pie-chart.js +2 -0
- package/dist/style/upload.css +1 -0
- package/dist/style/upload.js +2 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
- package/volar.d.ts +4 -0
- package/dist/components/trend-chart/components/trend-chart-grid.d.ts +0 -55
- package/dist/components/trend-chart/components/trend-chart-labels.d.ts +0 -26
- package/dist/components/trend-chart/helpers/genPath.d.ts +0 -8
- package/dist/components/trend-chart/helpers/getPadding.d.ts +0 -8
- package/dist/components/trend-chart/helpers/validatePadding.d.ts +0 -2
- package/dist/es/_hooks/use-popup-overflow-hidden.js +0 -29
- package/dist/es/components/trend-chart/components/trend-chart-grid.js +0 -62
- package/dist/es/components/trend-chart/components/trend-chart-labels.js +0 -75
- package/dist/es/components/trend-chart/helpers/genPath.js +0 -22
- package/dist/es/components/trend-chart/helpers/getPadding.js +0 -21
- package/dist/es/components/trend-chart/helpers/validatePadding.js +0 -7
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useLocale as
|
|
4
|
-
import { getClassNameMixin as
|
|
5
|
-
import { throttleByRaf as
|
|
6
|
-
import { KEYBOARD_KEY as
|
|
7
|
-
import { isServerRendering as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
|
|
1
|
+
import { defineComponent as Se, toRefs as he, ref as g, onMounted as we, reactive as D, computed as y, watch as k, nextTick as ke, onBeforeUnmount as Ce, h as b } from "vue";
|
|
2
|
+
import Ie from "../../_hooks/use-merge-state.js";
|
|
3
|
+
import { useLocale as Re } from "../../locale/index.js";
|
|
4
|
+
import { getClassNameMixin as Te } from "../../_utils/config.js";
|
|
5
|
+
import { throttleByRaf as Oe } from "../../_utils/throttle-by-raf.js";
|
|
6
|
+
import { KEYBOARD_KEY as c } from "../../_utils/keyboard.js";
|
|
7
|
+
import { isServerRendering as m, on as ze, off as Ae } from "../../_utils/dom.js";
|
|
8
|
+
import Pe from "./preview-arrow.vue.js";
|
|
9
|
+
import Ee from "./preview-toolbar.vue.js";
|
|
10
|
+
import Ne from "./hooks/use-image-load-status.js";
|
|
11
|
+
import Be from "./hooks/use-image-drag.js";
|
|
12
|
+
import Le from "../../icons/animation/animation-loading.js";
|
|
13
|
+
import xe from "../../icons/default/close.js";
|
|
14
|
+
import De from "../../icons/default/close-circle-fill.js";
|
|
15
|
+
import _e from "../../icons/_self/zoom-out.js";
|
|
16
|
+
import Me from "../../icons/_self/zoom-in.js";
|
|
17
|
+
import Ve from "../../icons/_self/full-screen.js";
|
|
18
|
+
import Fe from "../../icons/_self/rotate-left.js";
|
|
19
|
+
import Ke from "../../icons/_self/rotate-right.js";
|
|
20
|
+
import Ue from "../../icons/_self/original-size.js";
|
|
21
|
+
import { useOverflow as We } from "../../_hooks/use-overflow.js";
|
|
22
|
+
import je from "../../_hooks/use-popup-container.js";
|
|
23
|
+
import Ze, { getScaleByRate as He, maxScale as Y, minScale as G } from "./utils/get-scale.js";
|
|
24
|
+
import Ye from "../../_hooks/use-popup-manager.js";
|
|
25
|
+
const _ = 90, bt = /* @__PURE__ */ Se({
|
|
25
26
|
name: "ImagePreview",
|
|
27
|
+
inheritAttrs: !1,
|
|
26
28
|
components: {
|
|
27
|
-
PreviewArrow:
|
|
28
|
-
PreviewToolbar:
|
|
29
|
-
IconLoading:
|
|
30
|
-
IconClose:
|
|
29
|
+
PreviewArrow: Pe,
|
|
30
|
+
PreviewToolbar: Ee,
|
|
31
|
+
IconLoading: Le,
|
|
32
|
+
IconClose: xe,
|
|
33
|
+
IconImageClose: De
|
|
31
34
|
},
|
|
32
35
|
props: {
|
|
33
36
|
renderToBody: {
|
|
@@ -152,215 +155,260 @@ const T = 90, lo = /* @__PURE__ */ re({
|
|
|
152
155
|
* @slot actions
|
|
153
156
|
* @version 2.17.0
|
|
154
157
|
*/
|
|
155
|
-
setup(
|
|
156
|
-
|
|
158
|
+
setup(r, {
|
|
159
|
+
attrs: X,
|
|
160
|
+
emit: M
|
|
157
161
|
}) {
|
|
158
162
|
const {
|
|
159
|
-
t:
|
|
160
|
-
} =
|
|
161
|
-
src:
|
|
162
|
-
popupContainer:
|
|
163
|
-
visible:
|
|
164
|
-
defaultVisible:
|
|
165
|
-
maskClosable:
|
|
166
|
-
actionsLayout:
|
|
167
|
-
defaultScale:
|
|
168
|
-
zoomRate:
|
|
169
|
-
} =
|
|
170
|
-
|
|
171
|
-
|
|
163
|
+
t: u
|
|
164
|
+
} = Re(), {
|
|
165
|
+
src: V,
|
|
166
|
+
popupContainer: q,
|
|
167
|
+
visible: J,
|
|
168
|
+
defaultVisible: Q,
|
|
169
|
+
maskClosable: $,
|
|
170
|
+
actionsLayout: ee,
|
|
171
|
+
defaultScale: F,
|
|
172
|
+
zoomRate: O
|
|
173
|
+
} = he(r), l = g(), f = g(), K = g(!1);
|
|
174
|
+
we(() => {
|
|
175
|
+
K.value = !0;
|
|
172
176
|
});
|
|
173
|
-
const
|
|
174
|
-
value:
|
|
175
|
-
})),
|
|
176
|
-
[
|
|
177
|
-
}]),
|
|
178
|
-
popupContainer:
|
|
179
|
-
})),
|
|
180
|
-
zIndex:
|
|
181
|
-
|
|
177
|
+
const z = Te("image-preview"), [i, te] = Ie(Q.value, D({
|
|
178
|
+
value: J
|
|
179
|
+
})), oe = y(() => [z.block, {
|
|
180
|
+
[z.modifier("hide")]: !i.value
|
|
181
|
+
}]), ae = m ? void 0 : document.body, S = je(ae, D({
|
|
182
|
+
popupContainer: q
|
|
183
|
+
})), ie = y(() => !m && S.value === document.body), ne = y(() => m || !r.renderToBody || !S.value), {
|
|
184
|
+
zIndex: le,
|
|
185
|
+
isLastDialog: C,
|
|
186
|
+
close: re
|
|
187
|
+
} = Ye("dialog", {
|
|
182
188
|
visible: i
|
|
183
|
-
}),
|
|
184
|
-
...
|
|
185
|
-
zIndex:
|
|
189
|
+
}), se = y(() => ({
|
|
190
|
+
...ie.value ? {
|
|
191
|
+
zIndex: le.value,
|
|
186
192
|
position: "fixed"
|
|
187
193
|
} : {
|
|
188
194
|
zIndex: "inherit",
|
|
189
195
|
position: "absolute"
|
|
190
196
|
}
|
|
191
197
|
})), {
|
|
192
|
-
isLoading:
|
|
193
|
-
isLoaded:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
isLoading: ue,
|
|
199
|
+
isLoaded: d,
|
|
200
|
+
isError: ce,
|
|
201
|
+
setLoadStatus: A
|
|
202
|
+
} = Ne(), v = g(0), P = (e) => Number.isFinite(e) ? Math.max(G, Math.min(Y, e)) : 1, n = g(P(F.value)), {
|
|
203
|
+
translate: I,
|
|
204
|
+
moving: me,
|
|
205
|
+
resetTranslate: fe
|
|
206
|
+
} = Be(D({
|
|
207
|
+
wrapperEl: l,
|
|
208
|
+
imageEl: f,
|
|
202
209
|
visible: i,
|
|
203
|
-
scale:
|
|
204
|
-
})),
|
|
205
|
-
let
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
210
|
+
scale: n
|
|
211
|
+
})), h = g(!1);
|
|
212
|
+
let p;
|
|
213
|
+
const E = () => {
|
|
214
|
+
p && clearTimeout(p), p = void 0, h.value = !1;
|
|
215
|
+
}, de = () => {
|
|
216
|
+
!h.value && (h.value = !0), p && clearTimeout(p), p = setTimeout(() => {
|
|
217
|
+
h.value = !1;
|
|
209
218
|
}, 1e3);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
219
|
+
}, {
|
|
220
|
+
setOverflowHidden: ve,
|
|
221
|
+
resetOverflow: U
|
|
222
|
+
} = We(S);
|
|
223
|
+
k(i, (e) => {
|
|
224
|
+
e ? ve() : U();
|
|
225
|
+
}, {
|
|
226
|
+
immediate: !0
|
|
227
|
+
});
|
|
228
|
+
function pe() {
|
|
229
|
+
v.value = 0, n.value = P(F.value), fe(), E();
|
|
217
230
|
}
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
231
|
+
const N = (e) => ee.value.includes(e), W = (e) => {
|
|
232
|
+
if (!i.value || !r.keyboard || !C()) return;
|
|
233
|
+
const t = e.target;
|
|
234
|
+
if (t && (t.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(t.tagName)) && e.key !== c.ESC) return;
|
|
235
|
+
let o = !1;
|
|
221
236
|
switch (e.key) {
|
|
222
|
-
case
|
|
223
|
-
|
|
237
|
+
case c.ESC:
|
|
238
|
+
r.escToClose && (x(), o = !0);
|
|
224
239
|
break;
|
|
225
|
-
case
|
|
226
|
-
|
|
240
|
+
case c.ARROW_LEFT:
|
|
241
|
+
r.groupArrowProps.onPrev && (r.groupArrowProps.onPrev(), o = !0);
|
|
227
242
|
break;
|
|
228
|
-
case
|
|
229
|
-
|
|
243
|
+
case c.ARROW_RIGHT:
|
|
244
|
+
r.groupArrowProps.onNext && (r.groupArrowProps.onNext(), o = !0);
|
|
230
245
|
break;
|
|
231
|
-
case
|
|
232
|
-
|
|
246
|
+
case c.ARROW_UP:
|
|
247
|
+
d.value && N("zoomIn") && (t == null ? void 0 : t.tagName) !== "BUTTON" && (t == null ? void 0 : t.tagName) !== "A" && (R("zoomIn"), o = !0);
|
|
233
248
|
break;
|
|
234
|
-
case
|
|
235
|
-
|
|
249
|
+
case c.ARROW_DOWN:
|
|
250
|
+
d.value && N("zoomOut") && (t == null ? void 0 : t.tagName) !== "BUTTON" && (t == null ? void 0 : t.tagName) !== "A" && (R("zoomOut"), o = !0);
|
|
236
251
|
break;
|
|
237
|
-
case
|
|
238
|
-
|
|
252
|
+
case c.SPACE:
|
|
253
|
+
d.value && N("originalSize") && (t == null ? void 0 : t.tagName) !== "BUTTON" && (t == null ? void 0 : t.tagName) !== "A" && (w(1), o = !0);
|
|
239
254
|
break;
|
|
240
255
|
}
|
|
241
|
-
|
|
242
|
-
},
|
|
243
|
-
if (e.preventDefault(), e.stopPropagation(), !
|
|
244
|
-
const
|
|
245
|
-
|
|
256
|
+
o && (e.stopPropagation(), e.preventDefault());
|
|
257
|
+
}, B = Oe((e) => {
|
|
258
|
+
if (e.preventDefault(), e.stopPropagation(), !r.wheelZoom || !d.value || !i.value || !C()) return;
|
|
259
|
+
const a = (e.deltaY || e.deltaX) > 0 ? "zoomOut" : "zoomIn", o = Number.isFinite(O.value) && O.value > 1 ? O.value : 1.1, s = He(n.value, o, a);
|
|
260
|
+
w(s);
|
|
246
261
|
});
|
|
247
|
-
let
|
|
248
|
-
|
|
262
|
+
let L = null;
|
|
263
|
+
const j = () => {
|
|
264
|
+
const e = L;
|
|
265
|
+
L = null, e != null && e.isConnected && e.focus({
|
|
266
|
+
preventScroll: !0
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
k(i, (e) => {
|
|
270
|
+
e ? m || (L = document.activeElement) : (m || B.cancel(), E(), ke(j));
|
|
271
|
+
}, {
|
|
272
|
+
immediate: !0
|
|
273
|
+
}), k(l, (e) => {
|
|
274
|
+
e && C() && e.focus({
|
|
275
|
+
preventScroll: !0
|
|
276
|
+
});
|
|
277
|
+
}, {
|
|
249
278
|
flush: "post"
|
|
279
|
+
}), k([i, () => r.keyboard, S], ([e, t, a], o, s) => {
|
|
280
|
+
!e || !t || !a || m || (ze(a, "keydown", W), s(() => Ae(a, "keydown", W)));
|
|
281
|
+
}, {
|
|
282
|
+
immediate: !0
|
|
250
283
|
});
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
284
|
+
const ge = (e) => {
|
|
285
|
+
var H;
|
|
286
|
+
if (e.key !== "Tab" || !C() || !l.value) return;
|
|
287
|
+
const t = Array.from(l.value.querySelectorAll("button:not([disabled]), a[href], input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]")).filter((T) => T.tabIndex >= 0 && !T.closest('[hidden], [inert], [aria-hidden="true"]') && getComputedStyle(T).display !== "none" && getComputedStyle(T).visibility !== "hidden"), a = t[0], o = t.at(-1), s = document.activeElement;
|
|
288
|
+
a ? t.includes(s) ? e.shiftKey && s === a ? (e.preventDefault(), o == null || o.focus({
|
|
289
|
+
preventScroll: !0
|
|
290
|
+
})) : !e.shiftKey && s === o && (e.preventDefault(), a.focus({
|
|
291
|
+
preventScroll: !0
|
|
292
|
+
})) : (e.preventDefault(), (H = e.shiftKey ? o : a) == null || H.focus({
|
|
293
|
+
preventScroll: !0
|
|
294
|
+
})) : (e.preventDefault(), l.value.focus({
|
|
295
|
+
preventScroll: !0
|
|
296
|
+
}));
|
|
255
297
|
};
|
|
256
|
-
|
|
257
|
-
i.value
|
|
298
|
+
k([V, i], () => {
|
|
299
|
+
i.value && (pe(), A(V.value ? "loading" : "error"));
|
|
258
300
|
}, {
|
|
259
301
|
immediate: !0
|
|
260
302
|
});
|
|
261
|
-
function
|
|
262
|
-
i.value && (
|
|
303
|
+
function x() {
|
|
304
|
+
i.value && (M("close"), M("update:visible", !1), te(!1));
|
|
263
305
|
}
|
|
264
|
-
function
|
|
265
|
-
var
|
|
266
|
-
(
|
|
306
|
+
function ye(e) {
|
|
307
|
+
var t;
|
|
308
|
+
(t = l == null ? void 0 : l.value) == null || t.focus(), $.value && e.target === e.currentTarget && x();
|
|
267
309
|
}
|
|
268
|
-
function
|
|
269
|
-
if (
|
|
270
|
-
const
|
|
271
|
-
|
|
310
|
+
function w(e) {
|
|
311
|
+
if (e = P(e), n.value !== e) {
|
|
312
|
+
const t = n.value;
|
|
313
|
+
I.value = [I.value[0] * t / e, I.value[1] * t / e], n.value = e, de();
|
|
272
314
|
}
|
|
273
315
|
}
|
|
274
|
-
function
|
|
275
|
-
|
|
276
|
-
|
|
316
|
+
function be() {
|
|
317
|
+
if (!l.value || !f.value || !d.value) return;
|
|
318
|
+
const e = l.value.getBoundingClientRect(), t = f.value.getBoundingClientRect(), a = e.height / (t.height / n.value), o = e.width / (t.width / n.value);
|
|
319
|
+
if (t.width <= 0 || t.height <= 0) return;
|
|
320
|
+
const s = Math.min(a, o);
|
|
321
|
+
w(s);
|
|
277
322
|
}
|
|
278
|
-
function
|
|
279
|
-
const
|
|
280
|
-
|
|
323
|
+
function Z(e) {
|
|
324
|
+
const a = e === "clockwise" ? (v.value + _) % 360 : v.value === 0 ? 360 - _ : v.value - _;
|
|
325
|
+
v.value = a;
|
|
281
326
|
}
|
|
282
|
-
function
|
|
283
|
-
const
|
|
284
|
-
|
|
327
|
+
function R(e) {
|
|
328
|
+
const t = Ze(n.value, e);
|
|
329
|
+
w(t);
|
|
285
330
|
}
|
|
286
|
-
return
|
|
287
|
-
E();
|
|
331
|
+
return Ce(() => {
|
|
332
|
+
E(), m || B.cancel(), j(), re(), U();
|
|
288
333
|
}), {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
334
|
+
rootAttrs: y(() => Object.fromEntries(Object.entries(X).filter(([e]) => e !== "class" && e !== "style" && e !== "aria-label"))),
|
|
335
|
+
t: u,
|
|
336
|
+
className: z,
|
|
337
|
+
classNames: oe,
|
|
338
|
+
container: S,
|
|
339
|
+
teleportDisabled: ne,
|
|
340
|
+
wrapperStyles: se,
|
|
341
|
+
scale: n,
|
|
342
|
+
translate: I,
|
|
343
|
+
rotate: v,
|
|
344
|
+
moving: me,
|
|
299
345
|
mergedVisible: i,
|
|
300
|
-
isLoading:
|
|
301
|
-
isLoaded:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
346
|
+
isLoading: ue,
|
|
347
|
+
isLoaded: d,
|
|
348
|
+
isError: ce,
|
|
349
|
+
scaleValueVisible: h,
|
|
350
|
+
refWrapper: l,
|
|
351
|
+
refImage: f,
|
|
352
|
+
mounted: K,
|
|
353
|
+
onWheel: B,
|
|
354
|
+
onMaskClick: ye,
|
|
355
|
+
onCloseClick: x,
|
|
356
|
+
onDialogKeydown: ge,
|
|
357
|
+
onImgLoad(e) {
|
|
358
|
+
e.target === f.value && A("loaded");
|
|
311
359
|
},
|
|
312
|
-
onImgError() {
|
|
313
|
-
|
|
360
|
+
onImgError(e) {
|
|
361
|
+
e.target === f.value && A("error");
|
|
314
362
|
},
|
|
315
|
-
actions:
|
|
363
|
+
actions: y(() => [
|
|
316
364
|
/** 满屏 */
|
|
317
365
|
{
|
|
318
366
|
key: "fullScreen",
|
|
319
|
-
name:
|
|
320
|
-
content: () =>
|
|
321
|
-
onClick: () =>
|
|
367
|
+
name: u("imagePreview.fullscreen"),
|
|
368
|
+
content: () => b(Ve),
|
|
369
|
+
onClick: () => be()
|
|
322
370
|
},
|
|
323
371
|
/** 顺时针旋转 */
|
|
324
372
|
{
|
|
325
373
|
key: "rotateRight",
|
|
326
|
-
name:
|
|
327
|
-
content: () =>
|
|
328
|
-
onClick: () =>
|
|
374
|
+
name: u("imagePreview.rotateRight"),
|
|
375
|
+
content: () => b(Ke),
|
|
376
|
+
onClick: () => Z("clockwise")
|
|
329
377
|
},
|
|
330
378
|
/** 逆时针旋转 */
|
|
331
379
|
{
|
|
332
380
|
key: "rotateLeft",
|
|
333
|
-
name:
|
|
334
|
-
content: () =>
|
|
335
|
-
onClick: () =>
|
|
381
|
+
name: u("imagePreview.rotateLeft"),
|
|
382
|
+
content: () => b(Fe),
|
|
383
|
+
onClick: () => Z("counterclockwise")
|
|
336
384
|
},
|
|
337
385
|
/** 放大 */
|
|
338
386
|
{
|
|
339
387
|
key: "zoomIn",
|
|
340
|
-
name:
|
|
341
|
-
content: () =>
|
|
342
|
-
onClick: () =>
|
|
343
|
-
disabled:
|
|
388
|
+
name: u("imagePreview.zoomIn"),
|
|
389
|
+
content: () => b(Me),
|
|
390
|
+
onClick: () => R("zoomIn"),
|
|
391
|
+
disabled: n.value === Y
|
|
344
392
|
},
|
|
345
393
|
/** 缩小 */
|
|
346
394
|
{
|
|
347
395
|
key: "zoomOut",
|
|
348
|
-
name:
|
|
349
|
-
content: () =>
|
|
350
|
-
onClick: () =>
|
|
351
|
-
disabled:
|
|
396
|
+
name: u("imagePreview.zoomOut"),
|
|
397
|
+
content: () => b(_e),
|
|
398
|
+
onClick: () => R("zoomOut"),
|
|
399
|
+
disabled: n.value === G
|
|
352
400
|
},
|
|
353
401
|
/** 缩放到100% */
|
|
354
402
|
{
|
|
355
403
|
key: "originalSize",
|
|
356
|
-
name:
|
|
357
|
-
content: () =>
|
|
358
|
-
onClick: () =>
|
|
404
|
+
name: u("imagePreview.originalSize"),
|
|
405
|
+
content: () => b(Ue),
|
|
406
|
+
onClick: () => w(1)
|
|
359
407
|
}
|
|
360
408
|
])
|
|
361
409
|
};
|
|
362
410
|
}
|
|
363
411
|
});
|
|
364
412
|
export {
|
|
365
|
-
|
|
413
|
+
bt as default
|
|
366
414
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as u, createVNode as l, mergeProps as p, isVNode as f } from "vue";
|
|
2
2
|
import { getClassNameMixin as b } from "../../_utils/config.js";
|
|
3
|
-
import { Tooltip as
|
|
3
|
+
import { Tooltip as s } from "../tooltip/index.js";
|
|
4
4
|
function g(e) {
|
|
5
5
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !f(e);
|
|
6
6
|
}
|
|
7
|
-
const N = /* @__PURE__ */
|
|
7
|
+
const N = /* @__PURE__ */ u({
|
|
8
8
|
name: "ImagePreviewAction",
|
|
9
9
|
components: {
|
|
10
|
-
Tooltip:
|
|
10
|
+
Tooltip: s
|
|
11
11
|
},
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
props: {
|
|
@@ -28,7 +28,7 @@ const N = /* @__PURE__ */ d({
|
|
|
28
28
|
},
|
|
29
29
|
setup(e, {
|
|
30
30
|
slots: o,
|
|
31
|
-
attrs:
|
|
31
|
+
attrs: m
|
|
32
32
|
}) {
|
|
33
33
|
const t = b("image-preview--toolbar-action");
|
|
34
34
|
return () => {
|
|
@@ -38,21 +38,18 @@ const N = /* @__PURE__ */ d({
|
|
|
38
38
|
disabled: i
|
|
39
39
|
} = e, r = (c = o.default) == null ? void 0 : c.call(o);
|
|
40
40
|
if (!r || !r.length) return null;
|
|
41
|
-
const n = l("button",
|
|
41
|
+
const n = l("button", p(p(m, {
|
|
42
|
+
class: [t.block, i && t.modifier("disabled")],
|
|
43
|
+
onMousedown: (d) => d.preventDefault()
|
|
44
|
+
}), {
|
|
42
45
|
type: "button",
|
|
43
46
|
disabled: i,
|
|
44
47
|
"aria-disabled": i,
|
|
45
|
-
"aria-label": a
|
|
46
|
-
|
|
47
|
-
[t.modifier("disabled")]: i
|
|
48
|
-
}],
|
|
49
|
-
onMousedown: (m) => {
|
|
50
|
-
m.preventDefault();
|
|
51
|
-
}
|
|
52
|
-
}, s), [l("span", {
|
|
48
|
+
"aria-label": a
|
|
49
|
+
}), [l("span", {
|
|
53
50
|
class: t.element("content")
|
|
54
51
|
}, [r])]);
|
|
55
|
-
return a ? l(
|
|
52
|
+
return a ? l(s, {
|
|
56
53
|
class: t.element("tooltip"),
|
|
57
54
|
content: a
|
|
58
55
|
}, g(n) ? n : {
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as n, openBlock as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
1
|
+
import a from "./ImagePreviewGroup.vue2.js";
|
|
2
|
+
import { resolveComponent as n, openBlock as l, createElementBlock as s, Fragment as t, renderSlot as o, createVNode as i, mergeProps as p, createSlots as m, withCtx as u } from "vue";
|
|
3
|
+
import d from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
function b(e, c, g, f, v, $) {
|
|
5
5
|
const r = n("ImagePreview");
|
|
6
|
-
return
|
|
7
|
-
e
|
|
8
|
-
|
|
6
|
+
return l(), s(t, null, [
|
|
7
|
+
o(e.$slots, "default"),
|
|
8
|
+
i(r, p({ ...e.$attrs, groupArrowProps: e.groupArrowProps }, {
|
|
9
9
|
"in-group": "",
|
|
10
|
-
src:
|
|
11
|
-
visible:
|
|
12
|
-
"mask-closable":
|
|
13
|
-
closable:
|
|
14
|
-
"actions-layout":
|
|
15
|
-
"popup-container":
|
|
16
|
-
"render-to-body":
|
|
17
|
-
|
|
10
|
+
src: e.currentUrl,
|
|
11
|
+
visible: e.mergedVisible && !!e.currentUrl,
|
|
12
|
+
"mask-closable": e.maskClosable,
|
|
13
|
+
closable: e.closable,
|
|
14
|
+
"actions-layout": e.actionsLayout,
|
|
15
|
+
"popup-container": e.popupContainer,
|
|
16
|
+
"render-to-body": e.renderToBody,
|
|
17
|
+
"aria-label": e.$attrs["aria-label"] || e.t("imagePreview.previewLabel", { index: e.currentIndex + 1, total: e.imageCount }),
|
|
18
|
+
onClose: e.onClose
|
|
18
19
|
}), m({ _: 2 }, [
|
|
19
|
-
|
|
20
|
+
e.$slots.actions ? {
|
|
20
21
|
name: "actions",
|
|
21
22
|
fn: u(() => [
|
|
22
|
-
e
|
|
23
|
+
o(e.$slots, "actions", { url: e.currentUrl })
|
|
23
24
|
]),
|
|
24
25
|
key: "0"
|
|
25
26
|
} : void 0
|
|
26
|
-
]), 1040, ["src", "visible", "mask-closable", "closable", "actions-layout", "popup-container", "render-to-body", "onClose"])
|
|
27
|
+
]), 1040, ["src", "visible", "mask-closable", "closable", "actions-layout", "popup-container", "render-to-body", "aria-label", "onClose"])
|
|
27
28
|
], 64);
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
+
const P = /* @__PURE__ */ d(a, [["render", b]]);
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
P as default
|
|
32
33
|
};
|