@uzum-tech/ui 2.1.4 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1221 -527
- package/dist/index.mjs +1218 -528
- package/dist/index.prod.js +2 -2
- package/dist/index.prod.mjs +2 -2
- package/es/_internal/icon/src/UIcon.mjs +17 -9
- package/es/_internal/icons/SearchOutline.d.ts +2 -0
- package/es/_internal/icons/SearchOutline.mjs +18 -0
- package/es/_internal/icons/index.d.ts +1 -0
- package/es/_internal/icons/index.mjs +1 -0
- package/es/_utils/dom/copy-to-clipboard.d.ts +1 -0
- package/es/_utils/dom/copy-to-clipboard.mjs +8 -0
- package/es/_utils/dom/index.d.ts +1 -0
- package/es/_utils/dom/index.mjs +1 -0
- package/es/components.d.ts +1083 -4
- package/es/components.mjs +3 -0
- package/es/config-provider/src/internal-interface.d.ts +4 -0
- package/es/data-table/src/use-table-data.d.ts +1 -1
- package/es/icon-pack/index.d.ts +5 -0
- package/es/icon-pack/index.mjs +3 -0
- package/es/icon-pack/src/IconPack.d.ts +1047 -0
- package/es/icon-pack/src/IconPack.mjs +300 -0
- package/es/icon-pack/src/interface.d.ts +465 -0
- package/es/icon-pack/src/interface.mjs +75 -0
- package/es/icon-pack/src/styles/index.cssr.d.ts +2 -0
- package/es/icon-pack/src/styles/index.cssr.mjs +131 -0
- package/es/icon-pack/styles/dark.d.ts +123 -0
- package/es/icon-pack/styles/dark.mjs +20 -0
- package/es/icon-pack/styles/index.d.ts +3 -0
- package/es/icon-pack/styles/index.mjs +2 -0
- package/es/icon-pack/styles/light.d.ts +143 -0
- package/es/icon-pack/styles/light.mjs +64 -0
- package/es/icon-wrapper/src/IconWrapper.d.ts +1 -1
- package/es/input/src/Input.mjs +3 -1
- package/es/pagination/index.d.ts +3 -3
- package/es/pagination/index.mjs +2 -1
- package/es/pagination/src/Pagination.d.ts +78 -1379
- package/es/pagination/src/Pagination.mjs +36 -63
- package/es/pagination/src/interface.d.ts +1347 -1
- package/es/pagination/src/interface.mjs +70 -1
- package/es/themes/dark.mjs +2 -0
- package/es/themes/light.mjs +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_internal/icon/src/UIcon.js +15 -8
- package/lib/_internal/icons/SearchOutline.d.ts +2 -0
- package/lib/_internal/icons/SearchOutline.js +10 -0
- package/lib/_internal/icons/index.d.ts +1 -0
- package/lib/_internal/icons/index.js +3 -1
- package/lib/_utils/dom/copy-to-clipboard.d.ts +1 -0
- package/lib/_utils/dom/copy-to-clipboard.js +11 -0
- package/lib/_utils/dom/index.d.ts +1 -0
- package/lib/_utils/dom/index.js +3 -1
- package/lib/components.d.ts +1083 -4
- package/lib/components.js +11 -5
- package/lib/config-provider/src/internal-interface.d.ts +4 -0
- package/lib/data-table/src/use-table-data.d.ts +1 -1
- package/lib/icon-pack/index.d.ts +5 -0
- package/lib/icon-pack/index.js +13 -0
- package/lib/icon-pack/src/IconPack.d.ts +1047 -0
- package/lib/icon-pack/src/IconPack.js +240 -0
- package/lib/icon-pack/src/interface.d.ts +465 -0
- package/lib/icon-pack/src/interface.js +49 -0
- package/lib/icon-pack/src/styles/index.cssr.d.ts +2 -0
- package/lib/icon-pack/src/styles/index.cssr.js +136 -0
- package/lib/icon-pack/styles/dark.d.ts +123 -0
- package/lib/icon-pack/styles/dark.js +22 -0
- package/lib/icon-pack/styles/index.d.ts +3 -0
- package/lib/icon-pack/styles/index.js +10 -0
- package/lib/icon-pack/styles/light.d.ts +143 -0
- package/lib/icon-pack/styles/light.js +46 -0
- package/lib/icon-wrapper/src/IconWrapper.d.ts +1 -1
- package/lib/input/src/Input.js +3 -1
- package/lib/pagination/index.d.ts +3 -3
- package/lib/pagination/index.js +2 -1
- package/lib/pagination/src/Pagination.d.ts +78 -1379
- package/lib/pagination/src/Pagination.js +33 -40
- package/lib/pagination/src/interface.d.ts +1347 -1
- package/lib/pagination/src/interface.js +37 -0
- package/lib/themes/dark.js +110 -108
- package/lib/themes/light.js +110 -108
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/volar.d.ts +1 -0
- package/web-types.json +272 -1
|
@@ -4,67 +4,14 @@ import { UBaseIcon } from "../../_internal/index.mjs";
|
|
|
4
4
|
import { BackwardIcon, FastBackwardIcon, FastForwardIcon, ForwardIcon, MoreIcon } from "../../_internal/icons/index.mjs";
|
|
5
5
|
import { useConfig, useLocale, useTheme, useThemeClass } from "../../_mixins/index.mjs";
|
|
6
6
|
import { useRtl } from "../../_mixins/use-rtl.mjs";
|
|
7
|
-
import { call, createKey, resolveSlot, smallerSize,
|
|
7
|
+
import { call, createKey, resolveSlot, smallerSize, warn, warnOnce } from "../../_utils/index.mjs";
|
|
8
8
|
import { UInput } from "../../input/index.mjs";
|
|
9
9
|
import { UPopselect } from "../../popselect/index.mjs";
|
|
10
10
|
import { USelect } from "../../select/index.mjs";
|
|
11
11
|
import { paginationLight } from "../styles/index.mjs";
|
|
12
|
+
import { paginationProps } from "./interface.mjs";
|
|
12
13
|
import style from "./styles/index.cssr.mjs";
|
|
13
14
|
import { createPageItemsInfo } from "./utils.mjs";
|
|
14
|
-
export const paginationProps = Object.assign(Object.assign({}, useTheme.props), {
|
|
15
|
-
simple: Boolean,
|
|
16
|
-
page: Number,
|
|
17
|
-
defaultPage: {
|
|
18
|
-
type: Number,
|
|
19
|
-
default: 1
|
|
20
|
-
},
|
|
21
|
-
itemCount: Number,
|
|
22
|
-
pageCount: Number,
|
|
23
|
-
defaultPageCount: {
|
|
24
|
-
type: Number,
|
|
25
|
-
default: 1
|
|
26
|
-
},
|
|
27
|
-
showSizePicker: Boolean,
|
|
28
|
-
sizePickerLabel: String,
|
|
29
|
-
pageSize: Number,
|
|
30
|
-
defaultPageSize: Number,
|
|
31
|
-
pageSizes: {
|
|
32
|
-
type: Array,
|
|
33
|
-
default() {
|
|
34
|
-
return [10];
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
showQuickJumper: Boolean,
|
|
38
|
-
size: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: 'medium'
|
|
41
|
-
},
|
|
42
|
-
disabled: Boolean,
|
|
43
|
-
pageSlot: {
|
|
44
|
-
type: Number,
|
|
45
|
-
default: 9
|
|
46
|
-
},
|
|
47
|
-
selectProps: Object,
|
|
48
|
-
prev: Function,
|
|
49
|
-
next: Function,
|
|
50
|
-
goto: Function,
|
|
51
|
-
prefix: Function,
|
|
52
|
-
suffix: Function,
|
|
53
|
-
label: Function,
|
|
54
|
-
displayOrder: {
|
|
55
|
-
type: Array,
|
|
56
|
-
default: ['size-picker', 'pages', 'quick-jumper']
|
|
57
|
-
},
|
|
58
|
-
to: useAdjustedTo.propTo,
|
|
59
|
-
'onUpdate:page': [Function, Array],
|
|
60
|
-
onUpdatePage: [Function, Array],
|
|
61
|
-
'onUpdate:pageSize': [Function, Array],
|
|
62
|
-
onUpdatePageSize: [Function, Array],
|
|
63
|
-
/** @deprecated */
|
|
64
|
-
onPageSizeChange: [Function, Array],
|
|
65
|
-
/** @deprecated */
|
|
66
|
-
onChange: [Function, Array]
|
|
67
|
-
});
|
|
68
15
|
export default defineComponent({
|
|
69
16
|
name: 'Pagination',
|
|
70
17
|
props: paginationProps,
|
|
@@ -108,7 +55,6 @@ export default defineComponent({
|
|
|
108
55
|
const mergedPageRef = useMergedState(toRef(props, 'page'), uncontrolledPageRef);
|
|
109
56
|
const mergedPageSizeRef = useMergedState(toRef(props, 'pageSize'), uncontrolledPageSizeRef);
|
|
110
57
|
const mergedPageCountRef = computed(() => {
|
|
111
|
-
// item count has high priority, for it can affect prefix slot rendering
|
|
112
58
|
const {
|
|
113
59
|
itemCount
|
|
114
60
|
} = props;
|
|
@@ -121,6 +67,20 @@ export default defineComponent({
|
|
|
121
67
|
if (pageCount !== undefined) return Math.max(pageCount, 1);
|
|
122
68
|
return 1;
|
|
123
69
|
});
|
|
70
|
+
const mergedHasPrevRef = computed(() => {
|
|
71
|
+
const {
|
|
72
|
+
hasPrev
|
|
73
|
+
} = props;
|
|
74
|
+
if (hasPrev !== undefined) return hasPrev;
|
|
75
|
+
return mergedPageRef.value > 1;
|
|
76
|
+
});
|
|
77
|
+
const mergedHasNextRef = computed(() => {
|
|
78
|
+
const {
|
|
79
|
+
hasNext
|
|
80
|
+
} = props;
|
|
81
|
+
if (hasNext !== undefined) return hasNext;
|
|
82
|
+
return mergedPageRef.value < mergedPageCountRef.value;
|
|
83
|
+
});
|
|
124
84
|
const jumperValueRef = ref('');
|
|
125
85
|
watchEffect(() => {
|
|
126
86
|
void props.simple;
|
|
@@ -256,13 +216,21 @@ export default defineComponent({
|
|
|
256
216
|
}
|
|
257
217
|
}
|
|
258
218
|
function forward() {
|
|
259
|
-
if (props.disabled) return;
|
|
260
|
-
const page = Math.min(mergedPageRef.value + 1, mergedPageCountRef.value);
|
|
219
|
+
if (props.disabled || !mergedHasNextRef.value) return;
|
|
220
|
+
const page = props.hasNext === undefined ? Math.min(mergedPageRef.value + 1, mergedPageCountRef.value) : mergedPageRef.value + 1;
|
|
221
|
+
const {
|
|
222
|
+
onNext
|
|
223
|
+
} = props;
|
|
224
|
+
if (onNext) call(onNext, page);
|
|
261
225
|
doUpdatePage(page);
|
|
262
226
|
}
|
|
263
227
|
function backward() {
|
|
264
|
-
if (props.disabled) return;
|
|
228
|
+
if (props.disabled || !mergedHasPrevRef.value) return;
|
|
265
229
|
const page = Math.max(mergedPageRef.value - 1, 1);
|
|
230
|
+
const {
|
|
231
|
+
onPrev
|
|
232
|
+
} = props;
|
|
233
|
+
if (onPrev) call(onPrev, page);
|
|
266
234
|
doUpdatePage(page);
|
|
267
235
|
}
|
|
268
236
|
function fastForward() {
|
|
@@ -428,6 +396,8 @@ export default defineComponent({
|
|
|
428
396
|
locale: localeRef,
|
|
429
397
|
selfRef,
|
|
430
398
|
mergedPage: mergedPageRef,
|
|
399
|
+
mergedHasPrev: mergedHasPrevRef,
|
|
400
|
+
mergedHasNext: mergedHasNextRef,
|
|
431
401
|
pageItems: computed(() => {
|
|
432
402
|
return pageItemsInfo.value.items;
|
|
433
403
|
}),
|
|
@@ -470,6 +440,9 @@ export default defineComponent({
|
|
|
470
440
|
cssVars,
|
|
471
441
|
mergedPage,
|
|
472
442
|
mergedPageCount,
|
|
443
|
+
mergedHasPrev,
|
|
444
|
+
mergedHasNext,
|
|
445
|
+
variant,
|
|
473
446
|
pageItems,
|
|
474
447
|
showSizePicker,
|
|
475
448
|
sizePickerLabel,
|
|
@@ -504,7 +477,7 @@ export default defineComponent({
|
|
|
504
477
|
const renderLabel = label || $slots.label;
|
|
505
478
|
return h("div", {
|
|
506
479
|
ref: "selfRef",
|
|
507
|
-
class: [`${mergedClsPrefix}-pagination`, this.themeClass, this.rtlEnabled && `${mergedClsPrefix}-pagination--rtl`, disabled && `${mergedClsPrefix}-pagination--disabled`, simple && `${mergedClsPrefix}-pagination--simple`],
|
|
480
|
+
class: [`${mergedClsPrefix}-pagination`, this.themeClass, this.rtlEnabled && `${mergedClsPrefix}-pagination--rtl`, disabled && `${mergedClsPrefix}-pagination--disabled`, simple && `${mergedClsPrefix}-pagination--simple`, variant === 'cursor' && `${mergedClsPrefix}-pagination--cursor`],
|
|
508
481
|
style: cssVars
|
|
509
482
|
}, renderPrefix ? h("div", {
|
|
510
483
|
class: `${mergedClsPrefix}-pagination-prefix`
|
|
@@ -521,7 +494,7 @@ export default defineComponent({
|
|
|
521
494
|
return h("div", {
|
|
522
495
|
class: `${mergedClsPrefix}-pagination-pages`
|
|
523
496
|
}, h(Fragment, null, h("div", {
|
|
524
|
-
class: [`${mergedClsPrefix}-pagination-item`, !renderPrev && `${mergedClsPrefix}-pagination-item--button`, (
|
|
497
|
+
class: [`${mergedClsPrefix}-pagination-item`, !renderPrev && `${mergedClsPrefix}-pagination-item--button`, (!mergedHasPrev || disabled) && `${mergedClsPrefix}-pagination-item--disabled`],
|
|
525
498
|
onClick: handleBackwardClick
|
|
526
499
|
}, renderPrev ? renderPrev({
|
|
527
500
|
page: mergedPage,
|
|
@@ -534,7 +507,7 @@ export default defineComponent({
|
|
|
534
507
|
clsPrefix: mergedClsPrefix
|
|
535
508
|
}, {
|
|
536
509
|
default: () => this.rtlEnabled ? h(ForwardIcon, null) : h(BackwardIcon, null)
|
|
537
|
-
})), simple ? h(Fragment, null, h("div", {
|
|
510
|
+
})), variant === 'cursor' ? null : simple ? h(Fragment, null, h("div", {
|
|
538
511
|
class: `${mergedClsPrefix}-pagination-quick-jumper`
|
|
539
512
|
}, h(UInput, {
|
|
540
513
|
value: jumperValue,
|
|
@@ -678,7 +651,7 @@ export default defineComponent({
|
|
|
678
651
|
}
|
|
679
652
|
}), h("div", {
|
|
680
653
|
class: [`${mergedClsPrefix}-pagination-item`, !renderNext && `${mergedClsPrefix}-pagination-item--button`, {
|
|
681
|
-
[`${mergedClsPrefix}-pagination-item--disabled`]:
|
|
654
|
+
[`${mergedClsPrefix}-pagination-item--disabled`]: !mergedHasNext || disabled
|
|
682
655
|
}],
|
|
683
656
|
onClick: handleForwardClick
|
|
684
657
|
}, renderNext ? renderNext({
|