@cloudbase/weda-ui 3.14.1 → 3.14.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- @cloudbase/weda-ui v3.14.1
2
+ @cloudbase/weda-ui v3.14.4
3
3
  */
4
4
  @charset "UTF-8";@media (min-width:1024px){.weda-ui .weui-cells{font-size:1em}.weui .weui-cell_active:active{background-color:unset!important}}@font-face{font-family:lcap-icon;font-weight:400;font-style:normal;src:url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAkMAA0AAAAAFZgAAAi1AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACCXhEICpxYlmoLTgABNgIkA1gEIAWDMweDBRtzEVGUTVKf7GdCpjLGY/HIYGvbDpn6q7Qdj3xvUaZJUNFads3M7geYVSSiCgsZJYFkhEfn2DjU9//jpn8D1QTqVBQqSrtAVZAq1bwkpTOo0Hbz2tnYfkP3ZzAxpv6ZiSFf3OHh8/b+/oqzxIt4QmFX5ImmIe0SWAOEOJL2n9ZSO5PcCwErnTjzLxOYud0Az24IS8AOXSWgBtyL2lbFtkKxMAhSoPNdlrMFakJqTjuamX+3E3teqiTm6/UpPkH213oLGNahKuAtpQ0wbERrXcnzO1bBpK388B4D6I5fCT9kh69EbSy65RKsi/26+7qKtJv2oREq98FIbnbJO3TaMjBjPcwtqFDG9qp0XxcX/7ndSrUHxotP16TcVrHOGHgIM0PwK6JIMvN/BgpiRTDc/CFwhO+x7ZDYI/ONMoO4NDIX3PYHqpDAWg0a1byp4P4j3ft6fX2jqrvbO6bLU5gtI53w8U4ueG4vS7h0Ze7t9hJUld5xMnwpJp2X5O8KxChB4KG0IQ8pBk+JUXq17qFT7cTN1G17zf2SrGdNz1yMi7Agh0PzRINR0otFF515Z3Fzzml7wfmCrEvFl1zV9wiL6o6j8ELh5LgzjkKpbVTilkw1XLvyYxiCxZHZhpkOEZY3gDto5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anQU+67DN62G7tnPGP8h5DgBGvMgjgCILl0eQyJQoo5wKKqmimhpqqSOQIIIJQUQoYYQTQSRRRBNDLHGIkRBPAonZMHXOzF6Z99D0PpIk80xVIUlCBjmykYNc5CEfBShEJaqggBIqjzpSRkIGObKRg1zkIR8FKEQlqqCAEiqPulNOAgAA) format('woff2')}.wd-form--vertical-left .wedatea2td-form .weda-formcells__pc.horizontal,.wd-form--vertical-right .wedatea2td-form .weda-formcells__pc.horizontal,.wedatea2td-form--vertical .wd-form--horizontal-left .wd-form-item-wrap,.wedatea2td-form--vertical .wd-form--horizontal-right .wd-form-item-wrap,.wedatea2td-form--vertical .wd-form-item.wd-form-item--horizontal-left .wd-form-item-wrap,.wedatea2td-form--vertical .wd-form-item.wd-form-item--horizontal-right .wd-form-item-wrap,.wedatea2td-form--vertical .wedatea2td-form .weda-formcells__pc.horizontal{flex-direction:column}.g-swiper-item>div>*{max-width:100%;max-height:100%;object-fit:cover;max-width:100%;object-fit:cover;max-width:100%;max-height:100%;object-fit:cover;width:100%;height:auto;max-width:100%;object-fit:cover}.form-detail-wrap .form-detail-content-wrap .form-detail-group-header-container{display:flex;align-items:center;justify-content:space-between}.weda-graphic-card .weda-graphic-card__col .weda-graphic-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weda-graphic-card .weda-graphic-card__col .weda-graphic-card__desc{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weda-menu .wedatea2td-menu--light .wedatea2td-menu__list li.is-selected>.wedatea2td-menu__item:hover,.wedatea2td-drawer .wedatea2td-menu--light .wedatea2td-menu__list li .wedatea2td-menu__item:hover{background-color:var(--weda-navigation-menu-hover-color)}.weda-menu-mobile .weda-menu__wrapper{display:flex;align-items:center;justify-content:space-between;box-shadow:0 2px 2px rgba(0,0,0,.05)}.weda-menu .wedatea2td-menu__text .menu-text,.weda-menu__drawer .wedatea2td-menu__text .menu-text{display:flex;justify-content:center;align-items:center}@media (max-width:1024px){.g-swiper .g-swiper__turn-next,.g-swiper .g-swiper__turn-pre{display:none}.modal-table-delete .wedatea2td-dialog__inner,.model-relation-selector-modal .wedatea2td-dialog__inner,.wedatea2td-dialog__inner{min-width:0;width:90%;margin:10px 0}.wedatea2td-form.model-form{width:100%}}.markdown-body .octicon{fill:currentColor}.markdown-body pre{word-wrap:normal}.wd-form-item.wd-pc-rich-text-root .ExEditor-basic,.wd-form-item.wd-pc-rich-text-root .exeditor-toolbar{background-color:inherit}.wd-add-relation-button-wrap{display:flex;align-items:center;color:var(--wd-color-brand,#0052d9);white-space:pre-wrap}.weda-import-csv-file-modal .file-json-map-wrap{display:flex;flex-direction:column;box-sizing:border-box}.weda-import-csv-file-modal .import-file-result-wrap .error-container{display:flex;flex-direction:column}.weda-import-csv-file-modal .import-file-result-wrap .error-content{flex:1}.wd-table-wrap-filter .wedatea2td-input:focus,.wd-table-wrap-filter .wedatea2td-input:hover,.wd-table-wrap-filter .wedatea2td-textarea-group:focus,.wd-table-wrap-filter .wedatea2td-textarea-group:hover,.wd-table-wrap-filter .wedatea2td-textarea:focus,.wd-table-wrap-filter .wedatea2td-textarea:hover,.wedatea2td-overlay .wedatea2td-checkbox:focus,.wedatea2td-overlay .wedatea2td-checkbox:hover,.wedatea2td-overlay input[type=checkbox]:focus,.wedatea2td-overlay input[type=checkbox]:hover{border-color:var(--wd-color-brand,#0052d9)}.weda-ui_mapChoose_search_input_clear{display:flex;justify-content:center}.form-select-map .wedatea2td-dialog__inner{box-shadow:none;min-width:100vw!important}.weda-ui-custom-calendar-op__end,.weda-ui-custom-calendar-op__start{display:flex;align-items:center}.weui-tag span{word-wrap:break-word;word-break:break-word}.weda-ui-user-select-container-list__start .depart-tree .wedatea2td-tree__node.is-selected>.wedatea2td-tree__node-content,.weda-ui-user-select-container-list__start .depart-tree .wedatea2td-tree__node.is-selected>.wedatea2td-tree__node-content .wedatea2td-tree__label,.weda-ui-user-select-container-list__start .wedatea2td-tree.wedatea2td-tree--checkbox-separate .wedatea2td-tree__node.is-selected>.wedatea2td-tree__node-content .wedatea2td-tree__label .wedatea2td-tree__label-title{background-color:var(--wd-color-brand-light,#d4e3fc)}.weda-select-user-dept-breadcrumb{display:flex;align-items:center}.form-location-con_disabled{opacity:.4}body{font-size:var(--wd-font-base)}@font-face{font-family:wd-lcap-icon;font-weight:400;font-style:normal;src:url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAkMAA0AAAAAFZgAAAi1AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACCXhEICpxYlmoLTgABNgIkA1gEIAWDMweDBRtzEVGUTVKf7GdCpjLGY/HIYGvbDpn6q7Qdj3xvUaZJUNFads3M7geYVSSiCgsZJYFkhEfn2DjU9//jpn8D1QTqVBQqSrtAVZAq1bwkpTOo0Hbz2tnYfkP3ZzAxpv6ZiSFf3OHh8/b+/oqzxIt4QmFX5ImmIe0SWAOEOJL2n9ZSO5PcCwErnTjzLxOYud0Az24IS8AOXSWgBtyL2lbFtkKxMAhSoPNdlrMFakJqTjuamX+3E3teqiTm6/UpPkH213oLGNahKuAtpQ0wbERrXcnzO1bBpK388B4D6I5fCT9kh69EbSy65RKsi/26+7qKtJv2oREq98FIbnbJO3TaMjBjPcwtqFDG9qp0XxcX/7ndSrUHxotP16TcVrHOGHgIM0PwK6JIMvN/BgpiRTDc/CFwhO+x7ZDYI/ONMoO4NDIX3PYHqpDAWg0a1byp4P4j3ft6fX2jqrvbO6bLU5gtI53w8U4ueG4vS7h0Ze7t9hJUld5xMnwpJp2X5O8KxChB4KG0IQ8pBk+JUXq17qFT7cTN1G17zf2SrGdNz1yMi7Agh0PzRINR0otFF515Z3Fzzml7wfmCrEvFl1zV9wiL6o6j8ELh5LgzjkKpbVTilkw1XLvyYxiCxZHZhpkOEZY3gDto5Ci7PcrBzbTTOYWZGNeqCfoBN0loREx3AceICXbDYFPHIUNaFz37kj0Ei2vbd+MI4fpcJncQ7UiqZzDbycj160Ox7c5YRB0pveJQ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0PpIk80xVIUlCBjmykYNc5CEfBShEJaqggBIqjzpSRkIGObKRg1zkIR8FKEQlqqCAEiqPulNOAgAA) format("woff2")}.t-icon{speak:none;text-transform:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wd-space-align-items--flex-start{align-items:flex-start;align-items:center;align-items:flex-end}.wd-space-justify-content--flex-start{justify-content:flex-start;justify-content:center;justify-content:flex-end}.wd-btn{--wd-btn-sm-padding:0.0625rem calc(var(--wd-space-base) * 2);--wd-btn-md-padding:0.25rem calc(var(--wd-space-base) * 4);--wd-btn-lg-padding:0.4375rem calc(var(--wd-space-base) * 6);--wd-btn-margin-top:0;--wd-btn-margin-top:0;--wd-btn-font-size-sm:var(--wd-font-size-2);--wd-btn-line-height-sm:1.5;--wd-btn-min-height-sm:24px;--wd-btn-font-size-md:var(--wd-font-size-3);--wd-btn-line-height-md:1.5;--wd-btn-min-height-md:32px;--wd-btn-font-size-lg:var(--wd-font-size-4);--wd-btn-line-height-lg:1.5;--wd-btn-min-height-lg:40px;--wd-btn-icon-space-sm:var(--wd-space-base);--wd-btn-icon-space-md:calc(var(--wd-space-base) * 2);--wd-btn-icon-space-lg:calc(var(--wd-space-base) * 3);--wd-btn-icon-size-sm:calc(var(--wd-btn-font-size-sm) + 0.125rem);--wd-btn-icon-size-md:calc(var(--wd-btn-font-size-md) + 0.125rem);--wd-btn-icon-size-lg:calc(var(--wd-btn-font-size-lg) + 0.25rem);--wd-btn-border-radius:var(--wd-border-radius);--wd-btn-color-text:var(--wd-color-text-default);--wd-btn-color-text-inverse:var(--wd-color-text-inverse);--wd-btn-color-text-hover:var(--wd-color-text-default);--wd-btn-color-text-active:var(--wd-color-text-default);--wd-btn-color-text-focus:var(--wd-color-text-default);--wd-btn-color-text-disabled:var(--wd-color-text-disabled);--wd-btn-color-brand:var(--wd-color-brand);--wd-btn-color-brand-hover:var(--wd-color-brand-hover);--wd-btn-color-brand-active:var(--wd-color-brand-active);--wd-btn-color-brand-focus:var(--wd-color-brand-focus);--wd-btn-color-brand-disabled:var(--wd-color-brand-disabled);--wd-btn-color-warning:var(--wd-color-warning);--wd-btn-color-warning-hover:var(--wd-color-warning-hover);--wd-btn-color-warning-active:var(--wd-color-warning-active);--wd-btn-color-warning-focus:var(--wd-color-warning-focus);--wd-btn-color-warning-disabled:var(--wd-color-warning-disabled);--wd-btn-color-error:var(--wd-color-error);--wd-btn-color-error-hover:var(--wd-color-error-hover);--wd-btn-color-error-active:var(--wd-color-error-active);--wd-btn-color-error-focus:var(--wd-color-error-focus);--wd-btn-color-error-disabled:var(--wd-color-error-disabled);--wd-btn-color-gray:var(
5
5
  --wd-color-gray-1
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import * as React from 'react';
3
3
  import weui from '../../../utils/weui';
4
4
  import classNames from '../../../utils/classnames';
5
- import { browserEnv } from '../../../utils/platform';
5
+ import { browserEnv, alertErrorMessage } from '../../../utils/platform';
6
6
  import { IMAGE_TYPES, encodeConvert } from './uploader.pc';
7
7
  import { useTempUrl } from '../../../utils/hooks/use-cloud-id-temp-url';
8
8
  import { toBase64Uri } from '../../../utils/file2base64';
@@ -50,34 +50,33 @@ export function ImageUploaderH5(props) {
50
50
  return tempFile.length < maxUploadCount;
51
51
  }, [tempFile, single, maxUploadCount, uploading]);
52
52
  const uploadChange = async (e) => {
53
- var _a, _b, _c, _d, _e, _f, _g, _h;
54
53
  let files = [...e.target.files];
55
54
  const isAccepted = files.every((i) => checkAcceptedFiles(i, accepts));
56
55
  if (!isAccepted) {
57
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
58
- title: `上传图片类型错误`,
56
+ alertErrorMessage({
57
+ message: `上传图片类型错误`,
59
58
  icon: 'none',
60
59
  });
61
60
  return false;
62
61
  }
63
62
  if (files.some((f) => f.size > maxSize * 1024 * 1024)) {
64
- (_d = (_c = window === null || window === void 0 ? void 0 : window.$w) === null || _c === void 0 ? void 0 : _c.utils) === null || _d === void 0 ? void 0 : _d.showToast({
65
- title: `请上传不超过 ${maxSize}M 的图片`,
63
+ alertErrorMessage({
64
+ message: `请上传不超过 ${maxSize}M 的图片`,
66
65
  icon: 'none',
67
66
  });
68
67
  return false;
69
68
  }
70
69
  if (files.length > finalMaxImgCount) {
71
70
  // 防止一下子选择过多文件
72
- (_f = (_e = window === null || window === void 0 ? void 0 : window.$w) === null || _e === void 0 ? void 0 : _e.utils) === null || _f === void 0 ? void 0 : _f.showToast({
73
- title: `最多只能上传${finalMaxImgCount}张图片,请重新选择`,
71
+ alertErrorMessage({
72
+ message: `最多只能上传${finalMaxImgCount}张图片,请重新选择`,
74
73
  icon: 'none',
75
74
  });
76
75
  return false;
77
76
  }
78
77
  if (tempFile.length + files.length > finalMaxImgCount) {
79
- (_h = (_g = window === null || window === void 0 ? void 0 : window.$w) === null || _g === void 0 ? void 0 : _g.utils) === null || _h === void 0 ? void 0 : _h.showToast({
80
- title: `最多只能上传${finalMaxImgCount}张图片`,
78
+ alertErrorMessage({
79
+ message: `最多只能上传${finalMaxImgCount}张图片`,
81
80
  icon: 'none',
82
81
  });
83
82
  return false;
@@ -5,6 +5,7 @@ import { useTempUrl } from '../../../utils/hooks/use-cloud-id-temp-url';
5
5
  import { toBase64Uri } from '../../../utils/file2base64';
6
6
  import { isNil } from '../../../utils/lodash';
7
7
  import { errorHandler } from '../../../utils/error';
8
+ import { alertErrorMessage } from '../../../utils/platform';
8
9
  import { WdIcon } from '../../wd-icon';
9
10
  import { useUploader } from './useUploadFile';
10
11
  import { ImagePreview } from '../../wd-image/ImagePreview';
@@ -31,7 +32,6 @@ export function UploaderPCInner(props) {
31
32
  };
32
33
  // 方法:上传前,判断图片大小、数量是否满足,取消默认组件的上传事件,用自定义的 tcb 上传方法
33
34
  const beforeHandle = async (file, fileList, isAccepted, error) => {
34
- var _a, _b, _c, _d, _e, _f;
35
35
  const finalMaxImgCount = single ? 1 : maxUploadCount;
36
36
  if (!isAccepted) {
37
37
  try {
@@ -42,8 +42,8 @@ export function UploaderPCInner(props) {
42
42
  if (error.find((item) => (item === null || item === void 0 ? void 0 : item.code) === 'file-too-large')) {
43
43
  errorList.push(`上传图片大小不能超过${maxSize}M`);
44
44
  }
45
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
46
- title: errorList.join(', '),
45
+ alertErrorMessage({
46
+ message: errorList.join(', '),
47
47
  icon: 'error',
48
48
  });
49
49
  }
@@ -60,15 +60,15 @@ export function UploaderPCInner(props) {
60
60
  return Promise.reject(false);
61
61
  if (fileList.length > finalMaxImgCount) {
62
62
  // 防止一下子选择过多文件
63
- (_d = (_c = window === null || window === void 0 ? void 0 : window.$w) === null || _c === void 0 ? void 0 : _c.utils) === null || _d === void 0 ? void 0 : _d.showToast({
64
- title: `最多只能上传${finalMaxImgCount}张图片,请重新选择`,
63
+ alertErrorMessage({
64
+ message: `最多只能上传${finalMaxImgCount}张图片,请重新选择`,
65
65
  icon: 'error',
66
66
  });
67
67
  return Promise.reject(false);
68
68
  }
69
69
  if (tempFile.length + fileList.length > finalMaxImgCount) {
70
- (_f = (_e = window === null || window === void 0 ? void 0 : window.$w) === null || _e === void 0 ? void 0 : _e.utils) === null || _f === void 0 ? void 0 : _f.showToast({
71
- title: `最多只能上传${finalMaxImgCount}张图片`,
70
+ alertErrorMessage({
71
+ message: `最多只能上传${finalMaxImgCount}张图片`,
72
72
  icon: 'error',
73
73
  });
74
74
  return Promise.reject(false);
@@ -19,7 +19,7 @@ export const getBase64 = (files) => {
19
19
  };
20
20
  // 多张上传
21
21
  export const uploadTcbMulti = async (files, props) => {
22
- const { isCompressBeforeUpload, compressedHeight, compressedWidth, compressQuality, } = props;
22
+ const { isCompressBeforeUpload, compressedHeight, compressedWidth, compressQuality } = props;
23
23
  const promiseAll = files.map(async (f) => {
24
24
  if (isCompressBeforeUpload) {
25
25
  const compressed = await compressImage(f.file, {
@@ -36,7 +36,7 @@ export const uploadTcbMulti = async (files, props) => {
36
36
  };
37
37
  export const filenameRegex = /[^a-zA-Z0-9\u4e00-\u9fff-*!_.]/g;
38
38
  const uploadToTcb = async (item, props) => {
39
- var _a, _b;
39
+ var _a;
40
40
  const { onUploadProgress, onUploadFinish, onUploadError } = props;
41
41
  const { file, uploadPath } = item;
42
42
  try {
@@ -77,20 +77,14 @@ const uploadToTcb = async (item, props) => {
77
77
  errorHandler({
78
78
  code: 'WdUploadImage.UploadToTcbError',
79
79
  error: err,
80
- });
81
- (_b = window === null || window === void 0 ? void 0 : window.$w) === null || _b === void 0 ? void 0 : _b.utils.showModal({
82
- title: '上传失败,请重试',
83
- content: err.message,
84
- showCancel: false,
80
+ showTip: true,
85
81
  });
86
82
  onUploadError(err);
87
83
  }
88
84
  };
89
85
  export const checkAcceptedFiles = (file, acceptedFiles) => {
90
86
  if (file && acceptedFiles) {
91
- const acceptedFilesArray = Array.isArray(acceptedFiles)
92
- ? acceptedFiles
93
- : acceptedFiles.split(',');
87
+ const acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');
94
88
  if (acceptedFilesArray.length === 0) {
95
89
  return true;
96
90
  }
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import isObjectEqual from '../../../utils/isObjectEqual';
4
- import { ConfigProvider, Button, Text, List, Progress, Tooltip, } from 'tea-component';
5
- import { filterStrList, isCloudFileID, isHttpFileID, transSize, transFileCloudidToName, randomStr, isInIde, isWebInMiniprogram, transFileName, } from '../../../utils/platform';
4
+ import { ConfigProvider, Button, Text, List, Progress, Tooltip } from 'tea-component';
5
+ import { filterStrList, isCloudFileID, isHttpFileID, transSize, transFileCloudidToName, randomStr, isInIde, isWebInMiniprogram, transFileName, alertErrorMessage, } from '../../../utils/platform';
6
6
  import { getCloudInstance } from '../../../utils/tcb';
7
7
  import classNames from '../../../utils/classnames';
8
8
  import { renderDecorator } from '../renderDecorator';
@@ -95,9 +95,7 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
95
95
  [className]: className,
96
96
  });
97
97
  const accepts = React.useMemo(() => {
98
- return acceptTypes.includes('*') || acceptTypes.length === 0
99
- ? ['*']
100
- : Array.from(new Set(acceptTypes));
98
+ return acceptTypes.includes('*') || acceptTypes.length === 0 ? ['*'] : Array.from(new Set(acceptTypes));
101
99
  }, [acceptTypes]);
102
100
  // 上传后文件列表 fileIDList 改变事件,'add'|'delete'
103
101
  const handleChange = ({ fileID, uuid, type, size, file }) => {
@@ -137,42 +135,39 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
137
135
  }, children: _jsx("div", { "data-testid": "uploadFileH5", className: cls, id: id, style: style, children: _jsxs("div", { className: classNames(`${CLASS_PREFIX}`), children: [isEdit && (_jsx("div", { className: classNames(`${CLASS_PREFIX}__hd`, layout), children: _jsx("div", { children: btnDisabled ? (readOnly ? null : (_jsx(WdButton, { variant: "outline", className: classNames(`${CLASS_PREFIX}__btn--weak`), disabled: btnDisabled, text: btnTitle }))) : (_jsxs("div", { children: [_jsx("input", { ref: inputRef, id: "uploaderInput", type: "file", "data-testid": "button-up", className: "weui-uploader-mobile__input", accept: accepts.join(','), multiple: !single, onClick: () => {
138
136
  inputRef.current && (inputRef.current.value = '');
139
137
  }, onChange: async (e) => {
140
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
141
138
  let fileList = [...e.target.files];
142
139
  const isAccepted = fileList.every((i) => checkAcceptedFiles(i, accepts));
143
140
  if (!isAccepted) {
144
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
145
- title: `上传图片类型错误`,
141
+ alertErrorMessage({
142
+ message: `上传图片类型错误`,
146
143
  icon: 'none',
147
144
  });
148
145
  return false;
149
146
  }
150
147
  if (single && fileList.length > 1) {
151
- (_d = (_c = window === null || window === void 0 ? void 0 : window.$w) === null || _c === void 0 ? void 0 : _c.utils) === null || _d === void 0 ? void 0 : _d.showToast({
152
- title: `上传文件总数不能超过1个`,
148
+ alertErrorMessage({
149
+ message: `上传文件总数不能超过1个`,
153
150
  icon: 'none',
154
151
  });
155
152
  return false;
156
153
  }
157
- if (fileList.length + fileIDList.length >
158
- maxUploadCount) {
159
- (_f = (_e = window === null || window === void 0 ? void 0 : window.$w) === null || _e === void 0 ? void 0 : _e.utils) === null || _f === void 0 ? void 0 : _f.showToast({
160
- title: `上传文件总数不能超过${maxUploadCount}个`,
154
+ if (fileList.length + fileIDList.length > maxUploadCount) {
155
+ alertErrorMessage({
156
+ message: `上传文件总数不能超过${maxUploadCount}个`,
161
157
  icon: 'none',
162
158
  });
163
159
  return false;
164
160
  }
165
- if (maxSizeLimit &&
166
- fileList.some((f) => f.size > maxSizeLimit * 1024 * 1024)) {
167
- (_h = (_g = window === null || window === void 0 ? void 0 : window.$w) === null || _g === void 0 ? void 0 : _g.utils) === null || _h === void 0 ? void 0 : _h.showToast({
168
- title: `请上传不超过${maxSizeLimit}M的文件`,
161
+ if (maxSizeLimit && fileList.some((f) => f.size > maxSizeLimit * 1024 * 1024)) {
162
+ alertErrorMessage({
163
+ message: `请上传不超过${maxSizeLimit}M的文件`,
169
164
  icon: 'none',
170
165
  });
171
166
  return false;
172
167
  }
173
168
  if (fileList.some((f) => f.size > 1024 * 1024 * 1024)) {
174
- (_k = (_j = window === null || window === void 0 ? void 0 : window.$w) === null || _j === void 0 ? void 0 : _j.utils) === null || _k === void 0 ? void 0 : _k.showToast({
175
- title: `请上传不超过1024M的文件`,
169
+ alertErrorMessage({
170
+ message: `请上传不超过1024M的文件`,
176
171
  icon: 'none',
177
172
  });
178
173
  return false;
@@ -188,8 +183,7 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
188
183
  if (typeof ret === 'boolean') {
189
184
  shouldUploadToCos = ret;
190
185
  }
191
- else if (Array.isArray(ret) &&
192
- ret.every((item) => item instanceof File)) {
186
+ else if (Array.isArray(ret) && ret.every((item) => item instanceof File)) {
193
187
  fileList = ret;
194
188
  }
195
189
  else if (!isNil(ret)) {
@@ -210,7 +204,7 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
210
204
  }
211
205
  fileList.forEach((f) => (f['_uuid'] = randomStr()));
212
206
  setFileList((list) => [...list, ...fileList]);
213
- } }), _jsx(WdButton, { variant: "outline", className: "wedatea2td-btn wedatea2td-btn--weak", text: btnTitle, size: "sm" }), !single && (_jsx(Text, { className: `${CLASS_PREFIX}__tips`, children: uploadTipText }))] })) }) })), _jsx("div", { className: `${CLASS_PREFIX}__bd`, children: _jsxs(List, { children: [fileIDList.map((d) => (_jsx(List.Item, { children: _jsx(TcbFileEcho, { fileID: d, fileList: fileList, onChange: handleChange, disabled: disabled, deleteVisible: deleteVisible, downloadVisible: downloadVisible, formType: formType }) }, d))), fileList.map((item) => (_jsx(List.Item, { children: _jsx(TcbFileUpload, { id: id, disabled: disabled, file: item, downloadVisible: downloadVisible, deleteVisible: deleteVisible && !disabled, formType: formType }) }, item === null || item === void 0 ? void 0 : item._uuid)))] }) })] }) }) }) }))({
207
+ } }), _jsx(WdButton, { variant: "outline", className: "wedatea2td-btn wedatea2td-btn--weak", text: btnTitle, size: "sm" }), !single && _jsx(Text, { className: `${CLASS_PREFIX}__tips`, children: uploadTipText })] })) }) })), _jsx("div", { className: `${CLASS_PREFIX}__bd`, children: _jsxs(List, { children: [fileIDList.map((d) => (_jsx(List.Item, { children: _jsx(TcbFileEcho, { fileID: d, fileList: fileList, onChange: handleChange, disabled: disabled, deleteVisible: deleteVisible, downloadVisible: downloadVisible, formType: formType }) }, d))), fileList.map((item) => (_jsx(List.Item, { children: _jsx(TcbFileUpload, { id: id, disabled: disabled, file: item, downloadVisible: downloadVisible, deleteVisible: deleteVisible && !disabled, formType: formType }) }, item === null || item === void 0 ? void 0 : item._uuid)))] }) })] }) }) }) }))({
214
208
  id,
215
209
  className: cls,
216
210
  style,
@@ -224,12 +218,12 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
224
218
  * 基于 FileID 文件回显组件
225
219
  */
226
220
  const TcbFileEcho = ({ fileID, disabled, formType }) => {
227
- var _a, _b, _c;
221
+ var _a;
228
222
  const { fileSizeObj } = React.useContext(FileContext) || {};
229
223
  const { data: src, error } = useTempUrl(fileID);
230
224
  if (error) {
231
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
232
- title: `cloud id ${fileID} 资源获取错误`,
225
+ alertErrorMessage({
226
+ message: `cloud id ${fileID} 资源获取错误`,
233
227
  icon: 'error',
234
228
  });
235
229
  }
@@ -243,7 +237,7 @@ const TcbFileEcho = ({ fileID, disabled, formType }) => {
243
237
  }
244
238
  }, [fileID]);
245
239
  //上传文件列表展示
246
- return (_jsxs("div", { className: `${CLASS_PREFIX}__item`, children: [_jsx("div", { className: `${CLASS_PREFIX}__item-left`, children: _jsx(UploadFileStatus, { title: label, size: ((_c = fileSizeObj[fileID]) === null || _c === void 0 ? void 0 : _c.size) || '-', formType: formType }) }), _jsx("div", { className: `${CLASS_PREFIX}__btn-group`, children: _jsx(UploadFileAction, { title: label, disabled: disabled, status: "UPLOAD_STATUS_SUCCESS", fileID: fileID, src: src }) })] }));
240
+ return (_jsxs("div", { className: `${CLASS_PREFIX}__item`, children: [_jsx("div", { className: `${CLASS_PREFIX}__item-left`, children: _jsx(UploadFileStatus, { title: label, size: ((_a = fileSizeObj[fileID]) === null || _a === void 0 ? void 0 : _a.size) || '-', formType: formType }) }), _jsx("div", { className: `${CLASS_PREFIX}__btn-group`, children: _jsx(UploadFileAction, { title: label, disabled: disabled, status: "UPLOAD_STATUS_SUCCESS", fileID: fileID, src: src }) })] }));
247
241
  };
248
242
  /**
249
243
  * 基于 File 上传文件过程组件
@@ -279,8 +273,7 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
279
273
  setPercent(percent < 100 ? percent : 100);
280
274
  },
281
275
  });
282
- !cancelRef.current &&
283
- (onChange === null || onChange === void 0 ? void 0 : onChange({ fileID, type: 'add', uuid, size, file }));
276
+ !cancelRef.current && (onChange === null || onChange === void 0 ? void 0 : onChange({ fileID, type: 'add', uuid, size, file }));
284
277
  setStatus('UPLOAD_STATUS_SUCCESS');
285
278
  }
286
279
  catch (err) {
@@ -305,12 +298,10 @@ const UploadFileStatus = ({ status = 'UPLOAD_STATUS_SUCCESS', percent = 0, size,
305
298
  var _a;
306
299
  const { isEdit } = React.useContext(FileContext) || {};
307
300
  //上传中、待上传状态
308
- if (status == 'UPLOAD_STATUS_LOADING' ||
309
- (status == 'UPLOAD_STATUS_PENDING' && percent)) {
301
+ if (status == 'UPLOAD_STATUS_LOADING' || (status == 'UPLOAD_STATUS_PENDING' && percent)) {
310
302
  return (_jsxs(_Fragment, { children: [_jsx("div", { className: `${CLASS_PREFIX}__file-detail`, children: _jsx(Text, { className: `${CLASS_PREFIX}__file-name`, children: title }) }), _jsx("div", { children: _jsx(Progress, { percent: percent, theme: "default", strokeColor: '#0052D9', className: `${CLASS_PREFIX}__file-progress` }) }), _jsxs("div", { className: `${CLASS_PREFIX}__file-foot`, children: [formType !== 'read' && (_jsxs("div", { children: [_jsxs(Text, { children: [Math.floor(percentSize), "K/"] }), _jsx(Text, { children: size })] })), _jsx(Text, { children: status === 'UPLOAD_STATUS_PENDING' ? '等待上传' : '上传中' })] })] }));
311
303
  }
312
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: `${CLASS_PREFIX}__file-detail`, children: _jsx(Tooltip, { title: title, children: _jsx(Text, { className: `${CLASS_PREFIX}__file-name`, children: title }) }) }), isEdit && (_jsxs("div", { className: `${CLASS_PREFIX}__file-foot`, children: [isEdit && (_jsx("div", { className: `${CLASS_PREFIX}__file-status`, children: _jsx(Text, { className: `${CLASS_PREFIX}__file-status--msg`, children: ((_a = statusMap[status]) === null || _a === void 0 ? void 0 : _a.title) ||
313
- statusMap['UPLOAD_STATUS_PENDING'].title }) })), formType !== 'read' && (_jsx("div", { children: _jsx(Text, { children: size }) }))] }))] }));
304
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: `${CLASS_PREFIX}__file-detail`, children: _jsx(Tooltip, { title: title, children: _jsx(Text, { className: `${CLASS_PREFIX}__file-name`, children: title }) }) }), isEdit && (_jsxs("div", { className: `${CLASS_PREFIX}__file-foot`, children: [isEdit && (_jsx("div", { className: `${CLASS_PREFIX}__file-status`, children: _jsx(Text, { className: `${CLASS_PREFIX}__file-status--msg`, children: ((_a = statusMap[status]) === null || _a === void 0 ? void 0 : _a.title) || statusMap['UPLOAD_STATUS_PENDING'].title }) })), formType !== 'read' && (_jsx("div", { children: _jsx(Text, { children: size }) }))] }))] }));
314
305
  };
315
306
  /**
316
307
  * 操作列组件, onChange 从最外层 UploadFilePc 传进来
@@ -319,7 +310,7 @@ const UploadFileStatus = ({ status = 'UPLOAD_STATUS_SUCCESS', percent = 0, size,
319
310
  const UploadFileAction = ({ status = 'UPLOAD_STATUS_PENDING', fileID = '', uuid = '', src = '', file = null, onReLoad = null, onCancel = null, disabled, title = 'downfile', }) => {
320
311
  const { onChange, downloadVisible, deleteVisible, isEdit } = React.useContext(FileContext) || {};
321
312
  // 操作列按钮-删除
322
- const renderDelete = () => isEdit && (_jsx(Button, { icon: "delete", onClick: () => onChange === null || onChange === void 0 ? void 0 : onChange({ fileID, uuid, type: 'delete' }), disabled: disabled }));
313
+ const renderDelete = () => isEdit && _jsx(Button, { icon: "delete", onClick: () => onChange === null || onChange === void 0 ? void 0 : onChange({ fileID, uuid, type: 'delete' }), disabled: disabled });
323
314
  // 操作列按钮-取消
324
315
  const renderCancel = () => isEdit && _jsx(Button, { icon: "dismiss", onClick: () => onCancel === null || onCancel === void 0 ? void 0 : onCancel(uuid) });
325
316
  // 操作列按钮-重新上传
@@ -334,7 +325,7 @@ const UploadFileAction = ({ status = 'UPLOAD_STATUS_PENDING', fileID = '', uuid
334
325
  case 'UPLOAD_STATUS_LOADING':
335
326
  return renderCancel();
336
327
  case 'UPLOAD_STATUS_SUCCESS':
337
- return (_jsxs(_Fragment, { children: [downloadVisible && !isWebInMiniprogram() && renderDownLoad(), ' ', deleteVisible && renderDelete()] }));
328
+ return (_jsxs(_Fragment, { children: [downloadVisible && !isWebInMiniprogram() && renderDownLoad(), " ", deleteVisible && renderDelete()] }));
338
329
  case 'UPLOAD_STATUS_ERROR':
339
330
  return (_jsxs(_Fragment, { children: [renderReLoad(), " ", deleteVisible && renderDelete()] }));
340
331
  default:
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { Upload, ConfigProvider, Icon, List } from 'tea-component';
4
4
  import { WdButton } from '../../wd-button';
5
5
  import { WdText } from '../../wd-text';
6
- import { filterStrList, isCloudFileID, isHttpFileID, isDataUri, transSize, cutFileTitle, transFileCloudidToName, randomStr, isInIde, isWebInMiniprogram, transFileName, } from '../../../utils/platform';
6
+ import { filterStrList, isCloudFileID, isHttpFileID, isDataUri, transSize, cutFileTitle, transFileCloudidToName, randomStr, isInIde, isWebInMiniprogram, transFileName, alertErrorMessage, } from '../../../utils/platform';
7
7
  import { getCloudInstance } from '../../../utils/tcb';
8
8
  import classNames from '../../../utils/classnames';
9
9
  import { renderDecorator } from '../renderDecorator';
@@ -94,10 +94,9 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
94
94
  });
95
95
  // 批量上传文件前置事件
96
96
  const handleBefore = async (file, fileList, isAccepted, error) => {
97
- var _a, _b, _c, _d;
98
97
  if (fileList.length + fileIDList.length > maxUploadCount) {
99
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
100
- title: `上传文件总数不能超过${maxUploadCount}个`,
98
+ alertErrorMessage({
99
+ message: `上传文件总数不能超过${maxUploadCount}个`,
101
100
  icon: 'error',
102
101
  });
103
102
  return Promise.reject(false);
@@ -111,8 +110,8 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
111
110
  if (error.find((item) => (item === null || item === void 0 ? void 0 : item.code) === 'file-too-large')) {
112
111
  errorList.push(`上传文件大小不能超过${maxSizeLimit}M`);
113
112
  }
114
- (_d = (_c = window === null || window === void 0 ? void 0 : window.$w) === null || _c === void 0 ? void 0 : _c.utils) === null || _d === void 0 ? void 0 : _d.showToast({
115
- title: errorList.join(', '),
113
+ alertErrorMessage({
114
+ message: errorList.join(', '),
116
115
  icon: 'error',
117
116
  });
118
117
  }
@@ -140,8 +139,7 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
140
139
  if (typeof ret === 'boolean') {
141
140
  shouldUploadToCos = ret;
142
141
  }
143
- else if (Array.isArray(ret) &&
144
- ret.every((item) => item instanceof File)) {
142
+ else if (Array.isArray(ret) && ret.every((item) => item instanceof File)) {
145
143
  fileList = ret;
146
144
  }
147
145
  else if (!isNil(ret)) {
@@ -184,9 +182,7 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
184
182
  };
185
183
  // 上传组件属性
186
184
  const uploadProps = { multiple: !single };
187
- if (!(!(acceptTypes === null || acceptTypes === void 0 ? void 0 : acceptTypes.length) ||
188
- (acceptTypes === null || acceptTypes === void 0 ? void 0 : acceptTypes.includes('*')) ||
189
- (acceptTypes === null || acceptTypes === void 0 ? void 0 : acceptTypes.includes('')))) {
185
+ if (!(!(acceptTypes === null || acceptTypes === void 0 ? void 0 : acceptTypes.length) || (acceptTypes === null || acceptTypes === void 0 ? void 0 : acceptTypes.includes('*')) || (acceptTypes === null || acceptTypes === void 0 ? void 0 : acceptTypes.includes('')))) {
190
186
  uploadProps['accept'] = Array.from(new Set(acceptTypes));
191
187
  }
192
188
  tips && (uploadProps['title'] = tips);
@@ -208,10 +204,7 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
208
204
  isEdit,
209
205
  events,
210
206
  fileSizeObj,
211
- }, "data-testid": "button-up", children: _jsxs("div", { className: `${CLASS_PREFIX} ${readOnly ? `${CLASS_PREFIX}__readOnly` : ''}`, "data-testid": "UploadFilePc", children: [isEdit && (_jsx("div", { className: `${CLASS_PREFIX}__input-box`, children: btnDisabled ? (readOnly ? null : (_jsx(WdButton, { disabled: true, text: btnTitle, theme: "secondary", variant: "outline" }))) : (_jsxs(Upload, { ...uploadProps, beforeUpload: handleBefore, "data-testid": "Upload", children: [_jsx(WdButton, { className: `${CLASS_PREFIX}__btn--weak`, text: btnTitle, theme: "secondary", variant: "outline" }), !single && (_jsx(WdText, { text: uploadTipText, className: `${CLASS_PREFIX}__btn-descripe` }))] })) })), _jsxs(List, { split: "divide", children: [_jsx(List.Item, { children: _jsxs("div", { className: `${CLASS_PREFIX}--item ${CLASS_PREFIX}--item-header`, children: [_jsx("div", { className: `${CLASS_PREFIX}--item-title ${CLASS_PREFIX}--item-label`, children: "\u6587\u4EF6\u540D" }), formType !== 'read' && (_jsx("div", { className: `${CLASS_PREFIX}--item-size ${CLASS_PREFIX}--item-label`, children: "\u5927\u5C0F" })), _jsx("div", { className: `${CLASS_PREFIX}--item-status ${CLASS_PREFIX}--item-label`, children: "\u72B6\u6001" }), _jsx("div", { className: `${CLASS_PREFIX}--item-action ${CLASS_PREFIX}--item-label`, children: "\u64CD\u4F5C" })] }) }), fileIDList.map((d) => (_jsx(List.Item, { children: _jsx(TcbFileEcho, { disabled: disabled, fileID: d, formType: formType }) }, d))), fileList.map((item) => (_jsx(List.Item, { children: _jsx(TcbFileUpload, { disabled: disabled, file: item, formType: formType, id: id }) }, item === null || item === void 0 ? void 0 : item._uuid))), !readOnly &&
212
- isEdit &&
213
- fileIDList.length === 0 &&
214
- fileList.length === 0 && (_jsx(List.Item, { className: `${CLASS_PREFIX}--item-empty`, children: _jsxs("div", { className: `${CLASS_PREFIX}--item`, children: ["\u70B9\u51FB\u4E0A\u65B9\u201C", btnTitle, "\u201D\u6309\u94AE"] }) }))] })] }) }) }), decorator)({
207
+ }, "data-testid": "button-up", children: _jsxs("div", { className: `${CLASS_PREFIX} ${readOnly ? `${CLASS_PREFIX}__readOnly` : ''}`, "data-testid": "UploadFilePc", children: [isEdit && (_jsx("div", { className: `${CLASS_PREFIX}__input-box`, children: btnDisabled ? (readOnly ? null : (_jsx(WdButton, { disabled: true, text: btnTitle, theme: "secondary", variant: "outline" }))) : (_jsxs(Upload, { ...uploadProps, beforeUpload: handleBefore, "data-testid": "Upload", children: [_jsx(WdButton, { className: `${CLASS_PREFIX}__btn--weak`, text: btnTitle, theme: "secondary", variant: "outline" }), !single && _jsx(WdText, { text: uploadTipText, className: `${CLASS_PREFIX}__btn-descripe` })] })) })), _jsxs(List, { split: "divide", children: [_jsx(List.Item, { children: _jsxs("div", { className: `${CLASS_PREFIX}--item ${CLASS_PREFIX}--item-header`, children: [_jsx("div", { className: `${CLASS_PREFIX}--item-title ${CLASS_PREFIX}--item-label`, children: "\u6587\u4EF6\u540D" }), formType !== 'read' && (_jsx("div", { className: `${CLASS_PREFIX}--item-size ${CLASS_PREFIX}--item-label`, children: "\u5927\u5C0F" })), _jsx("div", { className: `${CLASS_PREFIX}--item-status ${CLASS_PREFIX}--item-label`, children: "\u72B6\u6001" }), _jsx("div", { className: `${CLASS_PREFIX}--item-action ${CLASS_PREFIX}--item-label`, children: "\u64CD\u4F5C" })] }) }), fileIDList.map((d) => (_jsx(List.Item, { children: _jsx(TcbFileEcho, { disabled: disabled, fileID: d, formType: formType }) }, d))), fileList.map((item) => (_jsx(List.Item, { children: _jsx(TcbFileUpload, { disabled: disabled, file: item, formType: formType, id: id }) }, item === null || item === void 0 ? void 0 : item._uuid))), !readOnly && isEdit && fileIDList.length === 0 && fileList.length === 0 && (_jsx(List.Item, { className: `${CLASS_PREFIX}--item-empty`, children: _jsxs("div", { className: `${CLASS_PREFIX}--item`, children: ["\u70B9\u51FB\u4E0A\u65B9\u201C", btnTitle, "\u201D\u6309\u94AE"] }) }))] })] }) }) }), decorator)({
215
208
  id,
216
209
  className: cls,
217
210
  style,
@@ -224,7 +217,7 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
224
217
  /**
225
218
  * 基于 FileID 回显文件表格行组件
226
219
  */
227
- const TcbFileEcho = ({ fileID, disabled, formType, readOnly, }) => {
220
+ const TcbFileEcho = ({ fileID, disabled, formType, readOnly }) => {
228
221
  var _a;
229
222
  const { fileSizeObj } = React.useContext(FileContext) || {};
230
223
  const { data: src } = useTempUrl(fileID);
@@ -272,8 +265,7 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
272
265
  setPercent(percent < 100 ? percent : 100);
273
266
  },
274
267
  });
275
- !cancelRef.current &&
276
- (onChange === null || onChange === void 0 ? void 0 : onChange({ fileID, type: 'add', uuid, size, file }));
268
+ !cancelRef.current && (onChange === null || onChange === void 0 ? void 0 : onChange({ fileID, type: 'add', uuid, size, file }));
277
269
  setStatus('2');
278
270
  }
279
271
  catch (e) {
@@ -286,7 +278,7 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
286
278
  events.error && events.error(e);
287
279
  }
288
280
  };
289
- return (_jsxs("div", { className: `${CLASS_PREFIX}--item ${CLASS_PREFIX}--item-body`, children: [_jsx("div", { className: `${CLASS_PREFIX}--item-title ${CLASS_PREFIX}--item-value`, title: title, children: cutFileTitle(title) }), formType !== 'read' && (_jsx("div", { className: `${CLASS_PREFIX}--item-size ${CLASS_PREFIX}--item-value`, children: size })), _jsx("div", { className: `${CLASS_PREFIX}--item-status ${CLASS_PREFIX}--item-value`, children: _jsx(UploadFileStatus, { status: status, percent: percent }) }), _jsx("div", { className: `${CLASS_PREFIX}--item-action ${CLASS_PREFIX}--item-value`, children: _jsx(UploadFileAction, { file: file, uuid: file === null || file === void 0 ? void 0 : file._uuid, status: status, onCancel: (uuid) => {
281
+ return (_jsxs("div", { className: `${CLASS_PREFIX}--item ${CLASS_PREFIX}--item-body`, children: [_jsx("div", { className: `${CLASS_PREFIX}--item-title ${CLASS_PREFIX}--item-value`, title: title, children: cutFileTitle(title) }), formType !== 'read' && _jsx("div", { className: `${CLASS_PREFIX}--item-size ${CLASS_PREFIX}--item-value`, children: size }), _jsx("div", { className: `${CLASS_PREFIX}--item-status ${CLASS_PREFIX}--item-value`, children: _jsx(UploadFileStatus, { status: status, percent: percent }) }), _jsx("div", { className: `${CLASS_PREFIX}--item-action ${CLASS_PREFIX}--item-value`, children: _jsx(UploadFileAction, { file: file, uuid: file === null || file === void 0 ? void 0 : file._uuid, status: status, onCancel: (uuid) => {
290
282
  cancelRef.current = uuid;
291
283
  onChange === null || onChange === void 0 ? void 0 : onChange({ type: 'delete', uuid });
292
284
  }, disabled: disabled, onReLoad: handleUpload, readOnly: formType === 'read' }) })] }));
@@ -312,7 +304,7 @@ const UploadFileAction = ({ title = 'downfile', status = '0', fileID = '', uuid
312
304
  deleteVisible &&
313
305
  !readOnly && (_jsx(WdButton, { text: "\u5220\u9664", size: "sm", variant: "link", disabled: disabled, events: { tap: () => onChange === null || onChange === void 0 ? void 0 : onChange({ fileID, uuid, type: 'delete' }) } }));
314
306
  // 操作列按钮-取消
315
- const renderCancel = () => isEdit && (_jsx(WdButton, { events: { tap: () => onCancel === null || onCancel === void 0 ? void 0 : onCancel(uuid) }, variant: "link", text: "\u53D6\u6D88", size: "sm" }));
307
+ const renderCancel = () => isEdit && _jsx(WdButton, { events: { tap: () => onCancel === null || onCancel === void 0 ? void 0 : onCancel(uuid) }, variant: "link", text: "\u53D6\u6D88", size: "sm" });
316
308
  // 操作列按钮-重新上传
317
309
  const renderReLoad = () => isEdit && (_jsx(WdButton, { text: "\u91CD\u65B0\u4E0A\u4F20", size: "sm", variant: "link", events: {
318
310
  tap: () => {
@@ -5,7 +5,7 @@ import { getTempFileURL } from '../../utils/tcb';
5
5
  import { v4 as uuidv4 } from 'uuid';
6
6
  import { LOAD_ERR_IMG_BASE64, RICH_TEXT_ICON_PACK, getWhitelist } from '../../utils/constant';
7
7
  import { renderDecorator } from '../form/renderDecorator';
8
- import { usePlatform } from '../../utils/platform';
8
+ import { usePlatform, alertErrorMessage } from '../../utils/platform';
9
9
  import { errorHandler } from '../../utils/error';
10
10
  import { isPrivate } from '../../utils/isPrivate';
11
11
  import './style';
@@ -98,10 +98,9 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
98
98
  }
99
99
  };
100
100
  const isSizeAccept = (file) => {
101
- var _a, _b;
102
101
  if (file.size > maxSize * 1024 * 1024) {
103
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
104
- title: `文件大小超过上限${maxSize}M`,
102
+ alertErrorMessage({
103
+ message: `文件大小超过上限${maxSize}M`,
105
104
  icon: 'error',
106
105
  });
107
106
  return false;
@@ -109,7 +108,7 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
109
108
  return true;
110
109
  };
111
110
  const upload = async (file) => {
112
- var _a, _b, _c, _d, _e, _f, _g;
111
+ var _a, _b, _c, _d, _e;
113
112
  const tcb = await ((_b = (_a = window === null || window === void 0 ? void 0 : window.app) === null || _a === void 0 ? void 0 : _a.cloud) === null || _b === void 0 ? void 0 : _b.getCloudInstance());
114
113
  try {
115
114
  const fileType = (_e = (_d = (_c = file === null || file === void 0 ? void 0 : file.name) === null || _c === void 0 ? void 0 : _c.split('.')) === null || _d === void 0 ? void 0 : _d.pop()) === null || _e === void 0 ? void 0 : _e.toLowerCase();
@@ -133,8 +132,8 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
133
132
  error: e,
134
133
  id,
135
134
  });
136
- (_g = (_f = window === null || window === void 0 ? void 0 : window.$w) === null || _f === void 0 ? void 0 : _f.utils) === null || _g === void 0 ? void 0 : _g.showToast({
137
- title: '上传图片失败',
135
+ alertErrorMessage({
136
+ message: '上传图片失败',
138
137
  icon: 'error',
139
138
  });
140
139
  }
@@ -192,10 +191,9 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
192
191
  initialContent: syncedValue || initialContent,
193
192
  placeholder: placeholder,
194
193
  onCopy: (isSuccess) => {
195
- var _a, _b;
196
194
  if (isSuccess) {
197
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
198
- title: '复制成功',
195
+ alertErrorMessage({
196
+ message: '复制成功',
199
197
  icon: 'success',
200
198
  });
201
199
  }
@@ -220,14 +218,13 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
220
218
  accept: acceptTypes.join(),
221
219
  inline: true,
222
220
  acceptFile: (file) => {
223
- var _a, _b;
224
221
  let typeRegex = new RegExp(`^((${acceptTypes.join(')|(').replaceAll('+', '\\+')}))$`);
225
222
  if (acceptTypes.join().includes('*')) {
226
223
  typeRegex = new RegExp(`^image/.+$`);
227
224
  }
228
225
  if (!typeRegex.test(file.type)) {
229
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
230
- title: '文件格式不支持',
226
+ alertErrorMessage({
227
+ message: '文件格式不支持',
231
228
  icon: 'error',
232
229
  });
233
230
  return false;
@@ -1,4 +1,4 @@
1
- export declare const deleteRecord: ({ selectedKeys, dataSourceAPI, beforeModalDestroy, supportManyRelated, }: {
1
+ export declare const deleteRecord: ({ selectedKeys, dataSourceAPI, beforeModalDestroy, supportManyRelated }: {
2
2
  selectedKeys: any;
3
3
  dataSourceAPI: any;
4
4
  beforeModalDestroy: any;
@@ -1,7 +1,30 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Modal } from 'tea-component';
3
+ import { alertErrorMessage } from '../../../utils/platform';
1
4
  // 删除数据事件
2
- export const deleteRecord = ({ selectedKeys, dataSourceAPI, beforeModalDestroy, supportManyRelated, }) => {
5
+ export const deleteRecord = ({ selectedKeys, dataSourceAPI, beforeModalDestroy, supportManyRelated }) => {
6
+ const deleteAction = async (resolve, reject) => {
7
+ try {
8
+ await dataSourceAPI.batchDeleteRecord(selectedKeys, supportManyRelated);
9
+ beforeModalDestroy();
10
+ alertErrorMessage({
11
+ message: '删除数据成功',
12
+ icon: 'success',
13
+ });
14
+ resolve();
15
+ }
16
+ catch (error) {
17
+ const obj = {
18
+ code: error.code,
19
+ message: error.message,
20
+ requestId: error.requestId,
21
+ original: error.original,
22
+ };
23
+ reject(obj);
24
+ }
25
+ };
3
26
  return new Promise((resolve, reject) => {
4
- var _a, _b;
27
+ var _a, _b, _c, _d;
5
28
  if (!(selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.length)) {
6
29
  reject({
7
30
  code: 'WdTable.NoSelectKeys',
@@ -13,34 +36,28 @@ export const deleteRecord = ({ selectedKeys, dataSourceAPI, beforeModalDestroy,
13
36
  const msg =
14
37
  // eslint-disable-next-line @typescript-eslint/no-magic-numbers
15
38
  (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.length) > 1 ? '确认删除选定的条目?' : '确认删除此条目?';
16
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showModal({
17
- title: '操作确认',
18
- content: msg,
19
- cancelColor: '#000000',
20
- success: async (res) => {
21
- var _a, _b;
22
- if (res.confirm) {
23
- try {
24
- // modal.destroy();
25
- await dataSourceAPI.batchDeleteRecord(selectedKeys, supportManyRelated);
26
- beforeModalDestroy();
27
- (_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
28
- title: '删除数据成功',
29
- icon: 'success',
30
- });
31
- resolve();
32
- }
33
- catch (error) {
34
- const obj = {
35
- code: error.code,
36
- message: error.message,
37
- requestId: error.requestId,
38
- original: error.original,
39
- };
40
- reject(obj);
39
+ if ((_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showModal) {
40
+ (_d = (_c = window === null || window === void 0 ? void 0 : window.$w) === null || _c === void 0 ? void 0 : _c.utils) === null || _d === void 0 ? void 0 : _d.showModal({
41
+ title: '操作确认',
42
+ content: msg,
43
+ cancelColor: '#000000',
44
+ success: async (res) => {
45
+ if (res.confirm) {
46
+ deleteAction(resolve, reject);
41
47
  }
42
- }
43
- },
44
- });
48
+ },
49
+ });
50
+ }
51
+ else {
52
+ const modal = Modal.show({
53
+ className: 'modal-table-delete',
54
+ caption: '操作确认',
55
+ onClose: () => modal.destroy(),
56
+ children: (_jsxs(_Fragment, { children: [_jsx("div", { children: msg }), _jsx(Modal.Footer, { children: _jsx(Button, { type: "primary", onClick: async () => {
57
+ modal.destroy();
58
+ deleteAction(resolve, reject);
59
+ }, children: "\u786E\u8BA4" }) })] })),
60
+ });
61
+ }
45
62
  });
46
63
  };
@@ -43,8 +43,7 @@ export function usePlatform() {
43
43
  // 不进行 observer 的目的是不希望出现页面 resize 时切换大小屏
44
44
  // 编辑器在大小屏切换时会刷新,所以不需要监听 platforms 变化
45
45
  // 由于编辑器中从 mp 和 h5 之间切换不会刷新页面,这里将 mp 也视为小屏幕
46
- const smallScreen = (_g = (((_c = (_b = (_a = window.$w) === null || _a === void 0 ? void 0 : _a.wedaContext) === null || _b === void 0 ? void 0 : _b.platforms) === null || _c === void 0 ? void 0 : _c.includes(`MOBILEWEB`)) ||
47
- ((_f = (_e = (_d = window.$w) === null || _d === void 0 ? void 0 : _d.wedaContext) === null || _e === void 0 ? void 0 : _e.platforms) === null || _f === void 0 ? void 0 : _f.includes(`MP`)))) !== null && _g !== void 0 ? _g : isH5Platform();
46
+ const smallScreen = (_g = (((_c = (_b = (_a = window.$w) === null || _a === void 0 ? void 0 : _a.wedaContext) === null || _b === void 0 ? void 0 : _b.platforms) === null || _c === void 0 ? void 0 : _c.includes(`MOBILEWEB`)) || ((_f = (_e = (_d = window.$w) === null || _d === void 0 ? void 0 : _d.wedaContext) === null || _e === void 0 ? void 0 : _e.platforms) === null || _f === void 0 ? void 0 : _f.includes(`MP`)))) !== null && _g !== void 0 ? _g : isH5Platform();
48
47
  return smallScreen ? 'h5' : 'pc';
49
48
  }
50
49
  /**
@@ -239,9 +238,7 @@ export const getWhereList = (where) => {
239
238
  }
240
239
  let [rel, val] = [REL_DICT[item2 === null || item2 === void 0 ? void 0 : item2.rel] || (item2 === null || item2 === void 0 ? void 0 : item2.rel), item2 === null || item2 === void 0 ? void 0 : item2.value];
241
240
  // 去掉空字符串、undefined(接口不支持)、对象类型(接口不支持)
242
- if (val === '' ||
243
- val === undefined ||
244
- Object.prototype.toString.call(val) === '[object Object]') {
241
+ if (val === '' || val === undefined || Object.prototype.toString.call(val) === '[object Object]') {
245
242
  return;
246
243
  }
247
244
  if ('_begin_with' === rel) {
@@ -284,12 +281,12 @@ export const textToString = (text) => {
284
281
  * 统一错误提示
285
282
  */
286
283
  export function alertErrorMessage({ message, duration = 3000, icon = 'none' }) {
287
- var _a, _b, _c, _d, _e, _f;
288
- const smallScreen = (_b = (_a = window === null || window === void 0 ? void 0 : window.matchMedia('(max-width: 768px)')) === null || _a === void 0 ? void 0 : _a.matches) !== null && _b !== void 0 ? _b : isH5Platform();
289
- const touchDevice = (_d = (_c = window === null || window === void 0 ? void 0 : window.matchMedia('(pointer:coarse)')) === null || _c === void 0 ? void 0 : _c.matches) !== null && _d !== void 0 ? _d : smallScreen;
290
- const platform = touchDevice || smallScreen ? 'h5' : 'pc';
291
- if (platform === 'h5' && ((_e = window === null || window === void 0 ? void 0 : window.app) === null || _e === void 0 ? void 0 : _e.showToast)) {
292
- (_f = window === null || window === void 0 ? void 0 : window.app) === null || _f === void 0 ? void 0 : _f.showToast({
284
+ var _a, _b;
285
+ // const smallScreen = window?.matchMedia('(max-width: 768px)')?.matches ?? isH5Platform();
286
+ // const touchDevice = window?.matchMedia('(pointer:coarse)')?.matches ?? smallScreen;
287
+ // const platform = touchDevice || smallScreen ? 'h5' : 'pc';
288
+ if ((_a = window === null || window === void 0 ? void 0 : window.app) === null || _a === void 0 ? void 0 : _a.showToast) {
289
+ (_b = window === null || window === void 0 ? void 0 : window.app) === null || _b === void 0 ? void 0 : _b.showToast({
293
290
  title: message,
294
291
  icon,
295
292
  duration,
@@ -374,8 +371,7 @@ export const isSupportLoading = () => {
374
371
  */
375
372
  export const isWebInMiniprogram = () => {
376
373
  var ua = navigator.userAgent.toLowerCase();
377
- return ((ua.match(/micromessenger/i) && ua.match(/miniprogram/i)) ||
378
- window['__wxjs_environment'] === 'miniprogram');
374
+ return (ua.match(/micromessenger/i) && ua.match(/miniprogram/i)) || window['__wxjs_environment'] === 'miniprogram';
379
375
  };
380
376
  /**
381
377
  * 判断访问终端
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.14.1",
3
+ "version": "3.14.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",
@@ -85,7 +85,7 @@
85
85
  "description": "腾讯云微搭低代码组件库模板",
86
86
  "dependencies": {
87
87
  "@antv/g6": "^4.8.5",
88
- "@cloudbase/weda-client": "^1.1.21",
88
+ "@cloudbase/weda-client": "^1.1.22",
89
89
  "@codemirror/autocomplete": "^6.16.0",
90
90
  "@codemirror/lang-javascript": "^6.2.2",
91
91
  "@codemirror/lang-json": "^6.0.1",
@@ -149,7 +149,7 @@
149
149
  "@babel/preset-typescript": "^7.22.15",
150
150
  "@cloudbase/cals": "^1.2.8",
151
151
  "@cloudbase/lowcode-cli": "^0.22.1",
152
- "@cloudbase/weda-cloud-sdk": "^1.0.96",
152
+ "@cloudbase/weda-cloud-sdk": "^1.0.97",
153
153
  "@commitlint/cli": "^16.0.2",
154
154
  "@commitlint/config-conventional": "^17.7.0",
155
155
  "@craco/craco": "^7.1.0",