@steedos-widgets/sortable 3.6.0-beta.4 → 3.6.0-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/assets.json +5 -5
- package/dist/sortable.cjs.js +146 -20
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +146 -20
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +146 -20
- 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.6/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.6/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.6/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.6/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.6/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 = "__lookup__" + __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 = "__lookup__" + __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,18 +58298,34 @@ 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;
|
|
58267
58303
|
const scope = event.context.scoped;
|
|
58268
58304
|
// let filterFormValues = event.data;
|
|
58269
58305
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
58270
58306
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
58271
58307
|
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
|
|
58272
58308
|
let filterFormValues = filterFormService.getData();
|
|
58309
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
58273
58310
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
58274
58311
|
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});;
|
|
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 = "__lookup__" + __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": "",
|
|
@@ -58878,6 +58928,58 @@ function getReferenceToSync(field) {
|
|
|
58878
58928
|
}
|
|
58879
58929
|
|
|
58880
58930
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
58931
|
+
let apiAdaptor = `
|
|
58932
|
+
// console.log("===getLookupSapceUserTreeSchema===", JSON.stringify(payload));
|
|
58933
|
+
const records = payload.data.options;
|
|
58934
|
+
let isTreeOptionsComputed = false;
|
|
58935
|
+
if(records.length === 1 && records[0].children){
|
|
58936
|
+
isTreeOptionsComputed = true;
|
|
58937
|
+
}
|
|
58938
|
+
if(isTreeOptionsComputed){
|
|
58939
|
+
return payload;
|
|
58940
|
+
}
|
|
58941
|
+
const treeRecords = [];
|
|
58942
|
+
const getChildren = (records, childrenIds) => {
|
|
58943
|
+
if (!childrenIds) {
|
|
58944
|
+
return;
|
|
58945
|
+
}
|
|
58946
|
+
const children = _.filter(records, (record) => {
|
|
58947
|
+
return _.includes(childrenIds, record.value)
|
|
58948
|
+
});
|
|
58949
|
+
_.each(children, (item) => {
|
|
58950
|
+
if (item.children) {
|
|
58951
|
+
item.children = getChildren(records, item.children)
|
|
58952
|
+
}
|
|
58953
|
+
})
|
|
58954
|
+
return children;
|
|
58955
|
+
}
|
|
58956
|
+
|
|
58957
|
+
const getRoot = (records) => {
|
|
58958
|
+
for (var i = 0; i < records.length; i++) {
|
|
58959
|
+
records[i].noParent = 0;
|
|
58960
|
+
if (!!records[i].parent) {
|
|
58961
|
+
biaozhi = 1
|
|
58962
|
+
for (var j = 0; j < records.length; j++) {
|
|
58963
|
+
if (records[i].parent == records[j].value)
|
|
58964
|
+
biaozhi = 0;
|
|
58965
|
+
}
|
|
58966
|
+
if (biaozhi == 1) records[i].noParent = 1;
|
|
58967
|
+
} else records[i].noParent = 1;
|
|
58968
|
+
}
|
|
58969
|
+
}
|
|
58970
|
+
getRoot(records);
|
|
58971
|
+
console.log(records)
|
|
58972
|
+
|
|
58973
|
+
_.each(records, (record) => {
|
|
58974
|
+
if (record.noParent == 1) {
|
|
58975
|
+
treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));
|
|
58976
|
+
}
|
|
58977
|
+
});
|
|
58978
|
+
console.log(treeRecords)
|
|
58979
|
+
|
|
58980
|
+
payload.data.options = treeRecords;
|
|
58981
|
+
return payload;
|
|
58982
|
+
`;
|
|
58881
58983
|
const treeSchema = {
|
|
58882
58984
|
"type": "input-tree",
|
|
58883
58985
|
"className":"steedos-select-user-tree",
|
|
@@ -58888,8 +58990,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
58888
58990
|
"headers": {
|
|
58889
58991
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
58890
58992
|
},
|
|
58891
|
-
"adaptor":
|
|
58892
|
-
"requestAdaptor": "\n ",
|
|
58993
|
+
"adaptor": apiAdaptor,
|
|
58893
58994
|
"data": {
|
|
58894
58995
|
"query": "{options:organizations(filters:[\"hidden\", \"!=\", true],sort:\"sort_no desc\"){value:_id label:name,parent,children}}"
|
|
58895
58996
|
},
|
|
@@ -59090,13 +59191,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59090
59191
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
59091
59192
|
|
|
59092
59193
|
source.requestAdaptor = `
|
|
59093
|
-
let
|
|
59194
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
59195
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
59196
|
+
if(__lookupField){
|
|
59197
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
59198
|
+
if(__lookupField.reference_to_field){
|
|
59199
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
59200
|
+
}
|
|
59201
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
59202
|
+
}
|
|
59203
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
59094
59204
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
59095
59205
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
59096
59206
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
59097
59207
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
59098
59208
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
59099
|
-
|
|
59209
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
59210
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59211
|
+
}
|
|
59100
59212
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59101
59213
|
var filters = [];
|
|
59102
59214
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -59303,7 +59415,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59303
59415
|
"objectName": refObjectConfig.name,
|
|
59304
59416
|
"uiSchema": refObjectConfig,
|
|
59305
59417
|
"listName": listName,// 需要按视图取可搜索项
|
|
59306
|
-
"isLookup": true
|
|
59418
|
+
"isLookup": true,
|
|
59419
|
+
"__lookupField": {
|
|
59420
|
+
"name": field.name,
|
|
59421
|
+
"reference_to": refObjectConfig.name,
|
|
59422
|
+
"reference_to_field": field.reference_to_field
|
|
59423
|
+
}
|
|
59307
59424
|
});
|
|
59308
59425
|
|
|
59309
59426
|
if(!pickerSchema.onEvent){
|
|
@@ -59672,6 +59789,15 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
59672
59789
|
|
|
59673
59790
|
// 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
|
|
59674
59791
|
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
59792
|
+
let amisVersion = getComparableAmisVersion();
|
|
59793
|
+
if(amisVersion >= 3.6){
|
|
59794
|
+
// amis 3.6.3单选和多选的树picker都有bug(https://github.com/baidu/amis/issues/9279,https://github.com/baidu/amis/issues/9295),我们改amis源码修正了
|
|
59795
|
+
// amis 3.6.3多选的下拉树组件有bug,多选树字段的选中值在编辑模式展开树时不会自动勾选树里面的节点,而是始终勾选显示在最外面的选中值选项(即defaultValueOptions),amis 3.2没有这个问题
|
|
59796
|
+
// 这里强制禁用多选下拉树,统一改为弹出树,如果以后需要下拉树功能,可以把下拉树组件改为一次性加载所有树节点数据模式来跳过这个问题
|
|
59797
|
+
if(!enableEnhancedLookup && refObject.enable_tree && field.multiple){
|
|
59798
|
+
enableEnhancedLookup = true;
|
|
59799
|
+
}
|
|
59800
|
+
}
|
|
59675
59801
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
59676
59802
|
if(enableEnhancedLookup == true){
|
|
59677
59803
|
return await lookupToAmisPicker(field, readonly, ctx);
|