@steedos-widgets/sortable 1.3.12 → 1.3.14
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 +76 -10
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +76 -10
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +76 -10
- package/package.json +3 -3
- package/src/components/MultipleContainers.tsx +16 -2
package/dist/sortable.esm.js
CHANGED
|
@@ -54138,6 +54138,7 @@ var frontend_record_detail_tab_detailed$1 = "Details";
|
|
|
54138
54138
|
var frontend_record_detail_tab_related$1 = "Related";
|
|
54139
54139
|
var frontend_all_apps$1 = "All apps";
|
|
54140
54140
|
var frontend_all_projects$1 = "All projects";
|
|
54141
|
+
var frontend_open_app_launcher$1 = "Open App Launcher";
|
|
54141
54142
|
var frontend_application_launcher$1 = "Application launcher";
|
|
54142
54143
|
var frontend_menu$1 = "Menu";
|
|
54143
54144
|
var frontend_help$1 = "Help";
|
|
@@ -54223,6 +54224,7 @@ var en_us = {
|
|
|
54223
54224
|
frontend_record_detail_tab_related: frontend_record_detail_tab_related$1,
|
|
54224
54225
|
frontend_all_apps: frontend_all_apps$1,
|
|
54225
54226
|
frontend_all_projects: frontend_all_projects$1,
|
|
54227
|
+
frontend_open_app_launcher: frontend_open_app_launcher$1,
|
|
54226
54228
|
frontend_application_launcher: frontend_application_launcher$1,
|
|
54227
54229
|
frontend_menu: frontend_menu$1,
|
|
54228
54230
|
frontend_help: frontend_help$1,
|
|
@@ -54310,6 +54312,7 @@ var frontend_record_detail_tab_detailed = "详细";
|
|
|
54310
54312
|
var frontend_record_detail_tab_related = "相关";
|
|
54311
54313
|
var frontend_all_apps = "所有应用";
|
|
54312
54314
|
var frontend_all_projects = "所有项目";
|
|
54315
|
+
var frontend_open_app_launcher = "打开应用程序启动器";
|
|
54313
54316
|
var frontend_application_launcher = "应用程序启动器";
|
|
54314
54317
|
var frontend_menu = "菜单";
|
|
54315
54318
|
var frontend_help = "帮助";
|
|
@@ -54396,6 +54399,7 @@ var zh_cn = {
|
|
|
54396
54399
|
frontend_record_detail_tab_related: frontend_record_detail_tab_related,
|
|
54397
54400
|
frontend_all_apps: frontend_all_apps,
|
|
54398
54401
|
frontend_all_projects: frontend_all_projects,
|
|
54402
|
+
frontend_open_app_launcher: frontend_open_app_launcher,
|
|
54399
54403
|
frontend_application_launcher: frontend_application_launcher,
|
|
54400
54404
|
frontend_menu: frontend_menu,
|
|
54401
54405
|
frontend_help: frontend_help,
|
|
@@ -56423,7 +56427,30 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
56423
56427
|
"value": crudKeywords,
|
|
56424
56428
|
"clearable": true,
|
|
56425
56429
|
"clearAndSubmit": true,
|
|
56426
|
-
"searchImediately": false
|
|
56430
|
+
"searchImediately": false,
|
|
56431
|
+
"onEvent": {
|
|
56432
|
+
"blur": {
|
|
56433
|
+
"actions": [
|
|
56434
|
+
{
|
|
56435
|
+
"actionType": "custom",
|
|
56436
|
+
"script": `
|
|
56437
|
+
try {
|
|
56438
|
+
const scope = event.context.scoped;
|
|
56439
|
+
const filterCrud = scope.parent.getComponents().find(function(n) {
|
|
56440
|
+
return n.props.type === "crud";
|
|
56441
|
+
});
|
|
56442
|
+
if (filterCrud && typeof filterCrud.reload === 'function') {
|
|
56443
|
+
const keyWords = { '${keywordsSearchBoxName}': event.data.value };
|
|
56444
|
+
filterCrud.reload(null, keyWords);
|
|
56445
|
+
}
|
|
56446
|
+
} catch (error) {
|
|
56447
|
+
console.error('An error occurred:', error);
|
|
56448
|
+
}
|
|
56449
|
+
`
|
|
56450
|
+
}
|
|
56451
|
+
]
|
|
56452
|
+
}
|
|
56453
|
+
}
|
|
56427
56454
|
}
|
|
56428
56455
|
]
|
|
56429
56456
|
}
|
|
@@ -58014,8 +58041,8 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
58014
58041
|
/*
|
|
58015
58042
|
* @Author: baozhoutao@steedos.com
|
|
58016
58043
|
* @Date: 2022-10-28 14:15:09
|
|
58017
|
-
* @LastEditors:
|
|
58018
|
-
* @LastEditTime: 2023-
|
|
58044
|
+
* @LastEditors: 孙浩林 sunhaolin@steedos.com
|
|
58045
|
+
* @LastEditTime: 2023-11-24 13:45:24
|
|
58019
58046
|
* @Description:
|
|
58020
58047
|
*/
|
|
58021
58048
|
|
|
@@ -58052,7 +58079,7 @@ const getAmisFileReadonlySchema = (steedosField)=>{
|
|
|
58052
58079
|
<% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
58053
58080
|
<% if(!Array.isArray(fileData)){ fileData = [fileData]} %>
|
|
58054
58081
|
<% fileData.forEach(function(item) { %>
|
|
58055
|
-
<a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
58082
|
+
<a href='<%= item.url+"?download=1" %>' target='_self' class='block'><%= item.name %></a>
|
|
58056
58083
|
<% });} %>`
|
|
58057
58084
|
}
|
|
58058
58085
|
}
|
|
@@ -58789,9 +58816,38 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
58789
58816
|
|
|
58790
58817
|
const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
|
|
58791
58818
|
if(amisField){
|
|
58792
|
-
|
|
58793
|
-
|
|
58794
|
-
|
|
58819
|
+
const changeActionsFields = ['select', 'boolean', 'toggle', 'date', 'datetime', 'time', 'number', 'currency', 'lookup', 'master_detail'];
|
|
58820
|
+
const isChangeActions = changeActionsFields.indexOf(field.type) > -1;
|
|
58821
|
+
let additionalProps = {
|
|
58822
|
+
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);
|
|
58795
58851
|
}
|
|
58796
58852
|
}
|
|
58797
58853
|
}
|
|
@@ -65580,6 +65636,12 @@ function MultipleContainers(props) {
|
|
|
65580
65636
|
"type": "tpl",
|
|
65581
65637
|
"tpl": "${label}",
|
|
65582
65638
|
}] : _r, _s = props.boardFooter, boardFooter = _s === void 0 ? [] : _s, _t = props.wrapperClassName, wrapperClassName = _t === void 0 ? "gap-2" : _t, _u = props.boardClassName, boardClassName = _u === void 0 ? "border rounded" : _u, _v = props.cardClassName, cardClassName = _v === void 0 ? "" : _v;
|
|
65639
|
+
if (!props.data) {
|
|
65640
|
+
// 为了解决3.2 dispatchevent不生效的问题, https://github.com/baidu/amis/issues/7488
|
|
65641
|
+
// 如果data为undefined,dispatchEvent时第三个参数传入的current的data为undefined会报错
|
|
65642
|
+
props.data = {};
|
|
65643
|
+
}
|
|
65644
|
+
var MultipleContainersRef = react.exports.useRef();
|
|
65583
65645
|
value && delete (value.$$id);
|
|
65584
65646
|
var _w = __read(react.exports.useState(function () {
|
|
65585
65647
|
var _a;
|
|
@@ -65604,7 +65666,7 @@ function MultipleContainers(props) {
|
|
|
65604
65666
|
value = newItems || items;
|
|
65605
65667
|
return [4 /*yield*/, amisDispatchEvent('change', createObject(amisData, {
|
|
65606
65668
|
value: value
|
|
65607
|
-
}))];
|
|
65669
|
+
}), MultipleContainersRef.current)];
|
|
65608
65670
|
case 1:
|
|
65609
65671
|
rendererEvent = _a.sent();
|
|
65610
65672
|
if (rendererEvent === null || rendererEvent === void 0 ? void 0 : rendererEvent.prevented) {
|
|
@@ -65701,7 +65763,7 @@ function MultipleContainers(props) {
|
|
|
65701
65763
|
recentlyMovedToNewContainer.current = false;
|
|
65702
65764
|
});
|
|
65703
65765
|
}, [items]);
|
|
65704
|
-
|
|
65766
|
+
var multipleContainers = (React.createElement(DndContext, __assign$1({ sensors: sensors, collisionDetection: collisionDetectionStrategy, measuring: {
|
|
65705
65767
|
droppable: {
|
|
65706
65768
|
strategy: MeasuringStrategy.Always,
|
|
65707
65769
|
},
|
|
@@ -65827,7 +65889,7 @@ function MultipleContainers(props) {
|
|
|
65827
65889
|
setActiveId(null);
|
|
65828
65890
|
// console.log('拖动结束2,更新form value')
|
|
65829
65891
|
handleChange(newItems);
|
|
65830
|
-
}, cancelDrop: cancelDrop, onDragCancel: onDragCancel, modifiers: modifiers },
|
|
65892
|
+
}, cancelDrop: cancelDrop, onDragCancel: onDragCancel, modifiers: modifiers }, props),
|
|
65831
65893
|
React.createElement("div", { style: {
|
|
65832
65894
|
display: 'inline-grid',
|
|
65833
65895
|
boxSizing: 'border-box',
|
|
@@ -65859,6 +65921,10 @@ function MultipleContainers(props) {
|
|
|
65859
65921
|
: renderSortableItemDragOverlay(activeId)
|
|
65860
65922
|
: null), document.body),
|
|
65861
65923
|
trashable && activeId && !containers.includes(activeId) ? (React.createElement(Trash, { id: TRASH_ID })) : null)));
|
|
65924
|
+
// 为了解决3.2 dispatchevent不生效的问题, https://github.com/baidu/amis/issues/7488
|
|
65925
|
+
// dispatchEvent时第三个参数传入的current必须是一个带props属性的对象
|
|
65926
|
+
MultipleContainersRef.current = multipleContainers;
|
|
65927
|
+
return multipleContainers;
|
|
65862
65928
|
function renderSortableItemDragOverlay(id) {
|
|
65863
65929
|
var item = lodash.exports.cloneDeep(lodash.exports.keyBy(cardSource, 'id')[id]) || { id: id, label: '' + id, columnSpan: 1 };
|
|
65864
65930
|
if (item.columnSpan && item.columnSpan > columns)
|