@pisell/materials 1.0.65 → 1.0.66
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/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +159 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +155 -7
- package/es/components/drawer/index.js +1 -0
- package/es/components/filter/components/FilterItem/index.js +2 -3
- package/es/components/table/BasicTable/index.js +8 -49
- package/es/components/table/Table/AddFieldModal/index.js +1 -0
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +1 -0
- package/es/components/table/Table/index.js +1 -34
- package/es/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
- package/es/components/table/Table/tableConfig/summary/index.js +1 -0
- package/es/components/table/index.js +1 -2
- package/es/components/table/index.less +1 -49
- package/lib/components/drawer/index.js +1 -0
- package/lib/components/filter/components/FilterItem/index.js +1 -1
- package/lib/components/table/BasicTable/index.js +8 -44
- package/lib/components/table/Table/AddFieldModal/index.js +1 -0
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +1 -0
- package/lib/components/table/Table/index.js +0 -25
- package/lib/components/table/Table/tableConfig/header/CellProvider/index.less +1 -1
- package/lib/components/table/Table/tableConfig/summary/index.js +1 -0
- package/lib/components/table/index.js +1 -1
- package/lib/components/table/index.less +1 -49
- package/package.json +2 -2
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
- package/es/components/table/Table/utils.d.ts +0 -1
- package/es/components/table/Table/utils.js +0 -70
- package/es/components/table/TableFilter/SortIcon.d.ts +0 -6
- package/es/components/table/TableFilter/SortIcon.js +0 -30
- package/es/components/table/TableFilter/index.less +0 -14
- package/es/components/table/TableFilter/numberFilter.d.ts +0 -6
- package/es/components/table/TableFilter/numberFilter.js +0 -95
- package/es/components/table/TableFilter/selectFilter.d.ts +0 -10
- package/es/components/table/TableFilter/selectFilter.js +0 -126
- package/es/components/table/TableFilter/stringFilter.d.ts +0 -6
- package/es/components/table/TableFilter/stringFilter.js +0 -73
- package/lib/components/table/Table/utils.d.ts +0 -1
- package/lib/components/table/Table/utils.js +0 -108
- package/lib/components/table/TableFilter/SortIcon.d.ts +0 -6
- package/lib/components/table/TableFilter/SortIcon.js +0 -59
- package/lib/components/table/TableFilter/index.less +0 -14
- package/lib/components/table/TableFilter/numberFilter.d.ts +0 -6
- package/lib/components/table/TableFilter/numberFilter.js +0 -110
- package/lib/components/table/TableFilter/selectFilter.d.ts +0 -10
- package/lib/components/table/TableFilter/selectFilter.js +0 -123
- package/lib/components/table/TableFilter/stringFilter.d.ts +0 -6
- package/lib/components/table/TableFilter/stringFilter.js +0 -99
|
@@ -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,
|
|
14
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
16
15
|
label: label,
|
|
17
16
|
name: name
|
|
18
|
-
},
|
|
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, {
|
|
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
|
|
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
|
|
28
|
+
var _size = formPagination.size;
|
|
51
29
|
var list = [];
|
|
52
30
|
var _total = total;
|
|
53
|
-
if (
|
|
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
|
-
}, [
|
|
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
|
-
}, [
|
|
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;
|
|
@@ -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
|
}
|
|
@@ -74,35 +69,7 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
74
69
|
lock: col.lock,
|
|
75
70
|
width: col.width || 0
|
|
76
71
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// 开启默认筛选后根据字段类型渲染表头筛选
|
|
80
|
-
if (col.defaultFilters) {
|
|
81
|
-
if (col.field_type === "number") {
|
|
82
|
-
filterObj = getColumnNumberProps({
|
|
83
|
-
dataIndex: col.dataIndex
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (col.field_type === "text") {
|
|
87
|
-
filterObj = getColumnStringProps({
|
|
88
|
-
dataIndex: col.dataIndex
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// 表头的筛选菜单项
|
|
94
|
-
if (((_col$filters = col.filters) === null || _col$filters === void 0 ? void 0 : _col$filters.length) > 0) {
|
|
95
|
-
filterObj = _objectSpread(_objectSpread({}, getColumnSelectProps({
|
|
96
|
-
dataIndex: col.dataIndex,
|
|
97
|
-
filters: col.filters
|
|
98
|
-
})), {}, {
|
|
99
|
-
filters: col.filters
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return _objectSpread(_objectSpread(_objectSpread({}, col), filterObj), {}, {
|
|
103
|
-
sortIcon: function sortIcon(props) {
|
|
104
|
-
return /*#__PURE__*/React.createElement(SortIcon, props);
|
|
105
|
-
},
|
|
72
|
+
return _objectSpread(_objectSpread({}, col), {}, {
|
|
106
73
|
onCell: function onCell(record) {
|
|
107
74
|
return _objectSpread(_objectSpread({
|
|
108
75
|
record: record
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
46
|
+
const { showTotal } = pagination;
|
|
50
47
|
const _showTotal = (0, import_react.useCallback)(
|
|
51
48
|
(total2, range) => {
|
|
52
|
-
let _size = formPagination.size
|
|
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
|
|
56
|
+
let _size = formPagination.size;
|
|
60
57
|
let list = [];
|
|
61
58
|
let _total = total;
|
|
62
|
-
if (
|
|
63
|
-
list =
|
|
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
|
-
}, [
|
|
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");
|
|
@@ -42,10 +42,6 @@ var import_SortRow = __toESM(require("./tableConfig/SortRow"));
|
|
|
42
42
|
var import_body = __toESM(require("./tableConfig/body"));
|
|
43
43
|
var import_header = __toESM(require("./tableConfig/header"));
|
|
44
44
|
var import_Pagination = require("../../Pagination");
|
|
45
|
-
var import_stringFilter = __toESM(require("../TableFilter/stringFilter"));
|
|
46
|
-
var import_numberFilter = __toESM(require("../TableFilter/numberFilter"));
|
|
47
|
-
var import_selectFilter = __toESM(require("../TableFilter/selectFilter"));
|
|
48
|
-
var import_SortIcon = __toESM(require("../TableFilter/SortIcon"));
|
|
49
45
|
var GridViewTable = ({ tableProps }) => {
|
|
50
46
|
const responsive = (0, import_hooks.useResponsive)();
|
|
51
47
|
const { state, dispatch } = (0, import_hooks.useSharedState)(import_model.Context);
|
|
@@ -76,7 +72,6 @@ var GridViewTable = ({ tableProps }) => {
|
|
|
76
72
|
};
|
|
77
73
|
const columns = (0, import_react.useMemo)(() => {
|
|
78
74
|
return defaultColumns.map((col, index) => {
|
|
79
|
-
var _a;
|
|
80
75
|
if (!col.editable) {
|
|
81
76
|
return col;
|
|
82
77
|
}
|
|
@@ -88,28 +83,8 @@ var GridViewTable = ({ tableProps }) => {
|
|
|
88
83
|
lock: col.lock,
|
|
89
84
|
width: col.width || 0
|
|
90
85
|
};
|
|
91
|
-
let filterObj = {};
|
|
92
|
-
if (col.defaultFilters) {
|
|
93
|
-
if (col.field_type === "number") {
|
|
94
|
-
filterObj = (0, import_numberFilter.default)({ dataIndex: col.dataIndex });
|
|
95
|
-
}
|
|
96
|
-
if (col.field_type === "text") {
|
|
97
|
-
filterObj = (0, import_stringFilter.default)({ dataIndex: col.dataIndex });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (((_a = col.filters) == null ? void 0 : _a.length) > 0) {
|
|
101
|
-
filterObj = {
|
|
102
|
-
...(0, import_selectFilter.default)({
|
|
103
|
-
dataIndex: col.dataIndex,
|
|
104
|
-
filters: col.filters
|
|
105
|
-
}),
|
|
106
|
-
filters: col.filters
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
86
|
return {
|
|
110
87
|
...col,
|
|
111
|
-
...filterObj,
|
|
112
|
-
sortIcon: (props) => /* @__PURE__ */ import_react.default.createElement(import_SortIcon.default, { ...props }),
|
|
113
88
|
onCell: (record) => ({
|
|
114
89
|
record,
|
|
115
90
|
...item,
|
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(summary_exports);
|
|
|
35
35
|
var import_antd = require("antd");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var summary = (props) => {
|
|
38
|
+
console.log("summary", props);
|
|
38
39
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Table.Summary, { fixed: true }, /* @__PURE__ */ import_react.default.createElement(import_antd.Table.Summary.Row, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Table.Summary.Cell, { index: 0, colSpan: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
39
40
|
"span",
|
|
40
41
|
{
|
|
@@ -100,7 +100,7 @@ var GridView = (0, import_model.Provider)((props) => {
|
|
|
100
100
|
page: 1
|
|
101
101
|
};
|
|
102
102
|
} else {
|
|
103
|
-
if ((_a = other == null ? void 0 : other.pagination) == null ? void 0 : _a.
|
|
103
|
+
if ((dataSource == null ? void 0 : dataSource.length) > ((_a = other == null ? void 0 : other.pagination) == null ? void 0 : _a.pageSize)) {
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -3,53 +3,5 @@
|
|
|
3
3
|
height: 100%;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
|
-
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.66",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@dnd-kit/sortable": "^7.0.2",
|
|
55
55
|
"@dnd-kit/utilities": "^3.2.1",
|
|
56
56
|
"ahooks": "^3.7.6",
|
|
57
|
+
"@pisell/utils": "1.0.4",
|
|
57
58
|
"@pisell/icon": "0.0.8",
|
|
58
|
-
"@pisell/utils": "1.0.3",
|
|
59
59
|
"@pisell/date-picker": "1.0.23"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.materials-grid{display:flex;flex-direction:column;height:100%;width:100%}.materials-grid-header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.materials-grid-header .right-wrap{align-items:center;display:flex;gap:8px}.materials-grid-actions{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.materials-grid-actions .left-wrap{align-items:center;display:flex;flex:1 1}.materials-grid-actions .left-wrap .pisell-lowcode-form-item{margin-bottom:0}.materials-grid-actions .right-wrap{align-items:center;display:flex;gap:8px}.materials-grid-actions .right-wrap .icon{cursor:pointer;transition:.2s}.materials-grid-actions .right-wrap .icon:hover{color:var(--theme-color)}.materials-grid-actions .right-wrap .button{align-items:center;display:flex;font-size:12px;height:28px;justify-content:center}.filter-dropdown-wrap{display:flex;flex-direction:column;max-height:400px;max-width:calc(100vw - 24px);min-width:250px;padding:4px;width:400px}.filter-dropdown-wrap .filter-dropdown-wrap-content{flex:1 1;overflow:auto}.filter-dropdown-wrap .filter-dropdown-drag-item{align-items:center;background:#f9fafb;background:var(--gray-50,#f9fafb);border-radius:8px;display:flex;margin-bottom:12px;padding:8px 12px 12px}.filter-dropdown-wrap .filter-dropdown-drag-item .dots-six-icon{color:#98a2b3;cursor:pointer;font-size:24px}.filter-dropdown-wrap .filter-dropdown-drag-item .pisell-lowcode-form-item{margin-bottom:0}.filter-dropdown-wrap .filter-dropdown-drag-item .filter-dropdown-drag-item-right{flex:1 1;margin-left:16px}.filter-dropdown-wrap .filter-dropdown-drag-item .filter-dropdown-drag-item-right .filter-dropdown-drag-item-title{color:#777;color:var(--text-text-2,#777);font-size:14px;font-style:normal;font-weight:600;line-height:20px}.filter-dropdown-container-wrap{border-bottom:1px solid #e2e2e2;border-bottom:1px solid var(--surface-surface-4,#e2e2e2);margin-bottom:20px;min-height:70px}.filter-dropdown-container-wrap:last-child{border:none}.filter-dropdown-container-wrap .filter-dropdown-container-title-wrap{align-items:center;color:#919191;color:var(--text-text-3,#919191);display:flex;font-size:16px;font-style:normal;font-weight:600;line-height:22px;margin-bottom:12px}.filter-dropdown-container-wrap .filter-dropdown-container-title-wrap .filter-dropdown-container-title{color:#101828;color:var(--gray-900,#101828);font-size:16px;font-style:normal;font-weight:600;line-height:24px;margin-right:6px}.filter-dropdown-container-wrap .filter-dropdown-container-title-wrap .filter-dropdown-container-icon-help{color:#98a2b3;color:var(--gray-400,#98a2b3);font-size:20px}.filter-dropdown-container-wrap .filter-dropdown-container-filter-wrap{min-height:80px}.materials-sort-list-empty{color:#5a5a5a;display:block;padding-top:22px;text-align:center}.materials-grid-summary{margin-bottom:16px}.grid-view-table-wrap{position:relative}.materials-grid-paginator{align-items:center;background-color:#fff;border:1px solid #f0f0f0;border-radius:0 0 8px 8px;border-top:none;display:flex;height:50px;justify-content:center;margin:0!important;padding:0 20px;width:100%}.materials-grid-paginator .pisell-lowcode-pagination-total-text{color:#667085;color:var(--gray-500,#667085);font-size:14px;font-style:normal;font-weight:500;margin-right:auto}.materials-grid-paginator .pisell-lowcode-pagination-item{border:1px solid #d0d5dd;border-radius:0;border-right:0;margin:0;position:relative}.materials-grid-paginator .pisell-lowcode-pagination-jump-next,.materials-grid-paginator .pisell-lowcode-pagination-jump-prev{border:1px solid #d0d5dd;border-radius:0;border-right:none;margin:0}.materials-grid-paginator .pisell-lowcode-pagination-item-link:hover{color:rgba(0,0,0,.88)!important;font-weight:450!important}.materials-grid-paginator .pisell-lowcode-pagination-item-link:hover .pisell-lowcode-pagination-item-link-icon{color:rgba(0,0,0,.88)!important;font-weight:450!important}.materials-grid-paginator .pisell-lowcode-pagination-item-active:hover{border-color:#d0d5dd!important}.materials-grid-paginator .pisell-lowcode-pagination-item-active{background-color:rgba(0,0,0,.06)}.materials-grid-paginator .pisell-lowcode-pagination-item-active a{color:rgba(0,0,0,.88)!important;font-weight:450!important}.materials-grid-paginator .pisell-lowcode-pagination-prev{align-items:center;border:1px solid #d0d5dd;border-radius:8px 0 0 8px;border-right:none;display:flex;justify-content:center;margin:0;min-width:auto}.materials-grid-paginator .pisell-lowcode-pagination-next{align-items:center;border:1px solid #d0d5dd;border-radius:0 8px 8px 0;display:flex;justify-content:center;margin:0;min-width:auto}.paginator-page-btn{align-items:center;border-radius:4px 4px 4px 4px;color:#344054;color:var(--gray-700,#344054);cursor:pointer;display:flex;font-size:12px;font-weight:400;justify-content:center;padding:10px 16px;transition:.2s;-ms-user-select:none;user-select:none}.paginator-page-btn .paginator-page-btn-text{font-weight:600}.paginator-page-btn .paginator-page-btn-left-icon,.paginator-page-btn .paginator-page-btn-right-icon{font-size:20px}.paginator-page-btn .paginator-page-btn-left-icon{margin-right:8px}.paginator-page-btn .paginator-page-btn-right-icon{margin-left:8px}.paginator-page-btn.left{margin-right:auto}.paginator-page-btn.left .icon{font-size:18px;margin-right:8px}.paginator-page-btn.right{margin-left:auto}.paginator-page-btn.right .icon{font-size:18px;margin-left:8px;transform:rotate(180deg)}.materials-grid-paginator-mini{align-items:center;background-color:#fff;border:1px solid #f0f0f0;border-radius:0 0 8px 8px;border-top:none;display:flex;height:50px;justify-content:space-between;margin:0!important;overflow:hidden;padding:0 20px;width:100%}.materials-grid-paginator-mini .paginator-page-btn{padding:8px}.materials-grid-paginator-mini .materials-grid-paginator-center{align-items:center;display:flex;gap:4px;justify-content:center}.materials-grid-paginator-mini .materials-grid-paginator-center .materials-grid-paginator-center-text{color:#344054;color:var(--gray-700,#344054);font-size:14px;font-style:normal;font-weight:400}.materials-grid-paginator-mini .materials-grid-paginator-center .materials-grid-paginator-center-value{color:#344054;color:var(--gray-700,#344054);font-size:14px;font-style:normal;font-weight:500}.materials-grid-paginator-mini .pisell-lowcode-pagination-next,.materials-grid-paginator-mini .pisell-lowcode-pagination-prev{border:1px solid #d0d5dd;border-radius:8px;margin:0}.materials-grid-paginator-mini .pisell-lowcode-pagination-next .paginator-page-btn-left-icon,.materials-grid-paginator-mini .pisell-lowcode-pagination-prev .paginator-page-btn-left-icon{margin-right:0}.materials-grid-paginator-mini .pisell-lowcode-pagination-next .paginator-page-btn-right-icon,.materials-grid-paginator-mini .pisell-lowcode-pagination-prev .paginator-page-btn-right-icon{margin-left:0}.react-resizable{position:relative}.react-resizable-handle{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgd2lkdGg9IjYiIGhlaWdodD0iNiI+PHBhdGggZD0iTTYgNkgwVjQuMmg0LjJWMEg2djZaIiBvcGFjaXR5PSIuMzAyIi8+PC9zdmc+);background-origin:content-box;background-position:100% 100%;background-repeat:no-repeat;box-sizing:border-box;height:20px;padding:0 3px 3px 0;position:absolute;width:20px}.react-resizable-handle-sw{bottom:0;cursor:sw-resize;left:0;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;cursor:se-resize;right:0}.react-resizable-handle-nw{cursor:nw-resize;left:0;top:0;transform:rotate(180deg)}.react-resizable-handle-ne{cursor:ne-resize;right:0;top:0;transform:rotate(270deg)}.react-resizable-handle-e,.react-resizable-handle-w{cursor:ew-resize;margin-top:-10px;top:50%}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{cursor:ns-resize;left:50%;margin-left:-10px}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.materials-grid-table-header-cell{align-items:center;display:flex;height:44px;padding:0 14px}.materials-grid-table-header-cell .field-icon{color:#777;font-size:18px}.materials-grid-table-header-cell .materials-grid-table-header-cell-content{color:#1b1b1b;flex:auto;font-size:14px;font-weight:600;overflow:hidden;padding-right:10px;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.materials-grid-table-header-cell .actions{align-items:center;display:flex;gap:8px}.materials-grid-table-header-cell .actions .action{color:#ababab;cursor:pointer;font-size:14px}.editable-cell-value-wrap{height:100%;width:100%}.materials-grid-table-cell{height:1px;padding:0!important}.cell-provider{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:100%;justify-content:center;padding:12px;position:relative;width:100%}.cell-provider.focus{box-shadow:var(--theme-color) 0 0 0 1px!important}
|