@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.umd.js
CHANGED
|
@@ -20280,8 +20280,8 @@
|
|
|
20280
20280
|
/*
|
|
20281
20281
|
* @Author: baozhoutao@steedos.com
|
|
20282
20282
|
* @Date: 2022-07-20 16:29:22
|
|
20283
|
-
* @LastEditors:
|
|
20284
|
-
* @LastEditTime: 2023-
|
|
20283
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
20284
|
+
* @LastEditTime: 2023-12-28 14:59:08
|
|
20285
20285
|
* @Description:
|
|
20286
20286
|
*/
|
|
20287
20287
|
|
|
@@ -20338,6 +20338,21 @@
|
|
|
20338
20338
|
return listView;
|
|
20339
20339
|
}
|
|
20340
20340
|
|
|
20341
|
+
|
|
20342
|
+
/**
|
|
20343
|
+
* 获取可比较的amis版本号
|
|
20344
|
+
* @returns 只返回前两位版本,第三位忽略,比如3.6.3返回3.6
|
|
20345
|
+
*/
|
|
20346
|
+
function getComparableAmisVersion() {
|
|
20347
|
+
let amis = (window.amisRequire && window.amisRequire('amis')) || window.Amis;
|
|
20348
|
+
let amisVersion = amis && amis.version;
|
|
20349
|
+
if(amisVersion){
|
|
20350
|
+
let comparableVersions = amisVersion.split(".");
|
|
20351
|
+
let comparableVersion = parseFloat(comparableVersions[0].toString() + "." + comparableVersions[1].toString());
|
|
20352
|
+
return comparableVersion;
|
|
20353
|
+
}
|
|
20354
|
+
}
|
|
20355
|
+
|
|
20341
20356
|
function getNumberTpl(field){
|
|
20342
20357
|
return `<span>\${_display.${field.name}}</span>`
|
|
20343
20358
|
}
|
|
@@ -20406,7 +20421,7 @@
|
|
|
20406
20421
|
if(ctx && ctx.isLookup){
|
|
20407
20422
|
linkTarget = "target='_blank'";
|
|
20408
20423
|
}
|
|
20409
|
-
return `<a href="${href}" ${linkTarget}>\${${field.name}}</a>`
|
|
20424
|
+
return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
|
|
20410
20425
|
}
|
|
20411
20426
|
|
|
20412
20427
|
function getRelatedFieldTpl(field, ctx){
|
|
@@ -20731,7 +20746,7 @@
|
|
|
20731
20746
|
* @Author: baozhoutao@steedos.com
|
|
20732
20747
|
* @Date: 2022-10-28 14:15:09
|
|
20733
20748
|
* @LastEditors: liaodaxue
|
|
20734
|
-
* @LastEditTime: 2023-
|
|
20749
|
+
* @LastEditTime: 2023-12-29 10:46:50
|
|
20735
20750
|
* @Description:
|
|
20736
20751
|
*/
|
|
20737
20752
|
|
|
@@ -20785,7 +20800,8 @@
|
|
|
20785
20800
|
dataType: "form-data",
|
|
20786
20801
|
url: `\${context.rootUrl}/s3/${tableName}`,
|
|
20787
20802
|
requestAdaptor: `
|
|
20788
|
-
const
|
|
20803
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
20804
|
+
const { _master, global } = superData;
|
|
20789
20805
|
// const { recordId, objectName } = _master;
|
|
20790
20806
|
const { spaceId, userId, user } = global;
|
|
20791
20807
|
/*
|
|
@@ -20803,8 +20819,9 @@
|
|
|
20803
20819
|
return api;
|
|
20804
20820
|
`,
|
|
20805
20821
|
adaptor: `
|
|
20806
|
-
const
|
|
20807
|
-
|
|
20822
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
20823
|
+
const { context:pageContext } = superData;
|
|
20824
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${tableName}/";
|
|
20808
20825
|
payload = {
|
|
20809
20826
|
status: response.status == 200 ? 0 : response.status,
|
|
20810
20827
|
msg: response.statusText,
|
|
@@ -21408,8 +21425,9 @@
|
|
|
21408
21425
|
case "avatar":
|
|
21409
21426
|
case "image":
|
|
21410
21427
|
quickEditSchema.body[0].receiver.adaptor = `
|
|
21411
|
-
const
|
|
21412
|
-
|
|
21428
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
21429
|
+
const { context:pageContext } = superData;
|
|
21430
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${field.type}s/";
|
|
21413
21431
|
payload = {
|
|
21414
21432
|
status: response.status == 200 ? 0 : response.status,
|
|
21415
21433
|
msg: response.statusText,
|
|
@@ -21812,8 +21830,8 @@
|
|
|
21812
21830
|
const href = Router.getObjectDetailPath({
|
|
21813
21831
|
...options, formFactor: options.formFactor, appId: "${appId}", objectName: options.objectName || "${objectName}", recordId: `\${${options.idFieldName}}`
|
|
21814
21832
|
});
|
|
21815
|
-
columns[
|
|
21816
|
-
columns[
|
|
21833
|
+
columns[0].type = "tpl";
|
|
21834
|
+
columns[0].tpl = `<a href="${href}">\${${columns[0].name}}</a>`;
|
|
21817
21835
|
}
|
|
21818
21836
|
return columns;
|
|
21819
21837
|
}
|
|
@@ -22072,7 +22090,7 @@
|
|
|
22072
22090
|
type: 'steedos-object-button',
|
|
22073
22091
|
name: button.name,
|
|
22074
22092
|
objectName: button.objectName,
|
|
22075
|
-
|
|
22093
|
+
visibleOnAlias: getButtonVisibleOn$1(button),
|
|
22076
22094
|
className: 'antd-Button--default'
|
|
22077
22095
|
});
|
|
22078
22096
|
});
|
|
@@ -22197,7 +22215,8 @@
|
|
|
22197
22215
|
}
|
|
22198
22216
|
|
|
22199
22217
|
if(!isLookup && !hiddenColumnOperation){
|
|
22200
|
-
|
|
22218
|
+
const toolbarOperation = await getTableOperation(options);
|
|
22219
|
+
columns.push(toolbarOperation);
|
|
22201
22220
|
}
|
|
22202
22221
|
|
|
22203
22222
|
}
|
|
@@ -22719,6 +22738,8 @@
|
|
|
22719
22738
|
`;
|
|
22720
22739
|
const onCancelScript = `
|
|
22721
22740
|
// console.log("===onCancelScript=form==");
|
|
22741
|
+
let isLookup = event.data.isLookup;
|
|
22742
|
+
let __lookupField = event.data.__lookupField;
|
|
22722
22743
|
const scope = event.context.scoped;
|
|
22723
22744
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
22724
22745
|
return n.props.type === "form";
|
|
@@ -22766,7 +22787,20 @@
|
|
|
22766
22787
|
// });
|
|
22767
22788
|
|
|
22768
22789
|
// 清除__changedFilterFormValues中的值
|
|
22769
|
-
crud && crud.setData({__changedFilterFormValues: {}});
|
|
22790
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
22791
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
22792
|
+
if(isLookup && __lookupField){
|
|
22793
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
22794
|
+
if(__lookupField.reference_to_field){
|
|
22795
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
22796
|
+
}
|
|
22797
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
22798
|
+
}
|
|
22799
|
+
if(crud){
|
|
22800
|
+
let crudData = crud.getData();
|
|
22801
|
+
crudData[__changedFilterFormValuesKey] = {};
|
|
22802
|
+
crud.setData(crudData);
|
|
22803
|
+
}
|
|
22770
22804
|
filterForm.handleFormSubmit(event);
|
|
22771
22805
|
// crud.handleFilterSubmit(removedValues);
|
|
22772
22806
|
|
|
@@ -24233,7 +24267,12 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24233
24267
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
24234
24268
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24235
24269
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
24236
|
-
crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24270
|
+
// crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24271
|
+
if(crud){
|
|
24272
|
+
let crudData = crud.getData();
|
|
24273
|
+
crudData.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
24274
|
+
crud.setData(crudData);
|
|
24275
|
+
}
|
|
24237
24276
|
`;
|
|
24238
24277
|
|
|
24239
24278
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -24246,9 +24285,19 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24246
24285
|
// const scope = event.context.scoped;
|
|
24247
24286
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
24248
24287
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
24288
|
+
let isLookup = event.data.isLookup;
|
|
24289
|
+
let __lookupField = event.data.__lookupField;
|
|
24290
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
24291
|
+
if(isLookup && __lookupField){
|
|
24292
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
24293
|
+
if(__lookupField.reference_to_field){
|
|
24294
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
24295
|
+
}
|
|
24296
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
24297
|
+
}
|
|
24249
24298
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
24250
24299
|
setTimeout(function(){
|
|
24251
|
-
filterForm.setValues(event.data
|
|
24300
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
24252
24301
|
}, 500);
|
|
24253
24302
|
`;
|
|
24254
24303
|
|
|
@@ -24269,8 +24318,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24269
24318
|
"name": keywordsSearchBoxName,
|
|
24270
24319
|
"placeholder": "搜索此列表",
|
|
24271
24320
|
"value": crudKeywords,
|
|
24272
|
-
"clearable": true
|
|
24273
|
-
|
|
24321
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
24322
|
+
"clearAndSubmit": true,
|
|
24274
24323
|
"searchImediately": false,
|
|
24275
24324
|
"onEvent": {
|
|
24276
24325
|
"search": {
|
|
@@ -24550,6 +24599,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24550
24599
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
24551
24600
|
`;
|
|
24552
24601
|
let onChangeScript = `
|
|
24602
|
+
let isLookup = event.data.isLookup;
|
|
24603
|
+
let __lookupField = event.data.__lookupField;
|
|
24604
|
+
console.log("==onChangeScript=isLookup===", isLookup);
|
|
24553
24605
|
const scope = event.context.scoped;
|
|
24554
24606
|
// let filterFormValues = event.data;
|
|
24555
24607
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -24561,7 +24613,20 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24561
24613
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
24562
24614
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24563
24615
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
24564
|
-
crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24616
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24617
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
24618
|
+
if(isLookup && __lookupField){
|
|
24619
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
24620
|
+
if(__lookupField.reference_to_field){
|
|
24621
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
24622
|
+
}
|
|
24623
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
24624
|
+
}
|
|
24625
|
+
if(crud){
|
|
24626
|
+
let crudData = crud.getData();
|
|
24627
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
24628
|
+
crud.setData(crudData);
|
|
24629
|
+
}
|
|
24565
24630
|
`;
|
|
24566
24631
|
return {
|
|
24567
24632
|
"title": "",
|
|
@@ -25376,13 +25441,24 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25376
25441
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
25377
25442
|
|
|
25378
25443
|
source.requestAdaptor = `
|
|
25379
|
-
let
|
|
25444
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
25445
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
25446
|
+
if(__lookupField){
|
|
25447
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
25448
|
+
if(__lookupField.reference_to_field){
|
|
25449
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
25450
|
+
}
|
|
25451
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
25452
|
+
}
|
|
25453
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
25380
25454
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
25381
25455
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
25382
25456
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
25383
25457
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
25384
25458
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
25385
|
-
|
|
25459
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
25460
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
25461
|
+
}
|
|
25386
25462
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
25387
25463
|
var filters = [];
|
|
25388
25464
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -25589,7 +25665,12 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25589
25665
|
"objectName": refObjectConfig.name,
|
|
25590
25666
|
"uiSchema": refObjectConfig,
|
|
25591
25667
|
"listName": listName,// 需要按视图取可搜索项
|
|
25592
|
-
"isLookup": true
|
|
25668
|
+
"isLookup": true,
|
|
25669
|
+
"__lookupField": {
|
|
25670
|
+
"name": field.name,
|
|
25671
|
+
"reference_to": refObjectConfig.name,
|
|
25672
|
+
"reference_to_field": field.reference_to_field
|
|
25673
|
+
}
|
|
25593
25674
|
});
|
|
25594
25675
|
|
|
25595
25676
|
if(!pickerSchema.onEvent){
|
|
@@ -25762,7 +25843,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25762
25843
|
sendOn.push(`this.${fName}`);
|
|
25763
25844
|
});
|
|
25764
25845
|
if(depend_on.length > 0){
|
|
25765
|
-
apiInfo.url = `${apiInfo.url}
|
|
25846
|
+
apiInfo.url = `${apiInfo.url}&${depend_on.join('&')}`;
|
|
25766
25847
|
apiInfo.sendOn = `${sendOn.join(' && ')}`;
|
|
25767
25848
|
}
|
|
25768
25849
|
}
|
|
@@ -25870,6 +25951,13 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25870
25951
|
autoComplete: apiInfo,
|
|
25871
25952
|
searchable: true,
|
|
25872
25953
|
};
|
|
25954
|
+
let amisVersion = getComparableAmisVersion();
|
|
25955
|
+
if(amisVersion >= 3.6){
|
|
25956
|
+
// amis 3.6中不加source会造成子表组件中弹出行编辑窗口的lookup字段有时不请求接口(概率现象,同一个地方反复操作有时请求有时不请求)
|
|
25957
|
+
// 但是同时配置autoComplete和source会多请求一次接口
|
|
25958
|
+
// TODO:应该想办法把是否字段在子表组件内,即ctx.isInputTable,如果不在子表组件内不需要加source
|
|
25959
|
+
data.source = apiInfo;
|
|
25960
|
+
}
|
|
25873
25961
|
//删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
|
|
25874
25962
|
const select_menuTpl = `<span class='flex items-center mt-0.5'>
|
|
25875
25963
|
<span role='img' aria-label='smile' class='anticon anticon-smile'>
|
|
@@ -25951,6 +26039,14 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25951
26039
|
|
|
25952
26040
|
// 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
|
|
25953
26041
|
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
26042
|
+
let amisVersion = getComparableAmisVersion();
|
|
26043
|
+
if(amisVersion >= 3.6){
|
|
26044
|
+
// amis 3.6.3单选的树picker有严重bug(https://github.com/baidu/amis/issues/9279),先强制使用下拉方式显示
|
|
26045
|
+
// amis 3.6.3多选的树会自动把下层节点,及下下层等所有子节点自动选中,跟amis 3.2不一样,而且目前没有开关,这不适合目前的业务场景,也先强制使用下拉方式显示
|
|
26046
|
+
if(enableEnhancedLookup && refObject.enable_tree){
|
|
26047
|
+
enableEnhancedLookup = false;
|
|
26048
|
+
}
|
|
26049
|
+
}
|
|
25954
26050
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
25955
26051
|
if(enableEnhancedLookup == true){
|
|
25956
26052
|
return await lookupToAmisPicker(field, readonly, ctx);
|
|
@@ -26832,9 +26928,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26832
26928
|
}
|
|
26833
26929
|
if(!lodash.exports.isEmpty(convertData)){
|
|
26834
26930
|
if(field.is_wide || convertData.type === 'group'){
|
|
26835
|
-
convertData.className = 'col-span-2 m-
|
|
26931
|
+
convertData.className = 'col-span-2 m-0';
|
|
26836
26932
|
}else {
|
|
26837
|
-
convertData.className = 'm-
|
|
26933
|
+
convertData.className = 'm-0';
|
|
26838
26934
|
}
|
|
26839
26935
|
if(readonly){
|
|
26840
26936
|
convertData.className = `${convertData.className} border-b`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/sortable",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.5",
|
|
4
4
|
"main": "dist/sortable.cjs.js",
|
|
5
5
|
"module": "dist/sortable.esm.js",
|
|
6
6
|
"unpkg": "dist/sortable.umd.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@dnd-kit/core": "^6.0.5",
|
|
47
47
|
"@dnd-kit/sortable": "^7.0.1",
|
|
48
|
-
"@steedos-widgets/amis-lib": "3.6.0-beta.
|
|
48
|
+
"@steedos-widgets/amis-lib": "3.6.0-beta.5"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "7babba3c01fe0aa4410cdc834c862774d4c59824"
|
|
51
51
|
}
|