@uzum-tech/ui 2.3.1 → 2.3.2

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 (52) hide show
  1. package/dist/index.js +373 -340
  2. package/dist/index.mjs +373 -340
  3. package/dist/index.prod.js +2 -2
  4. package/dist/index.prod.mjs +2 -2
  5. package/es/components.d.ts +10 -7
  6. package/es/image/src/ImagePreview.d.ts +1 -0
  7. package/es/image/src/ImagePreview.mjs +7 -35
  8. package/es/image/src/public-types.d.ts +4 -4
  9. package/es/message-bubble/src/MessageBubble.mjs +10 -3
  10. package/es/upload/index.d.ts +2 -1
  11. package/es/upload/index.mjs +2 -1
  12. package/es/upload/src/Upload.d.ts +73 -1007
  13. package/es/upload/src/Upload.mjs +43 -124
  14. package/es/upload/src/UploadFile.d.ts +1 -1
  15. package/es/upload/src/UploadFile.mjs +8 -2
  16. package/es/upload/src/UploadFileList.mjs +17 -2
  17. package/es/upload/src/UploadProgress.d.ts +3 -2
  18. package/es/upload/src/interface.d.ts +1086 -92
  19. package/es/upload/src/interface.mjs +117 -1
  20. package/es/upload/src/public-types.d.ts +17 -2
  21. package/es/upload/src/useUploadActionsRender.d.ts +2 -27
  22. package/es/upload/src/useUploadActionsRender.mjs +2 -2
  23. package/es/upload/src/useUploadInternals.d.ts +2 -25
  24. package/es/upload/src/utils.d.ts +2 -0
  25. package/es/upload/src/utils.mjs +7 -0
  26. package/es/version.d.ts +1 -1
  27. package/es/version.mjs +1 -1
  28. package/lib/components.d.ts +10 -7
  29. package/lib/image/src/ImagePreview.d.ts +1 -0
  30. package/lib/image/src/ImagePreview.js +3 -19
  31. package/lib/image/src/public-types.d.ts +4 -4
  32. package/lib/message-bubble/src/MessageBubble.js +10 -4
  33. package/lib/upload/index.d.ts +2 -1
  34. package/lib/upload/index.js +2 -1
  35. package/lib/upload/src/Upload.d.ts +73 -1007
  36. package/lib/upload/src/Upload.js +40 -68
  37. package/lib/upload/src/UploadFile.d.ts +1 -1
  38. package/lib/upload/src/UploadFile.js +12 -4
  39. package/lib/upload/src/UploadFileList.js +8 -1
  40. package/lib/upload/src/UploadProgress.d.ts +3 -2
  41. package/lib/upload/src/interface.d.ts +1086 -92
  42. package/lib/upload/src/interface.js +59 -1
  43. package/lib/upload/src/public-types.d.ts +17 -2
  44. package/lib/upload/src/useUploadActionsRender.d.ts +2 -27
  45. package/lib/upload/src/useUploadActionsRender.js +2 -2
  46. package/lib/upload/src/useUploadInternals.d.ts +2 -25
  47. package/lib/upload/src/utils.d.ts +2 -0
  48. package/lib/upload/src/utils.js +10 -0
  49. package/lib/version.d.ts +1 -1
  50. package/lib/version.js +1 -1
  51. package/package.json +1 -1
  52. package/web-types.json +104 -23
@@ -97936,6 +97936,7 @@ export declare const UImagePreview: import("vue").DefineComponent<import("vue").
97936
97936
  '--u-toolbar-color': string;
97937
97937
  '--u-toolbar-border-radius': string;
97938
97938
  '--u-toolbar-box-shadow': string;
97939
+ '--u-overlay-color': string;
97939
97940
  }> | undefined;
97940
97941
  themeClass: import("vue").Ref<string, string> | undefined;
97941
97942
  onRender: (() => void) | undefined;
@@ -146545,7 +146546,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
146545
146546
  readonly onError: import("vue").PropType<import("./upload/src/interface").OnError>;
146546
146547
  readonly onRetry: import("vue").PropType<import("./upload/src/interface").OnRetry>;
146547
146548
  readonly onBeforeUpload: import("vue").PropType<import("./upload/src/interface").OnBeforeUpload>;
146548
- readonly isErrorState: import("vue").PropType<(xhr: XMLHttpRequest) => boolean>;
146549
+ readonly isErrorState: import("vue").PropType<import("./upload/src/interface").IsErrorState>;
146549
146550
  readonly onDownload: import("vue").PropType<import("./upload/src/interface").OnDownload>;
146550
146551
  readonly defaultUpload: {
146551
146552
  readonly type: BooleanConstructor;
@@ -146590,6 +146591,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
146590
146591
  readonly createThumbnailUrl: import("vue").PropType<import("./upload/src/interface").CreateThumbnailUrl>;
146591
146592
  readonly abstract: BooleanConstructor;
146592
146593
  readonly max: NumberConstructor;
146594
+ readonly maxSize: NumberConstructor;
146593
146595
  readonly showTrigger: {
146594
146596
  readonly type: BooleanConstructor;
146595
146597
  readonly default: true;
@@ -146601,7 +146603,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
146601
146603
  readonly renderIcon: import("vue").PropType<import("./upload/src/interface").RenderIcon>;
146602
146604
  readonly label: StringConstructor;
146603
146605
  readonly size: {
146604
- readonly type: import("vue").PropType<"small" | "medium" | "large">;
146606
+ readonly type: import("vue").PropType<import("./upload").UploadSize>;
146605
146607
  readonly default: "medium";
146606
146608
  };
146607
146609
  readonly title: StringConstructor;
@@ -147431,7 +147433,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
147431
147433
  }>>>;
147432
147434
  }>, {
147433
147435
  openFileDialog: () => void;
147434
- submit: () => void;
147436
+ submit: import("./upload/src/interface").Submit;
147435
147437
  clear: () => void;
147436
147438
  mergedClsPrefix: import("vue").Ref<string, string>;
147437
147439
  mergedSizeRef: import("vue").ComputedRef<"small" | "medium" | "large">;
@@ -147742,7 +147744,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
147742
147744
  cssVars: import("vue").ComputedRef<any> | undefined;
147743
147745
  themeClass: import("vue").Ref<string, string> | undefined;
147744
147746
  onRender: (() => void) | undefined;
147745
- handleFileInputChange: (e: Event) => void;
147747
+ handleFileInputChange: (event: Event) => void;
147746
147748
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
147747
147749
  readonly name: {
147748
147750
  readonly type: StringConstructor;
@@ -147787,7 +147789,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
147787
147789
  readonly onError: import("vue").PropType<import("./upload/src/interface").OnError>;
147788
147790
  readonly onRetry: import("vue").PropType<import("./upload/src/interface").OnRetry>;
147789
147791
  readonly onBeforeUpload: import("vue").PropType<import("./upload/src/interface").OnBeforeUpload>;
147790
- readonly isErrorState: import("vue").PropType<(xhr: XMLHttpRequest) => boolean>;
147792
+ readonly isErrorState: import("vue").PropType<import("./upload/src/interface").IsErrorState>;
147791
147793
  readonly onDownload: import("vue").PropType<import("./upload/src/interface").OnDownload>;
147792
147794
  readonly defaultUpload: {
147793
147795
  readonly type: BooleanConstructor;
@@ -147832,6 +147834,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
147832
147834
  readonly createThumbnailUrl: import("vue").PropType<import("./upload/src/interface").CreateThumbnailUrl>;
147833
147835
  readonly abstract: BooleanConstructor;
147834
147836
  readonly max: NumberConstructor;
147837
+ readonly maxSize: NumberConstructor;
147835
147838
  readonly showTrigger: {
147836
147839
  readonly type: BooleanConstructor;
147837
147840
  readonly default: true;
@@ -147843,7 +147846,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
147843
147846
  readonly renderIcon: import("vue").PropType<import("./upload/src/interface").RenderIcon>;
147844
147847
  readonly label: StringConstructor;
147845
147848
  readonly size: {
147846
- readonly type: import("vue").PropType<"small" | "medium" | "large">;
147849
+ readonly type: import("vue").PropType<import("./upload").UploadSize>;
147847
147850
  readonly default: "medium";
147848
147851
  };
147849
147852
  readonly title: StringConstructor;
@@ -148674,7 +148677,7 @@ export declare const UUpload: import("vue").DefineComponent<import("vue").Extrac
148674
148677
  }>> & Readonly<{}>, {
148675
148678
  readonly disabled: boolean | undefined;
148676
148679
  readonly vertical: boolean;
148677
- readonly size: "small" | "medium" | "large";
148680
+ readonly size: import("./upload").UploadSize;
148678
148681
  readonly name: string;
148679
148682
  readonly abstract: boolean;
148680
148683
  readonly multiple: boolean;
@@ -313,6 +313,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
313
313
  '--u-toolbar-color': string;
314
314
  '--u-toolbar-border-radius': string;
315
315
  '--u-toolbar-box-shadow': string;
316
+ '--u-overlay-color': string;
316
317
  }> | undefined;
317
318
  themeClass: import("vue").Ref<string, string> | undefined;
318
319
  onRender: (() => void) | undefined;
@@ -6,12 +6,12 @@ import { useIsMounted, useMergedState } from 'vooks';
6
6
  import { computed, defineComponent, Fragment, h, inject, normalizeStyle, onBeforeUnmount, ref, toRef, toRefs, Transition, vShow, watch, withDirectives } from 'vue';
7
7
  import { LazyTeleport } from 'vueuc';
8
8
  import { UBaseIcon } from "../../_internal/index.mjs";
9
- import { ResizeSmallIcon, RotateClockwiseIcon, RotateCounterclockwiseIcon, ZoomInIcon, ZoomOutIcon } from "../../_internal/icons/index.mjs";
9
+ import { RotateClockwiseIcon, RotateCounterclockwiseIcon, ZoomInIcon, ZoomOutIcon } from "../../_internal/icons/index.mjs";
10
10
  import { useConfig, useLocale, useTheme, useThemeClass } from "../../_mixins/index.mjs";
11
11
  import { call, download } from "../../_utils/index.mjs";
12
12
  import { UTooltip } from "../../tooltip/index.mjs";
13
13
  import { imageLight } from "../styles/index.mjs";
14
- import { closeIcon, downloadIcon, nextIcon, prevIcon } from "./icons.mjs";
14
+ import { closeIcon } from "./icons.mjs";
15
15
  import { imageContextKey, imagePreviewSharedProps } from "./interface.mjs";
16
16
  import style from "./styles/index.cssr.mjs";
17
17
  const BLEEDING = 32;
@@ -404,7 +404,8 @@ export default defineComponent({
404
404
  toolbarIconColor,
405
405
  toolbarBorderRadius,
406
406
  toolbarBoxShadow,
407
- toolbarColor
407
+ toolbarColor,
408
+ overlayColor
408
409
  }
409
410
  } = themeRef.value;
410
411
  return {
@@ -412,7 +413,8 @@ export default defineComponent({
412
413
  '--u-toolbar-icon-color': toolbarIconColor,
413
414
  '--u-toolbar-color': toolbarColor,
414
415
  '--u-toolbar-border-radius': toolbarBorderRadius,
415
- '--u-toolbar-box-shadow': toolbarBoxShadow
416
+ '--u-toolbar-box-shadow': toolbarBoxShadow,
417
+ '--u-overlay-color': overlayColor
416
418
  };
417
419
  });
418
420
  const {
@@ -468,18 +470,6 @@ export default defineComponent({
468
470
  renderToolbar,
469
471
  withTooltip
470
472
  } = this;
471
- const prevNode = withTooltip(h(UBaseIcon, {
472
- clsPrefix: clsPrefix,
473
- onClick: this.handleSwitchPrev
474
- }, {
475
- default: () => prevIcon
476
- }), 'tipPrevious');
477
- const nextNode = withTooltip(h(UBaseIcon, {
478
- clsPrefix: clsPrefix,
479
- onClick: this.handleSwitchNext
480
- }, {
481
- default: () => nextIcon
482
- }), 'tipNext');
483
473
  const rotateCounterclockwiseNode = withTooltip(h(UBaseIcon, {
484
474
  clsPrefix: clsPrefix,
485
475
  onClick: this.rotateCounterclockwise
@@ -492,26 +482,12 @@ export default defineComponent({
492
482
  }, {
493
483
  default: () => h(RotateClockwiseIcon, null)
494
484
  }), 'tipClockwise');
495
- const originalSizeNode = withTooltip(h(UBaseIcon, {
496
- clsPrefix: clsPrefix,
497
- onClick: this.resizeToOrignalImageSize
498
- }, {
499
- default: () => {
500
- return h(ResizeSmallIcon, null);
501
- }
502
- }), 'tipOriginalSize');
503
485
  const zoomOutNode = withTooltip(h(UBaseIcon, {
504
486
  clsPrefix: clsPrefix,
505
487
  onClick: this.zoomOut
506
488
  }, {
507
489
  default: () => h(ZoomOutIcon, null)
508
490
  }), 'tipZoomOut');
509
- const downloadNode = withTooltip(h(UBaseIcon, {
510
- clsPrefix: clsPrefix,
511
- onClick: this.handleDownloadClick
512
- }, {
513
- default: () => downloadIcon
514
- }), 'tipDownload');
515
491
  const closeNode = withTooltip(h(UBaseIcon, {
516
492
  clsPrefix: clsPrefix,
517
493
  onClick: () => this.close()
@@ -556,17 +532,13 @@ export default defineComponent({
556
532
  class: `${clsPrefix}-image-preview-toolbar`
557
533
  }, renderToolbar ? renderToolbar({
558
534
  nodes: {
559
- prev: prevNode,
560
- next: nextNode,
561
535
  rotateCounterclockwise: rotateCounterclockwiseNode,
562
536
  rotateClockwise: rotateClockwiseNode,
563
- resizeToOriginalSize: originalSizeNode,
564
537
  zoomOut: zoomOutNode,
565
538
  zoomIn: zoomInNode,
566
- download: downloadNode,
567
539
  close: closeNode
568
540
  }
569
- }) : h(Fragment, null, this.onPrev ? h(Fragment, null, prevNode, nextNode) : null, rotateCounterclockwiseNode, rotateClockwiseNode, originalSizeNode, zoomOutNode, zoomInNode, downloadNode, closeNode));
541
+ }) : h(Fragment, null, rotateCounterclockwiseNode, rotateClockwiseNode, zoomOutNode, zoomInNode, closeNode));
570
542
  }
571
543
  }) : null, h(Transition, {
572
544
  name: "fade-in-scale-up-transition",
@@ -1,14 +1,14 @@
1
1
  import type { VNode, VNodeChild } from 'vue';
2
2
  export interface ImageRenderToolbarProps {
3
3
  nodes: {
4
- prev: VNode;
5
- next: VNode;
4
+ prev?: VNode;
5
+ next?: VNode;
6
6
  rotateCounterclockwise: VNode;
7
7
  rotateClockwise: VNode;
8
- resizeToOriginalSize: VNode;
8
+ resizeToOriginalSize?: VNode;
9
9
  zoomOut: VNode;
10
10
  zoomIn: VNode;
11
- download: VNode;
11
+ download?: VNode;
12
12
  close: VNode;
13
13
  };
14
14
  }
@@ -138,6 +138,11 @@ export default defineComponent({
138
138
  const url = [attachment.preview, attachment.thumbnail].find(value => typeof value === 'string');
139
139
  return url !== null && url !== void 0 ? url : null;
140
140
  };
141
+ const getAttachmentUrl = attachment => {
142
+ if (!attachment.url || attachment.url === '#') return null;
143
+ return attachment.url;
144
+ };
145
+ const isAttachmentPreviewable = file => Boolean(file.thumbnailUrl);
141
146
  const handleAttachmentDownload = file => __awaiter(this, void 0, void 0, function* () {
142
147
  if (props.onAttachmentDownload) {
143
148
  const attachment = normalizedAttachmentsRef.value.find(item => item.name === file.name);
@@ -172,21 +177,23 @@ export default defineComponent({
172
177
  return slots.messageAttachment(messagePayloadRef.value);
173
178
  }
174
179
  const fileList = normalizedAttachmentsRef.value.map(attachment => {
175
- var _a, _b, _c;
180
+ var _a, _b;
176
181
  return {
177
182
  id: String(attachment.id),
178
183
  name: attachment.name,
179
184
  status: attachment.status || MessageBubbleAttachmentStatus.FINISHED,
180
185
  percentage: (_a = attachment.percentage) !== null && _a !== void 0 ? _a : null,
181
- url: (_b = attachment.url) !== null && _b !== void 0 ? _b : null,
186
+ url: getAttachmentUrl(attachment),
182
187
  thumbnailUrl: getThumbnailUrl(attachment),
183
- type: (_c = attachment.type) !== null && _c !== void 0 ? _c : null,
188
+ type: (_b = attachment.type) !== null && _b !== void 0 ? _b : null,
184
189
  file: null,
185
190
  batchId: null
186
191
  };
187
192
  });
188
193
  const uploadComponent = h(UUpload, Object.assign({
189
194
  abstract: true,
195
+ listType: "preview-list",
196
+ shouldUseThumbnailUrl: isAttachmentPreviewable,
190
197
  fileList: fileList,
191
198
  fileListStyle: withPadding ? {
192
199
  display: 'flex',
@@ -1,7 +1,8 @@
1
1
  export { publicDownload as uploadDownload } from '../_utils/dom/download';
2
2
  export type { CustomRequestOptions as UploadCustomRequestOptions, FileInfo as UploadFileInfo, UploadInst, SettledFileInfo as UploadSettledFileInfo } from './src/interface';
3
+ export { uploadProps, type UploadProps } from './src/interface';
3
4
  export type * from './src/public-types';
4
- export { uploadProps, type UploadProps, default as UUpload } from './src/Upload';
5
+ export { default as UUpload } from './src/Upload';
5
6
  export { default as UUploadDragger } from './src/UploadDragger';
6
7
  export { default as UUploadFileList } from './src/UploadFileList';
7
8
  export { default as UUploadTrigger } from './src/UploadTrigger';
@@ -1,5 +1,6 @@
1
1
  export { publicDownload as uploadDownload } from "../_utils/dom/download.mjs";
2
- export { uploadProps, default as UUpload } from "./src/Upload.mjs";
2
+ export { uploadProps } from "./src/interface.mjs";
3
+ export { default as UUpload } from "./src/Upload.mjs";
3
4
  export { default as UUploadDragger } from "./src/UploadDragger.mjs";
4
5
  export { default as UUploadFileList } from "./src/UploadFileList.mjs";
5
6
  export { default as UUploadTrigger } from "./src/UploadTrigger.mjs";