@uzum-tech/ui 2.1.3 → 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.
Files changed (111) hide show
  1. package/dist/index.js +1236 -530
  2. package/dist/index.mjs +1232 -531
  3. package/dist/index.prod.js +2 -2
  4. package/dist/index.prod.mjs +2 -2
  5. package/es/_internal/icon/index.d.ts +1 -1
  6. package/es/_internal/icon/index.mjs +1 -1
  7. package/es/_internal/icon/src/UIcon.d.ts +11 -1
  8. package/es/_internal/icon/src/UIcon.mjs +20 -8
  9. package/es/_internal/icon/src/interface.d.ts +11 -4
  10. package/es/_internal/icon/src/interface.mjs +4 -0
  11. package/es/_internal/icon/src/render-icon.d.ts +1 -0
  12. package/es/_internal/icon/src/render-icon.mjs +5 -0
  13. package/es/_internal/icons/SearchOutline.d.ts +2 -0
  14. package/es/_internal/icons/SearchOutline.mjs +18 -0
  15. package/es/_internal/icons/index.d.ts +1 -0
  16. package/es/_internal/icons/index.mjs +1 -0
  17. package/es/_mixins/use-form-item.mjs +5 -0
  18. package/es/_utils/dom/copy-to-clipboard.d.ts +1 -0
  19. package/es/_utils/dom/copy-to-clipboard.mjs +8 -0
  20. package/es/_utils/dom/index.d.ts +1 -0
  21. package/es/_utils/dom/index.mjs +1 -0
  22. package/es/components.d.ts +1169 -76
  23. package/es/components.mjs +4 -1
  24. package/es/config-provider/src/internal-interface.d.ts +4 -0
  25. package/es/data-table/src/use-table-data.d.ts +1 -1
  26. package/es/date-picker/src/DatePicker.mjs +7 -4
  27. package/es/icon/index.d.ts +1 -1
  28. package/es/icon/index.mjs +1 -1
  29. package/es/icon/src/Icon.d.ts +1 -1
  30. package/es/icon/src/Icon.mjs +1 -1
  31. package/es/icon-pack/index.d.ts +5 -0
  32. package/es/icon-pack/index.mjs +3 -0
  33. package/es/icon-pack/src/IconPack.d.ts +1047 -0
  34. package/es/icon-pack/src/IconPack.mjs +300 -0
  35. package/es/icon-pack/src/interface.d.ts +465 -0
  36. package/es/icon-pack/src/interface.mjs +75 -0
  37. package/es/icon-pack/src/styles/index.cssr.d.ts +2 -0
  38. package/es/icon-pack/src/styles/index.cssr.mjs +131 -0
  39. package/es/icon-pack/styles/dark.d.ts +123 -0
  40. package/es/icon-pack/styles/dark.mjs +20 -0
  41. package/es/icon-pack/styles/index.d.ts +3 -0
  42. package/es/icon-pack/styles/index.mjs +2 -0
  43. package/es/icon-pack/styles/light.d.ts +143 -0
  44. package/es/icon-pack/styles/light.mjs +64 -0
  45. package/es/icon-wrapper/src/IconWrapper.d.ts +1 -1
  46. package/es/input/src/Input.mjs +3 -1
  47. package/es/pagination/index.d.ts +3 -3
  48. package/es/pagination/index.mjs +2 -1
  49. package/es/pagination/src/Pagination.d.ts +74 -1379
  50. package/es/pagination/src/Pagination.mjs +28 -63
  51. package/es/pagination/src/interface.d.ts +1345 -1
  52. package/es/pagination/src/interface.mjs +68 -1
  53. package/es/themes/dark.mjs +2 -0
  54. package/es/themes/light.mjs +2 -0
  55. package/es/version.d.ts +1 -1
  56. package/es/version.mjs +1 -1
  57. package/lib/_internal/icon/index.d.ts +1 -1
  58. package/lib/_internal/icon/index.js +2 -1
  59. package/lib/_internal/icon/src/UIcon.d.ts +11 -1
  60. package/lib/_internal/icon/src/UIcon.js +17 -6
  61. package/lib/_internal/icon/src/interface.d.ts +11 -4
  62. package/lib/_internal/icon/src/interface.js +1 -1
  63. package/lib/_internal/icon/src/render-icon.d.ts +1 -0
  64. package/lib/_internal/icon/src/render-icon.js +4 -0
  65. package/lib/_internal/icons/SearchOutline.d.ts +2 -0
  66. package/lib/_internal/icons/SearchOutline.js +10 -0
  67. package/lib/_internal/icons/index.d.ts +1 -0
  68. package/lib/_internal/icons/index.js +3 -1
  69. package/lib/_mixins/use-form-item.js +5 -0
  70. package/lib/_utils/dom/copy-to-clipboard.d.ts +1 -0
  71. package/lib/_utils/dom/copy-to-clipboard.js +11 -0
  72. package/lib/_utils/dom/index.d.ts +1 -0
  73. package/lib/_utils/dom/index.js +3 -1
  74. package/lib/components.d.ts +1169 -76
  75. package/lib/components.js +12 -5
  76. package/lib/config-provider/src/internal-interface.d.ts +4 -0
  77. package/lib/data-table/src/use-table-data.d.ts +1 -1
  78. package/lib/date-picker/src/DatePicker.js +5 -4
  79. package/lib/icon/index.d.ts +1 -1
  80. package/lib/icon/index.js +2 -1
  81. package/lib/icon/src/Icon.d.ts +1 -1
  82. package/lib/icon/src/Icon.js +2 -1
  83. package/lib/icon-pack/index.d.ts +5 -0
  84. package/lib/icon-pack/index.js +13 -0
  85. package/lib/icon-pack/src/IconPack.d.ts +1047 -0
  86. package/lib/icon-pack/src/IconPack.js +240 -0
  87. package/lib/icon-pack/src/interface.d.ts +465 -0
  88. package/lib/icon-pack/src/interface.js +49 -0
  89. package/lib/icon-pack/src/styles/index.cssr.d.ts +2 -0
  90. package/lib/icon-pack/src/styles/index.cssr.js +136 -0
  91. package/lib/icon-pack/styles/dark.d.ts +123 -0
  92. package/lib/icon-pack/styles/dark.js +22 -0
  93. package/lib/icon-pack/styles/index.d.ts +3 -0
  94. package/lib/icon-pack/styles/index.js +10 -0
  95. package/lib/icon-pack/styles/light.d.ts +143 -0
  96. package/lib/icon-pack/styles/light.js +46 -0
  97. package/lib/icon-wrapper/src/IconWrapper.d.ts +1 -1
  98. package/lib/input/src/Input.js +3 -1
  99. package/lib/pagination/index.d.ts +3 -3
  100. package/lib/pagination/index.js +2 -1
  101. package/lib/pagination/src/Pagination.d.ts +74 -1379
  102. package/lib/pagination/src/Pagination.js +27 -40
  103. package/lib/pagination/src/interface.d.ts +1345 -1
  104. package/lib/pagination/src/interface.js +37 -0
  105. package/lib/themes/dark.js +110 -108
  106. package/lib/themes/light.js +110 -108
  107. package/lib/version.d.ts +1 -1
  108. package/lib/version.js +1 -1
  109. package/package.json +1 -1
  110. package/volar.d.ts +1 -0
  111. package/web-types.json +263 -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, useAdjustedTo, warn, warnOnce } from "../../_utils/index.mjs";
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`, (mergedPage <= 1 || mergedPage > mergedPageCount || disabled) && `${mergedClsPrefix}-pagination-item--disabled`],
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`]: mergedPage < 1 || mergedPage >= mergedPageCount || disabled
646
+ [`${mergedClsPrefix}-pagination-item--disabled`]: !mergedHasNext || disabled
682
647
  }],
683
648
  onClick: handleForwardClick
684
649
  }, renderNext ? renderNext({