@steedos-widgets/sortable 3.6.0-beta.3 → 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 +121 -25
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +121 -25
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +121 -25
- package/package.json +3 -3
package/dist/sortable.esm.js
CHANGED
|
@@ -53975,8 +53975,8 @@ const Router = {
|
|
|
53975
53975
|
/*
|
|
53976
53976
|
* @Author: baozhoutao@steedos.com
|
|
53977
53977
|
* @Date: 2022-07-20 16:29:22
|
|
53978
|
-
* @LastEditors:
|
|
53979
|
-
* @LastEditTime: 2023-
|
|
53978
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
53979
|
+
* @LastEditTime: 2023-12-28 14:59:08
|
|
53980
53980
|
* @Description:
|
|
53981
53981
|
*/
|
|
53982
53982
|
|
|
@@ -54033,6 +54033,21 @@ function getLookupListView(refObjectConfig) {
|
|
|
54033
54033
|
return listView;
|
|
54034
54034
|
}
|
|
54035
54035
|
|
|
54036
|
+
|
|
54037
|
+
/**
|
|
54038
|
+
* 获取可比较的amis版本号
|
|
54039
|
+
* @returns 只返回前两位版本,第三位忽略,比如3.6.3返回3.6
|
|
54040
|
+
*/
|
|
54041
|
+
function getComparableAmisVersion() {
|
|
54042
|
+
let amis = (window.amisRequire && window.amisRequire('amis')) || window.Amis;
|
|
54043
|
+
let amisVersion = amis && amis.version;
|
|
54044
|
+
if(amisVersion){
|
|
54045
|
+
let comparableVersions = amisVersion.split(".");
|
|
54046
|
+
let comparableVersion = parseFloat(comparableVersions[0].toString() + "." + comparableVersions[1].toString());
|
|
54047
|
+
return comparableVersion;
|
|
54048
|
+
}
|
|
54049
|
+
}
|
|
54050
|
+
|
|
54036
54051
|
function getNumberTpl(field){
|
|
54037
54052
|
return `<span>\${_display.${field.name}}</span>`
|
|
54038
54053
|
}
|
|
@@ -54101,7 +54116,7 @@ function getNameTpl(field, ctx){
|
|
|
54101
54116
|
if(ctx && ctx.isLookup){
|
|
54102
54117
|
linkTarget = "target='_blank'";
|
|
54103
54118
|
}
|
|
54104
|
-
return `<a href="${href}" ${linkTarget}>\${${field.name}}</a>`
|
|
54119
|
+
return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
|
|
54105
54120
|
}
|
|
54106
54121
|
|
|
54107
54122
|
function getRelatedFieldTpl(field, ctx){
|
|
@@ -54426,7 +54441,7 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
54426
54441
|
* @Author: baozhoutao@steedos.com
|
|
54427
54442
|
* @Date: 2022-10-28 14:15:09
|
|
54428
54443
|
* @LastEditors: liaodaxue
|
|
54429
|
-
* @LastEditTime: 2023-
|
|
54444
|
+
* @LastEditTime: 2023-12-29 10:46:50
|
|
54430
54445
|
* @Description:
|
|
54431
54446
|
*/
|
|
54432
54447
|
|
|
@@ -54480,7 +54495,8 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
54480
54495
|
dataType: "form-data",
|
|
54481
54496
|
url: `\${context.rootUrl}/s3/${tableName}`,
|
|
54482
54497
|
requestAdaptor: `
|
|
54483
|
-
const
|
|
54498
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
54499
|
+
const { _master, global } = superData;
|
|
54484
54500
|
// const { recordId, objectName } = _master;
|
|
54485
54501
|
const { spaceId, userId, user } = global;
|
|
54486
54502
|
/*
|
|
@@ -54498,8 +54514,9 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
54498
54514
|
return api;
|
|
54499
54515
|
`,
|
|
54500
54516
|
adaptor: `
|
|
54501
|
-
const
|
|
54502
|
-
|
|
54517
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
54518
|
+
const { context:pageContext } = superData;
|
|
54519
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${tableName}/";
|
|
54503
54520
|
payload = {
|
|
54504
54521
|
status: response.status == 200 ? 0 : response.status,
|
|
54505
54522
|
msg: response.statusText,
|
|
@@ -55103,8 +55120,9 @@ async function getQuickEditSchema(field, options){
|
|
|
55103
55120
|
case "avatar":
|
|
55104
55121
|
case "image":
|
|
55105
55122
|
quickEditSchema.body[0].receiver.adaptor = `
|
|
55106
|
-
const
|
|
55107
|
-
|
|
55123
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
55124
|
+
const { context:pageContext } = superData;
|
|
55125
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${field.type}s/";
|
|
55108
55126
|
payload = {
|
|
55109
55127
|
status: response.status == 200 ? 0 : response.status,
|
|
55110
55128
|
msg: response.statusText,
|
|
@@ -55507,8 +55525,8 @@ async function getTableColumns(fields, options){
|
|
|
55507
55525
|
const href = Router.getObjectDetailPath({
|
|
55508
55526
|
...options, formFactor: options.formFactor, appId: "${appId}", objectName: options.objectName || "${objectName}", recordId: `\${${options.idFieldName}}`
|
|
55509
55527
|
});
|
|
55510
|
-
columns[
|
|
55511
|
-
columns[
|
|
55528
|
+
columns[0].type = "tpl";
|
|
55529
|
+
columns[0].tpl = `<a href="${href}">\${${columns[0].name}}</a>`;
|
|
55512
55530
|
}
|
|
55513
55531
|
return columns;
|
|
55514
55532
|
}
|
|
@@ -55767,7 +55785,7 @@ async function getTableOperation(ctx){
|
|
|
55767
55785
|
type: 'steedos-object-button',
|
|
55768
55786
|
name: button.name,
|
|
55769
55787
|
objectName: button.objectName,
|
|
55770
|
-
|
|
55788
|
+
visibleOnAlias: getButtonVisibleOn$1(button),
|
|
55771
55789
|
className: 'antd-Button--default'
|
|
55772
55790
|
});
|
|
55773
55791
|
});
|
|
@@ -55892,7 +55910,8 @@ async function getTableSchema$1(fields, options){
|
|
|
55892
55910
|
}
|
|
55893
55911
|
|
|
55894
55912
|
if(!isLookup && !hiddenColumnOperation){
|
|
55895
|
-
|
|
55913
|
+
const toolbarOperation = await getTableOperation(options);
|
|
55914
|
+
columns.push(toolbarOperation);
|
|
55896
55915
|
}
|
|
55897
55916
|
|
|
55898
55917
|
}
|
|
@@ -56414,6 +56433,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56414
56433
|
`;
|
|
56415
56434
|
const onCancelScript = `
|
|
56416
56435
|
// console.log("===onCancelScript=form==");
|
|
56436
|
+
let isLookup = event.data.isLookup;
|
|
56437
|
+
let __lookupField = event.data.__lookupField;
|
|
56417
56438
|
const scope = event.context.scoped;
|
|
56418
56439
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
56419
56440
|
return n.props.type === "form";
|
|
@@ -56461,7 +56482,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56461
56482
|
// });
|
|
56462
56483
|
|
|
56463
56484
|
// 清除__changedFilterFormValues中的值
|
|
56464
|
-
crud && crud.setData({__changedFilterFormValues: {}});
|
|
56485
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
56486
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
56487
|
+
if(isLookup && __lookupField){
|
|
56488
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
56489
|
+
if(__lookupField.reference_to_field){
|
|
56490
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
56491
|
+
}
|
|
56492
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
56493
|
+
}
|
|
56494
|
+
if(crud){
|
|
56495
|
+
let crudData = crud.getData();
|
|
56496
|
+
crudData[__changedFilterFormValuesKey] = {};
|
|
56497
|
+
crud.setData(crudData);
|
|
56498
|
+
}
|
|
56465
56499
|
filterForm.handleFormSubmit(event);
|
|
56466
56500
|
// crud.handleFilterSubmit(removedValues);
|
|
56467
56501
|
|
|
@@ -57928,7 +57962,12 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57928
57962
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
57929
57963
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57930
57964
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
57931
|
-
crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57965
|
+
// crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57966
|
+
if(crud){
|
|
57967
|
+
let crudData = crud.getData();
|
|
57968
|
+
crudData.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
57969
|
+
crud.setData(crudData);
|
|
57970
|
+
}
|
|
57932
57971
|
`;
|
|
57933
57972
|
|
|
57934
57973
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -57941,9 +57980,19 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57941
57980
|
// const scope = event.context.scoped;
|
|
57942
57981
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
57943
57982
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
57983
|
+
let isLookup = event.data.isLookup;
|
|
57984
|
+
let __lookupField = event.data.__lookupField;
|
|
57985
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
57986
|
+
if(isLookup && __lookupField){
|
|
57987
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
57988
|
+
if(__lookupField.reference_to_field){
|
|
57989
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
57990
|
+
}
|
|
57991
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
57992
|
+
}
|
|
57944
57993
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
57945
57994
|
setTimeout(function(){
|
|
57946
|
-
filterForm.setValues(event.data
|
|
57995
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
57947
57996
|
}, 500);
|
|
57948
57997
|
`;
|
|
57949
57998
|
|
|
@@ -57964,8 +58013,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57964
58013
|
"name": keywordsSearchBoxName,
|
|
57965
58014
|
"placeholder": "搜索此列表",
|
|
57966
58015
|
"value": crudKeywords,
|
|
57967
|
-
"clearable": true
|
|
57968
|
-
|
|
58016
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
58017
|
+
"clearAndSubmit": true,
|
|
57969
58018
|
"searchImediately": false,
|
|
57970
58019
|
"onEvent": {
|
|
57971
58020
|
"search": {
|
|
@@ -58245,6 +58294,9 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58245
58294
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
58246
58295
|
`;
|
|
58247
58296
|
let onChangeScript = `
|
|
58297
|
+
let isLookup = event.data.isLookup;
|
|
58298
|
+
let __lookupField = event.data.__lookupField;
|
|
58299
|
+
console.log("==onChangeScript=isLookup===", isLookup);
|
|
58248
58300
|
const scope = event.context.scoped;
|
|
58249
58301
|
// let filterFormValues = event.data;
|
|
58250
58302
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -58256,7 +58308,20 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58256
58308
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
58257
58309
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58258
58310
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
58259
|
-
crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58311
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58312
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
58313
|
+
if(isLookup && __lookupField){
|
|
58314
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
58315
|
+
if(__lookupField.reference_to_field){
|
|
58316
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
58317
|
+
}
|
|
58318
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
58319
|
+
}
|
|
58320
|
+
if(crud){
|
|
58321
|
+
let crudData = crud.getData();
|
|
58322
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
58323
|
+
crud.setData(crudData);
|
|
58324
|
+
}
|
|
58260
58325
|
`;
|
|
58261
58326
|
return {
|
|
58262
58327
|
"title": "",
|
|
@@ -59071,13 +59136,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59071
59136
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
59072
59137
|
|
|
59073
59138
|
source.requestAdaptor = `
|
|
59074
|
-
let
|
|
59139
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
59140
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
59141
|
+
if(__lookupField){
|
|
59142
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
59143
|
+
if(__lookupField.reference_to_field){
|
|
59144
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
59145
|
+
}
|
|
59146
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
59147
|
+
}
|
|
59148
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
59075
59149
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
59076
59150
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
59077
59151
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
59078
59152
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
59079
59153
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
59080
|
-
|
|
59154
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
59155
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59156
|
+
}
|
|
59081
59157
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59082
59158
|
var filters = [];
|
|
59083
59159
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -59284,7 +59360,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59284
59360
|
"objectName": refObjectConfig.name,
|
|
59285
59361
|
"uiSchema": refObjectConfig,
|
|
59286
59362
|
"listName": listName,// 需要按视图取可搜索项
|
|
59287
|
-
"isLookup": true
|
|
59363
|
+
"isLookup": true,
|
|
59364
|
+
"__lookupField": {
|
|
59365
|
+
"name": field.name,
|
|
59366
|
+
"reference_to": refObjectConfig.name,
|
|
59367
|
+
"reference_to_field": field.reference_to_field
|
|
59368
|
+
}
|
|
59288
59369
|
});
|
|
59289
59370
|
|
|
59290
59371
|
if(!pickerSchema.onEvent){
|
|
@@ -59457,7 +59538,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59457
59538
|
sendOn.push(`this.${fName}`);
|
|
59458
59539
|
});
|
|
59459
59540
|
if(depend_on.length > 0){
|
|
59460
|
-
apiInfo.url = `${apiInfo.url}
|
|
59541
|
+
apiInfo.url = `${apiInfo.url}&${depend_on.join('&')}`;
|
|
59461
59542
|
apiInfo.sendOn = `${sendOn.join(' && ')}`;
|
|
59462
59543
|
}
|
|
59463
59544
|
}
|
|
@@ -59565,6 +59646,13 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59565
59646
|
autoComplete: apiInfo,
|
|
59566
59647
|
searchable: true,
|
|
59567
59648
|
};
|
|
59649
|
+
let amisVersion = getComparableAmisVersion();
|
|
59650
|
+
if(amisVersion >= 3.6){
|
|
59651
|
+
// amis 3.6中不加source会造成子表组件中弹出行编辑窗口的lookup字段有时不请求接口(概率现象,同一个地方反复操作有时请求有时不请求)
|
|
59652
|
+
// 但是同时配置autoComplete和source会多请求一次接口
|
|
59653
|
+
// TODO:应该想办法把是否字段在子表组件内,即ctx.isInputTable,如果不在子表组件内不需要加source
|
|
59654
|
+
data.source = apiInfo;
|
|
59655
|
+
}
|
|
59568
59656
|
//删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
|
|
59569
59657
|
const select_menuTpl = `<span class='flex items-center mt-0.5'>
|
|
59570
59658
|
<span role='img' aria-label='smile' class='anticon anticon-smile'>
|
|
@@ -59646,6 +59734,14 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
59646
59734
|
|
|
59647
59735
|
// 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
|
|
59648
59736
|
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
59737
|
+
let amisVersion = getComparableAmisVersion();
|
|
59738
|
+
if(amisVersion >= 3.6){
|
|
59739
|
+
// amis 3.6.3单选的树picker有严重bug(https://github.com/baidu/amis/issues/9279),先强制使用下拉方式显示
|
|
59740
|
+
// amis 3.6.3多选的树会自动把下层节点,及下下层等所有子节点自动选中,跟amis 3.2不一样,而且目前没有开关,这不适合目前的业务场景,也先强制使用下拉方式显示
|
|
59741
|
+
if(enableEnhancedLookup && refObject.enable_tree){
|
|
59742
|
+
enableEnhancedLookup = false;
|
|
59743
|
+
}
|
|
59744
|
+
}
|
|
59649
59745
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
59650
59746
|
if(enableEnhancedLookup == true){
|
|
59651
59747
|
return await lookupToAmisPicker(field, readonly, ctx);
|
|
@@ -60527,9 +60623,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60527
60623
|
}
|
|
60528
60624
|
if(!lodash.exports.isEmpty(convertData)){
|
|
60529
60625
|
if(field.is_wide || convertData.type === 'group'){
|
|
60530
|
-
convertData.className = 'col-span-2 m-
|
|
60626
|
+
convertData.className = 'col-span-2 m-0';
|
|
60531
60627
|
}else {
|
|
60532
|
-
convertData.className = 'm-
|
|
60628
|
+
convertData.className = 'm-0';
|
|
60533
60629
|
}
|
|
60534
60630
|
if(readonly){
|
|
60535
60631
|
convertData.className = `${convertData.className} border-b`;
|