@steedos-widgets/sortable 1.3.22-beta.2 → 1.3.22-beta.4
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 +75 -10
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +75 -10
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +75 -10
- 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@1.3.22-beta.
|
|
7
|
-
"https://unpkg.com/@steedos-widgets/sortable@1.3.22-beta.
|
|
6
|
+
"https://unpkg.com/@steedos-widgets/sortable@1.3.22-beta.4/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@1.3.22-beta.4/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@1.3.22-beta.
|
|
18
|
+
"url": "https://unpkg.com/@steedos-widgets/sortable@1.3.22-beta.4/dist/meta.js",
|
|
19
19
|
"urls": {
|
|
20
|
-
"default": "https://unpkg.com/@steedos-widgets/sortable@1.3.22-beta.
|
|
21
|
-
"design": "https://unpkg.com/@steedos-widgets/sortable@1.3.22-beta.
|
|
20
|
+
"default": "https://unpkg.com/@steedos-widgets/sortable@1.3.22-beta.4/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@1.3.22-beta.4/dist/meta.js"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
]
|
package/dist/sortable.cjs.js
CHANGED
|
@@ -54969,6 +54969,7 @@ async function getQuickEditSchema(field, options){
|
|
|
54969
54969
|
{
|
|
54970
54970
|
"actionType": "custom",
|
|
54971
54971
|
"script": `
|
|
54972
|
+
|
|
54972
54973
|
var _display = _.cloneDeep(event.data._display);
|
|
54973
54974
|
${displayField}
|
|
54974
54975
|
doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"});
|
|
@@ -55355,7 +55356,9 @@ async function getTableColumns(fields, options){
|
|
|
55355
55356
|
if(!options.isLookup && !options.isInputTable){
|
|
55356
55357
|
//将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
55357
55358
|
columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
|
|
55358
|
-
|
|
55359
|
+
if(!options.enable_tree){
|
|
55360
|
+
columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
|
|
55361
|
+
}
|
|
55359
55362
|
}
|
|
55360
55363
|
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
55361
55364
|
|
|
@@ -56416,6 +56419,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56416
56419
|
`;
|
|
56417
56420
|
const onCancelScript = `
|
|
56418
56421
|
// console.log("===onCancelScript=form==");
|
|
56422
|
+
let isLookup = event.data.isLookup;
|
|
56423
|
+
let __lookupField = event.data.__lookupField;
|
|
56419
56424
|
const scope = event.context.scoped;
|
|
56420
56425
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
56421
56426
|
return n.props.type === "form";
|
|
@@ -56463,7 +56468,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56463
56468
|
// });
|
|
56464
56469
|
|
|
56465
56470
|
// 清除__changedFilterFormValues中的值
|
|
56466
|
-
crud && crud.setData({__changedFilterFormValues: {}});
|
|
56471
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
56472
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
56473
|
+
if(isLookup && __lookupField){
|
|
56474
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
56475
|
+
if(__lookupField.reference_to_field){
|
|
56476
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
56477
|
+
}
|
|
56478
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
56479
|
+
}
|
|
56480
|
+
if(crud){
|
|
56481
|
+
let crudData = crud.getData();
|
|
56482
|
+
crudData[__changedFilterFormValuesKey] = {};
|
|
56483
|
+
crud.setData(crudData);
|
|
56484
|
+
}
|
|
56467
56485
|
filterForm.handleFormSubmit(event);
|
|
56468
56486
|
// crud.handleFilterSubmit(removedValues);
|
|
56469
56487
|
|
|
@@ -57930,7 +57948,12 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57930
57948
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
57931
57949
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57932
57950
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
57933
|
-
crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57951
|
+
// crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57952
|
+
if(crud){
|
|
57953
|
+
let crudData = crud.getData();
|
|
57954
|
+
crudData.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
57955
|
+
crud.setData(crudData);
|
|
57956
|
+
}
|
|
57934
57957
|
`;
|
|
57935
57958
|
|
|
57936
57959
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -57943,9 +57966,19 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57943
57966
|
// const scope = event.context.scoped;
|
|
57944
57967
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
57945
57968
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
57969
|
+
let isLookup = event.data.isLookup;
|
|
57970
|
+
let __lookupField = event.data.__lookupField;
|
|
57971
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
57972
|
+
if(isLookup && __lookupField){
|
|
57973
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
57974
|
+
if(__lookupField.reference_to_field){
|
|
57975
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
57976
|
+
}
|
|
57977
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
57978
|
+
}
|
|
57946
57979
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
57947
57980
|
setTimeout(function(){
|
|
57948
|
-
filterForm.setValues(event.data
|
|
57981
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
57949
57982
|
}, 500);
|
|
57950
57983
|
`;
|
|
57951
57984
|
|
|
@@ -57966,8 +57999,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57966
57999
|
"name": keywordsSearchBoxName,
|
|
57967
58000
|
"placeholder": "搜索此列表",
|
|
57968
58001
|
"value": crudKeywords,
|
|
57969
|
-
"clearable": true
|
|
57970
|
-
|
|
58002
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
58003
|
+
"clearAndSubmit": true,
|
|
57971
58004
|
"searchImediately": false,
|
|
57972
58005
|
"onEvent": {
|
|
57973
58006
|
"search": {
|
|
@@ -58247,6 +58280,9 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58247
58280
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
58248
58281
|
`;
|
|
58249
58282
|
let onChangeScript = `
|
|
58283
|
+
let isLookup = event.data.isLookup;
|
|
58284
|
+
let __lookupField = event.data.__lookupField;
|
|
58285
|
+
console.log("==onChangeScript=isLookup===", isLookup);
|
|
58250
58286
|
const scope = event.context.scoped;
|
|
58251
58287
|
// let filterFormValues = event.data;
|
|
58252
58288
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -58258,7 +58294,20 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58258
58294
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
58259
58295
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58260
58296
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
58261
|
-
crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58297
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58298
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
58299
|
+
if(isLookup && __lookupField){
|
|
58300
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
58301
|
+
if(__lookupField.reference_to_field){
|
|
58302
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
58303
|
+
}
|
|
58304
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
58305
|
+
}
|
|
58306
|
+
if(crud){
|
|
58307
|
+
let crudData = crud.getData();
|
|
58308
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
58309
|
+
crud.setData(crudData);
|
|
58310
|
+
}
|
|
58262
58311
|
`;
|
|
58263
58312
|
return {
|
|
58264
58313
|
"title": "",
|
|
@@ -59073,13 +59122,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59073
59122
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
59074
59123
|
|
|
59075
59124
|
source.requestAdaptor = `
|
|
59076
|
-
let
|
|
59125
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
59126
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
59127
|
+
if(__lookupField){
|
|
59128
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
59129
|
+
if(__lookupField.reference_to_field){
|
|
59130
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
59131
|
+
}
|
|
59132
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
59133
|
+
}
|
|
59134
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
59077
59135
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
59078
59136
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
59079
59137
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
59080
59138
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
59081
59139
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
59082
|
-
|
|
59140
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
59141
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59142
|
+
}
|
|
59083
59143
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59084
59144
|
var filters = [];
|
|
59085
59145
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -59283,7 +59343,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59283
59343
|
"objectName": refObjectConfig.name,
|
|
59284
59344
|
"uiSchema": refObjectConfig,
|
|
59285
59345
|
"listName": listName,// 需要按视图取可搜索项
|
|
59286
|
-
"isLookup": true
|
|
59346
|
+
"isLookup": true,
|
|
59347
|
+
"__lookupField": {
|
|
59348
|
+
"name": field.name,
|
|
59349
|
+
"reference_to": refObjectConfig.name,
|
|
59350
|
+
"reference_to_field": field.reference_to_field
|
|
59351
|
+
}
|
|
59287
59352
|
});
|
|
59288
59353
|
|
|
59289
59354
|
if(!pickerSchema.onEvent){
|