@wfrog/vc-ui 1.11.10 → 1.11.12

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.
Files changed (141) hide show
  1. package/dist/es/chunk/Bw0Rhd-r.mjs +110 -0
  2. package/dist/es/chunk/CqTdDZkE.mjs +31 -0
  3. package/dist/es/chunk/{DAnWZLYj.mjs → CzWfBa_8.mjs} +96 -2
  4. package/dist/es/chunk/D229kQ56.mjs +28 -0
  5. package/dist/es/chunk/{Cxx_YWUC.mjs → DcouM6gM.mjs} +6 -548
  6. package/dist/es/chunk/Fo0dZYnz.mjs +128 -0
  7. package/dist/es/chunk/KanuIcmc.mjs +412 -0
  8. package/dist/es/chunk/{B71xEPfK.mjs → uuUHUjSk.mjs} +4 -35
  9. package/dist/es/components/backbottom/backbottom.mjs +3 -2
  10. package/dist/es/components/button/button.mjs +14 -13
  11. package/dist/es/components/choice/choice.mjs +11 -9
  12. package/dist/es/components/choice/index.css +1 -1
  13. package/dist/es/components/choice-boolean/choice-boolean.mjs +3 -3
  14. package/dist/es/components/color-switch/color-switch.mjs +73 -1046
  15. package/dist/es/components/color-switch/index.css +1 -1
  16. package/dist/es/components/cropper/cropper.mjs +11 -117
  17. package/dist/es/components/cropper/index.css +1 -1
  18. package/dist/es/components/currency/currency.mjs +10 -12
  19. package/dist/es/components/daterange-picker/daterange-picker.mjs +10 -6255
  20. package/dist/es/components/dialog/dialog.mjs +14 -408
  21. package/dist/es/components/dialog/index.css +1 -1
  22. package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +11 -14
  23. package/dist/es/components/dialog-map-point/dialog-map-point.mjs +4 -4
  24. package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +14 -1380
  25. package/dist/es/components/dialog-upload-images/index.css +1 -1
  26. package/dist/es/components/drag-verify/drag-verify.mjs +3 -2
  27. package/dist/es/components/drawer/drawer.mjs +16 -359
  28. package/dist/es/components/drawer/index.css +3 -3
  29. package/dist/es/components/easy-pagination/easy-pagination.mjs +3 -2
  30. package/dist/es/components/explorer/explorer.mjs +8 -8
  31. package/dist/es/components/explorer-column-table/explorer-column-table.mjs +5 -7
  32. package/dist/es/components/explorer-column-table/index.css +1 -1
  33. package/dist/es/components/explorer-container/explorer-container.d.ts +1 -1
  34. package/dist/es/components/explorer-container/explorer-container.mjs +4 -3
  35. package/dist/es/components/explorer-filter/explorer-filter.mjs +5 -4
  36. package/dist/es/components/explorer-footer/explorer-footer.mjs +4 -8
  37. package/dist/es/components/explorer-form/explorer-form.mjs +4 -3
  38. package/dist/es/components/explorer-list/explorer-list.mjs +18 -13
  39. package/dist/es/components/explorer-list/explorer-list.vue.d.ts +1 -1
  40. package/dist/es/components/explorer-list/index.css +16 -16
  41. package/dist/es/components/explorer-modal-form/explorer-modal-form.mjs +8 -7
  42. package/dist/es/components/explorer-panel/explorer-panel.mjs +3 -3
  43. package/dist/es/components/explorer-query/explorer-query.mjs +9 -2201
  44. package/dist/es/components/explorer-query/index.css +1 -1
  45. package/dist/es/components/explorer-table/explorer-table.mjs +5 -8
  46. package/dist/es/components/explorer-tools/explorer-tools.mjs +23 -271
  47. package/dist/es/components/explorer-tools/index.css +9 -9
  48. package/dist/es/components/explorer-tree/explorer-tree.mjs +4 -5
  49. package/dist/es/components/explorer-tree/explorer-tree.vue.d.ts +1 -1
  50. package/dist/es/components/form-item/form-item.mjs +3 -3
  51. package/dist/es/components/icon-picker/icon-picker.mjs +8 -12
  52. package/dist/es/components/image/image.mjs +4 -4
  53. package/dist/es/components/info-tooltip/info-tooltip.mjs +336 -4
  54. package/dist/es/components/input/input.mjs +3 -2
  55. package/dist/es/components/input-number/input-number.mjs +3 -3
  56. package/dist/es/components/pca-picker/index.css +1 -1
  57. package/dist/es/components/pca-picker/pca-picker.mjs +443 -601
  58. package/dist/es/components/screenfull/screenfull.mjs +4 -3
  59. package/dist/es/components/scrollbar/index.css +1 -1
  60. package/dist/es/components/scrollbar/scrollbar.mjs +10 -10
  61. package/dist/es/components/select/index.css +1 -1
  62. package/dist/es/components/select/select.mjs +9 -10
  63. package/dist/es/components/single-player/index.css +1 -1
  64. package/dist/es/components/single-player/single-player.mjs +10 -1087
  65. package/dist/es/components/splitter/splitter.mjs +3 -3
  66. package/dist/es/components/splitter-panel/splitter-panel.mjs +3 -3
  67. package/dist/es/components/switch/index.css +1 -1
  68. package/dist/es/components/switch/switch.mjs +9 -395
  69. package/dist/es/components/tags/tags.mjs +7 -9
  70. package/dist/es/components/text-ellipsis/text-ellipsis.mjs +3 -3
  71. package/dist/es/components/thousand-input/thousand-input.mjs +39 -8
  72. package/dist/es/components/tinymce/tinymce.mjs +4 -3
  73. package/dist/es/components/transfer/transfer.mjs +3 -4
  74. package/dist/es/components/transfer-panel/transfer-panel.mjs +5 -4
  75. package/dist/es/components/tree-picker/popover-cascader.css +1 -1
  76. package/dist/es/components/tree-picker/tree-picker.mjs +5 -10
  77. package/dist/es/index.mjs +1 -1
  78. package/dist/index.css +41 -68
  79. package/package.json +1 -1
  80. package/dist/es/chunk/B-rxnVJv.mjs +0 -3
  81. package/dist/es/chunk/B5HpgPRt.mjs +0 -69
  82. package/dist/es/chunk/BBhZKpIc.mjs +0 -2179
  83. package/dist/es/chunk/BDcsaNYa.mjs +0 -59
  84. package/dist/es/chunk/BTSSEFfD.mjs +0 -319
  85. package/dist/es/chunk/BTpNRPQW.mjs +0 -55
  86. package/dist/es/chunk/BVBK1U57.mjs +0 -96
  87. package/dist/es/chunk/Bc6yUGLs.mjs +0 -45
  88. package/dist/es/chunk/BjVI1XMz.mjs +0 -40
  89. package/dist/es/chunk/BlzQCBDu.mjs +0 -5741
  90. package/dist/es/chunk/BpJKnxlF.mjs +0 -476
  91. package/dist/es/chunk/Brp-qSBw.mjs +0 -2003
  92. package/dist/es/chunk/BunQI8Jb.mjs +0 -390
  93. package/dist/es/chunk/C0XgBrDz.mjs +0 -775
  94. package/dist/es/chunk/C0pTANRX.mjs +0 -109
  95. package/dist/es/chunk/CBMjhoFP.mjs +0 -101
  96. package/dist/es/chunk/CBiNtNvQ.mjs +0 -242
  97. package/dist/es/chunk/CBlJeNBO.mjs +0 -890
  98. package/dist/es/chunk/CCVL_Zj-.mjs +0 -427
  99. package/dist/es/chunk/CEl4MyfJ.mjs +0 -252
  100. package/dist/es/chunk/CJK5_jsA.mjs +0 -53
  101. package/dist/es/chunk/CKOcwq5V.mjs +0 -44
  102. package/dist/es/chunk/COs9dJZa.mjs +0 -66
  103. package/dist/es/chunk/CPt6MxJW.mjs +0 -375
  104. package/dist/es/chunk/CVqW0jzp.mjs +0 -107
  105. package/dist/es/chunk/CccIsEqA.mjs +0 -128
  106. package/dist/es/chunk/CjLR27-a.mjs +0 -582
  107. package/dist/es/chunk/CoGexPPD.mjs +0 -2192
  108. package/dist/es/chunk/CsLIbnzG.mjs +0 -64
  109. package/dist/es/chunk/Ct6q2FXg.mjs +0 -5
  110. package/dist/es/chunk/Cuq5meQh.mjs +0 -184
  111. package/dist/es/chunk/CvYIOfT1.mjs +0 -23
  112. package/dist/es/chunk/CxHJBf4l.mjs +0 -31
  113. package/dist/es/chunk/CzdaOBtA.mjs +0 -66
  114. package/dist/es/chunk/D0QTifnI.mjs +0 -54
  115. package/dist/es/chunk/D1QnA2iT.mjs +0 -229
  116. package/dist/es/chunk/D3AvJlVX.mjs +0 -188
  117. package/dist/es/chunk/D9Lr0Bzb.mjs +0 -1136
  118. package/dist/es/chunk/DCkPv0hy.mjs +0 -29
  119. package/dist/es/chunk/DRwwUUhy.mjs +0 -49
  120. package/dist/es/chunk/DX-2VRY2.mjs +0 -836
  121. package/dist/es/chunk/DZ2oTFad.mjs +0 -687
  122. package/dist/es/chunk/D_bou1py.mjs +0 -55
  123. package/dist/es/chunk/Da199A5L.mjs +0 -314
  124. package/dist/es/chunk/DbhQlaOz.mjs +0 -94
  125. package/dist/es/chunk/Dgu95mOy.mjs +0 -237
  126. package/dist/es/chunk/DhGOsWxx.mjs +0 -6
  127. package/dist/es/chunk/Dm_Sj5aH.mjs +0 -487
  128. package/dist/es/chunk/Dmi-1GRO.mjs +0 -163
  129. package/dist/es/chunk/DodoD9a9.mjs +0 -52
  130. package/dist/es/chunk/DrrVDcwm.mjs +0 -955
  131. package/dist/es/chunk/Du_zJ1Fz.mjs +0 -49
  132. package/dist/es/chunk/DxxbB5jY.mjs +0 -34
  133. package/dist/es/chunk/Gk1J52Yw.mjs +0 -207
  134. package/dist/es/chunk/NsldgdCh.mjs +0 -704
  135. package/dist/es/chunk/V6KjsUQN.mjs +0 -35
  136. package/dist/es/chunk/eEsLFV3s.mjs +0 -76
  137. package/dist/es/chunk/fqiLhk0V.mjs +0 -2065
  138. package/dist/es/chunk/nxVM7re4.mjs +0 -35
  139. package/dist/es/chunk/s7HLrANj.mjs +0 -215
  140. package/dist/es/chunk/vPhxogl3.mjs +0 -19
  141. package/dist/es/components/icon/icon2.mjs +0 -27
@@ -1,890 +0,0 @@
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 './D0QTifnI.mjs';
4
- import { b as buildProps, d as definePropType, u as useNamespace, c as isArray, a as debugWarn } from './Gk1J52Yw.mjs';
5
- import { i as iconPropType } from '../components/icon/icon2.mjs';
6
- import { _ as _export_sfc, w as withInstall } from './V6KjsUQN.mjs';
7
- import { u as useLocale } from './CEl4MyfJ.mjs';
8
- import { E as ElSelect, a as ElOption } from './BBhZKpIc.mjs';
9
- import { m as mutable } from './B-rxnVJv.mjs';
10
- import { c as componentSizes, a as useGlobalSize, u as useSizeProp } from './vPhxogl3.mjs';
11
- import { i as isEqual } from './B71xEPfK.mjs';
12
- import { E as ElInput } from './DX-2VRY2.mjs';
13
- import { C as CHANGE_EVENT } from './Ct6q2FXg.mjs';
14
- import { u as useDeprecated } from './CvYIOfT1.mjs';
15
- import { b as isNumber } from './Bc6yUGLs.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 };