@pisell/materials 1.0.7 → 1.0.9

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.
@@ -3,13 +3,22 @@ import { SortableItemProps } from "../DragSortList";
3
3
  declare type IdType = string | number;
4
4
  export interface MultipleContainersSortListProps<T> {
5
5
  list: Record<string, T[]>;
6
- vertical: boolean;
7
- wrapStyle: React.CSSProperties;
6
+ vertical?: boolean;
7
+ wrapStyle?: React.CSSProperties;
8
8
  onChange: (val: Record<string, T[]>) => void;
9
- renderContainer?: (dom: React.ReactElement) => React.ReactElement;
9
+ renderContainer?: DefaultRenderContainerProps['renderContainer'];
10
10
  rowKey: IdType | ((val: T) => IdType);
11
11
  children: SortableItemProps<T>["children"];
12
12
  }
13
13
  export declare const TRASH_ID = "void";
14
+ interface DefaultRenderContainerProps {
15
+ id: IdType;
16
+ renderContainer: (params: {
17
+ children: React.ReactElement;
18
+ ref: any;
19
+ id: IdType;
20
+ }) => React.ReactElement;
21
+ children: any;
22
+ }
14
23
  declare const MultipleContainersSortList: <T extends Record<string, any>>(props: MultipleContainersSortListProps<T>) => JSX.Element;
15
24
  export default MultipleContainersSortList;
@@ -35,7 +35,7 @@ var DefaultRenderContainer = function DefaultRenderContainer(props) {
35
35
  id: id
36
36
  });
37
37
  }
38
- if (renderContainer) return /*#__PURE__*/React.createElement("div", {
38
+ return /*#__PURE__*/React.createElement("div", {
39
39
  ref: setNodeRef
40
40
  }, children);
41
41
  };
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import "./index.less";
3
3
  export interface FilterItemProps {
4
4
  type: "single" | "input" | "datePicker" | "rangePicker";
5
- label: string;
5
+ label?: string;
6
6
  props?: object;
7
7
  name: string;
8
8
  other: Record<string, any>;
@@ -7,8 +7,8 @@ var FilterItem = function FilterItem(props) {
7
7
  type = props.type,
8
8
  name = props.name;
9
9
  var Com = useMemo(function () {
10
- var _fieldMaps$type;
11
- return (_fieldMaps$type = fieldMaps[type]) === null || _fieldMaps$type === void 0 ? void 0 : _fieldMaps$type.edit;
10
+ var _fieldMaps;
11
+ return (_fieldMaps = fieldMaps[type]) === null || _fieldMaps === void 0 ? void 0 : _fieldMaps.edit;
12
12
  }, [type]);
13
13
  return /*#__PURE__*/React.createElement(Form.Item, {
14
14
  label: label,
@@ -3,13 +3,22 @@ import { SortableItemProps } from "../DragSortList";
3
3
  declare type IdType = string | number;
4
4
  export interface MultipleContainersSortListProps<T> {
5
5
  list: Record<string, T[]>;
6
- vertical: boolean;
7
- wrapStyle: React.CSSProperties;
6
+ vertical?: boolean;
7
+ wrapStyle?: React.CSSProperties;
8
8
  onChange: (val: Record<string, T[]>) => void;
9
- renderContainer?: (dom: React.ReactElement) => React.ReactElement;
9
+ renderContainer?: DefaultRenderContainerProps['renderContainer'];
10
10
  rowKey: IdType | ((val: T) => IdType);
11
11
  children: SortableItemProps<T>["children"];
12
12
  }
13
13
  export declare const TRASH_ID = "void";
14
+ interface DefaultRenderContainerProps {
15
+ id: IdType;
16
+ renderContainer: (params: {
17
+ children: React.ReactElement;
18
+ ref: any;
19
+ id: IdType;
20
+ }) => React.ReactElement;
21
+ children: any;
22
+ }
14
23
  declare const MultipleContainersSortList: <T extends Record<string, any>>(props: MultipleContainersSortListProps<T>) => JSX.Element;
15
24
  export default MultipleContainersSortList;
@@ -47,8 +47,7 @@ var DefaultRenderContainer = (props) => {
47
47
  if ((0, import_utils.isFunction)(renderContainer)) {
48
48
  return renderContainer({ children, ref: setNodeRef, id });
49
49
  }
50
- if (renderContainer)
51
- return /* @__PURE__ */ import_react.default.createElement("div", { ref: setNodeRef }, children);
50
+ return /* @__PURE__ */ import_react.default.createElement("div", { ref: setNodeRef }, children);
52
51
  };
53
52
  var MultipleContainersSortList = (props) => {
54
53
  const {
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import "./index.less";
3
3
  export interface FilterItemProps {
4
4
  type: "single" | "input" | "datePicker" | "rangePicker";
5
- label: string;
5
+ label?: string;
6
6
  props?: object;
7
7
  name: string;
8
8
  other: Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "react": "^18.0.0",
15
15
  "react-dom": "^18.0.0",
16
16
  "@alib/build-scripts": "^0.1.32",
17
- "@pisell/build-plugin-lowcode": "^1.0.7",
17
+ "@pisell/build-plugin-lowcode": "^1.0.8",
18
18
  "@types/react": "^18.0.0",
19
19
  "@types/react-dom": "^18.0.0",
20
20
  "@alilc/lowcode-utils": "1.1.6",