@steedos-widgets/sortable 6.3.0-beta.11 → 6.3.0-beta.13
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 +96 -82
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +96 -82
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +96 -82
- package/package.json +3 -3
package/dist/sortable.umd.js
CHANGED
|
@@ -20431,9 +20431,9 @@
|
|
|
20431
20431
|
}
|
|
20432
20432
|
|
|
20433
20433
|
function getNameTplUrl(field, ctx){
|
|
20434
|
-
if(ctx.objectName === 'cms_files'){
|
|
20435
|
-
|
|
20436
|
-
}
|
|
20434
|
+
// if(ctx.objectName === 'cms_files'){
|
|
20435
|
+
// return "${(versions[0] && versions[0].url) ? versions[0].url+'?download=true' : context.rootUrl+'/api/files/files/'+versions[0]+'?download=true'}"
|
|
20436
|
+
// }
|
|
20437
20437
|
const href = Router.getObjectDetailPath({
|
|
20438
20438
|
...ctx, formFactor: ctx.formFactor, appId: "${appId}", objectName: ctx.objectName || "${objectName}", recordId: `\${${ctx.idFieldName}}`
|
|
20439
20439
|
});
|
|
@@ -20623,12 +20623,15 @@
|
|
|
20623
20623
|
}
|
|
20624
20624
|
}
|
|
20625
20625
|
|
|
20626
|
-
async function getFieldsTemplate(fields, display){
|
|
20626
|
+
async function getFieldsTemplate(object, fields, display){
|
|
20627
20627
|
let expandFields = [];
|
|
20628
20628
|
if(display != false){
|
|
20629
20629
|
display = true;
|
|
20630
20630
|
}
|
|
20631
|
-
let fieldsName = ['_id'
|
|
20631
|
+
let fieldsName = ['_id'];
|
|
20632
|
+
if(!object.datasource || object.datasource === 'default' || object.datasource === 'meteor'){
|
|
20633
|
+
fieldsName.push('space');
|
|
20634
|
+
}
|
|
20632
20635
|
let displayFields = [];
|
|
20633
20636
|
let fieldsArr = [];
|
|
20634
20637
|
if(lodash.exports.isArray(fields)){
|
|
@@ -20714,7 +20717,7 @@
|
|
|
20714
20717
|
// return item.replace(/^{/,"").replace(/}$/,"");
|
|
20715
20718
|
// }).join(",")) : "";
|
|
20716
20719
|
|
|
20717
|
-
const fieldsTemplate = `${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}`;
|
|
20720
|
+
const fieldsTemplate = `${await getFieldsTemplate(object, fields, options.expand)}${treeFields}${cfsFields}`;
|
|
20718
20721
|
|
|
20719
20722
|
return {
|
|
20720
20723
|
orderBy: "${orderBy}",
|
|
@@ -21809,6 +21812,59 @@
|
|
|
21809
21812
|
}
|
|
21810
21813
|
}
|
|
21811
21814
|
|
|
21815
|
+
async function getColumnItemOnClick(field, options){
|
|
21816
|
+
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
21817
|
+
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
21818
|
+
"recordId": `\${${options.idFieldName}}`,
|
|
21819
|
+
"data": {
|
|
21820
|
+
...recordPage.schema.data,
|
|
21821
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
21822
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
21823
|
+
}
|
|
21824
|
+
}) : {
|
|
21825
|
+
"type": "steedos-record-detail",
|
|
21826
|
+
"objectApiName": "${objectName}",
|
|
21827
|
+
"recordId": `\${${options.idFieldName}}`,
|
|
21828
|
+
"showBackButton": false,
|
|
21829
|
+
"showButtons": true,
|
|
21830
|
+
"data": {
|
|
21831
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
21832
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
21833
|
+
}
|
|
21834
|
+
};
|
|
21835
|
+
|
|
21836
|
+
if(!(field.is_name || field.name === options.labelFieldName)){
|
|
21837
|
+
drawerRecordDetailSchema.objectApiName = field.reference_to;
|
|
21838
|
+
drawerRecordDetailSchema.recordId = `\${_display.${field.name}.value}`;
|
|
21839
|
+
}
|
|
21840
|
+
return {
|
|
21841
|
+
"click": {
|
|
21842
|
+
"actions": [
|
|
21843
|
+
{
|
|
21844
|
+
"actionType": "drawer",
|
|
21845
|
+
"drawer": {
|
|
21846
|
+
"type": "drawer",
|
|
21847
|
+
"title": " ",
|
|
21848
|
+
"headerClassName": "hidden",
|
|
21849
|
+
"size": "lg",
|
|
21850
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
21851
|
+
"closeOnEsc": true,
|
|
21852
|
+
"closeOnOutside": true,
|
|
21853
|
+
"resizable": true,
|
|
21854
|
+
"actions": [],
|
|
21855
|
+
"body": [
|
|
21856
|
+
drawerRecordDetailSchema
|
|
21857
|
+
],
|
|
21858
|
+
"className": "steedos-record-detail-drawer app-popover",
|
|
21859
|
+
"id": "u:fc5f055afa8c"
|
|
21860
|
+
},
|
|
21861
|
+
"preventDefault": true
|
|
21862
|
+
}
|
|
21863
|
+
]
|
|
21864
|
+
}
|
|
21865
|
+
};
|
|
21866
|
+
}
|
|
21867
|
+
|
|
21812
21868
|
async function getTableColumns(object, fields, options){
|
|
21813
21869
|
const columns = [];
|
|
21814
21870
|
if(!options.isLookup && !options.isInputTable){
|
|
@@ -21848,7 +21904,10 @@
|
|
|
21848
21904
|
delete fieldAmis?.className;
|
|
21849
21905
|
|
|
21850
21906
|
let columnItem;
|
|
21851
|
-
|
|
21907
|
+
|
|
21908
|
+
// PC客户端点击名称字段直接预览
|
|
21909
|
+
let isNode = !!(window && window.nw && window.nw.require);
|
|
21910
|
+
if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files' && isNode){
|
|
21852
21911
|
const previewFileScript = `
|
|
21853
21912
|
var data = event.data;
|
|
21854
21913
|
var file_name = data.versions ? data.name : "${field.label}";
|
|
@@ -21863,20 +21922,20 @@
|
|
|
21863
21922
|
"onEvent": {
|
|
21864
21923
|
"click": {
|
|
21865
21924
|
"actions": [
|
|
21866
|
-
{
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
},
|
|
21925
|
+
// {
|
|
21926
|
+
// "args": {
|
|
21927
|
+
// "api": {
|
|
21928
|
+
// "url": "${(versions[0] && versions[0].url) ? versions[0].url+'?download=true' : context.rootUrl+'/api/files/files/'+versions[0]+'?download=true'}",
|
|
21929
|
+
// "method": "get",
|
|
21930
|
+
// "headers": {
|
|
21931
|
+
// "Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
21932
|
+
// }
|
|
21933
|
+
// }
|
|
21934
|
+
// },
|
|
21935
|
+
// "actionType": "download",
|
|
21936
|
+
// // "expression": "!!!window?.nw?.require"//浏览器上直接下载
|
|
21937
|
+
// "expression": "!!!(window && window.nw && window.nw.require)"//浏览器上直接下载
|
|
21938
|
+
// },
|
|
21880
21939
|
{
|
|
21881
21940
|
"args": {},
|
|
21882
21941
|
"actionType": "custom",
|
|
@@ -21974,57 +22033,7 @@
|
|
|
21974
22033
|
}
|
|
21975
22034
|
|
|
21976
22035
|
if(window.innerWidth >= 768 && ((field.is_name || field.name === options.labelFieldName) || ((field.type == 'lookup' || field.type == 'master_detail') && lodash.exports.isString(field.reference_to) && field.multiple != true)) && options.isRelated){
|
|
21977
|
-
|
|
21978
|
-
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
21979
|
-
"recordId": `\${${options.idFieldName}}`,
|
|
21980
|
-
"data": {
|
|
21981
|
-
...recordPage.schema.data,
|
|
21982
|
-
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
21983
|
-
"recordLoaded": false, // 重置数据加载状态
|
|
21984
|
-
}
|
|
21985
|
-
}) : {
|
|
21986
|
-
"type": "steedos-record-detail",
|
|
21987
|
-
"objectApiName": "${objectName}",
|
|
21988
|
-
"recordId": `\${${options.idFieldName}}`,
|
|
21989
|
-
"showBackButton": false,
|
|
21990
|
-
"showButtons": true,
|
|
21991
|
-
"data": {
|
|
21992
|
-
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
21993
|
-
"recordLoaded": false, // 重置数据加载状态
|
|
21994
|
-
}
|
|
21995
|
-
};
|
|
21996
|
-
|
|
21997
|
-
if(!(field.is_name || field.name === options.labelFieldName)){
|
|
21998
|
-
drawerRecordDetailSchema.objectApiName = field.reference_to;
|
|
21999
|
-
drawerRecordDetailSchema.recordId = `\${_display.${field.name}.value}`;
|
|
22000
|
-
}
|
|
22001
|
-
|
|
22002
|
-
columnItem.onEvent = {
|
|
22003
|
-
"click": {
|
|
22004
|
-
"actions": [
|
|
22005
|
-
{
|
|
22006
|
-
"actionType": "drawer",
|
|
22007
|
-
"drawer": {
|
|
22008
|
-
"type": "drawer",
|
|
22009
|
-
"title": " ",
|
|
22010
|
-
"headerClassName": "hidden",
|
|
22011
|
-
"size": "lg",
|
|
22012
|
-
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
22013
|
-
"closeOnEsc": true,
|
|
22014
|
-
"closeOnOutside": true,
|
|
22015
|
-
"resizable": true,
|
|
22016
|
-
"actions": [],
|
|
22017
|
-
"body": [
|
|
22018
|
-
drawerRecordDetailSchema
|
|
22019
|
-
],
|
|
22020
|
-
"className": "steedos-record-detail-drawer app-popover",
|
|
22021
|
-
"id": "u:fc5f055afa8c"
|
|
22022
|
-
},
|
|
22023
|
-
"preventDefault": true
|
|
22024
|
-
}
|
|
22025
|
-
]
|
|
22026
|
-
}
|
|
22027
|
-
};
|
|
22036
|
+
columnItem.onEvent = await getColumnItemOnClick(field, options);
|
|
22028
22037
|
}
|
|
22029
22038
|
|
|
22030
22039
|
}
|
|
@@ -22237,17 +22246,23 @@
|
|
|
22237
22246
|
onEvent: {
|
|
22238
22247
|
"click": {
|
|
22239
22248
|
"actions": [
|
|
22249
|
+
// {
|
|
22250
|
+
// "args": {
|
|
22251
|
+
// "api": {
|
|
22252
|
+
// "url": url,
|
|
22253
|
+
// "method": "get",
|
|
22254
|
+
// "headers": {
|
|
22255
|
+
// "Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
22256
|
+
// }
|
|
22257
|
+
// }
|
|
22258
|
+
// },
|
|
22259
|
+
// "actionType": "download"
|
|
22260
|
+
// }
|
|
22240
22261
|
{
|
|
22262
|
+
"actionType": "link",
|
|
22241
22263
|
"args": {
|
|
22242
|
-
"
|
|
22243
|
-
|
|
22244
|
-
"method": "get",
|
|
22245
|
-
"headers": {
|
|
22246
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
22247
|
-
}
|
|
22248
|
-
}
|
|
22249
|
-
},
|
|
22250
|
-
"actionType": "download"
|
|
22264
|
+
"link": url
|
|
22265
|
+
}
|
|
22251
22266
|
}
|
|
22252
22267
|
],
|
|
22253
22268
|
"weight": 0
|
|
@@ -26483,7 +26498,6 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26483
26498
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
26484
26499
|
var currentAmis = amisRequire('amis');
|
|
26485
26500
|
//递归fieldFilters数组,检查每一个元素,判断若是公式,就仅把它解析
|
|
26486
|
-
debugger;
|
|
26487
26501
|
function traverseNestedArray(arr) {
|
|
26488
26502
|
for (let i = 0; i < arr.length; i++) {
|
|
26489
26503
|
if (Array.isArray(arr[i])) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/sortable",
|
|
3
|
-
"version": "6.3.0-beta.
|
|
3
|
+
"version": "6.3.0-beta.13",
|
|
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": "6.3.0-beta.
|
|
48
|
+
"@steedos-widgets/amis-lib": "6.3.0-beta.13"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "9c91a4fcaec8a9a5399a98e4217c8230067f294f"
|
|
51
51
|
}
|