@element-plus/nightly 0.0.20220705 → 0.0.20220706
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 +5 -0
- package/attributes.json +1 -1
- 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/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/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/index.mjs +2 -2
- package/es/components/pagination/src/components/pager.mjs +207 -17
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +17 -207
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +45 -30
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +30 -45
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton.mjs +49 -22
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +22 -49
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/index.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/pagination/src/components/pager.js +207 -17
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +17 -207
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +45 -32
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +32 -45
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton.js +49 -22
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +22 -49
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../
|
|
3
|
-
import '../../../tokens/index.mjs';
|
|
4
|
-
import { rowProps } from './row.mjs';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
-
import { rowContextKey } from '../../../tokens/row.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
8
3
|
|
|
9
|
-
const
|
|
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
|
-
style: normalizeStyle(unref(style))
|
|
38
|
-
}, {
|
|
39
|
-
default: withCtx(() => [
|
|
40
|
-
renderSlot(_ctx.$slots, "default")
|
|
41
|
-
]),
|
|
42
|
-
_: 3
|
|
43
|
-
}, 8, ["class", "style"]);
|
|
44
|
-
};
|
|
4
|
+
const RowJustify = [
|
|
5
|
+
"start",
|
|
6
|
+
"center",
|
|
7
|
+
"end",
|
|
8
|
+
"space-around",
|
|
9
|
+
"space-between",
|
|
10
|
+
"space-evenly"
|
|
11
|
+
];
|
|
12
|
+
const RowAlign = ["top", "middle", "bottom"];
|
|
13
|
+
const rowProps = buildProps({
|
|
14
|
+
tag: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "div"
|
|
17
|
+
},
|
|
18
|
+
gutter: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 0
|
|
21
|
+
},
|
|
22
|
+
justify: {
|
|
23
|
+
type: String,
|
|
24
|
+
values: RowJustify,
|
|
25
|
+
default: "start"
|
|
26
|
+
},
|
|
27
|
+
align: {
|
|
28
|
+
type: String,
|
|
29
|
+
values: RowAlign,
|
|
30
|
+
default: "top"
|
|
45
31
|
}
|
|
46
32
|
});
|
|
47
|
-
var Row = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/row/src/row.vue"]]);
|
|
48
33
|
|
|
49
|
-
export {
|
|
34
|
+
export { RowAlign, RowJustify, rowProps };
|
|
50
35
|
//# sourceMappingURL=row2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row2.mjs","sources":["../../../../../../packages/components/row/src/row.
|
|
1
|
+
{"version":3,"file":"row2.mjs","sources":["../../../../../../packages/components/row/src/row.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Row from './row.vue'\n\nexport const RowJustify = [\n 'start',\n 'center',\n 'end',\n 'space-around',\n 'space-between',\n 'space-evenly',\n] as const\n\nexport const RowAlign = ['top', 'middle', 'bottom'] as const\n\nexport const rowProps = buildProps({\n tag: {\n type: String,\n default: 'div',\n },\n gutter: {\n type: Number,\n default: 0,\n },\n justify: {\n type: String,\n values: RowJustify,\n default: 'start',\n },\n align: {\n type: String,\n values: RowAlign,\n default: 'top',\n },\n} as const)\n\nexport type RowProps = ExtractPropTypes<typeof rowProps>\nexport type RowInstance = InstanceType<typeof Row>\n"],"names":[],"mappings":";;;AACY,MAAC,UAAU,GAAG;AAC1B,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,cAAc;AAChB,EAAE,eAAe;AACjB,EAAE,cAAc;AAChB,EAAE;AACU,MAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACxC,MAAC,QAAQ,GAAG,UAAU,CAAC;AACnC,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,QAAQ;AACpB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Skeleton from './src/
|
|
2
|
+
import Skeleton from './src/skeleton.mjs';
|
|
3
3
|
import SkeletonItem from './src/skeleton-item2.mjs';
|
|
4
|
-
export { skeletonProps } from './src/
|
|
4
|
+
export { skeletonProps } from './src/skeleton2.mjs';
|
|
5
5
|
export { skeletonItemProps } from './src/skeleton-item.mjs';
|
|
6
6
|
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
|
|
7
7
|
|
|
@@ -1,27 +1,54 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, toRef, unref, openBlock, createElementBlock, mergeProps, Fragment, renderList, renderSlot, createVNode, normalizeClass, createBlock, createCommentVNode, normalizeProps } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import { skeletonProps } from './skeleton2.mjs';
|
|
4
|
+
import SkeletonItem from './skeleton-item2.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
+
import { useThrottleRender } from '../../../hooks/use-throttle-render/index.mjs';
|
|
3
8
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
const __default__ = {
|
|
10
|
+
name: "ElSkeleton"
|
|
11
|
+
};
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
14
|
+
props: skeletonProps,
|
|
15
|
+
setup(__props, { expose }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const ns = useNamespace("skeleton");
|
|
18
|
+
const uiLoading = useThrottleRender(toRef(props, "loading"), props.throttle);
|
|
19
|
+
expose({
|
|
20
|
+
uiLoading
|
|
21
|
+
});
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return unref(uiLoading) ? (openBlock(), createElementBlock("div", mergeProps({
|
|
24
|
+
key: 0,
|
|
25
|
+
class: [unref(ns).b(), unref(ns).is("animated", _ctx.animated)]
|
|
26
|
+
}, _ctx.$attrs), [
|
|
27
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.count, (i) => {
|
|
28
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [
|
|
29
|
+
_ctx.loading ? renderSlot(_ctx.$slots, "template", { key: i }, () => [
|
|
30
|
+
createVNode(SkeletonItem, {
|
|
31
|
+
class: normalizeClass(unref(ns).is("first")),
|
|
32
|
+
variant: "p"
|
|
33
|
+
}, null, 8, ["class"]),
|
|
34
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (item) => {
|
|
35
|
+
return openBlock(), createBlock(SkeletonItem, {
|
|
36
|
+
key: item,
|
|
37
|
+
class: normalizeClass([
|
|
38
|
+
unref(ns).e("paragraph"),
|
|
39
|
+
unref(ns).is("last", item === _ctx.rows && _ctx.rows > 1)
|
|
40
|
+
]),
|
|
41
|
+
variant: "p"
|
|
42
|
+
}, null, 8, ["class"]);
|
|
43
|
+
}), 128))
|
|
44
|
+
]) : createCommentVNode("v-if", true)
|
|
45
|
+
], 64);
|
|
46
|
+
}), 128))
|
|
47
|
+
], 16)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)));
|
|
48
|
+
};
|
|
23
49
|
}
|
|
24
50
|
});
|
|
51
|
+
var Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/skeleton/src/skeleton.vue"]]);
|
|
25
52
|
|
|
26
|
-
export {
|
|
53
|
+
export { Skeleton as default };
|
|
27
54
|
//# sourceMappingURL=skeleton.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.
|
|
1
|
+
{"version":3,"file":"skeleton.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.vue"],"sourcesContent":["<template>\n <template v-if=\"uiLoading\">\n <div :class=\"[ns.b(), ns.is('animated', animated)]\" v-bind=\"$attrs\">\n <template v-for=\"i in count\" :key=\"i\">\n <slot v-if=\"loading\" :key=\"i\" name=\"template\">\n <el-skeleton-item :class=\"ns.is('first')\" variant=\"p\" />\n <el-skeleton-item\n v-for=\"item in rows\"\n :key=\"item\"\n :class=\"[\n ns.e('paragraph'),\n ns.is('last', item === rows && rows > 1),\n ]\"\n variant=\"p\"\n />\n </slot>\n </template>\n </div>\n </template>\n <template v-else>\n <slot v-bind=\"$attrs\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { toRef } from 'vue'\nimport { useNamespace, useThrottleRender } from '@element-plus/hooks'\nimport { skeletonProps } from './skeleton'\nimport ElSkeletonItem from './skeleton-item.vue'\n\ndefineOptions({\n name: 'ElSkeleton',\n})\nconst props = defineProps(skeletonProps)\n\nconst ns = useNamespace('skeleton')\nconst uiLoading = useThrottleRender(toRef(props, 'loading'), props.throttle)\n\ndefineExpose({\n /** @description loading state */\n uiLoading,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmCA,IAAA,MAAA,EAAA,GAAA,aAAA,UAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAA,iBAAA,CAAA,KAAA,CAAA,OAAA,SAAA,CAAA,EAAA,MAAA,QAAA,CAAA,CAAA;AAEA,IAAA,MAAA,CAAA;AAAA,MAEA,SAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,54 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../
|
|
3
|
-
import { skeletonProps } from './skeleton.mjs';
|
|
4
|
-
import SkeletonItem from './skeleton-item2.mjs';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
-
import { useThrottleRender } from '../../../hooks/use-throttle-render/index.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
8
3
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return openBlock(), createElementBlock(Fragment, { key: i }, [
|
|
29
|
-
_ctx.loading ? renderSlot(_ctx.$slots, "template", { key: i }, () => [
|
|
30
|
-
createVNode(SkeletonItem, {
|
|
31
|
-
class: normalizeClass(unref(ns).is("first")),
|
|
32
|
-
variant: "p"
|
|
33
|
-
}, null, 8, ["class"]),
|
|
34
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (item) => {
|
|
35
|
-
return openBlock(), createBlock(SkeletonItem, {
|
|
36
|
-
key: item,
|
|
37
|
-
class: normalizeClass([
|
|
38
|
-
unref(ns).e("paragraph"),
|
|
39
|
-
unref(ns).is("last", item === _ctx.rows && _ctx.rows > 1)
|
|
40
|
-
]),
|
|
41
|
-
variant: "p"
|
|
42
|
-
}, null, 8, ["class"]);
|
|
43
|
-
}), 128))
|
|
44
|
-
]) : createCommentVNode("v-if", true)
|
|
45
|
-
], 64);
|
|
46
|
-
}), 128))
|
|
47
|
-
], 16)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)));
|
|
48
|
-
};
|
|
4
|
+
const skeletonProps = buildProps({
|
|
5
|
+
animated: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: false
|
|
8
|
+
},
|
|
9
|
+
count: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 1
|
|
12
|
+
},
|
|
13
|
+
rows: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 3
|
|
16
|
+
},
|
|
17
|
+
loading: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true
|
|
20
|
+
},
|
|
21
|
+
throttle: {
|
|
22
|
+
type: Number
|
|
49
23
|
}
|
|
50
24
|
});
|
|
51
|
-
var Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/skeleton/src/skeleton.vue"]]);
|
|
52
25
|
|
|
53
|
-
export {
|
|
26
|
+
export { skeletonProps };
|
|
54
27
|
//# sourceMappingURL=skeleton2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.
|
|
1
|
+
{"version":3,"file":"skeleton2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type Skeleton from './skeleton.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const skeletonProps = buildProps({\n animated: {\n type: Boolean,\n default: false,\n },\n count: {\n type: Number,\n default: 1,\n },\n rows: {\n type: Number,\n default: 3,\n },\n loading: {\n type: Boolean,\n default: true,\n },\n throttle: {\n type: Number,\n },\n} as const)\nexport type SkeletonProps = ExtractPropTypes<typeof skeletonProps>\n\nexport type SkeletonInstance = InstanceType<typeof Skeleton>\n"],"names":[],"mappings":";;;AACY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,CAAC;;;;"}
|
package/es/index.mjs
CHANGED
|
@@ -109,7 +109,7 @@ export { rateEmits, rateProps } from './components/rate/src/rate.mjs';
|
|
|
109
109
|
export { ElRate } from './components/rate/index.mjs';
|
|
110
110
|
export { IconComponentMap, IconMap, resultProps } from './components/result/src/result.mjs';
|
|
111
111
|
export { ElResult } from './components/result/index.mjs';
|
|
112
|
-
export { RowAlign, RowJustify, rowProps } from './components/row/src/
|
|
112
|
+
export { RowAlign, RowJustify, rowProps } from './components/row/src/row2.mjs';
|
|
113
113
|
export { ElRow } from './components/row/index.mjs';
|
|
114
114
|
export { BAR_MAP, GAP, renderThumbStyle } from './components/scrollbar/src/util.mjs';
|
|
115
115
|
export { scrollbarEmits, scrollbarProps } from './components/scrollbar/src/scrollbar.mjs';
|
|
@@ -119,7 +119,7 @@ export { selectGroupKey, selectKey } from './components/select/src/token.mjs';
|
|
|
119
119
|
export { ElOption, ElOptionGroup, ElSelect } from './components/select/index.mjs';
|
|
120
120
|
export { selectV2InjectionKey } from './components/select-v2/src/token.mjs';
|
|
121
121
|
export { ElSelectV2 } from './components/select-v2/index.mjs';
|
|
122
|
-
export { skeletonProps } from './components/skeleton/src/
|
|
122
|
+
export { skeletonProps } from './components/skeleton/src/skeleton2.mjs';
|
|
123
123
|
export { skeletonItemProps } from './components/skeleton/src/skeleton-item.mjs';
|
|
124
124
|
export { ElSkeleton, ElSkeletonItem } from './components/skeleton/index.mjs';
|
|
125
125
|
export { sliderEmits, sliderProps } from './components/slider/src/slider.mjs';
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20220706";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220706'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
package/lib/components/index.js
CHANGED
|
@@ -133,13 +133,13 @@ var radioGroup = require('./radio/src/radio-group.js');
|
|
|
133
133
|
var radioButton = require('./radio/src/radio-button.js');
|
|
134
134
|
var rate = require('./rate/src/rate.js');
|
|
135
135
|
var result = require('./result/src/result.js');
|
|
136
|
-
var row = require('./row/src/
|
|
136
|
+
var row = require('./row/src/row2.js');
|
|
137
137
|
var util = require('./scrollbar/src/util.js');
|
|
138
138
|
var scrollbar = require('./scrollbar/src/scrollbar.js');
|
|
139
139
|
var thumb = require('./scrollbar/src/thumb.js');
|
|
140
140
|
var token = require('./select/src/token.js');
|
|
141
141
|
var token$1 = require('./select-v2/src/token.js');
|
|
142
|
-
var skeleton = require('./skeleton/src/
|
|
142
|
+
var skeleton = require('./skeleton/src/skeleton2.js');
|
|
143
143
|
var skeletonItem = require('./skeleton/src/skeleton-item.js');
|
|
144
144
|
var slider = require('./slider/src/slider.js');
|
|
145
145
|
var space = require('./space/src/space.js');
|
|
@@ -2,24 +2,214 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
6
|
-
var
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
7
|
+
require('../../../../hooks/index.js');
|
|
8
|
+
var pager = require('./pager2.js');
|
|
9
|
+
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
|
|
10
|
+
var index = require('../../../../hooks/use-namespace/index.js');
|
|
7
11
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
const _hoisted_1 = ["onKeyup"];
|
|
13
|
+
const _hoisted_2 = ["aria-current", "tabindex"];
|
|
14
|
+
const _hoisted_3 = ["tabindex"];
|
|
15
|
+
const _hoisted_4 = ["aria-current", "tabindex"];
|
|
16
|
+
const _hoisted_5 = ["tabindex"];
|
|
17
|
+
const _hoisted_6 = ["aria-current", "tabindex"];
|
|
18
|
+
const __default__ = {
|
|
19
|
+
name: "ElPaginationPager"
|
|
20
|
+
};
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
22
|
+
...__default__,
|
|
23
|
+
props: pager.paginationPagerProps,
|
|
24
|
+
emits: ["change"],
|
|
25
|
+
setup(__props, { emit }) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const nsPager = index.useNamespace("pager");
|
|
28
|
+
const nsIcon = index.useNamespace("icon");
|
|
29
|
+
const showPrevMore = vue.ref(false);
|
|
30
|
+
const showNextMore = vue.ref(false);
|
|
31
|
+
const quickPrevHover = vue.ref(false);
|
|
32
|
+
const quickNextHover = vue.ref(false);
|
|
33
|
+
const quickPrevFocus = vue.ref(false);
|
|
34
|
+
const quickNextFocus = vue.ref(false);
|
|
35
|
+
const pagers = vue.computed(() => {
|
|
36
|
+
const pagerCount = props.pagerCount;
|
|
37
|
+
const halfPagerCount = (pagerCount - 1) / 2;
|
|
38
|
+
const currentPage = Number(props.currentPage);
|
|
39
|
+
const pageCount = Number(props.pageCount);
|
|
40
|
+
let showPrevMore2 = false;
|
|
41
|
+
let showNextMore2 = false;
|
|
42
|
+
if (pageCount > pagerCount) {
|
|
43
|
+
if (currentPage > pagerCount - halfPagerCount) {
|
|
44
|
+
showPrevMore2 = true;
|
|
45
|
+
}
|
|
46
|
+
if (currentPage < pageCount - halfPagerCount) {
|
|
47
|
+
showNextMore2 = true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const array = [];
|
|
51
|
+
if (showPrevMore2 && !showNextMore2) {
|
|
52
|
+
const startPage = pageCount - (pagerCount - 2);
|
|
53
|
+
for (let i = startPage; i < pageCount; i++) {
|
|
54
|
+
array.push(i);
|
|
55
|
+
}
|
|
56
|
+
} else if (!showPrevMore2 && showNextMore2) {
|
|
57
|
+
for (let i = 2; i < pagerCount; i++) {
|
|
58
|
+
array.push(i);
|
|
59
|
+
}
|
|
60
|
+
} else if (showPrevMore2 && showNextMore2) {
|
|
61
|
+
const offset = Math.floor(pagerCount / 2) - 1;
|
|
62
|
+
for (let i = currentPage - offset; i <= currentPage + offset; i++) {
|
|
63
|
+
array.push(i);
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
for (let i = 2; i < pageCount; i++) {
|
|
67
|
+
array.push(i);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return array;
|
|
71
|
+
});
|
|
72
|
+
const tabindex = vue.computed(() => props.disabled ? -1 : 0);
|
|
73
|
+
vue.watchEffect(() => {
|
|
74
|
+
const halfPagerCount = (props.pagerCount - 1) / 2;
|
|
75
|
+
showPrevMore.value = false;
|
|
76
|
+
showNextMore.value = false;
|
|
77
|
+
if (props.pageCount > props.pagerCount) {
|
|
78
|
+
if (props.currentPage > props.pagerCount - halfPagerCount) {
|
|
79
|
+
showPrevMore.value = true;
|
|
80
|
+
}
|
|
81
|
+
if (props.currentPage < props.pageCount - halfPagerCount) {
|
|
82
|
+
showNextMore.value = true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
function onMouseEnter(forward = false) {
|
|
87
|
+
if (props.disabled)
|
|
88
|
+
return;
|
|
89
|
+
if (forward) {
|
|
90
|
+
quickPrevHover.value = true;
|
|
91
|
+
} else {
|
|
92
|
+
quickNextHover.value = true;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function onFocus(forward = false) {
|
|
96
|
+
if (forward) {
|
|
97
|
+
quickPrevFocus.value = true;
|
|
98
|
+
} else {
|
|
99
|
+
quickNextFocus.value = true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function onEnter(e) {
|
|
103
|
+
const target = e.target;
|
|
104
|
+
if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
|
|
105
|
+
const newPage = Number(target.textContent);
|
|
106
|
+
if (newPage !== props.currentPage) {
|
|
107
|
+
emit("change", newPage);
|
|
108
|
+
}
|
|
109
|
+
} else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
|
|
110
|
+
onPagerClick(e);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function onPagerClick(event) {
|
|
114
|
+
const target = event.target;
|
|
115
|
+
if (target.tagName.toLowerCase() === "ul" || props.disabled) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
let newPage = Number(target.textContent);
|
|
119
|
+
const pageCount = props.pageCount;
|
|
120
|
+
const currentPage = props.currentPage;
|
|
121
|
+
const pagerCountOffset = props.pagerCount - 2;
|
|
122
|
+
if (target.className.includes("more")) {
|
|
123
|
+
if (target.className.includes("quickprev")) {
|
|
124
|
+
newPage = currentPage - pagerCountOffset;
|
|
125
|
+
} else if (target.className.includes("quicknext")) {
|
|
126
|
+
newPage = currentPage + pagerCountOffset;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (!Number.isNaN(+newPage)) {
|
|
130
|
+
if (newPage < 1) {
|
|
131
|
+
newPage = 1;
|
|
132
|
+
}
|
|
133
|
+
if (newPage > pageCount) {
|
|
134
|
+
newPage = pageCount;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (newPage !== currentPage) {
|
|
138
|
+
emit("change", newPage);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return (_ctx, _cache) => {
|
|
142
|
+
return vue.openBlock(), vue.createElementBlock("ul", {
|
|
143
|
+
class: vue.normalizeClass(vue.unref(nsPager).b()),
|
|
144
|
+
onClick: onPagerClick,
|
|
145
|
+
onKeyup: vue.withKeys(onEnter, ["enter"])
|
|
146
|
+
}, [
|
|
147
|
+
_ctx.pageCount > 0 ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
148
|
+
key: 0,
|
|
149
|
+
class: vue.normalizeClass([[
|
|
150
|
+
vue.unref(nsPager).is("active", _ctx.currentPage === 1),
|
|
151
|
+
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
152
|
+
], "number"]),
|
|
153
|
+
"aria-current": _ctx.currentPage === 1,
|
|
154
|
+
tabindex: vue.unref(tabindex)
|
|
155
|
+
}, " 1 ", 10, _hoisted_2)) : vue.createCommentVNode("v-if", true),
|
|
156
|
+
showPrevMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
157
|
+
key: 1,
|
|
158
|
+
class: vue.normalizeClass([
|
|
159
|
+
"more",
|
|
160
|
+
"btn-quickprev",
|
|
161
|
+
vue.unref(nsIcon).b(),
|
|
162
|
+
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
163
|
+
]),
|
|
164
|
+
tabindex: vue.unref(tabindex),
|
|
165
|
+
onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
|
|
166
|
+
onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
|
|
167
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
|
|
168
|
+
onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
|
|
169
|
+
}, [
|
|
170
|
+
quickPrevHover.value || quickPrevFocus.value ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowLeft), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
|
|
171
|
+
], 42, _hoisted_3)) : vue.createCommentVNode("v-if", true),
|
|
172
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(pagers), (pager) => {
|
|
173
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
174
|
+
key: pager,
|
|
175
|
+
class: vue.normalizeClass([[
|
|
176
|
+
vue.unref(nsPager).is("active", _ctx.currentPage === pager),
|
|
177
|
+
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
178
|
+
], "number"]),
|
|
179
|
+
"aria-current": _ctx.currentPage === pager,
|
|
180
|
+
tabindex: vue.unref(tabindex)
|
|
181
|
+
}, vue.toDisplayString(pager), 11, _hoisted_4);
|
|
182
|
+
}), 128)),
|
|
183
|
+
showNextMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
184
|
+
key: 2,
|
|
185
|
+
class: vue.normalizeClass([
|
|
186
|
+
"more",
|
|
187
|
+
"btn-quicknext",
|
|
188
|
+
vue.unref(nsIcon).b(),
|
|
189
|
+
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
190
|
+
]),
|
|
191
|
+
tabindex: vue.unref(tabindex),
|
|
192
|
+
onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
|
|
193
|
+
onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
|
|
194
|
+
onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
|
|
195
|
+
onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
|
|
196
|
+
}, [
|
|
197
|
+
quickNextHover.value || quickNextFocus.value ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowRight), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
|
|
198
|
+
], 42, _hoisted_5)) : vue.createCommentVNode("v-if", true),
|
|
199
|
+
_ctx.pageCount > 1 ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
200
|
+
key: 3,
|
|
201
|
+
class: vue.normalizeClass([[
|
|
202
|
+
vue.unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
|
|
203
|
+
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
204
|
+
], "number"]),
|
|
205
|
+
"aria-current": _ctx.currentPage === _ctx.pageCount,
|
|
206
|
+
tabindex: vue.unref(tabindex)
|
|
207
|
+
}, vue.toDisplayString(_ctx.pageCount), 11, _hoisted_6)) : vue.createCommentVNode("v-if", true)
|
|
208
|
+
], 42, _hoisted_1);
|
|
209
|
+
};
|
|
210
|
+
}
|
|
22
211
|
});
|
|
212
|
+
var Pager = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/pager.vue"]]);
|
|
23
213
|
|
|
24
|
-
exports
|
|
214
|
+
exports["default"] = Pager;
|
|
25
215
|
//# sourceMappingURL=pager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pager.js","sources":["../../../../../../../packages/components/pagination/src/components/pager.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Pager from './pager.vue'\n\nexport const paginationPagerProps = buildProps({\n currentPage: {\n type: Number,\n default: 1,\n },\n pageCount: {\n type: Number,\n required: true,\n },\n pagerCount: {\n type: Number,\n default: 7,\n },\n disabled: Boolean,\n} as const)\n\nexport type PaginationPagerProps = ExtractPropTypes<typeof paginationPagerProps>\n\nexport type PagerInstance = InstanceType<typeof Pager>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,oBAAoB,GAAGA,kBAAU,CAAC;AAC/C,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"pager.js","sources":["../../../../../../../packages/components/pagination/src/components/pager.vue"],"sourcesContent":["<template>\n <ul :class=\"nsPager.b()\" @click=\"onPagerClick\" @keyup.enter=\"onEnter\">\n <li\n v-if=\"pageCount > 0\"\n :class=\"[\n nsPager.is('active', currentPage === 1),\n nsPager.is('disabled', disabled),\n ]\"\n class=\"number\"\n :aria-current=\"currentPage === 1\"\n :tabindex=\"tabindex\"\n >\n 1\n </li>\n <li\n v-if=\"showPrevMore\"\n :class=\"[\n 'more',\n 'btn-quickprev',\n nsIcon.b(),\n nsPager.is('disabled', disabled),\n ]\"\n :tabindex=\"tabindex\"\n @mouseenter=\"onMouseEnter(true)\"\n @mouseleave=\"quickPrevHover = false\"\n @focus=\"onFocus(true)\"\n @blur=\"quickPrevFocus = false\"\n >\n <d-arrow-left v-if=\"quickPrevHover || quickPrevFocus\" />\n <more-filled v-else />\n </li>\n <li\n v-for=\"pager in pagers\"\n :key=\"pager\"\n :class=\"[\n nsPager.is('active', currentPage === pager),\n nsPager.is('disabled', disabled),\n ]\"\n class=\"number\"\n :aria-current=\"currentPage === pager\"\n :tabindex=\"tabindex\"\n >\n {{ pager }}\n </li>\n <li\n v-if=\"showNextMore\"\n :class=\"[\n 'more',\n 'btn-quicknext',\n nsIcon.b(),\n nsPager.is('disabled', disabled),\n ]\"\n :tabindex=\"tabindex\"\n @mouseenter=\"onMouseEnter()\"\n @mouseleave=\"quickNextHover = false\"\n @focus=\"onFocus()\"\n @blur=\"quickNextFocus = false\"\n >\n <d-arrow-right v-if=\"quickNextHover || quickNextFocus\" />\n <more-filled v-else />\n </li>\n <li\n v-if=\"pageCount > 1\"\n :class=\"[\n nsPager.is('active', currentPage === pageCount),\n nsPager.is('disabled', disabled),\n ]\"\n class=\"number\"\n :aria-current=\"currentPage === pageCount\"\n :tabindex=\"tabindex\"\n >\n {{ pageCount }}\n </li>\n </ul>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref, watchEffect } from 'vue'\nimport { DArrowLeft, DArrowRight, MoreFilled } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { paginationPagerProps } from './pager'\ndefineOptions({\n name: 'ElPaginationPager',\n})\nconst props = defineProps(paginationPagerProps)\nconst emit = defineEmits(['change'])\nconst nsPager = useNamespace('pager')\nconst nsIcon = useNamespace('icon')\nconst showPrevMore = ref(false)\nconst showNextMore = ref(false)\nconst quickPrevHover = ref(false)\nconst quickNextHover = ref(false)\nconst quickPrevFocus = ref(false)\nconst quickNextFocus = ref(false)\nconst pagers = computed(() => {\n const pagerCount = props.pagerCount\n const halfPagerCount = (pagerCount - 1) / 2\n const currentPage = Number(props.currentPage)\n const pageCount = Number(props.pageCount)\n let showPrevMore = false\n let showNextMore = false\n if (pageCount > pagerCount) {\n if (currentPage > pagerCount - halfPagerCount) {\n showPrevMore = true\n }\n if (currentPage < pageCount - halfPagerCount) {\n showNextMore = true\n }\n }\n const array: number[] = []\n if (showPrevMore && !showNextMore) {\n const startPage = pageCount - (pagerCount - 2)\n for (let i = startPage; i < pageCount; i++) {\n array.push(i)\n }\n } else if (!showPrevMore && showNextMore) {\n for (let i = 2; i < pagerCount; i++) {\n array.push(i)\n }\n } else if (showPrevMore && showNextMore) {\n const offset = Math.floor(pagerCount / 2) - 1\n for (let i = currentPage - offset; i <= currentPage + offset; i++) {\n array.push(i)\n }\n } else {\n for (let i = 2; i < pageCount; i++) {\n array.push(i)\n }\n }\n return array\n})\nconst tabindex = computed(() => (props.disabled ? -1 : 0))\nwatchEffect(() => {\n const halfPagerCount = (props.pagerCount - 1) / 2\n showPrevMore.value = false\n showNextMore.value = false\n if (props.pageCount! > props.pagerCount) {\n if (props.currentPage > props.pagerCount - halfPagerCount) {\n showPrevMore.value = true\n }\n if (props.currentPage < props.pageCount! - halfPagerCount) {\n showNextMore.value = true\n }\n }\n})\nfunction onMouseEnter(forward = false) {\n if (props.disabled) return\n if (forward) {\n quickPrevHover.value = true\n } else {\n quickNextHover.value = true\n }\n}\nfunction onFocus(forward = false) {\n if (forward) {\n quickPrevFocus.value = true\n } else {\n quickNextFocus.value = true\n }\n}\nfunction onEnter(e: UIEvent) {\n const target = e.target as HTMLElement\n if (\n target.tagName.toLowerCase() === 'li' &&\n Array.from(target.classList).includes('number')\n ) {\n const newPage = Number(target.textContent)\n if (newPage !== props.currentPage) {\n emit('change', newPage)\n }\n } else if (\n target.tagName.toLowerCase() === 'li' &&\n Array.from(target.classList).includes('more')\n ) {\n onPagerClick(e)\n }\n}\nfunction onPagerClick(event: UIEvent) {\n const target = event.target as HTMLElement\n if (target.tagName.toLowerCase() === 'ul' || props.disabled) {\n return\n }\n let newPage = Number(target.textContent)\n const pageCount = props.pageCount!\n const currentPage = props.currentPage\n const pagerCountOffset = props.pagerCount - 2\n if (target.className.includes('more')) {\n if (target.className.includes('quickprev')) {\n newPage = currentPage - pagerCountOffset\n } else if (target.className.includes('quicknext')) {\n newPage = currentPage + pagerCountOffset\n }\n }\n if (!Number.isNaN(+newPage)) {\n if (newPage < 1) {\n newPage = 1\n }\n if (newPage > pageCount) {\n newPage = pageCount\n }\n }\n if (newPage !== currentPage) {\n emit('change', newPage)\n }\n}\n</script>\n"],"names":["useNamespace","ref","computed","watchEffect"],"mappings":";;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