vue-devui 1.0.0-rc.6 → 1.0.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/alert/index.es.js +37 -11
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +311 -77
- package/auto-complete/index.umd.js +3 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +81 -70
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +29 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5632 -87
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +56 -29
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +364 -234
- package/checkbox/index.umd.js +1 -1
- package/checkbox/style.css +1 -1
- package/date-picker/index.es.js +310 -157
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +28 -3
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +125 -45
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +437 -22
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +490 -605
- package/form/index.umd.js +15 -15
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +29 -5
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +71 -50
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +109 -13
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +34 -11
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +330 -130
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +272 -199
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +34 -6
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +34 -10
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +126 -27
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +125 -25
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/formControlProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/overlay/index.es.js +31 -9
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +2 -1
- package/pagination/index.es.js +135 -124
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/popover/index.es.js +198 -83
- package/popover/index.umd.js +16 -16
- package/popover/style.css +1 -1
- package/progress/index.es.js +76 -20
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +161 -140
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +48 -16
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +108 -12
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +379 -167
- package/search/index.umd.js +17 -17
- package/search/style.css +1 -1
- package/select/index.es.js +7339 -556
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +37 -12
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +34 -10
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +201 -84
- package/splitter/index.umd.js +14 -14
- package/splitter/style.css +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +30 -6
- package/switch/index.umd.js +1 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +6808 -585
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +136 -70
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +31 -7
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +5631 -80
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/timeline/index.es.js +108 -12
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +190 -74
- package/tooltip/index.umd.js +17 -17
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +376 -256
- package/tree/index.umd.js +1 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +138 -34
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +6770 -5769
- package/vue-devui.umd.js +27 -21
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -84
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/commentProps.js +0 -3
- package/nuxt/components/readTipProps.js +0 -3
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -261
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
package/pagination/index.es.js
CHANGED
|
@@ -190,6 +190,29 @@ const clickoutsideDirective = {
|
|
|
190
190
|
delete el[ctx];
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
|
+
function createBem(namespace, element, modifier) {
|
|
194
|
+
let cls = namespace;
|
|
195
|
+
if (element) {
|
|
196
|
+
cls += `__${element}`;
|
|
197
|
+
}
|
|
198
|
+
if (modifier) {
|
|
199
|
+
cls += `--${modifier}`;
|
|
200
|
+
}
|
|
201
|
+
return cls;
|
|
202
|
+
}
|
|
203
|
+
function useNamespace(block, needDot = false) {
|
|
204
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
205
|
+
const b = () => createBem(namespace);
|
|
206
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
207
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
208
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
209
|
+
return {
|
|
210
|
+
b,
|
|
211
|
+
e,
|
|
212
|
+
m,
|
|
213
|
+
em
|
|
214
|
+
};
|
|
215
|
+
}
|
|
193
216
|
var ConfigMenu = defineComponent({
|
|
194
217
|
directives: {
|
|
195
218
|
clickoutside: clickoutsideDirective
|
|
@@ -227,22 +250,23 @@ var ConfigMenu = defineComponent({
|
|
|
227
250
|
isShowConfig,
|
|
228
251
|
$slots
|
|
229
252
|
} = this;
|
|
253
|
+
const ns = useNamespace("pagination");
|
|
230
254
|
return withDirectives(createVNode("div", {
|
|
231
|
-
"class": "
|
|
255
|
+
"class": ns.e("config"),
|
|
232
256
|
"ref": "paginationConfig"
|
|
233
257
|
}, [createVNode("div", {
|
|
234
|
-
"class": "
|
|
258
|
+
"class": ns.e("setup-icon")
|
|
235
259
|
}, [createVNode("i", {
|
|
236
260
|
"class": "icon-setting",
|
|
237
261
|
"style": "font-weight: bold;"
|
|
238
262
|
}, null)]), isShowConfig && createVNode("div", {
|
|
239
|
-
"class": "
|
|
263
|
+
"class": ns.e("config-container")
|
|
240
264
|
}, [(_a = $slots.default) == null ? void 0 : _a.call($slots), createVNode("div", {
|
|
241
|
-
"class": "
|
|
265
|
+
"class": ns.e("config-item")
|
|
242
266
|
}, [createVNode("div", {
|
|
243
267
|
"class": "config-item-title"
|
|
244
268
|
}, [createTextVNode("\u6BCF\u9875\u6761\u6570")]), createVNode("div", {
|
|
245
|
-
"class": "
|
|
269
|
+
"class": ns.e("number")
|
|
246
270
|
}, [pageSizeOptions.map((v) => {
|
|
247
271
|
return createVNode("div", {
|
|
248
272
|
"class": {
|
|
@@ -316,25 +340,26 @@ var JumpPage = defineComponent({
|
|
|
316
340
|
jump,
|
|
317
341
|
showJumpButton
|
|
318
342
|
} = this;
|
|
343
|
+
const ns = useNamespace("pagination");
|
|
319
344
|
const inputProps = {
|
|
320
|
-
class: ["
|
|
345
|
+
class: [ns.e("input"), size ? ns.em("input", size) : ""],
|
|
321
346
|
size,
|
|
322
347
|
modelValue: String(inputNum),
|
|
323
348
|
"onUpdate:modelValue": jumpPageChange,
|
|
324
349
|
onKeydown: jump
|
|
325
350
|
};
|
|
326
351
|
return createVNode("div", {
|
|
327
|
-
"class": "
|
|
352
|
+
"class": ns.e("jump-container")
|
|
328
353
|
}, [
|
|
329
354
|
goToText,
|
|
330
355
|
createVNode(resolveComponent("d-input"), inputProps, null),
|
|
331
356
|
goToText === "\u8DF3\u81F3" && "\u9875",
|
|
332
357
|
showJumpButton && createVNode("div", {
|
|
333
|
-
"class": ["
|
|
358
|
+
"class": [ns.e("jump-button"), size ? ns.em("jump-size", size) : ns.em("jump-size", "default")],
|
|
334
359
|
"onClick": jump.bind(null, "btn"),
|
|
335
360
|
"title": goToText
|
|
336
361
|
}, [createVNode("div", {
|
|
337
|
-
"class": "
|
|
362
|
+
"class": ns.e("go")
|
|
338
363
|
}, null)])
|
|
339
364
|
]);
|
|
340
365
|
}
|
|
@@ -400,32 +425,33 @@ var PageNumBtn = defineComponent({
|
|
|
400
425
|
nextChange,
|
|
401
426
|
showTruePageIndex
|
|
402
427
|
} = this;
|
|
428
|
+
const ns = useNamespace("pagination");
|
|
403
429
|
return createVNode("ul", {
|
|
404
|
-
"class": ["
|
|
430
|
+
"class": [ns.e("list"), size ? ns.m(size) : ""]
|
|
405
431
|
}, [createVNode("li", {
|
|
406
432
|
"onClick": prevChange.bind(null, -1),
|
|
407
433
|
"class": {
|
|
408
|
-
"
|
|
434
|
+
[ns.e("item")]: true,
|
|
409
435
|
disabled: cursor <= 1
|
|
410
436
|
}
|
|
411
437
|
}, [createVNode("a", {
|
|
412
438
|
"innerHTML": preLink,
|
|
413
|
-
"class": "
|
|
439
|
+
"class": ns.e("link")
|
|
414
440
|
}, null)]), !lite && createVNode(Fragment, null, [
|
|
415
441
|
createVNode("li", {
|
|
416
442
|
"onClick": changeCursor.bind(null, 1),
|
|
417
443
|
"class": {
|
|
418
|
-
"
|
|
444
|
+
[ns.e("item")]: true,
|
|
419
445
|
active: cursor === 1
|
|
420
446
|
}
|
|
421
447
|
}, [createVNode("a", {
|
|
422
|
-
"class": "
|
|
448
|
+
"class": ns.e("link")
|
|
423
449
|
}, [createTextVNode("1")])]),
|
|
424
450
|
showPageNum[0] > 2 && createVNode("li", {
|
|
425
451
|
"onClick": prevChange.bind(null, showPageNum[0] - 1),
|
|
426
|
-
"class": "
|
|
452
|
+
"class": ns.e("item")
|
|
427
453
|
}, [createVNode("a", {
|
|
428
|
-
"class": "
|
|
454
|
+
"class": ns.e("link")
|
|
429
455
|
}, [createTextVNode("...")])]),
|
|
430
456
|
(() => {
|
|
431
457
|
const list = [];
|
|
@@ -434,48 +460,48 @@ var PageNumBtn = defineComponent({
|
|
|
434
460
|
"onClick": changeCursor.bind(null, i),
|
|
435
461
|
"key": i,
|
|
436
462
|
"class": {
|
|
437
|
-
"
|
|
463
|
+
[ns.e("item")]: true,
|
|
438
464
|
active: cursor === i
|
|
439
465
|
}
|
|
440
466
|
}, [createVNode("a", {
|
|
441
|
-
"class": "
|
|
467
|
+
"class": ns.e("link")
|
|
442
468
|
}, [i])]));
|
|
443
469
|
}
|
|
444
470
|
return list;
|
|
445
471
|
})(),
|
|
446
472
|
showPageNum[1] < totalPages - 1 && createVNode("li", {
|
|
447
473
|
"onClick": nextChange.bind(null, showPageNum[1] + 1),
|
|
448
|
-
"class": "
|
|
474
|
+
"class": ns.e("item")
|
|
449
475
|
}, [createVNode("a", {
|
|
450
|
-
"class": "
|
|
476
|
+
"class": ns.e("link")
|
|
451
477
|
}, [createTextVNode("...")])]),
|
|
452
478
|
showPageNum[1] < totalPages && createVNode("li", {
|
|
453
479
|
"onClick": changeCursor.bind(null, totalPages),
|
|
454
480
|
"class": {
|
|
455
|
-
"
|
|
481
|
+
[ns.e("item")]: true,
|
|
456
482
|
active: cursor === totalPages
|
|
457
483
|
}
|
|
458
484
|
}, [createVNode("a", {
|
|
459
|
-
"class": "
|
|
485
|
+
"class": ns.e("link")
|
|
460
486
|
}, [totalPages])]),
|
|
461
487
|
showTruePageIndex && cursor > totalPages && totalPages > 0 && createVNode(Fragment, null, [cursor > totalPages + 1 && createVNode("li", {
|
|
462
|
-
"class": "
|
|
488
|
+
"class": [ns.e("item"), "disabled"]
|
|
463
489
|
}, [createVNode("a", {
|
|
464
|
-
"class": "
|
|
490
|
+
"class": ns.e("link")
|
|
465
491
|
}, [createTextVNode("...")])]), createVNode("li", {
|
|
466
|
-
"class": "
|
|
492
|
+
"class": [ns.e("item"), "disabled", "active"]
|
|
467
493
|
}, [createVNode("a", {
|
|
468
|
-
"class": "
|
|
494
|
+
"class": ns.e("link")
|
|
469
495
|
}, [cursor])])])
|
|
470
496
|
]), createVNode("li", {
|
|
471
497
|
"onClick": nextChange.bind(null, -1),
|
|
472
498
|
"class": {
|
|
473
|
-
"
|
|
499
|
+
[ns.e("item")]: true,
|
|
474
500
|
disabled: cursor >= totalPages
|
|
475
501
|
}
|
|
476
502
|
}, [createVNode("a", {
|
|
477
503
|
"innerHTML": nextLink,
|
|
478
|
-
"class": "
|
|
504
|
+
"class": ns.e("link")
|
|
479
505
|
}, null)])]);
|
|
480
506
|
}
|
|
481
507
|
});
|
|
@@ -490,8 +516,31 @@ var Pagination = defineComponent({
|
|
|
490
516
|
props: paginationProps,
|
|
491
517
|
emits: ["pageIndexChange", "pageSizeChange", "update:pageSize", "update:pageIndex"],
|
|
492
518
|
setup(props, {
|
|
493
|
-
emit
|
|
519
|
+
emit,
|
|
520
|
+
slots
|
|
494
521
|
}) {
|
|
522
|
+
const {
|
|
523
|
+
autoHide,
|
|
524
|
+
pageSizeOptions,
|
|
525
|
+
total,
|
|
526
|
+
canChangePageSize,
|
|
527
|
+
lite,
|
|
528
|
+
size,
|
|
529
|
+
pageSizeDirection,
|
|
530
|
+
showPageSelector,
|
|
531
|
+
canViewTotal,
|
|
532
|
+
totalItemText,
|
|
533
|
+
maxItems,
|
|
534
|
+
preLink,
|
|
535
|
+
nextLink,
|
|
536
|
+
showTruePageIndex,
|
|
537
|
+
canJumpPage,
|
|
538
|
+
goToText,
|
|
539
|
+
pageIndex,
|
|
540
|
+
showJumpButton,
|
|
541
|
+
haveConfigMenu
|
|
542
|
+
} = toRefs(props);
|
|
543
|
+
const ns = useNamespace("pagination");
|
|
495
544
|
const totalPages = computed(() => Math.ceil(props.total / props.pageSize));
|
|
496
545
|
const litePageOptions = computed(() => liteSelectOptions(totalPages.value));
|
|
497
546
|
const cursor = computed({
|
|
@@ -532,102 +581,64 @@ var Pagination = defineComponent({
|
|
|
532
581
|
const litePageIndexChange = (page) => {
|
|
533
582
|
changeCursorEmit(page.value);
|
|
534
583
|
};
|
|
535
|
-
return {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
584
|
+
return () => {
|
|
585
|
+
return autoHide.value && Math.min(...pageSizeOptions.value) > total.value ? null : createVNode("div", {
|
|
586
|
+
"class": ns.b()
|
|
587
|
+
}, [
|
|
588
|
+
canChangePageSize.value && !lite.value && createVNode("div", {
|
|
589
|
+
"class": [ns.e("size"), size.value ? ns.em("size", size.value) : ""]
|
|
590
|
+
}, [createVNode(resolveComponent("d-select"), {
|
|
591
|
+
"options": pageSizeOptions.value,
|
|
592
|
+
"modelValue": currentPageSize.value,
|
|
593
|
+
"onValueChange": pageSizeChange,
|
|
594
|
+
"pageSizeDirection": pageSizeDirection.value
|
|
595
|
+
}, null)]),
|
|
596
|
+
(!lite.value || lite.value && showPageSelector.value) && canViewTotal.value && createVNode("div", {
|
|
597
|
+
"class": ns.e("total-size")
|
|
598
|
+
}, [totalItemText.value, createTextVNode(": "), total.value]),
|
|
599
|
+
lite.value && showPageSelector.value && createVNode("div", {
|
|
600
|
+
"class": ns.e("size")
|
|
601
|
+
}, [createVNode(resolveComponent("d-select"), {
|
|
602
|
+
"options": litePageOptions.value,
|
|
603
|
+
"disabled": total.value === 0,
|
|
604
|
+
"modelValue": cursor.value,
|
|
605
|
+
"onValueChange": litePageIndexChange,
|
|
606
|
+
"pageSizeDirection": pageSizeDirection.value
|
|
607
|
+
}, null)]),
|
|
608
|
+
createVNode(resolveComponent("page-num-btn"), mergeProps({
|
|
609
|
+
cursor: cursor.value,
|
|
610
|
+
totalPages: totalPages.value,
|
|
611
|
+
size: size.value,
|
|
612
|
+
lite: lite.value,
|
|
613
|
+
maxItems: maxItems.value,
|
|
614
|
+
preLink: preLink.value,
|
|
615
|
+
nextLink: nextLink.value,
|
|
616
|
+
showTruePageIndex: showTruePageIndex.value
|
|
617
|
+
}, {
|
|
618
|
+
"onChangeCursorEmit": changeCursorEmit
|
|
619
|
+
}), null),
|
|
620
|
+
canJumpPage.value && !lite.value && createVNode(resolveComponent("jump-page"), mergeProps({
|
|
621
|
+
goToText: goToText.value,
|
|
622
|
+
size: size.value,
|
|
623
|
+
pageIndex: pageIndex.value,
|
|
624
|
+
totalPages: totalPages.value,
|
|
625
|
+
cursor: cursor.value,
|
|
626
|
+
showJumpButton: showJumpButton.value
|
|
627
|
+
}, {
|
|
628
|
+
"onChangeCursorEmit": changeCursorEmit
|
|
629
|
+
}), null),
|
|
630
|
+
lite.value && haveConfigMenu.value && createVNode(resolveComponent("config-menu"), {
|
|
631
|
+
currentPageSize: currentPageSize.value,
|
|
632
|
+
pageSizeChange,
|
|
633
|
+
pageSizeOptions: pageSizeOptions.value
|
|
634
|
+
}, {
|
|
635
|
+
default: () => {
|
|
636
|
+
var _a;
|
|
637
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
|
638
|
+
}
|
|
639
|
+
})
|
|
640
|
+
]);
|
|
543
641
|
};
|
|
544
|
-
},
|
|
545
|
-
render() {
|
|
546
|
-
const {
|
|
547
|
-
total,
|
|
548
|
-
pageIndex,
|
|
549
|
-
pageSizeOptions,
|
|
550
|
-
pageSizeDirection,
|
|
551
|
-
preLink,
|
|
552
|
-
nextLink,
|
|
553
|
-
size,
|
|
554
|
-
canJumpPage,
|
|
555
|
-
canChangePageSize,
|
|
556
|
-
canViewTotal,
|
|
557
|
-
totalItemText,
|
|
558
|
-
goToText,
|
|
559
|
-
maxItems,
|
|
560
|
-
showJumpButton,
|
|
561
|
-
showTruePageIndex,
|
|
562
|
-
lite,
|
|
563
|
-
showPageSelector,
|
|
564
|
-
haveConfigMenu,
|
|
565
|
-
autoHide,
|
|
566
|
-
$slots,
|
|
567
|
-
cursor,
|
|
568
|
-
totalPages,
|
|
569
|
-
currentPageSize,
|
|
570
|
-
pageSizeChange,
|
|
571
|
-
changeCursorEmit,
|
|
572
|
-
litePageOptions,
|
|
573
|
-
litePageIndexChange
|
|
574
|
-
} = this;
|
|
575
|
-
return autoHide && Math.min(...pageSizeOptions) > total ? null : createVNode("div", {
|
|
576
|
-
"class": "devui-pagination"
|
|
577
|
-
}, [
|
|
578
|
-
canChangePageSize && !lite && createVNode("div", {
|
|
579
|
-
"class": ["devui-page-size", size ? "devui-page-size-" + size : ""]
|
|
580
|
-
}, [createVNode(resolveComponent("d-select"), {
|
|
581
|
-
"options": pageSizeOptions,
|
|
582
|
-
"modelValue": currentPageSize,
|
|
583
|
-
"onValueChange": pageSizeChange,
|
|
584
|
-
"pageSizeDirection": pageSizeDirection
|
|
585
|
-
}, null)]),
|
|
586
|
-
(!lite || lite && showPageSelector) && canViewTotal && createVNode("div", {
|
|
587
|
-
"class": "devui-total-size"
|
|
588
|
-
}, [totalItemText, createTextVNode(": "), total]),
|
|
589
|
-
lite && showPageSelector && createVNode("div", {
|
|
590
|
-
"class": "devui-page-size"
|
|
591
|
-
}, [createVNode(resolveComponent("d-select"), {
|
|
592
|
-
"options": litePageOptions,
|
|
593
|
-
"disabled": total === 0,
|
|
594
|
-
"modelValue": cursor,
|
|
595
|
-
"onValueChange": litePageIndexChange,
|
|
596
|
-
"pageSizeDirection": pageSizeDirection
|
|
597
|
-
}, null)]),
|
|
598
|
-
createVNode(resolveComponent("page-num-btn"), mergeProps({
|
|
599
|
-
cursor,
|
|
600
|
-
totalPages,
|
|
601
|
-
size,
|
|
602
|
-
lite,
|
|
603
|
-
maxItems,
|
|
604
|
-
preLink,
|
|
605
|
-
nextLink,
|
|
606
|
-
showTruePageIndex
|
|
607
|
-
}, {
|
|
608
|
-
"onChangeCursorEmit": changeCursorEmit
|
|
609
|
-
}), null),
|
|
610
|
-
canJumpPage && !lite && createVNode(resolveComponent("jump-page"), mergeProps({
|
|
611
|
-
goToText,
|
|
612
|
-
size,
|
|
613
|
-
pageIndex,
|
|
614
|
-
totalPages,
|
|
615
|
-
cursor,
|
|
616
|
-
showJumpButton
|
|
617
|
-
}, {
|
|
618
|
-
"onChangeCursorEmit": changeCursorEmit
|
|
619
|
-
}), null),
|
|
620
|
-
lite && haveConfigMenu && createVNode(resolveComponent("config-menu"), {
|
|
621
|
-
currentPageSize,
|
|
622
|
-
pageSizeChange,
|
|
623
|
-
pageSizeOptions
|
|
624
|
-
}, {
|
|
625
|
-
default: () => {
|
|
626
|
-
var _a;
|
|
627
|
-
return [(_a = $slots.default) == null ? void 0 : _a.call($slots)];
|
|
628
|
-
}
|
|
629
|
-
})
|
|
630
|
-
]);
|
|
631
642
|
}
|
|
632
643
|
});
|
|
633
644
|
var index = {
|
package/pagination/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(p,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(p=typeof globalThis!="undefined"?globalThis:p||self,e(p.index={},p.Vue))})(this,function(p,e){"use strict";const w={pageSize:{type:Number,default:10},total:{type:Number,default:0},pageSizeOptions:{type:Array,default:()=>[5,10,20,50]},pageSizeDirection:{type:Array,default:()=>["centerDown","centerUp"]},pageIndex:{type:Number,default:1},maxItems:{type:Number,default:10},preLink:{type:String,default:"<"},nextLink:{type:String,default:">"},size:{type:String,default:""},canJumpPage:{type:Boolean,default:!1},canChangePageSize:{type:Boolean,default:!1},canViewTotal:{type:Boolean,default:!1},totalItemText:{type:String,default:"\u6240\u6709\u6761\u76EE"},goToText:{type:String,default:"\u8DF3\u81F3"},showJumpButton:{type:Boolean,default:!1},showTruePageIndex:{type:Boolean,default:!1},lite:{type:Boolean,default:!1},showPageSelector:{type:Boolean,default:!0},haveConfigMenu:{type:Boolean,default:!1},autoFixPageIndex:{type:Boolean,default:!0},autoHide:{type:Boolean,default:!1},"onUpdate:pageIndex":{type:Function},"onUpdate:pageSize":{type:Function},onPageIndexChange:{type:Function},onPageSizeChange:{type:Function}},L=(t,a,n)=>{const l=t,c=a;if(c>=n)return[2,n];const s=c-2;let o=l-(s>>1),i=l+(s-1>>1);return o<2&&(o=2,i=c-2),i>n&&(o=n-c+3,i=n),[o,i]};function j(t){return new Array(t||1).fill(0).map((a,n)=>({name:`${n+1}/${t}`,value:n+1}))}function b(t,a,n){document.addEventListener?t&&a&&n&&t.addEventListener(a,n,!1):t&&a&&n&&t.attachEvent("on"+a,n)}function M(t,a,n){document.removeEventListener?t&&a&&n&&t.removeEventListener(a,n,!1):t&&a&&n&&t.detachEvent("on"+a,n)}const D=typeof window!="undefined",f=Symbol("@@clickoutside"),z=new Map;let B,k=0,I=!0;function E(t,a,n){return D&&I&&(I=!1,b(document,"mousedown",l=>{B=l}),b(document,"mouseup",l=>{for(const[c,s]of z)s[f].documentHandler(l,B)})),function(l,c){!n||!a.instance||!l.target||!c.target||t.contains(l.target)||t.contains(c.target)||t===l.target||t[f].bindingFn&&t[f].bindingFn()}}const H={beforeMount:function(t,a,n){k++,z.set(k,t),t[f]={nid:k,documentHandler:E(t,a,n),bindingFn:a.value}},updated:function(t,a,n){t[f].documentHandler=E(t,a,n),t[f].bindingFn=a.value},unmounted:function(t){z.delete(t[f].nid),delete t[f]}};function V(t,a,n){let l=t;return a&&(l+=`__${a}`),n&&(l+=`--${n}`),l}function P(t,a=!1){const n=a?`.devui-${t}`:`devui-${t}`;return{b:()=>V(n),e:i=>i?V(n,i):"",m:i=>i?V(n,"",i):"",em:(i,r)=>i&&r?V(n,i,r):""}}var J=e.defineComponent({directives:{clickoutside:H},props:{currentPageSize:Number,pageSizeChange:Function,pageSizeOptions:Array},setup(){const t=e.ref(null),a=e.ref(!1),n=l=>{a.value=a.value?!1:!!l};return e.onMounted(()=>{b(t.value,"click",n)}),e.onUnmounted(()=>{M(t.value,"click",n)}),{paginationConfig:t,isShowConfig:a,closeConfigMenu:n}},render(){var i;const{closeConfigMenu:t,currentPageSize:a,pageSizeChange:n,pageSizeOptions:l,isShowConfig:c,$slots:s}=this,o=P("pagination");return e.withDirectives(e.createVNode("div",{class:o.e("config"),ref:"paginationConfig"},[e.createVNode("div",{class:o.e("setup-icon")},[e.createVNode("i",{class:"icon-setting",style:"font-weight: bold;"},null)]),c&&e.createVNode("div",{class:o.e("config-container")},[(i=s.default)==null?void 0:i.call(s),e.createVNode("div",{class:o.e("config-item")},[e.createVNode("div",{class:"config-item-title"},[e.createTextVNode("\u6BCF\u9875\u6761\u6570")]),e.createVNode("div",{class:o.e("number")},[l.map(r=>e.createVNode("div",{class:{choosed:r===a},key:r,onClick:n.bind(null,{value:r})},[r]))])])])]),[[e.resolveDirective("clickoutside"),t]])}});const O={goToText:String,size:{type:String,default:""},pageIndex:Number,showJumpButton:Boolean,totalPages:Number,cursor:Number,onChangeCursorEmit:Function};var A=e.defineComponent({props:O,emits:["changeCursorEmit"],setup(t,{emit:a}){const{pageIndex:n,totalPages:l,cursor:c}=e.toRefs(t),s=e.ref(n==null?void 0:n.value);e.watch(()=>n==null?void 0:n.value,d=>{s.value=d});let o=n==null?void 0:n.value;return{inputNum:s,jumpPageChange:d=>{o=+d,s.value=d,isNaN(d)&&setTimeout(()=>{s.value=n==null?void 0:n.value},300)},jump:d=>{o>(l==null?void 0:l.value)||(d==="btn"||d.key==="Enter")&&(c==null?void 0:c.value)!==o&&a("changeCursorEmit",o)}}},render(){const{goToText:t,size:a,inputNum:n,jumpPageChange:l,jump:c,showJumpButton:s}=this,o=P("pagination"),i={class:[o.e("input"),a?o.em("input",a):""],size:a,modelValue:String(n),"onUpdate:modelValue":l,onKeydown:c};return e.createVNode("div",{class:o.e("jump-container")},[t,e.createVNode(e.resolveComponent("d-input"),i,null),t==="\u8DF3\u81F3"&&"\u9875",s&&e.createVNode("div",{class:[o.e("jump-button"),a?o.em("jump-size",a):o.em("jump-size","default")],onClick:c.bind(null,"btn"),title:t},[e.createVNode("div",{class:o.e("go")},null)])])}});const U={size:{type:String,default:""},preLink:String,nextLink:String,lite:Boolean,cursor:Number,maxItems:Number,totalPages:Number,onChangeCursorEmit:Function,showTruePageIndex:Boolean};var $=e.defineComponent({props:U,emits:["changeCursorEmit"],setup(t,{emit:a}){return{showPageNum:e.computed(()=>L(t.cursor,t.maxItems,t.totalPages)),changeCursor:o=>{if(isNaN(o))return;const i=o<1?1:o>t.totalPages?t.totalPages:o|0;a("changeCursorEmit",i)},prevChange:o=>{if(t.cursor>1){const i=o===-1?t.cursor-1:o;a("changeCursorEmit",i)}},nextChange:o=>{if(t.cursor<t.totalPages){const i=o===-1?t.cursor+1:o;a("changeCursorEmit",i)}}}},render(){const{size:t,preLink:a,nextLink:n,lite:l,changeCursor:c,cursor:s,showPageNum:o,prevChange:i,totalPages:r,nextChange:d,showTruePageIndex:x}=this,u=P("pagination");return e.createVNode("ul",{class:[u.e("list"),t?u.m(t):""]},[e.createVNode("li",{onClick:i.bind(null,-1),class:{[u.e("item")]:!0,disabled:s<=1}},[e.createVNode("a",{innerHTML:a,class:u.e("link")},null)]),!l&&e.createVNode(e.Fragment,null,[e.createVNode("li",{onClick:c.bind(null,1),class:{[u.e("item")]:!0,active:s===1}},[e.createVNode("a",{class:u.e("link")},[e.createTextVNode("1")])]),o[0]>2&&e.createVNode("li",{onClick:i.bind(null,o[0]-1),class:u.e("item")},[e.createVNode("a",{class:u.e("link")},[e.createTextVNode("...")])]),(()=>{const S=[];for(let m=o[0];m<=o[1];m++)S.push(e.createVNode("li",{onClick:c.bind(null,m),key:m,class:{[u.e("item")]:!0,active:s===m}},[e.createVNode("a",{class:u.e("link")},[m])]));return S})(),o[1]<r-1&&e.createVNode("li",{onClick:d.bind(null,o[1]+1),class:u.e("item")},[e.createVNode("a",{class:u.e("link")},[e.createTextVNode("...")])]),o[1]<r&&e.createVNode("li",{onClick:c.bind(null,r),class:{[u.e("item")]:!0,active:s===r}},[e.createVNode("a",{class:u.e("link")},[r])]),x&&s>r&&r>0&&e.createVNode(e.Fragment,null,[s>r+1&&e.createVNode("li",{class:[u.e("item"),"disabled"]},[e.createVNode("a",{class:u.e("link")},[e.createTextVNode("...")])]),e.createVNode("li",{class:[u.e("item"),"disabled","active"]},[e.createVNode("a",{class:u.e("link")},[s])])])]),e.createVNode("li",{onClick:d.bind(null,-1),class:{[u.e("item")]:!0,disabled:s>=r}},[e.createVNode("a",{innerHTML:n,class:u.e("link")},null)])])}}),te="",v=e.defineComponent({name:"DPagination",components:{ConfigMenu:J,JumpPage:A,PageNumBtn:$},props:w,emits:["pageIndexChange","pageSizeChange","update:pageSize","update:pageIndex"],setup(t,{emit:a,slots:n}){const{autoHide:l,pageSizeOptions:c,total:s,canChangePageSize:o,lite:i,size:r,pageSizeDirection:d,showPageSelector:x,canViewTotal:u,totalItemText:S,maxItems:m,preLink:R,nextLink:q,showTruePageIndex:K,canJumpPage:G,goToText:Q,pageIndex:W,showJumpButton:X,haveConfigMenu:Y}=e.toRefs(t),h=P("pagination"),C=e.computed(()=>Math.ceil(t.total/t.pageSize)),Z=e.computed(()=>j(C.value)),N=e.computed({get(){return!t.showTruePageIndex&&t.pageIndex>C.value?(a("update:pageIndex",C.value||1),C.value||1):t.pageIndex||1},set(g){a("update:pageIndex",g)}}),T=e.computed({get(){return t.pageSize},set(g){a("update:pageSize",g)}}),y=g=>{N.value=g,a("pageIndexChange",g)},F=g=>{T.value=g.value,t.autoFixPageIndex&&e.nextTick(()=>{N.value>C.value&&y(C.value)}),a("pageSizeChange",g.value)},ee=g=>{y(g.value)};return()=>l.value&&Math.min(...c.value)>s.value?null:e.createVNode("div",{class:h.b()},[o.value&&!i.value&&e.createVNode("div",{class:[h.e("size"),r.value?h.em("size",r.value):""]},[e.createVNode(e.resolveComponent("d-select"),{options:c.value,modelValue:T.value,onValueChange:F,pageSizeDirection:d.value},null)]),(!i.value||i.value&&x.value)&&u.value&&e.createVNode("div",{class:h.e("total-size")},[S.value,e.createTextVNode(": "),s.value]),i.value&&x.value&&e.createVNode("div",{class:h.e("size")},[e.createVNode(e.resolveComponent("d-select"),{options:Z.value,disabled:s.value===0,modelValue:N.value,onValueChange:ee,pageSizeDirection:d.value},null)]),e.createVNode(e.resolveComponent("page-num-btn"),e.mergeProps({cursor:N.value,totalPages:C.value,size:r.value,lite:i.value,maxItems:m.value,preLink:R.value,nextLink:q.value,showTruePageIndex:K.value},{onChangeCursorEmit:y}),null),G.value&&!i.value&&e.createVNode(e.resolveComponent("jump-page"),e.mergeProps({goToText:Q.value,size:r.value,pageIndex:W.value,totalPages:C.value,cursor:N.value,showJumpButton:X.value},{onChangeCursorEmit:y}),null),i.value&&Y.value&&e.createVNode(e.resolveComponent("config-menu"),{currentPageSize:T.value,pageSizeChange:F,pageSizeOptions:c.value},{default:()=>{var g;return[(g=n.default)==null?void 0:g.call(n)]}})])}}),_={title:"Pagination \u5206\u9875",category:"\u5BFC\u822A",status:"100%",install(t){t.component(v.name,v)}};p.Pagination=v,p.default=_,p.paginationProps=w,Object.defineProperty(p,"__esModule",{value:!0}),p[Symbol.toStringTag]="Module"});
|
package/pagination/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.devui-pagination{font-size:var(--devui-font-size, 12px)}.devui-pagination .devui-
|
|
1
|
+
@charset "UTF-8";.devui-pagination{font-size:var(--devui-font-size, 12px)}.devui-pagination .devui-pagination__size{display:inline-block;max-width:100px;line-height:24px;margin:0 12px 0 0;position:relative;vertical-align:middle}.devui-pagination .devui-pagination__size.devui-pagination__size--sm{max-width:80px}.devui-pagination .devui-pagination__size.devui-pagination__size--sm .devui-select-input{height:24px}.devui-pagination .devui-pagination__size.devui-pagination__size--lg{max-width:100px}.devui-pagination .devui-pagination__size.devui-pagination__size--lg .devui-select-input,.devui-pagination .devui-pagination__size.devui-pagination__size--lg .devui-select-item{height:46px}.devui-pagination .devui-select-input{height:26px}.devui-pagination .devui-pagination__total-size{display:inline-block;position:relative;vertical-align:middle;margin:0 12px 0 0;color:var(--devui-text-weak, #575d6c)}.devui-pagination .devui-pagination__list,.devui-pagination .devui-pagination__item{padding:0;margin:0;list-style:none}.devui-pagination a{text-decoration:none;color:#3eaf7c}.devui-pagination .devui-pagination__list{vertical-align:middle;display:inline-flex;align-items:center}.devui-pagination .devui-pagination__list li.devui-pagination__item{cursor:pointer}.devui-pagination .devui-pagination__list li.devui-pagination__item.active a.devui-pagination__link{text-decoration:none;background-color:var(--devui-list-item-active-bg, #5e7ce0);color:var(--devui-list-item-active-text, #ffffff)}.devui-pagination .devui-pagination__list li.devui-pagination__item.disabled a.devui-pagination__link{cursor:not-allowed;opacity:.5;background-color:#fff;color:var(--devui-text-weak, #575d6c)}.devui-pagination .devui-pagination__list li.devui-pagination__item .devui-pagination__link{margin-left:5px;padding:3px 7px;line-height:1.5;border-radius:var(--devui-border-radius, 2px);color:var(--devui-text-weak, #575d6c);display:flex;align-items:center;transition:background-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-pagination .devui-pagination__list li.devui-pagination__item .devui-pagination__link:hover{text-decoration:none;background-color:var(--devui-list-item-hover-bg, #f2f5fc);color:var(--devui-list-item-hover-text, #526ecc)}.devui-pagination .devui-pagination__sm>li.devui-pagination__item>a.devui-pagination__link{padding:0 5px;min-width:18px;height:22px;line-height:1.5;font-size:var(--devui-font-size-sm, 12px)}.devui-pagination .devui-pagination__lg>li.devui-pagination__item>a.devui-pagination__link{padding:0 12px;height:38px;font-size:var(--devui-font-size-lg, 14px);line-height:1.5}.devui-pagination .devui-pagination__jump-container{display:inline-flex;position:relative;margin:0 12px;vertical-align:middle;align-items:center}.devui-pagination .devui-pagination__jump-container .devui-input{display:inline-block;width:42px;vertical-align:middle;margin:0 4px}.devui-pagination .devui-pagination__jump-container .devui-input--lg{width:56px}.devui-pagination .devui-pagination__jump-button{display:inline-flex;vertical-align:middle;width:24px;height:24px;border-radius:var(--devui-border-radius, 2px);border:1px solid var(--devui-line, #adb0b8);cursor:pointer;margin-left:4px;align-items:center;justify-content:center}.devui-pagination .devui-pagination__jump-button .devui-pagination__go{width:0;height:0;border-top:6px solid transparent;border-left:6px solid var(--devui-icon-text, #252b3a);border-bottom:6px solid transparent}.devui-pagination .devui-pagination__jump-button:hover{border-color:var(--devui-brand-active, #526ecc)}.devui-pagination .devui-pagination__jump-button:hover .devui-pagination__go{border-left-color:var(--devui-brand-active, #526ecc)}.devui-pagination .devui-pagination__jump-size--default{width:28px;height:28px}.devui-pagination .devui-pagination__jump-size--default .devui-pagination__go{width:0;height:0;border-top:8px solid transparent;border-left:10px solid var(--devui-icon-text, #252b3a);border-bottom:8px solid transparent}.devui-pagination .devui-pagination__jump-size--sm{width:24px;height:24px}.devui-pagination .devui-pagination__jump-size--sm .devui-pagination__go{width:0;height:0;border-top:6px solid transparent;border-left:6px solid var(--devui-icon-text, #252b3a);border-bottom:6px solid transparent}.devui-pagination .devui-pagination__jump-size--sm .devui-pagination__link{height:30px;line-height:32px}.devui-pagination .devui-pagination__jump-size--lg{width:46px;height:46px}.devui-pagination .devui-pagination__jump-size--lg .devui-pagination__go{width:0;height:0;border-top:14px solid transparent;border-left:14px solid var(--devui-icon-text, #252b3a);border-bottom:14px solid transparent}.devui-pagination .devui-pagination__config{color:var(--devui-text, #252b3a);position:relative;display:inline-block;vertical-align:middle;margin:0 4px}.devui-pagination .devui-pagination__setup-icon{line-height:30px;cursor:pointer;display:flex}.devui-pagination .devui-pagination__config-container{padding:4px 0;box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));border-radius:var(--devui-border-radius, 2px);width:150px;background-color:var(--devui-connected-overlay-bg, #ffffff);line-height:26px;position:absolute;left:-136px;top:28px;cursor:auto;z-index:var(--devui-z-index-dropdown, 1052);user-select:none}.devui-pagination .devui-pagination__config-item{padding-bottom:8px;padding-top:4px;border-bottom:1px solid var(--devui-line, #adb0b8)}.devui-pagination .devui-pagination__config-item:last-child{border-bottom:none}.devui-pagination .config-item-title{color:var(--devui-line, #adb0b8);padding-left:8px;font-size:var(--devui-font-size, 12px);line-height:1.5}.devui-pagination .devui-pagination__number{padding-left:8px;margin-top:4px;display:flex}.devui-pagination .devui-pagination__number div{color:var(--devui-text, #252b3a);cursor:pointer;border-top:1px solid var(--devui-line, #adb0b8);border-bottom:1px solid var(--devui-line, #adb0b8);border-right:1px solid var(--devui-line, #adb0b8);text-align:center;height:26px;width:26px}.devui-pagination .devui-pagination__number div:first-child{border-left:1px solid var(--devui-line, #adb0b8)}.devui-pagination .devui-pagination__number div:hover{background-color:var(--devui-list-item-hover-bg, #f2f5fc);color:var(--devui-list-item-hover-text, #526ecc)}.devui-pagination .devui-pagination__number div.choosed{color:var(--devui-list-item-active-text, #ffffff);background-color:var(--devui-list-item-active-bg, #5e7ce0)!important;cursor:auto!important}.devui-pagination .config-item-words{color:var(--devui-text, #252b3a);padding-left:8px;font-size:var(--devui-font-size, 12px);margin-top:4px}.devui-pagination .config-item-words:hover{background-color:var(--devui-area, #f8f8f8);cursor:pointer}
|