@element-plus/nightly 0.0.20220706 → 0.0.20220709
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.css +1 -1
- package/dist/index.full.js +29 -34
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +13 -13
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +29 -34
- 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/dropdown/index.d.ts +2 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +2 -1
- package/es/components/dropdown/src/dropdown2.mjs +10 -6
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/index.mjs +2 -2
- package/es/components/pagination/src/components/pager.mjs +17 -207
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +207 -17
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/radio/index.d.ts +0 -6
- package/es/components/radio/src/radio.vue.d.ts +0 -7
- package/es/components/radio/src/radio2.mjs +12 -25
- package/es/components/radio/src/radio2.mjs.map +1 -1
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +30 -45
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +45 -30
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/select-v2/src/useSelect.mjs +2 -1
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton.mjs +22 -49
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +49 -22
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/slider/src/composables/use-slider-button.mjs +3 -1
- package/es/components/slider/src/composables/use-slider-button.mjs.map +1 -1
- package/es/components/steps/src/item2.mjs +1 -1
- package/es/components/steps/src/item2.mjs.map +1 -1
- package/es/hooks/use-floating/index.d.ts +1 -1
- package/es/hooks/use-floating/index.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/dropdown/index.d.ts +2 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +2 -1
- package/lib/components/dropdown/src/dropdown2.js +10 -6
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/pagination/src/components/pager.js +17 -207
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +207 -17
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/radio/index.d.ts +0 -6
- package/lib/components/radio/src/radio.vue.d.ts +0 -7
- package/lib/components/radio/src/radio2.js +13 -26
- package/lib/components/radio/src/radio2.js.map +1 -1
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +32 -45
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +45 -32
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.js +2 -1
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton.js +22 -49
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +49 -22
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/slider/src/composables/use-slider-button.js +3 -1
- package/lib/components/slider/src/composables/use-slider-button.js.map +1 -1
- package/lib/components/steps/src/item2.js +1 -1
- package/lib/components/steps/src/item2.js.map +1 -1
- package/lib/hooks/use-floating/index.d.ts +1 -1
- package/lib/hooks/use-floating/index.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/theme-chalk/el-select-dropdown-v2.css +1 -1
- package/theme-chalk/el-select-dropdown.css +1 -1
- package/theme-chalk/el-select-v2.css +1 -1
- package/theme-chalk/el-select.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/select-dropdown-v2.scss +3 -3
- package/theme-chalk/src/select-dropdown.scss +2 -2
- package/web-types.json +1 -1
|
@@ -1,21 +1,211 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, ref, computed, watchEffect, openBlock, createElementBlock, normalizeClass, unref, withKeys, createCommentVNode, createBlock, Fragment, renderList, toDisplayString } from 'vue';
|
|
2
|
+
import { DArrowLeft, MoreFilled, DArrowRight } from '@element-plus/icons-vue';
|
|
3
|
+
import '../../../../hooks/index.mjs';
|
|
4
|
+
import { paginationPagerProps } from './pager.mjs';
|
|
5
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
|
|
3
7
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
const _hoisted_1 = ["onKeyup"];
|
|
9
|
+
const _hoisted_2 = ["aria-current", "tabindex"];
|
|
10
|
+
const _hoisted_3 = ["tabindex"];
|
|
11
|
+
const _hoisted_4 = ["aria-current", "tabindex"];
|
|
12
|
+
const _hoisted_5 = ["tabindex"];
|
|
13
|
+
const _hoisted_6 = ["aria-current", "tabindex"];
|
|
14
|
+
const __default__ = {
|
|
15
|
+
name: "ElPaginationPager"
|
|
16
|
+
};
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
+
...__default__,
|
|
19
|
+
props: paginationPagerProps,
|
|
20
|
+
emits: ["change"],
|
|
21
|
+
setup(__props, { emit }) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const nsPager = useNamespace("pager");
|
|
24
|
+
const nsIcon = useNamespace("icon");
|
|
25
|
+
const showPrevMore = ref(false);
|
|
26
|
+
const showNextMore = ref(false);
|
|
27
|
+
const quickPrevHover = ref(false);
|
|
28
|
+
const quickNextHover = ref(false);
|
|
29
|
+
const quickPrevFocus = ref(false);
|
|
30
|
+
const quickNextFocus = ref(false);
|
|
31
|
+
const pagers = computed(() => {
|
|
32
|
+
const pagerCount = props.pagerCount;
|
|
33
|
+
const halfPagerCount = (pagerCount - 1) / 2;
|
|
34
|
+
const currentPage = Number(props.currentPage);
|
|
35
|
+
const pageCount = Number(props.pageCount);
|
|
36
|
+
let showPrevMore2 = false;
|
|
37
|
+
let showNextMore2 = false;
|
|
38
|
+
if (pageCount > pagerCount) {
|
|
39
|
+
if (currentPage > pagerCount - halfPagerCount) {
|
|
40
|
+
showPrevMore2 = true;
|
|
41
|
+
}
|
|
42
|
+
if (currentPage < pageCount - halfPagerCount) {
|
|
43
|
+
showNextMore2 = true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const array = [];
|
|
47
|
+
if (showPrevMore2 && !showNextMore2) {
|
|
48
|
+
const startPage = pageCount - (pagerCount - 2);
|
|
49
|
+
for (let i = startPage; i < pageCount; i++) {
|
|
50
|
+
array.push(i);
|
|
51
|
+
}
|
|
52
|
+
} else if (!showPrevMore2 && showNextMore2) {
|
|
53
|
+
for (let i = 2; i < pagerCount; i++) {
|
|
54
|
+
array.push(i);
|
|
55
|
+
}
|
|
56
|
+
} else if (showPrevMore2 && showNextMore2) {
|
|
57
|
+
const offset = Math.floor(pagerCount / 2) - 1;
|
|
58
|
+
for (let i = currentPage - offset; i <= currentPage + offset; i++) {
|
|
59
|
+
array.push(i);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
for (let i = 2; i < pageCount; i++) {
|
|
63
|
+
array.push(i);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return array;
|
|
67
|
+
});
|
|
68
|
+
const tabindex = computed(() => props.disabled ? -1 : 0);
|
|
69
|
+
watchEffect(() => {
|
|
70
|
+
const halfPagerCount = (props.pagerCount - 1) / 2;
|
|
71
|
+
showPrevMore.value = false;
|
|
72
|
+
showNextMore.value = false;
|
|
73
|
+
if (props.pageCount > props.pagerCount) {
|
|
74
|
+
if (props.currentPage > props.pagerCount - halfPagerCount) {
|
|
75
|
+
showPrevMore.value = true;
|
|
76
|
+
}
|
|
77
|
+
if (props.currentPage < props.pageCount - halfPagerCount) {
|
|
78
|
+
showNextMore.value = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
function onMouseEnter(forward = false) {
|
|
83
|
+
if (props.disabled)
|
|
84
|
+
return;
|
|
85
|
+
if (forward) {
|
|
86
|
+
quickPrevHover.value = true;
|
|
87
|
+
} else {
|
|
88
|
+
quickNextHover.value = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function onFocus(forward = false) {
|
|
92
|
+
if (forward) {
|
|
93
|
+
quickPrevFocus.value = true;
|
|
94
|
+
} else {
|
|
95
|
+
quickNextFocus.value = true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function onEnter(e) {
|
|
99
|
+
const target = e.target;
|
|
100
|
+
if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
|
|
101
|
+
const newPage = Number(target.textContent);
|
|
102
|
+
if (newPage !== props.currentPage) {
|
|
103
|
+
emit("change", newPage);
|
|
104
|
+
}
|
|
105
|
+
} else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
|
|
106
|
+
onPagerClick(e);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function onPagerClick(event) {
|
|
110
|
+
const target = event.target;
|
|
111
|
+
if (target.tagName.toLowerCase() === "ul" || props.disabled) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
let newPage = Number(target.textContent);
|
|
115
|
+
const pageCount = props.pageCount;
|
|
116
|
+
const currentPage = props.currentPage;
|
|
117
|
+
const pagerCountOffset = props.pagerCount - 2;
|
|
118
|
+
if (target.className.includes("more")) {
|
|
119
|
+
if (target.className.includes("quickprev")) {
|
|
120
|
+
newPage = currentPage - pagerCountOffset;
|
|
121
|
+
} else if (target.className.includes("quicknext")) {
|
|
122
|
+
newPage = currentPage + pagerCountOffset;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (!Number.isNaN(+newPage)) {
|
|
126
|
+
if (newPage < 1) {
|
|
127
|
+
newPage = 1;
|
|
128
|
+
}
|
|
129
|
+
if (newPage > pageCount) {
|
|
130
|
+
newPage = pageCount;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (newPage !== currentPage) {
|
|
134
|
+
emit("change", newPage);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return (_ctx, _cache) => {
|
|
138
|
+
return openBlock(), createElementBlock("ul", {
|
|
139
|
+
class: normalizeClass(unref(nsPager).b()),
|
|
140
|
+
onClick: onPagerClick,
|
|
141
|
+
onKeyup: withKeys(onEnter, ["enter"])
|
|
142
|
+
}, [
|
|
143
|
+
_ctx.pageCount > 0 ? (openBlock(), createElementBlock("li", {
|
|
144
|
+
key: 0,
|
|
145
|
+
class: normalizeClass([[
|
|
146
|
+
unref(nsPager).is("active", _ctx.currentPage === 1),
|
|
147
|
+
unref(nsPager).is("disabled", _ctx.disabled)
|
|
148
|
+
], "number"]),
|
|
149
|
+
"aria-current": _ctx.currentPage === 1,
|
|
150
|
+
tabindex: unref(tabindex)
|
|
151
|
+
}, " 1 ", 10, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
152
|
+
showPrevMore.value ? (openBlock(), createElementBlock("li", {
|
|
153
|
+
key: 1,
|
|
154
|
+
class: normalizeClass([
|
|
155
|
+
"more",
|
|
156
|
+
"btn-quickprev",
|
|
157
|
+
unref(nsIcon).b(),
|
|
158
|
+
unref(nsPager).is("disabled", _ctx.disabled)
|
|
159
|
+
]),
|
|
160
|
+
tabindex: unref(tabindex),
|
|
161
|
+
onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
|
|
162
|
+
onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
|
|
163
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
|
|
164
|
+
onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
|
|
165
|
+
}, [
|
|
166
|
+
quickPrevHover.value || quickPrevFocus.value ? (openBlock(), createBlock(unref(DArrowLeft), { key: 0 })) : (openBlock(), createBlock(unref(MoreFilled), { key: 1 }))
|
|
167
|
+
], 42, _hoisted_3)) : createCommentVNode("v-if", true),
|
|
168
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(pagers), (pager) => {
|
|
169
|
+
return openBlock(), createElementBlock("li", {
|
|
170
|
+
key: pager,
|
|
171
|
+
class: normalizeClass([[
|
|
172
|
+
unref(nsPager).is("active", _ctx.currentPage === pager),
|
|
173
|
+
unref(nsPager).is("disabled", _ctx.disabled)
|
|
174
|
+
], "number"]),
|
|
175
|
+
"aria-current": _ctx.currentPage === pager,
|
|
176
|
+
tabindex: unref(tabindex)
|
|
177
|
+
}, toDisplayString(pager), 11, _hoisted_4);
|
|
178
|
+
}), 128)),
|
|
179
|
+
showNextMore.value ? (openBlock(), createElementBlock("li", {
|
|
180
|
+
key: 2,
|
|
181
|
+
class: normalizeClass([
|
|
182
|
+
"more",
|
|
183
|
+
"btn-quicknext",
|
|
184
|
+
unref(nsIcon).b(),
|
|
185
|
+
unref(nsPager).is("disabled", _ctx.disabled)
|
|
186
|
+
]),
|
|
187
|
+
tabindex: unref(tabindex),
|
|
188
|
+
onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
|
|
189
|
+
onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
|
|
190
|
+
onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
|
|
191
|
+
onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
|
|
192
|
+
}, [
|
|
193
|
+
quickNextHover.value || quickNextFocus.value ? (openBlock(), createBlock(unref(DArrowRight), { key: 0 })) : (openBlock(), createBlock(unref(MoreFilled), { key: 1 }))
|
|
194
|
+
], 42, _hoisted_5)) : createCommentVNode("v-if", true),
|
|
195
|
+
_ctx.pageCount > 1 ? (openBlock(), createElementBlock("li", {
|
|
196
|
+
key: 3,
|
|
197
|
+
class: normalizeClass([[
|
|
198
|
+
unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
|
|
199
|
+
unref(nsPager).is("disabled", _ctx.disabled)
|
|
200
|
+
], "number"]),
|
|
201
|
+
"aria-current": _ctx.currentPage === _ctx.pageCount,
|
|
202
|
+
tabindex: unref(tabindex)
|
|
203
|
+
}, toDisplayString(_ctx.pageCount), 11, _hoisted_6)) : createCommentVNode("v-if", true)
|
|
204
|
+
], 42, _hoisted_1);
|
|
205
|
+
};
|
|
206
|
+
}
|
|
18
207
|
});
|
|
208
|
+
var Pager = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/pager.vue"]]);
|
|
19
209
|
|
|
20
|
-
export {
|
|
210
|
+
export { Pager as default };
|
|
21
211
|
//# sourceMappingURL=pager2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pager2.mjs","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":[],"mappings":";;;AACY,MAAC,oBAAoB,GAAG,UAAU,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":"pager2.mjs","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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqFA,IAAA,MAAA,OAAA,GAAA,aAAA,OAAA,CAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAA,aAAA,MAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAA,GAAA,IAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAA,GAAA,IAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,IAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,IAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,IAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,IAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAA,SAAA,MAAA;AACA,MAA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AAA;AACA,MAAA,MAAA,gBAAA,GAAA,MAAA,UAAA,GAAA,CAAA,CAAA;AACA,MAAA,IAAA,MAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,EAAA;AACA,QAAA,IAAA,MAAA,CAAA,SAAA,CAAA,QAAA,CAAA,WAAA,CAAA,EAAA;AACA,UAAA,OAAA,GAAA,WAAA,GAAA,gBAAA,CAAA;AAAA,SACA,MAAA,IAAA,MAAA,CAAA,SAAA,CAAA,QAAA,CAAA,WAAA,CAAA,EAAA;AACA,UAAA,OAAA,GAAA,WAAA,GAAA,gBAAA,CAAA;AAAA,SACA;AAAA,OACA;AACA,MAAA,IAAA,CAAA,MAAA,CAAA,KAAA,CAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,IAAA,UAAA,CAAA,EAAA;AACA,UAAA,OAAA,GAAA,CAAA,CAAA;AAAA,SACA;AACA,QAAA,IAAA,UAAA,SAAA,EAAA;AACA,UAAA,OAAA,GAAA,SAAA,CAAA;AAAA,SACA;AAAA,OACA;AACA,MAAA,IAAA,YAAA,WAAA,EAAA;AACA,QAAA,IAAA,CAAA,UAAA,OAAA,CAAA,CAAA;AAAA,OACA;AAAA,KACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,7 @@ import Next from './components/next2.mjs';
|
|
|
7
7
|
import Sizes from './components/sizes2.mjs';
|
|
8
8
|
import Jumper from './components/jumper.mjs';
|
|
9
9
|
import Total from './components/total2.mjs';
|
|
10
|
-
import Pager from './components/
|
|
10
|
+
import Pager from './components/pager2.mjs';
|
|
11
11
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
12
12
|
import { mutable } from '../../../utils/typescript.mjs';
|
|
13
13
|
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
@@ -28,12 +28,6 @@ export declare const ElRadio: import("element-plus/es/utils").SFCWithInstall<imp
|
|
|
28
28
|
"onUpdate:modelValue"?: ((val: string | number | boolean) => any) | undefined;
|
|
29
29
|
}>>;
|
|
30
30
|
emit: ((event: "update:modelValue", val: string | number | boolean) => void) & ((event: "change", val: string | number | boolean) => void);
|
|
31
|
-
rawAttrs: {
|
|
32
|
-
[x: string]: unknown;
|
|
33
|
-
};
|
|
34
|
-
containerStyle: import("vue").ComputedRef<import("vue").StyleValue>;
|
|
35
|
-
inputAttrs: import("vue").ComputedRef<Record<string, unknown>>;
|
|
36
|
-
labelListeners: import("vue").ComputedRef<Record<string, unknown>>;
|
|
37
31
|
ns: {
|
|
38
32
|
namespace: import("vue").ComputedRef<string>;
|
|
39
33
|
b: (blockSuffix?: string) => string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { StyleValue } from 'vue';
|
|
2
1
|
declare const _default: import("vue").DefineComponent<{
|
|
3
2
|
readonly modelValue: import("../../../utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
4
3
|
readonly name: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -29,12 +28,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
29
28
|
"onUpdate:modelValue"?: ((val: string | number | boolean) => any) | undefined;
|
|
30
29
|
}>>;
|
|
31
30
|
emit: ((event: "update:modelValue", val: string | number | boolean) => void) & ((event: "change", val: string | number | boolean) => void);
|
|
32
|
-
rawAttrs: {
|
|
33
|
-
[x: string]: unknown;
|
|
34
|
-
};
|
|
35
|
-
containerStyle: import("vue").ComputedRef<StyleValue>;
|
|
36
|
-
inputAttrs: import("vue").ComputedRef<Record<string, unknown>>;
|
|
37
|
-
labelListeners: import("vue").ComputedRef<Record<string, unknown>>;
|
|
38
31
|
ns: {
|
|
39
32
|
namespace: import("vue").ComputedRef<string>;
|
|
40
33
|
b: (blockSuffix?: string) => string;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, nextTick, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, withDirectives, isRef, vModelRadio, withModifiers, renderSlot, createTextVNode, toDisplayString } from 'vue';
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import { radioProps, radioEmits } from './radio.mjs';
|
|
4
4
|
import { useRadio } from './use-radio.mjs';
|
|
5
5
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useAttrs as useAttrs$1 } from '../../../hooks/use-attrs/index.mjs';
|
|
7
6
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
7
|
|
|
9
8
|
const _hoisted_1 = ["value", "name", "disabled"];
|
|
10
9
|
const __default__ = {
|
|
11
|
-
name: "ElRadio"
|
|
12
|
-
inheritAttrs: false
|
|
10
|
+
name: "ElRadio"
|
|
13
11
|
};
|
|
14
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
13
|
...__default__,
|
|
@@ -17,14 +15,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
15
|
emits: radioEmits,
|
|
18
16
|
setup(__props, { emit }) {
|
|
19
17
|
const props = __props;
|
|
20
|
-
const rawAttrs = useAttrs();
|
|
21
|
-
const containerStyle = computed(() => rawAttrs.style);
|
|
22
|
-
const inputAttrs = useAttrs$1({ excludeListeners: true });
|
|
23
|
-
const labelListeners = useAttrs$1({
|
|
24
|
-
excludeKeys: computed(() => {
|
|
25
|
-
return Object.keys(inputAttrs.value);
|
|
26
|
-
})
|
|
27
|
-
});
|
|
28
18
|
const ns = useNamespace("radio");
|
|
29
19
|
const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(props, emit);
|
|
30
20
|
function handleChange() {
|
|
@@ -32,18 +22,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
22
|
}
|
|
33
23
|
return (_ctx, _cache) => {
|
|
34
24
|
var _a;
|
|
35
|
-
return openBlock(), createElementBlock("label",
|
|
36
|
-
class: [
|
|
25
|
+
return openBlock(), createElementBlock("label", {
|
|
26
|
+
class: normalizeClass([
|
|
37
27
|
unref(ns).b(),
|
|
38
28
|
unref(ns).is("disabled", unref(disabled)),
|
|
39
29
|
unref(ns).is("focus", unref(focus)),
|
|
40
30
|
unref(ns).is("bordered", _ctx.border),
|
|
41
31
|
unref(ns).is("checked", unref(modelValue) === _ctx.label),
|
|
42
|
-
unref(ns).m(unref(size))
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
style: unref(containerStyle)
|
|
46
|
-
}, unref(labelListeners)), [
|
|
32
|
+
unref(ns).m(unref(size))
|
|
33
|
+
])
|
|
34
|
+
}, [
|
|
47
35
|
createElementVNode("span", {
|
|
48
36
|
class: normalizeClass([
|
|
49
37
|
unref(ns).e("input"),
|
|
@@ -51,20 +39,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
39
|
unref(ns).is("checked", unref(modelValue) === _ctx.label)
|
|
52
40
|
])
|
|
53
41
|
}, [
|
|
54
|
-
withDirectives(createElementVNode("input",
|
|
42
|
+
withDirectives(createElementVNode("input", {
|
|
55
43
|
ref_key: "radioRef",
|
|
56
44
|
ref: radioRef,
|
|
57
45
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
|
|
58
|
-
class: unref(ns).e("original"),
|
|
46
|
+
class: normalizeClass(unref(ns).e("original")),
|
|
59
47
|
value: _ctx.label,
|
|
60
48
|
name: _ctx.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name),
|
|
61
49
|
disabled: unref(disabled),
|
|
62
|
-
type: "radio"
|
|
63
|
-
}, unref(inputAttrs), {
|
|
50
|
+
type: "radio",
|
|
64
51
|
onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
|
|
65
52
|
onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
|
|
66
53
|
onChange: handleChange
|
|
67
|
-
}
|
|
54
|
+
}, null, 42, _hoisted_1), [
|
|
68
55
|
[vModelRadio, unref(modelValue)]
|
|
69
56
|
]),
|
|
70
57
|
createElementVNode("span", {
|
|
@@ -80,7 +67,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
80
67
|
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
81
68
|
])
|
|
82
69
|
], 34)
|
|
83
|
-
],
|
|
70
|
+
], 2);
|
|
84
71
|
};
|
|
85
72
|
}
|
|
86
73
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio2.mjs","sources":["../../../../../../packages/components/radio/src/radio.vue"],"sourcesContent":["<template>\n <label\n :class=\"[\n ns.b(),\n ns.is('disabled', disabled),\n ns.is('focus', focus),\n ns.is('bordered', border),\n ns.is('checked', modelValue === label),\n ns.m(size),\n
|
|
1
|
+
{"version":3,"file":"radio2.mjs","sources":["../../../../../../packages/components/radio/src/radio.vue"],"sourcesContent":["<template>\n <label\n :class=\"[\n ns.b(),\n ns.is('disabled', disabled),\n ns.is('focus', focus),\n ns.is('bordered', border),\n ns.is('checked', modelValue === label),\n ns.m(size),\n ]\"\n >\n <span\n :class=\"[\n ns.e('input'),\n ns.is('disabled', disabled),\n ns.is('checked', modelValue === label),\n ]\"\n >\n <input\n ref=\"radioRef\"\n v-model=\"modelValue\"\n :class=\"ns.e('original')\"\n :value=\"label\"\n :name=\"name || radioGroup?.name\"\n :disabled=\"disabled\"\n type=\"radio\"\n @focus=\"focus = true\"\n @blur=\"focus = false\"\n @change=\"handleChange\"\n />\n <span :class=\"ns.e('inner')\" />\n </span>\n <span :class=\"ns.e('label')\" @keydown.stop>\n <slot>\n {{ label }}\n </slot>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\" setup>\nimport { nextTick } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { radioEmits, radioProps } from './radio'\nimport { useRadio } from './use-radio'\n\ndefineOptions({\n name: 'ElRadio',\n})\n\nconst props = defineProps(radioProps)\nconst emit = defineEmits(radioEmits)\n\nconst ns = useNamespace('radio')\nconst { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(\n props,\n emit\n)\n\nfunction handleChange() {\n nextTick(() => emit('change', modelValue.value))\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqDA,IAAA,MAAA,EAAA,GAAA,aAAA,OAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,UAAA,UAAA,EAAA,KAAA,EAAA,MAAA,QAAA,EAAA,UAAA,EAAA,GAAA,QACA,CAAA,KAAA,EACA,IACA,CAAA,CAAA;AAEA,IAAA,SAAA,YAAA,GAAA;AACA,MAAA,QAAA,CAAA,MAAA,IAAA,CAAA,QAAA,EAAA,UAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA,KACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Row from './src/
|
|
3
|
-
export { RowAlign, RowJustify, rowProps } from './src/
|
|
2
|
+
import Row from './src/row2.mjs';
|
|
3
|
+
export { RowAlign, RowJustify, rowProps } from './src/row.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const ElRow = withInstall(Row);
|
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../
|
|
3
|
-
import '../../../tokens/index.mjs';
|
|
4
|
-
import { rowProps } from './row2.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=row.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row.mjs","sources":["../../../../../../packages/components/row/src/row.
|
|
1
|
+
{"version":3,"file":"row.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,35 +1,50 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, computed, provide, openBlock, createBlock, resolveDynamicComponent, normalizeClass, unref, normalizeStyle, withCtx, renderSlot } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
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';
|
|
3
8
|
|
|
4
|
-
const
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
const __default__ = {
|
|
10
|
+
name: "ElRow"
|
|
11
|
+
};
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
14
|
+
props: rowProps,
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const ns = useNamespace("row");
|
|
18
|
+
const gutter = computed(() => props.gutter);
|
|
19
|
+
provide(rowContextKey, {
|
|
20
|
+
gutter
|
|
21
|
+
});
|
|
22
|
+
const style = computed(() => {
|
|
23
|
+
const styles = {};
|
|
24
|
+
if (!props.gutter) {
|
|
25
|
+
return styles;
|
|
26
|
+
}
|
|
27
|
+
styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
|
|
28
|
+
return styles;
|
|
29
|
+
});
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
32
|
+
class: normalizeClass([
|
|
33
|
+
unref(ns).b(),
|
|
34
|
+
unref(ns).is(`justify-${props.justify}`, _ctx.justify !== "start"),
|
|
35
|
+
unref(ns).is(`align-${props.align}`, _ctx.align !== "top")
|
|
36
|
+
]),
|
|
37
|
+
style: normalizeStyle(unref(style))
|
|
38
|
+
}, {
|
|
39
|
+
default: withCtx(() => [
|
|
40
|
+
renderSlot(_ctx.$slots, "default")
|
|
41
|
+
]),
|
|
42
|
+
_: 3
|
|
43
|
+
}, 8, ["class", "style"]);
|
|
44
|
+
};
|
|
31
45
|
}
|
|
32
46
|
});
|
|
47
|
+
var Row = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/row/src/row.vue"]]);
|
|
33
48
|
|
|
34
|
-
export {
|
|
49
|
+
export { Row as default };
|
|
35
50
|
//# 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.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n :class=\"[\n ns.b(),\n ns.is(`justify-${props.justify}`, justify !== 'start'),\n ns.is(`align-${props.align}`, align !== 'top'),\n ]\"\n :style=\"style\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rowContextKey } from '@element-plus/tokens'\nimport { rowProps } from './row'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElRow',\n})\n\nconst props = defineProps(rowProps)\n\nconst ns = useNamespace('row')\nconst gutter = computed(() => props.gutter)\n\nprovide(rowContextKey, {\n gutter,\n})\n\nconst style = computed(() => {\n const styles: CSSProperties = {}\n if (!props.gutter) {\n return styles\n }\n\n styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`\n return styles\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAA,MAAA,EAAA,GAAA,aAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,MAAA,CAAA,CAAA;AAEA,IAAA,OAAA,CAAA,aAAA,EAAA;AAAA,MACA,MAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,KAAA,GAAA,SAAA,MAAA;AACA,MAAA,MAAA,SAAA,EAAA,CAAA;AACA,MAAA,IAAA,CAAA,MAAA,MAAA,EAAA;AACA,QAAA,OAAA,MAAA,CAAA;AAAA,OACA;AAEA,MAAA,MAAA,CAAA,WAAA,GAAA,MAAA,CAAA,UAAA,GAAA,CAAA,CAAA,EAAA,MAAA,MAAA,GAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AACA,MAAA,OAAA,MAAA,CAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -100,8 +100,9 @@ const useSelect = (props, emit) => {
|
|
|
100
100
|
});
|
|
101
101
|
const filteredOptions = computed(() => {
|
|
102
102
|
const isValidOption = (o) => {
|
|
103
|
+
var _a;
|
|
103
104
|
const query = states.inputValue;
|
|
104
|
-
const containsQueryString = query ? o.label.includes(query) : true;
|
|
105
|
+
const containsQueryString = query ? (_a = o.label) == null ? void 0 : _a.includes(query) : true;
|
|
105
106
|
return containsQueryString;
|
|
106
107
|
};
|
|
107
108
|
if (props.loading) {
|