@steedos-widgets/sortable 6.3.0-beta.16 → 6.3.0-beta.18
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 +134 -47
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +134 -47
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +134 -47
- package/package.json +3 -3
package/dist/sortable.umd.js
CHANGED
|
@@ -20800,6 +20800,29 @@
|
|
|
20800
20800
|
}
|
|
20801
20801
|
}
|
|
20802
20802
|
|
|
20803
|
+
/*
|
|
20804
|
+
* @Author: baozhoutao@steedos.com
|
|
20805
|
+
* @Date: 2022-07-13 15:18:03
|
|
20806
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
20807
|
+
* @LastEditTime: 2023-04-11 10:34:26
|
|
20808
|
+
* @Description:
|
|
20809
|
+
*/
|
|
20810
|
+
|
|
20811
|
+
async function getPage({type, pageId = '', appId, objectName = '', recordId = '', formFactor = 'LARGE'}){
|
|
20812
|
+
const api = `/api/pageSchema/${type}?app=${appId}&objectApiName=${objectName}&recordId=${recordId}&pageId=${pageId}&formFactor=${formFactor}`;
|
|
20813
|
+
const page = await fetchAPI(api);
|
|
20814
|
+
if (page && page.schema) {
|
|
20815
|
+
page.schema = JSON.parse(page.schema);
|
|
20816
|
+
if(page.schema.data){
|
|
20817
|
+
delete page.schema.data.recordId;
|
|
20818
|
+
delete page.schema.data.objectName;
|
|
20819
|
+
delete page.schema.data.context;
|
|
20820
|
+
delete page.schema.data.global;
|
|
20821
|
+
}
|
|
20822
|
+
return page;
|
|
20823
|
+
}
|
|
20824
|
+
}
|
|
20825
|
+
|
|
20803
20826
|
/*
|
|
20804
20827
|
* @Author: baozhoutao@steedos.com
|
|
20805
20828
|
* @Date: 2022-10-28 14:15:09
|
|
@@ -20823,9 +20846,74 @@
|
|
|
20823
20846
|
return getAmisStaticFieldType(steedosField.type === 'avatar' ? 'image' : steedosField.type, readonly, {multiple: steedosField.multiple});
|
|
20824
20847
|
};
|
|
20825
20848
|
|
|
20826
|
-
|
|
20849
|
+
async function getLookupLinkOnClick(field, options) {
|
|
20850
|
+
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
20851
|
+
|
|
20852
|
+
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
20853
|
+
"recordId": "${value}",
|
|
20854
|
+
"data": {
|
|
20855
|
+
...recordPage.schema.data,
|
|
20856
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
20857
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
20858
|
+
"objectName": options.objectName,
|
|
20859
|
+
}
|
|
20860
|
+
}) : {
|
|
20861
|
+
"type": "steedos-record-detail",
|
|
20862
|
+
"objectApiName": options.objectName,
|
|
20863
|
+
"recordId": "${value}",
|
|
20864
|
+
"showBackButton": false,
|
|
20865
|
+
"showButtons": true,
|
|
20866
|
+
"data": {
|
|
20867
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
20868
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
20869
|
+
}
|
|
20870
|
+
};
|
|
20871
|
+
return {
|
|
20872
|
+
"click": {
|
|
20873
|
+
"actions": [
|
|
20874
|
+
// {
|
|
20875
|
+
// "type": "custom",
|
|
20876
|
+
// "script": `
|
|
20877
|
+
// let fileRecordId = url.match(${regFileRecordId})[2];
|
|
20878
|
+
// console.log('fileRecordId:',fileRecordId);
|
|
20879
|
+
// event.data.recordId = fileRecordId;
|
|
20880
|
+
// `,
|
|
20881
|
+
// },
|
|
20882
|
+
{
|
|
20883
|
+
"actionType": "drawer",
|
|
20884
|
+
"drawer": {
|
|
20885
|
+
"type": "drawer",
|
|
20886
|
+
"title": " ",
|
|
20887
|
+
"headerClassName": "hidden",
|
|
20888
|
+
"size": "lg",
|
|
20889
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
20890
|
+
"closeOnEsc": true,
|
|
20891
|
+
"closeOnOutside": true,
|
|
20892
|
+
"resizable": true,
|
|
20893
|
+
"actions": [],
|
|
20894
|
+
"body": [
|
|
20895
|
+
drawerRecordDetailSchema
|
|
20896
|
+
],
|
|
20897
|
+
"className": "steedos-record-detail-drawer app-popover"
|
|
20898
|
+
},
|
|
20899
|
+
"preventDefault": true
|
|
20900
|
+
}
|
|
20901
|
+
]
|
|
20902
|
+
}
|
|
20903
|
+
}
|
|
20904
|
+
}
|
|
20905
|
+
|
|
20906
|
+
const getAmisFileReadonlySchema = async (steedosField,ctx)=>{
|
|
20827
20907
|
const type = steedosField.type;
|
|
20908
|
+
const { appId, formFactor } = ctx.amisData || {};
|
|
20828
20909
|
const amisFieldType = getAmisFieldType$1(steedosField, true);
|
|
20910
|
+
|
|
20911
|
+
let lookupATagClick = 'onclick="return false;"';
|
|
20912
|
+
|
|
20913
|
+
if(window.innerWidth < 768){
|
|
20914
|
+
lookupATagClick = "";
|
|
20915
|
+
}
|
|
20916
|
+
|
|
20829
20917
|
if(_.includes(['avatar','image'], type)){
|
|
20830
20918
|
return {
|
|
20831
20919
|
type: amisFieldType,
|
|
@@ -20860,13 +20948,34 @@
|
|
|
20860
20948
|
}
|
|
20861
20949
|
}
|
|
20862
20950
|
} : {
|
|
20863
|
-
type: amisFieldType,
|
|
20864
|
-
tpl: `
|
|
20865
|
-
<% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
20866
|
-
|
|
20867
|
-
|
|
20868
|
-
|
|
20869
|
-
<% });} %>`
|
|
20951
|
+
// type: amisFieldType,
|
|
20952
|
+
// tpl: `
|
|
20953
|
+
// <% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
20954
|
+
// <% if(!Array.isArray(fileData)){ fileData = [fileData]} %>
|
|
20955
|
+
// <% fileData.forEach(function(item) { %>
|
|
20956
|
+
// <a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
20957
|
+
// <% });} %>`
|
|
20958
|
+
"type": "control",
|
|
20959
|
+
"body": {
|
|
20960
|
+
type: 'each',
|
|
20961
|
+
placeholder: "",
|
|
20962
|
+
// className: `steedos-field-lookup-each flex flex-wrap gap-2`,
|
|
20963
|
+
source: `\${_display.${steedosField.name}|asArray}`,
|
|
20964
|
+
items: {
|
|
20965
|
+
type: 'static',
|
|
20966
|
+
labelClassName: "hidden",
|
|
20967
|
+
label: false,
|
|
20968
|
+
className: 'm-0',
|
|
20969
|
+
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${value}" ${lookupATagClick}>\${name}</a>`,
|
|
20970
|
+
// tpl: "<%= item.name >",
|
|
20971
|
+
// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
20972
|
+
onEvent: window.innerWidth < 768 ? null : await getLookupLinkOnClick(steedosField, {
|
|
20973
|
+
appId,
|
|
20974
|
+
objectName: "cfs_files_filerecord",
|
|
20975
|
+
formFactor
|
|
20976
|
+
})
|
|
20977
|
+
}
|
|
20978
|
+
}
|
|
20870
20979
|
}
|
|
20871
20980
|
}
|
|
20872
20981
|
};
|
|
@@ -20928,8 +21037,8 @@
|
|
|
20928
21037
|
return convertData;
|
|
20929
21038
|
};
|
|
20930
21039
|
|
|
20931
|
-
const getAmisFileSchema = (steedosField, readonly)=>{
|
|
20932
|
-
return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
|
|
21040
|
+
const getAmisFileSchema = async (steedosField, readonly, ctx)=>{
|
|
21041
|
+
return readonly ? await getAmisFileReadonlySchema(steedosField,ctx) : getAmisFileEditSchema(steedosField);
|
|
20933
21042
|
};
|
|
20934
21043
|
|
|
20935
21044
|
var frontend_field_group_generalization$1 = "General";
|
|
@@ -21324,29 +21433,6 @@
|
|
|
21324
21433
|
}
|
|
21325
21434
|
});
|
|
21326
21435
|
|
|
21327
|
-
/*
|
|
21328
|
-
* @Author: baozhoutao@steedos.com
|
|
21329
|
-
* @Date: 2022-07-13 15:18:03
|
|
21330
|
-
* @LastEditors: baozhoutao@steedos.com
|
|
21331
|
-
* @LastEditTime: 2023-04-11 10:34:26
|
|
21332
|
-
* @Description:
|
|
21333
|
-
*/
|
|
21334
|
-
|
|
21335
|
-
async function getPage({type, pageId = '', appId, objectName = '', recordId = '', formFactor = 'LARGE'}){
|
|
21336
|
-
const api = `/api/pageSchema/${type}?app=${appId}&objectApiName=${objectName}&recordId=${recordId}&pageId=${pageId}&formFactor=${formFactor}`;
|
|
21337
|
-
const page = await fetchAPI(api);
|
|
21338
|
-
if (page && page.schema) {
|
|
21339
|
-
page.schema = JSON.parse(page.schema);
|
|
21340
|
-
if(page.schema.data){
|
|
21341
|
-
delete page.schema.data.recordId;
|
|
21342
|
-
delete page.schema.data.objectName;
|
|
21343
|
-
delete page.schema.data.context;
|
|
21344
|
-
delete page.schema.data.global;
|
|
21345
|
-
}
|
|
21346
|
-
return page;
|
|
21347
|
-
}
|
|
21348
|
-
}
|
|
21349
|
-
|
|
21350
21436
|
async function getQuickEditSchema(object, columnField, options){
|
|
21351
21437
|
let field = object.fields[columnField.name];
|
|
21352
21438
|
//判断在amis3.2以上环境下,放开批量编辑与lookup的单元格编辑
|
|
@@ -23495,21 +23581,11 @@
|
|
|
23495
23581
|
};
|
|
23496
23582
|
}
|
|
23497
23583
|
|
|
23498
|
-
|
|
23499
|
-
/**
|
|
23500
|
-
* 列表视图顶部放大镜过滤条件栏amisSchema
|
|
23501
|
-
* @param {*} objectSchema 对象UISchema
|
|
23502
|
-
* @returns amisSchema
|
|
23503
|
-
*/
|
|
23504
|
-
async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ctx) {
|
|
23505
|
-
const fieldsFilterBarSchema = await getObjectFieldsFilterBarSchema(objectSchema, ctx);
|
|
23506
|
-
return fieldsFilterBarSchema;
|
|
23507
|
-
}
|
|
23508
|
-
|
|
23509
23584
|
const getNewListviewButtonSchema = ()=>{
|
|
23510
23585
|
return {
|
|
23511
23586
|
"type": "button",
|
|
23512
23587
|
"label": instance.t('frontend_listview_control_new_label'),
|
|
23588
|
+
"className": "steedos-listview-new-button",
|
|
23513
23589
|
"onEvent": {
|
|
23514
23590
|
"click": {
|
|
23515
23591
|
"weight": 0,
|
|
@@ -23716,6 +23792,17 @@
|
|
|
23716
23792
|
}
|
|
23717
23793
|
}
|
|
23718
23794
|
|
|
23795
|
+
|
|
23796
|
+
/**
|
|
23797
|
+
* 列表视图顶部放大镜过滤条件栏amisSchema
|
|
23798
|
+
* @param {*} objectSchema 对象UISchema
|
|
23799
|
+
* @returns amisSchema
|
|
23800
|
+
*/
|
|
23801
|
+
async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ctx) {
|
|
23802
|
+
const fieldsFilterBarSchema = await getObjectFieldsFilterBarSchema(objectSchema, ctx);
|
|
23803
|
+
return fieldsFilterBarSchema;
|
|
23804
|
+
}
|
|
23805
|
+
|
|
23719
23806
|
const getCopyListviewButtonSchema = ()=>{
|
|
23720
23807
|
return {
|
|
23721
23808
|
"type": "button",
|
|
@@ -27574,13 +27661,13 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
27574
27661
|
};
|
|
27575
27662
|
break;
|
|
27576
27663
|
case 'avatar':
|
|
27577
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
27664
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
27578
27665
|
break;
|
|
27579
27666
|
case 'image':
|
|
27580
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
27667
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
27581
27668
|
break;
|
|
27582
27669
|
case 'file':
|
|
27583
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
27670
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
27584
27671
|
break;
|
|
27585
27672
|
case 'formula':
|
|
27586
27673
|
if(readonly){
|
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.18",
|
|
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.18"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "c4207084f415d61be03b01f3b71512df15de1b68"
|
|
51
51
|
}
|