@steedos-widgets/amis-lib 3.6.11-beta.4 → 3.6.11-beta.6
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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +105 -74
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +105 -74
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +57 -48
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/editor.d.ts +1 -13
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -8255,6 +8255,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8255
8255
|
}
|
|
8256
8256
|
|
|
8257
8257
|
const onChangeScript = `
|
|
8258
|
+
// console.log("==search=onChangeScript===");
|
|
8258
8259
|
const scope = event.context.scoped;
|
|
8259
8260
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
8260
8261
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
@@ -8270,14 +8271,14 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8270
8271
|
}
|
|
8271
8272
|
`;
|
|
8272
8273
|
|
|
8273
|
-
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
8274
|
+
// 之前onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
8274
8275
|
// 而点击回车按键又不会触发blur事件,所以只能每次回车事件中额外再执行一次onChangeScript
|
|
8275
8276
|
// 等升级到amis 3.4+,blur事件换成change事件执行onChangeScript,就可以不用在onSearchScript中执行onChangeScript了
|
|
8277
|
+
// 基于amis3.6,已经不再用blur事件触发onChangeScript,所以这里把之前加上的onChangeScript去掉了,如果以后还要换blur来触发onChangeScript脚本的话,这里又要加回onChangeScript脚本
|
|
8276
8278
|
const onSearchScript = `
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
+
// console.log("==search=onSearchScript===");
|
|
8279
8280
|
// 下面的脚本只为解决点击搜索表单取消按钮,再重新在其中输入过滤条件但是不点击搜索按钮或回车按键触发搜索,此时在快速搜索框输入过滤条件按回车按键会把搜索表单中的过滤条件清空的问题
|
|
8280
|
-
|
|
8281
|
+
const scope = event.context.scoped;
|
|
8281
8282
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
8282
8283
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
8283
8284
|
let isLookup = event.data.isLookup;
|
|
@@ -8296,6 +8297,14 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8296
8297
|
}, 500);
|
|
8297
8298
|
`;
|
|
8298
8299
|
|
|
8300
|
+
const onBlurScript = `
|
|
8301
|
+
// console.log("==search=onBlurScript===");
|
|
8302
|
+
// 失去焦点事件触发搜索
|
|
8303
|
+
const scope = event.context.scoped;
|
|
8304
|
+
const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
|
|
8305
|
+
sb.handleSearch();
|
|
8306
|
+
`;
|
|
8307
|
+
|
|
8299
8308
|
return {
|
|
8300
8309
|
"type": "tooltip-wrapper",
|
|
8301
8310
|
"id": "steedos_crud_toolbar_quick_search",
|
|
@@ -8313,7 +8322,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8313
8322
|
"name": keywordsSearchBoxName,
|
|
8314
8323
|
"placeholder": "快捷搜索",
|
|
8315
8324
|
"value": crudKeywords,
|
|
8316
|
-
|
|
8325
|
+
"clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
8317
8326
|
"clearAndSubmit": true,
|
|
8318
8327
|
"searchImediately": false,
|
|
8319
8328
|
"onEvent": {
|
|
@@ -8325,13 +8334,21 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8325
8334
|
}
|
|
8326
8335
|
]
|
|
8327
8336
|
},
|
|
8328
|
-
"
|
|
8337
|
+
"change": { //amis 3.2change事件中setData会卡,升级到amis 3.4+应该不会再卡了,所以这里换回change事件,如果还是会卡就要考虑重新换成blur事件
|
|
8329
8338
|
"actions": [
|
|
8330
8339
|
{
|
|
8331
8340
|
"actionType": "custom",
|
|
8332
8341
|
"script": onChangeScript
|
|
8333
8342
|
},
|
|
8334
8343
|
]
|
|
8344
|
+
},
|
|
8345
|
+
"blur": {
|
|
8346
|
+
"actions": [
|
|
8347
|
+
{
|
|
8348
|
+
"actionType": "custom",
|
|
8349
|
+
"script": onBlurScript
|
|
8350
|
+
},
|
|
8351
|
+
]
|
|
8335
8352
|
}
|
|
8336
8353
|
}
|
|
8337
8354
|
}
|
|
@@ -8357,59 +8374,67 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
8357
8374
|
};
|
|
8358
8375
|
}
|
|
8359
8376
|
let toolbarReloadButton;
|
|
8360
|
-
|
|
8361
|
-
// const
|
|
8362
|
-
//
|
|
8363
|
-
//
|
|
8364
|
-
//
|
|
8365
|
-
//
|
|
8366
|
-
// listView.handleChangePage(1);
|
|
8367
|
-
// `;
|
|
8368
|
-
// toolbarReloadButton = {
|
|
8369
|
-
// // "type": "reload",//不可以直接使用reload,因为它不会设置页码到第一页,这在加载更多按钮的翻页模式下会有问题
|
|
8370
|
-
// "type": "button",
|
|
8371
|
-
// "align": "right",
|
|
8372
|
-
// //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8373
|
-
// // "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
8374
|
-
// "tooltipPlacement": "top",
|
|
8375
|
-
// "className": "bg-white p-2 rounded text-gray-500",
|
|
8376
|
-
// "label": "",
|
|
8377
|
-
// "icon": "fa fa-sync",
|
|
8378
|
-
// "visibleOn": "${!showFieldsFilter}",
|
|
8379
|
-
// "onEvent": {
|
|
8380
|
-
// "click": {
|
|
8381
|
-
// "actions": [
|
|
8382
|
-
// {
|
|
8383
|
-
// "actionType": "custom",
|
|
8384
|
-
// "script": onReloadScript
|
|
8385
|
-
// }
|
|
8386
|
-
// ]
|
|
8387
|
-
// }
|
|
8388
|
-
// },
|
|
8389
|
-
// };
|
|
8377
|
+
const onReloadScript = `
|
|
8378
|
+
// const scope = event.context.scoped;
|
|
8379
|
+
// var listView = scope.parent.getComponents().find(function(n){
|
|
8380
|
+
// return n.props.type === "crud";
|
|
8381
|
+
// });
|
|
8382
|
+
// listView.handleChangePage(1);
|
|
8390
8383
|
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8384
|
+
|
|
8385
|
+
// 触发搜索,而不是reload,因为快速搜索输入框失去焦点已经会触发搜索了,这里用reload的话,会有bug
|
|
8386
|
+
// 不加setTimeout的话,快速搜索输入框失去焦点再触发此脚本还是有问题
|
|
8387
|
+
setTimeout(function(){
|
|
8388
|
+
const scope = event.context.scoped;
|
|
8389
|
+
const sb = SteedosUI.getClosestAmisComponentByType(scope, "search-box");
|
|
8390
|
+
sb.handleSearch();
|
|
8391
|
+
}, 500);
|
|
8392
|
+
`;
|
|
8393
|
+
toolbarReloadButton = {
|
|
8394
|
+
// "type": "reload",//不可以直接使用reload,因为它不会设置页码到第一页,这在加载更多按钮的翻页模式下会有问题
|
|
8395
|
+
"type": "button",
|
|
8396
|
+
"align": "right",
|
|
8397
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8398
|
+
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
8399
|
+
"tooltipPlacement": "top",
|
|
8400
|
+
"className": "bg-white p-2 rounded text-gray-500",
|
|
8401
|
+
"label": "",
|
|
8402
|
+
"icon": "fa fa-sync",
|
|
8403
|
+
// "visibleOn": "${!showFieldsFilter}",
|
|
8404
|
+
"onEvent": {
|
|
8405
|
+
"click": {
|
|
8406
|
+
"actions": [
|
|
8407
|
+
{
|
|
8408
|
+
"actionType": "custom",
|
|
8409
|
+
"script": onReloadScript
|
|
8410
|
+
}
|
|
8411
|
+
]
|
|
8412
|
+
}
|
|
8413
|
+
},
|
|
8414
|
+
};
|
|
8415
|
+
// if(formFactor === 'SMALL'){
|
|
8416
|
+
// // 后续如果换成加载更多按钮的翻页模式的话,不可以直接使用下面的reload,需要换成上面的自定义脚本模式
|
|
8417
|
+
// toolbarReloadButton = {
|
|
8418
|
+
// "type": "reload",
|
|
8419
|
+
// "align": "right",
|
|
8420
|
+
// //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8421
|
+
// // "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
8422
|
+
// "tooltip":"",
|
|
8423
|
+
// "tooltipPlacement": "top",
|
|
8424
|
+
// "className": "bg-white p-2 rounded text-gray-500"
|
|
8425
|
+
// };
|
|
8426
|
+
// }
|
|
8427
|
+
// else{
|
|
8428
|
+
// toolbarReloadButton = {
|
|
8429
|
+
// "type": "reload",
|
|
8430
|
+
// "align": "right",
|
|
8431
|
+
// //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8432
|
+
// // "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
8433
|
+
// "tooltip":"",
|
|
8434
|
+
// "tooltipPlacement": "top",
|
|
8435
|
+
// "className": "bg-white p-2 rounded text-gray-500"
|
|
8436
|
+
// };
|
|
8437
|
+
// }
|
|
8413
8438
|
let toolbarFilter;
|
|
8414
8439
|
if(filterVisible){
|
|
8415
8440
|
toolbarFilter ={
|
|
@@ -11248,6 +11273,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
11248
11273
|
}
|
|
11249
11274
|
}
|
|
11250
11275
|
|
|
11276
|
+
// amis@3.6.3和6.3.0如果不配置 trackExpression监听当前字段值变化,那么当前lookup字段(比如T)作为其它lookup字段(比如F)autoFill自动填充的目标字段的话,
|
|
11277
|
+
// F字段值变更后,虽然会自动填充值到T字段中,但是并不会触发T字段的source接口重新请求,这会造成T字段被填充后,可能会显示为字段id而不是label了,见issue:https://github.com/steedos/steedos-platform/issues/6601
|
|
11278
|
+
// amis@6.2.2不需要配置trackExpression不会有#6601所示问题,但是更高版本6.3.0也会有,所以这里只能加上trackExpression避开相关bug。
|
|
11279
|
+
source.trackExpression = `\${${field.name}}`;
|
|
11280
|
+
|
|
11251
11281
|
source.data.$term = "$term";
|
|
11252
11282
|
source.data.$self = "$$";
|
|
11253
11283
|
|
|
@@ -12136,8 +12166,8 @@ if(typeof window != 'undefined'){
|
|
|
12136
12166
|
/*
|
|
12137
12167
|
* @Author: baozhoutao@steedos.com
|
|
12138
12168
|
* @Date: 2023-01-13 17:27:54
|
|
12139
|
-
* @LastEditors:
|
|
12140
|
-
* @LastEditTime: 2024-
|
|
12169
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
12170
|
+
* @LastEditTime: 2024-04-11 14:14:43
|
|
12141
12171
|
* @Description:
|
|
12142
12172
|
*/
|
|
12143
12173
|
|
|
@@ -12213,12 +12243,12 @@ const getHtmlFieldSchema = (field, readonly, ctx)=>{
|
|
|
12213
12243
|
"receiver": "${context.rootUrl}/s3/images",
|
|
12214
12244
|
"name": field.name,
|
|
12215
12245
|
"options": {
|
|
12216
|
-
"menu": {
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
},
|
|
12246
|
+
// "menu": {
|
|
12247
|
+
// "insert": {
|
|
12248
|
+
// "title": "Insert",
|
|
12249
|
+
// "items": "image link media addcomment pageembed codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents | insertdatetime"
|
|
12250
|
+
// }
|
|
12251
|
+
// },
|
|
12222
12252
|
"plugins": [
|
|
12223
12253
|
"autoresize"
|
|
12224
12254
|
],
|
|
@@ -12234,13 +12264,14 @@ const getHtmlFieldSchema = (field, readonly, ctx)=>{
|
|
|
12234
12264
|
"type": "input-rich-text",
|
|
12235
12265
|
"receiver": "${context.rootUrl}/s3/images",
|
|
12236
12266
|
"options":{
|
|
12237
|
-
"menu": {
|
|
12238
|
-
|
|
12239
|
-
|
|
12240
|
-
|
|
12241
|
-
|
|
12242
|
-
},
|
|
12243
|
-
"statusbar": false
|
|
12267
|
+
// "menu": {
|
|
12268
|
+
// "insert": {
|
|
12269
|
+
// "title": "Insert",
|
|
12270
|
+
// "items": "image link media addcomment pageembed codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents | insertdatetime"
|
|
12271
|
+
// }
|
|
12272
|
+
// },
|
|
12273
|
+
"statusbar": false,
|
|
12274
|
+
"menubar": false
|
|
12244
12275
|
},
|
|
12245
12276
|
"name": field.name
|
|
12246
12277
|
}
|
|
@@ -12436,7 +12467,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
12436
12467
|
if(_$1.includes(OMIT_FIELDS, field.name) && ctx.showSystemFields != true){
|
|
12437
12468
|
return;
|
|
12438
12469
|
}
|
|
12439
|
-
const baseData = {name: ctx.fieldNamePrefix ? `${ctx.fieldNamePrefix}${field.name}` : field.name, label: field.label, labelRemark: field.inlineHelpText, required: _$1.has(ctx, 'required') ? ctx.required : field.required};
|
|
12470
|
+
const baseData = {name: ctx.fieldNamePrefix ? `${ctx.fieldNamePrefix}${field.name}` : field.name, label: field.label, labelRemark: field.inlineHelpText, description: field.description, required: _$1.has(ctx, 'required') ? ctx.required : field.required};
|
|
12440
12471
|
let convertData = {
|
|
12441
12472
|
};
|
|
12442
12473
|
// if(_.includes(OMIT_FIELDS, field.name)){
|