@cloudbase/weda-ui 3.18.1 → 3.18.3
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/container.js +0 -1
- package/dist/configs/components/form-image-uploader.js +1 -1
- package/dist/configs/components/form-upload-file.js +1 -1
- package/dist/configs/components/listView.js +0 -1
- package/dist/configs/components/wd-table.js +6 -6
- package/dist/configs/components/wd-upload-file.js +1 -1
- package/dist/configs/components/wd-upload-image.js +1 -1
- package/dist/style/weda-ui.min.css +1 -1
- package/dist/web/components/form/uploader/upload/index.js +10 -4
- package/dist/web/components/form/uploader/uploader.pc.js +0 -1
- package/dist/web/components/form-user-tree-select/index.d.ts +1 -1
- package/dist/web/components/form-user-tree-select/index.js +13 -3
- package/dist/web/components/richTextView/index.d.ts +1 -1
- package/dist/web/components/richTextView/index.js +19 -8
- package/dist/web/components/wd-markdown/wd-markdown.js +19 -6
- package/dist/web/components/wd-member/wd-member.js +11 -2
- package/dist/web/components/wd-select/hooks/useChooseList.js +1 -3
- package/dist/web/components/wd-table/components/FieldRender/Form/Enum.d.ts +1 -1
- package/dist/web/components/wd-table/components/FieldRender/Form/Enum.js +6 -3
- package/dist/web/components/wd-table/components/FieldRender/index.js +9 -6
- package/dist/web/components/wd-table/components/FilterFieldsPanel/index.js +14 -4
- package/dist/web/components/wd-unified-link/index.js +2 -2
- package/dist/web/components/wd-unified-link/utils.js +22 -7
- package/dist/web/utils/tool.js +4 -10
- package/package.json +4 -4
|
@@ -8,7 +8,6 @@ const data = Type.Object({
|
|
|
8
8
|
data: Type.Optional(Type.Record(Type.String(), Type.Unknown(), {
|
|
9
9
|
title: '数据',
|
|
10
10
|
description: '该属性用于区块动态项配置,可通过 $w.<id>.data 引用到',
|
|
11
|
-
'x-helper-text': '该属性用于区块动态项配置,[详情参考区块动态项配置使用指引](kehttps://cloud.tencent.com/document/product/1301/90229)',
|
|
12
11
|
default: {},
|
|
13
12
|
})),
|
|
14
13
|
});
|
|
@@ -17,7 +17,7 @@ const data = Type.Object({
|
|
|
17
17
|
],
|
|
18
18
|
required: true,
|
|
19
19
|
description: '表单字段的Key值,用于提交数据时,匹配数据模型字段标识。页面内需保证唯一。图片上传后,文件 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在云开发-云存储模块中调整访问权限。',
|
|
20
|
-
'x-helper-text': '图片上传后,图片 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在[云存储权限设置](https://
|
|
20
|
+
'x-helper-text': '图片上传后,图片 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在[云存储权限设置](https://cloud.tencent.com/document/product/876/49037)中调整访问权限。',
|
|
21
21
|
}),
|
|
22
22
|
title: Type.String({
|
|
23
23
|
type: 'string',
|
|
@@ -17,7 +17,7 @@ const data = Type.Object({
|
|
|
17
17
|
required: true,
|
|
18
18
|
'x-category': '基础属性',
|
|
19
19
|
description: '表单字段的Key值,用于提交数据时,匹配数据模型字段标识。页面内需保证唯一。文件上传后,文件 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在云开发-云存储模块中调整访问权限。',
|
|
20
|
-
'x-helper-text': '文件上传后,文件 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在[云存储权限设置](https://
|
|
20
|
+
'x-helper-text': '文件上传后,文件 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在[云存储权限设置](https://cloud.tencent.com/document/product/876/49037)中调整访问权限。',
|
|
21
21
|
}),
|
|
22
22
|
label: Type.String({
|
|
23
23
|
type: 'string',
|
|
@@ -690,7 +690,7 @@ const data = Type.Object({
|
|
|
690
690
|
},
|
|
691
691
|
},
|
|
692
692
|
],
|
|
693
|
-
'x-index':
|
|
693
|
+
'x-index': 125,
|
|
694
694
|
'x-group': '表格列',
|
|
695
695
|
description: '配置表格列,支持拖拽调整列排序',
|
|
696
696
|
}),
|
|
@@ -1276,11 +1276,11 @@ const data = Type.Object({
|
|
|
1276
1276
|
],
|
|
1277
1277
|
})),
|
|
1278
1278
|
enableRelationTag: Type.Optional(Type.Boolean({
|
|
1279
|
-
title: '
|
|
1279
|
+
title: '显示关联/枚举字段标签',
|
|
1280
1280
|
'x-index': 131,
|
|
1281
1281
|
'x-runtime-default': true,
|
|
1282
1282
|
'x-group': '表格列',
|
|
1283
|
-
description: '
|
|
1283
|
+
description: '开启后,表格中的关联关系、枚举字段默认以标签形式展示',
|
|
1284
1284
|
})),
|
|
1285
1285
|
customOptionTitle: Type.Optional(Type.String({
|
|
1286
1286
|
title: '操作列标题',
|
|
@@ -1331,9 +1331,9 @@ const data = Type.Object({
|
|
|
1331
1331
|
],
|
|
1332
1332
|
'x-runtime-default': 'table',
|
|
1333
1333
|
'x-props': { clearable: true },
|
|
1334
|
-
'x-helper-text': '
|
|
1334
|
+
'x-helper-text': '仅查询范围中的字段,可在表格自定义列中被引用,详情参考[字段查询范围配置说明](https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/database/WdTable#%E5%AD%97%E6%AE%B5%E6%9F%A5%E8%AF%A2%E8%8C%83%E5%9B%B4%E8%AE%BE%E7%BD%AE)',
|
|
1335
1335
|
description: '默认查询表格列字段',
|
|
1336
|
-
'x-index':
|
|
1336
|
+
'x-index': 120,
|
|
1337
1337
|
'x-group': '表格列',
|
|
1338
1338
|
'x-linkages': [
|
|
1339
1339
|
{
|
|
@@ -1347,7 +1347,7 @@ const data = Type.Object({
|
|
|
1347
1347
|
title: '自定义查询字段',
|
|
1348
1348
|
type: 'array',
|
|
1349
1349
|
'x-props': { clearable: true },
|
|
1350
|
-
'x-index':
|
|
1350
|
+
'x-index': 121,
|
|
1351
1351
|
'x-group': '表格列',
|
|
1352
1352
|
'x-component': 'mutilp-data-source-field-select',
|
|
1353
1353
|
'x-component-props': {
|
|
@@ -9,7 +9,7 @@ const TITLE = getFormItemDataTitle('文件上传');
|
|
|
9
9
|
const data = Type.Partial(Type.Object({
|
|
10
10
|
// 通用
|
|
11
11
|
name: Object.assign({}, FORM_ITEM_DATA.name, {
|
|
12
|
-
'x-helper-text': '文件上传后,文件 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在[云存储权限设置](https://
|
|
12
|
+
'x-helper-text': '文件上传后,文件 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在[云存储权限设置](https://cloud.tencent.com/document/product/876/49037)中调整访问权限。',
|
|
13
13
|
}),
|
|
14
14
|
value: Object.assign({}, FORM_ITEM_DATA._valueInUpload, {
|
|
15
15
|
title: '文件值',
|
|
@@ -21,7 +21,7 @@ const TITLE = getFormItemDataTitle('图片上传');
|
|
|
21
21
|
const data = Type.Partial(Type.Object({
|
|
22
22
|
// 通用
|
|
23
23
|
name: Object.assign({}, FORM_ITEM_DATA.name, {
|
|
24
|
-
'x-helper-text': '图片上传后,图片 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在[云存储权限设置](https://
|
|
24
|
+
'x-helper-text': '图片上传后,图片 https 链接默认仅可在微搭应用中访问,有效期 2 小时,可在[云存储权限设置](https://cloud.tencent.com/document/product/876/49037)中调整访问权限。',
|
|
25
25
|
}),
|
|
26
26
|
value: FORM_ITEM_DATA._valueInUpload,
|
|
27
27
|
template: Type.String({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
@cloudbase/weda-ui v3.18.
|
|
2
|
+
@cloudbase/weda-ui v3.18.3
|
|
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//jpn8D1QTq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/bDf9+T1/Rpe/YolYsWYXO1XS/CmOv6KUuBnUoITNTDEhJNqb1rYTOf1sRhF1D0EvKOkYiRSHnElw9UGd7bkVIq17pUYpqZfGAtizVSDozNPORXtY3YTig+HhCnpergJhqZl1ZlhDTKQz8O+lKEtWVWLTXTaNPBSmt1Z6faC6hmaq+/j+gGT66PrtpKxquCKzUqTFI36xjltiipsN34AAhYK30U0Si9PDd4Qrlx5gXZbykCAdhWAj3p+F8DA+WBim/aNhq9g86DAocD+KIj0VJtIEzs137fvNcn+Zf8+xChp637Q/Eo/0gLUBkjiCckExRp4iSCSMhV8TToMmywXB/GhkcF5ziw45OB87l85aUMFg0NLu2/zrqV/BH9vE5gRJkaL8IilGuqC03JjHIZdlQAzgqTSpcqAx7mVejwNSGWWs4aGlmhqdGjnCFPBYAqTFrMVhmw/tErzDrt1E1nqkx9Os0wHbxR48t8+rYA9icsgyFzkc5s8Ne9hwCEXWH8WM82YAhjUzGZLCR46/+MZFkk2djoLT1IzKCbi3WV1hnUrcvSm+MZtRSpiYWanQU+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+/oqzxIt4QmFX5ImmIe0SWAOEOJL2n9ZSO5PcCw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AtizVSDozNPORXtY3YTig+HhCnpergJhqZl1ZlhDTKQz8O+lKEtWVWLTXTaNPBSmt1Z6faC6hmaq+/j+gGT66PrtpKxquCKzUqTFI36xjltiipsN34AAhYK30U0Si9PDd4Qrlx5gXZbykCAdhWAj3p+F8DA+WBim/aNhq9g86DAocD+KIj0VJtIEzs137fvNcn+Zf8+xChp637Q/Eo/0gLUBkjiCckExRp4iSCSMhV8TToMmywXB/GhkcF5ziw45OB87l85aUMFg0NLu2/zrqV/BH9vE5gRJkaL8IilGuqC03JjHIZdlQAzgqTSpcqAx7mVejwNSGWWs4aGlmhqdGjnCFPBYAqTFrMVhmw/tErzDrt1E1nqkx9Os0wHbxR48t8+rYA9icsgyFzkc5s8Ne9hwCEXWH8WM82YAhjUzGZLCR46/+MZFkk2djoLT1IzKCbi3WV1hnUrcvSm+MZtRSpiYWanQU+67DN62G7tnPGP8h5DgBGvMgjgCILl0eQyJQoo5wKKqmimhpqqSOQIIIJQUQoYYQTQSRRRBNDLHGIkRBPAonZMHXOzF6Z99D0PpIk80xVIUlCBjmykYNc5CEfBShEJaqggBIqjzpSRkIGObKRg1zkIR8FKEQlqqCAEiqPulNOAgAA) 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
|
|
@@ -6,6 +6,8 @@ import { errorHandler } from '../../../../utils/error';
|
|
|
6
6
|
import { isNil } from '../../../../utils/lodash';
|
|
7
7
|
import { toBase64Uri } from '../../../../utils/file2base64';
|
|
8
8
|
import { randomStr, browserEnv } from '../../../../utils/platform';
|
|
9
|
+
import { useSyncValue } from '../../../../utils/hooks/useSyncValue';
|
|
10
|
+
import equal from '../../../../utils/isObjectEqual';
|
|
9
11
|
// 默认图片类型
|
|
10
12
|
export const IMAGE_TYPES = [
|
|
11
13
|
'image/jpg',
|
|
@@ -39,7 +41,7 @@ export const Upload = forwardRef(function Upload({ children, ...props }, ref) {
|
|
|
39
41
|
const [previewFile, updatePreviewFile] = useState(() => {
|
|
40
42
|
return getInitTempFile({ value });
|
|
41
43
|
});
|
|
42
|
-
const [config, updateConfig] =
|
|
44
|
+
const [config, updateConfig] = useSyncValue({
|
|
43
45
|
accepts,
|
|
44
46
|
disabled,
|
|
45
47
|
maxSize,
|
|
@@ -48,7 +50,7 @@ export const Upload = forwardRef(function Upload({ children, ...props }, ref) {
|
|
|
48
50
|
compressQuality,
|
|
49
51
|
compressedHeight,
|
|
50
52
|
compressedWidth,
|
|
51
|
-
});
|
|
53
|
+
}, equal);
|
|
52
54
|
const [initFlag, setInitFlag] = useState(false);
|
|
53
55
|
React.useEffect(() => {
|
|
54
56
|
if (!(value === null || value === void 0 ? void 0 : value.length)) {
|
|
@@ -200,6 +202,10 @@ export const Upload = forwardRef(function Upload({ children, ...props }, ref) {
|
|
|
200
202
|
}
|
|
201
203
|
return uploadHandle;
|
|
202
204
|
}, [deleteFile, onClick, previewFile, setUploadHandle, uploadInstance]);
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
+
const isAndroidWeixin = browserEnv().android && browserEnv().weixin;
|
|
206
|
+
const extraProps = {
|
|
207
|
+
...(multiple && !isAndroidWeixin && { multiple: true }),
|
|
208
|
+
...(sourceType === 'camera' && { capture: true }),
|
|
209
|
+
};
|
|
210
|
+
return (_jsxs(React.Fragment, { children: [_jsx("input", { ref: inputRef, name: name, disabled: disabled || readOnly, type: "file", onClick: (e) => e.stopPropagation(), style: { display: 'none' }, accept: accepts, onChange: uploadChange, ...extraProps }, inputId), children] }));
|
|
205
211
|
});
|
|
@@ -43,7 +43,6 @@ export function UploaderPCInner(props) {
|
|
|
43
43
|
extraProps['multiple'] = !single;
|
|
44
44
|
extraProps['accept'] = acceptTypes.length === 0 ? IMAGE_TYPES : Array.from(new Set(acceptTypes));
|
|
45
45
|
tips && (extraProps['title'] = tips);
|
|
46
|
-
maxSize && (extraProps['maxSize'] = maxSize * 1024 * 1024);
|
|
47
46
|
const hasActions = !uploading && !readOnly && !(disabled || sourceType === 'camera');
|
|
48
47
|
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx(Upload, { ...extraProps, ref: uploadRef, value: defaultValue, setUploadHandle: setUploadRef, sourceType: sourceType, children: _jsxs("div", { className: "_weda-fn-upload-result", children: [tempFile === null || tempFile === void 0 ? void 0 : tempFile.map((d, index) => (_jsx("div", { className: `_weda-fn-upload-result__item ${imgTypeCls}`, children: _jsx(TcbImage, { index: index, allFile: tempFile, tempFile: d, imgTypeCls: imgTypeCls, isZoom: true, previewIcon: "td:browse", portalContainer: portalContainer, actions: hasActions && (_jsx(WdIcon, { className: `${CLASS_PREFIX}__image-actions-delete`, name: "td:delete", onClick: () => deleteHandle(d), size: "sm" })) }) }, d.cloudId))), _jsxs("div", { className: `${CLASS_PREFIX}__input-box`, children: [readOnly && tempFile.length < 1 && _jsx("div", { children: "-" }), sourceType === 'camera' || (disabled && !readOnly) ? (_jsx("div", { className: `_weda-fn-upload-result__item wedatea2td-disabled weda-uploader-btn__box ${imgTypeCls}`, children: _jsxs("div", { className: "_weda-fn-upload-result__status", children: [_jsx("i", { className: "wedatea2td-icon wedatea2td-icon-plus", role: "img", "aria-label": "plus" }), _jsx("span", { className: "wedatea2td-mt-1n wedatea2td-text-label wedatea2td-fz-reset", children: btnTitle })] }) })) : (((!single && tempFile.length < maxUploadCount) || (single && tempFile.length < 1 && !uploading)) &&
|
|
49
48
|
!readOnly && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { DataType, EventsType } from '../../../configs/components/form-user-tree-select';
|
|
3
3
|
import type { CommonPropsType } from '../../types';
|
|
4
4
|
export type FormUserTreeSelectProps = CommonPropsType & DataType & {
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React, { useMemo, useRef } from 'react';
|
|
3
3
|
import { UserTreeSelect } from '../../components';
|
|
4
4
|
import Tips from '../form/tips';
|
|
5
5
|
import { useFormInputTrait, useParentForm } from '../form-input-hooks';
|
|
6
6
|
import { FormItemWrapper } from '../common/form-item-wrapper';
|
|
7
|
+
import { convertSingleValue } from '../../utils/tool';
|
|
7
8
|
const FormUserTreeSelect = React.forwardRef(function FormUserTreeSelect(props, inputRef) {
|
|
8
9
|
const parent = useParentForm(props.$widget);
|
|
9
10
|
const { className, id, style, events, required, requiredFlag, label, labelVisible, confirmValue, defaultValueType, multiple, size, where, secondDisplay, corpScope, ...restProps } = props;
|
|
10
|
-
|
|
11
|
+
// 强制转换初始值
|
|
12
|
+
const initRef = useRef(false);
|
|
13
|
+
const formValue = useMemo(() => {
|
|
14
|
+
if (initRef.current)
|
|
15
|
+
return props.value;
|
|
16
|
+
initRef.current = true;
|
|
17
|
+
return convertSingleValue(props.value, !multiple);
|
|
18
|
+
}, [props.value, multiple]);
|
|
19
|
+
const { value, name, onChange, disabled, layout, readOnly, validateErrorMsg, validateState, visible } = useFormInputTrait({
|
|
11
20
|
name: restProps.name,
|
|
12
21
|
inputRef,
|
|
13
22
|
required,
|
|
14
23
|
label,
|
|
15
24
|
...restProps,
|
|
25
|
+
value: formValue,
|
|
16
26
|
});
|
|
17
27
|
if (!visible) {
|
|
18
28
|
return null;
|
|
19
29
|
}
|
|
20
|
-
return (_jsxs(FormItemWrapper, { children: [_jsx(UserTreeSelect, { id: id, style: style, className: className, events: events, name: name, onChange: onChange, checked: value, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, confirmValue: confirmValue, defaultValueType: defaultValueType, defaultValue: value, size: size, multiple: multiple, where: where, secondDisplay: secondDisplay, corpScope: corpScope, readOnly: readOnly, formType: parent === null || parent === void 0 ? void 0 : parent.formType }), (validateState === 'error' || validateState === 'warn') &&
|
|
30
|
+
return (_jsxs(FormItemWrapper, { children: [_jsx(UserTreeSelect, { id: id, style: style, className: className, events: events, name: name, onChange: onChange, checked: value, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, confirmValue: confirmValue, defaultValueType: defaultValueType, defaultValue: value, size: size, multiple: multiple, where: where, secondDisplay: secondDisplay, corpScope: corpScope, readOnly: readOnly, formType: parent === null || parent === void 0 ? void 0 : parent.formType }), (validateState === 'error' || validateState === 'warn') && _jsx(Tips, { tips: validateErrorMsg, type: "warn" })] }));
|
|
21
31
|
});
|
|
22
32
|
export default FormUserTreeSelect;
|
|
@@ -4,4 +4,4 @@ import './style';
|
|
|
4
4
|
export interface PropsType extends CommonPropsType {
|
|
5
5
|
value: string;
|
|
6
6
|
}
|
|
7
|
-
export default function RichTextView({ value, className, style, id
|
|
7
|
+
export default function RichTextView({ value, className, style, id }: PropsType): JSX.Element;
|
|
@@ -7,7 +7,14 @@ import { useImgTransform } from './useImgTransform';
|
|
|
7
7
|
import destr from 'destr';
|
|
8
8
|
import './style';
|
|
9
9
|
import xss from 'xss';
|
|
10
|
-
|
|
10
|
+
const clickHandler = (event) => {
|
|
11
|
+
const target = event.target;
|
|
12
|
+
const anchor = target.closest('a');
|
|
13
|
+
if (anchor) {
|
|
14
|
+
getOnClick({ url: anchor.href })(event);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export default function RichTextView({ value = '', className, style, id }) {
|
|
11
18
|
const parseValue = xss(destr(value) || '', getWhitelist());
|
|
12
19
|
const cls = classNames({
|
|
13
20
|
'weda-ui': true,
|
|
@@ -17,19 +24,23 @@ export default function RichTextView({ value = '', className, style, id, }) {
|
|
|
17
24
|
const displayValue = useImgTransform(parseValue);
|
|
18
25
|
const richTextRef = useRef(null);
|
|
19
26
|
useEffect(() => {
|
|
20
|
-
|
|
27
|
+
const parent = document.getElementById(id);
|
|
28
|
+
if (richTextRef.current && parent) {
|
|
21
29
|
richTextRef.current.querySelectorAll('a').forEach((a) => {
|
|
22
30
|
const url = a.href;
|
|
23
31
|
// 若非同域 默认新页面打开
|
|
24
|
-
if (/https?:\/\//.test(url) &&
|
|
25
|
-
!url.startsWith(window.location.origin)) {
|
|
32
|
+
if (/https?:\/\//.test(url) && !url.startsWith(window.location.origin)) {
|
|
26
33
|
a.target = a.target || '_blank';
|
|
27
34
|
}
|
|
28
|
-
a.
|
|
29
|
-
|
|
30
|
-
}
|
|
35
|
+
if (a.target === '_blank') {
|
|
36
|
+
a.rel = 'noopener noreferrer';
|
|
37
|
+
}
|
|
31
38
|
});
|
|
39
|
+
parent === null || parent === void 0 ? void 0 : parent.addEventListener('click', clickHandler);
|
|
32
40
|
}
|
|
33
|
-
|
|
41
|
+
return () => {
|
|
42
|
+
parent === null || parent === void 0 ? void 0 : parent.removeEventListener('click', clickHandler);
|
|
43
|
+
};
|
|
44
|
+
}, [displayValue, id]);
|
|
34
45
|
return (displayValue && (_jsx("div", { ref: richTextRef, className: cls, style: style, id: id, children: _jsx("div", { dangerouslySetInnerHTML: { __html: displayValue } }) })));
|
|
35
46
|
}
|
|
@@ -13,6 +13,13 @@ import { useImgTransform } from '../richTextView/useImgTransform';
|
|
|
13
13
|
import { getOnClick } from '../wd-unified-link/utils';
|
|
14
14
|
import { addCustomClassPlugin } from './addClass';
|
|
15
15
|
import './style';
|
|
16
|
+
const clickHandler = (event) => {
|
|
17
|
+
const target = event.target;
|
|
18
|
+
const anchor = target.closest('a');
|
|
19
|
+
if (anchor) {
|
|
20
|
+
getOnClick({ url: anchor.href })(event);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
16
23
|
export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options, className, style, id, events }, ref) {
|
|
17
24
|
const platform = usePlatform();
|
|
18
25
|
const { classPrefix } = useConfig();
|
|
@@ -95,19 +102,25 @@ export const WdMarkdown = forwardRef(function WdMarkdown({ value = '', options,
|
|
|
95
102
|
const displayValue = useImgTransform(html);
|
|
96
103
|
const markdownRef = useRef(null);
|
|
97
104
|
useEffect(() => {
|
|
98
|
-
|
|
105
|
+
const parent = document.getElementById(id);
|
|
106
|
+
if (markdownRef.current && parent) {
|
|
99
107
|
markdownRef.current.querySelectorAll('a').forEach((a) => {
|
|
100
108
|
const url = a.href;
|
|
109
|
+
const isOrigin = url.startsWith(window.location.origin);
|
|
101
110
|
// 若非同域 默认新页面打开
|
|
102
|
-
if (/https?:\/\//.test(url) && !
|
|
111
|
+
if (/https?:\/\//.test(url) && !isOrigin) {
|
|
103
112
|
a.target = a.target || '_blank';
|
|
104
113
|
}
|
|
105
|
-
a.
|
|
106
|
-
|
|
107
|
-
}
|
|
114
|
+
if (a.target === '_blank') {
|
|
115
|
+
a.rel = 'noopener noreferrer';
|
|
116
|
+
}
|
|
108
117
|
});
|
|
118
|
+
parent === null || parent === void 0 ? void 0 : parent.addEventListener('click', clickHandler); // 需要清理
|
|
109
119
|
}
|
|
110
|
-
|
|
120
|
+
return () => {
|
|
121
|
+
parent === null || parent === void 0 ? void 0 : parent.removeEventListener('click', clickHandler);
|
|
122
|
+
};
|
|
123
|
+
}, [displayValue, id]);
|
|
111
124
|
useSetWidgetApi(() => {
|
|
112
125
|
return {
|
|
113
126
|
value,
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback } from 'react';
|
|
2
|
+
import { forwardRef, useMemo, useRef, useCallback } from 'react';
|
|
3
3
|
import { useHandleClear } from '../../utils/hooks/useFormLegacy';
|
|
4
4
|
import { useFormInputTrait } from '../../components/form-input-hooks';
|
|
5
5
|
import { WdFormItem, WdInputGroup, WdInputWrap } from '../wd-form-item';
|
|
6
6
|
import UserTreeSelect from '../form/userOrgSelect/component/user-select-h5';
|
|
7
7
|
import { emptyObject } from '../../utils/constant';
|
|
8
8
|
import { RecycleProvider } from '../../utils/hooks/useRecycle';
|
|
9
|
+
import { convertSingleValue } from '../../utils/tool';
|
|
9
10
|
import { X_RUNTIME_DEFAULT } from '../../../configs/type-utils/x-runtime-default';
|
|
10
11
|
import './style';
|
|
11
12
|
export const WdMember = forwardRef(function WdMember(props, ref) {
|
|
12
13
|
const { classRoot = 'member', clearable = X_RUNTIME_DEFAULT.clearable, placeholder, where, multiple = X_RUNTIME_DEFAULT.multiple, secondDisplay = X_RUNTIME_DEFAULT.secondDisplay, corpScope = X_RUNTIME_DEFAULT.corpScope, events = emptyObject, } = props;
|
|
13
|
-
|
|
14
|
+
// 强制转换初始值
|
|
15
|
+
const initRef = useRef(false);
|
|
16
|
+
const formValue = useMemo(() => {
|
|
17
|
+
if (initRef.current)
|
|
18
|
+
return props.value;
|
|
19
|
+
initRef.current = true;
|
|
20
|
+
return convertSingleValue(props.value, !multiple);
|
|
21
|
+
}, [props.value, multiple]);
|
|
22
|
+
const traitProps = { ...props, value: formValue, inputRef: ref };
|
|
14
23
|
const trait = useFormInputTrait(traitProps);
|
|
15
24
|
const { value, onChange, disabled, readOnly, visible } = trait;
|
|
16
25
|
const onClearChange = useCallback((v) => {
|
|
@@ -63,9 +63,7 @@ export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primary
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
let optionRes = mapResult(transformedRecords, primaryColumn);
|
|
66
|
-
|
|
67
|
-
optionRes = [...options, ...optionRes];
|
|
68
|
-
}
|
|
66
|
+
optionRes = [...options, ...optionRes];
|
|
69
67
|
optionRes = getUniqueOption(optionRes);
|
|
70
68
|
if (typeof setOptions === 'function') {
|
|
71
69
|
setOptions(optionRes);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const EnumSelect: (props: any) => JSX.Element;
|
|
2
|
-
export declare const formatEnum: (value: any, field: any, enumOptions: any) => any;
|
|
2
|
+
export declare const formatEnum: (value: any, field: any, enumOptions: any, showRelationWithTag?: boolean) => any;
|
|
3
3
|
export declare const EnumView: (props: any) => any;
|
|
@@ -31,7 +31,7 @@ export const EnumSelect = (props) => {
|
|
|
31
31
|
return _jsx(Select, { ...selectProps, onChange: onSelectChange });
|
|
32
32
|
};
|
|
33
33
|
// 转换枚举值
|
|
34
|
-
export const formatEnum = (value, field, enumOptions) => {
|
|
34
|
+
export const formatEnum = (value, field, enumOptions, showRelationWithTag = true) => {
|
|
35
35
|
var _a;
|
|
36
36
|
try {
|
|
37
37
|
const optionName = field['x-option-name'];
|
|
@@ -47,6 +47,9 @@ export const formatEnum = (value, field, enumOptions) => {
|
|
|
47
47
|
else {
|
|
48
48
|
val = getTextByValue(value);
|
|
49
49
|
}
|
|
50
|
+
if (!showRelationWithTag) {
|
|
51
|
+
return _jsx("span", { title: val, children: val });
|
|
52
|
+
}
|
|
50
53
|
return (_jsx(WdTag, { range: val === null || val === void 0 ? void 0 : val.split(',').map((i) => ({
|
|
51
54
|
label: i,
|
|
52
55
|
value: i,
|
|
@@ -62,9 +65,9 @@ export const formatEnum = (value, field, enumOptions) => {
|
|
|
62
65
|
};
|
|
63
66
|
// 枚举值展示组件
|
|
64
67
|
export const EnumView = (props) => {
|
|
65
|
-
const { field, values } = props;
|
|
68
|
+
const { field, values, showRelationWithTag = true } = props;
|
|
66
69
|
const { enumOptions, loading } = useEnumContext();
|
|
67
70
|
if (loading)
|
|
68
71
|
return _jsx(Icon, { type: "loading" });
|
|
69
|
-
return formatEnum(values, field, enumOptions);
|
|
72
|
+
return formatEnum(values, field, enumOptions, showRelationWithTag);
|
|
70
73
|
};
|
|
@@ -124,7 +124,7 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
124
124
|
}
|
|
125
125
|
else if (format === 'x-enum') {
|
|
126
126
|
// 枚举(新)
|
|
127
|
-
return (_jsx(TextWrap, { ...textProps, title: val, children: _jsx(EnumView, { field: field, values: val }) }));
|
|
127
|
+
return (_jsx(TextWrap, { ...textProps, title: val, children: _jsx(EnumView, { field: field, values: val, showRelationWithTag: showRelationWithTag }) }));
|
|
128
128
|
}
|
|
129
129
|
else if (format === 'url') {
|
|
130
130
|
// 网址
|
|
@@ -224,7 +224,7 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
224
224
|
}
|
|
225
225
|
if (format === 'x-enum') {
|
|
226
226
|
// 枚举(新)
|
|
227
|
-
return (_jsx(TextWrap, { ...textProps, title: val, children: _jsx(EnumView, { field: field, values: val }) }));
|
|
227
|
+
return (_jsx(TextWrap, { ...textProps, title: val, children: _jsx(EnumView, { field: field, values: val, showRelationWithTag: showRelationWithTag }) }));
|
|
228
228
|
}
|
|
229
229
|
else if ((items === null || items === void 0 ? void 0 : items.format) === 'x-location') {
|
|
230
230
|
// 地理位置
|
|
@@ -765,7 +765,6 @@ export const filterCustomColumns = ({ columns, columnSets, slots, fields, isH5,
|
|
|
765
765
|
const { key, header, genre, fixed, relatedField } = item2;
|
|
766
766
|
const _oriField = fields.find((el) => key === el.name); // 1、原始字段
|
|
767
767
|
const _relField = getRelatedField(_oriField, relatedField, supportManyRelated) || _oriField; // 2、关联关系字段
|
|
768
|
-
const field = getCustomField(_relField, item2); // 3、自定义数据类型字段;
|
|
769
768
|
// 处理渲染错误
|
|
770
769
|
const render = (record) => {
|
|
771
770
|
const extra = isH5
|
|
@@ -789,10 +788,11 @@ export const filterCustomColumns = ({ columns, columnSets, slots, fields, isH5,
|
|
|
789
788
|
showRelationWithTag,
|
|
790
789
|
};
|
|
791
790
|
const value = getFieldValue(key, record, relatedField, isMany(_oriField));
|
|
792
|
-
const
|
|
791
|
+
const _field = getCustomField(_relField, item2, value); // 结合数据内容,获取自定义字段类型
|
|
792
|
+
const component = getFieldRender(_field, extra)(value);
|
|
793
793
|
return _jsx(ErrorBoundary, { FallbackComponent: () => _jsx("span", { className: "", children: "\u274C \u6570\u636E\u5F02\u5E38" }), children: component });
|
|
794
794
|
};
|
|
795
|
-
const _oriWidth = getFieldWidth(
|
|
795
|
+
const _oriWidth = getFieldWidth(_relField) + 10;
|
|
796
796
|
const isIllegalWidth = typeof (item2 === null || item2 === void 0 ? void 0 : item2.width) !== 'number';
|
|
797
797
|
item2.width = (item2 === null || item2 === void 0 ? void 0 : item2.widthType) === 'auto' || isIllegalWidth ? _oriWidth : item2 === null || item2 === void 0 ? void 0 : item2.width;
|
|
798
798
|
// 拿到自定义列属性值
|
|
@@ -833,7 +833,7 @@ const CUSTOM_TYPE_MAP = {
|
|
|
833
833
|
file: { type: 'string', format: 'x-file' },
|
|
834
834
|
};
|
|
835
835
|
// 自定义数据类型
|
|
836
|
-
const getCustomField = (_field, columnSet) => {
|
|
836
|
+
const getCustomField = (_field, columnSet, value) => {
|
|
837
837
|
try {
|
|
838
838
|
const { customType, customArrayItem, customJson } = columnSet;
|
|
839
839
|
let customField = {};
|
|
@@ -846,6 +846,9 @@ const getCustomField = (_field, columnSet) => {
|
|
|
846
846
|
}
|
|
847
847
|
else {
|
|
848
848
|
customField = CUSTOM_TYPE_MAP[customType] || {};
|
|
849
|
+
if (Array.isArray(value) && Object.keys(customField).length > 0) {
|
|
850
|
+
customField = { type: 'array', format: '', items: customField };
|
|
851
|
+
}
|
|
849
852
|
}
|
|
850
853
|
return { ..._field, ...customField };
|
|
851
854
|
}
|
|
@@ -9,6 +9,10 @@ import { filterFieldsGenerate } from './filterFieldsGenerate';
|
|
|
9
9
|
import { WdButton } from '../../../wd-button';
|
|
10
10
|
import { usePlatform } from '../../../../utils/platform';
|
|
11
11
|
import { useSetWidgetApi } from '../../../../utils/widget-api/use-set-widget-api';
|
|
12
|
+
// 正则元字符添加转义符
|
|
13
|
+
const escapeRegExp = (string) => {
|
|
14
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
15
|
+
};
|
|
12
16
|
const getFilterConfig = (data) => data.map(({ name, label, value, fieldCalculationOption = [], fieldCalculation }) => ({
|
|
13
17
|
name,
|
|
14
18
|
label,
|
|
@@ -85,7 +89,7 @@ export const FilterFieldsPanel = forwardRef(function Comp(props, ref) {
|
|
|
85
89
|
});
|
|
86
90
|
// 值筛选条件
|
|
87
91
|
filterValues.forEach((i) => {
|
|
88
|
-
var _a, _b
|
|
92
|
+
var _a, _b;
|
|
89
93
|
switch (i.fieldCalculation.value) {
|
|
90
94
|
case 'scope':
|
|
91
95
|
if (i.filterType === 'number') {
|
|
@@ -122,17 +126,23 @@ export const FilterFieldsPanel = forwardRef(function Comp(props, ref) {
|
|
|
122
126
|
case 'exclude':
|
|
123
127
|
searchValues.push({
|
|
124
128
|
key: i.name,
|
|
125
|
-
val: `^((?!${i.filterType === 'string' ? (
|
|
129
|
+
val: `^((?!${i.filterType === 'string' ? escapeRegExp(i.value) : i.value}).)*$`,
|
|
126
130
|
rel: 'regex',
|
|
127
131
|
});
|
|
128
132
|
break;
|
|
129
133
|
case 'startWith':
|
|
130
|
-
searchValues.push({ key: i.name, val: `^${(
|
|
134
|
+
searchValues.push({ key: i.name, val: `^${(_a = i.value) === null || _a === void 0 ? void 0 : _a.trim()}`, rel: 'regex' });
|
|
135
|
+
break;
|
|
136
|
+
case 'regex':
|
|
137
|
+
searchValues.push({ key: i.name, val: `^${escapeRegExp(i.value)}`, rel: i.fieldCalculation.value });
|
|
138
|
+
break;
|
|
139
|
+
case 'nsearch_ci':
|
|
140
|
+
searchValues.push({ key: i.name, val: `${escapeRegExp(i.value)}`, rel: i.fieldCalculation.value });
|
|
131
141
|
break;
|
|
132
142
|
default: {
|
|
133
143
|
const searchItem = {
|
|
134
144
|
key: i.name,
|
|
135
|
-
val: i.filterType === 'string' ? (
|
|
145
|
+
val: i.filterType === 'string' ? (_b = i.value) === null || _b === void 0 ? void 0 : _b.trim() : i.value,
|
|
136
146
|
rel: i.fieldCalculation.value,
|
|
137
147
|
};
|
|
138
148
|
if (i.filterType === 'number') {
|
|
@@ -26,7 +26,7 @@ export const WdUnifiedLink = forwardRef(function WdUnifiedLink(props, ref) {
|
|
|
26
26
|
options,
|
|
27
27
|
}), [url, options], ref);
|
|
28
28
|
// 方法
|
|
29
|
-
const onClick = getOnClick(props);
|
|
30
|
-
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx("a", { href:
|
|
29
|
+
const onClick = (e) => getOnClick(props)(e);
|
|
30
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx("a", { href: url, rel: "noopener noreferrer", className: classNames(classes, className), id: id, style: style, onClick: onClick, "data-testid": "wd-unified-link", ...options, children: children }) }));
|
|
31
31
|
});
|
|
32
32
|
export default WdUnifiedLink;
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
+
/* eslint-disable complexity */
|
|
1
2
|
import { alertErrorMessage } from '../../utils/platform';
|
|
2
3
|
// ! reference in src/web/components/richTextView/index.tsx
|
|
3
4
|
export const getOnClick = (props) => {
|
|
4
5
|
const { url, options, events } = props;
|
|
5
6
|
const isMobile = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|IEMobile)/i);
|
|
6
7
|
return async (e) => {
|
|
7
|
-
var _a, _b, _c, _d, _e;
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
8
9
|
(events === null || events === void 0 ? void 0 : events.tap) && events.tap({}, { originEvent: e });
|
|
9
10
|
// a 标签直接跳转
|
|
10
|
-
if (
|
|
11
|
+
if (/^(https?:|#)/.test(url)) {
|
|
12
|
+
const isHashLink = url.includes('#');
|
|
13
|
+
const isOrigin = url.startsWith(window.location.origin);
|
|
14
|
+
const isEditorMode = (_b = (_a = window.$w) === null || _a === void 0 ? void 0 : _a.wedaContext) === null || _b === void 0 ? void 0 : _b.isEditorMode;
|
|
15
|
+
const targetId = url.split('#')[1];
|
|
16
|
+
const target = targetId ? document.getElementById(targetId) : null;
|
|
17
|
+
// 编辑器模式下的锚点滚动
|
|
18
|
+
if (isEditorMode && target) {
|
|
19
|
+
if ((isOrigin && isHashLink) || url.startsWith('#')) {
|
|
20
|
+
if (!e.defaultPrevented) {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
11
26
|
return;
|
|
12
27
|
}
|
|
13
28
|
if (!e.defaultPrevented) {
|
|
@@ -34,10 +49,10 @@ export const getOnClick = (props) => {
|
|
|
34
49
|
}, {});
|
|
35
50
|
}
|
|
36
51
|
// 页面参数,如果存在变量绑定,以绑定值为准
|
|
37
|
-
if ((
|
|
38
|
-
params = { ...params, ...(
|
|
52
|
+
if ((_c = props === null || props === void 0 ? void 0 : props.params) === null || _c === void 0 ? void 0 : _c[pageId]) {
|
|
53
|
+
params = { ...params, ...(_d = props === null || props === void 0 ? void 0 : props.params) === null || _d === void 0 ? void 0 : _d[pageId] };
|
|
39
54
|
}
|
|
40
|
-
(
|
|
55
|
+
(_e = window === null || window === void 0 ? void 0 : window.app) === null || _e === void 0 ? void 0 : _e.navigateTo({
|
|
41
56
|
pageId,
|
|
42
57
|
packageName: packageName === 'main' ? '' : packageName,
|
|
43
58
|
mode: (options === null || options === void 0 ? void 0 : options.target) === '_blank' ? 'web' : 'weDa',
|
|
@@ -53,11 +68,11 @@ export const getOnClick = (props) => {
|
|
|
53
68
|
});
|
|
54
69
|
}
|
|
55
70
|
else {
|
|
56
|
-
(
|
|
71
|
+
(_f = window === null || window === void 0 ? void 0 : window.app) === null || _f === void 0 ? void 0 : _f.navigateTo({ url, options });
|
|
57
72
|
}
|
|
58
73
|
break;
|
|
59
74
|
default:
|
|
60
|
-
(
|
|
75
|
+
(_g = window === null || window === void 0 ? void 0 : window.app) === null || _g === void 0 ? void 0 : _g.navigateTo({ url, options });
|
|
61
76
|
break;
|
|
62
77
|
}
|
|
63
78
|
}
|
package/dist/web/utils/tool.js
CHANGED
|
@@ -31,9 +31,7 @@ export const getUuid = () => {
|
|
|
31
31
|
* 转换枚举值
|
|
32
32
|
*/
|
|
33
33
|
export const convertLegacyEnum = (prop, enumObj, defaultValue) => {
|
|
34
|
-
const enumValue = enumObj.map((i) => i.value).includes(prop)
|
|
35
|
-
? prop
|
|
36
|
-
: enumObj[0].value;
|
|
34
|
+
const enumValue = enumObj.map((i) => i.value).includes(prop) ? prop : enumObj[0].value;
|
|
37
35
|
if (defaultValue !== undefined)
|
|
38
36
|
return enumValue || defaultValue;
|
|
39
37
|
return enumValue;
|
|
@@ -101,9 +99,7 @@ export const getFieldsTypeName = (fields) => {
|
|
|
101
99
|
else if (type === 'string' && format === 'function') {
|
|
102
100
|
item.fieldsTypeName = '计算公式';
|
|
103
101
|
}
|
|
104
|
-
else if (type === 'string' &&
|
|
105
|
-
format === 'related' &&
|
|
106
|
-
fatherAction === 'related') {
|
|
102
|
+
else if (type === 'string' && format === 'related' && fatherAction === 'related') {
|
|
107
103
|
item.fieldsTypeName = '主子明细';
|
|
108
104
|
}
|
|
109
105
|
else if (type === 'string' && format === 'father-son') {
|
|
@@ -153,9 +149,7 @@ export const deepClone = (value) => {
|
|
|
153
149
|
}
|
|
154
150
|
return copiedValue;
|
|
155
151
|
};
|
|
156
|
-
const type = value === null || value === undefined
|
|
157
|
-
? 'NullOrUndefined'
|
|
158
|
-
: Object.prototype.toString.call(value).slice(8, -1);
|
|
152
|
+
const type = value === null || value === undefined ? 'NullOrUndefined' : Object.prototype.toString.call(value).slice(8, -1);
|
|
159
153
|
if ([
|
|
160
154
|
'Int8Array',
|
|
161
155
|
'Uint8Array',
|
|
@@ -222,7 +216,7 @@ export const setRefProp = (ref, name, value) => {
|
|
|
222
216
|
ref.current[name] = value;
|
|
223
217
|
}
|
|
224
218
|
};
|
|
225
|
-
//
|
|
219
|
+
// 兼容单选多选值类型,上传图片/上传文件/级联选择/成员选择
|
|
226
220
|
export const convertSingleValue = (value, single) => {
|
|
227
221
|
let v = value;
|
|
228
222
|
if (value !== null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.3",
|
|
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.
|
|
88
|
+
"@cloudbase/weda-client": "^1.1.32",
|
|
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.14",
|
|
151
151
|
"@cloudbase/lowcode-cli": "^0.22.2",
|
|
152
|
-
"@cloudbase/weda-cloud-sdk": "^1.0.
|
|
152
|
+
"@cloudbase/weda-cloud-sdk": "^1.0.102",
|
|
153
153
|
"@commitlint/cli": "^16.0.2",
|
|
154
154
|
"@commitlint/config-conventional": "^17.7.0",
|
|
155
155
|
"@craco/craco": "^7.1.0",
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
"!.temp/dist/*.map"
|
|
280
280
|
],
|
|
281
281
|
"webpack": false,
|
|
282
|
-
"limit": "
|
|
282
|
+
"limit": "1000 KB"
|
|
283
283
|
}
|
|
284
284
|
],
|
|
285
285
|
"nyc": {
|