@pisell/materials 1.0.67 → 1.0.69

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.
Files changed (93) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +159 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +155 -7
  11. package/es/components/drawer/index.js +1 -0
  12. package/es/components/filter/components/FilterItem/index.js +2 -3
  13. package/es/components/table/BasicTable/index.js +8 -49
  14. package/es/components/table/Table/AddFieldModal/index.js +1 -0
  15. package/es/components/table/Table/fields/index.d.ts +0 -29
  16. package/es/components/table/Table/fields/index.js +2 -5
  17. package/es/components/table/Table/fields/rangePicker/Edit/index.js +1 -0
  18. package/es/components/table/Table/fields/types/index.d.ts +1 -2
  19. package/es/components/table/Table/index.js +2 -36
  20. package/es/components/table/Table/tableConfig/body/CellProvider/index.js +1 -5
  21. package/es/components/table/Table/tableConfig/body/index.d.ts +0 -1
  22. package/es/components/table/Table/tableConfig/body/index.js +1 -2
  23. package/es/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
  24. package/es/components/table/Table/tableConfig/summary/index.js +1 -0
  25. package/es/components/table/index.js +1 -2
  26. package/es/components/table/index.less +1 -49
  27. package/lib/components/drawer/index.js +1 -0
  28. package/lib/components/filter/components/FilterItem/index.js +1 -1
  29. package/lib/components/table/BasicTable/index.js +8 -44
  30. package/lib/components/table/Table/AddFieldModal/index.js +1 -0
  31. package/lib/components/table/Table/fields/index.d.ts +0 -29
  32. package/lib/components/table/Table/fields/index.js +2 -5
  33. package/lib/components/table/Table/fields/rangePicker/Edit/index.js +1 -0
  34. package/lib/components/table/Table/fields/types/index.d.ts +1 -2
  35. package/lib/components/table/Table/index.js +1 -27
  36. package/lib/components/table/Table/tableConfig/body/CellProvider/index.js +1 -5
  37. package/lib/components/table/Table/tableConfig/body/index.d.ts +0 -1
  38. package/lib/components/table/Table/tableConfig/body/index.js +0 -1
  39. package/lib/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
  40. package/lib/components/table/Table/tableConfig/summary/index.js +1 -0
  41. package/lib/components/table/index.js +1 -1
  42. package/lib/components/table/index.less +1 -49
  43. package/package.json +1 -1
  44. package/dist/umd/materials.min.css +0 -1
  45. package/dist/umd/materials.min.js +0 -1
  46. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  47. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  48. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  49. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  50. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  51. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
  52. package/es/components/table/Table/fields/pSwitch/Config/index.d.ts +0 -3
  53. package/es/components/table/Table/fields/pSwitch/Config/index.js +0 -4
  54. package/es/components/table/Table/fields/pSwitch/Edit/index.d.ts +0 -4
  55. package/es/components/table/Table/fields/pSwitch/Edit/index.js +0 -12
  56. package/es/components/table/Table/fields/pSwitch/Show/index.d.ts +0 -4
  57. package/es/components/table/Table/fields/pSwitch/Show/index.js +0 -24
  58. package/es/components/table/Table/fields/pSwitch/Sort/index.d.ts +0 -3
  59. package/es/components/table/Table/fields/pSwitch/Sort/index.js +0 -4
  60. package/es/components/table/Table/fields/pSwitch/index.d.ts +0 -14
  61. package/es/components/table/Table/fields/pSwitch/index.js +0 -17
  62. package/es/components/table/Table/utils.d.ts +0 -1
  63. package/es/components/table/Table/utils.js +0 -70
  64. package/es/components/table/TableFilter/SortIcon.d.ts +0 -6
  65. package/es/components/table/TableFilter/SortIcon.js +0 -30
  66. package/es/components/table/TableFilter/index.less +0 -14
  67. package/es/components/table/TableFilter/numberFilter.d.ts +0 -6
  68. package/es/components/table/TableFilter/numberFilter.js +0 -95
  69. package/es/components/table/TableFilter/selectFilter.d.ts +0 -10
  70. package/es/components/table/TableFilter/selectFilter.js +0 -126
  71. package/es/components/table/TableFilter/stringFilter.d.ts +0 -6
  72. package/es/components/table/TableFilter/stringFilter.js +0 -71
  73. package/lib/components/table/Table/fields/pSwitch/Config/index.d.ts +0 -3
  74. package/lib/components/table/Table/fields/pSwitch/Config/index.js +0 -28
  75. package/lib/components/table/Table/fields/pSwitch/Edit/index.d.ts +0 -4
  76. package/lib/components/table/Table/fields/pSwitch/Edit/index.js +0 -41
  77. package/lib/components/table/Table/fields/pSwitch/Show/index.d.ts +0 -4
  78. package/lib/components/table/Table/fields/pSwitch/Show/index.js +0 -58
  79. package/lib/components/table/Table/fields/pSwitch/Sort/index.d.ts +0 -3
  80. package/lib/components/table/Table/fields/pSwitch/Sort/index.js +0 -28
  81. package/lib/components/table/Table/fields/pSwitch/index.d.ts +0 -14
  82. package/lib/components/table/Table/fields/pSwitch/index.js +0 -51
  83. package/lib/components/table/Table/utils.d.ts +0 -1
  84. package/lib/components/table/Table/utils.js +0 -108
  85. package/lib/components/table/TableFilter/SortIcon.d.ts +0 -6
  86. package/lib/components/table/TableFilter/SortIcon.js +0 -59
  87. package/lib/components/table/TableFilter/index.less +0 -14
  88. package/lib/components/table/TableFilter/numberFilter.d.ts +0 -6
  89. package/lib/components/table/TableFilter/numberFilter.js +0 -110
  90. package/lib/components/table/TableFilter/selectFilter.d.ts +0 -10
  91. package/lib/components/table/TableFilter/selectFilter.js +0 -123
  92. package/lib/components/table/TableFilter/stringFilter.d.ts +0 -6
  93. package/lib/components/table/TableFilter/stringFilter.js +0 -97
@@ -7,6 +7,7 @@ var Drawer = function Drawer(props) {
7
7
  // 低代码编辑态中强制显示,将控制权交给引擎侧
8
8
  innerProps.open = true;
9
9
  }
10
+ console.log(props, 'Drawer props', innerProps);
10
11
  return /*#__PURE__*/React.createElement(OriginalDrawer, _extends({}, props, innerProps));
11
12
  };
12
13
  export default Drawer;
@@ -1,4 +1,3 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  import React, { useMemo } from "react";
3
2
  import { Form } from "antd";
4
3
  import { fieldMaps } from "../../../table/Table/fields";
@@ -12,9 +11,9 @@ var FilterItem = function FilterItem(props) {
12
11
  var _fieldMaps;
13
12
  return (_fieldMaps = fieldMaps[type]) === null || _fieldMaps === void 0 ? void 0 : _fieldMaps.edit;
14
13
  }, [type]);
15
- return /*#__PURE__*/React.createElement(Form.Item, _extends({
14
+ return /*#__PURE__*/React.createElement(Form.Item, {
16
15
  label: label,
17
16
  name: name
18
- }, (other === null || other === void 0 ? void 0 : other.formItemProps) || {}), /*#__PURE__*/React.createElement(Com, other));
17
+ }, /*#__PURE__*/React.createElement(Com, other));
19
18
  };
20
19
  export default FilterItem;
@@ -1,63 +1,35 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
1
  var _excluded = ["dataSource", "pagination", "value"];
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
- 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; }
13
- 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; } }
14
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
3
  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; }
16
4
  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; }
17
5
  import { Table, Form } from "antd";
18
- import React, { useState, useMemo, useCallback } from "react";
6
+ import React, { useMemo, useCallback } from "react";
19
7
  import { FormPagination } from "../../Pagination";
20
- import { calcFilterSort } from "../Table/utils";
21
8
  var BasicTable = function BasicTable(props) {
22
9
  var _pagination$pageSizeO;
23
10
  var dataSource = props.dataSource,
24
11
  pagination = props.pagination,
25
12
  value = props.value,
26
13
  other = _objectWithoutProperties(props, _excluded);
27
- var _useState = useState(),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- filter = _useState2[0],
30
- setFilter = _useState2[1];
31
- var _useState3 = useState(),
32
- _useState4 = _slicedToArray(_useState3, 2),
33
- sort = _useState4[0],
34
- setSort = _useState4[1];
35
14
  var form = Form.useFormInstance();
36
15
  var formPagination = Form.useWatch("pagination", form) || {
37
16
  page: 1,
38
17
  size: 10
39
18
  };
40
- var showTotal = pagination.showTotal,
41
- localPagination = pagination.localPagination;
19
+ var showTotal = pagination.showTotal;
42
20
  var _showTotal = useCallback(function (total, range) {
43
- var _size = formPagination.size || 10;
21
+ var _size = formPagination.size;
44
22
  return showTotal(total, range, _size);
45
23
  }, [showTotal, formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size]);
46
24
 
47
25
  // 分割数据源
48
26
  var _dataSource = useMemo(function () {
49
27
  var _page = formPagination.page;
50
- var _size = formPagination.size || 10;
28
+ var _size = formPagination.size;
51
29
  var list = [];
52
30
  var _total = total;
53
- if (localPagination) {
54
- // 这里本地前端过滤筛选
55
- list = calcFilterSort({
56
- dataSource: dataSource,
57
- columns: other.columns,
58
- sort: sort,
59
- filter: filter
60
- });
31
+ if (dataSource.length > _size) {
32
+ list = dataSource;
61
33
  _total = list.length;
62
34
  list = list.slice((_page - 1) * _size, _page * _size);
63
35
  } else {
@@ -67,26 +39,13 @@ var BasicTable = function BasicTable(props) {
67
39
  list: list,
68
40
  total: _total
69
41
  };
70
- }, [localPagination, dataSource, formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size, filter, sort, other.columns]);
42
+ }, [dataSource, formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size]);
71
43
 
72
44
  // 总数
73
45
  var total = useMemo(function () {
74
- // 如果dataSource.length > 当前分页时为前端分页处理 此时total优先取_dataSource中total
75
- if (dataSource.length > formPagination.size) {
76
- return (_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.total) || 0;
77
- }
78
46
  return (pagination === null || pagination === void 0 ? void 0 : pagination.total) || (_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.total) || 0;
79
- }, [_dataSource, pagination]);
47
+ }, [dataSource, pagination]);
80
48
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, _extends({}, other, {
81
- onChange: function onChange(pagination, filters, sorter) {
82
- form.setFieldsValue({
83
- pagination: _objectSpread(_objectSpread({}, formPagination), {}, {
84
- page: 1
85
- })
86
- });
87
- setFilter(filters);
88
- setSort(sorter);
89
- },
90
49
  pagination: false,
91
50
  dataSource: _dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list
92
51
  })), total > ((pagination === null || pagination === void 0 ? void 0 : (_pagination$pageSizeO = pagination.pageSizeOptions) === null || _pagination$pageSizeO === void 0 ? void 0 : _pagination$pageSizeO[0]) || 10) ? /*#__PURE__*/React.createElement(Form.Item, {
@@ -39,6 +39,7 @@ var AddFieldModal = function AddFieldModal() {
39
39
  openModal = _useState4[0],
40
40
  setOpenModal = _useState4[1];
41
41
  var addField = function addField(values) {
42
+ console.log(values);
42
43
  var field_name = values.field_name;
43
44
  if (defaultColumns.find(function (d) {
44
45
  return d.dataIndex === field_name;
@@ -96,18 +96,6 @@ export declare const fieldMaps: {
96
96
  sort: () => JSX.Element;
97
97
  show: (props: import("./types").FieldPropsType) => JSX.Element;
98
98
  };
99
- pSwitch: {
100
- field: {
101
- field_icon: string;
102
- field_name: string;
103
- field_type: string;
104
- default_value: boolean;
105
- };
106
- config: () => JSX.Element;
107
- edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
108
- sort: () => JSX.Element;
109
- show: (props: import("./types").FieldPropsType) => JSX.Element;
110
- };
111
99
  };
112
100
  export declare const fieldList: ({
113
101
  field_icon: string;
@@ -149,11 +137,6 @@ export declare const fieldList: ({
149
137
  field_name: string;
150
138
  field_type: string;
151
139
  default_value: string;
152
- } | {
153
- field_icon: string;
154
- field_name: string;
155
- field_type: string;
156
- default_value: boolean;
157
140
  })[];
158
141
  export declare const getFieldByType: (type: string) => {
159
142
  field: {
@@ -264,17 +247,5 @@ declare const _default: {
264
247
  sort: () => JSX.Element;
265
248
  show: (props: import("./types").FieldPropsType) => JSX.Element;
266
249
  };
267
- pSwitch: {
268
- field: {
269
- field_icon: string;
270
- field_name: string;
271
- field_type: string;
272
- default_value: boolean;
273
- };
274
- config: () => JSX.Element;
275
- edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
276
- sort: () => JSX.Element;
277
- show: (props: import("./types").FieldPropsType) => JSX.Element;
278
- };
279
250
  };
280
251
  export default _default;
@@ -6,7 +6,6 @@ import text from "./text";
6
6
  import image from "./image";
7
7
  import rangePicker from "./rangePicker";
8
8
  import search from "./search";
9
- import pSwitch from "./pSwitch";
10
9
  export var fieldMaps = {
11
10
  text: text,
12
11
  link: link,
@@ -15,8 +14,7 @@ export var fieldMaps = {
15
14
  select: select,
16
15
  image: image,
17
16
  rangePicker: rangePicker,
18
- search: search,
19
- pSwitch: pSwitch
17
+ search: search
20
18
  };
21
19
  export var fieldList = Object.values(fieldMaps).map(function (d) {
22
20
  return d.field;
@@ -32,6 +30,5 @@ export default {
32
30
  select: select,
33
31
  image: image,
34
32
  rangePicker: rangePicker,
35
- search: search,
36
- pSwitch: pSwitch
33
+ search: search
37
34
  };
@@ -71,6 +71,7 @@ var Edit = function Edit(props, ref) {
71
71
  }
72
72
  return true;
73
73
  }, [showTime]);
74
+ console.log(dayjsVal, 'dayjsVal');
74
75
  return /*#__PURE__*/React.createElement(RangePicker, _extends({}, others, {
75
76
  format: format,
76
77
  showTime: _showTime,
@@ -10,9 +10,8 @@ export declare type FieldPropsType = {
10
10
  label: string;
11
11
  }[];
12
12
  handleSave: () => void;
13
- onChange: (value: any, record: any) => void;
14
13
  };
15
- export declare type FieldType = "text" | "image";
14
+ export declare type FieldType = 'text' | 'image';
16
15
  export declare type EditPropsType = {
17
16
  value: any;
18
17
  onChange: (v: any) => void;
@@ -23,10 +23,6 @@ import SortRow from "./tableConfig/SortRow";
23
23
  import Body from "./tableConfig/body";
24
24
  import Header from "./tableConfig/header";
25
25
  import { paginationConfig } from "../../Pagination";
26
- import getColumnStringProps from "../TableFilter/stringFilter";
27
- import getColumnNumberProps from "../TableFilter/numberFilter";
28
- import getColumnSelectProps from "../TableFilter/selectFilter";
29
- import SortIcon from "../TableFilter/SortIcon";
30
26
  var GridViewTable = function GridViewTable(_ref) {
31
27
  var tableProps = _ref.tableProps;
32
28
  var responsive = useResponsive();
@@ -62,7 +58,6 @@ var GridViewTable = function GridViewTable(_ref) {
62
58
  };
63
59
  var columns = useMemo(function () {
64
60
  return defaultColumns.map(function (col, index) {
65
- var _col$filters;
66
61
  if (!col.editable) {
67
62
  return col;
68
63
  }
@@ -72,38 +67,9 @@ var GridViewTable = function GridViewTable(_ref) {
72
67
  title: col.title,
73
68
  field_type: col.field_type,
74
69
  lock: col.lock,
75
- width: col.width || 0,
76
- render: col.render
70
+ width: col.width || 0
77
71
  };
78
- var filterObj = {};
79
-
80
- // 开启默认筛选后根据字段类型渲染表头筛选
81
- if (col.defaultFilters) {
82
- if (col.field_type === "number") {
83
- filterObj = getColumnNumberProps({
84
- dataIndex: col.dataIndex
85
- });
86
- }
87
- if (col.field_type === "text") {
88
- filterObj = getColumnStringProps({
89
- dataIndex: col.dataIndex
90
- });
91
- }
92
- }
93
-
94
- // 表头的筛选菜单项
95
- if (((_col$filters = col.filters) === null || _col$filters === void 0 ? void 0 : _col$filters.length) > 0) {
96
- filterObj = _objectSpread(_objectSpread({}, getColumnSelectProps({
97
- dataIndex: col.dataIndex,
98
- filters: col.filters
99
- })), {}, {
100
- filters: col.filters
101
- });
102
- }
103
- return _objectSpread(_objectSpread(_objectSpread({}, col), filterObj), {}, {
104
- sortIcon: function sortIcon(props) {
105
- return /*#__PURE__*/React.createElement(SortIcon, props);
106
- },
72
+ return _objectSpread(_objectSpread({}, col), {}, {
107
73
  onCell: function onCell(record) {
108
74
  return _objectSpread(_objectSpread({
109
75
  record: record
@@ -29,11 +29,7 @@ var CellProvider = function CellProvider(props) {
29
29
  dataIndex = props.dataIndex,
30
30
  field_type = props.field_type,
31
31
  record = props.record,
32
- handleSave = props.handleSave,
33
- render = props.render;
34
- if (render) {
35
- return children;
36
- }
32
+ handleSave = props.handleSave;
37
33
  var _useState = useState(false),
38
34
  _useState2 = _slicedToArray(_useState, 2),
39
35
  editing = _useState2[0],
@@ -22,7 +22,6 @@ interface EditableCellProps {
22
22
  handleSave: (record: Item) => void;
23
23
  className?: string;
24
24
  lock?: any;
25
- render?: any;
26
25
  }
27
26
  declare const _default: {
28
27
  Row: React.FC<RowProps>;
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["index"],
2
- _excluded2 = ["title", "editable", "children", "dataIndex", "field_type", "record", "handleSave", "lock", "render"];
2
+ _excluded2 = ["title", "editable", "children", "dataIndex", "field_type", "record", "handleSave", "lock"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
5
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -37,7 +37,6 @@ var EditableCell = function EditableCell(props) {
37
37
  record = props.record,
38
38
  handleSave = props.handleSave,
39
39
  lock = props.lock,
40
- render = props.render,
41
40
  restProps = _objectWithoutProperties(props, _excluded2);
42
41
  return /*#__PURE__*/React.createElement("td", _extends({}, restProps, {
43
42
  className: classNames(restProps.className, "ant-table-cell", "materials-grid-table-cell")
@@ -15,7 +15,7 @@
15
15
  font-weight: 600;
16
16
  font-size: 14px;
17
17
  color: #1B1B1B;
18
- //overflow: hidden;
18
+ overflow: hidden;
19
19
  text-overflow: ellipsis;
20
20
  white-space: nowrap;
21
21
  word-break: break-all;
@@ -1,6 +1,7 @@
1
1
  import { Table } from "antd";
2
2
  import React from "react";
3
3
  var summary = function summary(props) {
4
+ console.log("summary", props);
4
5
  return /*#__PURE__*/React.createElement(Table.Summary, {
5
6
  fixed: true
6
7
  }, /*#__PURE__*/React.createElement(Table.Summary.Row, null, /*#__PURE__*/React.createElement(Table.Summary.Cell, {
@@ -78,8 +78,7 @@ var GridView = Provider(function (props) {
78
78
  });
79
79
  } else {
80
80
  var _other$pagination;
81
- // 如果使用本地分页 不执行onValuesChange
82
- if (other !== null && other !== void 0 && (_other$pagination = other.pagination) !== null && _other$pagination !== void 0 && _other$pagination.localPagination) {
81
+ if ((dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > (other === null || other === void 0 ? void 0 : (_other$pagination = other.pagination) === null || _other$pagination === void 0 ? void 0 : _other$pagination.pageSize)) {
83
82
  return;
84
83
  }
85
84
  }
@@ -3,53 +3,5 @@
3
3
  height: 100%;
4
4
  display: flex;
5
5
  flex-direction: column;
6
- .pisell-lowcode-table-filter-column {
7
- align-items: center;
8
- .pisell-lowcode-dropdown-trigger {
9
- width: 25px;
10
- height: 25px;
11
- justify-content: center;
12
- }
13
- .pisell-lowcode-table-filter-trigger.active {
14
- background: var(--primary-100, #F4EBFF);
15
- }
16
- }
17
- .pisell-lowcode-table-column-sorters {
18
- cursor: pointer;
19
- }
20
- .pisell-table-sorter-inner {
21
- width: 25px;
22
- height: 25px;
23
- display: inline-flex;
24
- flex-direction: column;
25
- align-items: center;
26
- margin-inline-start: 4px;
27
- color: rgba(0, 0, 0, 0.29);
28
- font-size: 12px;
29
- transition: color 0.3s;
30
- border-radius: 8px;
31
- justify-content: center;
32
- &:hover {
33
- background: var(--primary-100, #F4EBFF);
34
- }
35
- .pisell-table-column-sorter-up,.pisell-table-column-sorter-down {
36
- color: rgba(102, 112, 133, 0.65);
37
- font-size: 12px;
38
- }
39
- .pisell-table-column-sorter-down {
40
- margin-top: -0.3em;
41
- }
42
- .pisell-table-column-up {
43
- font-size: 20px;
44
- }
45
- .pisell-table-column-down {
46
- font-size: 20px;
47
- transform: rotate(180deg);
48
- }
49
- }
50
- .pisell-table-sorter-inner.active {
51
- background: var(--primary-100, #F4EBFF);
52
- cursor: pointer;
53
- color: #7F56D9
54
- }
6
+
55
7
  }
@@ -39,6 +39,7 @@ var Drawer = (props) => {
39
39
  if (props.__designMode === "design") {
40
40
  innerProps.open = true;
41
41
  }
42
+ console.log(props, "Drawer props", innerProps);
42
43
  return /* @__PURE__ */ import_react.default.createElement(import_antd.Drawer, { ...props, ...innerProps });
43
44
  };
44
45
  var drawer_default = Drawer;
@@ -42,6 +42,6 @@ var FilterItem = (props) => {
42
42
  var _a;
43
43
  return (_a = import_fields.fieldMaps[type]) == null ? void 0 : _a.edit;
44
44
  }, [type]);
45
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label, name, ...(other == null ? void 0 : other.formItemProps) || {} }, /* @__PURE__ */ import_react.default.createElement(Com, { ...other }));
45
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label, name }, /* @__PURE__ */ import_react.default.createElement(Com, { ...other }));
46
46
  };
47
47
  var FilterItem_default = FilterItem;
@@ -35,37 +35,29 @@ module.exports = __toCommonJS(BasicTable_exports);
35
35
  var import_antd = require("antd");
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_Pagination = require("../../Pagination");
38
- var import_utils = require("../Table/utils");
39
38
  var BasicTable = (props) => {
40
39
  var _a;
41
40
  const { dataSource, pagination, value, ...other } = props;
42
- const [filter, setFilter] = (0, import_react.useState)();
43
- const [sort, setSort] = (0, import_react.useState)();
44
41
  const form = import_antd.Form.useFormInstance();
45
42
  const formPagination = import_antd.Form.useWatch("pagination", form) || {
46
43
  page: 1,
47
44
  size: 10
48
45
  };
49
- const { showTotal, localPagination } = pagination;
46
+ const { showTotal } = pagination;
50
47
  const _showTotal = (0, import_react.useCallback)(
51
48
  (total2, range) => {
52
- let _size = formPagination.size || 10;
49
+ let _size = formPagination.size;
53
50
  return showTotal(total2, range, _size);
54
51
  },
55
52
  [showTotal, formPagination == null ? void 0 : formPagination.page, formPagination == null ? void 0 : formPagination.size]
56
53
  );
57
54
  const _dataSource = (0, import_react.useMemo)(() => {
58
55
  let _page = formPagination.page;
59
- let _size = formPagination.size || 10;
56
+ let _size = formPagination.size;
60
57
  let list = [];
61
58
  let _total = total;
62
- if (localPagination) {
63
- list = (0, import_utils.calcFilterSort)({
64
- dataSource,
65
- columns: other.columns,
66
- sort,
67
- filter
68
- });
59
+ if (dataSource.length > _size) {
60
+ list = dataSource;
69
61
  _total = list.length;
70
62
  list = list.slice((_page - 1) * _size, _page * _size);
71
63
  } else {
@@ -75,39 +67,11 @@ var BasicTable = (props) => {
75
67
  list,
76
68
  total: _total
77
69
  };
78
- }, [
79
- localPagination,
80
- dataSource,
81
- formPagination == null ? void 0 : formPagination.page,
82
- formPagination == null ? void 0 : formPagination.size,
83
- filter,
84
- sort,
85
- other.columns
86
- ]);
70
+ }, [dataSource, formPagination == null ? void 0 : formPagination.page, formPagination == null ? void 0 : formPagination.size]);
87
71
  const total = (0, import_react.useMemo)(() => {
88
- if (dataSource.length > formPagination.size) {
89
- return (_dataSource == null ? void 0 : _dataSource.total) || 0;
90
- }
91
72
  return (pagination == null ? void 0 : pagination.total) || (_dataSource == null ? void 0 : _dataSource.total) || 0;
92
- }, [_dataSource, pagination]);
93
- return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
94
- import_antd.Table,
95
- {
96
- ...other,
97
- onChange: (pagination2, filters, sorter) => {
98
- form.setFieldsValue({
99
- pagination: {
100
- ...formPagination,
101
- page: 1
102
- }
103
- });
104
- setFilter(filters);
105
- setSort(sorter);
106
- },
107
- pagination: false,
108
- dataSource: _dataSource == null ? void 0 : _dataSource.list
109
- }
110
- ), total > (((_a = pagination == null ? void 0 : pagination.pageSizeOptions) == null ? void 0 : _a[0]) || 10) ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "pagination" }, /* @__PURE__ */ import_react.default.createElement(
73
+ }, [dataSource, pagination]);
74
+ return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd.Table, { ...other, pagination: false, dataSource: _dataSource == null ? void 0 : _dataSource.list }), total > (((_a = pagination == null ? void 0 : pagination.pageSizeOptions) == null ? void 0 : _a[0]) || 10) ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "pagination" }, /* @__PURE__ */ import_react.default.createElement(
111
75
  import_Pagination.FormPagination,
112
76
  {
113
77
  ...pagination,
@@ -46,6 +46,7 @@ var AddFieldModal = () => {
46
46
  const [count, setCount] = (0, import_react.useState)(2);
47
47
  const [openModal, setOpenModal] = (0, import_react.useState)(false);
48
48
  const addField = (values) => {
49
+ console.log(values);
49
50
  let field_name = values.field_name;
50
51
  if (defaultColumns.find((d) => d.dataIndex === field_name)) {
51
52
  import_antd.message.warning("This field already exists");
@@ -96,18 +96,6 @@ export declare const fieldMaps: {
96
96
  sort: () => JSX.Element;
97
97
  show: (props: import("./types").FieldPropsType) => JSX.Element;
98
98
  };
99
- pSwitch: {
100
- field: {
101
- field_icon: string;
102
- field_name: string;
103
- field_type: string;
104
- default_value: boolean;
105
- };
106
- config: () => JSX.Element;
107
- edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
108
- sort: () => JSX.Element;
109
- show: (props: import("./types").FieldPropsType) => JSX.Element;
110
- };
111
99
  };
112
100
  export declare const fieldList: ({
113
101
  field_icon: string;
@@ -149,11 +137,6 @@ export declare const fieldList: ({
149
137
  field_name: string;
150
138
  field_type: string;
151
139
  default_value: string;
152
- } | {
153
- field_icon: string;
154
- field_name: string;
155
- field_type: string;
156
- default_value: boolean;
157
140
  })[];
158
141
  export declare const getFieldByType: (type: string) => {
159
142
  field: {
@@ -264,17 +247,5 @@ declare const _default: {
264
247
  sort: () => JSX.Element;
265
248
  show: (props: import("./types").FieldPropsType) => JSX.Element;
266
249
  };
267
- pSwitch: {
268
- field: {
269
- field_icon: string;
270
- field_name: string;
271
- field_type: string;
272
- default_value: boolean;
273
- };
274
- config: () => JSX.Element;
275
- edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
276
- sort: () => JSX.Element;
277
- show: (props: import("./types").FieldPropsType) => JSX.Element;
278
- };
279
250
  };
280
251
  export default _default;
@@ -43,7 +43,6 @@ var import_text = __toESM(require("./text"));
43
43
  var import_image = __toESM(require("./image"));
44
44
  var import_rangePicker = __toESM(require("./rangePicker"));
45
45
  var import_search = __toESM(require("./search"));
46
- var import_pSwitch = __toESM(require("./pSwitch"));
47
46
  var fieldMaps = {
48
47
  text: import_text.default,
49
48
  link: import_link.default,
@@ -52,8 +51,7 @@ var fieldMaps = {
52
51
  select: import_select.default,
53
52
  image: import_image.default,
54
53
  rangePicker: import_rangePicker.default,
55
- search: import_search.default,
56
- pSwitch: import_pSwitch.default
54
+ search: import_search.default
57
55
  };
58
56
  var fieldList = Object.values(fieldMaps).map((d) => {
59
57
  return d.field;
@@ -69,8 +67,7 @@ var fields_default = {
69
67
  select: import_select.default,
70
68
  image: import_image.default,
71
69
  rangePicker: import_rangePicker.default,
72
- search: import_search.default,
73
- pSwitch: import_pSwitch.default
70
+ search: import_search.default
74
71
  };
75
72
  // Annotate the CommonJS export names for ESM import in node:
76
73
  0 && (module.exports = {
@@ -101,6 +101,7 @@ var Edit = (props, ref) => {
101
101
  }
102
102
  return true;
103
103
  }, [showTime]);
104
+ console.log(dayjsVal, "dayjsVal");
104
105
  return /* @__PURE__ */ React.createElement(
105
106
  RangePicker,
106
107
  {
@@ -10,9 +10,8 @@ export declare type FieldPropsType = {
10
10
  label: string;
11
11
  }[];
12
12
  handleSave: () => void;
13
- onChange: (value: any, record: any) => void;
14
13
  };
15
- export declare type FieldType = "text" | "image";
14
+ export declare type FieldType = 'text' | 'image';
16
15
  export declare type EditPropsType = {
17
16
  value: any;
18
17
  onChange: (v: any) => void;