@steedos-widgets/sortable 3.6.0-beta.4 → 3.6.0-beta.5
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/assets.json +5 -5
- package/dist/sortable.cjs.js +92 -18
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +92 -18
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +92 -18
- package/package.json +3 -3
package/dist/assets.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
{
|
|
4
4
|
"package": "@steedos-widgets/sortable",
|
|
5
5
|
"urls": [
|
|
6
|
-
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
7
|
-
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
6
|
+
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.5/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.5/dist/sortable.umd.css"
|
|
8
8
|
],
|
|
9
9
|
"library": "BuilderSortable"
|
|
10
10
|
}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"npm": {
|
|
16
16
|
"package": "@steedos-widgets/sortable"
|
|
17
17
|
},
|
|
18
|
-
"url": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
18
|
+
"url": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.5/dist/meta.js",
|
|
19
19
|
"urls": {
|
|
20
|
-
"default": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
21
|
-
"design": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
20
|
+
"default": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.5/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.5/dist/meta.js"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
]
|
package/dist/sortable.cjs.js
CHANGED
|
@@ -54120,7 +54120,7 @@ function getNameTpl(field, ctx){
|
|
|
54120
54120
|
if(ctx && ctx.isLookup){
|
|
54121
54121
|
linkTarget = "target='_blank'";
|
|
54122
54122
|
}
|
|
54123
|
-
return `<a href="${href}" ${linkTarget}>\${${field.name}}</a>`
|
|
54123
|
+
return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
|
|
54124
54124
|
}
|
|
54125
54125
|
|
|
54126
54126
|
function getRelatedFieldTpl(field, ctx){
|
|
@@ -54445,7 +54445,7 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
54445
54445
|
* @Author: baozhoutao@steedos.com
|
|
54446
54446
|
* @Date: 2022-10-28 14:15:09
|
|
54447
54447
|
* @LastEditors: liaodaxue
|
|
54448
|
-
* @LastEditTime: 2023-
|
|
54448
|
+
* @LastEditTime: 2023-12-29 10:46:50
|
|
54449
54449
|
* @Description:
|
|
54450
54450
|
*/
|
|
54451
54451
|
|
|
@@ -54499,7 +54499,8 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
54499
54499
|
dataType: "form-data",
|
|
54500
54500
|
url: `\${context.rootUrl}/s3/${tableName}`,
|
|
54501
54501
|
requestAdaptor: `
|
|
54502
|
-
const
|
|
54502
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
54503
|
+
const { _master, global } = superData;
|
|
54503
54504
|
// const { recordId, objectName } = _master;
|
|
54504
54505
|
const { spaceId, userId, user } = global;
|
|
54505
54506
|
/*
|
|
@@ -54517,8 +54518,9 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
54517
54518
|
return api;
|
|
54518
54519
|
`,
|
|
54519
54520
|
adaptor: `
|
|
54520
|
-
const
|
|
54521
|
-
|
|
54521
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
54522
|
+
const { context:pageContext } = superData;
|
|
54523
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${tableName}/";
|
|
54522
54524
|
payload = {
|
|
54523
54525
|
status: response.status == 200 ? 0 : response.status,
|
|
54524
54526
|
msg: response.statusText,
|
|
@@ -55122,8 +55124,9 @@ async function getQuickEditSchema(field, options){
|
|
|
55122
55124
|
case "avatar":
|
|
55123
55125
|
case "image":
|
|
55124
55126
|
quickEditSchema.body[0].receiver.adaptor = `
|
|
55125
|
-
const
|
|
55126
|
-
|
|
55127
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
55128
|
+
const { context:pageContext } = superData;
|
|
55129
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${field.type}s/";
|
|
55127
55130
|
payload = {
|
|
55128
55131
|
status: response.status == 200 ? 0 : response.status,
|
|
55129
55132
|
msg: response.statusText,
|
|
@@ -55786,7 +55789,7 @@ async function getTableOperation(ctx){
|
|
|
55786
55789
|
type: 'steedos-object-button',
|
|
55787
55790
|
name: button.name,
|
|
55788
55791
|
objectName: button.objectName,
|
|
55789
|
-
|
|
55792
|
+
visibleOnAlias: getButtonVisibleOn$1(button),
|
|
55790
55793
|
className: 'antd-Button--default'
|
|
55791
55794
|
});
|
|
55792
55795
|
});
|
|
@@ -55911,7 +55914,8 @@ async function getTableSchema$1(fields, options){
|
|
|
55911
55914
|
}
|
|
55912
55915
|
|
|
55913
55916
|
if(!isLookup && !hiddenColumnOperation){
|
|
55914
|
-
|
|
55917
|
+
const toolbarOperation = await getTableOperation(options);
|
|
55918
|
+
columns.push(toolbarOperation);
|
|
55915
55919
|
}
|
|
55916
55920
|
|
|
55917
55921
|
}
|
|
@@ -56433,6 +56437,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56433
56437
|
`;
|
|
56434
56438
|
const onCancelScript = `
|
|
56435
56439
|
// console.log("===onCancelScript=form==");
|
|
56440
|
+
let isLookup = event.data.isLookup;
|
|
56441
|
+
let __lookupField = event.data.__lookupField;
|
|
56436
56442
|
const scope = event.context.scoped;
|
|
56437
56443
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
56438
56444
|
return n.props.type === "form";
|
|
@@ -56480,7 +56486,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56480
56486
|
// });
|
|
56481
56487
|
|
|
56482
56488
|
// 清除__changedFilterFormValues中的值
|
|
56483
|
-
crud && crud.setData({__changedFilterFormValues: {}});
|
|
56489
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
56490
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
56491
|
+
if(isLookup && __lookupField){
|
|
56492
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
56493
|
+
if(__lookupField.reference_to_field){
|
|
56494
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
56495
|
+
}
|
|
56496
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
56497
|
+
}
|
|
56498
|
+
if(crud){
|
|
56499
|
+
let crudData = crud.getData();
|
|
56500
|
+
crudData[__changedFilterFormValuesKey] = {};
|
|
56501
|
+
crud.setData(crudData);
|
|
56502
|
+
}
|
|
56484
56503
|
filterForm.handleFormSubmit(event);
|
|
56485
56504
|
// crud.handleFilterSubmit(removedValues);
|
|
56486
56505
|
|
|
@@ -57947,7 +57966,12 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57947
57966
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
57948
57967
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57949
57968
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
57950
|
-
crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57969
|
+
// crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57970
|
+
if(crud){
|
|
57971
|
+
let crudData = crud.getData();
|
|
57972
|
+
crudData.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
57973
|
+
crud.setData(crudData);
|
|
57974
|
+
}
|
|
57951
57975
|
`;
|
|
57952
57976
|
|
|
57953
57977
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -57960,9 +57984,19 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57960
57984
|
// const scope = event.context.scoped;
|
|
57961
57985
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
57962
57986
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
57987
|
+
let isLookup = event.data.isLookup;
|
|
57988
|
+
let __lookupField = event.data.__lookupField;
|
|
57989
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
57990
|
+
if(isLookup && __lookupField){
|
|
57991
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
57992
|
+
if(__lookupField.reference_to_field){
|
|
57993
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
57994
|
+
}
|
|
57995
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
57996
|
+
}
|
|
57963
57997
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
57964
57998
|
setTimeout(function(){
|
|
57965
|
-
filterForm.setValues(event.data
|
|
57999
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
57966
58000
|
}, 500);
|
|
57967
58001
|
`;
|
|
57968
58002
|
|
|
@@ -57983,8 +58017,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57983
58017
|
"name": keywordsSearchBoxName,
|
|
57984
58018
|
"placeholder": "搜索此列表",
|
|
57985
58019
|
"value": crudKeywords,
|
|
57986
|
-
"clearable": true
|
|
57987
|
-
|
|
58020
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
58021
|
+
"clearAndSubmit": true,
|
|
57988
58022
|
"searchImediately": false,
|
|
57989
58023
|
"onEvent": {
|
|
57990
58024
|
"search": {
|
|
@@ -58264,6 +58298,9 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58264
58298
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
58265
58299
|
`;
|
|
58266
58300
|
let onChangeScript = `
|
|
58301
|
+
let isLookup = event.data.isLookup;
|
|
58302
|
+
let __lookupField = event.data.__lookupField;
|
|
58303
|
+
console.log("==onChangeScript=isLookup===", isLookup);
|
|
58267
58304
|
const scope = event.context.scoped;
|
|
58268
58305
|
// let filterFormValues = event.data;
|
|
58269
58306
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -58275,7 +58312,20 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58275
58312
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
58276
58313
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58277
58314
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
58278
|
-
crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58315
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58316
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
58317
|
+
if(isLookup && __lookupField){
|
|
58318
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
58319
|
+
if(__lookupField.reference_to_field){
|
|
58320
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
58321
|
+
}
|
|
58322
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
58323
|
+
}
|
|
58324
|
+
if(crud){
|
|
58325
|
+
let crudData = crud.getData();
|
|
58326
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
58327
|
+
crud.setData(crudData);
|
|
58328
|
+
}
|
|
58279
58329
|
`;
|
|
58280
58330
|
return {
|
|
58281
58331
|
"title": "",
|
|
@@ -59090,13 +59140,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59090
59140
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
59091
59141
|
|
|
59092
59142
|
source.requestAdaptor = `
|
|
59093
|
-
let
|
|
59143
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
59144
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
59145
|
+
if(__lookupField){
|
|
59146
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
59147
|
+
if(__lookupField.reference_to_field){
|
|
59148
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
59149
|
+
}
|
|
59150
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
59151
|
+
}
|
|
59152
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
59094
59153
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
59095
59154
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
59096
59155
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
59097
59156
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
59098
59157
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
59099
|
-
|
|
59158
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
59159
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59160
|
+
}
|
|
59100
59161
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59101
59162
|
var filters = [];
|
|
59102
59163
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -59303,7 +59364,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59303
59364
|
"objectName": refObjectConfig.name,
|
|
59304
59365
|
"uiSchema": refObjectConfig,
|
|
59305
59366
|
"listName": listName,// 需要按视图取可搜索项
|
|
59306
|
-
"isLookup": true
|
|
59367
|
+
"isLookup": true,
|
|
59368
|
+
"__lookupField": {
|
|
59369
|
+
"name": field.name,
|
|
59370
|
+
"reference_to": refObjectConfig.name,
|
|
59371
|
+
"reference_to_field": field.reference_to_field
|
|
59372
|
+
}
|
|
59307
59373
|
});
|
|
59308
59374
|
|
|
59309
59375
|
if(!pickerSchema.onEvent){
|
|
@@ -59672,6 +59738,14 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
59672
59738
|
|
|
59673
59739
|
// 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
|
|
59674
59740
|
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
59741
|
+
let amisVersion = getComparableAmisVersion();
|
|
59742
|
+
if(amisVersion >= 3.6){
|
|
59743
|
+
// amis 3.6.3单选的树picker有严重bug(https://github.com/baidu/amis/issues/9279),先强制使用下拉方式显示
|
|
59744
|
+
// amis 3.6.3多选的树会自动把下层节点,及下下层等所有子节点自动选中,跟amis 3.2不一样,而且目前没有开关,这不适合目前的业务场景,也先强制使用下拉方式显示
|
|
59745
|
+
if(enableEnhancedLookup && refObject.enable_tree){
|
|
59746
|
+
enableEnhancedLookup = false;
|
|
59747
|
+
}
|
|
59748
|
+
}
|
|
59675
59749
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
59676
59750
|
if(enableEnhancedLookup == true){
|
|
59677
59751
|
return await lookupToAmisPicker(field, readonly, ctx);
|