@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
@@ -1,5 +1,5 @@
1
1
  export { default as UBaseIcon } from './src/Icon';
2
2
  export { iconProps } from './src/interface';
3
3
  export type { Depth, GenericUIcon, IconNameOf, IconProps, RenderIconProps } from './src/interface';
4
- export { renderIcon } from './src/render-icon';
4
+ export { renderAsyncIcon, renderIcon } from './src/render-icon';
5
5
  export { UIcon } from './src/UIcon';
@@ -1,4 +1,4 @@
1
1
  export { default as UBaseIcon } from "./src/Icon.mjs";
2
2
  export { iconProps } from "./src/interface.mjs";
3
- export { renderIcon } from "./src/render-icon.mjs";
3
+ export { renderAsyncIcon, renderIcon } from "./src/render-icon.mjs";
4
4
  export { UIcon } from "./src/UIcon.mjs";
@@ -7,6 +7,10 @@ declare const UIconImpl: import("vue").DefineComponent<import("vue").ExtractProp
7
7
  readonly component: import("vue").PropType<import("vue").Component>;
8
8
  readonly name: import("vue").PropType<string>;
9
9
  readonly pack: import("vue").PropType<import("../../..").IconPackName>;
10
+ readonly async: {
11
+ readonly type: BooleanConstructor;
12
+ readonly default: undefined;
13
+ };
10
14
  readonly onClick: import("vue").PropType<(e: MouseEvent) => void>;
11
15
  readonly theme: import("vue").PropType<import("../../../_mixins").Theme<"Icon", {
12
16
  color: string;
@@ -53,6 +57,10 @@ declare const UIconImpl: import("vue").DefineComponent<import("vue").ExtractProp
53
57
  readonly component: import("vue").PropType<import("vue").Component>;
54
58
  readonly name: import("vue").PropType<string>;
55
59
  readonly pack: import("vue").PropType<import("../../..").IconPackName>;
60
+ readonly async: {
61
+ readonly type: BooleanConstructor;
62
+ readonly default: undefined;
63
+ };
56
64
  readonly onClick: import("vue").PropType<(e: MouseEvent) => void>;
57
65
  readonly theme: import("vue").PropType<import("../../../_mixins").Theme<"Icon", {
58
66
  color: string;
@@ -78,6 +86,8 @@ declare const UIconImpl: import("vue").DefineComponent<import("vue").ExtractProp
78
86
  opacity4Depth: string;
79
87
  opacity5Depth: string;
80
88
  }, any>>>;
81
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
89
+ }>> & Readonly<{}>, {
90
+ readonly async: boolean;
91
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
82
92
  export declare const UIcon: typeof UIconImpl & GenericUIcon;
83
93
  export {};
@@ -1,10 +1,11 @@
1
1
  import { computed, defineComponent, h } from 'vue';
2
2
  import { useConfig, useTheme, useThemeClass } from "../../../_mixins/index.mjs";
3
- import { formatLength, warn } from "../../../_utils/index.mjs";
3
+ import { formatLength, warn, warnOnce } from "../../../_utils/index.mjs";
4
4
  import style from "../../../icon/src/styles/index.cssr.mjs";
5
5
  import { iconLight } from "../../../icon/styles/index.mjs";
6
6
  import UBaseIcon from "./Icon.mjs";
7
7
  import { iconProps } from "./interface.mjs";
8
+ const FALLBACK_ICON = '&#65533';
8
9
  const UIconImpl = defineComponent({
9
10
  _n_icon__: true,
10
11
  name: 'Icon',
@@ -45,6 +46,7 @@ const UIconImpl = defineComponent({
45
46
  });
46
47
  const themeClassHandle = inlineThemeDisabled ? useThemeClass('icon', computed(() => `${props.depth || 'd'}`), cssVarsRef, props) : undefined;
47
48
  const resolvedPackedIconRef = computed(() => {
49
+ var _a;
48
50
  const {
49
51
  name,
50
52
  pack
@@ -61,14 +63,24 @@ const UIconImpl = defineComponent({
61
63
  warn('icon', `icon pack "${targetName}" not found`);
62
64
  return null;
63
65
  }
64
- if (config.async) {
65
- return target.renderAsyncIcon(name);
66
+ try {
67
+ if ((_a = props.async) !== null && _a !== void 0 ? _a : config.async) {
68
+ if ('renderIcon' in target) {
69
+ warnOnce('icon', `pack "${target.name}" is a sync pack rendered in async mode — its icons are already bundled, so async loads them again at runtime. Register the async pack ("${target.name}Async") or drop \`async\`.`);
70
+ }
71
+ return target.renderAsyncIcon(name);
72
+ }
73
+ if (!('renderIcon' in target)) {
74
+ warn('icon', `pack "${target.name}" is async-only, set \`async: true\` on \`u-config-provider :icon-packs\``);
75
+ return null;
76
+ }
77
+ return target.renderIcon(name);
78
+ } catch (err) {
79
+ warnOnce('icon', `icon "${name}" not found in pack "${target.name}", rendering fallback (${err.message})`);
80
+ return h('span', {
81
+ innerHTML: FALLBACK_ICON
82
+ });
66
83
  }
67
- if (!('renderIcon' in target)) {
68
- warn('icon', `pack "${target.name}" is async-only, set \`async: true\` on \`u-config-provider :icon-packs\``);
69
- return null;
70
- }
71
- return target.renderIcon(name);
72
84
  });
73
85
  return {
74
86
  mergedClsPrefix: mergedClsPrefixRef,
@@ -2,8 +2,6 @@ import type { IconPackBase, IconPackRegistry } from '@uzum-tech/icons';
2
2
  import type { Component, PropType, VNodeChild } from 'vue';
3
3
  import type { ExtractPublicPropTypes } from '../../../_utils';
4
4
  import type { IconPackName } from '../../../config-provider/src/internal-interface';
5
- export type Depth = 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5' | undefined;
6
- export type IconNameOf<P extends IconPackName> = IconPackRegistry extends Record<P, infer Pack> ? Pack extends IconPackBase<infer Name> ? Name : string : string;
7
5
  export declare const iconProps: {
8
6
  readonly depth: PropType<Depth>;
9
7
  readonly size: PropType<number | string>;
@@ -11,6 +9,10 @@ export declare const iconProps: {
11
9
  readonly component: PropType<Component>;
12
10
  readonly name: PropType<string>;
13
11
  readonly pack: PropType<IconPackName>;
12
+ readonly async: {
13
+ readonly type: BooleanConstructor;
14
+ readonly default: undefined;
15
+ };
14
16
  readonly onClick: PropType<(e: MouseEvent) => void>;
15
17
  readonly theme: PropType<import("../../../_mixins").Theme<"Icon", {
16
18
  color: string;
@@ -37,8 +39,14 @@ export declare const iconProps: {
37
39
  opacity5Depth: string;
38
40
  }, any>>>;
39
41
  };
42
+ export interface IconNameResolver<P extends IconPackName> {
43
+ name: IconPackRegistry extends Record<P, IconPackBase<infer Name>> ? Name : string;
44
+ }
45
+ export type DepthBase = 1 | 2 | 3 | 4 | 5;
46
+ export type Depth = DepthBase | `${DepthBase}` | undefined;
47
+ export type IconNameOf<P extends IconPackName> = IconNameResolver<P>['name'];
40
48
  export type IconProps = ExtractPublicPropTypes<typeof iconProps>;
41
- type IconBaseProps = Omit<IconProps, 'name' | 'pack'>;
49
+ export type IconBaseProps = Omit<IconProps, 'name' | 'pack'>;
42
50
  export type GenericUIcon = <P extends IconPackName = IconPackName>(props: IconBaseProps & {
43
51
  pack?: P;
44
52
  name?: IconNameOf<P>;
@@ -47,4 +55,3 @@ export type RenderIconProps<P extends IconPackName = IconPackName> = IconBasePro
47
55
  pack?: P;
48
56
  };
49
57
  export type RenderIconChildren = VNodeChild | (() => VNodeChild);
50
- export {};
@@ -6,5 +6,9 @@ export const iconProps = Object.assign(Object.assign({}, useTheme.props), {
6
6
  component: Object,
7
7
  name: String,
8
8
  pack: String,
9
+ async: {
10
+ type: Boolean,
11
+ default: undefined
12
+ },
9
13
  onClick: Function
10
14
  });
@@ -2,3 +2,4 @@ import type { VNode } from 'vue';
2
2
  import type { IconPackName } from '../../../config-provider/src/internal-interface';
3
3
  import type { IconNameOf, RenderIconChildren, RenderIconProps } from './interface';
4
4
  export declare function renderIcon<P extends IconPackName = IconPackName>(name: IconNameOf<P>, props?: RenderIconProps<P> | null, children?: RenderIconChildren): VNode;
5
+ export declare function renderAsyncIcon<P extends IconPackName = IconPackName>(name: IconNameOf<P>, props?: RenderIconProps<P> | null, children?: RenderIconChildren): VNode;
@@ -7,4 +7,9 @@ export function renderIcon(name, props, children) {
7
7
  return h(UIcon, Object.assign(Object.assign({}, props), {
8
8
  name
9
9
  }), slots);
10
+ }
11
+ export function renderAsyncIcon(name, props, children) {
12
+ return renderIcon(name, Object.assign(Object.assign({}, props), {
13
+ async: true
14
+ }), children);
10
15
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { defineComponent, h } from 'vue';
2
+ export default defineComponent({
3
+ name: 'SearchOutline',
4
+ render() {
5
+ return h("svg", {
6
+ viewBox: "0 0 24 24",
7
+ fill: "none",
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ "aria-hidden": true
10
+ }, h("path", {
11
+ d: "M21 21l-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0z",
12
+ stroke: "currentColor",
13
+ "stroke-width": "2",
14
+ "stroke-linecap": "round",
15
+ "stroke-linejoin": "round"
16
+ }));
17
+ }
18
+ });
@@ -52,6 +52,7 @@ export { default as RotateClockwiseIcon } from './RotateClockwise';
52
52
  export { default as RotateCounterclockwiseIcon } from './RotateCounterclockwise';
53
53
  export { default as RussiaFlag } from './RussiaFlag';
54
54
  export { default as SearchIcon } from './Search';
55
+ export { default as SearchOutlineIcon } from './SearchOutline';
55
56
  export { default as SendFilled } from './SendFilled';
56
57
  export { default as SiderUnionBorder } from './SiderUnionBorder';
57
58
  export { default as SuccessIcon } from './Success';
@@ -52,6 +52,7 @@ export { default as RotateClockwiseIcon } from "./RotateClockwise.mjs";
52
52
  export { default as RotateCounterclockwiseIcon } from "./RotateCounterclockwise.mjs";
53
53
  export { default as RussiaFlag } from "./RussiaFlag.mjs";
54
54
  export { default as SearchIcon } from "./Search.mjs";
55
+ export { default as SearchOutlineIcon } from "./SearchOutline.mjs";
55
56
  export { default as SendFilled } from "./SendFilled.mjs";
56
57
  export { default as SiderUnionBorder } from "./SiderUnionBorder.mjs";
57
58
  export { default as SuccessIcon } from "./Success.mjs";
@@ -1,5 +1,6 @@
1
1
  import { computed, inject, onBeforeUnmount, provide } from 'vue';
2
2
  import { createInjectionKey } from "../_utils/index.mjs";
3
+ import { formInjectionKey } from "../form/src/context.mjs";
3
4
  export const formItemInjectionKey = createInjectionKey('u-form-item');
4
5
  export default function useFormItem(props, {
5
6
  defaultSize = 'medium',
@@ -7,6 +8,7 @@ export default function useFormItem(props, {
7
8
  mergedDisabled
8
9
  } = {}) {
9
10
  const UFormItem = inject(formItemInjectionKey, null);
11
+ const UForm = inject(formInjectionKey, null);
10
12
  provide(formItemInjectionKey, null);
11
13
  const mergedSizeRef = computed(mergedSize ? () => mergedSize(UFormItem) : () => {
12
14
  const {
@@ -33,6 +35,9 @@ export default function useFormItem(props, {
33
35
  if (UFormItem) {
34
36
  return UFormItem.disabled.value;
35
37
  }
38
+ if (UForm) {
39
+ return UForm.props.disabled;
40
+ }
36
41
  return false;
37
42
  });
38
43
  const mergedStatusRef = computed(() => {
@@ -0,0 +1 @@
1
+ export declare function copyToClipboard(text: string): Promise<void>;
@@ -0,0 +1,8 @@
1
+ export function copyToClipboard(text) {
2
+ var _a;
3
+ const clipboard = (_a = globalThis.navigator) === null || _a === void 0 ? void 0 : _a.clipboard;
4
+ if (!(clipboard === null || clipboard === void 0 ? void 0 : clipboard.writeText)) {
5
+ return Promise.reject(new Error('Clipboard API is unavailable'));
6
+ }
7
+ return clipboard.writeText(text);
8
+ }
@@ -1,2 +1,3 @@
1
+ export { copyToClipboard } from './copy-to-clipboard';
1
2
  export { download, publicDownload } from './download';
2
3
  export { isDocument } from './is-document';
@@ -1,2 +1,3 @@
1
+ export { copyToClipboard } from "./copy-to-clipboard.mjs";
1
2
  export { download, publicDownload } from "./download.mjs";
2
3
  export { isDocument } from "./is-document.mjs";