@element-plus/nightly 0.0.20240304 → 0.0.20240305
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +6 -6
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +3 -3
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +6 -6
- 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-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.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/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +26 -117
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +117 -26
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +35 -17
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +17 -35
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/index.mjs +4 -4
- package/es/components/pagination/src/components/pager.mjs +216 -17
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +17 -216
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/arrow.mjs +8 -37
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +37 -8
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/table/src/filter-panel.mjs +2 -2
- package/es/components/table/src/filter-panel.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/transfer/src/transfer-panel2.mjs +2 -2
- package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
- package/es/index.mjs +4 -4
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +27 -117
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +117 -27
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +35 -18
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +18 -35
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/index.js +4 -4
- package/lib/components/pagination/src/components/pager.js +216 -17
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +17 -216
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/arrow.js +9 -37
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +37 -9
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/table/src/filter-panel.js +2 -2
- package/lib/components/table/src/filter-panel.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/transfer/src/transfer-panel2.js +2 -2
- package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
- package/lib/index.js +4 -4
- 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/theme-chalk/el-anchor.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/anchor-link.scss +3 -4
- package/theme-chalk/src/anchor.scss +8 -12
- package/theme-chalk/src/input.scss +0 -1
- package/web-types.json +1 -1
|
@@ -2,36 +2,126 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
require('../../../
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
require('../../../hooks/index.js');
|
|
9
|
+
var affix = require('./affix.js');
|
|
10
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
11
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
12
|
+
var style = require('../../../utils/dom/style.js');
|
|
13
|
+
var error = require('../../../utils/error.js');
|
|
14
|
+
var scroll = require('../../../utils/dom/scroll.js');
|
|
10
15
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const COMPONENT_NAME = "ElAffix";
|
|
17
|
+
const __default__ = vue.defineComponent({
|
|
18
|
+
name: COMPONENT_NAME
|
|
19
|
+
});
|
|
20
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
21
|
+
...__default__,
|
|
22
|
+
props: affix.affixProps,
|
|
23
|
+
emits: affix.affixEmits,
|
|
24
|
+
setup(__props, { expose, emit }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const ns = index.useNamespace("affix");
|
|
27
|
+
const target = vue.shallowRef();
|
|
28
|
+
const root = vue.shallowRef();
|
|
29
|
+
const scrollContainer = vue.shallowRef();
|
|
30
|
+
const { height: windowHeight } = core.useWindowSize();
|
|
31
|
+
const {
|
|
32
|
+
height: rootHeight,
|
|
33
|
+
width: rootWidth,
|
|
34
|
+
top: rootTop,
|
|
35
|
+
bottom: rootBottom,
|
|
36
|
+
update: updateRoot
|
|
37
|
+
} = core.useElementBounding(root, { windowScroll: false });
|
|
38
|
+
const targetRect = core.useElementBounding(target);
|
|
39
|
+
const fixed = vue.ref(false);
|
|
40
|
+
const scrollTop = vue.ref(0);
|
|
41
|
+
const transform = vue.ref(0);
|
|
42
|
+
const rootStyle = vue.computed(() => {
|
|
43
|
+
return {
|
|
44
|
+
height: fixed.value ? `${rootHeight.value}px` : "",
|
|
45
|
+
width: fixed.value ? `${rootWidth.value}px` : ""
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
const affixStyle = vue.computed(() => {
|
|
49
|
+
if (!fixed.value)
|
|
50
|
+
return {};
|
|
51
|
+
const offset = props.offset ? style.addUnit(props.offset) : 0;
|
|
52
|
+
return {
|
|
53
|
+
height: `${rootHeight.value}px`,
|
|
54
|
+
width: `${rootWidth.value}px`,
|
|
55
|
+
top: props.position === "top" ? offset : "",
|
|
56
|
+
bottom: props.position === "bottom" ? offset : "",
|
|
57
|
+
transform: transform.value ? `translateY(${transform.value}px)` : "",
|
|
58
|
+
zIndex: props.zIndex
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
const update = () => {
|
|
62
|
+
if (!scrollContainer.value)
|
|
63
|
+
return;
|
|
64
|
+
scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
|
|
65
|
+
if (props.position === "top") {
|
|
66
|
+
if (props.target) {
|
|
67
|
+
const difference = targetRect.bottom.value - props.offset - rootHeight.value;
|
|
68
|
+
fixed.value = props.offset > rootTop.value && targetRect.bottom.value > 0;
|
|
69
|
+
transform.value = difference < 0 ? difference : 0;
|
|
70
|
+
} else {
|
|
71
|
+
fixed.value = props.offset > rootTop.value;
|
|
72
|
+
}
|
|
73
|
+
} else if (props.target) {
|
|
74
|
+
const difference = windowHeight.value - targetRect.top.value - props.offset - rootHeight.value;
|
|
75
|
+
fixed.value = windowHeight.value - props.offset < rootBottom.value && windowHeight.value > targetRect.top.value;
|
|
76
|
+
transform.value = difference < 0 ? -difference : 0;
|
|
77
|
+
} else {
|
|
78
|
+
fixed.value = windowHeight.value - props.offset < rootBottom.value;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const handleScroll = () => {
|
|
82
|
+
updateRoot();
|
|
83
|
+
emit("scroll", {
|
|
84
|
+
scrollTop: scrollTop.value,
|
|
85
|
+
fixed: fixed.value
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
vue.watch(fixed, (val) => emit("change", val));
|
|
89
|
+
vue.onMounted(() => {
|
|
90
|
+
var _a;
|
|
91
|
+
if (props.target) {
|
|
92
|
+
target.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
93
|
+
if (!target.value)
|
|
94
|
+
error.throwError(COMPONENT_NAME, `Target is not existed: ${props.target}`);
|
|
95
|
+
} else {
|
|
96
|
+
target.value = document.documentElement;
|
|
97
|
+
}
|
|
98
|
+
scrollContainer.value = scroll.getScrollContainer(root.value, true);
|
|
99
|
+
updateRoot();
|
|
100
|
+
});
|
|
101
|
+
core.useEventListener(scrollContainer, "scroll", handleScroll);
|
|
102
|
+
vue.watchEffect(update);
|
|
103
|
+
expose({
|
|
104
|
+
update,
|
|
105
|
+
updateRoot
|
|
106
|
+
});
|
|
107
|
+
return (_ctx, _cache) => {
|
|
108
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
109
|
+
ref_key: "root",
|
|
110
|
+
ref: root,
|
|
111
|
+
class: vue.normalizeClass(vue.unref(ns).b()),
|
|
112
|
+
style: vue.normalizeStyle(vue.unref(rootStyle))
|
|
113
|
+
}, [
|
|
114
|
+
vue.createElementVNode("div", {
|
|
115
|
+
class: vue.normalizeClass({ [vue.unref(ns).m("fixed")]: fixed.value }),
|
|
116
|
+
style: vue.normalizeStyle(vue.unref(affixStyle))
|
|
117
|
+
}, [
|
|
118
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
119
|
+
], 6)
|
|
120
|
+
], 6);
|
|
121
|
+
};
|
|
28
122
|
}
|
|
29
123
|
});
|
|
30
|
-
|
|
31
|
-
scroll: ({ scrollTop, fixed }) => types.isNumber(scrollTop) && types.isBoolean(fixed),
|
|
32
|
-
[event.CHANGE_EVENT]: (fixed) => types.isBoolean(fixed)
|
|
33
|
-
};
|
|
124
|
+
var Affix = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "affix.vue"]]);
|
|
34
125
|
|
|
35
|
-
exports
|
|
36
|
-
exports.affixProps = affixProps;
|
|
126
|
+
exports["default"] = Affix;
|
|
37
127
|
//# sourceMappingURL=affix2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.
|
|
1
|
+
{"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.vue"],"sourcesContent":["<template>\n <div ref=\"root\" :class=\"ns.b()\" :style=\"rootStyle\">\n <div :class=\"{ [ns.m('fixed')]: fixed }\" :style=\"affixStyle\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, shallowRef, watch, watchEffect } from 'vue'\nimport {\n useElementBounding,\n useEventListener,\n useWindowSize,\n} from '@vueuse/core'\nimport { addUnit, getScrollContainer, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { affixEmits, affixProps } from './affix'\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElAffix'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(affixProps)\nconst emit = defineEmits(affixEmits)\n\nconst ns = useNamespace('affix')\n\nconst target = shallowRef<HTMLElement>()\nconst root = shallowRef<HTMLDivElement>()\nconst scrollContainer = shallowRef<HTMLElement | Window>()\nconst { height: windowHeight } = useWindowSize()\nconst {\n height: rootHeight,\n width: rootWidth,\n top: rootTop,\n bottom: rootBottom,\n update: updateRoot,\n} = useElementBounding(root, { windowScroll: false })\nconst targetRect = useElementBounding(target)\n\nconst fixed = ref(false)\nconst scrollTop = ref(0)\nconst transform = ref(0)\n\nconst rootStyle = computed<CSSProperties>(() => {\n return {\n height: fixed.value ? `${rootHeight.value}px` : '',\n width: fixed.value ? `${rootWidth.value}px` : '',\n }\n})\n\nconst affixStyle = computed<CSSProperties>(() => {\n if (!fixed.value) return {}\n\n const offset = props.offset ? addUnit(props.offset) : 0\n return {\n height: `${rootHeight.value}px`,\n width: `${rootWidth.value}px`,\n top: props.position === 'top' ? offset : '',\n bottom: props.position === 'bottom' ? offset : '',\n transform: transform.value ? `translateY(${transform.value}px)` : '',\n zIndex: props.zIndex,\n }\n})\n\nconst update = () => {\n if (!scrollContainer.value) return\n\n scrollTop.value =\n scrollContainer.value instanceof Window\n ? document.documentElement.scrollTop\n : scrollContainer.value.scrollTop || 0\n\n if (props.position === 'top') {\n if (props.target) {\n const difference =\n targetRect.bottom.value - props.offset - rootHeight.value\n fixed.value = props.offset > rootTop.value && targetRect.bottom.value > 0\n transform.value = difference < 0 ? difference : 0\n } else {\n fixed.value = props.offset > rootTop.value\n }\n } else if (props.target) {\n const difference =\n windowHeight.value -\n targetRect.top.value -\n props.offset -\n rootHeight.value\n fixed.value =\n windowHeight.value - props.offset < rootBottom.value &&\n windowHeight.value > targetRect.top.value\n transform.value = difference < 0 ? -difference : 0\n } else {\n fixed.value = windowHeight.value - props.offset < rootBottom.value\n }\n}\n\nconst handleScroll = () => {\n updateRoot()\n emit('scroll', {\n scrollTop: scrollTop.value,\n fixed: fixed.value,\n })\n}\n\nwatch(fixed, (val) => emit('change', val))\n\nonMounted(() => {\n if (props.target) {\n target.value =\n document.querySelector<HTMLElement>(props.target) ?? undefined\n if (!target.value)\n throwError(COMPONENT_NAME, `Target is not existed: ${props.target}`)\n } else {\n target.value = document.documentElement\n }\n scrollContainer.value = getScrollContainer(root.value!, true)\n updateRoot()\n})\n\nuseEventListener(scrollContainer, 'scroll', handleScroll)\nwatchEffect(update)\n\ndefineExpose({\n /** @description update affix status */\n update,\n /** @description update rootRect info */\n updateRoot,\n})\n</script>\n"],"names":["useNamespace","shallowRef","useWindowSize","useElementBounding","ref","computed","addUnit","watch","onMounted","throwError","getScrollContainer","useEventListener","watchEffect"],"mappings":";;;;;;;;;;;;;;;;uCAqBc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM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,cAAA,EAAA,CAAA,uBAAA,EAAA,KAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACL,OAAA,MAAA;AAAwB,QAC1B,MAAA,CAAA,KAAA,GAAA,QAAA,CAAA,eAAA,CAAA;AACA,OAAA;AACA,MAAW,eAAA,CAAA,KAAA,GAAAC,yBAAA,CAAA,IAAA,CAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AAAA,MACZ,UAAA,EAAA,CAAA;AAED,KAAiB,CAAA,CAAA;AACjB,IAAAC,qBAAkB,CAAA,eAAA,EAAA,QAAA,EAAA,YAAA,CAAA,CAAA;AAElB,IAAaC,eAAA,CAAA,MAAA,CAAA,CAAA;AAAA,IAEX,MAAA,CAAA;AAAA,MAEA,MAAA;AAAA,MACD,UAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var checkTag$1 = require('./src/check-
|
|
7
|
-
var checkTag = require('./src/check-
|
|
6
|
+
var checkTag$1 = require('./src/check-tag.js');
|
|
7
|
+
var checkTag = require('./src/check-tag2.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElCheckTag = install.withInstall(checkTag$1["default"]);
|
|
@@ -2,28 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
5
|
+
var vue = require('vue');
|
|
6
6
|
require('../../../constants/index.js');
|
|
7
|
-
|
|
8
|
-
var
|
|
7
|
+
require('../../../hooks/index.js');
|
|
8
|
+
var checkTag = require('./check-tag2.js');
|
|
9
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
10
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
9
11
|
var event = require('../../../constants/event.js');
|
|
10
12
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const __default__ = vue.defineComponent({
|
|
14
|
+
name: "ElCheckTag"
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: checkTag.checkTagProps,
|
|
19
|
+
emits: checkTag.checkTagEmits,
|
|
20
|
+
setup(__props, { emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const ns = index.useNamespace("check-tag");
|
|
23
|
+
const containerKls = vue.computed(() => [
|
|
24
|
+
ns.b(),
|
|
25
|
+
ns.is("checked", props.checked),
|
|
26
|
+
ns.m(props.type || "primary")
|
|
27
|
+
]);
|
|
28
|
+
const handleChange = () => {
|
|
29
|
+
const checked = !props.checked;
|
|
30
|
+
emit(event.CHANGE_EVENT, checked);
|
|
31
|
+
emit("update:checked", checked);
|
|
32
|
+
};
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
35
|
+
class: vue.normalizeClass(vue.unref(containerKls)),
|
|
36
|
+
onClick: handleChange
|
|
37
|
+
}, [
|
|
38
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
39
|
+
], 2);
|
|
40
|
+
};
|
|
20
41
|
}
|
|
21
42
|
});
|
|
22
|
-
|
|
23
|
-
"update:checked": (value) => types.isBoolean(value),
|
|
24
|
-
[event.CHANGE_EVENT]: (value) => types.isBoolean(value)
|
|
25
|
-
};
|
|
43
|
+
var CheckTag = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "check-tag.vue"]]);
|
|
26
44
|
|
|
27
|
-
exports
|
|
28
|
-
exports.checkTagProps = checkTagProps;
|
|
45
|
+
exports["default"] = CheckTag;
|
|
29
46
|
//# sourceMappingURL=check-tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-tag.js","sources":["../../../../../../packages/components/check-tag/src/check-tag.
|
|
1
|
+
{"version":3,"file":"check-tag.js","sources":["../../../../../../packages/components/check-tag/src/check-tag.vue"],"sourcesContent":["<template>\n <span :class=\"containerKls\" @click=\"handleChange\">\n <slot />\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport { checkTagEmits, checkTagProps } from './check-tag'\n\ndefineOptions({\n name: 'ElCheckTag',\n})\nconst props = defineProps(checkTagProps)\nconst emit = defineEmits(checkTagEmits)\n\nconst ns = useNamespace('check-tag')\nconst containerKls = computed(() => [\n ns.b(),\n ns.is('checked', props.checked),\n ns.m(props.type || 'primary'),\n])\n\nconst handleChange = () => {\n const checked = !props.checked\n emit(CHANGE_EVENT, checked)\n emit('update:checked', checked)\n}\n</script>\n"],"names":["useNamespace","computed","CHANGE_EVENT"],"mappings":";;;;;;;;;;;;uCAYc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAA,GAAKA,mBAAa,WAAW,CAAA,CAAA;AACnC,IAAM,MAAA,YAAA,GAAeC,aAAS,MAAM;AAAA,MAClC,GAAG,CAAE,EAAA;AAAA,MACL,EAAG,CAAA,EAAA,CAAG,SAAW,EAAA,KAAA,CAAM,OAAO,CAAA;AAAA,MAC9B,EAAG,CAAA,CAAA,CAAE,KAAM,CAAA,IAAA,IAAQ,SAAS,CAAA;AAAA,KAC7B,CAAA,CAAA;AAED,IAAA,MAAM,eAAe,MAAM;AACzB,MAAM,MAAA,OAAA,GAAU,CAAC,KAAM,CAAA,OAAA,CAAA;AACvB,MAAA,IAAA,CAAKC,oBAAc,OAAO,CAAA,CAAA;AAC1B,MAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA,CAAA;AAAA,KAChC,CAAA;;;;;;;;;;;;;;;"}
|
|
@@ -2,45 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('../../../utils/index.js');
|
|
6
6
|
require('../../../constants/index.js');
|
|
7
|
-
require('../../../
|
|
8
|
-
var
|
|
9
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
10
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
7
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
8
|
+
var types = require('../../../utils/types.js');
|
|
11
9
|
var event = require('../../../constants/event.js');
|
|
12
10
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const ns = index.useNamespace("check-tag");
|
|
23
|
-
const containerKls = vue.computed(() => [
|
|
24
|
-
ns.b(),
|
|
25
|
-
ns.is("checked", props.checked),
|
|
26
|
-
ns.m(props.type || "primary")
|
|
27
|
-
]);
|
|
28
|
-
const handleChange = () => {
|
|
29
|
-
const checked = !props.checked;
|
|
30
|
-
emit(event.CHANGE_EVENT, checked);
|
|
31
|
-
emit("update:checked", checked);
|
|
32
|
-
};
|
|
33
|
-
return (_ctx, _cache) => {
|
|
34
|
-
return vue.openBlock(), vue.createElementBlock("span", {
|
|
35
|
-
class: vue.normalizeClass(vue.unref(containerKls)),
|
|
36
|
-
onClick: handleChange
|
|
37
|
-
}, [
|
|
38
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
39
|
-
], 2);
|
|
40
|
-
};
|
|
11
|
+
const checkTagProps = runtime.buildProps({
|
|
12
|
+
checked: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false
|
|
15
|
+
},
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
values: ["primary", "success", "info", "warning", "danger"],
|
|
19
|
+
default: "primary"
|
|
41
20
|
}
|
|
42
21
|
});
|
|
43
|
-
|
|
22
|
+
const checkTagEmits = {
|
|
23
|
+
"update:checked": (value) => types.isBoolean(value),
|
|
24
|
+
[event.CHANGE_EVENT]: (value) => types.isBoolean(value)
|
|
25
|
+
};
|
|
44
26
|
|
|
45
|
-
exports
|
|
27
|
+
exports.checkTagEmits = checkTagEmits;
|
|
28
|
+
exports.checkTagProps = checkTagProps;
|
|
46
29
|
//# sourceMappingURL=check-tag2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-tag2.js","sources":["../../../../../../packages/components/check-tag/src/check-tag.
|
|
1
|
+
{"version":3,"file":"check-tag2.js","sources":["../../../../../../packages/components/check-tag/src/check-tag.ts"],"sourcesContent":["import { buildProps, isBoolean } from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\n\nimport type CheckTag from './check-tag.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const checkTagProps = buildProps({\n /**\n * @description is checked\n */\n checked: {\n type: Boolean,\n default: false,\n },\n /**\n * @description type of Tag\n */\n type: {\n type: String,\n values: ['primary', 'success', 'info', 'warning', 'danger'],\n default: 'primary',\n },\n} as const)\nexport type CheckTagProps = ExtractPropTypes<typeof checkTagProps>\n\nexport const checkTagEmits = {\n 'update:checked': (value: boolean) => isBoolean(value),\n [CHANGE_EVENT]: (value: boolean) => isBoolean(value),\n}\nexport type CheckTagEmits = typeof checkTagEmits\n\nexport type CheckTagInstance = InstanceType<typeof CheckTag>\n"],"names":["buildProps","isBoolean","CHANGE_EVENT"],"mappings":";;;;;;;;;;AAEY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;AAC/D,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,gBAAgB,EAAE,CAAC,KAAK,KAAKC,eAAS,CAAC,KAAK,CAAC;AAC/C,EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,KAAKD,eAAS,CAAC,KAAK,CAAC;AAC7C;;;;;"}
|
package/lib/components/index.js
CHANGED
|
@@ -82,7 +82,7 @@ var index$1b = require('./message/index.js');
|
|
|
82
82
|
var index$1c = require('./message-box/index.js');
|
|
83
83
|
var index$1d = require('./notification/index.js');
|
|
84
84
|
var index$1e = require('./popover/index.js');
|
|
85
|
-
var affix = require('./affix/src/
|
|
85
|
+
var affix = require('./affix/src/affix.js');
|
|
86
86
|
var alert = require('./alert/src/alert.js');
|
|
87
87
|
var autocomplete = require('./autocomplete/src/autocomplete.js');
|
|
88
88
|
var avatar = require('./avatar/src/avatar.js');
|
|
@@ -101,7 +101,7 @@ var constants$2 = require('./carousel/src/constants.js');
|
|
|
101
101
|
var cascader = require('./cascader/src/cascader.js');
|
|
102
102
|
var types = require('./cascader-panel/src/types.js');
|
|
103
103
|
var config = require('./cascader-panel/src/config.js');
|
|
104
|
-
var checkTag = require('./check-tag/src/check-
|
|
104
|
+
var checkTag = require('./check-tag/src/check-tag2.js');
|
|
105
105
|
var checkboxGroup = require('./checkbox/src/checkbox-group.js');
|
|
106
106
|
var checkbox = require('./checkbox/src/checkbox.js');
|
|
107
107
|
var constants$3 = require('./checkbox/src/constants.js');
|
|
@@ -149,9 +149,9 @@ var popconfirm = require('./popconfirm/src/popconfirm.js');
|
|
|
149
149
|
var popper = require('./popper/src/popper.js');
|
|
150
150
|
var trigger$1 = require('./popper/src/trigger.js');
|
|
151
151
|
var content$1 = require('./popper/src/content.js');
|
|
152
|
-
var arrow$1 = require('./popper/src/
|
|
152
|
+
var arrow$1 = require('./popper/src/arrow.js');
|
|
153
153
|
var constants$a = require('./popper/src/constants.js');
|
|
154
|
-
var arrow = require('./popper/src/
|
|
154
|
+
var arrow = require('./popper/src/arrow2.js');
|
|
155
155
|
var trigger = require('./popper/src/trigger2.js');
|
|
156
156
|
var content = require('./popper/src/content2.js');
|
|
157
157
|
var progress = require('./progress/src/progress.js');
|
|
@@ -2,24 +2,223 @@
|
|
|
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');
|
|
11
|
+
var index$1 = require('../../../../hooks/use-locale/index.js');
|
|
7
12
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
pagerCount: {
|
|
18
|
-
type: Number,
|
|
19
|
-
default: 7
|
|
20
|
-
},
|
|
21
|
-
disabled: Boolean
|
|
13
|
+
const _hoisted_1 = ["onKeyup"];
|
|
14
|
+
const _hoisted_2 = ["aria-current", "aria-label", "tabindex"];
|
|
15
|
+
const _hoisted_3 = ["tabindex", "aria-label"];
|
|
16
|
+
const _hoisted_4 = ["aria-current", "aria-label", "tabindex"];
|
|
17
|
+
const _hoisted_5 = ["tabindex", "aria-label"];
|
|
18
|
+
const _hoisted_6 = ["aria-current", "aria-label", "tabindex"];
|
|
19
|
+
const __default__ = vue.defineComponent({
|
|
20
|
+
name: "ElPaginationPager"
|
|
22
21
|
});
|
|
22
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
23
|
+
...__default__,
|
|
24
|
+
props: pager.paginationPagerProps,
|
|
25
|
+
emits: ["change"],
|
|
26
|
+
setup(__props, { emit }) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const nsPager = index.useNamespace("pager");
|
|
29
|
+
const nsIcon = index.useNamespace("icon");
|
|
30
|
+
const { t } = index$1.useLocale();
|
|
31
|
+
const showPrevMore = vue.ref(false);
|
|
32
|
+
const showNextMore = vue.ref(false);
|
|
33
|
+
const quickPrevHover = vue.ref(false);
|
|
34
|
+
const quickNextHover = vue.ref(false);
|
|
35
|
+
const quickPrevFocus = vue.ref(false);
|
|
36
|
+
const quickNextFocus = vue.ref(false);
|
|
37
|
+
const pagers = vue.computed(() => {
|
|
38
|
+
const pagerCount = props.pagerCount;
|
|
39
|
+
const halfPagerCount = (pagerCount - 1) / 2;
|
|
40
|
+
const currentPage = Number(props.currentPage);
|
|
41
|
+
const pageCount = Number(props.pageCount);
|
|
42
|
+
let showPrevMore2 = false;
|
|
43
|
+
let showNextMore2 = false;
|
|
44
|
+
if (pageCount > pagerCount) {
|
|
45
|
+
if (currentPage > pagerCount - halfPagerCount) {
|
|
46
|
+
showPrevMore2 = true;
|
|
47
|
+
}
|
|
48
|
+
if (currentPage < pageCount - halfPagerCount) {
|
|
49
|
+
showNextMore2 = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const array = [];
|
|
53
|
+
if (showPrevMore2 && !showNextMore2) {
|
|
54
|
+
const startPage = pageCount - (pagerCount - 2);
|
|
55
|
+
for (let i = startPage; i < pageCount; i++) {
|
|
56
|
+
array.push(i);
|
|
57
|
+
}
|
|
58
|
+
} else if (!showPrevMore2 && showNextMore2) {
|
|
59
|
+
for (let i = 2; i < pagerCount; i++) {
|
|
60
|
+
array.push(i);
|
|
61
|
+
}
|
|
62
|
+
} else if (showPrevMore2 && showNextMore2) {
|
|
63
|
+
const offset = Math.floor(pagerCount / 2) - 1;
|
|
64
|
+
for (let i = currentPage - offset; i <= currentPage + offset; i++) {
|
|
65
|
+
array.push(i);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
for (let i = 2; i < pageCount; i++) {
|
|
69
|
+
array.push(i);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return array;
|
|
73
|
+
});
|
|
74
|
+
const prevMoreKls = vue.computed(() => [
|
|
75
|
+
"more",
|
|
76
|
+
"btn-quickprev",
|
|
77
|
+
nsIcon.b(),
|
|
78
|
+
nsPager.is("disabled", props.disabled)
|
|
79
|
+
]);
|
|
80
|
+
const nextMoreKls = vue.computed(() => [
|
|
81
|
+
"more",
|
|
82
|
+
"btn-quicknext",
|
|
83
|
+
nsIcon.b(),
|
|
84
|
+
nsPager.is("disabled", props.disabled)
|
|
85
|
+
]);
|
|
86
|
+
const tabindex = vue.computed(() => props.disabled ? -1 : 0);
|
|
87
|
+
vue.watchEffect(() => {
|
|
88
|
+
const halfPagerCount = (props.pagerCount - 1) / 2;
|
|
89
|
+
showPrevMore.value = false;
|
|
90
|
+
showNextMore.value = false;
|
|
91
|
+
if (props.pageCount > props.pagerCount) {
|
|
92
|
+
if (props.currentPage > props.pagerCount - halfPagerCount) {
|
|
93
|
+
showPrevMore.value = true;
|
|
94
|
+
}
|
|
95
|
+
if (props.currentPage < props.pageCount - halfPagerCount) {
|
|
96
|
+
showNextMore.value = true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
function onMouseEnter(forward = false) {
|
|
101
|
+
if (props.disabled)
|
|
102
|
+
return;
|
|
103
|
+
if (forward) {
|
|
104
|
+
quickPrevHover.value = true;
|
|
105
|
+
} else {
|
|
106
|
+
quickNextHover.value = true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function onFocus(forward = false) {
|
|
110
|
+
if (forward) {
|
|
111
|
+
quickPrevFocus.value = true;
|
|
112
|
+
} else {
|
|
113
|
+
quickNextFocus.value = true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function onEnter(e) {
|
|
117
|
+
const target = e.target;
|
|
118
|
+
if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
|
|
119
|
+
const newPage = Number(target.textContent);
|
|
120
|
+
if (newPage !== props.currentPage) {
|
|
121
|
+
emit("change", newPage);
|
|
122
|
+
}
|
|
123
|
+
} else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
|
|
124
|
+
onPagerClick(e);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function onPagerClick(event) {
|
|
128
|
+
const target = event.target;
|
|
129
|
+
if (target.tagName.toLowerCase() === "ul" || props.disabled) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
let newPage = Number(target.textContent);
|
|
133
|
+
const pageCount = props.pageCount;
|
|
134
|
+
const currentPage = props.currentPage;
|
|
135
|
+
const pagerCountOffset = props.pagerCount - 2;
|
|
136
|
+
if (target.className.includes("more")) {
|
|
137
|
+
if (target.className.includes("quickprev")) {
|
|
138
|
+
newPage = currentPage - pagerCountOffset;
|
|
139
|
+
} else if (target.className.includes("quicknext")) {
|
|
140
|
+
newPage = currentPage + pagerCountOffset;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (!Number.isNaN(+newPage)) {
|
|
144
|
+
if (newPage < 1) {
|
|
145
|
+
newPage = 1;
|
|
146
|
+
}
|
|
147
|
+
if (newPage > pageCount) {
|
|
148
|
+
newPage = pageCount;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (newPage !== currentPage) {
|
|
152
|
+
emit("change", newPage);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return (_ctx, _cache) => {
|
|
156
|
+
return vue.openBlock(), vue.createElementBlock("ul", {
|
|
157
|
+
class: vue.normalizeClass(vue.unref(nsPager).b()),
|
|
158
|
+
onClick: onPagerClick,
|
|
159
|
+
onKeyup: vue.withKeys(onEnter, ["enter"])
|
|
160
|
+
}, [
|
|
161
|
+
_ctx.pageCount > 0 ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
162
|
+
key: 0,
|
|
163
|
+
class: vue.normalizeClass([[
|
|
164
|
+
vue.unref(nsPager).is("active", _ctx.currentPage === 1),
|
|
165
|
+
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
166
|
+
], "number"]),
|
|
167
|
+
"aria-current": _ctx.currentPage === 1,
|
|
168
|
+
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager: 1 }),
|
|
169
|
+
tabindex: vue.unref(tabindex)
|
|
170
|
+
}, " 1 ", 10, _hoisted_2)) : vue.createCommentVNode("v-if", true),
|
|
171
|
+
showPrevMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
172
|
+
key: 1,
|
|
173
|
+
class: vue.normalizeClass(vue.unref(prevMoreKls)),
|
|
174
|
+
tabindex: vue.unref(tabindex),
|
|
175
|
+
"aria-label": vue.unref(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }),
|
|
176
|
+
onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
|
|
177
|
+
onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
|
|
178
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
|
|
179
|
+
onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
|
|
180
|
+
}, [
|
|
181
|
+
(quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowLeft), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
|
|
182
|
+
], 42, _hoisted_3)) : vue.createCommentVNode("v-if", true),
|
|
183
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(pagers), (pager) => {
|
|
184
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
185
|
+
key: pager,
|
|
186
|
+
class: vue.normalizeClass([[
|
|
187
|
+
vue.unref(nsPager).is("active", _ctx.currentPage === pager),
|
|
188
|
+
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
189
|
+
], "number"]),
|
|
190
|
+
"aria-current": _ctx.currentPage === pager,
|
|
191
|
+
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager }),
|
|
192
|
+
tabindex: vue.unref(tabindex)
|
|
193
|
+
}, vue.toDisplayString(pager), 11, _hoisted_4);
|
|
194
|
+
}), 128)),
|
|
195
|
+
showNextMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
196
|
+
key: 2,
|
|
197
|
+
class: vue.normalizeClass(vue.unref(nextMoreKls)),
|
|
198
|
+
tabindex: vue.unref(tabindex),
|
|
199
|
+
"aria-label": vue.unref(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }),
|
|
200
|
+
onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
|
|
201
|
+
onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
|
|
202
|
+
onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
|
|
203
|
+
onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
|
|
204
|
+
}, [
|
|
205
|
+
(quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowRight), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
|
|
206
|
+
], 42, _hoisted_5)) : vue.createCommentVNode("v-if", true),
|
|
207
|
+
_ctx.pageCount > 1 ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
208
|
+
key: 3,
|
|
209
|
+
class: vue.normalizeClass([[
|
|
210
|
+
vue.unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
|
|
211
|
+
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
212
|
+
], "number"]),
|
|
213
|
+
"aria-current": _ctx.currentPage === _ctx.pageCount,
|
|
214
|
+
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager: _ctx.pageCount }),
|
|
215
|
+
tabindex: vue.unref(tabindex)
|
|
216
|
+
}, vue.toDisplayString(_ctx.pageCount), 11, _hoisted_6)) : vue.createCommentVNode("v-if", true)
|
|
217
|
+
], 42, _hoisted_1);
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
var Pager = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "pager.vue"]]);
|
|
23
222
|
|
|
24
|
-
exports
|
|
223
|
+
exports["default"] = Pager;
|
|
25
224
|
//# sourceMappingURL=pager.js.map
|