@pisell/materials 1.0.319 → 1.0.321

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.
@@ -1,15 +1,15 @@
1
- import React from "react";
2
- import { SortableItemProps } from "../DragSortList";
3
- import "./index.less";
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["renderContainer"];
10
+ renderContainer?: DefaultRenderContainerProps['renderContainer'];
11
11
  rowKey: IdType | ((val: T) => IdType);
12
- children: SortableItemProps<T>["children"];
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 "@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";
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 = "void";
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 ? "id" : _props$rowKey,
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 === "quickFilter" && newList[overContainer].length > quickFilterMaxLength) {
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("table-action-filter-no-filter"))));
163
+ }, getText('table-action-filter-no-filter'))));
164
164
  })));
165
165
  };
166
166
  export default MultipleContainersSortList;
@@ -1,6 +1,6 @@
1
- import type { FormInstance } from "antd/es/form";
2
- import React from "react";
3
- import "./index.less";
1
+ import type { FormInstance } from 'antd/es/form';
2
+ import React from 'react';
3
+ import './index.less';
4
4
  export declare const EditableContext: React.Context<FormInstance<any> | null>;
5
5
  interface Item {
6
6
  key: string;
@@ -10,7 +10,7 @@ interface Item {
10
10
  }
11
11
  export interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
12
12
  index: number;
13
- "data-row-key": string;
13
+ 'data-row-key': string;
14
14
  __is_group?: boolean;
15
15
  __table_group_field?: string;
16
16
  __is_drag_sort?: boolean;
@@ -15,12 +15,12 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
17
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
- import { Form, Tooltip } from "antd";
19
- import { useSortable } from "@dnd-kit/sortable";
20
- import { CSS } from "@dnd-kit/utilities";
21
- import { MenuOutlined } from "@ant-design/icons";
22
- import classNames from "classnames";
23
- import React, { useMemo } from "react";
18
+ import { Form, Tooltip } from 'antd';
19
+ import { useSortable } from '@dnd-kit/sortable';
20
+ import { CSS } from '@dnd-kit/utilities';
21
+ import { MenuOutlined } from '@ant-design/icons';
22
+ import classNames from 'classnames';
23
+ import React, { useMemo } from 'react';
24
24
  import CellProvider from "./CellProvider";
25
25
  import { getText } from "../../../../../locales";
26
26
  import "./index.less";
@@ -35,9 +35,9 @@ var EditableRow = function EditableRow(_ref) {
35
35
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
36
36
  form = _Form$useForm2[0];
37
37
  var parentForm = Form.useFormInstance();
38
- var order_by = Form.useWatch("order_by", parentForm);
38
+ var order_by = Form.useWatch('order_by', parentForm);
39
39
  var _useSortable = useSortable({
40
- id: props["data-row-key"]
40
+ id: props['data-row-key']
41
41
  }),
42
42
  attributes = _useSortable.attributes,
43
43
  listeners = _useSortable.listeners,
@@ -52,7 +52,7 @@ var EditableRow = function EditableRow(_ref) {
52
52
  })),
53
53
  transition: transition
54
54
  }, isDragging && __is_drag_sort ? {
55
- position: "relative",
55
+ position: 'relative',
56
56
  zIndex: 9999
57
57
  } : {});
58
58
  var cells = useMemo(function () {
@@ -60,20 +60,14 @@ var EditableRow = function EditableRow(_ref) {
60
60
  return children;
61
61
  }
62
62
  return React.Children.map(children, function (child) {
63
- if (child.key === "__sort") {
63
+ if (child.key === '__sort') {
64
64
  var handleIcon = order_by ? /*#__PURE__*/React.createElement(Tooltip, {
65
- title: getText("table-column-drag-sort-disabled-tip")
65
+ title: getText('table-column-drag-sort-disabled-tip')
66
66
  }, /*#__PURE__*/React.createElement(MenuOutlined, {
67
- style: {
68
- touchAction: "none",
69
- cursor: "move"
70
- }
67
+ className: "pisell-lowcode-menu-out-lined-icon"
71
68
  })) : /*#__PURE__*/React.createElement(MenuOutlined, _extends({
72
69
  ref: setActivatorNodeRef,
73
- style: {
74
- touchAction: "none",
75
- cursor: "move"
76
- }
70
+ className: "pisell-lowcode-menu-out-lined-icon"
77
71
  }, listeners));
78
72
  return /*#__PURE__*/React.cloneElement(child, {
79
73
  children: handleIcon
@@ -108,7 +102,7 @@ var EditableCell = function EditableCell(props) {
108
102
  render = props.render,
109
103
  restProps = _objectWithoutProperties(props, _excluded2);
110
104
  return /*#__PURE__*/React.createElement("td", _extends({}, restProps, {
111
- className: classNames(restProps.className, "ant-table-cell", "materials-grid-table-cell")
105
+ className: classNames(restProps.className, 'ant-table-cell', 'materials-grid-table-cell')
112
106
  }), /*#__PURE__*/React.createElement(CellProvider, props));
113
107
  };
114
108
  export default {
@@ -3,6 +3,19 @@
3
3
  height: 100%;
4
4
  }
5
5
 
6
+ .pisell-lowcode-menu-out-lined-icon{
7
+ position: absolute;
8
+ top: 0;
9
+ left: 0;
10
+ width: 100%;
11
+ height: 100%;
12
+ display: flex;
13
+ justify-content: center;
14
+ align-items: center;
15
+ cursor: move;
16
+ touch-action: none;
17
+ }
18
+
6
19
  .materials-grid-table-cell {
7
20
  padding: 12px;
8
21
  }
@@ -29,6 +29,9 @@
29
29
  display: flex;
30
30
  align-items: center;
31
31
  justify-content: center;
32
+ position: absolute;
33
+ top: 0;
34
+ left: 0;
32
35
  }
33
36
  }
34
37
  }
@@ -42,6 +45,9 @@
42
45
  display: flex;
43
46
  align-items: center;
44
47
  justify-content: center;
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
45
51
  }
46
52
  }
47
53
 
@@ -1,15 +1,15 @@
1
- import React from "react";
2
- import { SortableItemProps } from "../DragSortList";
3
- import "./index.less";
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["renderContainer"];
10
+ renderContainer?: DefaultRenderContainerProps['renderContainer'];
11
11
  rowKey: IdType | ((val: T) => IdType);
12
- children: SortableItemProps<T>["children"];
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(0, quickFilterMaxLength),
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((item, index) => /* @__PURE__ */ import_react.default.createElement(
178
- import_DragSortList.SortableItem,
179
- {
180
- key: getRowKey(item),
181
- id: getRowKey(item),
182
- item,
183
- index
184
- },
185
- children
186
- )) : /* @__PURE__ */ import_react.default.createElement("span", { className: "materials-sort-list-empty" }, (0, import_locales.getText)("table-action-filter-no-filter"))
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
  };
@@ -1,6 +1,6 @@
1
- import type { FormInstance } from "antd/es/form";
2
- import React from "react";
3
- import "./index.less";
1
+ import type { FormInstance } from 'antd/es/form';
2
+ import React from 'react';
3
+ import './index.less';
4
4
  export declare const EditableContext: React.Context<FormInstance<any> | null>;
5
5
  interface Item {
6
6
  key: string;
@@ -10,7 +10,7 @@ interface Item {
10
10
  }
11
11
  export interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
12
12
  index: number;
13
- "data-row-key": string;
13
+ 'data-row-key': string;
14
14
  __is_group?: boolean;
15
15
  __table_group_field?: string;
16
16
  __is_drag_sort?: boolean;
@@ -80,11 +80,11 @@ var EditableRow = ({
80
80
  }
81
81
  return import_react.default.Children.map(children, (child) => {
82
82
  if (child.key === "__sort") {
83
- const handleIcon = order_by ? /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { title: (0, import_locales.getText)("table-column-drag-sort-disabled-tip") }, /* @__PURE__ */ import_react.default.createElement(import_icons.MenuOutlined, { style: { touchAction: "none", cursor: "move" } })) : /* @__PURE__ */ import_react.default.createElement(
83
+ const handleIcon = order_by ? /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { title: (0, import_locales.getText)("table-column-drag-sort-disabled-tip") }, /* @__PURE__ */ import_react.default.createElement(import_icons.MenuOutlined, { className: "pisell-lowcode-menu-out-lined-icon" })) : /* @__PURE__ */ import_react.default.createElement(
84
84
  import_icons.MenuOutlined,
85
85
  {
86
86
  ref: setActivatorNodeRef,
87
- style: { touchAction: "none", cursor: "move" },
87
+ className: "pisell-lowcode-menu-out-lined-icon",
88
88
  ...listeners
89
89
  }
90
90
  );
@@ -3,6 +3,19 @@
3
3
  height: 100%;
4
4
  }
5
5
 
6
+ .pisell-lowcode-menu-out-lined-icon{
7
+ position: absolute;
8
+ top: 0;
9
+ left: 0;
10
+ width: 100%;
11
+ height: 100%;
12
+ display: flex;
13
+ justify-content: center;
14
+ align-items: center;
15
+ cursor: move;
16
+ touch-action: none;
17
+ }
18
+
6
19
  .materials-grid-table-cell {
7
20
  padding: 12px;
8
21
  }
@@ -29,6 +29,9 @@
29
29
  display: flex;
30
30
  align-items: center;
31
31
  justify-content: center;
32
+ position: absolute;
33
+ top: 0;
34
+ left: 0;
32
35
  }
33
36
  }
34
37
  }
@@ -42,6 +45,9 @@
42
45
  display: flex;
43
46
  align-items: center;
44
47
  justify-content: center;
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
45
51
  }
46
52
  }
47
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.319",
3
+ "version": "1.0.321",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",