@steedos-widgets/sortable 1.3.15 → 1.3.16
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 +109 -60
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +109 -60
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +109 -60
- package/package.json +3 -3
package/dist/sortable.esm.js
CHANGED
|
@@ -54942,6 +54942,17 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
54942
54942
|
crudService && crudService.setData({isFieldsFilterEmpty, showFieldsFilter});
|
|
54943
54943
|
`;
|
|
54944
54944
|
const onCancelScript = `
|
|
54945
|
+
doAction(
|
|
54946
|
+
{
|
|
54947
|
+
"componentId": 'service_${ctx.crudId}',
|
|
54948
|
+
"actionType": "setValue",
|
|
54949
|
+
"args": {
|
|
54950
|
+
"value": {
|
|
54951
|
+
"__filterFormValues": null
|
|
54952
|
+
}
|
|
54953
|
+
}
|
|
54954
|
+
}
|
|
54955
|
+
)
|
|
54945
54956
|
const scope = event.context.scoped;
|
|
54946
54957
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
54947
54958
|
return n.props.type === "form";
|
|
@@ -54976,7 +54987,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
54976
54987
|
removedValues[keywordsSearchBoxName] = filterFormValues[keywordsSearchBoxName];
|
|
54977
54988
|
}
|
|
54978
54989
|
filterForm.reset();
|
|
54979
|
-
|
|
54990
|
+
setTimeout(()=>{
|
|
54991
|
+
listView.handleFilterSubmit(removedValues);
|
|
54992
|
+
}, 100);
|
|
54980
54993
|
const filterService = filterForm.context.getComponents().find(function(n){
|
|
54981
54994
|
return n.props.type === "service";
|
|
54982
54995
|
});
|
|
@@ -56392,7 +56405,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
56392
56405
|
// }
|
|
56393
56406
|
`;
|
|
56394
56407
|
|
|
56395
|
-
function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup = false, keywordsSearchBoxName = "__keywords" } = {}){
|
|
56408
|
+
function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup = false, keywordsSearchBoxName = "__keywords", crudId } = {}){
|
|
56396
56409
|
const searchableFieldsLabel = [];
|
|
56397
56410
|
_.each(mainObject.fields, function (field) {
|
|
56398
56411
|
if (isFieldQuickSearchable(field, mainObject.NAME_FIELD_KEY)) {
|
|
@@ -56429,23 +56442,22 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
56429
56442
|
"clearAndSubmit": true,
|
|
56430
56443
|
"searchImediately": false,
|
|
56431
56444
|
"onEvent": {
|
|
56432
|
-
"
|
|
56445
|
+
"change": {
|
|
56433
56446
|
"actions": [
|
|
56434
56447
|
{
|
|
56435
56448
|
"actionType": "custom",
|
|
56436
56449
|
"script": `
|
|
56437
|
-
|
|
56438
|
-
|
|
56439
|
-
|
|
56440
|
-
|
|
56441
|
-
|
|
56442
|
-
|
|
56443
|
-
|
|
56444
|
-
|
|
56450
|
+
doAction(
|
|
56451
|
+
{
|
|
56452
|
+
"componentId": 'service_${crudId}',
|
|
56453
|
+
"actionType": "setValue",
|
|
56454
|
+
"args": {
|
|
56455
|
+
"value": {
|
|
56456
|
+
"__serachBoxValues": event.data
|
|
56457
|
+
}
|
|
56445
56458
|
}
|
|
56446
|
-
|
|
56447
|
-
|
|
56448
|
-
}
|
|
56459
|
+
}
|
|
56460
|
+
)
|
|
56449
56461
|
`
|
|
56450
56462
|
}
|
|
56451
56463
|
]
|
|
@@ -56457,7 +56469,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
56457
56469
|
}
|
|
56458
56470
|
|
|
56459
56471
|
function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
56460
|
-
showDisplayAs = false, hiddenCount = false, headerToolbarItems,
|
|
56472
|
+
showDisplayAs = false, hiddenCount = false, headerToolbarItems, crudId,
|
|
56461
56473
|
filterVisible = true, isLookup = false, keywordsSearchBoxName } = {}){
|
|
56462
56474
|
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
56463
56475
|
// console.log(`getObjectHeaderToolbar`, mainObject)
|
|
@@ -56561,7 +56573,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
56561
56573
|
};
|
|
56562
56574
|
}
|
|
56563
56575
|
let toolbarDisplayAsButton = getDisplayAsButton(mainObject?.name);
|
|
56564
|
-
let toolbarDQuickSearchBox = getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName });
|
|
56576
|
+
let toolbarDQuickSearchBox = getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName, crudId });
|
|
56565
56577
|
|
|
56566
56578
|
// toolbars返回的数组元素不可以是空对象{},比如hiddenCount ? {} : {"type": "tpl",...},因为空对象最终还是会生成一个空的.antd-Crud-toolbar-item dom
|
|
56567
56579
|
// 当出现空的.antd-Crud-toolbar-item dom时会影响toolbar元素的maring-right css样式计算,如果有动态需要应该加到动态数组变量toolbars中
|
|
@@ -56727,6 +56739,26 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
56727
56739
|
"script": onSubmitSuccScript
|
|
56728
56740
|
}
|
|
56729
56741
|
]
|
|
56742
|
+
},
|
|
56743
|
+
"change": {
|
|
56744
|
+
"actions": [
|
|
56745
|
+
{
|
|
56746
|
+
"actionType": "custom",
|
|
56747
|
+
"script": `
|
|
56748
|
+
doAction(
|
|
56749
|
+
{
|
|
56750
|
+
"componentId": 'service_${options.crudId}',
|
|
56751
|
+
"actionType": "setValue",
|
|
56752
|
+
"args": {
|
|
56753
|
+
"value": {
|
|
56754
|
+
"__filterFormValues": event.data
|
|
56755
|
+
}
|
|
56756
|
+
}
|
|
56757
|
+
}
|
|
56758
|
+
)
|
|
56759
|
+
`
|
|
56760
|
+
}
|
|
56761
|
+
]
|
|
56730
56762
|
}
|
|
56731
56763
|
}
|
|
56732
56764
|
}
|
|
@@ -56930,19 +56962,12 @@ async function lookupToAmisTreeSelect(field, readonly, ctx) {
|
|
|
56930
56962
|
|
|
56931
56963
|
const keywordsSearchBoxName = `__keywords_lookup`;
|
|
56932
56964
|
|
|
56933
|
-
const
|
|
56965
|
+
const getReferenceToFieldSchema = (field, refObjectConfig)=>{
|
|
56934
56966
|
let referenceTo = field.reference_to;
|
|
56935
56967
|
if(!referenceTo){
|
|
56936
|
-
return
|
|
56937
|
-
}
|
|
56938
|
-
|
|
56939
|
-
if(referenceTo === 'users'){
|
|
56940
|
-
referenceTo = 'space_users';
|
|
56941
|
-
field.reference_to_field = 'user';
|
|
56968
|
+
return;
|
|
56942
56969
|
}
|
|
56943
56970
|
|
|
56944
|
-
const refObjectConfig = await getUISchema(referenceTo);
|
|
56945
|
-
|
|
56946
56971
|
// 如果lookup 引用的对象未定义
|
|
56947
56972
|
if (!refObjectConfig)
|
|
56948
56973
|
return null;
|
|
@@ -56965,6 +56990,28 @@ const getReferenceTo = async (field)=>{
|
|
|
56965
56990
|
}
|
|
56966
56991
|
};
|
|
56967
56992
|
|
|
56993
|
+
const getReferenceTo = async (field)=>{
|
|
56994
|
+
let referenceTo = field.reference_to;
|
|
56995
|
+
if(referenceTo === 'users'){
|
|
56996
|
+
field.reference_to = 'space_users';
|
|
56997
|
+
field.reference_to_field = 'user';
|
|
56998
|
+
}
|
|
56999
|
+
|
|
57000
|
+
const refObjectConfig = await getUISchema(field.reference_to);
|
|
57001
|
+
return getReferenceToFieldSchema(field, refObjectConfig);
|
|
57002
|
+
};
|
|
57003
|
+
|
|
57004
|
+
function getReferenceToSync(field) {
|
|
57005
|
+
let referenceTo = field.reference_to;
|
|
57006
|
+
if(referenceTo === 'users'){
|
|
57007
|
+
field.reference_to = 'space_users';
|
|
57008
|
+
field.reference_to_field = 'user';
|
|
57009
|
+
}
|
|
57010
|
+
|
|
57011
|
+
const refObjectConfig = getUISchemaSync(field.reference_to);
|
|
57012
|
+
return getReferenceToFieldSchema(field, refObjectConfig);
|
|
57013
|
+
}
|
|
57014
|
+
|
|
56968
57015
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
56969
57016
|
const treeSchema = {
|
|
56970
57017
|
"type": "input-tree",
|
|
@@ -57558,7 +57605,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
57558
57605
|
// [["_id", "=", "$${field.name}._id"],"or",["name", "contains", "$term"]]
|
|
57559
57606
|
apiInfo.requestAdaptor = `
|
|
57560
57607
|
var filters = [];
|
|
57561
|
-
var top =
|
|
57608
|
+
var top = 200;
|
|
57562
57609
|
if(api.data.$term){
|
|
57563
57610
|
filters = [["${referenceTo?.NAME_FIELD_KEY || 'name'}", "contains", api.data.$term]];
|
|
57564
57611
|
}
|
|
@@ -57864,6 +57911,12 @@ async function getIdsPickerSchema(field, readonly, ctx){
|
|
|
57864
57911
|
return data;
|
|
57865
57912
|
}
|
|
57866
57913
|
|
|
57914
|
+
|
|
57915
|
+
if(typeof window != 'undefined'){
|
|
57916
|
+
window.getReferenceTo = getReferenceTo;
|
|
57917
|
+
window.getReferenceToSync = getReferenceToSync;
|
|
57918
|
+
}
|
|
57919
|
+
|
|
57867
57920
|
/*
|
|
57868
57921
|
* @Author: baozhoutao@steedos.com
|
|
57869
57922
|
* @Date: 2023-01-13 17:27:54
|
|
@@ -58653,6 +58706,29 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
58653
58706
|
}
|
|
58654
58707
|
}
|
|
58655
58708
|
break;
|
|
58709
|
+
case 'table':
|
|
58710
|
+
if(field.subFields){
|
|
58711
|
+
convertData = {
|
|
58712
|
+
type: 'steedos-input-table',
|
|
58713
|
+
showIndex: true,
|
|
58714
|
+
editable: !readonly,
|
|
58715
|
+
addable: !readonly,
|
|
58716
|
+
removable: !readonly,
|
|
58717
|
+
draggable: !readonly,
|
|
58718
|
+
fields: [],
|
|
58719
|
+
amis:{
|
|
58720
|
+
columnsTogglable: false
|
|
58721
|
+
}
|
|
58722
|
+
};
|
|
58723
|
+
for (const subField of field.subFields) {
|
|
58724
|
+
const subFieldName = subField.name.replace(`${field._prefix || ''}${field.name}.$.`, '').replace(`${field.name}.`, '');
|
|
58725
|
+
const gridSub = await convertSFieldToAmisField(Object.assign({}, subField, {name: subFieldName, isTableField: true}), readonly, ctx);
|
|
58726
|
+
if(gridSub){
|
|
58727
|
+
convertData.fields.push(Object.assign({}, subField, {name: subFieldName}));
|
|
58728
|
+
}
|
|
58729
|
+
}
|
|
58730
|
+
}
|
|
58731
|
+
break;
|
|
58656
58732
|
case 'object':
|
|
58657
58733
|
if(field.subFields){
|
|
58658
58734
|
convertData = {
|
|
@@ -58724,7 +58800,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
58724
58800
|
return convertData
|
|
58725
58801
|
}
|
|
58726
58802
|
// if(ctx.mode === 'edit'){
|
|
58727
|
-
|
|
58803
|
+
let convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, field.amis, {name: baseData.name});
|
|
58804
|
+
// console.log("convertDataResult:", convertDataResult);
|
|
58805
|
+
return convertDataResult;
|
|
58728
58806
|
// }else{
|
|
58729
58807
|
// return Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name});
|
|
58730
58808
|
// }
|
|
@@ -58816,38 +58894,9 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
58816
58894
|
|
|
58817
58895
|
const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
|
|
58818
58896
|
if(amisField){
|
|
58819
|
-
|
|
58820
|
-
const isChangeActions = changeActionsFields.indexOf(field.type) > -1;
|
|
58821
|
-
let additionalProps = {
|
|
58897
|
+
return Object.assign({}, amisField,{
|
|
58822
58898
|
submitOnChange: false
|
|
58823
|
-
};
|
|
58824
|
-
if (isChangeActions) {
|
|
58825
|
-
additionalProps.submitOnChange = true;
|
|
58826
|
-
} else {
|
|
58827
|
-
additionalProps.onEvent = {
|
|
58828
|
-
blur: {
|
|
58829
|
-
actions: [
|
|
58830
|
-
{
|
|
58831
|
-
actionType: "custom",
|
|
58832
|
-
script: `
|
|
58833
|
-
try {
|
|
58834
|
-
const scope = event.context.scoped;
|
|
58835
|
-
const filterForm = scope.parent.parent.parent.getComponents().find(function(n) {
|
|
58836
|
-
return n.props.type === "form";
|
|
58837
|
-
});
|
|
58838
|
-
if (filterForm && typeof filterForm.handleFormSubmit === 'function') {
|
|
58839
|
-
filterForm.handleFormSubmit(event);
|
|
58840
|
-
}
|
|
58841
|
-
} catch (error) {
|
|
58842
|
-
console.error('An error occurred:', error);
|
|
58843
|
-
}
|
|
58844
|
-
`
|
|
58845
|
-
}
|
|
58846
|
-
]
|
|
58847
|
-
}
|
|
58848
|
-
};
|
|
58849
|
-
}
|
|
58850
|
-
return Object.assign({}, amisField, additionalProps);
|
|
58899
|
+
});
|
|
58851
58900
|
}
|
|
58852
58901
|
}
|
|
58853
58902
|
}
|
|
@@ -59096,7 +59145,7 @@ async function getUISchema(objectName, force) {
|
|
|
59096
59145
|
return getUISchemaCache(objectName);
|
|
59097
59146
|
}
|
|
59098
59147
|
|
|
59099
|
-
function getUISchemaSync(objectName, force) {
|
|
59148
|
+
function getUISchemaSync$1(objectName, force) {
|
|
59100
59149
|
if (!objectName) {
|
|
59101
59150
|
return;
|
|
59102
59151
|
}
|
|
@@ -59280,7 +59329,7 @@ async function getListSchema(
|
|
|
59280
59329
|
|
|
59281
59330
|
if(typeof window != 'undefined'){
|
|
59282
59331
|
window.getUISchema = getUISchema;
|
|
59283
|
-
window.getUISchemaSync = getUISchemaSync;
|
|
59332
|
+
window.getUISchemaSync = getUISchemaSync$1;
|
|
59284
59333
|
window.getListSchema = getListSchema;
|
|
59285
59334
|
}
|
|
59286
59335
|
|