@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/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.14/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@1.3.14/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.14/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.14/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@1.3.14/dist/meta.js"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
]
|
package/dist/sortable.cjs.js
CHANGED
|
@@ -54142,6 +54142,7 @@ var frontend_record_detail_tab_detailed$1 = "Details";
|
|
|
54142
54142
|
var frontend_record_detail_tab_related$1 = "Related";
|
|
54143
54143
|
var frontend_all_apps$1 = "All apps";
|
|
54144
54144
|
var frontend_all_projects$1 = "All projects";
|
|
54145
|
+
var frontend_open_app_launcher$1 = "Open App Launcher";
|
|
54145
54146
|
var frontend_application_launcher$1 = "Application launcher";
|
|
54146
54147
|
var frontend_menu$1 = "Menu";
|
|
54147
54148
|
var frontend_help$1 = "Help";
|
|
@@ -54227,6 +54228,7 @@ var en_us = {
|
|
|
54227
54228
|
frontend_record_detail_tab_related: frontend_record_detail_tab_related$1,
|
|
54228
54229
|
frontend_all_apps: frontend_all_apps$1,
|
|
54229
54230
|
frontend_all_projects: frontend_all_projects$1,
|
|
54231
|
+
frontend_open_app_launcher: frontend_open_app_launcher$1,
|
|
54230
54232
|
frontend_application_launcher: frontend_application_launcher$1,
|
|
54231
54233
|
frontend_menu: frontend_menu$1,
|
|
54232
54234
|
frontend_help: frontend_help$1,
|
|
@@ -54314,6 +54316,7 @@ var frontend_record_detail_tab_detailed = "详细";
|
|
|
54314
54316
|
var frontend_record_detail_tab_related = "相关";
|
|
54315
54317
|
var frontend_all_apps = "所有应用";
|
|
54316
54318
|
var frontend_all_projects = "所有项目";
|
|
54319
|
+
var frontend_open_app_launcher = "打开应用程序启动器";
|
|
54317
54320
|
var frontend_application_launcher = "应用程序启动器";
|
|
54318
54321
|
var frontend_menu = "菜单";
|
|
54319
54322
|
var frontend_help = "帮助";
|
|
@@ -54400,6 +54403,7 @@ var zh_cn = {
|
|
|
54400
54403
|
frontend_record_detail_tab_related: frontend_record_detail_tab_related,
|
|
54401
54404
|
frontend_all_apps: frontend_all_apps,
|
|
54402
54405
|
frontend_all_projects: frontend_all_projects,
|
|
54406
|
+
frontend_open_app_launcher: frontend_open_app_launcher,
|
|
54403
54407
|
frontend_application_launcher: frontend_application_launcher,
|
|
54404
54408
|
frontend_menu: frontend_menu,
|
|
54405
54409
|
frontend_help: frontend_help,
|
|
@@ -56427,7 +56431,30 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
56427
56431
|
"value": crudKeywords,
|
|
56428
56432
|
"clearable": true,
|
|
56429
56433
|
"clearAndSubmit": true,
|
|
56430
|
-
"searchImediately": false
|
|
56434
|
+
"searchImediately": false,
|
|
56435
|
+
"onEvent": {
|
|
56436
|
+
"blur": {
|
|
56437
|
+
"actions": [
|
|
56438
|
+
{
|
|
56439
|
+
"actionType": "custom",
|
|
56440
|
+
"script": `
|
|
56441
|
+
try {
|
|
56442
|
+
const scope = event.context.scoped;
|
|
56443
|
+
const filterCrud = scope.parent.getComponents().find(function(n) {
|
|
56444
|
+
return n.props.type === "crud";
|
|
56445
|
+
});
|
|
56446
|
+
if (filterCrud && typeof filterCrud.reload === 'function') {
|
|
56447
|
+
const keyWords = { '${keywordsSearchBoxName}': event.data.value };
|
|
56448
|
+
filterCrud.reload(null, keyWords);
|
|
56449
|
+
}
|
|
56450
|
+
} catch (error) {
|
|
56451
|
+
console.error('An error occurred:', error);
|
|
56452
|
+
}
|
|
56453
|
+
`
|
|
56454
|
+
}
|
|
56455
|
+
]
|
|
56456
|
+
}
|
|
56457
|
+
}
|
|
56431
56458
|
}
|
|
56432
56459
|
]
|
|
56433
56460
|
}
|
|
@@ -58018,8 +58045,8 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
58018
58045
|
/*
|
|
58019
58046
|
* @Author: baozhoutao@steedos.com
|
|
58020
58047
|
* @Date: 2022-10-28 14:15:09
|
|
58021
|
-
* @LastEditors:
|
|
58022
|
-
* @LastEditTime: 2023-
|
|
58048
|
+
* @LastEditors: 孙浩林 sunhaolin@steedos.com
|
|
58049
|
+
* @LastEditTime: 2023-11-24 13:45:24
|
|
58023
58050
|
* @Description:
|
|
58024
58051
|
*/
|
|
58025
58052
|
|
|
@@ -58056,7 +58083,7 @@ const getAmisFileReadonlySchema = (steedosField)=>{
|
|
|
58056
58083
|
<% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
58057
58084
|
<% if(!Array.isArray(fileData)){ fileData = [fileData]} %>
|
|
58058
58085
|
<% fileData.forEach(function(item) { %>
|
|
58059
|
-
<a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
58086
|
+
<a href='<%= item.url+"?download=1" %>' target='_self' class='block'><%= item.name %></a>
|
|
58060
58087
|
<% });} %>`
|
|
58061
58088
|
}
|
|
58062
58089
|
}
|
|
@@ -58793,9 +58820,38 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
58793
58820
|
|
|
58794
58821
|
const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
|
|
58795
58822
|
if(amisField){
|
|
58796
|
-
|
|
58797
|
-
|
|
58798
|
-
|
|
58823
|
+
const changeActionsFields = ['select', 'boolean', 'toggle', 'date', 'datetime', 'time', 'number', 'currency', 'lookup', 'master_detail'];
|
|
58824
|
+
const isChangeActions = changeActionsFields.indexOf(field.type) > -1;
|
|
58825
|
+
let additionalProps = {
|
|
58826
|
+
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);
|
|
58799
58855
|
}
|
|
58800
58856
|
}
|
|
58801
58857
|
}
|
|
@@ -65584,6 +65640,12 @@ function MultipleContainers(props) {
|
|
|
65584
65640
|
"type": "tpl",
|
|
65585
65641
|
"tpl": "${label}",
|
|
65586
65642
|
}] : _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;
|
|
65643
|
+
if (!props.data) {
|
|
65644
|
+
// 为了解决3.2 dispatchevent不生效的问题, https://github.com/baidu/amis/issues/7488
|
|
65645
|
+
// 如果data为undefined,dispatchEvent时第三个参数传入的current的data为undefined会报错
|
|
65646
|
+
props.data = {};
|
|
65647
|
+
}
|
|
65648
|
+
var MultipleContainersRef = react.exports.useRef();
|
|
65587
65649
|
value && delete (value.$$id);
|
|
65588
65650
|
var _w = __read(react.exports.useState(function () {
|
|
65589
65651
|
var _a;
|
|
@@ -65608,7 +65670,7 @@ function MultipleContainers(props) {
|
|
|
65608
65670
|
value = newItems || items;
|
|
65609
65671
|
return [4 /*yield*/, amisDispatchEvent('change', createObject(amisData, {
|
|
65610
65672
|
value: value
|
|
65611
|
-
}))];
|
|
65673
|
+
}), MultipleContainersRef.current)];
|
|
65612
65674
|
case 1:
|
|
65613
65675
|
rendererEvent = _a.sent();
|
|
65614
65676
|
if (rendererEvent === null || rendererEvent === void 0 ? void 0 : rendererEvent.prevented) {
|
|
@@ -65705,7 +65767,7 @@ function MultipleContainers(props) {
|
|
|
65705
65767
|
recentlyMovedToNewContainer.current = false;
|
|
65706
65768
|
});
|
|
65707
65769
|
}, [items]);
|
|
65708
|
-
|
|
65770
|
+
var multipleContainers = (React.createElement(DndContext, __assign$1({ sensors: sensors, collisionDetection: collisionDetectionStrategy, measuring: {
|
|
65709
65771
|
droppable: {
|
|
65710
65772
|
strategy: MeasuringStrategy.Always,
|
|
65711
65773
|
},
|
|
@@ -65831,7 +65893,7 @@ function MultipleContainers(props) {
|
|
|
65831
65893
|
setActiveId(null);
|
|
65832
65894
|
// console.log('拖动结束2,更新form value')
|
|
65833
65895
|
handleChange(newItems);
|
|
65834
|
-
}, cancelDrop: cancelDrop, onDragCancel: onDragCancel, modifiers: modifiers },
|
|
65896
|
+
}, cancelDrop: cancelDrop, onDragCancel: onDragCancel, modifiers: modifiers }, props),
|
|
65835
65897
|
React.createElement("div", { style: {
|
|
65836
65898
|
display: 'inline-grid',
|
|
65837
65899
|
boxSizing: 'border-box',
|
|
@@ -65863,6 +65925,10 @@ function MultipleContainers(props) {
|
|
|
65863
65925
|
: renderSortableItemDragOverlay(activeId)
|
|
65864
65926
|
: null), document.body),
|
|
65865
65927
|
trashable && activeId && !containers.includes(activeId) ? (React.createElement(Trash, { id: TRASH_ID })) : null)));
|
|
65928
|
+
// 为了解决3.2 dispatchevent不生效的问题, https://github.com/baidu/amis/issues/7488
|
|
65929
|
+
// dispatchEvent时第三个参数传入的current必须是一个带props属性的对象
|
|
65930
|
+
MultipleContainersRef.current = multipleContainers;
|
|
65931
|
+
return multipleContainers;
|
|
65866
65932
|
function renderSortableItemDragOverlay(id) {
|
|
65867
65933
|
var item = lodash.exports.cloneDeep(lodash.exports.keyBy(cardSource, 'id')[id]) || { id: id, label: '' + id, columnSpan: 1 };
|
|
65868
65934
|
if (item.columnSpan && item.columnSpan > columns)
|