@uzum-tech/ui 2.1.2 → 2.1.4

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 (42) hide show
  1. package/dist/index.js +35 -11
  2. package/dist/index.mjs +35 -12
  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 +6 -2
  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/_mixins/use-form-item.mjs +5 -0
  14. package/es/components.d.ts +22 -4
  15. package/es/components.mjs +1 -1
  16. package/es/date-picker/src/DatePicker.mjs +15 -8
  17. package/es/icon/index.d.ts +1 -1
  18. package/es/icon/index.mjs +1 -1
  19. package/es/icon/src/Icon.d.ts +1 -1
  20. package/es/icon/src/Icon.mjs +1 -1
  21. package/es/version.d.ts +1 -1
  22. package/es/version.mjs +1 -1
  23. package/lib/_internal/icon/index.d.ts +1 -1
  24. package/lib/_internal/icon/index.js +2 -1
  25. package/lib/_internal/icon/src/UIcon.d.ts +11 -1
  26. package/lib/_internal/icon/src/UIcon.js +5 -1
  27. package/lib/_internal/icon/src/interface.d.ts +11 -4
  28. package/lib/_internal/icon/src/interface.js +1 -1
  29. package/lib/_internal/icon/src/render-icon.d.ts +1 -0
  30. package/lib/_internal/icon/src/render-icon.js +4 -0
  31. package/lib/_mixins/use-form-item.js +5 -0
  32. package/lib/components.d.ts +22 -4
  33. package/lib/components.js +6 -5
  34. package/lib/date-picker/src/DatePicker.js +19 -8
  35. package/lib/icon/index.d.ts +1 -1
  36. package/lib/icon/index.js +2 -1
  37. package/lib/icon/src/Icon.d.ts +1 -1
  38. package/lib/icon/src/Icon.js +2 -1
  39. package/lib/version.d.ts +1 -1
  40. package/lib/version.js +1 -1
  41. package/package.json +1 -1
  42. package/web-types.json +6 -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,6 +1,6 @@
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";
@@ -45,6 +45,7 @@ const UIconImpl = defineComponent({
45
45
  });
46
46
  const themeClassHandle = inlineThemeDisabled ? useThemeClass('icon', computed(() => `${props.depth || 'd'}`), cssVarsRef, props) : undefined;
47
47
  const resolvedPackedIconRef = computed(() => {
48
+ var _a;
48
49
  const {
49
50
  name,
50
51
  pack
@@ -61,7 +62,10 @@ const UIconImpl = defineComponent({
61
62
  warn('icon', `icon pack "${targetName}" not found`);
62
63
  return null;
63
64
  }
64
- if (config.async) {
65
+ if ((_a = props.async) !== null && _a !== void 0 ? _a : config.async) {
66
+ if ('renderIcon' in target) {
67
+ 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\`.`);
68
+ }
65
69
  return target.renderAsyncIcon(name);
66
70
  }
67
71
  if (!('renderIcon' in target)) {
@@ -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
  }
@@ -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(() => {
@@ -65495,7 +65495,7 @@ export declare const UHighlight: import("vue").DefineComponent<import("vue").Ext
65495
65495
  readonly patterns: string[];
65496
65496
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65497
65497
  export type * from './icon';
65498
- export { iconProps, renderIcon } from './icon';
65498
+ export { iconProps, renderAsyncIcon, renderIcon } from './icon';
65499
65499
  export declare const UIcon: {
65500
65500
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
65501
65501
  readonly depth: import("vue").PropType<import("./_internal/icon").Depth>;
@@ -65504,6 +65504,10 @@ export declare const UIcon: {
65504
65504
  readonly component: import("vue").PropType<import("vue").Component>;
65505
65505
  readonly name: import("vue").PropType<string>;
65506
65506
  readonly pack: import("vue").PropType<import("./config-provider").IconPackName>;
65507
+ readonly async: {
65508
+ readonly type: BooleanConstructor;
65509
+ readonly default: undefined;
65510
+ };
65507
65511
  readonly onClick: import("vue").PropType<(e: MouseEvent) => void>;
65508
65512
  readonly theme: import("vue").PropType<import("./_mixins").Theme<"Icon", {
65509
65513
  color: string;
@@ -65543,7 +65547,9 @@ export declare const UIcon: {
65543
65547
  }> | undefined;
65544
65548
  themeClass: import("vue").Ref<string, string> | undefined;
65545
65549
  onRender: (() => void) | undefined;
65546
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
65550
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
65551
+ readonly async: boolean;
65552
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
65547
65553
  P: {};
65548
65554
  B: {};
65549
65555
  D: {};
@@ -65557,6 +65563,10 @@ export declare const UIcon: {
65557
65563
  readonly component: import("vue").PropType<import("vue").Component>;
65558
65564
  readonly name: import("vue").PropType<string>;
65559
65565
  readonly pack: import("vue").PropType<import("./config-provider").IconPackName>;
65566
+ readonly async: {
65567
+ readonly type: BooleanConstructor;
65568
+ readonly default: undefined;
65569
+ };
65560
65570
  readonly onClick: import("vue").PropType<(e: MouseEvent) => void>;
65561
65571
  readonly theme: import("vue").PropType<import("./_mixins").Theme<"Icon", {
65562
65572
  color: string;
@@ -65596,7 +65606,9 @@ export declare const UIcon: {
65596
65606
  }> | undefined;
65597
65607
  themeClass: import("vue").Ref<string, string> | undefined;
65598
65608
  onRender: (() => void) | undefined;
65599
- }, {}, {}, {}, {}>;
65609
+ }, {}, {}, {}, {
65610
+ readonly async: boolean;
65611
+ }>;
65600
65612
  __isFragment?: never;
65601
65613
  __isTeleport?: never;
65602
65614
  __isSuspense?: never;
@@ -65607,6 +65619,10 @@ export declare const UIcon: {
65607
65619
  readonly component: import("vue").PropType<import("vue").Component>;
65608
65620
  readonly name: import("vue").PropType<string>;
65609
65621
  readonly pack: import("vue").PropType<import("./config-provider").IconPackName>;
65622
+ readonly async: {
65623
+ readonly type: BooleanConstructor;
65624
+ readonly default: undefined;
65625
+ };
65610
65626
  readonly onClick: import("vue").PropType<(e: MouseEvent) => void>;
65611
65627
  readonly theme: import("vue").PropType<import("./_mixins").Theme<"Icon", {
65612
65628
  color: string;
@@ -65646,7 +65662,9 @@ export declare const UIcon: {
65646
65662
  }> | undefined;
65647
65663
  themeClass: import("vue").Ref<string, string> | undefined;
65648
65664
  onRender: (() => void) | undefined;
65649
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("./_internal/icon").GenericUIcon;
65665
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
65666
+ readonly async: boolean;
65667
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("./_internal/icon").GenericUIcon;
65650
65668
  export type * from './icon-bar';
65651
65669
  export { iconBarItemProps, iconBarProps } from './icon-bar';
65652
65670
  export declare const UIconBar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
package/es/components.mjs CHANGED
@@ -237,7 +237,7 @@ export { heatmapDark, heatmapLight, heatmapMockData, heatmapProps } from "./heat
237
237
  export const UHeatmap = wrap(_UHeatmap);
238
238
  export { highlightProps } from "./highlight/index.mjs";
239
239
  export const UHighlight = wrap(_UHighlight);
240
- export { iconProps, renderIcon } from "./icon/index.mjs";
240
+ export { iconProps, renderAsyncIcon, renderIcon } from "./icon/index.mjs";
241
241
  export const UIcon = wrap(_UIcon);
242
242
  export { iconBarItemProps, iconBarProps } from "./icon-bar/index.mjs";
243
243
  export const UIconBar = wrap(_UIconBar);
@@ -220,6 +220,7 @@ export default defineComponent({
220
220
  } = props;
221
221
  switch (type) {
222
222
  case 'date':
223
+ case 'daterange':
223
224
  return localeRef.value.datePlaceholder;
224
225
  case 'datetime':
225
226
  return localeRef.value.datetimePlaceholder;
@@ -453,15 +454,18 @@ export default defineComponent({
453
454
  }
454
455
  }
455
456
  function handleClear() {
456
- var _a;
457
+ var _a, _b;
458
+ doUpdateValue(null, {
459
+ doConfirm: false
460
+ });
457
461
  doUpdateShow(false);
458
- (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.deactivate();
462
+ (_b = (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.deactivate) === null || _b === void 0 ? void 0 : _b.call(_a);
459
463
  doClear();
460
464
  }
461
465
  function handlePanelClear() {
462
- var _a;
466
+ var _a, _b;
463
467
  // close will be called inside panel
464
- (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.deactivate();
468
+ (_b = (_a = inputInstRef.value) === null || _a === void 0 ? void 0 : _a.deactivate) === null || _b === void 0 ? void 0 : _b.call(_a);
465
469
  doClear();
466
470
  }
467
471
  function handlePanelTabOut() {
@@ -1015,12 +1019,14 @@ export default defineComponent({
1015
1019
  value: this.displayTime || this.localizedPlacehoder
1016
1020
  });
1017
1021
  }
1022
+ const hasDisplayTime = this.isRange ? this.displayStartTime && this.displayEndTime : this.displayTime;
1023
+ const displayValue = this.isRange ? `${this.displayStartTime} - ${this.displayEndTime}` : this.displayTime;
1018
1024
  if (this.triggerPreset === 'select') {
1019
1025
  return h(UInternalSelection, {
1020
1026
  ref: "inputInstRef",
1021
- selectedOption: this.displayTime ? {
1022
- label: this.displayTime,
1023
- value: this.displayTime
1027
+ selectedOption: hasDisplayTime ? {
1028
+ label: displayValue,
1029
+ value: displayValue
1024
1030
  } : null,
1025
1031
  round: this.round,
1026
1032
  status: this.mergedStatus,
@@ -1045,6 +1051,7 @@ export default defineComponent({
1045
1051
  });
1046
1052
  }
1047
1053
  if (this.triggerPreset === 'button') {
1054
+ const buttonText = hasDisplayTime ? displayValue : this.localizedPlacehoder;
1048
1055
  return h(UButton, {
1049
1056
  round: this.round,
1050
1057
  size: this.mergedSize,
@@ -1052,7 +1059,7 @@ export default defineComponent({
1052
1059
  themeOverrides: this.mergedTheme.peerOverrides.Button,
1053
1060
  onClick: this.handleTriggerClick
1054
1061
  }, {
1055
- default: () => this.displayTime || this.localizedPlacehoder
1062
+ default: () => buttonText
1056
1063
  });
1057
1064
  }
1058
1065
  return this.isRange ? h(UInput, Object.assign({
@@ -1,2 +1,2 @@
1
- export { iconProps, renderIcon, UIcon } from './src/Icon';
1
+ export { iconProps, renderAsyncIcon, renderIcon, UIcon } from './src/Icon';
2
2
  export type { IconProps, RenderIconProps } from './src/Icon';
package/es/icon/index.mjs CHANGED
@@ -1 +1 @@
1
- export { iconProps, renderIcon, UIcon } from "./src/Icon.mjs";
1
+ export { iconProps, renderAsyncIcon, renderIcon, UIcon } from "./src/Icon.mjs";
@@ -1,2 +1,2 @@
1
- export { iconProps, renderIcon, UIcon } from '../../_internal/icon';
1
+ export { iconProps, renderAsyncIcon, renderIcon, UIcon } from '../../_internal/icon';
2
2
  export type { Depth, GenericUIcon, IconNameOf, IconProps, RenderIconProps } from '../../_internal/icon';
@@ -1 +1 @@
1
- export { iconProps, renderIcon, UIcon } from "../../_internal/icon/index.mjs";
1
+ export { iconProps, renderAsyncIcon, renderIcon, UIcon } from "../../_internal/icon/index.mjs";
package/es/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "2.1.2";
1
+ declare const _default: "2.1.4";
2
2
  export default _default;
package/es/version.mjs CHANGED
@@ -1 +1 @@
1
- export default '2.1.2';
1
+ export default '2.1.4';
@@ -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';
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UIcon = exports.renderIcon = exports.iconProps = exports.UBaseIcon = void 0;
6
+ exports.UIcon = exports.renderIcon = exports.renderAsyncIcon = exports.iconProps = exports.UBaseIcon = void 0;
7
7
  var Icon_1 = require("./src/Icon");
8
8
  Object.defineProperty(exports, "UBaseIcon", { enumerable: true, get: function () { return __importDefault(Icon_1).default; } });
9
9
  var interface_1 = require("./src/interface");
10
10
  Object.defineProperty(exports, "iconProps", { enumerable: true, get: function () { return interface_1.iconProps; } });
11
11
  var render_icon_1 = require("./src/render-icon");
12
+ Object.defineProperty(exports, "renderAsyncIcon", { enumerable: true, get: function () { return render_icon_1.renderAsyncIcon; } });
12
13
  Object.defineProperty(exports, "renderIcon", { enumerable: true, get: function () { return render_icon_1.renderIcon; } });
13
14
  var UIcon_1 = require("./src/UIcon");
14
15
  Object.defineProperty(exports, "UIcon", { enumerable: true, get: function () { return UIcon_1.UIcon; } });
@@ -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 {};
@@ -39,6 +39,7 @@ const UIconImpl = (0, vue_1.defineComponent)({
39
39
  ? (0, _mixins_1.useThemeClass)('icon', (0, vue_1.computed)(() => `${props.depth || 'd'}`), cssVarsRef, props)
40
40
  : undefined;
41
41
  const resolvedPackedIconRef = (0, vue_1.computed)(() => {
42
+ var _a;
42
43
  const { name, pack } = props;
43
44
  if (!name)
44
45
  return null;
@@ -53,7 +54,10 @@ const UIconImpl = (0, vue_1.defineComponent)({
53
54
  (0, _utils_1.warn)('icon', `icon pack "${targetName}" not found`);
54
55
  return null;
55
56
  }
56
- if (config.async) {
57
+ if ((_a = props.async) !== null && _a !== void 0 ? _a : config.async) {
58
+ if ('renderIcon' in target) {
59
+ (0, _utils_1.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\`.`);
60
+ }
57
61
  return target.renderAsyncIcon(name);
58
62
  }
59
63
  if (!('renderIcon' in target)) {
@@ -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 {};
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.iconProps = void 0;
4
4
  const _mixins_1 = require("../../../_mixins");
5
- exports.iconProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { depth: [String, Number], size: [Number, String], color: String, component: Object, name: String, pack: String, onClick: Function });
5
+ exports.iconProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { depth: [String, Number], size: [Number, String], color: String, component: Object, name: String, pack: String, async: { type: Boolean, default: undefined }, onClick: Function });
@@ -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;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderIcon = renderIcon;
4
+ exports.renderAsyncIcon = renderAsyncIcon;
4
5
  const vue_1 = require("vue");
5
6
  const UIcon_1 = require("./UIcon");
6
7
  function renderIcon(name, props, children) {
@@ -9,3 +10,6 @@ function renderIcon(name, props, children) {
9
10
  : { default: typeof children === 'function' ? children : () => children };
10
11
  return (0, vue_1.h)(UIcon_1.UIcon, Object.assign(Object.assign({}, props), { name }), slots);
11
12
  }
13
+ function renderAsyncIcon(name, props, children) {
14
+ return renderIcon(name, Object.assign(Object.assign({}, props), { async: true }), children);
15
+ }
@@ -4,9 +4,11 @@ exports.formItemInjectionKey = void 0;
4
4
  exports.default = useFormItem;
5
5
  const vue_1 = require("vue");
6
6
  const _utils_1 = require("../_utils");
7
+ const context_1 = require("../form/src/context");
7
8
  exports.formItemInjectionKey = (0, _utils_1.createInjectionKey)('u-form-item');
8
9
  function useFormItem(props, { defaultSize = 'medium', mergedSize, mergedDisabled } = {}) {
9
10
  const UFormItem = (0, vue_1.inject)(exports.formItemInjectionKey, null);
11
+ const UForm = (0, vue_1.inject)(context_1.formInjectionKey, null);
10
12
  (0, vue_1.provide)(exports.formItemInjectionKey, null);
11
13
  const mergedSizeRef = (0, vue_1.computed)(mergedSize
12
14
  ? () => mergedSize(UFormItem)
@@ -32,6 +34,9 @@ function useFormItem(props, { defaultSize = 'medium', mergedSize, mergedDisabled
32
34
  if (UFormItem) {
33
35
  return UFormItem.disabled.value;
34
36
  }
37
+ if (UForm) {
38
+ return UForm.props.disabled;
39
+ }
35
40
  return false;
36
41
  });
37
42
  const mergedStatusRef = (0, vue_1.computed)(() => {
@@ -65495,7 +65495,7 @@ export declare const UHighlight: import("vue").DefineComponent<import("vue").Ext
65495
65495
  readonly patterns: string[];
65496
65496
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65497
65497
  export type * from './icon';
65498
- export { iconProps, renderIcon } from './icon';
65498
+ export { iconProps, renderAsyncIcon, renderIcon } from './icon';
65499
65499
  export declare const UIcon: {
65500
65500
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
65501
65501
  readonly depth: import("vue").PropType<import("./_internal/icon").Depth>;
@@ -65504,6 +65504,10 @@ export declare const UIcon: {
65504
65504
  readonly component: import("vue").PropType<import("vue").Component>;
65505
65505
  readonly name: import("vue").PropType<string>;
65506
65506
  readonly pack: import("vue").PropType<import("./config-provider").IconPackName>;
65507
+ readonly async: {
65508
+ readonly type: BooleanConstructor;
65509
+ readonly default: undefined;
65510
+ };
65507
65511
  readonly onClick: import("vue").PropType<(e: MouseEvent) => void>;
65508
65512
  readonly theme: import("vue").PropType<import("./_mixins").Theme<"Icon", {
65509
65513
  color: string;
@@ -65543,7 +65547,9 @@ export declare const UIcon: {
65543
65547
  }> | undefined;
65544
65548
  themeClass: import("vue").Ref<string, string> | undefined;
65545
65549
  onRender: (() => void) | undefined;
65546
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
65550
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
65551
+ readonly async: boolean;
65552
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
65547
65553
  P: {};
65548
65554
  B: {};
65549
65555
  D: {};
@@ -65557,6 +65563,10 @@ export declare const UIcon: {
65557
65563
  readonly component: import("vue").PropType<import("vue").Component>;
65558
65564
  readonly name: import("vue").PropType<string>;
65559
65565
  readonly pack: import("vue").PropType<import("./config-provider").IconPackName>;
65566
+ readonly async: {
65567
+ readonly type: BooleanConstructor;
65568
+ readonly default: undefined;
65569
+ };
65560
65570
  readonly onClick: import("vue").PropType<(e: MouseEvent) => void>;
65561
65571
  readonly theme: import("vue").PropType<import("./_mixins").Theme<"Icon", {
65562
65572
  color: string;
@@ -65596,7 +65606,9 @@ export declare const UIcon: {
65596
65606
  }> | undefined;
65597
65607
  themeClass: import("vue").Ref<string, string> | undefined;
65598
65608
  onRender: (() => void) | undefined;
65599
- }, {}, {}, {}, {}>;
65609
+ }, {}, {}, {}, {
65610
+ readonly async: boolean;
65611
+ }>;
65600
65612
  __isFragment?: never;
65601
65613
  __isTeleport?: never;
65602
65614
  __isSuspense?: never;
@@ -65607,6 +65619,10 @@ export declare const UIcon: {
65607
65619
  readonly component: import("vue").PropType<import("vue").Component>;
65608
65620
  readonly name: import("vue").PropType<string>;
65609
65621
  readonly pack: import("vue").PropType<import("./config-provider").IconPackName>;
65622
+ readonly async: {
65623
+ readonly type: BooleanConstructor;
65624
+ readonly default: undefined;
65625
+ };
65610
65626
  readonly onClick: import("vue").PropType<(e: MouseEvent) => void>;
65611
65627
  readonly theme: import("vue").PropType<import("./_mixins").Theme<"Icon", {
65612
65628
  color: string;
@@ -65646,7 +65662,9 @@ export declare const UIcon: {
65646
65662
  }> | undefined;
65647
65663
  themeClass: import("vue").Ref<string, string> | undefined;
65648
65664
  onRender: (() => void) | undefined;
65649
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("./_internal/icon").GenericUIcon;
65665
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
65666
+ readonly async: boolean;
65667
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("./_internal/icon").GenericUIcon;
65650
65668
  export type * from './icon-bar';
65651
65669
  export { iconBarItemProps, iconBarProps } from './icon-bar';
65652
65670
  export declare const UIconBar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{