@wfrog/vc-ui 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/chunk/{CCmEeM7D.mjs → B3GxuXVE.mjs} +6 -6
- package/dist/es/chunk/BL8WhaLp.mjs +427 -0
- package/dist/es/chunk/{BiHWk71g.mjs → BPqrpkTb.mjs} +4 -4
- package/dist/es/chunk/{C_7t9blX.mjs → BZ1uhZQF.mjs} +1 -1
- package/dist/es/chunk/{-ga82G_B.mjs → BdVq9mV6.mjs} +1 -1
- package/dist/es/chunk/{DGGhWn1A.mjs → BfjuZmry.mjs} +6 -5
- package/dist/es/chunk/{BLLKi_0v.mjs → Bu3XHP55.mjs} +1 -1
- package/dist/es/chunk/{DEiqPcuO.mjs → BvNFaD5d.mjs} +3 -3
- package/dist/es/chunk/BxibBO68.mjs +5741 -0
- package/dist/es/chunk/{DO-mBaf5.mjs → By7FMB3I.mjs} +1 -43
- package/dist/es/chunk/{DATKTbFj.mjs → CGhekNBa.mjs} +5 -5
- package/dist/es/chunk/{plK2vnjp.mjs → CJ0afvkJ.mjs} +1 -1
- package/dist/es/chunk/{CtYp4FB7.mjs → CK5Bluh4.mjs} +2 -2
- package/dist/es/chunk/{Vv8g5_A1.mjs → CKZGL4_3.mjs} +9 -8
- package/dist/es/chunk/CNEMJL35.mjs +69 -0
- package/dist/es/chunk/{C9ldJ8Hh.mjs → CPCieLBG.mjs} +1 -1
- package/dist/es/chunk/{C50_dziC.mjs → CQz3lhyS.mjs} +2 -1
- package/dist/es/chunk/{Cekqdlxf.mjs → CbYM6R_O.mjs} +12 -77
- package/dist/es/chunk/{CQbpo0im.mjs → CboHfRXN.mjs} +5 -6
- package/dist/es/chunk/{BambM7zX.mjs → Cdh3HNZa.mjs} +2 -2
- package/dist/es/chunk/{aX4SRHmD.mjs → Cg-Krnly.mjs} +2 -1
- package/dist/es/chunk/{9qQNa4bM.mjs → Cjp0Czyu.mjs} +1 -1
- package/dist/es/chunk/Cmb_E8Ip.mjs +184 -0
- package/dist/es/chunk/{BIK5Djc_.mjs → Co77DVCw.mjs} +2 -2
- package/dist/es/chunk/CqTa_Vd-.mjs +375 -0
- package/dist/es/{components/dual-pane/dual-pane.mjs → chunk/CsjEhAYY.mjs} +11 -91
- package/dist/es/chunk/{BQyZW57B.mjs → CwXV7M2F.mjs} +3 -3
- package/dist/es/chunk/{b9dx0jdT.mjs → D1MHFKtN.mjs} +3 -3
- package/dist/es/chunk/{DskGUrkJ.mjs → D6m3vWpc.mjs} +2 -1
- package/dist/es/chunk/{4F1xxyju.mjs → D6nWUATi.mjs} +48 -2117
- package/dist/es/chunk/{C6bIuBQg.mjs → D7CQDxqy.mjs} +3 -3
- package/dist/es/chunk/{Dqk3gyUk.mjs → D9Lr0Bzb.mjs} +1 -374
- package/dist/es/chunk/{Xk5kfdyT.mjs → DAIuzoFs.mjs} +2 -1
- package/dist/es/chunk/{OVbHCQoq.mjs → DCS0eqqM.mjs} +3 -101
- package/dist/es/chunk/{BJTCqgn1.mjs → DDR6UjaC.mjs} +1 -1
- package/dist/es/chunk/{BKmk2ptO.mjs → DNsAO9iB.mjs} +2 -2
- package/dist/es/chunk/{-_x5oKYF.mjs → DQK0ezHm.mjs} +5 -4
- package/dist/es/chunk/{BQHHM_Gw.mjs → DQi1QPak.mjs} +30 -70
- package/dist/es/chunk/{BaqDgAvL.mjs → DSt2uDNE.mjs} +22 -434
- package/dist/es/chunk/DSw4GnC6.mjs +44 -0
- package/dist/es/chunk/DTbnchOm.mjs +94 -0
- package/dist/es/chunk/DViraU6I.mjs +45 -0
- package/dist/es/chunk/{C540ZOUa.mjs → DX84QR5M.mjs} +10 -9
- package/dist/es/chunk/DYKOYbzT.mjs +2003 -0
- package/dist/es/chunk/{D1PKXAql.mjs → D_F7nIja.mjs} +3 -4
- package/dist/es/chunk/{DcTh6n4x.mjs → D_Mvdscy.mjs} +5 -4
- package/dist/es/chunk/DhGOsWxx.mjs +6 -0
- package/dist/es/chunk/{DFxeI_lP.mjs → DhGcJR5p.mjs} +6 -6
- package/dist/es/chunk/DxxbB5jY.mjs +34 -0
- package/dist/es/chunk/EMeQxUfH.mjs +49 -0
- package/dist/es/chunk/{eN6VJ63C.mjs → F2ph6lWu.mjs} +9 -8
- package/dist/es/chunk/{Dn-BFXcJ.mjs → dN0VcQc2.mjs} +1 -1
- package/dist/es/chunk/{DTpr71Gd.mjs → e5i7OJY-.mjs} +4 -4
- package/dist/es/chunk/fueZ9sVu.mjs +890 -0
- package/dist/es/chunk/{CV2NA_2e.mjs → ipA7n6-J.mjs} +1 -1
- package/dist/es/chunk/{Dw-yyl2m.mjs → q2jRgbir.mjs} +2 -2
- package/dist/es/chunk/{C72pWnuz.mjs → w7VqVeWU.mjs} +5 -4
- package/dist/es/chunk/{DWcIzeMM.mjs → ytiKcA3H.mjs} +108 -10
- package/dist/es/chunk/{DFHjl3eL.mjs → yuIXvUxc.mjs} +1 -1
- package/dist/es/components/backbottom/backbottom.mjs +2 -2
- package/dist/es/components/button/button.d.ts +2 -1
- package/dist/es/components/button/button.mjs +68 -17
- package/dist/es/components/button/button.vue.d.ts +4 -1
- package/dist/es/components/choice/choice.mjs +3 -2
- package/dist/es/components/color-switcher/color-switcher.d.ts +15 -0
- package/dist/es/components/color-switcher/color-switcher.mjs +1215 -0
- package/dist/es/components/color-switcher/color-switcher.vue.d.ts +122 -0
- package/dist/es/components/color-switcher/index.css +5 -0
- package/dist/es/components/color-switcher/index.d.ts +4 -0
- package/dist/es/components/color-switcher/index.mjs +6 -0
- package/dist/es/components/cropper/cropper.mjs +12 -11
- package/dist/es/components/cropper/cropper.vue.d.ts +2 -2
- package/dist/es/components/currency/currency.mjs +7 -7
- package/dist/es/components/dark-switcher/dark-switcher.d.ts +10 -0
- package/dist/es/components/dark-switcher/dark-switcher.mjs +87 -0
- package/dist/es/components/dark-switcher/dark-switcher.vue.d.ts +12 -0
- package/dist/es/components/dark-switcher/index.css +11 -0
- package/dist/es/components/dark-switcher/index.d.ts +4 -0
- package/dist/es/components/dark-switcher/index.mjs +6 -0
- package/dist/es/components/daterange-picker/daterange-picker.mjs +21 -20
- package/dist/es/components/dialog/dialog.d.ts +1 -1
- package/dist/es/components/dialog/dialog.mjs +46 -61
- package/dist/es/components/dialog/dialog.vue.d.ts +1 -3
- package/dist/es/components/dialog/index.css +31 -32
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +12 -12
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +5 -5
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +14 -13
- package/dist/es/components/drag-verify/drag-verify.mjs +14 -14
- package/dist/es/components/drag-verify/index.css +11 -11
- package/dist/es/components/drawer/drawer.mjs +14 -14
- package/dist/es/components/drawer/index.css +16 -15
- package/dist/es/components/easy-pagination/easy-pagination.mjs +4 -4
- package/dist/es/components/el-icon/el-icon.mjs +2 -2
- package/dist/es/components/explorer/docs/data.d.ts +13 -0
- package/dist/es/components/explorer/explorer.d.ts +12 -0
- package/dist/es/components/explorer/explorer.mjs +64 -0
- package/dist/es/components/explorer/explorer.vue.d.ts +183 -0
- package/dist/es/components/explorer/explorer2.mjs +6 -0
- package/dist/es/components/explorer/index.css +14 -0
- package/dist/es/components/explorer/index.d.ts +4 -0
- package/dist/es/components/explorer/index.mjs +6 -0
- package/dist/es/components/explorer-column-table/explorer-column-table.d.ts +23 -0
- package/dist/es/components/explorer-column-table/explorer-column-table.mjs +2948 -0
- package/dist/es/components/explorer-column-table/explorer-column-table.vue.d.ts +1486 -0
- package/dist/es/components/explorer-column-table/index.css +49 -0
- package/dist/es/components/explorer-column-table/index.d.ts +4 -0
- package/dist/es/components/explorer-column-table/index.mjs +6 -0
- package/dist/es/components/explorer-filter/explorer-filter.d.ts +12 -0
- package/dist/es/components/explorer-filter/explorer-filter.mjs +81 -0
- package/dist/es/components/explorer-filter/explorer-filter.vue.d.ts +14 -0
- package/dist/es/components/explorer-filter/index.css +7 -0
- package/dist/es/components/explorer-filter/index.d.ts +4 -0
- package/dist/es/components/explorer-filter/index.mjs +6 -0
- package/dist/es/components/explorer-footer/explorer-footer.d.ts +5 -0
- package/dist/es/components/explorer-footer/explorer-footer.mjs +92 -0
- package/dist/es/components/explorer-footer/explorer-footer.vue.d.ts +21 -0
- package/dist/es/components/explorer-footer/index.css +7 -0
- package/dist/es/components/explorer-footer/index.d.ts +4 -0
- package/dist/es/components/explorer-footer/index.mjs +6 -0
- package/dist/es/components/explorer-list/explorer-list.d.ts +23 -0
- package/dist/es/components/explorer-list/explorer-list.mjs +157 -0
- package/dist/es/components/explorer-list/explorer-list.vue.d.ts +38 -0
- package/dist/es/components/explorer-list/index.css +47 -0
- package/dist/es/components/explorer-list/index.d.ts +4 -0
- package/dist/es/components/explorer-list/index.mjs +6 -0
- package/dist/es/components/explorer-panel/explorer-panel.d.ts +14 -0
- package/dist/es/components/explorer-panel/explorer-panel.mjs +77 -0
- package/dist/es/components/explorer-panel/explorer-panel.vue.d.ts +253 -0
- package/dist/es/components/explorer-panel/explorer-panel2.mjs +6 -0
- package/dist/es/components/explorer-panel/index.css +12 -0
- package/dist/es/components/explorer-panel/index.d.ts +4 -0
- package/dist/es/components/explorer-panel/index.mjs +6 -0
- package/dist/es/components/explorer-query/explorer-query.d.ts +11 -0
- package/dist/es/components/explorer-query/explorer-query.mjs +2376 -0
- package/dist/es/components/explorer-query/explorer-query.vue.d.ts +396 -0
- package/dist/es/components/explorer-query/index.css +36 -0
- package/dist/es/components/explorer-query/index.d.ts +4 -0
- package/dist/es/components/explorer-query/index.mjs +6 -0
- package/dist/es/components/explorer-table/explorer-table.d.ts +11 -0
- package/dist/es/components/explorer-table/explorer-table.mjs +116 -0
- package/dist/es/components/explorer-table/explorer-table.vue.d.ts +25 -0
- package/dist/es/components/explorer-table/index.css +18 -0
- package/dist/es/components/explorer-table/index.d.ts +4 -0
- package/dist/es/components/explorer-table/index.mjs +6 -0
- package/dist/es/components/explorer-tools/components/column-setter.vue.d.ts +3028 -0
- package/dist/es/components/explorer-tools/explorer-tools.d.ts +35 -0
- package/dist/es/components/explorer-tools/explorer-tools.mjs +585 -0
- package/dist/es/components/explorer-tools/explorer-tools.vue.d.ts +43 -0
- package/dist/es/components/explorer-tools/index.css +60 -0
- package/dist/es/components/explorer-tools/index.d.ts +4 -0
- package/dist/es/components/explorer-tools/index.mjs +6 -0
- package/dist/es/components/explorer-tree/explorer-tree.d.ts +22 -0
- package/dist/es/components/explorer-tree/explorer-tree.mjs +174 -0
- package/dist/es/components/explorer-tree/explorer-tree.vue.d.ts +2055 -0
- package/dist/es/components/explorer-tree/index.css +55 -0
- package/dist/es/components/explorer-tree/index.d.ts +4 -0
- package/dist/es/components/explorer-tree/index.mjs +6 -0
- package/dist/es/components/icon/icon2.mjs +2 -2
- package/dist/es/components/icon-picker/components/collections.vue.d.ts +242 -196
- package/dist/es/components/icon-picker/icon-picker.mjs +38 -921
- package/dist/es/components/icon-picker/index.css +31 -29
- package/dist/es/components/iconify-icon/iconify-icon.mjs +2 -2
- package/dist/es/components/image/image.mjs +5 -5
- package/dist/es/components/image/image.vue.d.ts +7 -7
- package/dist/es/components/input/index.css +4 -5
- package/dist/es/components/input/input.mjs +7 -7
- package/dist/es/components/input/input.vue.d.ts +3 -3
- package/dist/es/components/input-number/input-number.mjs +5 -5
- package/dist/es/components/pca-picker/components/c.vue.d.ts +3 -3
- package/dist/es/components/pca-picker/index.css +4 -4
- package/dist/es/components/pca-picker/pca-picker.mjs +21 -209
- package/dist/es/components/pca-picker/pca-picker.vue.d.ts +10 -10
- package/dist/es/components/screenfull/screenfull.mjs +4 -4
- package/dist/es/components/scrollbar/index.css +6 -5
- package/dist/es/components/scrollbar/scrollbar.d.ts +2 -0
- package/dist/es/components/scrollbar/scrollbar.mjs +17 -12
- package/dist/es/components/scrollbar/scrollbar.vue.d.ts +156 -134
- package/dist/es/components/select/select.mjs +7 -7
- package/dist/es/components/single-player/index.css +11 -11
- package/dist/es/components/single-player/single-player.mjs +20 -19
- package/dist/es/components/splitter/index.d.ts +4 -0
- package/dist/es/components/splitter/index.mjs +6 -0
- package/dist/es/components/splitter/splitter.d.ts +4 -0
- package/dist/es/components/splitter/splitter.mjs +28 -0
- package/dist/es/components/{dual-pane/dual-pane.vue.d.ts → splitter/splitter.vue.d.ts} +3 -5
- package/dist/es/components/splitter-panel/index.css +5 -0
- package/dist/es/components/splitter-panel/index.d.ts +4 -0
- package/dist/es/components/splitter-panel/index.mjs +6 -0
- package/dist/es/components/splitter-panel/splitter-panel.d.ts +3 -0
- package/dist/es/components/splitter-panel/splitter-panel.mjs +49 -0
- package/dist/es/components/splitter-panel/splitter-panel.vue.d.ts +20 -0
- package/dist/es/components/svg-icon/svg-icon.mjs +2 -2
- package/dist/es/components/switch/switch.mjs +2 -2
- package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +2 -2
- package/dist/es/components/tags/tags.mjs +12 -11
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +4 -4
- package/dist/es/components/text-ellipsis/text-ellipsis.vue.d.ts +1 -1
- package/dist/es/components/thousand-input/thousand-input.mjs +3 -3
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +8 -8
- package/dist/es/components/tinymce/index.css +1 -1
- package/dist/es/components/tinymce/tinymce.d.ts +1 -0
- package/dist/es/components/tinymce/tinymce.mjs +20 -11
- package/dist/es/components/tinymce/tinymce.vue.d.ts +1 -0
- package/dist/es/components/tree-picker/popover-cascader.css +1 -1
- package/dist/es/components/tree-picker/tree-picker.mjs +11 -10
- package/dist/es/components/tree-picker/tree-picker.vue.d.ts +10 -10
- package/dist/es/components/upload-file/upload-file.mjs +2 -2
- package/dist/es/index.d.ts +14 -1
- package/dist/es/index.mjs +69 -39
- package/dist/es/use/usePersistentModel/index.d.ts +4 -0
- package/dist/es/use/usePersistentModel/index.mjs +19 -0
- package/dist/global.d.ts +14 -1
- package/dist/index.css +450 -123
- package/package.json +4 -1
- package/dist/es/chunk/DVNTpOBR.mjs +0 -4
- package/dist/es/components/dual-pane/dual-pane.d.ts +0 -8
- package/dist/es/components/dual-pane/index.css +0 -8
- package/dist/es/components/dual-pane/index.d.ts +0 -4
- package/dist/es/components/dual-pane/index.mjs +0 -6
|
@@ -0,0 +1,890 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, unref, createBlock, toDisplayString, withCtx, resolveDynamicComponent, inject, ref, watch, normalizeClass, createVNode, Fragment, renderList, createElementVNode, withKeys, createCommentVNode, getCurrentInstance, provide, h } from 'vue';
|
|
2
|
+
import { DArrowLeft, MoreFilled, DArrowRight, ArrowRight, ArrowLeft } from '@element-plus/icons-vue';
|
|
3
|
+
import { E as ElIcon } from './D1MHFKtN.mjs';
|
|
4
|
+
import { b as buildProps, d as definePropType, u as useNamespace, c as isArray, a as debugWarn } from './By7FMB3I.mjs';
|
|
5
|
+
import { i as iconPropType } from '../components/icon/icon2.mjs';
|
|
6
|
+
import { _ as _export_sfc, w as withInstall } from './dN0VcQc2.mjs';
|
|
7
|
+
import { u as useLocale } from './CJ0afvkJ.mjs';
|
|
8
|
+
import { E as ElSelect, a as ElOption } from './DQi1QPak.mjs';
|
|
9
|
+
import { m as mutable } from './B-rxnVJv.mjs';
|
|
10
|
+
import { c as componentSizes, a as useGlobalSize, u as useSizeProp } from './CPCieLBG.mjs';
|
|
11
|
+
import { i as isEqual } from './q2jRgbir.mjs';
|
|
12
|
+
import { E as ElInput } from './CKZGL4_3.mjs';
|
|
13
|
+
import { C as CHANGE_EVENT } from './Ct6q2FXg.mjs';
|
|
14
|
+
import { u as useDeprecated } from './yuIXvUxc.mjs';
|
|
15
|
+
import { b as isNumber } from './DViraU6I.mjs';
|
|
16
|
+
|
|
17
|
+
const elPaginationKey = Symbol("elPaginationKey");
|
|
18
|
+
|
|
19
|
+
const paginationPrevProps = buildProps({
|
|
20
|
+
disabled: Boolean,
|
|
21
|
+
currentPage: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 1
|
|
24
|
+
},
|
|
25
|
+
prevText: {
|
|
26
|
+
type: String
|
|
27
|
+
},
|
|
28
|
+
prevIcon: {
|
|
29
|
+
type: iconPropType
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const paginationPrevEmits = {
|
|
33
|
+
click: (evt) => evt instanceof MouseEvent
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const _hoisted_1$4 = ["disabled", "aria-label", "aria-disabled"];
|
|
37
|
+
const _hoisted_2$2 = { key: 0 };
|
|
38
|
+
const _sfc_main$5 = defineComponent({
|
|
39
|
+
...{
|
|
40
|
+
name: "ElPaginationPrev"
|
|
41
|
+
},
|
|
42
|
+
__name: "prev",
|
|
43
|
+
props: paginationPrevProps,
|
|
44
|
+
emits: paginationPrevEmits,
|
|
45
|
+
setup(__props) {
|
|
46
|
+
const props = __props;
|
|
47
|
+
const { t } = useLocale();
|
|
48
|
+
const internalDisabled = computed(
|
|
49
|
+
() => props.disabled || props.currentPage <= 1
|
|
50
|
+
);
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return openBlock(), createElementBlock("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
class: "btn-prev",
|
|
55
|
+
disabled: internalDisabled.value,
|
|
56
|
+
"aria-label": _ctx.prevText || unref(t)("el.pagination.prev"),
|
|
57
|
+
"aria-disabled": internalDisabled.value,
|
|
58
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
|
|
59
|
+
}, [
|
|
60
|
+
_ctx.prevText ? (openBlock(), createElementBlock(
|
|
61
|
+
"span",
|
|
62
|
+
_hoisted_2$2,
|
|
63
|
+
toDisplayString(_ctx.prevText),
|
|
64
|
+
1
|
|
65
|
+
)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
66
|
+
default: withCtx(() => [
|
|
67
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon)))
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
}))
|
|
71
|
+
], 8, _hoisted_1$4);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
var Prev = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/prev.vue"]]);
|
|
76
|
+
|
|
77
|
+
const paginationNextProps = buildProps({
|
|
78
|
+
disabled: Boolean,
|
|
79
|
+
currentPage: {
|
|
80
|
+
type: Number,
|
|
81
|
+
default: 1
|
|
82
|
+
},
|
|
83
|
+
pageCount: {
|
|
84
|
+
type: Number,
|
|
85
|
+
default: 50
|
|
86
|
+
},
|
|
87
|
+
nextText: {
|
|
88
|
+
type: String
|
|
89
|
+
},
|
|
90
|
+
nextIcon: {
|
|
91
|
+
type: iconPropType
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const _hoisted_1$3 = ["disabled", "aria-label", "aria-disabled"];
|
|
96
|
+
const _hoisted_2$1 = { key: 0 };
|
|
97
|
+
const _sfc_main$4 = defineComponent({
|
|
98
|
+
...{
|
|
99
|
+
name: "ElPaginationNext"
|
|
100
|
+
},
|
|
101
|
+
__name: "next",
|
|
102
|
+
props: paginationNextProps,
|
|
103
|
+
emits: ["click"],
|
|
104
|
+
setup(__props) {
|
|
105
|
+
const props = __props;
|
|
106
|
+
const { t } = useLocale();
|
|
107
|
+
const internalDisabled = computed(
|
|
108
|
+
() => props.disabled || props.currentPage === props.pageCount || props.pageCount === 0
|
|
109
|
+
);
|
|
110
|
+
return (_ctx, _cache) => {
|
|
111
|
+
return openBlock(), createElementBlock("button", {
|
|
112
|
+
type: "button",
|
|
113
|
+
class: "btn-next",
|
|
114
|
+
disabled: internalDisabled.value,
|
|
115
|
+
"aria-label": _ctx.nextText || unref(t)("el.pagination.next"),
|
|
116
|
+
"aria-disabled": internalDisabled.value,
|
|
117
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
|
|
118
|
+
}, [
|
|
119
|
+
_ctx.nextText ? (openBlock(), createElementBlock(
|
|
120
|
+
"span",
|
|
121
|
+
_hoisted_2$1,
|
|
122
|
+
toDisplayString(_ctx.nextText),
|
|
123
|
+
1
|
|
124
|
+
)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
125
|
+
default: withCtx(() => [
|
|
126
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon)))
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
}))
|
|
130
|
+
], 8, _hoisted_1$3);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
var Next = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/next.vue"]]);
|
|
135
|
+
|
|
136
|
+
const usePagination = () => inject(elPaginationKey, {});
|
|
137
|
+
|
|
138
|
+
const paginationSizesProps = buildProps({
|
|
139
|
+
pageSize: {
|
|
140
|
+
type: Number,
|
|
141
|
+
required: true
|
|
142
|
+
},
|
|
143
|
+
pageSizes: {
|
|
144
|
+
type: definePropType(Array),
|
|
145
|
+
default: () => mutable([10, 20, 30, 40, 50, 100])
|
|
146
|
+
},
|
|
147
|
+
popperClass: {
|
|
148
|
+
type: String
|
|
149
|
+
},
|
|
150
|
+
popperStyle: {
|
|
151
|
+
type: definePropType([String, Object])
|
|
152
|
+
},
|
|
153
|
+
disabled: Boolean,
|
|
154
|
+
teleported: Boolean,
|
|
155
|
+
size: {
|
|
156
|
+
type: String,
|
|
157
|
+
values: componentSizes
|
|
158
|
+
},
|
|
159
|
+
appendSizeTo: String
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const _sfc_main$3 = defineComponent({
|
|
163
|
+
...{
|
|
164
|
+
name: "ElPaginationSizes"
|
|
165
|
+
},
|
|
166
|
+
__name: "sizes",
|
|
167
|
+
props: paginationSizesProps,
|
|
168
|
+
emits: ["page-size-change"],
|
|
169
|
+
setup(__props, { emit: __emit }) {
|
|
170
|
+
const props = __props;
|
|
171
|
+
const emit = __emit;
|
|
172
|
+
const { t } = useLocale();
|
|
173
|
+
const ns = useNamespace("pagination");
|
|
174
|
+
const pagination = usePagination();
|
|
175
|
+
const innerPageSize = ref(props.pageSize);
|
|
176
|
+
watch(
|
|
177
|
+
() => props.pageSizes,
|
|
178
|
+
(newVal, oldVal) => {
|
|
179
|
+
if (isEqual(newVal, oldVal))
|
|
180
|
+
return;
|
|
181
|
+
if (isArray(newVal)) {
|
|
182
|
+
const pageSize = newVal.includes(props.pageSize) ? props.pageSize : props.pageSizes[0];
|
|
183
|
+
emit("page-size-change", pageSize);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
watch(
|
|
188
|
+
() => props.pageSize,
|
|
189
|
+
(newVal) => {
|
|
190
|
+
innerPageSize.value = newVal;
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
const innerPageSizes = computed(() => props.pageSizes);
|
|
194
|
+
function handleChange(val) {
|
|
195
|
+
var _a;
|
|
196
|
+
if (val !== innerPageSize.value) {
|
|
197
|
+
innerPageSize.value = val;
|
|
198
|
+
(_a = pagination.handleSizeChange) == null ? void 0 : _a.call(pagination, Number(val));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return (_ctx, _cache) => {
|
|
202
|
+
return openBlock(), createElementBlock(
|
|
203
|
+
"span",
|
|
204
|
+
{
|
|
205
|
+
class: normalizeClass(unref(ns).e("sizes"))
|
|
206
|
+
},
|
|
207
|
+
[
|
|
208
|
+
createVNode(unref(ElSelect), {
|
|
209
|
+
"model-value": innerPageSize.value,
|
|
210
|
+
disabled: _ctx.disabled,
|
|
211
|
+
"popper-class": _ctx.popperClass,
|
|
212
|
+
"popper-style": _ctx.popperStyle,
|
|
213
|
+
size: _ctx.size,
|
|
214
|
+
teleported: _ctx.teleported,
|
|
215
|
+
"validate-event": false,
|
|
216
|
+
"append-to": _ctx.appendSizeTo,
|
|
217
|
+
onChange: handleChange
|
|
218
|
+
}, {
|
|
219
|
+
default: withCtx(() => [
|
|
220
|
+
(openBlock(true), createElementBlock(
|
|
221
|
+
Fragment,
|
|
222
|
+
null,
|
|
223
|
+
renderList(innerPageSizes.value, (item) => {
|
|
224
|
+
return openBlock(), createBlock(unref(ElOption), {
|
|
225
|
+
key: item,
|
|
226
|
+
value: item,
|
|
227
|
+
label: item + unref(t)("el.pagination.pagesize")
|
|
228
|
+
}, null, 8, ["value", "label"]);
|
|
229
|
+
}),
|
|
230
|
+
128
|
|
231
|
+
))
|
|
232
|
+
]),
|
|
233
|
+
_: 1
|
|
234
|
+
}, 8, ["model-value", "disabled", "popper-class", "popper-style", "size", "teleported", "append-to"])
|
|
235
|
+
],
|
|
236
|
+
2
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
var Sizes = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/sizes.vue"]]);
|
|
242
|
+
|
|
243
|
+
const paginationJumperProps = buildProps({
|
|
244
|
+
size: {
|
|
245
|
+
type: String,
|
|
246
|
+
values: componentSizes
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const _hoisted_1$2 = ["disabled"];
|
|
251
|
+
const _sfc_main$2 = defineComponent({
|
|
252
|
+
...{
|
|
253
|
+
name: "ElPaginationJumper"
|
|
254
|
+
},
|
|
255
|
+
__name: "jumper",
|
|
256
|
+
props: paginationJumperProps,
|
|
257
|
+
setup(__props) {
|
|
258
|
+
const { t } = useLocale();
|
|
259
|
+
const ns = useNamespace("pagination");
|
|
260
|
+
const { pageCount, disabled, currentPage, changeEvent } = usePagination();
|
|
261
|
+
const userInput = ref();
|
|
262
|
+
const innerValue = computed(() => {
|
|
263
|
+
var _a;
|
|
264
|
+
return (_a = userInput.value) != null ? _a : currentPage == null ? void 0 : currentPage.value;
|
|
265
|
+
});
|
|
266
|
+
function handleInput(val) {
|
|
267
|
+
userInput.value = val ? +val : "";
|
|
268
|
+
}
|
|
269
|
+
function handleChange(val) {
|
|
270
|
+
val = Math.trunc(+val);
|
|
271
|
+
changeEvent == null ? void 0 : changeEvent(val);
|
|
272
|
+
userInput.value = void 0;
|
|
273
|
+
}
|
|
274
|
+
return (_ctx, _cache) => {
|
|
275
|
+
return openBlock(), createElementBlock("span", {
|
|
276
|
+
class: normalizeClass(unref(ns).e("jump")),
|
|
277
|
+
disabled: unref(disabled)
|
|
278
|
+
}, [
|
|
279
|
+
createElementVNode(
|
|
280
|
+
"span",
|
|
281
|
+
{
|
|
282
|
+
class: normalizeClass([unref(ns).e("goto")])
|
|
283
|
+
},
|
|
284
|
+
toDisplayString(unref(t)("el.pagination.goto")),
|
|
285
|
+
3
|
|
286
|
+
),
|
|
287
|
+
createVNode(unref(ElInput), {
|
|
288
|
+
size: _ctx.size,
|
|
289
|
+
class: normalizeClass([unref(ns).e("editor"), unref(ns).is("in-pagination")]),
|
|
290
|
+
min: 1,
|
|
291
|
+
max: unref(pageCount),
|
|
292
|
+
disabled: unref(disabled),
|
|
293
|
+
"model-value": innerValue.value,
|
|
294
|
+
"validate-event": false,
|
|
295
|
+
"aria-label": unref(t)("el.pagination.page"),
|
|
296
|
+
type: "number",
|
|
297
|
+
"onUpdate:modelValue": handleInput,
|
|
298
|
+
onChange: handleChange
|
|
299
|
+
}, null, 8, ["size", "class", "max", "disabled", "model-value", "aria-label"]),
|
|
300
|
+
createElementVNode(
|
|
301
|
+
"span",
|
|
302
|
+
{
|
|
303
|
+
class: normalizeClass([unref(ns).e("classifier")])
|
|
304
|
+
},
|
|
305
|
+
toDisplayString(unref(t)("el.pagination.pageClassifier")),
|
|
306
|
+
3
|
|
307
|
+
)
|
|
308
|
+
], 10, _hoisted_1$2);
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
var Jumper = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/jumper.vue"]]);
|
|
313
|
+
|
|
314
|
+
const paginationTotalProps = buildProps({
|
|
315
|
+
total: {
|
|
316
|
+
type: Number,
|
|
317
|
+
default: 1e3
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
const _hoisted_1$1 = ["disabled"];
|
|
322
|
+
const _sfc_main$1 = defineComponent({
|
|
323
|
+
...{
|
|
324
|
+
name: "ElPaginationTotal"
|
|
325
|
+
},
|
|
326
|
+
__name: "total",
|
|
327
|
+
props: paginationTotalProps,
|
|
328
|
+
setup(__props) {
|
|
329
|
+
const { t } = useLocale();
|
|
330
|
+
const ns = useNamespace("pagination");
|
|
331
|
+
const { disabled } = usePagination();
|
|
332
|
+
return (_ctx, _cache) => {
|
|
333
|
+
return openBlock(), createElementBlock("span", {
|
|
334
|
+
class: normalizeClass(unref(ns).e("total")),
|
|
335
|
+
disabled: unref(disabled)
|
|
336
|
+
}, toDisplayString(unref(t)("el.pagination.total", {
|
|
337
|
+
total: _ctx.total
|
|
338
|
+
})), 11, _hoisted_1$1);
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
var Total = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/total.vue"]]);
|
|
343
|
+
|
|
344
|
+
const paginationPagerProps = buildProps({
|
|
345
|
+
currentPage: {
|
|
346
|
+
type: Number,
|
|
347
|
+
default: 1
|
|
348
|
+
},
|
|
349
|
+
pageCount: {
|
|
350
|
+
type: Number,
|
|
351
|
+
required: true
|
|
352
|
+
},
|
|
353
|
+
pagerCount: {
|
|
354
|
+
type: Number,
|
|
355
|
+
default: 7
|
|
356
|
+
},
|
|
357
|
+
disabled: Boolean
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
const _hoisted_1 = ["aria-current", "aria-label", "tabindex"];
|
|
361
|
+
const _hoisted_2 = ["tabindex", "aria-label"];
|
|
362
|
+
const _hoisted_3 = ["aria-current", "aria-label", "tabindex"];
|
|
363
|
+
const _hoisted_4 = ["tabindex", "aria-label"];
|
|
364
|
+
const _hoisted_5 = ["aria-current", "aria-label", "tabindex"];
|
|
365
|
+
const _sfc_main = defineComponent({
|
|
366
|
+
...{
|
|
367
|
+
name: "ElPaginationPager"
|
|
368
|
+
},
|
|
369
|
+
__name: "pager",
|
|
370
|
+
props: paginationPagerProps,
|
|
371
|
+
emits: [CHANGE_EVENT],
|
|
372
|
+
setup(__props, { emit: __emit }) {
|
|
373
|
+
const props = __props;
|
|
374
|
+
const emit = __emit;
|
|
375
|
+
const nsPager = useNamespace("pager");
|
|
376
|
+
const nsIcon = useNamespace("icon");
|
|
377
|
+
const { t } = useLocale();
|
|
378
|
+
const showPrevMore = ref(false);
|
|
379
|
+
const showNextMore = ref(false);
|
|
380
|
+
const quickPrevHover = ref(false);
|
|
381
|
+
const quickNextHover = ref(false);
|
|
382
|
+
const quickPrevFocus = ref(false);
|
|
383
|
+
const quickNextFocus = ref(false);
|
|
384
|
+
const pagers = computed(() => {
|
|
385
|
+
const pagerCount = props.pagerCount;
|
|
386
|
+
const halfPagerCount = (pagerCount - 1) / 2;
|
|
387
|
+
const currentPage = Number(props.currentPage);
|
|
388
|
+
const pageCount = Number(props.pageCount);
|
|
389
|
+
let showPrevMore2 = false;
|
|
390
|
+
let showNextMore2 = false;
|
|
391
|
+
if (pageCount > pagerCount) {
|
|
392
|
+
if (currentPage > pagerCount - halfPagerCount) {
|
|
393
|
+
showPrevMore2 = true;
|
|
394
|
+
}
|
|
395
|
+
if (currentPage < pageCount - halfPagerCount) {
|
|
396
|
+
showNextMore2 = true;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
const array = [];
|
|
400
|
+
if (showPrevMore2 && !showNextMore2) {
|
|
401
|
+
const startPage = pageCount - (pagerCount - 2);
|
|
402
|
+
for (let i = startPage; i < pageCount; i++) {
|
|
403
|
+
array.push(i);
|
|
404
|
+
}
|
|
405
|
+
} else if (!showPrevMore2 && showNextMore2) {
|
|
406
|
+
for (let i = 2; i < pagerCount; i++) {
|
|
407
|
+
array.push(i);
|
|
408
|
+
}
|
|
409
|
+
} else if (showPrevMore2 && showNextMore2) {
|
|
410
|
+
const offset = Math.floor(pagerCount / 2) - 1;
|
|
411
|
+
for (let i = currentPage - offset; i <= currentPage + offset; i++) {
|
|
412
|
+
array.push(i);
|
|
413
|
+
}
|
|
414
|
+
} else {
|
|
415
|
+
for (let i = 2; i < pageCount; i++) {
|
|
416
|
+
array.push(i);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return array;
|
|
420
|
+
});
|
|
421
|
+
const prevMoreKls = computed(() => [
|
|
422
|
+
"more",
|
|
423
|
+
"btn-quickprev",
|
|
424
|
+
nsIcon.b(),
|
|
425
|
+
nsPager.is("disabled", props.disabled)
|
|
426
|
+
]);
|
|
427
|
+
const nextMoreKls = computed(() => [
|
|
428
|
+
"more",
|
|
429
|
+
"btn-quicknext",
|
|
430
|
+
nsIcon.b(),
|
|
431
|
+
nsPager.is("disabled", props.disabled)
|
|
432
|
+
]);
|
|
433
|
+
const tabindex = computed(() => props.disabled ? -1 : 0);
|
|
434
|
+
watch(
|
|
435
|
+
() => [props.pageCount, props.pagerCount, props.currentPage],
|
|
436
|
+
([pageCount, pagerCount, currentPage]) => {
|
|
437
|
+
const halfPagerCount = (pagerCount - 1) / 2;
|
|
438
|
+
let showPrev = false;
|
|
439
|
+
let showNext = false;
|
|
440
|
+
if (pageCount > pagerCount) {
|
|
441
|
+
showPrev = currentPage > pagerCount - halfPagerCount;
|
|
442
|
+
showNext = currentPage < pageCount - halfPagerCount;
|
|
443
|
+
}
|
|
444
|
+
quickPrevHover.value && (quickPrevHover.value = showPrev);
|
|
445
|
+
quickNextHover.value && (quickNextHover.value = showNext);
|
|
446
|
+
showPrevMore.value = showPrev;
|
|
447
|
+
showNextMore.value = showNext;
|
|
448
|
+
},
|
|
449
|
+
{ immediate: true }
|
|
450
|
+
);
|
|
451
|
+
function onMouseEnter(forward = false) {
|
|
452
|
+
if (props.disabled)
|
|
453
|
+
return;
|
|
454
|
+
if (forward) {
|
|
455
|
+
quickPrevHover.value = true;
|
|
456
|
+
} else {
|
|
457
|
+
quickNextHover.value = true;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
function onFocus(forward = false) {
|
|
461
|
+
if (forward) {
|
|
462
|
+
quickPrevFocus.value = true;
|
|
463
|
+
} else {
|
|
464
|
+
quickNextFocus.value = true;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function onEnter(e) {
|
|
468
|
+
const target = e.target;
|
|
469
|
+
if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
|
|
470
|
+
const newPage = Number(target.textContent);
|
|
471
|
+
if (newPage !== props.currentPage) {
|
|
472
|
+
emit(CHANGE_EVENT, newPage);
|
|
473
|
+
}
|
|
474
|
+
} else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
|
|
475
|
+
onPagerClick(e);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function onPagerClick(event) {
|
|
479
|
+
const target = event.target;
|
|
480
|
+
if (target.tagName.toLowerCase() === "ul" || props.disabled) {
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
let newPage = Number(target.textContent);
|
|
484
|
+
const pageCount = props.pageCount;
|
|
485
|
+
const currentPage = props.currentPage;
|
|
486
|
+
const pagerCountOffset = props.pagerCount - 2;
|
|
487
|
+
if (target.className.includes("more")) {
|
|
488
|
+
if (target.className.includes("quickprev")) {
|
|
489
|
+
newPage = currentPage - pagerCountOffset;
|
|
490
|
+
} else if (target.className.includes("quicknext")) {
|
|
491
|
+
newPage = currentPage + pagerCountOffset;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (!Number.isNaN(+newPage)) {
|
|
495
|
+
if (newPage < 1) {
|
|
496
|
+
newPage = 1;
|
|
497
|
+
}
|
|
498
|
+
if (newPage > pageCount) {
|
|
499
|
+
newPage = pageCount;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
if (newPage !== currentPage) {
|
|
503
|
+
emit(CHANGE_EVENT, newPage);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return (_ctx, _cache) => {
|
|
507
|
+
return openBlock(), createElementBlock(
|
|
508
|
+
"ul",
|
|
509
|
+
{
|
|
510
|
+
class: normalizeClass(unref(nsPager).b()),
|
|
511
|
+
onClick: onPagerClick,
|
|
512
|
+
onKeyup: withKeys(onEnter, ["enter"])
|
|
513
|
+
},
|
|
514
|
+
[
|
|
515
|
+
_ctx.pageCount > 0 ? (openBlock(), createElementBlock("li", {
|
|
516
|
+
key: 0,
|
|
517
|
+
class: normalizeClass([[
|
|
518
|
+
unref(nsPager).is("active", _ctx.currentPage === 1),
|
|
519
|
+
unref(nsPager).is("disabled", _ctx.disabled)
|
|
520
|
+
], "number"]),
|
|
521
|
+
"aria-current": _ctx.currentPage === 1,
|
|
522
|
+
"aria-label": unref(t)("el.pagination.currentPage", { pager: 1 }),
|
|
523
|
+
tabindex: tabindex.value
|
|
524
|
+
}, " 1 ", 10, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
525
|
+
showPrevMore.value ? (openBlock(), createElementBlock("li", {
|
|
526
|
+
key: 1,
|
|
527
|
+
class: normalizeClass(prevMoreKls.value),
|
|
528
|
+
tabindex: tabindex.value,
|
|
529
|
+
"aria-label": unref(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }),
|
|
530
|
+
onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
|
|
531
|
+
onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
|
|
532
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
|
|
533
|
+
onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
|
|
534
|
+
}, [
|
|
535
|
+
(quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(DArrowLeft), { key: 0 })) : (openBlock(), createBlock(unref(MoreFilled), { key: 1 }))
|
|
536
|
+
], 42, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
537
|
+
(openBlock(true), createElementBlock(
|
|
538
|
+
Fragment,
|
|
539
|
+
null,
|
|
540
|
+
renderList(pagers.value, (pager) => {
|
|
541
|
+
return openBlock(), createElementBlock("li", {
|
|
542
|
+
key: pager,
|
|
543
|
+
class: normalizeClass([[
|
|
544
|
+
unref(nsPager).is("active", _ctx.currentPage === pager),
|
|
545
|
+
unref(nsPager).is("disabled", _ctx.disabled)
|
|
546
|
+
], "number"]),
|
|
547
|
+
"aria-current": _ctx.currentPage === pager,
|
|
548
|
+
"aria-label": unref(t)("el.pagination.currentPage", { pager }),
|
|
549
|
+
tabindex: tabindex.value
|
|
550
|
+
}, toDisplayString(pager), 11, _hoisted_3);
|
|
551
|
+
}),
|
|
552
|
+
128
|
|
553
|
+
)),
|
|
554
|
+
showNextMore.value ? (openBlock(), createElementBlock("li", {
|
|
555
|
+
key: 2,
|
|
556
|
+
class: normalizeClass(nextMoreKls.value),
|
|
557
|
+
tabindex: tabindex.value,
|
|
558
|
+
"aria-label": unref(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }),
|
|
559
|
+
onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
|
|
560
|
+
onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
|
|
561
|
+
onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
|
|
562
|
+
onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
|
|
563
|
+
}, [
|
|
564
|
+
(quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(DArrowRight), { key: 0 })) : (openBlock(), createBlock(unref(MoreFilled), { key: 1 }))
|
|
565
|
+
], 42, _hoisted_4)) : createCommentVNode("v-if", true),
|
|
566
|
+
_ctx.pageCount > 1 ? (openBlock(), createElementBlock("li", {
|
|
567
|
+
key: 3,
|
|
568
|
+
class: normalizeClass([[
|
|
569
|
+
unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
|
|
570
|
+
unref(nsPager).is("disabled", _ctx.disabled)
|
|
571
|
+
], "number"]),
|
|
572
|
+
"aria-current": _ctx.currentPage === _ctx.pageCount,
|
|
573
|
+
"aria-label": unref(t)("el.pagination.currentPage", { pager: _ctx.pageCount }),
|
|
574
|
+
tabindex: tabindex.value
|
|
575
|
+
}, toDisplayString(_ctx.pageCount), 11, _hoisted_5)) : createCommentVNode("v-if", true)
|
|
576
|
+
],
|
|
577
|
+
34
|
|
578
|
+
);
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
var Pager = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/pager.vue"]]);
|
|
583
|
+
|
|
584
|
+
const isAbsent = (v) => typeof v !== "number";
|
|
585
|
+
const paginationProps = buildProps({
|
|
586
|
+
pageSize: Number,
|
|
587
|
+
defaultPageSize: Number,
|
|
588
|
+
total: Number,
|
|
589
|
+
pageCount: Number,
|
|
590
|
+
pagerCount: {
|
|
591
|
+
type: Number,
|
|
592
|
+
validator: (value) => {
|
|
593
|
+
return isNumber(value) && Math.trunc(value) === value && value > 4 && value < 22 && value % 2 === 1;
|
|
594
|
+
},
|
|
595
|
+
default: 7
|
|
596
|
+
},
|
|
597
|
+
currentPage: Number,
|
|
598
|
+
defaultCurrentPage: Number,
|
|
599
|
+
layout: {
|
|
600
|
+
type: String,
|
|
601
|
+
default: ["prev", "pager", "next", "jumper", "->", "total"].join(", ")
|
|
602
|
+
},
|
|
603
|
+
pageSizes: {
|
|
604
|
+
type: definePropType(Array),
|
|
605
|
+
default: () => mutable([10, 20, 30, 40, 50, 100])
|
|
606
|
+
},
|
|
607
|
+
popperClass: {
|
|
608
|
+
type: String,
|
|
609
|
+
default: ""
|
|
610
|
+
},
|
|
611
|
+
popperStyle: {
|
|
612
|
+
type: definePropType([String, Object])
|
|
613
|
+
},
|
|
614
|
+
prevText: {
|
|
615
|
+
type: String,
|
|
616
|
+
default: ""
|
|
617
|
+
},
|
|
618
|
+
prevIcon: {
|
|
619
|
+
type: iconPropType,
|
|
620
|
+
default: () => ArrowLeft
|
|
621
|
+
},
|
|
622
|
+
nextText: {
|
|
623
|
+
type: String,
|
|
624
|
+
default: ""
|
|
625
|
+
},
|
|
626
|
+
nextIcon: {
|
|
627
|
+
type: iconPropType,
|
|
628
|
+
default: () => ArrowRight
|
|
629
|
+
},
|
|
630
|
+
teleported: {
|
|
631
|
+
type: Boolean,
|
|
632
|
+
default: true
|
|
633
|
+
},
|
|
634
|
+
small: Boolean,
|
|
635
|
+
size: useSizeProp,
|
|
636
|
+
background: Boolean,
|
|
637
|
+
disabled: Boolean,
|
|
638
|
+
hideOnSinglePage: Boolean,
|
|
639
|
+
appendSizeTo: String
|
|
640
|
+
});
|
|
641
|
+
const paginationEmits = {
|
|
642
|
+
"update:current-page": (val) => isNumber(val),
|
|
643
|
+
"update:page-size": (val) => isNumber(val),
|
|
644
|
+
"size-change": (val) => isNumber(val),
|
|
645
|
+
change: (currentPage, pageSize) => isNumber(currentPage) && isNumber(pageSize),
|
|
646
|
+
"current-change": (val) => isNumber(val),
|
|
647
|
+
"prev-click": (val) => isNumber(val),
|
|
648
|
+
"next-click": (val) => isNumber(val)
|
|
649
|
+
};
|
|
650
|
+
const componentName = "ElPagination";
|
|
651
|
+
var Pagination = defineComponent({
|
|
652
|
+
name: componentName,
|
|
653
|
+
props: paginationProps,
|
|
654
|
+
emits: paginationEmits,
|
|
655
|
+
setup(props, { emit, slots }) {
|
|
656
|
+
const { t } = useLocale();
|
|
657
|
+
const ns = useNamespace("pagination");
|
|
658
|
+
const vnodeProps = getCurrentInstance().vnode.props || {};
|
|
659
|
+
const _globalSize = useGlobalSize();
|
|
660
|
+
const _size = computed(
|
|
661
|
+
() => {
|
|
662
|
+
var _a;
|
|
663
|
+
return props.small ? "small" : (_a = props.size) != null ? _a : _globalSize.value;
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
useDeprecated(
|
|
667
|
+
{
|
|
668
|
+
from: "small",
|
|
669
|
+
replacement: "size",
|
|
670
|
+
version: "3.0.0",
|
|
671
|
+
scope: "el-pagination",
|
|
672
|
+
ref: "https://element-plus.org/zh-CN/component/pagination.html"
|
|
673
|
+
},
|
|
674
|
+
computed(() => !!props.small)
|
|
675
|
+
);
|
|
676
|
+
const hasCurrentPageListener = "onUpdate:currentPage" in vnodeProps || "onUpdate:current-page" in vnodeProps || "onCurrentChange" in vnodeProps;
|
|
677
|
+
const hasPageSizeListener = "onUpdate:pageSize" in vnodeProps || "onUpdate:page-size" in vnodeProps || "onSizeChange" in vnodeProps;
|
|
678
|
+
const assertValidUsage = computed(() => {
|
|
679
|
+
if (isAbsent(props.total) && isAbsent(props.pageCount))
|
|
680
|
+
return false;
|
|
681
|
+
if (!isAbsent(props.currentPage) && !hasCurrentPageListener)
|
|
682
|
+
return false;
|
|
683
|
+
if (props.layout.includes("sizes")) {
|
|
684
|
+
if (!isAbsent(props.pageCount)) {
|
|
685
|
+
if (!hasPageSizeListener)
|
|
686
|
+
return false;
|
|
687
|
+
} else if (!isAbsent(props.total)) {
|
|
688
|
+
if (!isAbsent(props.pageSize)) {
|
|
689
|
+
if (!hasPageSizeListener) {
|
|
690
|
+
return false;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return true;
|
|
696
|
+
});
|
|
697
|
+
const innerPageSize = ref(
|
|
698
|
+
isAbsent(props.defaultPageSize) ? 10 : props.defaultPageSize
|
|
699
|
+
);
|
|
700
|
+
const innerCurrentPage = ref(
|
|
701
|
+
isAbsent(props.defaultCurrentPage) ? 1 : props.defaultCurrentPage
|
|
702
|
+
);
|
|
703
|
+
const pageSizeBridge = computed({
|
|
704
|
+
get() {
|
|
705
|
+
return isAbsent(props.pageSize) ? innerPageSize.value : props.pageSize;
|
|
706
|
+
},
|
|
707
|
+
set(v) {
|
|
708
|
+
if (isAbsent(props.pageSize)) {
|
|
709
|
+
innerPageSize.value = v;
|
|
710
|
+
}
|
|
711
|
+
if (hasPageSizeListener) {
|
|
712
|
+
emit("update:page-size", v);
|
|
713
|
+
emit("size-change", v);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
const pageCountBridge = computed(() => {
|
|
718
|
+
let pageCount = 0;
|
|
719
|
+
if (!isAbsent(props.pageCount)) {
|
|
720
|
+
pageCount = props.pageCount;
|
|
721
|
+
} else if (!isAbsent(props.total)) {
|
|
722
|
+
pageCount = Math.max(1, Math.ceil(props.total / pageSizeBridge.value));
|
|
723
|
+
}
|
|
724
|
+
return pageCount;
|
|
725
|
+
});
|
|
726
|
+
const currentPageBridge = computed({
|
|
727
|
+
get() {
|
|
728
|
+
return isAbsent(props.currentPage) ? innerCurrentPage.value : props.currentPage;
|
|
729
|
+
},
|
|
730
|
+
set(v) {
|
|
731
|
+
let newCurrentPage = v;
|
|
732
|
+
if (v < 1) {
|
|
733
|
+
newCurrentPage = 1;
|
|
734
|
+
} else if (v > pageCountBridge.value) {
|
|
735
|
+
newCurrentPage = pageCountBridge.value;
|
|
736
|
+
}
|
|
737
|
+
if (isAbsent(props.currentPage)) {
|
|
738
|
+
innerCurrentPage.value = newCurrentPage;
|
|
739
|
+
}
|
|
740
|
+
if (hasCurrentPageListener) {
|
|
741
|
+
emit("update:current-page", newCurrentPage);
|
|
742
|
+
emit("current-change", newCurrentPage);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
watch(pageCountBridge, (val) => {
|
|
747
|
+
if (currentPageBridge.value > val)
|
|
748
|
+
currentPageBridge.value = val;
|
|
749
|
+
});
|
|
750
|
+
watch(
|
|
751
|
+
[currentPageBridge, pageSizeBridge],
|
|
752
|
+
(value) => {
|
|
753
|
+
emit(CHANGE_EVENT, ...value);
|
|
754
|
+
},
|
|
755
|
+
{ flush: "post" }
|
|
756
|
+
);
|
|
757
|
+
function handleCurrentChange(val) {
|
|
758
|
+
currentPageBridge.value = val;
|
|
759
|
+
}
|
|
760
|
+
function handleSizeChange(val) {
|
|
761
|
+
pageSizeBridge.value = val;
|
|
762
|
+
const newPageCount = pageCountBridge.value;
|
|
763
|
+
if (currentPageBridge.value > newPageCount) {
|
|
764
|
+
currentPageBridge.value = newPageCount;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
function prev() {
|
|
768
|
+
if (props.disabled)
|
|
769
|
+
return;
|
|
770
|
+
currentPageBridge.value -= 1;
|
|
771
|
+
emit("prev-click", currentPageBridge.value);
|
|
772
|
+
}
|
|
773
|
+
function next() {
|
|
774
|
+
if (props.disabled)
|
|
775
|
+
return;
|
|
776
|
+
currentPageBridge.value += 1;
|
|
777
|
+
emit("next-click", currentPageBridge.value);
|
|
778
|
+
}
|
|
779
|
+
function addClass(element, cls) {
|
|
780
|
+
if (element) {
|
|
781
|
+
if (!element.props) {
|
|
782
|
+
element.props = {};
|
|
783
|
+
}
|
|
784
|
+
element.props.class = [element.props.class, cls].join(" ");
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
provide(elPaginationKey, {
|
|
788
|
+
pageCount: pageCountBridge,
|
|
789
|
+
disabled: computed(() => props.disabled),
|
|
790
|
+
currentPage: currentPageBridge,
|
|
791
|
+
changeEvent: handleCurrentChange,
|
|
792
|
+
handleSizeChange
|
|
793
|
+
});
|
|
794
|
+
return () => {
|
|
795
|
+
var _a, _b;
|
|
796
|
+
if (!assertValidUsage.value) {
|
|
797
|
+
debugWarn(componentName, t("el.pagination.deprecationWarning"));
|
|
798
|
+
return null;
|
|
799
|
+
}
|
|
800
|
+
if (!props.layout)
|
|
801
|
+
return null;
|
|
802
|
+
if (props.hideOnSinglePage && pageCountBridge.value <= 1)
|
|
803
|
+
return null;
|
|
804
|
+
const rootChildren = [];
|
|
805
|
+
const rightWrapperChildren = [];
|
|
806
|
+
const rightWrapperRoot = h(
|
|
807
|
+
"div",
|
|
808
|
+
{ class: ns.e("rightwrapper") },
|
|
809
|
+
rightWrapperChildren
|
|
810
|
+
);
|
|
811
|
+
const TEMPLATE_MAP = {
|
|
812
|
+
prev: h(Prev, {
|
|
813
|
+
disabled: props.disabled,
|
|
814
|
+
currentPage: currentPageBridge.value,
|
|
815
|
+
prevText: props.prevText,
|
|
816
|
+
prevIcon: props.prevIcon,
|
|
817
|
+
onClick: prev
|
|
818
|
+
}),
|
|
819
|
+
jumper: h(Jumper, {
|
|
820
|
+
size: _size.value
|
|
821
|
+
}),
|
|
822
|
+
pager: h(Pager, {
|
|
823
|
+
currentPage: currentPageBridge.value,
|
|
824
|
+
pageCount: pageCountBridge.value,
|
|
825
|
+
pagerCount: props.pagerCount,
|
|
826
|
+
onChange: handleCurrentChange,
|
|
827
|
+
disabled: props.disabled
|
|
828
|
+
}),
|
|
829
|
+
next: h(Next, {
|
|
830
|
+
disabled: props.disabled,
|
|
831
|
+
currentPage: currentPageBridge.value,
|
|
832
|
+
pageCount: pageCountBridge.value,
|
|
833
|
+
nextText: props.nextText,
|
|
834
|
+
nextIcon: props.nextIcon,
|
|
835
|
+
onClick: next
|
|
836
|
+
}),
|
|
837
|
+
sizes: h(Sizes, {
|
|
838
|
+
pageSize: pageSizeBridge.value,
|
|
839
|
+
pageSizes: props.pageSizes,
|
|
840
|
+
popperClass: props.popperClass,
|
|
841
|
+
popperStyle: props.popperStyle,
|
|
842
|
+
disabled: props.disabled,
|
|
843
|
+
teleported: props.teleported,
|
|
844
|
+
size: _size.value,
|
|
845
|
+
appendSizeTo: props.appendSizeTo
|
|
846
|
+
}),
|
|
847
|
+
slot: (_b = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : null,
|
|
848
|
+
total: h(Total, { total: isAbsent(props.total) ? 0 : props.total })
|
|
849
|
+
};
|
|
850
|
+
const components = props.layout.split(",").map((item) => item.trim());
|
|
851
|
+
let haveRightWrapper = false;
|
|
852
|
+
components.forEach((c) => {
|
|
853
|
+
if (c === "->") {
|
|
854
|
+
haveRightWrapper = true;
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
if (!haveRightWrapper) {
|
|
858
|
+
rootChildren.push(TEMPLATE_MAP[c]);
|
|
859
|
+
} else {
|
|
860
|
+
rightWrapperChildren.push(TEMPLATE_MAP[c]);
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
addClass(rootChildren[0], ns.is("first"));
|
|
864
|
+
addClass(rootChildren[rootChildren.length - 1], ns.is("last"));
|
|
865
|
+
if (haveRightWrapper && rightWrapperChildren.length > 0) {
|
|
866
|
+
addClass(rightWrapperChildren[0], ns.is("first"));
|
|
867
|
+
addClass(
|
|
868
|
+
rightWrapperChildren[rightWrapperChildren.length - 1],
|
|
869
|
+
ns.is("last")
|
|
870
|
+
);
|
|
871
|
+
rootChildren.push(rightWrapperRoot);
|
|
872
|
+
}
|
|
873
|
+
return h(
|
|
874
|
+
"div",
|
|
875
|
+
{
|
|
876
|
+
class: [
|
|
877
|
+
ns.b(),
|
|
878
|
+
ns.is("background", props.background),
|
|
879
|
+
ns.m(_size.value)
|
|
880
|
+
]
|
|
881
|
+
},
|
|
882
|
+
rootChildren
|
|
883
|
+
);
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
});
|
|
887
|
+
|
|
888
|
+
const ElPagination = withInstall(Pagination);
|
|
889
|
+
|
|
890
|
+
export { ElPagination as E };
|