@uzum-tech/ui 2.1.4 → 2.2.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/index.js +1213 -527
- package/dist/index.mjs +1210 -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 +1079 -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 +74 -1379
- package/es/pagination/src/Pagination.mjs +28 -63
- package/es/pagination/src/interface.d.ts +1345 -1
- package/es/pagination/src/interface.mjs +68 -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 +1079 -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 +74 -1379
- package/lib/pagination/src/Pagination.js +27 -40
- package/lib/pagination/src/interface.d.ts +1345 -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 +1 -1
- package/volar.d.ts +1 -0
- package/web-types.json +258 -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,12 +216,12 @@ 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;
|
|
261
221
|
doUpdatePage(page);
|
|
262
222
|
}
|
|
263
223
|
function backward() {
|
|
264
|
-
if (props.disabled) return;
|
|
224
|
+
if (props.disabled || !mergedHasPrevRef.value) return;
|
|
265
225
|
const page = Math.max(mergedPageRef.value - 1, 1);
|
|
266
226
|
doUpdatePage(page);
|
|
267
227
|
}
|
|
@@ -428,6 +388,8 @@ export default defineComponent({
|
|
|
428
388
|
locale: localeRef,
|
|
429
389
|
selfRef,
|
|
430
390
|
mergedPage: mergedPageRef,
|
|
391
|
+
mergedHasPrev: mergedHasPrevRef,
|
|
392
|
+
mergedHasNext: mergedHasNextRef,
|
|
431
393
|
pageItems: computed(() => {
|
|
432
394
|
return pageItemsInfo.value.items;
|
|
433
395
|
}),
|
|
@@ -470,6 +432,9 @@ export default defineComponent({
|
|
|
470
432
|
cssVars,
|
|
471
433
|
mergedPage,
|
|
472
434
|
mergedPageCount,
|
|
435
|
+
mergedHasPrev,
|
|
436
|
+
mergedHasNext,
|
|
437
|
+
variant,
|
|
473
438
|
pageItems,
|
|
474
439
|
showSizePicker,
|
|
475
440
|
sizePickerLabel,
|
|
@@ -504,7 +469,7 @@ export default defineComponent({
|
|
|
504
469
|
const renderLabel = label || $slots.label;
|
|
505
470
|
return h("div", {
|
|
506
471
|
ref: "selfRef",
|
|
507
|
-
class: [`${mergedClsPrefix}-pagination`, this.themeClass, this.rtlEnabled && `${mergedClsPrefix}-pagination--rtl`, disabled && `${mergedClsPrefix}-pagination--disabled`, simple && `${mergedClsPrefix}-pagination--simple`],
|
|
472
|
+
class: [`${mergedClsPrefix}-pagination`, this.themeClass, this.rtlEnabled && `${mergedClsPrefix}-pagination--rtl`, disabled && `${mergedClsPrefix}-pagination--disabled`, simple && `${mergedClsPrefix}-pagination--simple`, variant === 'cursor' && `${mergedClsPrefix}-pagination--cursor`],
|
|
508
473
|
style: cssVars
|
|
509
474
|
}, renderPrefix ? h("div", {
|
|
510
475
|
class: `${mergedClsPrefix}-pagination-prefix`
|
|
@@ -521,7 +486,7 @@ export default defineComponent({
|
|
|
521
486
|
return h("div", {
|
|
522
487
|
class: `${mergedClsPrefix}-pagination-pages`
|
|
523
488
|
}, h(Fragment, null, h("div", {
|
|
524
|
-
class: [`${mergedClsPrefix}-pagination-item`, !renderPrev && `${mergedClsPrefix}-pagination-item--button`, (
|
|
489
|
+
class: [`${mergedClsPrefix}-pagination-item`, !renderPrev && `${mergedClsPrefix}-pagination-item--button`, (!mergedHasPrev || disabled) && `${mergedClsPrefix}-pagination-item--disabled`],
|
|
525
490
|
onClick: handleBackwardClick
|
|
526
491
|
}, renderPrev ? renderPrev({
|
|
527
492
|
page: mergedPage,
|
|
@@ -534,7 +499,7 @@ export default defineComponent({
|
|
|
534
499
|
clsPrefix: mergedClsPrefix
|
|
535
500
|
}, {
|
|
536
501
|
default: () => this.rtlEnabled ? h(ForwardIcon, null) : h(BackwardIcon, null)
|
|
537
|
-
})), simple ? h(Fragment, null, h("div", {
|
|
502
|
+
})), variant === 'cursor' ? null : simple ? h(Fragment, null, h("div", {
|
|
538
503
|
class: `${mergedClsPrefix}-pagination-quick-jumper`
|
|
539
504
|
}, h(UInput, {
|
|
540
505
|
value: jumperValue,
|
|
@@ -678,7 +643,7 @@ export default defineComponent({
|
|
|
678
643
|
}
|
|
679
644
|
}), h("div", {
|
|
680
645
|
class: [`${mergedClsPrefix}-pagination-item`, !renderNext && `${mergedClsPrefix}-pagination-item--button`, {
|
|
681
|
-
[`${mergedClsPrefix}-pagination-item--disabled`]:
|
|
646
|
+
[`${mergedClsPrefix}-pagination-item--disabled`]: !mergedHasNext || disabled
|
|
682
647
|
}],
|
|
683
648
|
onClick: handleForwardClick
|
|
684
649
|
}, renderNext ? renderNext({
|