@cloudbase/weda-ui 3.9.0 → 3.9.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.
- package/dist/configs/components/dataView.d.ts +1 -0
- package/dist/configs/components/dataView.js +5 -0
- package/dist/configs/components/listView.d.ts +2 -0
- package/dist/configs/components/listView.js +5 -0
- package/dist/configs/components/wd-form.d.ts +2 -0
- package/dist/configs/components/wd-location.d.ts +13 -0
- package/dist/configs/components/wd-location.js +10 -0
- package/dist/configs/components/wd-markdown.d.ts +18 -3
- package/dist/configs/components/wd-markdown.js +33 -4
- package/dist/configs/components/wd-side-tab.js +1 -0
- package/dist/configs/components/wd-table.d.ts +2 -0
- package/dist/configs/components/wd-top-tab.js +1 -0
- package/dist/configs/components/wd-upload-image.js +1 -1
- package/dist/configs/components/web-view.d.ts +6 -15
- package/dist/configs/components/web-view.js +12 -15
- package/dist/configs/index.d.ts +86 -36
- package/dist/configs/type-utils/error.d.ts +1 -0
- package/dist/configs/type-utils/error.js +3 -0
- package/dist/configs/utils/layout.js +4 -1
- package/dist/web/components/dataView/index.js +11 -6
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +19 -3
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +7 -1
- package/dist/web/components/listView/index.js +4 -1
- package/dist/web/components/slot/index.js +2 -1
- package/dist/web/components/wd-form/index.d.ts +1 -0
- package/dist/web/components/wd-input-phone/wd-input-phone.js +1 -1
- package/dist/web/components/wd-location/wd-location.js +2 -2
- package/dist/web/components/wd-markdown/wd-markdown.js +12 -4
- package/dist/web/components/wd-menu-layout/components/H5Menu.js +2 -1
- package/dist/web/utils/error.d.ts +13 -0
- package/dist/web/utils/error.js +11 -0
- package/package.json +1 -1
|
@@ -205,6 +205,7 @@ declare const config: {
|
|
|
205
205
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
206
206
|
message: import("@sinclair/typebox").TString;
|
|
207
207
|
code: import("@sinclair/typebox").TString;
|
|
208
|
+
original: import("@sinclair/typebox").TAny;
|
|
208
209
|
}>;
|
|
209
210
|
}>;
|
|
210
211
|
})[];
|
|
@@ -254,7 +254,12 @@ ${rawTemplate}
|
|
|
254
254
|
{{/with}}
|
|
255
255
|
|
|
256
256
|
[attributes]
|
|
257
|
+
{{#if (helper_utils 'isEqual' $self.attributes.datasource.extra.methodName 'wedaGetRecordsV2')}}
|
|
258
|
+
':queryCondition'='null'
|
|
259
|
+
supportManyRelated=true
|
|
260
|
+
{{else}}
|
|
257
261
|
':queryCondition'='[]'
|
|
262
|
+
{{/if}}
|
|
258
263
|
`;
|
|
259
264
|
const properties = Type.Object({
|
|
260
265
|
record: Type.Object({}, {
|
|
@@ -458,6 +458,7 @@ declare const _default: {
|
|
|
458
458
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
459
459
|
message: import("@sinclair/typebox").TString;
|
|
460
460
|
code: import("@sinclair/typebox").TString;
|
|
461
|
+
original: import("@sinclair/typebox").TAny;
|
|
461
462
|
}>;
|
|
462
463
|
}>;
|
|
463
464
|
} | {
|
|
@@ -480,6 +481,7 @@ declare const _default: {
|
|
|
480
481
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
481
482
|
message: import("@sinclair/typebox").TString;
|
|
482
483
|
code: import("@sinclair/typebox").TString;
|
|
484
|
+
original: import("@sinclair/typebox").TAny;
|
|
483
485
|
}>;
|
|
484
486
|
dataSourceVersion: import("@sinclair/typebox").TString;
|
|
485
487
|
}>;
|
|
@@ -733,7 +733,12 @@ ${rawTemplate}
|
|
|
733
733
|
{{/with}}
|
|
734
734
|
|
|
735
735
|
[attributes]
|
|
736
|
+
{{#if (helper_utils 'isEqual' $self.attributes.datasource.extra.methodName 'wedaGetRecordsV2')}}
|
|
737
|
+
':queryCondition'='null'
|
|
738
|
+
supportManyRelated=true
|
|
739
|
+
{{else}}
|
|
736
740
|
':queryCondition'='[]'
|
|
741
|
+
{{/if}}
|
|
737
742
|
`;
|
|
738
743
|
const properties = Type.Object({
|
|
739
744
|
records: Type.Array(Type.Object({}, {
|
|
@@ -34,6 +34,7 @@ declare const events: [{
|
|
|
34
34
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
35
35
|
message: import("@sinclair/typebox").TString;
|
|
36
36
|
code: import("@sinclair/typebox").TString;
|
|
37
|
+
original: import("@sinclair/typebox").TAny;
|
|
37
38
|
}>;
|
|
38
39
|
}>;
|
|
39
40
|
}];
|
|
@@ -204,6 +205,7 @@ declare const _default: {
|
|
|
204
205
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
205
206
|
message: import("@sinclair/typebox").TString;
|
|
206
207
|
code: import("@sinclair/typebox").TString;
|
|
208
|
+
original: import("@sinclair/typebox").TAny;
|
|
207
209
|
}>;
|
|
208
210
|
}>;
|
|
209
211
|
}];
|
|
@@ -183,6 +183,19 @@ declare const config: {
|
|
|
183
183
|
readonly name: string;
|
|
184
184
|
readonly title: string;
|
|
185
185
|
readonly description: string;
|
|
186
|
+
}, {
|
|
187
|
+
readonly title: "地图组件错误事件";
|
|
188
|
+
readonly name: "error";
|
|
189
|
+
readonly description: "地图加载失败,或地图组件使用异常时触发";
|
|
190
|
+
readonly 'x-platforms': readonly ["MOBILEWEB", "PCWEB"];
|
|
191
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
192
|
+
error: import("@sinclair/typebox").TObject<{
|
|
193
|
+
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
194
|
+
message: import("@sinclair/typebox").TString;
|
|
195
|
+
code: import("@sinclair/typebox").TString;
|
|
196
|
+
original: import("@sinclair/typebox").TAny;
|
|
197
|
+
}>;
|
|
198
|
+
}>;
|
|
186
199
|
}];
|
|
187
200
|
readonly meta: {
|
|
188
201
|
readonly description: "用于在表单中进行地图选点定位。";
|
|
@@ -2,6 +2,7 @@ import { defineConfig, Type } from '../type-utils';
|
|
|
2
2
|
import { FORM_ITEM_DATA, FORM_ITEM_EVENTS, FORM_ITEM_METHODS, FORM_ITEM_META, ItemData, pickWithXCategory, X_CATEGORY, getFormItemDataTitle, } from '../type-utils/type-form';
|
|
3
3
|
import { getClasses } from '../type-utils/classes';
|
|
4
4
|
import { templateInitNameWithId } from './common/init-name-with-id';
|
|
5
|
+
import { genericErrorType } from '../type-utils/error';
|
|
5
6
|
const SELECT = pickWithXCategory(FORM_ITEM_DATA, ['clearable', 'extra', 'showLngLat', 'showMap', 'borderedH5'], X_CATEGORY.LOCATION_CONTENT);
|
|
6
7
|
const TITLE = getFormItemDataTitle('地图');
|
|
7
8
|
// 属性类型定义
|
|
@@ -104,6 +105,15 @@ const config = defineConfig({
|
|
|
104
105
|
...FORM_ITEM_EVENTS.change,
|
|
105
106
|
detail: paramValueType,
|
|
106
107
|
},
|
|
108
|
+
{
|
|
109
|
+
title: '地图组件错误事件',
|
|
110
|
+
name: 'error',
|
|
111
|
+
description: '地图加载失败,或地图组件使用异常时触发',
|
|
112
|
+
'x-platforms': ['MOBILEWEB', 'PCWEB'],
|
|
113
|
+
detail: Type.Object({
|
|
114
|
+
error: genericErrorType,
|
|
115
|
+
}),
|
|
116
|
+
},
|
|
107
117
|
],
|
|
108
118
|
meta: {
|
|
109
119
|
description: '用于在表单中进行地图选点定位。',
|
|
@@ -13,6 +13,7 @@ declare const config: {
|
|
|
13
13
|
}>;
|
|
14
14
|
readonly properties: import("@sinclair/typebox").TObject<{
|
|
15
15
|
value: import("@sinclair/typebox").TString;
|
|
16
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
16
17
|
}>;
|
|
17
18
|
readonly classes: readonly [{
|
|
18
19
|
readonly name: "根元素";
|
|
@@ -31,12 +32,26 @@ declare const config: {
|
|
|
31
32
|
readonly selector: ".wd-mp-markdown";
|
|
32
33
|
readonly description: "可以为小程序端的链接编写样式";
|
|
33
34
|
}];
|
|
34
|
-
readonly methods: readonly [
|
|
35
|
-
|
|
35
|
+
readonly methods: readonly [{
|
|
36
|
+
readonly name: "updateMarkdownInstance";
|
|
37
|
+
readonly label: "更新markdown实例";
|
|
38
|
+
readonly description: "更新markdown实例";
|
|
39
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
40
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
41
|
+
}>;
|
|
42
|
+
}];
|
|
43
|
+
readonly events: readonly [{
|
|
44
|
+
readonly title: "markdown Ready";
|
|
45
|
+
readonly name: "onReady";
|
|
46
|
+
readonly description: "当前markdown已完成实例初始化,可以调用markdown实例方法";
|
|
47
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
48
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
49
|
+
}>;
|
|
50
|
+
}];
|
|
36
51
|
readonly meta: {
|
|
37
52
|
readonly name: "WdMarkdown";
|
|
38
53
|
readonly componentName: "markdown";
|
|
39
|
-
readonly title: "
|
|
54
|
+
readonly title: "Markdown";
|
|
40
55
|
readonly description: "用于markdown展示";
|
|
41
56
|
readonly figureIcon: "../figureIcons/RichTextView.svg";
|
|
42
57
|
readonly icon: "../icons/RichTextView.svg";
|
|
@@ -40,7 +40,15 @@ const data = Type.Object({
|
|
|
40
40
|
}),
|
|
41
41
|
});
|
|
42
42
|
// 组件对外暴露的只读属性
|
|
43
|
-
const properties = Type.
|
|
43
|
+
const properties = Type.Composite([
|
|
44
|
+
Type.Pick(data, ['value']),
|
|
45
|
+
Type.Object({
|
|
46
|
+
markdownInstance: Type.Object({}, {
|
|
47
|
+
title: 'markdown实例',
|
|
48
|
+
description: '可以通过markdown实例调用markdown实例方法,如:markdownInstance.render("# markdown-it rulezz!")具体内容见[markdown-it官方文档](https://markdown-it.github.io/markdown-it/)',
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
]);
|
|
44
52
|
// export default
|
|
45
53
|
const config = defineConfig({
|
|
46
54
|
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
@@ -72,15 +80,36 @@ const config = defineConfig({
|
|
|
72
80
|
},
|
|
73
81
|
],
|
|
74
82
|
// 组件方法
|
|
75
|
-
methods: [
|
|
83
|
+
methods: [
|
|
84
|
+
{
|
|
85
|
+
name: 'updateMarkdownInstance',
|
|
86
|
+
label: '更新markdown实例',
|
|
87
|
+
description: '更新markdown实例',
|
|
88
|
+
params: Type.Object({
|
|
89
|
+
markdownInstance: Type.Object({}, {
|
|
90
|
+
title: 'markdown实例',
|
|
91
|
+
description: '可以通过markdown实例调用markdown实例方法,如:markdownInstance.render("# markdown-it rulezz!")具体内容见[markdown-it官方文档](https://markdown-it.github.io/markdown-it/)',
|
|
92
|
+
}),
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
],
|
|
76
96
|
// 组件对外暴露事件
|
|
77
|
-
events: [
|
|
97
|
+
events: [
|
|
98
|
+
{
|
|
99
|
+
title: 'markdown Ready',
|
|
100
|
+
name: 'onReady',
|
|
101
|
+
description: '当前markdown已完成实例初始化,可以调用markdown实例方法',
|
|
102
|
+
detail: Type.Object({
|
|
103
|
+
markdownInstance: Type.Object({}, { title: 'markdown实例' }),
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
],
|
|
78
107
|
// 组件元信息
|
|
79
108
|
meta: {
|
|
80
109
|
name: 'WdMarkdown',
|
|
81
110
|
// 组件别名,用于生成组件 id,例如 Icon1
|
|
82
111
|
componentName: 'markdown',
|
|
83
|
-
title: '
|
|
112
|
+
title: 'Markdown',
|
|
84
113
|
description: '用于markdown展示',
|
|
85
114
|
figureIcon: '../figureIcons/RichTextView.svg',
|
|
86
115
|
icon: '../icons/RichTextView.svg',
|
|
@@ -197,6 +197,7 @@ declare const config: {
|
|
|
197
197
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
198
198
|
message: import("@sinclair/typebox").TString;
|
|
199
199
|
code: import("@sinclair/typebox").TString;
|
|
200
|
+
original: import("@sinclair/typebox").TAny;
|
|
200
201
|
}>;
|
|
201
202
|
sort: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>;
|
|
202
203
|
pageNo: import("@sinclair/typebox").TNumber;
|
|
@@ -390,6 +391,7 @@ declare const config: {
|
|
|
390
391
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
391
392
|
message: import("@sinclair/typebox").TString;
|
|
392
393
|
code: import("@sinclair/typebox").TString;
|
|
394
|
+
original: import("@sinclair/typebox").TAny;
|
|
393
395
|
}>;
|
|
394
396
|
}>;
|
|
395
397
|
}, {
|
|
@@ -52,21 +52,12 @@ declare const config: {
|
|
|
52
52
|
readonly name: "postMessage";
|
|
53
53
|
readonly label: "发送消息";
|
|
54
54
|
readonly description: "向页面发送消息";
|
|
55
|
-
readonly
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
readonly title: "targetorigin";
|
|
62
|
-
readonly description: "web端通过窗口的 origin 属性来指定哪些窗口能接收到消息事件";
|
|
63
|
-
};
|
|
64
|
-
readonly transfer: {
|
|
65
|
-
readonly title: "transfer";
|
|
66
|
-
readonly description: "是一串和 message 同时传递的 Transferable 对象。web端参数。";
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
};
|
|
55
|
+
readonly 'x-platforms': readonly ["MOBILEWEB", "PCWEB"];
|
|
56
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
57
|
+
message: import("@sinclair/typebox").TString;
|
|
58
|
+
targetorigin: import("@sinclair/typebox").TString;
|
|
59
|
+
transfer: import("@sinclair/typebox").TString;
|
|
60
|
+
}>;
|
|
70
61
|
}];
|
|
71
62
|
readonly events: [{
|
|
72
63
|
readonly name: "load";
|
|
@@ -83,21 +83,18 @@ const config = defineConfig({
|
|
|
83
83
|
name: 'postMessage',
|
|
84
84
|
label: '发送消息',
|
|
85
85
|
description: '向页面发送消息',
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
86
|
+
'x-platforms': ['MOBILEWEB', 'PCWEB'],
|
|
87
|
+
params: Type.Object({
|
|
88
|
+
message: Type.String({ title: '消息内容' }),
|
|
89
|
+
targetorigin: Type.String({
|
|
90
|
+
title: 'targetorigin',
|
|
91
|
+
description: 'web端通过窗口的 origin 属性来指定哪些窗口能接收到消息事件',
|
|
92
|
+
}),
|
|
93
|
+
transfer: Type.String({
|
|
94
|
+
title: 'transfer',
|
|
95
|
+
description: '是一串和 message 同时传递的 Transferable 对象。web端参数。',
|
|
96
|
+
}),
|
|
97
|
+
}),
|
|
101
98
|
},
|
|
102
99
|
],
|
|
103
100
|
// 组件对外暴露事件
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const components: {
|
|
|
7
7
|
}>;
|
|
8
8
|
readonly properties: import("@sinclair/typebox").TObject<{
|
|
9
9
|
value: import("@sinclair/typebox").TString;
|
|
10
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
10
11
|
}>;
|
|
11
12
|
readonly classes: readonly [{
|
|
12
13
|
readonly name: "根元素";
|
|
@@ -25,12 +26,26 @@ export declare const components: {
|
|
|
25
26
|
readonly selector: ".wd-mp-markdown";
|
|
26
27
|
readonly description: "可以为小程序端的链接编写样式";
|
|
27
28
|
}];
|
|
28
|
-
readonly methods: readonly [
|
|
29
|
-
|
|
29
|
+
readonly methods: readonly [{
|
|
30
|
+
readonly name: "updateMarkdownInstance";
|
|
31
|
+
readonly label: "更新markdown实例";
|
|
32
|
+
readonly description: "更新markdown实例";
|
|
33
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
34
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
35
|
+
}>;
|
|
36
|
+
}];
|
|
37
|
+
readonly events: readonly [{
|
|
38
|
+
readonly title: "markdown Ready";
|
|
39
|
+
readonly name: "onReady";
|
|
40
|
+
readonly description: "当前markdown已完成实例初始化,可以调用markdown实例方法";
|
|
41
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
42
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
43
|
+
}>;
|
|
44
|
+
}];
|
|
30
45
|
readonly meta: {
|
|
31
46
|
readonly name: "WdMarkdown";
|
|
32
47
|
readonly componentName: "markdown";
|
|
33
|
-
readonly title: "
|
|
48
|
+
readonly title: "Markdown";
|
|
34
49
|
readonly description: "用于markdown展示";
|
|
35
50
|
readonly figureIcon: "../figureIcons/RichTextView.svg";
|
|
36
51
|
readonly icon: "../icons/RichTextView.svg";
|
|
@@ -4014,6 +4029,7 @@ export declare const components: {
|
|
|
4014
4029
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
4015
4030
|
message: import("@sinclair/typebox").TString;
|
|
4016
4031
|
code: import("@sinclair/typebox").TString;
|
|
4032
|
+
original: import("@sinclair/typebox").TAny;
|
|
4017
4033
|
}>;
|
|
4018
4034
|
}>;
|
|
4019
4035
|
}];
|
|
@@ -7406,6 +7422,7 @@ export declare const components: {
|
|
|
7406
7422
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7407
7423
|
message: import("@sinclair/typebox").TString;
|
|
7408
7424
|
code: import("@sinclair/typebox").TString;
|
|
7425
|
+
original: import("@sinclair/typebox").TAny;
|
|
7409
7426
|
}>;
|
|
7410
7427
|
}>;
|
|
7411
7428
|
} | {
|
|
@@ -7428,6 +7445,7 @@ export declare const components: {
|
|
|
7428
7445
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7429
7446
|
message: import("@sinclair/typebox").TString;
|
|
7430
7447
|
code: import("@sinclair/typebox").TString;
|
|
7448
|
+
original: import("@sinclair/typebox").TAny;
|
|
7431
7449
|
}>;
|
|
7432
7450
|
dataSourceVersion: import("@sinclair/typebox").TString;
|
|
7433
7451
|
}>;
|
|
@@ -7738,6 +7756,7 @@ export declare const components: {
|
|
|
7738
7756
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7739
7757
|
message: import("@sinclair/typebox").TString;
|
|
7740
7758
|
code: import("@sinclair/typebox").TString;
|
|
7759
|
+
original: import("@sinclair/typebox").TAny;
|
|
7741
7760
|
}>;
|
|
7742
7761
|
}>;
|
|
7743
7762
|
})[];
|
|
@@ -12832,6 +12851,7 @@ export declare const components: {
|
|
|
12832
12851
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
12833
12852
|
message: import("@sinclair/typebox").TString;
|
|
12834
12853
|
code: import("@sinclair/typebox").TString;
|
|
12854
|
+
original: import("@sinclair/typebox").TAny;
|
|
12835
12855
|
}>;
|
|
12836
12856
|
sort: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>;
|
|
12837
12857
|
pageNo: import("@sinclair/typebox").TNumber;
|
|
@@ -13025,6 +13045,7 @@ export declare const components: {
|
|
|
13025
13045
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
13026
13046
|
message: import("@sinclair/typebox").TString;
|
|
13027
13047
|
code: import("@sinclair/typebox").TString;
|
|
13048
|
+
original: import("@sinclair/typebox").TAny;
|
|
13028
13049
|
}>;
|
|
13029
13050
|
}>;
|
|
13030
13051
|
}, {
|
|
@@ -16714,6 +16735,19 @@ export declare const components: {
|
|
|
16714
16735
|
readonly name: string;
|
|
16715
16736
|
readonly title: string;
|
|
16716
16737
|
readonly description: string;
|
|
16738
|
+
}, {
|
|
16739
|
+
readonly title: "地图组件错误事件";
|
|
16740
|
+
readonly name: "error";
|
|
16741
|
+
readonly description: "地图加载失败,或地图组件使用异常时触发";
|
|
16742
|
+
readonly 'x-platforms': readonly ["MOBILEWEB", "PCWEB"];
|
|
16743
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
16744
|
+
error: import("@sinclair/typebox").TObject<{
|
|
16745
|
+
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16746
|
+
message: import("@sinclair/typebox").TString;
|
|
16747
|
+
code: import("@sinclair/typebox").TString;
|
|
16748
|
+
original: import("@sinclair/typebox").TAny;
|
|
16749
|
+
}>;
|
|
16750
|
+
}>;
|
|
16717
16751
|
}];
|
|
16718
16752
|
readonly meta: {
|
|
16719
16753
|
readonly description: "用于在表单中进行地图选点定位。";
|
|
@@ -19846,21 +19880,12 @@ export declare const components: {
|
|
|
19846
19880
|
readonly name: "postMessage";
|
|
19847
19881
|
readonly label: "发送消息";
|
|
19848
19882
|
readonly description: "向页面发送消息";
|
|
19849
|
-
readonly
|
|
19850
|
-
|
|
19851
|
-
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
readonly title: "targetorigin";
|
|
19856
|
-
readonly description: "web端通过窗口的 origin 属性来指定哪些窗口能接收到消息事件";
|
|
19857
|
-
};
|
|
19858
|
-
readonly transfer: {
|
|
19859
|
-
readonly title: "transfer";
|
|
19860
|
-
readonly description: "是一串和 message 同时传递的 Transferable 对象。web端参数。";
|
|
19861
|
-
};
|
|
19862
|
-
};
|
|
19863
|
-
};
|
|
19883
|
+
readonly 'x-platforms': readonly ["MOBILEWEB", "PCWEB"];
|
|
19884
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
19885
|
+
message: import("@sinclair/typebox").TString;
|
|
19886
|
+
targetorigin: import("@sinclair/typebox").TString;
|
|
19887
|
+
transfer: import("@sinclair/typebox").TString;
|
|
19888
|
+
}>;
|
|
19864
19889
|
}];
|
|
19865
19890
|
readonly events: [{
|
|
19866
19891
|
readonly name: "load";
|
|
@@ -20264,6 +20289,7 @@ declare const _default: {
|
|
|
20264
20289
|
}>;
|
|
20265
20290
|
readonly properties: import("@sinclair/typebox").TObject<{
|
|
20266
20291
|
value: import("@sinclair/typebox").TString;
|
|
20292
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
20267
20293
|
}>;
|
|
20268
20294
|
readonly classes: readonly [{
|
|
20269
20295
|
readonly name: "根元素";
|
|
@@ -20282,12 +20308,26 @@ declare const _default: {
|
|
|
20282
20308
|
readonly selector: ".wd-mp-markdown";
|
|
20283
20309
|
readonly description: "可以为小程序端的链接编写样式";
|
|
20284
20310
|
}];
|
|
20285
|
-
readonly methods: readonly [
|
|
20286
|
-
|
|
20311
|
+
readonly methods: readonly [{
|
|
20312
|
+
readonly name: "updateMarkdownInstance";
|
|
20313
|
+
readonly label: "更新markdown实例";
|
|
20314
|
+
readonly description: "更新markdown实例";
|
|
20315
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
20316
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
20317
|
+
}>;
|
|
20318
|
+
}];
|
|
20319
|
+
readonly events: readonly [{
|
|
20320
|
+
readonly title: "markdown Ready";
|
|
20321
|
+
readonly name: "onReady";
|
|
20322
|
+
readonly description: "当前markdown已完成实例初始化,可以调用markdown实例方法";
|
|
20323
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
20324
|
+
markdownInstance: import("@sinclair/typebox").TObject<{}>;
|
|
20325
|
+
}>;
|
|
20326
|
+
}];
|
|
20287
20327
|
readonly meta: {
|
|
20288
20328
|
readonly name: "WdMarkdown";
|
|
20289
20329
|
readonly componentName: "markdown";
|
|
20290
|
-
readonly title: "
|
|
20330
|
+
readonly title: "Markdown";
|
|
20291
20331
|
readonly description: "用于markdown展示";
|
|
20292
20332
|
readonly figureIcon: "../figureIcons/RichTextView.svg";
|
|
20293
20333
|
readonly icon: "../icons/RichTextView.svg";
|
|
@@ -24271,6 +24311,7 @@ declare const _default: {
|
|
|
24271
24311
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
24272
24312
|
message: import("@sinclair/typebox").TString;
|
|
24273
24313
|
code: import("@sinclair/typebox").TString;
|
|
24314
|
+
original: import("@sinclair/typebox").TAny;
|
|
24274
24315
|
}>;
|
|
24275
24316
|
}>;
|
|
24276
24317
|
}];
|
|
@@ -27663,6 +27704,7 @@ declare const _default: {
|
|
|
27663
27704
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
27664
27705
|
message: import("@sinclair/typebox").TString;
|
|
27665
27706
|
code: import("@sinclair/typebox").TString;
|
|
27707
|
+
original: import("@sinclair/typebox").TAny;
|
|
27666
27708
|
}>;
|
|
27667
27709
|
}>;
|
|
27668
27710
|
} | {
|
|
@@ -27685,6 +27727,7 @@ declare const _default: {
|
|
|
27685
27727
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
27686
27728
|
message: import("@sinclair/typebox").TString;
|
|
27687
27729
|
code: import("@sinclair/typebox").TString;
|
|
27730
|
+
original: import("@sinclair/typebox").TAny;
|
|
27688
27731
|
}>;
|
|
27689
27732
|
dataSourceVersion: import("@sinclair/typebox").TString;
|
|
27690
27733
|
}>;
|
|
@@ -27995,6 +28038,7 @@ declare const _default: {
|
|
|
27995
28038
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
27996
28039
|
message: import("@sinclair/typebox").TString;
|
|
27997
28040
|
code: import("@sinclair/typebox").TString;
|
|
28041
|
+
original: import("@sinclair/typebox").TAny;
|
|
27998
28042
|
}>;
|
|
27999
28043
|
}>;
|
|
28000
28044
|
})[];
|
|
@@ -33089,6 +33133,7 @@ declare const _default: {
|
|
|
33089
33133
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
33090
33134
|
message: import("@sinclair/typebox").TString;
|
|
33091
33135
|
code: import("@sinclair/typebox").TString;
|
|
33136
|
+
original: import("@sinclair/typebox").TAny;
|
|
33092
33137
|
}>;
|
|
33093
33138
|
sort: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>;
|
|
33094
33139
|
pageNo: import("@sinclair/typebox").TNumber;
|
|
@@ -33282,6 +33327,7 @@ declare const _default: {
|
|
|
33282
33327
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
33283
33328
|
message: import("@sinclair/typebox").TString;
|
|
33284
33329
|
code: import("@sinclair/typebox").TString;
|
|
33330
|
+
original: import("@sinclair/typebox").TAny;
|
|
33285
33331
|
}>;
|
|
33286
33332
|
}>;
|
|
33287
33333
|
}, {
|
|
@@ -36971,6 +37017,19 @@ declare const _default: {
|
|
|
36971
37017
|
readonly name: string;
|
|
36972
37018
|
readonly title: string;
|
|
36973
37019
|
readonly description: string;
|
|
37020
|
+
}, {
|
|
37021
|
+
readonly title: "地图组件错误事件";
|
|
37022
|
+
readonly name: "error";
|
|
37023
|
+
readonly description: "地图加载失败,或地图组件使用异常时触发";
|
|
37024
|
+
readonly 'x-platforms': readonly ["MOBILEWEB", "PCWEB"];
|
|
37025
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
37026
|
+
error: import("@sinclair/typebox").TObject<{
|
|
37027
|
+
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
37028
|
+
message: import("@sinclair/typebox").TString;
|
|
37029
|
+
code: import("@sinclair/typebox").TString;
|
|
37030
|
+
original: import("@sinclair/typebox").TAny;
|
|
37031
|
+
}>;
|
|
37032
|
+
}>;
|
|
36974
37033
|
}];
|
|
36975
37034
|
readonly meta: {
|
|
36976
37035
|
readonly description: "用于在表单中进行地图选点定位。";
|
|
@@ -40103,21 +40162,12 @@ declare const _default: {
|
|
|
40103
40162
|
readonly name: "postMessage";
|
|
40104
40163
|
readonly label: "发送消息";
|
|
40105
40164
|
readonly description: "向页面发送消息";
|
|
40106
|
-
readonly
|
|
40107
|
-
|
|
40108
|
-
|
|
40109
|
-
|
|
40110
|
-
|
|
40111
|
-
|
|
40112
|
-
readonly title: "targetorigin";
|
|
40113
|
-
readonly description: "web端通过窗口的 origin 属性来指定哪些窗口能接收到消息事件";
|
|
40114
|
-
};
|
|
40115
|
-
readonly transfer: {
|
|
40116
|
-
readonly title: "transfer";
|
|
40117
|
-
readonly description: "是一串和 message 同时传递的 Transferable 对象。web端参数。";
|
|
40118
|
-
};
|
|
40119
|
-
};
|
|
40120
|
-
};
|
|
40165
|
+
readonly 'x-platforms': readonly ["MOBILEWEB", "PCWEB"];
|
|
40166
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
40167
|
+
message: import("@sinclair/typebox").TString;
|
|
40168
|
+
targetorigin: import("@sinclair/typebox").TString;
|
|
40169
|
+
transfer: import("@sinclair/typebox").TString;
|
|
40170
|
+
}>;
|
|
40121
40171
|
}];
|
|
40122
40172
|
readonly events: [{
|
|
40123
40173
|
readonly name: "load";
|
|
@@ -2,4 +2,5 @@ export declare const genericErrorType: import("@sinclair/typebox").TObject<{
|
|
|
2
2
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
3
3
|
message: import("@sinclair/typebox").TString;
|
|
4
4
|
code: import("@sinclair/typebox").TString;
|
|
5
|
+
original: import("@sinclair/typebox").TAny;
|
|
5
6
|
}>;
|
|
@@ -267,6 +267,8 @@ export const getItems = (template = 'horizontal') => {
|
|
|
267
267
|
menu: [],
|
|
268
268
|
template,
|
|
269
269
|
type: template,
|
|
270
|
+
outerClickClosable: true,
|
|
271
|
+
defaultOpened: true,
|
|
270
272
|
},
|
|
271
273
|
items: [
|
|
272
274
|
{
|
|
@@ -949,7 +951,8 @@ export const getChildrenTemplate = (type = 'horizontal') => {
|
|
|
949
951
|
[template.attributes]
|
|
950
952
|
template = "${type}"
|
|
951
953
|
type = "${type}"
|
|
952
|
-
|
|
954
|
+
outerClickClosable=true
|
|
955
|
+
defaultOpened=true
|
|
953
956
|
[[template.items]]
|
|
954
957
|
id = 'contentSlot'
|
|
955
958
|
component = ''
|
|
@@ -17,11 +17,16 @@ export default React.forwardRef(function DataView(props, ref) {
|
|
|
17
17
|
}, []);
|
|
18
18
|
const refresh = useCallback(() => { var _a, _b; return (_b = (_a = listViewRef.current) === null || _a === void 0 ? void 0 : _a.refresh) === null || _b === void 0 ? void 0 : _b.call(_a); }, [listViewRef.current]);
|
|
19
19
|
const deleteOne = useCallback((params) => { var _a, _b; return (_b = (_a = listViewRef.current) === null || _a === void 0 ? void 0 : _a.deleteOne) === null || _b === void 0 ? void 0 : _b.call(_a, params); }, [listViewRef.current]);
|
|
20
|
-
useSetWidgetApi(() =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
useSetWidgetApi(() => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
return ({
|
|
23
|
+
record,
|
|
24
|
+
refresh,
|
|
25
|
+
deleteOne,
|
|
26
|
+
dataSourceVersion: ((_b = (_a = props === null || props === void 0 ? void 0 : props.datasource) === null || _a === void 0 ? void 0 : _a.extra) === null || _b === void 0 ? void 0 : _b.methodName) === 'wedaGetRecordsV2'
|
|
27
|
+
? 'v2'
|
|
28
|
+
: 'v1',
|
|
29
|
+
});
|
|
30
|
+
}, [record, refresh, deleteOne], ref);
|
|
26
31
|
return (_jsx(ListView, { ...props, ref: listViewRef, isRecords: false, orderBy: undefined, orderType: undefined, template: "none", pageSize: 1, pagination: "none", beforeDataChange: beforeDataChange, refType: "dataView", dataSourceData: [].concat(props.dataSourceData) }));
|
|
27
32
|
});
|
|
@@ -16,6 +16,7 @@ import { useRecycle } from '../../../../../utils/hooks/useRecycle';
|
|
|
16
16
|
import ChooseBtn from '../ChooseBtn';
|
|
17
17
|
import { WdText } from '../../../../wd-text';
|
|
18
18
|
import { checkCustomLocation } from '../../common/useLocationInfo';
|
|
19
|
+
import { errorHandler } from '../../../../../utils/error';
|
|
19
20
|
import './style';
|
|
20
21
|
const { useEffect, useState, useRef } = React;
|
|
21
22
|
export default function LocationH5(props) {
|
|
@@ -139,7 +140,12 @@ export default function LocationH5(props) {
|
|
|
139
140
|
recycleBack(true);
|
|
140
141
|
}
|
|
141
142
|
}, (error) => {
|
|
142
|
-
|
|
143
|
+
const { comErrorInfo } = errorHandler({
|
|
144
|
+
code: 'WdLocation.GeolocationLocationError',
|
|
145
|
+
id,
|
|
146
|
+
error,
|
|
147
|
+
});
|
|
148
|
+
events === null || events === void 0 ? void 0 : events.error({ error: comErrorInfo });
|
|
143
149
|
currentLocations.current = null;
|
|
144
150
|
setApiKeyStatus({
|
|
145
151
|
status: false,
|
|
@@ -151,7 +157,12 @@ export default function LocationH5(props) {
|
|
|
151
157
|
});
|
|
152
158
|
};
|
|
153
159
|
script.onerror = (error) => {
|
|
154
|
-
|
|
160
|
+
const { comErrorInfo } = errorHandler({
|
|
161
|
+
code: 'WdLocation.GeolocationScriptError',
|
|
162
|
+
id,
|
|
163
|
+
error,
|
|
164
|
+
});
|
|
165
|
+
events === null || events === void 0 ? void 0 : events.error({ error: comErrorInfo });
|
|
155
166
|
setApiKeyStatus({
|
|
156
167
|
status: false,
|
|
157
168
|
message: '定位失败',
|
|
@@ -188,7 +199,12 @@ export default function LocationH5(props) {
|
|
|
188
199
|
}
|
|
189
200
|
})
|
|
190
201
|
.catch((error) => {
|
|
191
|
-
|
|
202
|
+
const { comErrorInfo } = errorHandler({
|
|
203
|
+
code: 'WdLocation.DatasourceError',
|
|
204
|
+
id,
|
|
205
|
+
error,
|
|
206
|
+
});
|
|
207
|
+
events === null || events === void 0 ? void 0 : events.error({ error: comErrorInfo });
|
|
192
208
|
setDataSourceStatus({
|
|
193
209
|
status: false,
|
|
194
210
|
message: error,
|
|
@@ -13,6 +13,7 @@ import { propTypes, defaultProps } from '../../common/propsConfig';
|
|
|
13
13
|
import { callDataSource } from '../../../../../utils/tcb';
|
|
14
14
|
import Header from './Header';
|
|
15
15
|
import { useRecycle } from '../../../../../utils/hooks/useRecycle';
|
|
16
|
+
import { errorHandler } from '../../../../../utils/error';
|
|
16
17
|
import './style';
|
|
17
18
|
const { useState, useEffect, useRef } = React;
|
|
18
19
|
export default function LocationPC(props) {
|
|
@@ -136,7 +137,12 @@ export default function LocationPC(props) {
|
|
|
136
137
|
}
|
|
137
138
|
})
|
|
138
139
|
.catch((error) => {
|
|
139
|
-
|
|
140
|
+
const { comErrorInfo } = errorHandler({
|
|
141
|
+
code: 'WdLocation.DatasourceError',
|
|
142
|
+
id,
|
|
143
|
+
error,
|
|
144
|
+
});
|
|
145
|
+
events === null || events === void 0 ? void 0 : events.error({ error: comErrorInfo });
|
|
140
146
|
setDataSourceStatus({
|
|
141
147
|
status: false,
|
|
142
148
|
message: error,
|
|
@@ -57,13 +57,16 @@ export default React.forwardRef(function ListView(props, ref) {
|
|
|
57
57
|
const isH5 = platform === 'h5';
|
|
58
58
|
const isSetStatus = dataSourceType !== 'expression' ? rawIsSetStatus : false;
|
|
59
59
|
const isSetLoading = dataSourceType !== 'expression' ? rawIsSetLoading : true;
|
|
60
|
-
const modelParams = getModelParams(props); // 包括 where 和 order
|
|
61
60
|
const connectorParams = getParseValue(rawConnectorParams);
|
|
62
61
|
const dataSourceData = getParseValue(rawDataSourceData);
|
|
63
62
|
const methodName = getStringValue(dataSourceType === 'data-model'
|
|
64
63
|
? ((_a = datasource === null || datasource === void 0 ? void 0 : datasource.extra) === null || _a === void 0 ? void 0 : _a.methodName) || 'wedaGetRecords'
|
|
65
64
|
: connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name);
|
|
66
65
|
const isV2protocol = methodName === 'wedaGetRecordsV2';
|
|
66
|
+
const modelParams = getModelParams({
|
|
67
|
+
...props,
|
|
68
|
+
supportManyRelated: isV2protocol,
|
|
69
|
+
}); // 包括 where 和 order
|
|
67
70
|
const dataSourceName = getStringValue(dataSourceType === 'data-model'
|
|
68
71
|
? datasource === null || datasource === void 0 ? void 0 : datasource.name
|
|
69
72
|
: (_b = bindConnectMetadata === null || bindConnectMetadata === void 0 ? void 0 : bindConnectMetadata.datasource) === null || _b === void 0 ? void 0 : _b.name);
|
|
@@ -3,6 +3,7 @@ import classNames from '../../utils/classnames';
|
|
|
3
3
|
import { usePlatform } from '../../utils/platform';
|
|
4
4
|
import { useConfig } from '../../utils/config-context';
|
|
5
5
|
export default function Slot({ compositeParent, name, className, style, }) {
|
|
6
|
+
var _a;
|
|
6
7
|
const { classPrefix } = useConfig();
|
|
7
8
|
const platform = usePlatform();
|
|
8
9
|
const cls = classNames({
|
|
@@ -16,5 +17,5 @@ export default function Slot({ compositeParent, name, className, style, }) {
|
|
|
16
17
|
// 兼容编辑器点击,可选中 Slot 组件
|
|
17
18
|
return (_jsx("div", { style: style, className: cls, children: 'Slot - ' + name }));
|
|
18
19
|
}
|
|
19
|
-
return compositeParent.props.data[name] ? (_jsx("div", { style: style, className: cls, children: compositeParent.props.data[name] })) : null;
|
|
20
|
+
return ((_a = compositeParent === null || compositeParent === void 0 ? void 0 : compositeParent.props) === null || _a === void 0 ? void 0 : _a.data[name]) ? (_jsx("div", { style: style, className: cls, children: compositeParent.props.data[name] })) : null;
|
|
20
21
|
}
|
|
@@ -63,6 +63,7 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
|
63
63
|
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
64
64
|
message: import("@sinclair/typebox").TString;
|
|
65
65
|
code: import("@sinclair/typebox").TString;
|
|
66
|
+
original: import("@sinclair/typebox").TAny;
|
|
66
67
|
}>;
|
|
67
68
|
}>;
|
|
68
69
|
}]>> & {
|
|
@@ -9,6 +9,6 @@ const rules = [{ format: 'mobile', message: '手机校验失败' }];
|
|
|
9
9
|
export const WdInputPhone = forwardRef(function WdInputPhone(props, ref) {
|
|
10
10
|
const { classPrefix } = useConfig();
|
|
11
11
|
const wrapCls = `${classPrefix}-form-input-number-wrap `;
|
|
12
|
-
const pattern = /^[()\d\s
|
|
12
|
+
const pattern = /^[()\d\s+\-ext]{0,20}$/;
|
|
13
13
|
return (_jsx(WdInput, { ...props, inputPattern: pattern, maxLength: 20, wrapClassName: wrapCls, classRoot: "input-phone", rules: rules, ref: ref }));
|
|
14
14
|
});
|
|
@@ -12,7 +12,7 @@ import './style';
|
|
|
12
12
|
* 地图-标准化
|
|
13
13
|
*/
|
|
14
14
|
export const WdLocation = forwardRef(function WdLocation(props, ref) {
|
|
15
|
-
const { classRoot = 'location', clearable = X_RUNTIME_DEFAULT.clearable, placeholder = '选择地理位置', customLocation, customRange = X_RUNTIME_DEFAULT.customRange, dataSource = X_RUNTIME_DEFAULT._dataSourceInLocation, defauleShowLocation, drag = X_RUNTIME_DEFAULT.drag, locationType = X_RUNTIME_DEFAULT.locationType, locationRange = X_RUNTIME_DEFAULT.locationRange, showLngLat = X_RUNTIME_DEFAULT.showLngLat, showMap = X_RUNTIME_DEFAULT.showMap, zoom = X_RUNTIME_DEFAULT.zoom, events = emptyObject, } = props;
|
|
15
|
+
const { classRoot = 'location', clearable = X_RUNTIME_DEFAULT.clearable, placeholder = '选择地理位置', customLocation, customRange = X_RUNTIME_DEFAULT.customRange, dataSource = X_RUNTIME_DEFAULT._dataSourceInLocation, defauleShowLocation, drag = X_RUNTIME_DEFAULT.drag, locationType = X_RUNTIME_DEFAULT.locationType, locationRange = X_RUNTIME_DEFAULT.locationRange, showLngLat = X_RUNTIME_DEFAULT.showLngLat, showMap = X_RUNTIME_DEFAULT.showMap, zoom = X_RUNTIME_DEFAULT.zoom, events = emptyObject, id, } = props;
|
|
16
16
|
const traitProps = { ...props, inputRef: ref };
|
|
17
17
|
const trait = useFormInputTrait(traitProps);
|
|
18
18
|
const { value, onChange, disabled, readOnly, visible } = trait;
|
|
@@ -44,5 +44,5 @@ export const WdLocation = forwardRef(function WdLocation(props, ref) {
|
|
|
44
44
|
const inputWrapProps = { ...props, classRoot, disabled, ...clearProps };
|
|
45
45
|
if (!visible)
|
|
46
46
|
return null;
|
|
47
|
-
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { recycleBack: setIsInit, children: _jsx(Location, { events: events, labelVisible: false, placeholder: placeholder, value: value, customLocation: customLocation, customRange: customRange, dataSource: dataSource, defauleShowLocation: defauleShowLocation, drag: drag, locationType: locationType, locationRange: locationRange, showLngLat: showLngLat, showMap: showMap, zoom: zoom, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange }) }) }) }) }));
|
|
47
|
+
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { recycleBack: setIsInit, children: _jsx(Location, { events: events, labelVisible: false, placeholder: placeholder, value: value, customLocation: customLocation, customRange: customRange, dataSource: dataSource, defauleShowLocation: defauleShowLocation, drag: drag, locationType: locationType, locationRange: locationRange, showLngLat: showLngLat, showMap: showMap, zoom: zoom, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange, id: id }) }) }) }) }));
|
|
48
48
|
});
|
|
@@ -12,7 +12,7 @@ import useDebouncedCallback from '../../utils/hooks/use-debounced-callback';
|
|
|
12
12
|
import { useImgTransform } from '../richTextView/useImgTransform';
|
|
13
13
|
import { getOnClick } from '../wd-unified-link/utils';
|
|
14
14
|
import './style';
|
|
15
|
-
export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options, className, style, id }, ref) {
|
|
15
|
+
export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options, className, style, id, events }, ref) {
|
|
16
16
|
const platform = usePlatform();
|
|
17
17
|
const { classPrefix } = useConfig();
|
|
18
18
|
const cls = classNames({
|
|
@@ -29,6 +29,12 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
29
29
|
}
|
|
30
30
|
setMdInstance(null);
|
|
31
31
|
}, [mdInstance]);
|
|
32
|
+
const onMarkdownReady = useCallback((mdInstance) => {
|
|
33
|
+
setMdInstance(mdInstance);
|
|
34
|
+
if (events === null || events === void 0 ? void 0 : events.onReady) {
|
|
35
|
+
events === null || events === void 0 ? void 0 : events.onReady({ markdownInstance: mdInstance });
|
|
36
|
+
}
|
|
37
|
+
}, [events]);
|
|
32
38
|
// 初始化markdown-it实例
|
|
33
39
|
const init = useDebouncedCallback(useCallback(async (options) => {
|
|
34
40
|
let md = mdInstance;
|
|
@@ -49,8 +55,8 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
49
55
|
...options,
|
|
50
56
|
});
|
|
51
57
|
md.use(copy);
|
|
52
|
-
|
|
53
|
-
}, [mdInstance, destroy]), 500, {
|
|
58
|
+
onMarkdownReady(md);
|
|
59
|
+
}, [mdInstance, onMarkdownReady, destroy]), 500, {
|
|
54
60
|
maxWait: 1000,
|
|
55
61
|
});
|
|
56
62
|
useEffect(() => {
|
|
@@ -82,7 +88,9 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
82
88
|
useSetWidgetApi(() => {
|
|
83
89
|
return {
|
|
84
90
|
value,
|
|
91
|
+
markdownInstance: mdInstance,
|
|
92
|
+
updateMarkdownInstance: ({ markdownInstance }) => setMdInstance(markdownInstance),
|
|
85
93
|
};
|
|
86
|
-
}, [value], ref);
|
|
94
|
+
}, [value, mdInstance], ref);
|
|
87
95
|
return (_jsx("div", { ref: markdownRef, className: cls, style: style, id: id, children: mdInstance && (_jsx("div", { dangerouslySetInnerHTML: { __html: displayValue } })) }));
|
|
88
96
|
});
|
|
@@ -5,6 +5,7 @@ import { WdIcon, WdMenuList } from '../../index';
|
|
|
5
5
|
import { Drawer, ConfigProvider } from 'tea-component';
|
|
6
6
|
import { slotDiv, MenuLayoutContext } from '../utils';
|
|
7
7
|
export const H5Menu = forwardRef(function H5Menu(props, ref) {
|
|
8
|
+
const { outerClickClosable = true } = props;
|
|
8
9
|
const { classPrefix } = useConfig();
|
|
9
10
|
const [visible, setVisible] = useState(false);
|
|
10
11
|
const provider = useMemo(() => {
|
|
@@ -16,5 +17,5 @@ export const H5Menu = forwardRef(function H5Menu(props, ref) {
|
|
|
16
17
|
}, [setVisible]);
|
|
17
18
|
return (_jsxs(MenuLayoutContext.Provider, { value: provider, children: [_jsxs("div", { className: `${classPrefix}-menulayout__bar-wrap`, children: [_jsx("div", { className: `${classPrefix}-menulayout__bar-logo`, children: slotDiv(props.headSlot) }), _jsx("div", { className: `${classPrefix}-menulayout__bar-content`, children: slotDiv(props.headRightSlot, { justifyContent: 'flex-end' }) }), _jsx("div", { className: `${classPrefix}-menulayout__bar-extra`,
|
|
18
19
|
// 防止连续触发
|
|
19
|
-
style: props.outerClickClosable && visible ? { pointerEvents: 'none' } : {}, children: !visible ? (_jsx(WdIcon, { name: "td:view-list", size: "md", onClick: () => setVisible(true) })) : (_jsx(WdIcon, { name: "td:close", size: "md", onClick: () => setVisible(false) })) }), _jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs(Drawer, {
|
|
20
|
+
style: props.outerClickClosable && visible ? { pointerEvents: 'none' } : {}, children: !visible ? (_jsx(WdIcon, { name: "td:view-list", size: "md", onClick: () => setVisible(true) })) : (_jsx(WdIcon, { name: "td:close", size: "md", onClick: () => setVisible(false) })) }), _jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs(Drawer, { size: 'm', placement: 'right', disableAnimation: true, outerClickClosable: outerClickClosable, showMask: visible, visible: visible, onClose: () => setVisible(false), className: `${classPrefix}-menulayout-h5__drawer ${classPrefix}-menulayout__menu`, children: [_jsx(WdMenuList, { ...props, className: "", id: "", style: {}, ref: ref }), _jsx("div", { className: `${classPrefix}-menulayout-h5__drawer-slot ${classPrefix}-menulayout-body__footer`, children: slotDiv(props.footerSlot) })] }) })] }), _jsx("div", { className: `${classPrefix}-menulayout-body`, children: _jsx("div", { className: `${classPrefix}-menulayout-body__content ${classPrefix}-menulayout__body`, children: props.contentSlot }) })] }));
|
|
20
21
|
});
|
|
@@ -8,3 +8,16 @@ export declare class WdCompError extends Error {
|
|
|
8
8
|
original?: Error;
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
+
export declare const errorHandler: ({ id, code, error }: {
|
|
12
|
+
id?: string;
|
|
13
|
+
code: any;
|
|
14
|
+
error: any;
|
|
15
|
+
}) => {
|
|
16
|
+
compError: WdCompError;
|
|
17
|
+
comErrorInfo: {
|
|
18
|
+
code: any;
|
|
19
|
+
requestId: any;
|
|
20
|
+
original: any;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
package/dist/web/utils/error.js
CHANGED
|
@@ -25,3 +25,14 @@ export class WdCompError extends Error {
|
|
|
25
25
|
this.original = context === null || context === void 0 ? void 0 : context.original;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
export const errorHandler = ({ id = '', code, error }) => {
|
|
29
|
+
const comErrorInfo = {
|
|
30
|
+
code: (error === null || error === void 0 ? void 0 : error.code) || code,
|
|
31
|
+
requestId: error === null || error === void 0 ? void 0 : error.requestId,
|
|
32
|
+
original: error,
|
|
33
|
+
message: `[组件${id}:${code}]${(error === null || error === void 0 ? void 0 : error.message) || code}`,
|
|
34
|
+
};
|
|
35
|
+
const compError = new WdCompError(comErrorInfo.message, comErrorInfo);
|
|
36
|
+
console.error(comErrorInfo);
|
|
37
|
+
return { compError, comErrorInfo };
|
|
38
|
+
};
|