@element-plus/nightly 0.0.20231106 → 0.0.20231107
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/dist/index.full.js +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/cascader/index.mjs +2 -2
- package/es/components/cascader/src/cascader.mjs +65 -626
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader2.mjs +626 -65
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +61 -225
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +225 -61
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +7 -7
- package/es/components/pagination/src/components/jumper.mjs +9 -60
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +60 -9
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/pagination/src/components/prev.mjs +18 -38
- package/es/components/pagination/src/components/prev.mjs.map +1 -1
- package/es/components/pagination/src/components/prev2.mjs +38 -18
- package/es/components/pagination/src/components/prev2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +2 -2
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/trigger.mjs +31 -119
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +119 -31
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/scrollbar/index.mjs +2 -2
- package/es/components/scrollbar/src/scrollbar.mjs +53 -178
- package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +178 -53
- package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +1 -1
- package/es/components/tooltip/src/trigger2.mjs +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +101 -116
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +116 -101
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/components/watermark/index.mjs +2 -2
- package/es/components/watermark/src/watermark.mjs +28 -207
- package/es/components/watermark/src/watermark.mjs.map +1 -1
- package/es/components/watermark/src/watermark2.mjs +207 -28
- package/es/components/watermark/src/watermark2.mjs.map +1 -1
- package/es/index.mjs +7 -7
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/cascader/index.js +2 -2
- package/lib/components/cascader/src/cascader.js +66 -626
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader2.js +626 -66
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +61 -224
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +224 -61
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +7 -7
- package/lib/components/pagination/src/components/jumper.js +9 -60
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/jumper2.js +60 -9
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/pagination/src/components/prev.js +19 -38
- package/lib/components/pagination/src/components/prev.js.map +1 -1
- package/lib/components/pagination/src/components/prev2.js +38 -19
- package/lib/components/pagination/src/components/prev2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +2 -2
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/trigger.js +32 -119
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +119 -32
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/scrollbar/index.js +2 -2
- package/lib/components/scrollbar/src/scrollbar.js +54 -178
- package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +178 -54
- package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +1 -1
- package/lib/components/tooltip/src/trigger2.js +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +104 -116
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +116 -104
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/components/watermark/index.js +2 -2
- package/lib/components/watermark/src/watermark.js +28 -207
- package/lib/components/watermark/src/watermark.js.map +1 -1
- package/lib/components/watermark/src/watermark2.js +207 -28
- package/lib/components/watermark/src/watermark2.js.map +1 -1
- package/lib/index.js +7 -7
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,67 +1,231 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, ref, computed, nextTick, watch, onMounted, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, renderSlot, createElementVNode, toDisplayString, Fragment, mergeProps, createCommentVNode, createBlock, withCtx } from 'vue';
|
|
2
|
+
import { isClient, useThrottleFn, useEventListener } from '@vueuse/core';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import { ElImageViewer } from '../../image-viewer/index.mjs';
|
|
1
5
|
import '../../../utils/index.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
6
|
+
import { imageProps, imageEmits } from './image.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
10
|
+
import { useAttrs as useAttrs$1 } from '../../../hooks/use-attrs/index.mjs';
|
|
11
|
+
import { isInContainer } from '../../../utils/dom/position.mjs';
|
|
12
|
+
import { isElement } from '../../../utils/types.mjs';
|
|
13
|
+
import { isString } from '@vue/shared';
|
|
14
|
+
import { getScrollContainer } from '../../../utils/dom/scroll.mjs';
|
|
5
15
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
16
|
+
const _hoisted_1 = ["src", "loading"];
|
|
17
|
+
const _hoisted_2 = { key: 0 };
|
|
18
|
+
const __default__ = defineComponent({
|
|
19
|
+
name: "ElImage",
|
|
20
|
+
inheritAttrs: false
|
|
21
|
+
});
|
|
22
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
23
|
+
...__default__,
|
|
24
|
+
props: imageProps,
|
|
25
|
+
emits: imageEmits,
|
|
26
|
+
setup(__props, { emit }) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
let prevOverflow = "";
|
|
29
|
+
const { t } = useLocale();
|
|
30
|
+
const ns = useNamespace("image");
|
|
31
|
+
const rawAttrs = useAttrs();
|
|
32
|
+
const attrs = useAttrs$1();
|
|
33
|
+
const imageSrc = ref();
|
|
34
|
+
const hasLoadError = ref(false);
|
|
35
|
+
const isLoading = ref(true);
|
|
36
|
+
const showViewer = ref(false);
|
|
37
|
+
const container = ref();
|
|
38
|
+
const _scrollContainer = ref();
|
|
39
|
+
const supportLoading = isClient && "loading" in HTMLImageElement.prototype;
|
|
40
|
+
let stopScrollListener;
|
|
41
|
+
let stopWheelListener;
|
|
42
|
+
const imageKls = computed(() => [
|
|
43
|
+
ns.e("inner"),
|
|
44
|
+
preview.value && ns.e("preview"),
|
|
45
|
+
isLoading.value && ns.is("loading")
|
|
46
|
+
]);
|
|
47
|
+
const containerStyle = computed(() => rawAttrs.style);
|
|
48
|
+
const imageStyle = computed(() => {
|
|
49
|
+
const { fit } = props;
|
|
50
|
+
if (isClient && fit) {
|
|
51
|
+
return { objectFit: fit };
|
|
52
|
+
}
|
|
53
|
+
return {};
|
|
54
|
+
});
|
|
55
|
+
const preview = computed(() => {
|
|
56
|
+
const { previewSrcList } = props;
|
|
57
|
+
return Array.isArray(previewSrcList) && previewSrcList.length > 0;
|
|
58
|
+
});
|
|
59
|
+
const imageIndex = computed(() => {
|
|
60
|
+
const { previewSrcList, initialIndex } = props;
|
|
61
|
+
let previewIndex = initialIndex;
|
|
62
|
+
if (initialIndex > previewSrcList.length - 1) {
|
|
63
|
+
previewIndex = 0;
|
|
64
|
+
}
|
|
65
|
+
return previewIndex;
|
|
66
|
+
});
|
|
67
|
+
const isManual = computed(() => {
|
|
68
|
+
if (props.loading === "eager")
|
|
69
|
+
return false;
|
|
70
|
+
return !supportLoading && props.loading === "lazy" || props.lazy;
|
|
71
|
+
});
|
|
72
|
+
const loadImage = () => {
|
|
73
|
+
if (!isClient)
|
|
74
|
+
return;
|
|
75
|
+
isLoading.value = true;
|
|
76
|
+
hasLoadError.value = false;
|
|
77
|
+
imageSrc.value = props.src;
|
|
78
|
+
};
|
|
79
|
+
function handleLoad(event) {
|
|
80
|
+
isLoading.value = false;
|
|
81
|
+
hasLoadError.value = false;
|
|
82
|
+
emit("load", event);
|
|
83
|
+
}
|
|
84
|
+
function handleError(event) {
|
|
85
|
+
isLoading.value = false;
|
|
86
|
+
hasLoadError.value = true;
|
|
87
|
+
emit("error", event);
|
|
88
|
+
}
|
|
89
|
+
function handleLazyLoad() {
|
|
90
|
+
if (isInContainer(container.value, _scrollContainer.value)) {
|
|
91
|
+
loadImage();
|
|
92
|
+
removeLazyLoadListener();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const lazyLoadHandler = useThrottleFn(handleLazyLoad, 200, true);
|
|
96
|
+
async function addLazyLoadListener() {
|
|
97
|
+
var _a;
|
|
98
|
+
if (!isClient)
|
|
99
|
+
return;
|
|
100
|
+
await nextTick();
|
|
101
|
+
const { scrollContainer } = props;
|
|
102
|
+
if (isElement(scrollContainer)) {
|
|
103
|
+
_scrollContainer.value = scrollContainer;
|
|
104
|
+
} else if (isString(scrollContainer) && scrollContainer !== "") {
|
|
105
|
+
_scrollContainer.value = (_a = document.querySelector(scrollContainer)) != null ? _a : void 0;
|
|
106
|
+
} else if (container.value) {
|
|
107
|
+
_scrollContainer.value = getScrollContainer(container.value);
|
|
108
|
+
}
|
|
109
|
+
if (_scrollContainer.value) {
|
|
110
|
+
stopScrollListener = useEventListener(_scrollContainer, "scroll", lazyLoadHandler);
|
|
111
|
+
setTimeout(() => handleLazyLoad(), 100);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function removeLazyLoadListener() {
|
|
115
|
+
if (!isClient || !_scrollContainer.value || !lazyLoadHandler)
|
|
116
|
+
return;
|
|
117
|
+
stopScrollListener == null ? void 0 : stopScrollListener();
|
|
118
|
+
_scrollContainer.value = void 0;
|
|
119
|
+
}
|
|
120
|
+
function wheelHandler(e) {
|
|
121
|
+
if (!e.ctrlKey)
|
|
122
|
+
return;
|
|
123
|
+
if (e.deltaY < 0) {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
return false;
|
|
126
|
+
} else if (e.deltaY > 0) {
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function clickHandler() {
|
|
132
|
+
if (!preview.value)
|
|
133
|
+
return;
|
|
134
|
+
stopWheelListener = useEventListener("wheel", wheelHandler, {
|
|
135
|
+
passive: false
|
|
136
|
+
});
|
|
137
|
+
prevOverflow = document.body.style.overflow;
|
|
138
|
+
document.body.style.overflow = "hidden";
|
|
139
|
+
showViewer.value = true;
|
|
140
|
+
emit("show");
|
|
141
|
+
}
|
|
142
|
+
function closeViewer() {
|
|
143
|
+
stopWheelListener == null ? void 0 : stopWheelListener();
|
|
144
|
+
document.body.style.overflow = prevOverflow;
|
|
145
|
+
showViewer.value = false;
|
|
146
|
+
emit("close");
|
|
147
|
+
}
|
|
148
|
+
function switchViewer(val) {
|
|
149
|
+
emit("switch", val);
|
|
150
|
+
}
|
|
151
|
+
watch(() => props.src, () => {
|
|
152
|
+
if (isManual.value) {
|
|
153
|
+
isLoading.value = true;
|
|
154
|
+
hasLoadError.value = false;
|
|
155
|
+
removeLazyLoadListener();
|
|
156
|
+
addLazyLoadListener();
|
|
157
|
+
} else {
|
|
158
|
+
loadImage();
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
onMounted(() => {
|
|
162
|
+
if (isManual.value) {
|
|
163
|
+
addLazyLoadListener();
|
|
164
|
+
} else {
|
|
165
|
+
loadImage();
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
return (_ctx, _cache) => {
|
|
169
|
+
return openBlock(), createElementBlock("div", {
|
|
170
|
+
ref_key: "container",
|
|
171
|
+
ref: container,
|
|
172
|
+
class: normalizeClass([unref(ns).b(), _ctx.$attrs.class]),
|
|
173
|
+
style: normalizeStyle(unref(containerStyle))
|
|
174
|
+
}, [
|
|
175
|
+
hasLoadError.value ? renderSlot(_ctx.$slots, "error", { key: 0 }, () => [
|
|
176
|
+
createElementVNode("div", {
|
|
177
|
+
class: normalizeClass(unref(ns).e("error"))
|
|
178
|
+
}, toDisplayString(unref(t)("el.image.error")), 3)
|
|
179
|
+
]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
180
|
+
imageSrc.value !== void 0 ? (openBlock(), createElementBlock("img", mergeProps({ key: 0 }, unref(attrs), {
|
|
181
|
+
src: imageSrc.value,
|
|
182
|
+
loading: _ctx.loading,
|
|
183
|
+
style: unref(imageStyle),
|
|
184
|
+
class: unref(imageKls),
|
|
185
|
+
onClick: clickHandler,
|
|
186
|
+
onLoad: handleLoad,
|
|
187
|
+
onError: handleError
|
|
188
|
+
}), null, 16, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
189
|
+
isLoading.value ? (openBlock(), createElementBlock("div", {
|
|
190
|
+
key: 1,
|
|
191
|
+
class: normalizeClass(unref(ns).e("wrapper"))
|
|
192
|
+
}, [
|
|
193
|
+
renderSlot(_ctx.$slots, "placeholder", {}, () => [
|
|
194
|
+
createElementVNode("div", {
|
|
195
|
+
class: normalizeClass(unref(ns).e("placeholder"))
|
|
196
|
+
}, null, 2)
|
|
197
|
+
])
|
|
198
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
199
|
+
], 64)),
|
|
200
|
+
unref(preview) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
201
|
+
showViewer.value ? (openBlock(), createBlock(unref(ElImageViewer), {
|
|
202
|
+
key: 0,
|
|
203
|
+
"z-index": _ctx.zIndex,
|
|
204
|
+
"initial-index": unref(imageIndex),
|
|
205
|
+
infinite: _ctx.infinite,
|
|
206
|
+
"zoom-rate": _ctx.zoomRate,
|
|
207
|
+
"min-scale": _ctx.minScale,
|
|
208
|
+
"max-scale": _ctx.maxScale,
|
|
209
|
+
"url-list": _ctx.previewSrcList,
|
|
210
|
+
"hide-on-click-modal": _ctx.hideOnClickModal,
|
|
211
|
+
teleported: _ctx.previewTeleported,
|
|
212
|
+
"close-on-press-escape": _ctx.closeOnPressEscape,
|
|
213
|
+
onClose: closeViewer,
|
|
214
|
+
onSwitch: switchViewer
|
|
215
|
+
}, {
|
|
216
|
+
default: withCtx(() => [
|
|
217
|
+
_ctx.$slots.viewer ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
218
|
+
renderSlot(_ctx.$slots, "viewer")
|
|
219
|
+
])) : createCommentVNode("v-if", true)
|
|
220
|
+
]),
|
|
221
|
+
_: 3
|
|
222
|
+
}, 8, ["z-index", "initial-index", "infinite", "zoom-rate", "min-scale", "max-scale", "url-list", "hide-on-click-modal", "teleported", "close-on-press-escape"])) : createCommentVNode("v-if", true)
|
|
223
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
224
|
+
], 6);
|
|
225
|
+
};
|
|
56
226
|
}
|
|
57
227
|
});
|
|
58
|
-
|
|
59
|
-
load: (evt) => evt instanceof Event,
|
|
60
|
-
error: (evt) => evt instanceof Event,
|
|
61
|
-
switch: (val) => isNumber(val),
|
|
62
|
-
close: () => true,
|
|
63
|
-
show: () => true
|
|
64
|
-
};
|
|
228
|
+
var Image = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/image/src/image.vue"]]);
|
|
65
229
|
|
|
66
|
-
export {
|
|
230
|
+
export { Image as default };
|
|
67
231
|
//# sourceMappingURL=image2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image2.mjs","sources":["../../../../../../packages/components/image/src/image.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isNumber,\n mutable,\n} from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const imageProps = buildProps({\n /**\n * @description when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode.\n */\n hideOnClickModal: Boolean,\n /**\n * @description image source, same as native.\n */\n src: {\n type: String,\n default: '',\n },\n /**\n * @description indicate how the image should be resized to fit its container, same as [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit).\n */\n fit: {\n type: String,\n values: ['', 'contain', 'cover', 'fill', 'none', 'scale-down'],\n default: '',\n },\n /**\n * @description Indicates how the browser should load the image, same as [native](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading)\n */\n loading: {\n type: String,\n values: ['eager', 'lazy'],\n },\n /**\n * @description whether to use lazy load.\n */\n lazy: Boolean,\n /**\n * @description the container to add scroll listener when using lazy load.\n */\n scrollContainer: {\n type: definePropType<string | HTMLElement | undefined>([String, Object]),\n },\n /**\n * @description allow big image preview.\n */\n previewSrcList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`.\n */\n previewTeleported: Boolean,\n /**\n * @description set image preview z-index.\n */\n zIndex: {\n type: Number,\n },\n /**\n * @description initial preview image index, less than the length of `url-list`.\n */\n initialIndex: {\n type: Number,\n default: 0,\n },\n /**\n * @description whether the viewer preview is infinite.\n */\n infinite: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the image-viewer can be closed by pressing ESC.\n */\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n /**\n * @description the zoom rate of the image viewer zoom event\n */\n zoomRate: {\n type: Number,\n default: 1.2,\n },\n /**\n * @description the min scale of the image viewer zoom event.\n */\n minScale: {\n type: Number,\n default: 0.2,\n },\n /**\n * @description the max scale of the image viewer zoom event.\n */\n maxScale: {\n type: Number,\n default: 7,\n },\n} as const)\nexport type ImageProps = ExtractPropTypes<typeof imageProps>\n\nexport const imageEmits = {\n load: (evt: Event) => evt instanceof Event,\n error: (evt: Event) => evt instanceof Event,\n switch: (val: number) => isNumber(val),\n close: () => true,\n show: () => true,\n}\nexport type ImageEmits = typeof imageEmits\n"],"names":[],"mappings":";;;;;AAMY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,gBAAgB,EAAE,OAAO;AAC3B,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IA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CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,KAAK;AACrC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,KAAK;AACtC,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC;AAChC,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB,EAAE,IAAI,EAAE,MAAM,IAAI;AAClB;;;;"}
|
|
1
|
+
{"version":3,"file":"image2.mjs","sources":["../../../../../../packages/components/image/src/image.vue"],"sourcesContent":["<template>\n <div ref=\"container\" :class=\"[ns.b(), $attrs.class]\" :style=\"containerStyle\">\n <slot v-if=\"hasLoadError\" name=\"error\">\n <div :class=\"ns.e('error')\">{{ t('el.image.error') }}</div>\n </slot>\n <template v-else>\n <img\n v-if=\"imageSrc !== undefined\"\n v-bind=\"attrs\"\n :src=\"imageSrc\"\n :loading=\"loading\"\n :style=\"imageStyle\"\n :class=\"imageKls\"\n @click=\"clickHandler\"\n @load=\"handleLoad\"\n @error=\"handleError\"\n />\n <div v-if=\"isLoading\" :class=\"ns.e('wrapper')\">\n <slot name=\"placeholder\">\n <div :class=\"ns.e('placeholder')\" />\n </slot>\n </div>\n </template>\n <template v-if=\"preview\">\n <image-viewer\n v-if=\"showViewer\"\n :z-index=\"zIndex\"\n :initial-index=\"imageIndex\"\n :infinite=\"infinite\"\n :zoom-rate=\"zoomRate\"\n :min-scale=\"minScale\"\n :max-scale=\"maxScale\"\n :url-list=\"previewSrcList\"\n :hide-on-click-modal=\"hideOnClickModal\"\n :teleported=\"previewTeleported\"\n :close-on-press-escape=\"closeOnPressEscape\"\n @close=\"closeViewer\"\n @switch=\"switchViewer\"\n >\n <div v-if=\"$slots.viewer\">\n <slot name=\"viewer\" />\n </div>\n </image-viewer>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n ref,\n useAttrs as useRawAttrs,\n watch,\n} from 'vue'\nimport { useEventListener, useThrottleFn } from '@vueuse/core'\nimport { useAttrs, useLocale, useNamespace } from '@element-plus/hooks'\nimport ImageViewer from '@element-plus/components/image-viewer'\nimport {\n getScrollContainer,\n isClient,\n isElement,\n isInContainer,\n isString,\n} from '@element-plus/utils'\nimport { imageEmits, imageProps } from './image'\n\nimport type { CSSProperties, StyleValue } from 'vue'\n\ndefineOptions({\n name: 'ElImage',\n inheritAttrs: false,\n})\n\nconst props = defineProps(imageProps)\nconst emit = defineEmits(imageEmits)\n\nlet prevOverflow = ''\n\nconst { t } = useLocale()\nconst ns = useNamespace('image')\nconst rawAttrs = useRawAttrs()\nconst attrs = useAttrs()\n\nconst imageSrc = ref<string | undefined>()\nconst hasLoadError = ref(false)\nconst isLoading = ref(true)\nconst showViewer = ref(false)\nconst container = ref<HTMLElement>()\nconst _scrollContainer = ref<HTMLElement | Window>()\n\nconst supportLoading = isClient && 'loading' in HTMLImageElement.prototype\nlet stopScrollListener: (() => void) | undefined\nlet stopWheelListener: (() => void) | undefined\n\nconst imageKls = computed(() => [\n ns.e('inner'),\n preview.value && ns.e('preview'),\n isLoading.value && ns.is('loading'),\n])\n\nconst containerStyle = computed(() => rawAttrs.style as StyleValue)\n\nconst imageStyle = computed<CSSProperties>(() => {\n const { fit } = props\n if (isClient && fit) {\n return { objectFit: fit }\n }\n return {}\n})\n\nconst preview = computed(() => {\n const { previewSrcList } = props\n return Array.isArray(previewSrcList) && previewSrcList.length > 0\n})\n\nconst imageIndex = computed(() => {\n const { previewSrcList, initialIndex } = props\n let previewIndex = initialIndex\n if (initialIndex > previewSrcList.length - 1) {\n previewIndex = 0\n }\n return previewIndex\n})\n\nconst isManual = computed(() => {\n if (props.loading === 'eager') return false\n return (!supportLoading && props.loading === 'lazy') || props.lazy\n})\n\nconst loadImage = () => {\n if (!isClient) return\n\n // reset status\n isLoading.value = true\n hasLoadError.value = false\n imageSrc.value = props.src\n}\n\nfunction handleLoad(event: Event) {\n isLoading.value = false\n hasLoadError.value = false\n emit('load', event)\n}\n\nfunction handleError(event: Event) {\n isLoading.value = false\n hasLoadError.value = true\n emit('error', event)\n}\n\nfunction handleLazyLoad() {\n if (isInContainer(container.value, _scrollContainer.value)) {\n loadImage()\n removeLazyLoadListener()\n }\n}\n\nconst lazyLoadHandler = useThrottleFn(handleLazyLoad, 200, true)\n\nasync function addLazyLoadListener() {\n if (!isClient) return\n\n await nextTick()\n\n const { scrollContainer } = props\n if (isElement(scrollContainer)) {\n _scrollContainer.value = scrollContainer\n } else if (isString(scrollContainer) && scrollContainer !== '') {\n _scrollContainer.value =\n document.querySelector<HTMLElement>(scrollContainer) ?? undefined\n } else if (container.value) {\n _scrollContainer.value = getScrollContainer(container.value)\n }\n\n if (_scrollContainer.value) {\n stopScrollListener = useEventListener(\n _scrollContainer,\n 'scroll',\n lazyLoadHandler\n )\n setTimeout(() => handleLazyLoad(), 100)\n }\n}\n\nfunction removeLazyLoadListener() {\n if (!isClient || !_scrollContainer.value || !lazyLoadHandler) return\n\n stopScrollListener?.()\n _scrollContainer.value = undefined\n}\n\nfunction wheelHandler(e: WheelEvent) {\n if (!e.ctrlKey) return\n\n if (e.deltaY < 0) {\n e.preventDefault()\n return false\n } else if (e.deltaY > 0) {\n e.preventDefault()\n return false\n }\n}\n\nfunction clickHandler() {\n // don't show viewer when preview is false\n if (!preview.value) return\n\n stopWheelListener = useEventListener('wheel', wheelHandler, {\n passive: false,\n })\n\n // prevent body scroll\n prevOverflow = document.body.style.overflow\n document.body.style.overflow = 'hidden'\n showViewer.value = true\n emit('show')\n}\n\nfunction closeViewer() {\n stopWheelListener?.()\n document.body.style.overflow = prevOverflow\n showViewer.value = false\n emit('close')\n}\n\nfunction switchViewer(val: number) {\n emit('switch', val)\n}\n\nwatch(\n () => props.src,\n () => {\n if (isManual.value) {\n // reset status\n isLoading.value = true\n hasLoadError.value = false\n removeLazyLoadListener()\n addLazyLoadListener()\n } else {\n loadImage()\n }\n }\n)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cardProps } from './card/src/card.mjs';
|
|
|
92
92
|
export { carouselEmits, carouselProps } from './carousel/src/carousel.mjs';
|
|
93
93
|
export { carouselItemProps } from './carousel/src/carousel-item.mjs';
|
|
94
94
|
export { carouselContextKey } from './carousel/src/constants.mjs';
|
|
95
|
-
export { cascaderEmits, cascaderProps } from './cascader/src/
|
|
95
|
+
export { cascaderEmits, cascaderProps } from './cascader/src/cascader.mjs';
|
|
96
96
|
export { CASCADER_PANEL_INJECTION_KEY } from './cascader-panel/src/types.mjs';
|
|
97
97
|
export { CommonProps, DefaultProps, useCascaderConfig } from './cascader-panel/src/config.mjs';
|
|
98
98
|
export { checkTagEmits, checkTagProps } from './check-tag/src/check-tag.mjs';
|
|
@@ -126,7 +126,7 @@ export { formContextKey, formItemContextKey } from './form/src/constants.mjs';
|
|
|
126
126
|
export { useDisabled, useFormDisabled, useFormSize, useSize } from './form/src/hooks/use-form-common-props.mjs';
|
|
127
127
|
export { useFormItem, useFormItemInputId } from './form/src/hooks/use-form-item.mjs';
|
|
128
128
|
export { iconProps } from './icon/src/icon.mjs';
|
|
129
|
-
export { imageEmits, imageProps } from './image/src/
|
|
129
|
+
export { imageEmits, imageProps } from './image/src/image.mjs';
|
|
130
130
|
export { imageViewerEmits, imageViewerProps } from './image-viewer/src/image-viewer.mjs';
|
|
131
131
|
export { inputEmits, inputProps } from './input/src/input.mjs';
|
|
132
132
|
export { inputNumberEmits, inputNumberProps } from './input-number/src/input-number.mjs';
|
|
@@ -141,12 +141,12 @@ export { paginationEmits, paginationProps } from './pagination/src/pagination.mj
|
|
|
141
141
|
export { elPaginationKey } from './pagination/src/constants.mjs';
|
|
142
142
|
export { popconfirmEmits, popconfirmProps } from './popconfirm/src/popconfirm.mjs';
|
|
143
143
|
export { Effect, popperProps, roleTypes, usePopperProps } from './popper/src/popper.mjs';
|
|
144
|
-
export { popperTriggerProps, usePopperTriggerProps } from './popper/src/
|
|
144
|
+
export { popperTriggerProps, usePopperTriggerProps } from './popper/src/trigger.mjs';
|
|
145
145
|
export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './popper/src/content.mjs';
|
|
146
146
|
export { popperArrowProps, usePopperArrowProps } from './popper/src/arrow.mjs';
|
|
147
147
|
export { POPPER_CONTENT_INJECTION_KEY, POPPER_INJECTION_KEY } from './popper/src/constants.mjs';
|
|
148
148
|
export { default as ElPopperArrow } from './popper/src/arrow2.mjs';
|
|
149
|
-
export { default as ElPopperTrigger } from './popper/src/
|
|
149
|
+
export { default as ElPopperTrigger } from './popper/src/trigger2.mjs';
|
|
150
150
|
export { default as ElPopperContent } from './popper/src/content2.mjs';
|
|
151
151
|
export { progressProps } from './progress/src/progress.mjs';
|
|
152
152
|
export { radioEmits, radioProps, radioPropsBase } from './radio/src/radio.mjs';
|
|
@@ -158,7 +158,7 @@ export { IconComponentMap, IconMap, resultProps } from './result/src/result.mjs'
|
|
|
158
158
|
export { RowAlign, RowJustify, rowProps } from './row/src/row.mjs';
|
|
159
159
|
export { rowContextKey } from './row/src/constants.mjs';
|
|
160
160
|
export { BAR_MAP, GAP, renderThumbStyle } from './scrollbar/src/util.mjs';
|
|
161
|
-
export { scrollbarEmits, scrollbarProps } from './scrollbar/src/
|
|
161
|
+
export { scrollbarEmits, scrollbarProps } from './scrollbar/src/scrollbar.mjs';
|
|
162
162
|
export { thumbProps } from './scrollbar/src/thumb.mjs';
|
|
163
163
|
export { scrollbarContextKey } from './scrollbar/src/constants.mjs';
|
|
164
164
|
export { selectGroupKey, selectKey } from './select/src/token.mjs';
|
|
@@ -197,7 +197,7 @@ export { useTooltipTriggerProps } from './tooltip/src/trigger.mjs';
|
|
|
197
197
|
export { useTooltipContentProps } from './tooltip/src/content.mjs';
|
|
198
198
|
export { TOOLTIP_INJECTION_KEY } from './tooltip/src/constants.mjs';
|
|
199
199
|
export { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT, transferCheckedChangeFn, transferEmits, transferProps } from './transfer/src/transfer.mjs';
|
|
200
|
-
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './upload/src/
|
|
200
|
+
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './upload/src/upload.mjs';
|
|
201
201
|
export { uploadContentProps } from './upload/src/upload-content.mjs';
|
|
202
202
|
export { uploadListEmits, uploadListProps } from './upload/src/upload-list.mjs';
|
|
203
203
|
export { uploadDraggerEmits, uploadDraggerProps } from './upload/src/upload-dragger.mjs';
|
|
@@ -207,7 +207,7 @@ export { default as DynamicSizeList } from './virtual-list/src/components/dynami
|
|
|
207
207
|
export { default as FixedSizeGrid } from './virtual-list/src/components/fixed-size-grid.mjs';
|
|
208
208
|
export { default as DynamicSizeGrid } from './virtual-list/src/components/dynamic-size-grid.mjs';
|
|
209
209
|
export { virtualizedGridProps, virtualizedListProps, virtualizedProps, virtualizedScrollbarProps } from './virtual-list/src/props.mjs';
|
|
210
|
-
export { watermarkProps } from './watermark/src/
|
|
210
|
+
export { watermarkProps } from './watermark/src/watermark.mjs';
|
|
211
211
|
export { vLoading as ElLoadingDirective, vLoading } from './loading/src/directive.mjs';
|
|
212
212
|
export { Loading as ElLoadingService } from './loading/src/service.mjs';
|
|
213
213
|
export { messageDefaults, messageEmits, messageProps, messageTypes } from './message/src/message.mjs';
|
|
@@ -1,65 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { paginationJumperProps } from './jumper2.mjs';
|
|
6
|
-
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
-
import { useLocale } from '../../../../hooks/use-locale/index.mjs';
|
|
8
|
-
import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import '../../../../utils/index.mjs';
|
|
2
|
+
import '../../../../constants/index.mjs';
|
|
3
|
+
import { buildProps } from '../../../../utils/vue/props/runtime.mjs';
|
|
4
|
+
import { componentSizes } from '../../../../constants/size.mjs';
|
|
9
5
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
-
...__default__,
|
|
16
|
-
props: paginationJumperProps,
|
|
17
|
-
setup(__props) {
|
|
18
|
-
const { t } = useLocale();
|
|
19
|
-
const ns = useNamespace("pagination");
|
|
20
|
-
const { pageCount, disabled, currentPage, changeEvent } = usePagination();
|
|
21
|
-
const userInput = ref();
|
|
22
|
-
const innerValue = computed(() => {
|
|
23
|
-
var _a;
|
|
24
|
-
return (_a = userInput.value) != null ? _a : currentPage == null ? void 0 : currentPage.value;
|
|
25
|
-
});
|
|
26
|
-
function handleInput(val) {
|
|
27
|
-
userInput.value = val ? +val : "";
|
|
28
|
-
}
|
|
29
|
-
function handleChange(val) {
|
|
30
|
-
val = Math.trunc(+val);
|
|
31
|
-
changeEvent == null ? void 0 : changeEvent(val);
|
|
32
|
-
userInput.value = void 0;
|
|
33
|
-
}
|
|
34
|
-
return (_ctx, _cache) => {
|
|
35
|
-
return openBlock(), createElementBlock("span", {
|
|
36
|
-
class: normalizeClass(unref(ns).e("jump")),
|
|
37
|
-
disabled: unref(disabled)
|
|
38
|
-
}, [
|
|
39
|
-
createElementVNode("span", {
|
|
40
|
-
class: normalizeClass([unref(ns).e("goto")])
|
|
41
|
-
}, toDisplayString(unref(t)("el.pagination.goto")), 3),
|
|
42
|
-
createVNode(unref(ElInput), {
|
|
43
|
-
size: _ctx.size,
|
|
44
|
-
class: normalizeClass([unref(ns).e("editor"), unref(ns).is("in-pagination")]),
|
|
45
|
-
min: 1,
|
|
46
|
-
max: unref(pageCount),
|
|
47
|
-
disabled: unref(disabled),
|
|
48
|
-
"model-value": unref(innerValue),
|
|
49
|
-
"validate-event": false,
|
|
50
|
-
label: unref(t)("el.pagination.page"),
|
|
51
|
-
type: "number",
|
|
52
|
-
"onUpdate:modelValue": handleInput,
|
|
53
|
-
onChange: handleChange
|
|
54
|
-
}, null, 8, ["size", "class", "max", "disabled", "model-value", "label"]),
|
|
55
|
-
createElementVNode("span", {
|
|
56
|
-
class: normalizeClass([unref(ns).e("classifier")])
|
|
57
|
-
}, toDisplayString(unref(t)("el.pagination.pageClassifier")), 3)
|
|
58
|
-
], 10, _hoisted_1);
|
|
59
|
-
};
|
|
6
|
+
const paginationJumperProps = buildProps({
|
|
7
|
+
size: {
|
|
8
|
+
type: String,
|
|
9
|
+
values: componentSizes
|
|
60
10
|
}
|
|
61
11
|
});
|
|
62
|
-
var Jumper = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/jumper.vue"]]);
|
|
63
12
|
|
|
64
|
-
export {
|
|
13
|
+
export { paginationJumperProps };
|
|
65
14
|
//# sourceMappingURL=jumper.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jumper.mjs","sources":["../../../../../../../packages/components/pagination/src/components/jumper.
|
|
1
|
+
{"version":3,"file":"jumper.mjs","sources":["../../../../../../../packages/components/pagination/src/components/jumper.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type Jumper from './jumper.vue'\n\nexport const paginationJumperProps = buildProps({\n size: {\n type: String,\n values: componentSizes,\n },\n} as const)\n\nexport type PaginationJumperProps = ExtractPropTypes<\n typeof paginationJumperProps\n>\n\nexport type PaginationJumperInstance = InstanceType<typeof Jumper>\n"],"names":[],"mappings":";;;;;AAEY,MAAC,qBAAqB,GAAG,UAAU,CAAC;AAChD,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,cAAc;AAC1B,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,14 +1,65 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, toDisplayString, createVNode } from 'vue';
|
|
2
|
+
import '../../../../hooks/index.mjs';
|
|
3
|
+
import { ElInput } from '../../../input/index.mjs';
|
|
4
|
+
import { usePagination } from '../usePagination.mjs';
|
|
5
|
+
import { paginationJumperProps } from './jumper.mjs';
|
|
6
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { useLocale } from '../../../../hooks/use-locale/index.mjs';
|
|
8
|
+
import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
|
|
5
9
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
const _hoisted_1 = ["disabled"];
|
|
11
|
+
const __default__ = defineComponent({
|
|
12
|
+
name: "ElPaginationJumper"
|
|
13
|
+
});
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
...__default__,
|
|
16
|
+
props: paginationJumperProps,
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const { t } = useLocale();
|
|
19
|
+
const ns = useNamespace("pagination");
|
|
20
|
+
const { pageCount, disabled, currentPage, changeEvent } = usePagination();
|
|
21
|
+
const userInput = ref();
|
|
22
|
+
const innerValue = computed(() => {
|
|
23
|
+
var _a;
|
|
24
|
+
return (_a = userInput.value) != null ? _a : currentPage == null ? void 0 : currentPage.value;
|
|
25
|
+
});
|
|
26
|
+
function handleInput(val) {
|
|
27
|
+
userInput.value = val ? +val : "";
|
|
28
|
+
}
|
|
29
|
+
function handleChange(val) {
|
|
30
|
+
val = Math.trunc(+val);
|
|
31
|
+
changeEvent == null ? void 0 : changeEvent(val);
|
|
32
|
+
userInput.value = void 0;
|
|
33
|
+
}
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return openBlock(), createElementBlock("span", {
|
|
36
|
+
class: normalizeClass(unref(ns).e("jump")),
|
|
37
|
+
disabled: unref(disabled)
|
|
38
|
+
}, [
|
|
39
|
+
createElementVNode("span", {
|
|
40
|
+
class: normalizeClass([unref(ns).e("goto")])
|
|
41
|
+
}, toDisplayString(unref(t)("el.pagination.goto")), 3),
|
|
42
|
+
createVNode(unref(ElInput), {
|
|
43
|
+
size: _ctx.size,
|
|
44
|
+
class: normalizeClass([unref(ns).e("editor"), unref(ns).is("in-pagination")]),
|
|
45
|
+
min: 1,
|
|
46
|
+
max: unref(pageCount),
|
|
47
|
+
disabled: unref(disabled),
|
|
48
|
+
"model-value": unref(innerValue),
|
|
49
|
+
"validate-event": false,
|
|
50
|
+
label: unref(t)("el.pagination.page"),
|
|
51
|
+
type: "number",
|
|
52
|
+
"onUpdate:modelValue": handleInput,
|
|
53
|
+
onChange: handleChange
|
|
54
|
+
}, null, 8, ["size", "class", "max", "disabled", "model-value", "label"]),
|
|
55
|
+
createElementVNode("span", {
|
|
56
|
+
class: normalizeClass([unref(ns).e("classifier")])
|
|
57
|
+
}, toDisplayString(unref(t)("el.pagination.pageClassifier")), 3)
|
|
58
|
+
], 10, _hoisted_1);
|
|
59
|
+
};
|
|
10
60
|
}
|
|
11
61
|
});
|
|
62
|
+
var Jumper = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/jumper.vue"]]);
|
|
12
63
|
|
|
13
|
-
export {
|
|
64
|
+
export { Jumper as default };
|
|
14
65
|
//# sourceMappingURL=jumper2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jumper2.mjs","sources":["../../../../../../../packages/components/pagination/src/components/jumper.
|
|
1
|
+
{"version":3,"file":"jumper2.mjs","sources":["../../../../../../../packages/components/pagination/src/components/jumper.vue"],"sourcesContent":["<template>\n <span :class=\"ns.e('jump')\" :disabled=\"disabled\">\n <span :class=\"[ns.e('goto')]\">{{ t('el.pagination.goto') }}</span>\n <el-input\n :size=\"size\"\n :class=\"[ns.e('editor'), ns.is('in-pagination')]\"\n :min=\"1\"\n :max=\"pageCount\"\n :disabled=\"disabled\"\n :model-value=\"innerValue\"\n :validate-event=\"false\"\n :label=\"t('el.pagination.page')\"\n type=\"number\"\n @update:model-value=\"handleInput\"\n @change=\"handleChange\"\n />\n <span :class=\"[ns.e('classifier')]\">{{\n t('el.pagination.pageClassifier')\n }}</span>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { usePagination } from '../usePagination'\nimport { paginationJumperProps } from './jumper'\n\ndefineOptions({\n name: 'ElPaginationJumper',\n})\n\ndefineProps(paginationJumperProps)\nconst { t } = useLocale()\nconst ns = useNamespace('pagination')\nconst { pageCount, disabled, currentPage, changeEvent } = usePagination()\nconst userInput = ref<number | string>()\nconst innerValue = computed(() => userInput.value ?? currentPage?.value)\n\nfunction handleInput(val: number | string) {\n userInput.value = val ? +val : ''\n}\n\nfunction handleChange(val: number | string) {\n val = Math.trunc(+val)\n changeEvent?.(val)\n userInput.value = undefined\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;mCA6Bc,CAAA;AAAA,EACZ,IAAM,EAAA,oBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAGA,IAAM,MAAA,EAAE,MAAM,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,YAAY,CAAA,CAAA;AACpC,IAAA,MAAM,EAAE,SAAA,EAAW,QAAU,EAAA,WAAA,EAAa,gBAAgB,aAAc,EAAA,CAAA;AACxE,IAAA,MAAM,YAAY,GAAqB,EAAA,CAAA;AACvC,IAAA,MAAM,aAAa,QAAS,CAAA,MAAM;AAElC,MAAA,IAAA,EAAA,CAAA;AACE,MAAU,OAAA,CAAA,EAAA,GAAA,SAAc,CAAA,KAAO,KAAA,IAAA,GAAA,EAAA,GAAA,WAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,WAAA,CAAA,KAAA,CAAA;AAAA,KACjC,CAAA,CAAA;AAEA,IAAA,SAAA,WAAA,CAAA,GAA4C,EAAA;AAC1C,MAAM,SAAA,CAAA,KAAW,GAAC,GAAG,GAAA,CAAA,GAAA,GAAA,EAAA,CAAA;AACrB,KAAA;AACA,IAAA,SAAA,YAAkB,CAAA,GAAA,EAAA;AAAA,MACpB,GAAA,GAAA,IAAA,CAAA,KAAA,CAAA,CAAA,GAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,43 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../../
|
|
3
|
-
import {
|
|
4
|
-
import { paginationPrevProps, paginationPrevEmits } from './prev2.mjs';
|
|
5
|
-
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useLocale } from '../../../../hooks/use-locale/index.mjs';
|
|
1
|
+
import '../../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { iconPropType } from '../../../../utils/vue/icon.mjs';
|
|
7
4
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const { t } = useLocale();
|
|
20
|
-
const internalDisabled = computed(() => props.disabled || props.currentPage <= 1);
|
|
21
|
-
return (_ctx, _cache) => {
|
|
22
|
-
return openBlock(), createElementBlock("button", {
|
|
23
|
-
type: "button",
|
|
24
|
-
class: "btn-prev",
|
|
25
|
-
disabled: unref(internalDisabled),
|
|
26
|
-
"aria-label": _ctx.prevText || unref(t)("el.pagination.prev"),
|
|
27
|
-
"aria-disabled": unref(internalDisabled),
|
|
28
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
|
|
29
|
-
}, [
|
|
30
|
-
_ctx.prevText ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.prevText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
31
|
-
default: withCtx(() => [
|
|
32
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon)))
|
|
33
|
-
]),
|
|
34
|
-
_: 1
|
|
35
|
-
}))
|
|
36
|
-
], 8, _hoisted_1);
|
|
37
|
-
};
|
|
5
|
+
const paginationPrevProps = buildProps({
|
|
6
|
+
disabled: Boolean,
|
|
7
|
+
currentPage: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 1
|
|
10
|
+
},
|
|
11
|
+
prevText: {
|
|
12
|
+
type: String
|
|
13
|
+
},
|
|
14
|
+
prevIcon: {
|
|
15
|
+
type: iconPropType
|
|
38
16
|
}
|
|
39
17
|
});
|
|
40
|
-
|
|
18
|
+
const paginationPrevEmits = {
|
|
19
|
+
click: (evt) => evt instanceof MouseEvent
|
|
20
|
+
};
|
|
41
21
|
|
|
42
|
-
export {
|
|
22
|
+
export { paginationPrevEmits, paginationPrevProps };
|
|
43
23
|
//# sourceMappingURL=prev.mjs.map
|