@ecoding/components.antd 0.4.23 → 0.4.24
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.
|
@@ -12,7 +12,7 @@ import { Upload, Image as Img, Alert, Flex, message, Space } from 'antd';
|
|
|
12
12
|
import { PlusOutlined } from '@ant-design/icons';
|
|
13
13
|
import { buildURL } from "@ecoding/helper.url";
|
|
14
14
|
import { DndContext, PointerSensor, useSensor } from '@dnd-kit/core';
|
|
15
|
-
import { arrayMove, SortableContext, useSortable,
|
|
15
|
+
import { arrayMove, SortableContext, useSortable, rectSortingStrategy, } from '@dnd-kit/sortable';
|
|
16
16
|
import { CSS } from '@dnd-kit/utilities';
|
|
17
17
|
import Toast from "../../core/toast";
|
|
18
18
|
const DraggableUploadListItem = ({ originNode, file }) => {
|
|
@@ -231,7 +231,7 @@ const MultipleImgUpload = (props) => {
|
|
|
231
231
|
!((_c = props.opts) === null || _c === void 0 ? void 0 : _c.minH) ? null : (React.createElement("span", null, i18n ? `${i18n.$t("global.minH", "最小高")}:${props.opts.minH}` : `最小高:${props.opts.minH}`)),
|
|
232
232
|
!((_d = props.opts) === null || _d === void 0 ? void 0 : _d.maxH) ? null : (React.createElement("span", null, i18n ? `${i18n.$t("global.maxH", "最大高")}:${props.opts.maxH}` : `最大高:${props.opts.maxH}`))))) : null)), type: "warning", showIcon: true })),
|
|
233
233
|
React.createElement(DndContext, { sensors: [sensor], onDragEnd: onDragEnd },
|
|
234
|
-
React.createElement(SortableContext, { items: imgList === null || imgList === void 0 ? void 0 : imgList.map((i) => i.uid), strategy:
|
|
234
|
+
React.createElement(SortableContext, { items: imgList === null || imgList === void 0 ? void 0 : imgList.map((i) => i.uid), strategy: rectSortingStrategy },
|
|
235
235
|
React.createElement(Upload, { listType: "picture-card", fileList: imgList, action: action, beforeUpload: beforeUpload, onPreview: handlePreview, onChange: handleChange, onRemove: handleRemove, name: name, data: props.data, multiple: true, disabled: disabled, withCredentials: true, itemRender: (originNode, file) => (React.createElement(DraggableUploadListItem, { originNode: originNode, file: file })) }, maxCount == 0 ? uploadButton : maxCount && imgList.length >= maxCount ? null : uploadButton),
|
|
236
236
|
previewImage && (React.createElement(Img, { wrapperStyle: { display: 'none' }, preview: {
|
|
237
237
|
visible: previewOpen,
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { Flex, Alert, Space } from 'antd';
|
|
3
3
|
import { DragOutlined } from '@ant-design/icons';
|
|
4
4
|
import { DndContext, closestCenter, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';
|
|
5
|
-
import { arrayMove, SortableContext,
|
|
5
|
+
import { arrayMove, SortableContext, rectSortingStrategy, useSortable } from '@dnd-kit/sortable';
|
|
6
6
|
import { CSS } from '@dnd-kit/utilities';
|
|
7
7
|
import ImgUpload from '../single-img-upload';
|
|
8
8
|
const SortableItem = (props) => {
|
|
@@ -120,7 +120,7 @@ const MultiPileImgUpload = (props) => {
|
|
|
120
120
|
!((_c = props.opts) === null || _c === void 0 ? void 0 : _c.minW) ? null : (React.createElement("span", null, props.i18n ? `${props.i18n.$t("global.minW", "最小宽")}:${props.opts.minW}` : `最小宽:${props.opts.minW}`)),
|
|
121
121
|
!((_d = props.opts) === null || _d === void 0 ? void 0 : _d.maxH) ? null : (React.createElement("span", null, props.i18n ? `${props.i18n.$t("global.maxH", "最大高")}:${props.opts.maxH}` : `最大高:${props.opts.maxH}`))))) : null)), type: "warning", showIcon: true })),
|
|
122
122
|
React.createElement(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd },
|
|
123
|
-
React.createElement(SortableContext, { items: items, strategy:
|
|
123
|
+
React.createElement(SortableContext, { items: items, strategy: rectSortingStrategy },
|
|
124
124
|
React.createElement(Flex, { wrap: true, align: "start" }, items.map((item, index) => (React.createElement(SortableItem, Object.assign({}, props, { index: index, items: items, updateItems: updateItems, value: item.url, key: item.id, id: item.id })))))))));
|
|
125
125
|
};
|
|
126
126
|
MultiPileImgUpload.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.24",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"antd": "^6.0.0",
|
|
48
48
|
"axios": "^1.1.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "fe2f4ed23efc30f329c9ca878e2f4928241a6e04"
|
|
51
51
|
}
|