@pisell/materials 1.0.319 → 1.0.320
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/MultipleContainersSortList/index.d.ts +5 -5
- package/es/components/MultipleContainersSortList/index.js +10 -10
- package/lib/components/MultipleContainersSortList/index.d.ts +5 -5
- package/lib/components/MultipleContainersSortList/index.js +16 -11
- package/package.json +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { SortableItemProps } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SortableItemProps } from '../DragSortList';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare type IdType = string | number;
|
|
5
5
|
export interface MultipleContainersSortListProps<T> {
|
|
6
6
|
list: Record<string, T[]>;
|
|
7
7
|
vertical?: boolean;
|
|
8
8
|
wrapStyle?: React.CSSProperties;
|
|
9
9
|
onChange: (val: Record<string, T[]>) => void;
|
|
10
|
-
renderContainer?: DefaultRenderContainerProps[
|
|
10
|
+
renderContainer?: DefaultRenderContainerProps['renderContainer'];
|
|
11
11
|
rowKey: IdType | ((val: T) => IdType);
|
|
12
|
-
children: SortableItemProps<T>[
|
|
12
|
+
children: SortableItemProps<T>['children'];
|
|
13
13
|
quickFilterMaxLength: number;
|
|
14
14
|
}
|
|
15
15
|
export declare const TRASH_ID = "void";
|
|
@@ -14,14 +14,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
14
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
15
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
import { DndContext } from
|
|
18
|
-
import { SortableContext, arrayMove, verticalListSortingStrategy, useSortable } from
|
|
19
|
-
import { isFunction } from
|
|
20
|
-
import React, { useCallback, useEffect, useState } from
|
|
17
|
+
import { DndContext } from '@dnd-kit/core';
|
|
18
|
+
import { SortableContext, arrayMove, verticalListSortingStrategy, useSortable } from '@dnd-kit/sortable';
|
|
19
|
+
import { isFunction } from '@pisell/utils';
|
|
20
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
21
21
|
import { SortableItem } from "../DragSortList";
|
|
22
22
|
import "./index.less";
|
|
23
23
|
import { getText } from "../../locales";
|
|
24
|
-
export var TRASH_ID =
|
|
24
|
+
export var TRASH_ID = 'void';
|
|
25
25
|
var DefaultRenderContainer = function DefaultRenderContainer(props) {
|
|
26
26
|
var id = props.id,
|
|
27
27
|
children = props.children,
|
|
@@ -48,7 +48,7 @@ var MultipleContainersSortList = function MultipleContainersSortList(props) {
|
|
|
48
48
|
onChange = props.onChange,
|
|
49
49
|
renderContainer = props.renderContainer,
|
|
50
50
|
_props$rowKey = props.rowKey,
|
|
51
|
-
rowKey = _props$rowKey === void 0 ?
|
|
51
|
+
rowKey = _props$rowKey === void 0 ? 'id' : _props$rowKey,
|
|
52
52
|
quickFilterMaxLength = props.quickFilterMaxLength;
|
|
53
53
|
var _useState = useState([]),
|
|
54
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -106,7 +106,7 @@ var MultipleContainersSortList = function MultipleContainersSortList(props) {
|
|
|
106
106
|
var newList = _objectSpread(_objectSpread({}, list), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, activeContainer, list[activeContainer].filter(function (item) {
|
|
107
107
|
return getRowKey(item) !== active.id;
|
|
108
108
|
})), _defineProperty(_objectSpread2, overContainer, [].concat(_toConsumableArray(list[overContainer].slice(0, newIndex)), [list[activeContainer][activeIndex]], _toConsumableArray(list[overContainer].slice(newIndex, list[overContainer].length)))), _objectSpread2));
|
|
109
|
-
if (overContainer ===
|
|
109
|
+
if (overContainer === 'quickFilter' && newList[overContainer].length > quickFilterMaxLength) {
|
|
110
110
|
var _objectSpread3;
|
|
111
111
|
newList = _objectSpread(_objectSpread({}, newList), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, overContainer, newList[overContainer].slice(0, quickFilterMaxLength)), _defineProperty(_objectSpread3, activeContainer, [].concat(_toConsumableArray(newList[overContainer].slice(quickFilterMaxLength)), _toConsumableArray(newList[activeContainer]))), _objectSpread3));
|
|
112
112
|
}
|
|
@@ -152,15 +152,15 @@ var MultipleContainersSortList = function MultipleContainersSortList(props) {
|
|
|
152
152
|
}),
|
|
153
153
|
strategy: verticalListSortingStrategy
|
|
154
154
|
}, list[container].length ? list[container].map(function (item, index) {
|
|
155
|
-
return /*#__PURE__*/React.createElement(SortableItem, {
|
|
155
|
+
return !(item !== null && item !== void 0 && item.isHidden) ? /*#__PURE__*/React.createElement(SortableItem, {
|
|
156
156
|
key: getRowKey(item),
|
|
157
157
|
id: getRowKey(item),
|
|
158
158
|
item: item,
|
|
159
159
|
index: index
|
|
160
|
-
}, children);
|
|
160
|
+
}, children) : null;
|
|
161
161
|
}) : /*#__PURE__*/React.createElement("span", {
|
|
162
162
|
className: "materials-sort-list-empty"
|
|
163
|
-
}, getText(
|
|
163
|
+
}, getText('table-action-filter-no-filter'))));
|
|
164
164
|
})));
|
|
165
165
|
};
|
|
166
166
|
export default MultipleContainersSortList;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { SortableItemProps } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SortableItemProps } from '../DragSortList';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare type IdType = string | number;
|
|
5
5
|
export interface MultipleContainersSortListProps<T> {
|
|
6
6
|
list: Record<string, T[]>;
|
|
7
7
|
vertical?: boolean;
|
|
8
8
|
wrapStyle?: React.CSSProperties;
|
|
9
9
|
onChange: (val: Record<string, T[]>) => void;
|
|
10
|
-
renderContainer?: DefaultRenderContainerProps[
|
|
10
|
+
renderContainer?: DefaultRenderContainerProps['renderContainer'];
|
|
11
11
|
rowKey: IdType | ((val: T) => IdType);
|
|
12
|
-
children: SortableItemProps<T>[
|
|
12
|
+
children: SortableItemProps<T>['children'];
|
|
13
13
|
quickFilterMaxLength: number;
|
|
14
14
|
}
|
|
15
15
|
export declare const TRASH_ID = "void";
|
|
@@ -123,7 +123,10 @@ var MultipleContainersSortList = (props) => {
|
|
|
123
123
|
if (overContainer === "quickFilter" && newList[overContainer].length > quickFilterMaxLength) {
|
|
124
124
|
newList = {
|
|
125
125
|
...newList,
|
|
126
|
-
[overContainer]: newList[overContainer].slice(
|
|
126
|
+
[overContainer]: newList[overContainer].slice(
|
|
127
|
+
0,
|
|
128
|
+
quickFilterMaxLength
|
|
129
|
+
),
|
|
127
130
|
[activeContainer]: [
|
|
128
131
|
...newList[overContainer].slice(quickFilterMaxLength),
|
|
129
132
|
...newList[activeContainer]
|
|
@@ -174,16 +177,18 @@ var MultipleContainersSortList = (props) => {
|
|
|
174
177
|
items: list[container].map((item) => getRowKey(item)),
|
|
175
178
|
strategy: import_sortable.verticalListSortingStrategy
|
|
176
179
|
},
|
|
177
|
-
list[container].length ? list[container].map(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
list[container].length ? list[container].map(
|
|
181
|
+
(item, index) => !(item == null ? void 0 : item.isHidden) ? /* @__PURE__ */ import_react.default.createElement(
|
|
182
|
+
import_DragSortList.SortableItem,
|
|
183
|
+
{
|
|
184
|
+
key: getRowKey(item),
|
|
185
|
+
id: getRowKey(item),
|
|
186
|
+
item,
|
|
187
|
+
index
|
|
188
|
+
},
|
|
189
|
+
children
|
|
190
|
+
) : null
|
|
191
|
+
) : /* @__PURE__ */ import_react.default.createElement("span", { className: "materials-sort-list-empty" }, (0, import_locales.getText)("table-action-filter-no-filter"))
|
|
187
192
|
)
|
|
188
193
|
))));
|
|
189
194
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.320",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"react-window": "^1.8.10",
|
|
63
63
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
64
64
|
"crypto-js": "^4.2.0",
|
|
65
|
-
"@pisell/utils": "1.0.27",
|
|
66
65
|
"@pisell/icon": "0.0.10",
|
|
66
|
+
"@pisell/utils": "1.0.27",
|
|
67
67
|
"@pisell/date-picker": "1.0.75"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|