@cloudbase/weda-ui 3.13.6 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/components/chart/bar.d.ts +2 -2
- package/dist/configs/components/chart/bar.js +1 -1
- package/dist/configs/components/chart/line.d.ts +1 -1
- package/dist/configs/components/chart/pie.d.ts +1 -1
- package/dist/configs/components/form-date.d.ts +2 -2
- package/dist/configs/components/form-depart-tree-select.d.ts +2 -2
- package/dist/configs/components/form-email.d.ts +2 -2
- package/dist/configs/components/form-input.d.ts +2 -2
- package/dist/configs/components/form-location.d.ts +2 -2
- package/dist/configs/components/form-multi-region.d.ts +2 -2
- package/dist/configs/components/form-phone.d.ts +2 -2
- package/dist/configs/components/form-region.d.ts +2 -2
- package/dist/configs/components/form-select-multiple.d.ts +2 -2
- package/dist/configs/components/form-select.d.ts +2 -2
- package/dist/configs/components/form-text-area.d.ts +2 -2
- package/dist/configs/components/form-time.d.ts +2 -2
- package/dist/configs/components/form-url.d.ts +2 -2
- package/dist/configs/components/form-user-tree-select.d.ts +2 -2
- package/dist/configs/components/swiper.json +122 -0
- package/dist/configs/components/wd-canvas.d.ts +1 -1
- package/dist/configs/components/wd-cascader.d.ts +3 -3
- package/dist/configs/components/wd-checkbox.d.ts +1 -1
- package/dist/configs/components/wd-code-editor.d.ts +1 -1
- package/dist/configs/components/wd-date-range.d.ts +1 -1
- package/dist/configs/components/wd-date.d.ts +1 -1
- package/dist/configs/components/wd-department.d.ts +1 -1
- package/dist/configs/components/wd-form-arr.d.ts +1 -1
- package/dist/configs/components/wd-form-detail.d.ts +1 -1
- package/dist/configs/components/wd-form-obj.d.ts +1 -1
- package/dist/configs/components/wd-icon.d.ts +7 -2
- package/dist/configs/components/wd-icon.js +1 -5
- package/dist/configs/components/wd-input-email.d.ts +1 -1
- package/dist/configs/components/wd-input-number.d.ts +2 -2
- package/dist/configs/components/wd-input-phone.d.ts +1 -1
- package/dist/configs/components/wd-input-url.d.ts +1 -1
- package/dist/configs/components/wd-input.d.ts +1 -1
- package/dist/configs/components/wd-location.d.ts +2 -2
- package/dist/configs/components/wd-member.d.ts +1 -1
- package/dist/configs/components/wd-progress.d.ts +2 -2
- package/dist/configs/components/wd-radio.d.ts +1 -1
- package/dist/configs/components/wd-rating.d.ts +2 -2
- package/dist/configs/components/wd-region.d.ts +1 -1
- package/dist/configs/components/wd-rich-text.d.ts +1 -1
- package/dist/configs/components/wd-select-multiple.d.ts +1 -1
- package/dist/configs/components/wd-select.d.ts +2 -2
- package/dist/configs/components/wd-store-product.d.ts +6 -0
- package/dist/configs/components/wd-store-product.js +35 -0
- package/dist/configs/components/wd-switch.d.ts +2 -2
- package/dist/configs/components/wd-tag-select.d.ts +1 -1
- package/dist/configs/components/wd-textarea.d.ts +1 -1
- package/dist/configs/components/wd-time.d.ts +1 -1
- package/dist/configs/components/wd-top-tab.d.ts +2 -1
- package/dist/configs/components/wd-top-tab.js +8 -1
- package/dist/configs/components/wd-upload-file.d.ts +3 -3
- package/dist/configs/components/wd-upload-image.d.ts +1 -1
- package/dist/configs/index.d.ts +256 -114
- package/dist/configs/type-utils/index.d.ts +1 -1
- package/dist/style/index.css +19 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +4 -4
- package/dist/web/components/form/location/common/mapChoose.js +17 -3
- package/dist/web/components/form-date/index.d.ts +2 -2
- package/dist/web/components/form-depart-tree-select/index.d.ts +2 -2
- package/dist/web/components/form-email/index.d.ts +2 -2
- package/dist/web/components/form-image-uploader/index.d.ts +1 -1
- package/dist/web/components/form-input/index.d.ts +4 -4
- package/dist/web/components/form-location/index.d.ts +4 -4
- package/dist/web/components/form-multi-region/index.d.ts +2 -2
- package/dist/web/components/form-phone/index.d.ts +2 -2
- package/dist/web/components/form-radio/index.d.ts +3 -3
- package/dist/web/components/form-region/index.d.ts +2 -2
- package/dist/web/components/form-rich-text/index.d.ts +1 -1
- package/dist/web/components/form-select/index.d.ts +4 -4
- package/dist/web/components/form-select-multiple/index.d.ts +4 -4
- package/dist/web/components/form-switch/index.d.ts +1 -1
- package/dist/web/components/form-text-area/index.d.ts +2 -2
- package/dist/web/components/form-time/index.d.ts +2 -2
- package/dist/web/components/form-upload-file/index.d.ts +1 -1
- package/dist/web/components/form-url/index.d.ts +2 -2
- package/dist/web/components/form-user-tree-select/index.d.ts +2 -2
- package/dist/web/components/richText/index.js +29 -16
- package/dist/web/components/statusContent/index.css +1 -0
- package/dist/web/components/wd-image/ImagePreview.js +3 -3
- package/dist/web/components/wd-input/wd-input.d.ts +2 -2
- package/dist/web/components/wd-input-number/wd-input-number.js +17 -34
- package/dist/web/components/wd-input-phone/wd-input-phone.d.ts +2 -2
- package/dist/web/components/wd-table/components/FilterFieldsPanel/index.js +9 -13
- package/dist/web/components/wd-tree/utils.d.ts +6 -6
- package/dist/web/utils/loadIconCss.js +10 -7
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import classNames from '../../../../utils/classnames';
|
|
6
6
|
import debounce from '../../../../utils/debounce';
|
|
7
7
|
import { tmapApiUrl } from '../constants';
|
|
8
|
-
import { getTMap, calculateDistance, base64LocationIcon
|
|
8
|
+
import { getTMap, calculateDistance, base64LocationIcon } from '../../../../utils/tmap';
|
|
9
9
|
import { errorHandler } from '../../../../utils/error';
|
|
10
10
|
import { Icon } from 'tea-component';
|
|
11
11
|
import { inH5IsMobile } from '../../../../utils/platform';
|
|
@@ -234,11 +234,13 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
234
234
|
}
|
|
235
235
|
})
|
|
236
236
|
.catch((error) => {
|
|
237
|
+
var _a;
|
|
237
238
|
setSearchLoadingStatus(false);
|
|
238
239
|
setRealLocation({ lat, lng }, []);
|
|
239
240
|
errorHandler({
|
|
240
241
|
code: 'WdLocation.exploreNear',
|
|
241
242
|
error,
|
|
243
|
+
message: ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限')) ? '附近搜索失败,请调整/ws/place/v1/explore配额' : '',
|
|
242
244
|
});
|
|
243
245
|
});
|
|
244
246
|
}, 500);
|
|
@@ -270,9 +272,13 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
270
272
|
}
|
|
271
273
|
})
|
|
272
274
|
.catch((error) => {
|
|
275
|
+
var _a;
|
|
273
276
|
errorHandler({
|
|
274
277
|
code: 'WdLocation.getAddress',
|
|
275
278
|
error,
|
|
279
|
+
message: ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限'))
|
|
280
|
+
? '地址解析失败,请调整/ws/geocoder/v1/?address=*配额'
|
|
281
|
+
: '',
|
|
276
282
|
});
|
|
277
283
|
let item = {
|
|
278
284
|
id: 'current-location',
|
|
@@ -323,9 +329,13 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
323
329
|
}
|
|
324
330
|
})
|
|
325
331
|
.catch((error) => {
|
|
332
|
+
var _a;
|
|
326
333
|
errorHandler({
|
|
327
334
|
code: 'WdLocation.getSuggestion',
|
|
328
335
|
error,
|
|
336
|
+
message: ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限'))
|
|
337
|
+
? '关键词输入提示失败,请调整/ws/place/v1/suggestion配额'
|
|
338
|
+
: '',
|
|
329
339
|
});
|
|
330
340
|
});
|
|
331
341
|
}
|
|
@@ -415,14 +425,14 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
415
425
|
e.stopPropagation();
|
|
416
426
|
}, ref: searchListRef, onScroll: searchListOnScroll, children: (isSearch ? searchList : exploreList).map((item, index) => (_jsx("div", { className: "weda-ui_mapChoose_search_list_li", onClick: () => {
|
|
417
427
|
chooseLoction(item);
|
|
418
|
-
}, children: _jsxs("div", { className: "weda-ui_mapChoose_search_list_li_wrap", children: [_jsx("div", { className: "weda-ui_mapChoose_search_list_li_title", children: item.title }), _jsx("div", { className: "weda-ui_mapChoose_search_list_li_con", children: item.address }), item.id === chooseLoc.id &&
|
|
428
|
+
}, children: _jsxs("div", { className: "weda-ui_mapChoose_search_list_li_wrap", children: [_jsx("div", { className: "weda-ui_mapChoose_search_list_li_title", children: item.title }), _jsx("div", { className: "weda-ui_mapChoose_search_list_li_con", children: item.address }), item.id === chooseLoc.id && _jsx("span", { className: "weda-ui_mapChoose_search_list_li_con_choosed" })] }) }, index))) })] }));
|
|
419
429
|
};
|
|
420
430
|
const renderOutTip = () => {
|
|
421
431
|
return (_jsxs("div", { className: classNames({
|
|
422
432
|
'weda-ui_mapChoose_outTip': true,
|
|
423
433
|
'weda-ui_mapChoose_outTip_block': isOutofrange,
|
|
424
434
|
'weda-ui_mapChoose_outTip_pc': isPC,
|
|
425
|
-
}), children: [isOutofrange &&
|
|
435
|
+
}), children: [isOutofrange && _jsx(Icon, { type: "warning", size: "default", color: "#ED7B2F", style: { marginRight: '9px' } }), isOutofrange && _jsx("span", { children: "\u5B9A\u4F4D\u8D85\u51FA\u5141\u8BB8\u8303\u56F4,\u8BF7\u8C03\u6574" })] }));
|
|
426
436
|
};
|
|
427
437
|
const getRadius = () => {
|
|
428
438
|
let radius = 0;
|
|
@@ -437,6 +447,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
437
447
|
// 获取设备最新位置
|
|
438
448
|
const getLatestLc = function () {
|
|
439
449
|
return new Promise((resolve) => {
|
|
450
|
+
var _a;
|
|
440
451
|
try {
|
|
441
452
|
if (userLocation) {
|
|
442
453
|
resolve(userLocation);
|
|
@@ -470,6 +481,9 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
470
481
|
errorHandler({
|
|
471
482
|
code: 'WdLocation.getLatestLocation',
|
|
472
483
|
error: e,
|
|
484
|
+
message: ((_a = e === null || e === void 0 ? void 0 : e.message) === null || _a === void 0 ? void 0 : _a.includes('调用量已达到上限'))
|
|
485
|
+
? '坐标转换失败,请调整/ws/geocoder/v1/?location=*配额'
|
|
486
|
+
: '',
|
|
473
487
|
});
|
|
474
488
|
resolve(null);
|
|
475
489
|
}
|
|
@@ -7,11 +7,11 @@ export type FormDateProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormDate: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
12
|
+
value: string;
|
|
13
13
|
required: boolean;
|
|
14
|
-
size: "
|
|
14
|
+
size: "s" | "m" | "l" | "full";
|
|
15
15
|
disabled: boolean;
|
|
16
16
|
placeholder: string;
|
|
17
17
|
end: string;
|
|
@@ -7,11 +7,11 @@ export type FormDepartTreeSelectProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormDepartTreeSelect: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
12
|
+
value: string;
|
|
13
13
|
required: boolean;
|
|
14
|
-
size: "
|
|
14
|
+
size: "s" | "m" | "l" | "full";
|
|
15
15
|
disabled: boolean;
|
|
16
16
|
placeholder: string;
|
|
17
17
|
layout: "" | "vertical" | "horizontal";
|
|
@@ -7,12 +7,12 @@ export type PropsType = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormEmail: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
13
12
|
focus: boolean;
|
|
13
|
+
value: string;
|
|
14
14
|
required: boolean;
|
|
15
|
-
size: "
|
|
15
|
+
size: "s" | "m" | "l" | "full";
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
maxLength: number;
|
|
18
18
|
placeholder: string;
|
|
@@ -7,9 +7,9 @@ export type FormImageUploaderProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormImageUploader: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string[];
|
|
11
10
|
name: string;
|
|
12
11
|
title: string;
|
|
12
|
+
value: string[];
|
|
13
13
|
required: boolean;
|
|
14
14
|
disabled: boolean;
|
|
15
15
|
layout: "" | "vertical" | "horizontal";
|
|
@@ -7,13 +7,13 @@ export type PropsType = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
};
|
|
9
9
|
declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
|
-
type: "number" | "text" | "idcard" | "digit";
|
|
12
10
|
name: string;
|
|
11
|
+
type: "number" | "text" | "idcard" | "digit";
|
|
13
12
|
label: string;
|
|
14
13
|
focus: boolean;
|
|
14
|
+
value: string;
|
|
15
15
|
required: boolean;
|
|
16
|
-
size: "
|
|
16
|
+
size: "s" | "m" | "l" | "full";
|
|
17
17
|
disabled: boolean;
|
|
18
18
|
maxLength: number;
|
|
19
19
|
placeholder: string;
|
|
@@ -23,9 +23,9 @@ declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
23
23
|
isNickNameType: boolean;
|
|
24
24
|
password: boolean;
|
|
25
25
|
rules: {
|
|
26
|
-
format: string;
|
|
27
26
|
message: string;
|
|
28
27
|
pattern: string;
|
|
28
|
+
format: string;
|
|
29
29
|
}[];
|
|
30
30
|
validateStatus: "error" | "success" | "warn";
|
|
31
31
|
requiredFlag: boolean;
|
|
@@ -7,6 +7,9 @@ export type FormLocationProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormLocation: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
+
name: string;
|
|
11
|
+
label: string;
|
|
12
|
+
drag: boolean;
|
|
10
13
|
value: {
|
|
11
14
|
address: string;
|
|
12
15
|
geopoint: {
|
|
@@ -14,14 +17,11 @@ declare const FormLocation: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
14
17
|
coordinates: [number, number];
|
|
15
18
|
};
|
|
16
19
|
};
|
|
17
|
-
name: string;
|
|
18
|
-
label: string;
|
|
19
|
-
drag: boolean;
|
|
20
20
|
required: boolean;
|
|
21
21
|
disabled: boolean;
|
|
22
22
|
layout: "" | "vertical" | "horizontal";
|
|
23
23
|
zoom: boolean;
|
|
24
|
-
locationType:
|
|
24
|
+
locationType: 2 | 1;
|
|
25
25
|
labelVisible: boolean;
|
|
26
26
|
showLngLat: boolean;
|
|
27
27
|
showMap: boolean;
|
|
@@ -7,11 +7,11 @@ export type FormMultiRegionProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormMultiRegion: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
12
|
+
value: string;
|
|
13
13
|
required: boolean;
|
|
14
|
-
size: "
|
|
14
|
+
size: "s" | "m" | "l" | "full";
|
|
15
15
|
disabled: boolean;
|
|
16
16
|
placeholder: string;
|
|
17
17
|
layout: "" | "vertical" | "horizontal";
|
|
@@ -7,12 +7,12 @@ export type PropsType = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormPhone: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
13
12
|
focus: boolean;
|
|
13
|
+
value: string;
|
|
14
14
|
required: boolean;
|
|
15
|
-
size: "
|
|
15
|
+
size: "s" | "m" | "l" | "full";
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
placeholder: string;
|
|
18
18
|
layout: "" | "vertical" | "horizontal";
|
|
@@ -11,16 +11,16 @@ declare const FormRadio: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
11
11
|
disabled: boolean;
|
|
12
12
|
readOnly: boolean;
|
|
13
13
|
} & {
|
|
14
|
-
value: string;
|
|
15
|
-
format: string;
|
|
16
14
|
name: string;
|
|
17
15
|
label: string;
|
|
16
|
+
format: string;
|
|
17
|
+
value: string;
|
|
18
18
|
required: boolean;
|
|
19
19
|
disabled: boolean;
|
|
20
20
|
layout: "" | "vertical" | "horizontal";
|
|
21
21
|
range: {
|
|
22
|
-
value: string;
|
|
23
22
|
label: string;
|
|
23
|
+
value: string;
|
|
24
24
|
}[];
|
|
25
25
|
tipBlock: string;
|
|
26
26
|
labelVisible: boolean;
|
|
@@ -7,11 +7,11 @@ export type FormRegionProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormRegion: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string[];
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
12
|
+
value: string[];
|
|
13
13
|
required: boolean;
|
|
14
|
-
size: "
|
|
14
|
+
size: "s" | "m" | "l" | "full";
|
|
15
15
|
disabled: boolean;
|
|
16
16
|
placeholder: string;
|
|
17
17
|
separator: string;
|
|
@@ -7,9 +7,9 @@ export type FormRichTextProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FromRichText: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
title: string;
|
|
12
|
+
value: string;
|
|
13
13
|
required: boolean;
|
|
14
14
|
disabled: boolean;
|
|
15
15
|
layout: "" | "vertical" | "horizontal";
|
|
@@ -7,18 +7,18 @@ export type FormSelectProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormSelect: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
|
-
format: "x-enum" | "related" | "father-son" | "many-one";
|
|
12
10
|
name: string;
|
|
13
11
|
label: string;
|
|
12
|
+
format: "x-enum" | "related" | "father-son" | "many-one";
|
|
13
|
+
value: string;
|
|
14
14
|
required: boolean;
|
|
15
|
-
size: "
|
|
15
|
+
size: "s" | "m" | "l" | "full";
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
placeholder: string;
|
|
18
18
|
layout: "" | "vertical" | "horizontal";
|
|
19
19
|
range: {
|
|
20
|
-
value: string;
|
|
21
20
|
label: string;
|
|
21
|
+
value: string;
|
|
22
22
|
}[];
|
|
23
23
|
dataSourceName: string;
|
|
24
24
|
where: any[];
|
|
@@ -7,18 +7,18 @@ export type FormSelectMultipleProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormSelectMultiple: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string[];
|
|
11
|
-
format: "many-many" | "one-many";
|
|
12
10
|
name: string;
|
|
13
11
|
label: string;
|
|
12
|
+
format: "many-many" | "one-many";
|
|
13
|
+
value: string[];
|
|
14
14
|
required: boolean;
|
|
15
|
-
size: "
|
|
15
|
+
size: "s" | "m" | "l" | "full";
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
placeholder: string;
|
|
18
18
|
layout: "" | "vertical" | "horizontal";
|
|
19
19
|
range: {
|
|
20
|
-
value: string;
|
|
21
20
|
label: string;
|
|
21
|
+
value: string;
|
|
22
22
|
}[];
|
|
23
23
|
dataSourceName: string;
|
|
24
24
|
tipBlock: string;
|
|
@@ -7,9 +7,9 @@ export type FormSwitchProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormSwitch: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: boolean;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
12
|
+
value: boolean;
|
|
13
13
|
required: boolean;
|
|
14
14
|
disabled: boolean;
|
|
15
15
|
layout: "" | "vertical" | "horizontal";
|
|
@@ -7,12 +7,12 @@ export type FormTextAreaProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormTextArea: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
13
12
|
focus: boolean;
|
|
13
|
+
value: string;
|
|
14
14
|
required: boolean;
|
|
15
|
-
size: "
|
|
15
|
+
size: "s" | "m" | "l" | "full";
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
maxLength: number;
|
|
18
18
|
placeholder: string;
|
|
@@ -7,11 +7,11 @@ export type FormTimeProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormTime: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
12
|
+
value: string;
|
|
13
13
|
required: boolean;
|
|
14
|
-
size: "
|
|
14
|
+
size: "s" | "m" | "l" | "full";
|
|
15
15
|
disabled: boolean;
|
|
16
16
|
placeholder: string;
|
|
17
17
|
end: string;
|
|
@@ -7,9 +7,9 @@ export type FormUploadFileProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormUploadFile: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string[];
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
12
|
+
value: string[];
|
|
13
13
|
required: boolean;
|
|
14
14
|
disabled: boolean;
|
|
15
15
|
layout: "" | "vertical" | "horizontal";
|
|
@@ -7,12 +7,12 @@ export type PropsType = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormUrl: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
13
12
|
focus: boolean;
|
|
13
|
+
value: string;
|
|
14
14
|
required: boolean;
|
|
15
|
-
size: "
|
|
15
|
+
size: "s" | "m" | "l" | "full";
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
maxLength: number;
|
|
18
18
|
placeholder: string;
|
|
@@ -7,11 +7,11 @@ export type FormUserTreeSelectProps = CommonPropsType & DataType & {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
} & EventsType;
|
|
9
9
|
declare const FormUserTreeSelect: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
|
-
value: string;
|
|
11
10
|
name: string;
|
|
12
11
|
label: string;
|
|
12
|
+
value: string;
|
|
13
13
|
required: boolean;
|
|
14
|
-
size: "
|
|
14
|
+
size: "s" | "m" | "l" | "full";
|
|
15
15
|
disabled: boolean;
|
|
16
16
|
placeholder: string;
|
|
17
17
|
layout: "" | "vertical" | "horizontal";
|
|
@@ -12,7 +12,6 @@ import './style';
|
|
|
12
12
|
import { useSyncValue } from '../../utils/hooks/useSyncValue';
|
|
13
13
|
import xss from 'xss';
|
|
14
14
|
import onlineConfig from '../../../onlineConfig.json';
|
|
15
|
-
const cfg = isPrivate() ? { ...onlineConfig.richText, ...onlineConfig.richText.private } : onlineConfig.richText;
|
|
16
15
|
// 默认图片类型
|
|
17
16
|
const IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp', 'image/tiff', 'image/svg+xml'];
|
|
18
17
|
// 默认音频类型
|
|
@@ -142,24 +141,38 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
|
|
|
142
141
|
};
|
|
143
142
|
React.useEffect(() => {
|
|
144
143
|
if (!(window === null || window === void 0 ? void 0 : window.ExEditor3) && !loadEditorPromise) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
head
|
|
144
|
+
// 挂载资源
|
|
145
|
+
function loadSrc(src, css) {
|
|
146
|
+
return new Promise((resolve, reject) => {
|
|
147
|
+
const script = document.createElement('script');
|
|
148
|
+
script.src = src;
|
|
149
|
+
script.onload = () => resolve('');
|
|
150
|
+
script.onerror = () => reject('');
|
|
151
|
+
document.body.appendChild(script);
|
|
152
|
+
const link = document.createElement('link');
|
|
153
|
+
link.setAttribute('rel', 'stylesheet');
|
|
154
|
+
link.setAttribute('href', css);
|
|
155
|
+
const head = document.getElementsByTagName('head');
|
|
156
|
+
if (head.length) {
|
|
157
|
+
head[0].appendChild(link);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
document.body.appendChild(link);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
const cfg = onlineConfig.richText;
|
|
166
|
+
if (isPrivate()) {
|
|
167
|
+
loadEditorPromise = loadSrc(cfg.private.js, cfg.private.css).catch((_) => loadSrc(cfg.js, cfg.css));
|
|
158
168
|
}
|
|
159
169
|
else {
|
|
160
|
-
|
|
170
|
+
loadEditorPromise = loadSrc(cfg.js, cfg.css);
|
|
161
171
|
}
|
|
162
|
-
}
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
errorHandler({ code: 'LoadRichtextResourceError', error: e });
|
|
175
|
+
}
|
|
163
176
|
}
|
|
164
177
|
if (loadEditorPromise) {
|
|
165
178
|
loadEditorPromise.then(() => {
|
|
@@ -24,13 +24,13 @@ export const ImagePreview = (props) => {
|
|
|
24
24
|
const previewStyle = platform === 'h5'
|
|
25
25
|
? {
|
|
26
26
|
touchAction: 'none',
|
|
27
|
-
backgroundImage: `url('${realSrc || src}')`,
|
|
27
|
+
// backgroundImage: `url('${realSrc || src}')`,
|
|
28
28
|
transform: `translate(${translateX}px, ${translateY}px) scale(${previewScale})`,
|
|
29
29
|
...style,
|
|
30
30
|
}
|
|
31
31
|
: {
|
|
32
32
|
touchAction: 'none',
|
|
33
|
-
backgroundImage: `url('${realSrc || src}')`,
|
|
33
|
+
// backgroundImage: `url('${realSrc || src}')`,
|
|
34
34
|
transform: `rotate(${rotate}deg)`,
|
|
35
35
|
...style,
|
|
36
36
|
};
|
|
@@ -100,7 +100,7 @@ export const ImagePreview = (props) => {
|
|
|
100
100
|
e.stopPropagation();
|
|
101
101
|
}
|
|
102
102
|
setVisible(false);
|
|
103
|
-
}, className: `${classPrefix}-image-mask__close-btn`, children: _jsx("i", { className: `${classPrefix}-image-mask__icon-close` }) }), _jsx("div", { ...bind(), className: `${classPrefix}-image-preview`, style: previewStyle }), platform === 'pc' && (_jsxs("div", { className: `${classPrefix}-image-preview-toolbar`, children: [(previewImageList === null || previewImageList === void 0 ? void 0 : previewImageList.length) > 1 && (_jsxs(_Fragment, { children: [_jsx("span", { className: "wd-icon-wrap wd-event-tap", children: _jsx(WdIcon, { name: 'td:chevron-left', size: "sm", events: {
|
|
103
|
+
}, className: `${classPrefix}-image-mask__close-btn`, children: _jsx("i", { className: `${classPrefix}-image-mask__icon-close` }) }), _jsx("div", { ...bind(), className: `${classPrefix}-image-preview ${classPrefix}-${platform}-image-preview`, style: previewStyle, children: _jsx("img", { style: { backgroundImage: `url('${realSrc || src}')` }, className: `${classPrefix}-image-preview-img`, src: realSrc || src }) }), platform === 'pc' && (_jsxs("div", { className: `${classPrefix}-image-preview-toolbar`, children: [(previewImageList === null || previewImageList === void 0 ? void 0 : previewImageList.length) > 1 && (_jsxs(_Fragment, { children: [_jsx("span", { className: "wd-icon-wrap wd-event-tap", children: _jsx(WdIcon, { name: 'td:chevron-left', size: "sm", events: {
|
|
104
104
|
tap: (arg, { originEvent: e }) => {
|
|
105
105
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
106
106
|
const index = previewImageList.findIndex((i) => i === currentImg);
|
|
@@ -5,8 +5,8 @@ import type { DataType, EventsType } from '../../../configs/components/wd-input'
|
|
|
5
5
|
* 标准化:单行输入组件
|
|
6
6
|
*/
|
|
7
7
|
export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
8
|
-
type?: string;
|
|
9
8
|
name?: string;
|
|
9
|
+
type?: string;
|
|
10
10
|
label?: string;
|
|
11
11
|
template?: string;
|
|
12
12
|
focus?: boolean;
|
|
@@ -40,9 +40,9 @@ export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType &
|
|
|
40
40
|
borderedH5?: boolean;
|
|
41
41
|
borderedPc?: boolean;
|
|
42
42
|
rules?: {
|
|
43
|
-
format: string;
|
|
44
43
|
message: string;
|
|
45
44
|
pattern: string;
|
|
45
|
+
format: string;
|
|
46
46
|
}[];
|
|
47
47
|
requiredFlag?: boolean;
|
|
48
48
|
requiredMsg?: string;
|