@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/assets.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
{
|
|
4
4
|
"package": "@steedos-widgets/sortable",
|
|
5
5
|
"urls": [
|
|
6
|
-
"https://unpkg.com/@steedos-widgets/sortable@1.3.
|
|
7
|
-
"https://unpkg.com/@steedos-widgets/sortable@1.3.
|
|
6
|
+
"https://unpkg.com/@steedos-widgets/sortable@1.3.16/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@1.3.16/dist/sortable.umd.css"
|
|
8
8
|
],
|
|
9
9
|
"library": "BuilderSortable"
|
|
10
10
|
}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"npm": {
|
|
16
16
|
"package": "@steedos-widgets/sortable"
|
|
17
17
|
},
|
|
18
|
-
"url": "https://unpkg.com/@steedos-widgets/sortable@1.3.
|
|
18
|
+
"url": "https://unpkg.com/@steedos-widgets/sortable@1.3.16/dist/meta.js",
|
|
19
19
|
"urls": {
|
|
20
|
-
"default": "https://unpkg.com/@steedos-widgets/sortable@1.3.
|
|
21
|
-
"design": "https://unpkg.com/@steedos-widgets/sortable@1.3.
|
|
20
|
+
"default": "https://unpkg.com/@steedos-widgets/sortable@1.3.16/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@1.3.16/dist/meta.js"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
]
|
package/dist/sortable.cjs.js
CHANGED
|
@@ -54946,6 +54946,17 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
54946
54946
|
crudService && crudService.setData({isFieldsFilterEmpty, showFieldsFilter});
|
|
54947
54947
|
`;
|
|
54948
54948
|
const onCancelScript = `
|
|
54949
|
+
doAction(
|
|
54950
|
+
{
|
|
54951
|
+
"componentId": 'service_${ctx.crudId}',
|
|
54952
|
+
"actionType": "setValue",
|
|
54953
|
+
"args": {
|
|
54954
|
+
"value": {
|
|
54955
|
+
"__filterFormValues": null
|
|
54956
|
+
}
|
|
54957
|
+
}
|
|
54958
|
+
}
|
|
54959
|
+
)
|
|
54949
54960
|
const scope = event.context.scoped;
|
|
54950
54961
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
54951
54962
|
return n.props.type === "form";
|
|
@@ -54980,7 +54991,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
54980
54991
|
removedValues[keywordsSearchBoxName] = filterFormValues[keywordsSearchBoxName];
|
|
54981
54992
|
}
|
|
54982
54993
|
filterForm.reset();
|
|
54983
|
-
|
|
54994
|
+
setTimeout(()=>{
|
|
54995
|
+
listView.handleFilterSubmit(removedValues);
|
|
54996
|
+
}, 100);
|
|
54984
54997
|
const filterService = filterForm.context.getComponents().find(function(n){
|
|
54985
54998
|
return n.props.type === "service";
|
|
54986
54999
|
});
|
|
@@ -56396,7 +56409,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
56396
56409
|
// }
|
|
56397
56410
|
`;
|
|
56398
56411
|
|
|
56399
|
-
function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup = false, keywordsSearchBoxName = "__keywords" } = {}){
|
|
56412
|
+
function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup = false, keywordsSearchBoxName = "__keywords", crudId } = {}){
|
|
56400
56413
|
const searchableFieldsLabel = [];
|
|
56401
56414
|
_.each(mainObject.fields, function (field) {
|
|
56402
56415
|
if (isFieldQuickSearchable(field, mainObject.NAME_FIELD_KEY)) {
|
|
@@ -56433,23 +56446,22 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
56433
56446
|
"clearAndSubmit": true,
|
|
56434
56447
|
"searchImediately": false,
|
|
56435
56448
|
"onEvent": {
|
|
56436
|
-
"
|
|
56449
|
+
"change": {
|
|
56437
56450
|
"actions": [
|
|
56438
56451
|
{
|
|
56439
56452
|
"actionType": "custom",
|
|
56440
56453
|
"script": `
|
|
56441
|
-
|
|
56442
|
-
|
|
56443
|
-
|
|
56444
|
-
|
|
56445
|
-
|
|
56446
|
-
|
|
56447
|
-
|
|
56448
|
-
|
|
56454
|
+
doAction(
|
|
56455
|
+
{
|
|
56456
|
+
"componentId": 'service_${crudId}',
|
|
56457
|
+
"actionType": "setValue",
|
|
56458
|
+
"args": {
|
|
56459
|
+
"value": {
|
|
56460
|
+
"__serachBoxValues": event.data
|
|
56461
|
+
}
|
|
56449
56462
|
}
|
|
56450
|
-
|
|
56451
|
-
|
|
56452
|
-
}
|
|
56463
|
+
}
|
|
56464
|
+
)
|
|
56453
56465
|
`
|
|
56454
56466
|
}
|
|
56455
56467
|
]
|
|
@@ -56461,7 +56473,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
56461
56473
|
}
|
|
56462
56474
|
|
|
56463
56475
|
function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
56464
|
-
showDisplayAs = false, hiddenCount = false, headerToolbarItems,
|
|
56476
|
+
showDisplayAs = false, hiddenCount = false, headerToolbarItems, crudId,
|
|
56465
56477
|
filterVisible = true, isLookup = false, keywordsSearchBoxName } = {}){
|
|
56466
56478
|
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
56467
56479
|
// console.log(`getObjectHeaderToolbar`, mainObject)
|
|
@@ -56565,7 +56577,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
56565
56577
|
};
|
|
56566
56578
|
}
|
|
56567
56579
|
let toolbarDisplayAsButton = getDisplayAsButton(mainObject?.name);
|
|
56568
|
-
let toolbarDQuickSearchBox = getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName });
|
|
56580
|
+
let toolbarDQuickSearchBox = getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName, crudId });
|
|
56569
56581
|
|
|
56570
56582
|
// toolbars返回的数组元素不可以是空对象{},比如hiddenCount ? {} : {"type": "tpl",...},因为空对象最终还是会生成一个空的.antd-Crud-toolbar-item dom
|
|
56571
56583
|
// 当出现空的.antd-Crud-toolbar-item dom时会影响toolbar元素的maring-right css样式计算,如果有动态需要应该加到动态数组变量toolbars中
|
|
@@ -56731,6 +56743,26 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
56731
56743
|
"script": onSubmitSuccScript
|
|
56732
56744
|
}
|
|
56733
56745
|
]
|
|
56746
|
+
},
|
|
56747
|
+
"change": {
|
|
56748
|
+
"actions": [
|
|
56749
|
+
{
|
|
56750
|
+
"actionType": "custom",
|
|
56751
|
+
"script": `
|
|
56752
|
+
doAction(
|
|
56753
|
+
{
|
|
56754
|
+
"componentId": 'service_${options.crudId}',
|
|
56755
|
+
"actionType": "setValue",
|
|
56756
|
+
"args": {
|
|
56757
|
+
"value": {
|
|
56758
|
+
"__filterFormValues": event.data
|
|
56759
|
+
}
|
|
56760
|
+
}
|
|
56761
|
+
}
|
|
56762
|
+
)
|
|
56763
|
+
`
|
|
56764
|
+
}
|
|
56765
|
+
]
|
|
56734
56766
|
}
|
|
56735
56767
|
}
|
|
56736
56768
|
}
|
|
@@ -56934,19 +56966,12 @@ async function lookupToAmisTreeSelect(field, readonly, ctx) {
|
|
|
56934
56966
|
|
|
56935
56967
|
const keywordsSearchBoxName = `__keywords_lookup`;
|
|
56936
56968
|
|
|
56937
|
-
const
|
|
56969
|
+
const getReferenceToFieldSchema = (field, refObjectConfig)=>{
|
|
56938
56970
|
let referenceTo = field.reference_to;
|
|
56939
56971
|
if(!referenceTo){
|
|
56940
|
-
return
|
|
56941
|
-
}
|
|
56942
|
-
|
|
56943
|
-
if(referenceTo === 'users'){
|
|
56944
|
-
referenceTo = 'space_users';
|
|
56945
|
-
field.reference_to_field = 'user';
|
|
56972
|
+
return;
|
|
56946
56973
|
}
|
|
56947
56974
|
|
|
56948
|
-
const refObjectConfig = await getUISchema(referenceTo);
|
|
56949
|
-
|
|
56950
56975
|
// 如果lookup 引用的对象未定义
|
|
56951
56976
|
if (!refObjectConfig)
|
|
56952
56977
|
return null;
|
|
@@ -56969,6 +56994,28 @@ const getReferenceTo = async (field)=>{
|
|
|
56969
56994
|
}
|
|
56970
56995
|
};
|
|
56971
56996
|
|
|
56997
|
+
const getReferenceTo = async (field)=>{
|
|
56998
|
+
let referenceTo = field.reference_to;
|
|
56999
|
+
if(referenceTo === 'users'){
|
|
57000
|
+
field.reference_to = 'space_users';
|
|
57001
|
+
field.reference_to_field = 'user';
|
|
57002
|
+
}
|
|
57003
|
+
|
|
57004
|
+
const refObjectConfig = await getUISchema(field.reference_to);
|
|
57005
|
+
return getReferenceToFieldSchema(field, refObjectConfig);
|
|
57006
|
+
};
|
|
57007
|
+
|
|
57008
|
+
function getReferenceToSync(field) {
|
|
57009
|
+
let referenceTo = field.reference_to;
|
|
57010
|
+
if(referenceTo === 'users'){
|
|
57011
|
+
field.reference_to = 'space_users';
|
|
57012
|
+
field.reference_to_field = 'user';
|
|
57013
|
+
}
|
|
57014
|
+
|
|
57015
|
+
const refObjectConfig = getUISchemaSync(field.reference_to);
|
|
57016
|
+
return getReferenceToFieldSchema(field, refObjectConfig);
|
|
57017
|
+
}
|
|
57018
|
+
|
|
56972
57019
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
56973
57020
|
const treeSchema = {
|
|
56974
57021
|
"type": "input-tree",
|
|
@@ -57562,7 +57609,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
57562
57609
|
// [["_id", "=", "$${field.name}._id"],"or",["name", "contains", "$term"]]
|
|
57563
57610
|
apiInfo.requestAdaptor = `
|
|
57564
57611
|
var filters = [];
|
|
57565
|
-
var top =
|
|
57612
|
+
var top = 200;
|
|
57566
57613
|
if(api.data.$term){
|
|
57567
57614
|
filters = [["${referenceTo?.NAME_FIELD_KEY || 'name'}", "contains", api.data.$term]];
|
|
57568
57615
|
}
|
|
@@ -57868,6 +57915,12 @@ async function getIdsPickerSchema(field, readonly, ctx){
|
|
|
57868
57915
|
return data;
|
|
57869
57916
|
}
|
|
57870
57917
|
|
|
57918
|
+
|
|
57919
|
+
if(typeof window != 'undefined'){
|
|
57920
|
+
window.getReferenceTo = getReferenceTo;
|
|
57921
|
+
window.getReferenceToSync = getReferenceToSync;
|
|
57922
|
+
}
|
|
57923
|
+
|
|
57871
57924
|
/*
|
|
57872
57925
|
* @Author: baozhoutao@steedos.com
|
|
57873
57926
|
* @Date: 2023-01-13 17:27:54
|
|
@@ -58657,6 +58710,29 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
58657
58710
|
}
|
|
58658
58711
|
}
|
|
58659
58712
|
break;
|
|
58713
|
+
case 'table':
|
|
58714
|
+
if(field.subFields){
|
|
58715
|
+
convertData = {
|
|
58716
|
+
type: 'steedos-input-table',
|
|
58717
|
+
showIndex: true,
|
|
58718
|
+
editable: !readonly,
|
|
58719
|
+
addable: !readonly,
|
|
58720
|
+
removable: !readonly,
|
|
58721
|
+
draggable: !readonly,
|
|
58722
|
+
fields: [],
|
|
58723
|
+
amis:{
|
|
58724
|
+
columnsTogglable: false
|
|
58725
|
+
}
|
|
58726
|
+
};
|
|
58727
|
+
for (const subField of field.subFields) {
|
|
58728
|
+
const subFieldName = subField.name.replace(`${field._prefix || ''}${field.name}.$.`, '').replace(`${field.name}.`, '');
|
|
58729
|
+
const gridSub = await convertSFieldToAmisField(Object.assign({}, subField, {name: subFieldName, isTableField: true}), readonly, ctx);
|
|
58730
|
+
if(gridSub){
|
|
58731
|
+
convertData.fields.push(Object.assign({}, subField, {name: subFieldName}));
|
|
58732
|
+
}
|
|
58733
|
+
}
|
|
58734
|
+
}
|
|
58735
|
+
break;
|
|
58660
58736
|
case 'object':
|
|
58661
58737
|
if(field.subFields){
|
|
58662
58738
|
convertData = {
|
|
@@ -58728,7 +58804,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
58728
58804
|
return convertData
|
|
58729
58805
|
}
|
|
58730
58806
|
// if(ctx.mode === 'edit'){
|
|
58731
|
-
|
|
58807
|
+
let convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, field.amis, {name: baseData.name});
|
|
58808
|
+
// console.log("convertDataResult:", convertDataResult);
|
|
58809
|
+
return convertDataResult;
|
|
58732
58810
|
// }else{
|
|
58733
58811
|
// return Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name});
|
|
58734
58812
|
// }
|
|
@@ -58820,38 +58898,9 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
58820
58898
|
|
|
58821
58899
|
const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
|
|
58822
58900
|
if(amisField){
|
|
58823
|
-
|
|
58824
|
-
const isChangeActions = changeActionsFields.indexOf(field.type) > -1;
|
|
58825
|
-
let additionalProps = {
|
|
58901
|
+
return Object.assign({}, amisField,{
|
|
58826
58902
|
submitOnChange: false
|
|
58827
|
-
};
|
|
58828
|
-
if (isChangeActions) {
|
|
58829
|
-
additionalProps.submitOnChange = true;
|
|
58830
|
-
} else {
|
|
58831
|
-
additionalProps.onEvent = {
|
|
58832
|
-
blur: {
|
|
58833
|
-
actions: [
|
|
58834
|
-
{
|
|
58835
|
-
actionType: "custom",
|
|
58836
|
-
script: `
|
|
58837
|
-
try {
|
|
58838
|
-
const scope = event.context.scoped;
|
|
58839
|
-
const filterForm = scope.parent.parent.parent.getComponents().find(function(n) {
|
|
58840
|
-
return n.props.type === "form";
|
|
58841
|
-
});
|
|
58842
|
-
if (filterForm && typeof filterForm.handleFormSubmit === 'function') {
|
|
58843
|
-
filterForm.handleFormSubmit(event);
|
|
58844
|
-
}
|
|
58845
|
-
} catch (error) {
|
|
58846
|
-
console.error('An error occurred:', error);
|
|
58847
|
-
}
|
|
58848
|
-
`
|
|
58849
|
-
}
|
|
58850
|
-
]
|
|
58851
|
-
}
|
|
58852
|
-
};
|
|
58853
|
-
}
|
|
58854
|
-
return Object.assign({}, amisField, additionalProps);
|
|
58903
|
+
});
|
|
58855
58904
|
}
|
|
58856
58905
|
}
|
|
58857
58906
|
}
|
|
@@ -59100,7 +59149,7 @@ async function getUISchema(objectName, force) {
|
|
|
59100
59149
|
return getUISchemaCache(objectName);
|
|
59101
59150
|
}
|
|
59102
59151
|
|
|
59103
|
-
function getUISchemaSync(objectName, force) {
|
|
59152
|
+
function getUISchemaSync$1(objectName, force) {
|
|
59104
59153
|
if (!objectName) {
|
|
59105
59154
|
return;
|
|
59106
59155
|
}
|
|
@@ -59284,7 +59333,7 @@ async function getListSchema(
|
|
|
59284
59333
|
|
|
59285
59334
|
if(typeof window != 'undefined'){
|
|
59286
59335
|
window.getUISchema = getUISchema;
|
|
59287
|
-
window.getUISchemaSync = getUISchemaSync;
|
|
59336
|
+
window.getUISchemaSync = getUISchemaSync$1;
|
|
59288
59337
|
window.getListSchema = getListSchema;
|
|
59289
59338
|
}
|
|
59290
59339
|
|