@pisell/materials 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/umd/materials.min.css +1 -1
- package/dist/umd/materials.min.js +1 -1
- package/es/components/Pagination/index.less +8 -1
- package/es/components/table/Actions/Filter/FilterItem/index.js +3 -2
- package/es/components/table/Actions/index.js +1 -7
- package/es/components/table/Actions/index.less +2 -0
- package/es/components/table/BasicTable/index.d.ts.map +1 -1
- package/es/components/table/BasicTable/index.js +12 -2
- package/es/components/table/Table/fields/rangePicker/Edit/index.d.ts.map +1 -1
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +13 -3
- package/es/components/table/Table/index.d.ts.map +1 -1
- package/es/components/table/Table/index.js +5 -4
- package/es/components/table/Table/index.less +0 -2
- package/es/components/table/Table/tableConfig/body/CellContent/index.less +0 -1
- package/es/components/table/Table/tableConfig/body/CellProvider/index.less +0 -3
- package/es/components/table/model.js +1 -1
- package/lib/components/Pagination/index.less +8 -1
- package/lib/components/table/Actions/Filter/FilterItem/index.js +2 -2
- package/lib/components/table/Actions/index.js +1 -3
- package/lib/components/table/Actions/index.less +2 -0
- package/lib/components/table/BasicTable/index.d.ts.map +1 -1
- package/lib/components/table/BasicTable/index.js +11 -1
- package/lib/components/table/Table/fields/rangePicker/Edit/index.d.ts.map +1 -1
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +6 -1
- package/lib/components/table/Table/index.d.ts.map +1 -1
- package/lib/components/table/Table/index.js +5 -4
- package/lib/components/table/Table/index.less +0 -2
- package/lib/components/table/Table/tableConfig/body/CellContent/index.less +0 -1
- package/lib/components/table/Table/tableConfig/body/CellProvider/index.less +0 -3
- package/lib/components/table/model.js +1 -1
- package/package.json +1 -1
- package/dist/umd/static/DotsSix.57d66266.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
|
@@ -55,7 +55,14 @@
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.pisell-lowcode-pagination-disabled {
|
|
58
|
+
.pisell-lowcode-pagination-disabled {
|
|
59
|
+
cursor: not-allowed;
|
|
60
|
+
color: rgba(0,0,0,.25);
|
|
61
|
+
.paginator-page-btn {
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
color: rgba(0,0,0,.25);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
59
66
|
|
|
60
67
|
.pisell-lowcode-pagination-item-active:hover {
|
|
61
68
|
border-color: #D0D5DD !important;
|
|
@@ -5,7 +5,8 @@ import "./index.less";
|
|
|
5
5
|
var FilterItem = function FilterItem(props) {
|
|
6
6
|
var label = props.label,
|
|
7
7
|
type = props.type,
|
|
8
|
-
name = props.name
|
|
8
|
+
name = props.name,
|
|
9
|
+
other = props.other;
|
|
9
10
|
var Com = useMemo(function () {
|
|
10
11
|
var _fieldMaps;
|
|
11
12
|
return (_fieldMaps = fieldMaps[type]) === null || _fieldMaps === void 0 ? void 0 : _fieldMaps.edit;
|
|
@@ -13,6 +14,6 @@ var FilterItem = function FilterItem(props) {
|
|
|
13
14
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
14
15
|
label: label,
|
|
15
16
|
name: name
|
|
16
|
-
}, /*#__PURE__*/React.createElement(Com,
|
|
17
|
+
}, /*#__PURE__*/React.createElement(Com, other));
|
|
17
18
|
};
|
|
18
19
|
export default FilterItem;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
|
-
import Filter from "./Filter";
|
|
3
2
|
import QuickFilter from "./Filter/QuickFilter";
|
|
4
|
-
import Sort from "./Sort";
|
|
5
3
|
import "./index.less";
|
|
6
4
|
var Actions = function Actions(_ref) {
|
|
7
5
|
var filter = _ref.filter,
|
|
@@ -15,10 +13,6 @@ var Actions = function Actions(_ref) {
|
|
|
15
13
|
className: "left-wrap"
|
|
16
14
|
}, /*#__PURE__*/React.createElement(QuickFilter, null)), /*#__PURE__*/React.createElement("div", {
|
|
17
15
|
className: "right-wrap"
|
|
18
|
-
}
|
|
19
|
-
list: (filter === null || filter === void 0 ? void 0 : filter.list) || []
|
|
20
|
-
}) : null, sort !== null && sort !== void 0 && sort.show ? /*#__PURE__*/React.createElement(Sort, {
|
|
21
|
-
list: (sort === null || sort === void 0 ? void 0 : sort.list) || []
|
|
22
|
-
}) : null)) : null;
|
|
16
|
+
})) : null;
|
|
23
17
|
};
|
|
24
18
|
export default Actions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAC;AAIzC,QAAA,MAAM,UAAU,UAAW,WAAW,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAC;AAIzC,QAAA,MAAM,UAAU,UAAW,WAAW,GAAG,CAAC,gBA2EzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -9,9 +9,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
11
|
import { Table } from "antd";
|
|
12
|
-
import React, { useState, useMemo, useEffect } from "react";
|
|
12
|
+
import React, { useState, useMemo, useEffect, useCallback } from "react";
|
|
13
13
|
import Pagination from "../../Pagination";
|
|
14
14
|
var BasicTable = function BasicTable(props) {
|
|
15
|
+
var _pagination$pageSizeO;
|
|
15
16
|
var dataSource = props.dataSource,
|
|
16
17
|
pagination = props.pagination,
|
|
17
18
|
other = _objectWithoutProperties(props, _excluded);
|
|
@@ -23,9 +24,16 @@ var BasicTable = function BasicTable(props) {
|
|
|
23
24
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
24
25
|
pageSize = _useState4[0],
|
|
25
26
|
setPageSize = _useState4[1];
|
|
27
|
+
var showTotal = pagination.showTotal;
|
|
28
|
+
var _showTotal = useCallback(function (total, range) {
|
|
29
|
+
return showTotal(total, range, pageSize);
|
|
30
|
+
}, [showTotal, pageSize, currentPage]);
|
|
26
31
|
useEffect(function () {
|
|
27
32
|
setCurrentPage(1);
|
|
28
33
|
}, [dataSource]);
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
setPageSize(pagination === null || pagination === void 0 ? void 0 : pagination.pageSize);
|
|
36
|
+
}, [pagination.pageSize]);
|
|
29
37
|
|
|
30
38
|
// 分割数据源
|
|
31
39
|
var _dataSource = useMemo(function () {
|
|
@@ -60,10 +68,12 @@ var BasicTable = function BasicTable(props) {
|
|
|
60
68
|
setCurrentPage(page);
|
|
61
69
|
setPageSize(pageSize);
|
|
62
70
|
};
|
|
71
|
+
console.log(pagination, 'pagination');
|
|
63
72
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, _extends({}, other, {
|
|
64
73
|
pagination: false,
|
|
65
74
|
dataSource: _dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list
|
|
66
|
-
})), total >
|
|
75
|
+
})), 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(Pagination, _extends({}, pagination, {
|
|
76
|
+
showTotal: _showTotal,
|
|
67
77
|
current: currentPage,
|
|
68
78
|
pageSize: pageSize,
|
|
69
79
|
onShowSizeChange: onPaginationChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;;AA4E5C,wBAAgC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
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
|
+
var _excluded = ["value", "onChange", "onPressEnter", "onBlur", "style", "bordered", "presets", "showTime", "format"];
|
|
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); }
|
|
2
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; }
|
|
3
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; }
|
|
4
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; }
|
|
5
7
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
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 _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; }
|
|
10
|
+
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; }
|
|
7
11
|
import { isArr, isBoolean, isString } from "@pisell/utils";
|
|
8
12
|
import dayjs from "dayjs";
|
|
9
13
|
import { forwardRef, useMemo } from "react";
|
|
@@ -17,7 +21,9 @@ var Edit = function Edit(props, ref) {
|
|
|
17
21
|
style = props.style,
|
|
18
22
|
bordered = props.bordered,
|
|
19
23
|
presets = props.presets,
|
|
20
|
-
showTime = props.showTime
|
|
24
|
+
showTime = props.showTime,
|
|
25
|
+
format = props.format,
|
|
26
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
21
27
|
var dayjsVal = useMemo(function () {
|
|
22
28
|
if (isString(value)) {
|
|
23
29
|
return dayjs(value);
|
|
@@ -35,6 +41,9 @@ var Edit = function Edit(props, ref) {
|
|
|
35
41
|
var rangePresets = [{
|
|
36
42
|
label: "Today",
|
|
37
43
|
value: [dayjs().startOf('day'), dayjs().endOf('day')]
|
|
44
|
+
}, {
|
|
45
|
+
label: "Yesterday",
|
|
46
|
+
value: [dayjs().add(-1, "d").startOf('day'), dayjs().add(-1, "d").endOf('day')]
|
|
38
47
|
}, {
|
|
39
48
|
label: "Last 3 Days",
|
|
40
49
|
value: [dayjs().add(-3, "d").startOf('day'), dayjs().endOf('day')]
|
|
@@ -57,7 +66,8 @@ var Edit = function Edit(props, ref) {
|
|
|
57
66
|
}
|
|
58
67
|
return true;
|
|
59
68
|
}, [showTime]);
|
|
60
|
-
return /*#__PURE__*/React.createElement(RangePicker, {
|
|
69
|
+
return /*#__PURE__*/React.createElement(RangePicker, _extends({}, others, {
|
|
70
|
+
format: format,
|
|
61
71
|
showTime: _showTime,
|
|
62
72
|
presets: presets || rangePresets,
|
|
63
73
|
ref: ref,
|
|
@@ -82,6 +92,6 @@ var Edit = function Edit(props, ref) {
|
|
|
82
92
|
}
|
|
83
93
|
}, dom);
|
|
84
94
|
}
|
|
85
|
-
});
|
|
95
|
+
}));
|
|
86
96
|
};
|
|
87
97
|
export default /*#__PURE__*/forwardRef(Edit);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,cAAc,CAAC;AAkBtB,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,cAAc,CAAC;AAkBtB,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAwHhC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -87,11 +87,12 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
}, [defaultColumns]);
|
|
90
|
-
var showTotal = useCallback(function (total, range) {
|
|
90
|
+
var showTotal = useCallback(function (total, range, pageSize) {
|
|
91
|
+
console.log(range, 'range');
|
|
91
92
|
var start = range[0] - 1;
|
|
92
|
-
var _current = start /
|
|
93
|
-
return "Page ".concat(_current, " of ").concat(Math.ceil(total /
|
|
94
|
-
}, [
|
|
93
|
+
var _current = start / pageSize + 1;
|
|
94
|
+
return "Page ".concat(_current, " of ").concat(Math.ceil(total / pageSize));
|
|
95
|
+
}, []);
|
|
95
96
|
var _paginationConfig = useMemo(function () {
|
|
96
97
|
if (tableProps.pagination === false) {
|
|
97
98
|
return false;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
.cell-provider {
|
|
2
|
-
// position: relative;
|
|
3
|
-
cursor: pointer;
|
|
4
2
|
width: 100%;
|
|
5
3
|
height: 100%;
|
|
6
4
|
display: flex;
|
|
@@ -8,7 +6,6 @@
|
|
|
8
6
|
justify-content: center;
|
|
9
7
|
border-radius: 4px;
|
|
10
8
|
padding: 12px;
|
|
11
|
-
// cursor: pointer;
|
|
12
9
|
|
|
13
10
|
&.focus {
|
|
14
11
|
box-shadow: var(--theme-color) 0px 0px 0px 1px !important;
|
|
@@ -55,7 +55,14 @@
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.pisell-lowcode-pagination-disabled {
|
|
58
|
+
.pisell-lowcode-pagination-disabled {
|
|
59
|
+
cursor: not-allowed;
|
|
60
|
+
color: rgba(0,0,0,.25);
|
|
61
|
+
.paginator-page-btn {
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
color: rgba(0,0,0,.25);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
59
66
|
|
|
60
67
|
.pisell-lowcode-pagination-item-active:hover {
|
|
61
68
|
border-color: #D0D5DD !important;
|
|
@@ -37,11 +37,11 @@ var import_antd = require("antd");
|
|
|
37
37
|
var import_fields = require("../../../Table/fields");
|
|
38
38
|
var import_index = require("./index.less");
|
|
39
39
|
var FilterItem = (props) => {
|
|
40
|
-
const { label, type, name } = props;
|
|
40
|
+
const { label, type, name, other } = props;
|
|
41
41
|
const Com = (0, import_react.useMemo)(() => {
|
|
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 }, /* @__PURE__ */ import_react.default.createElement(Com,
|
|
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;
|
|
@@ -33,14 +33,12 @@ __export(Actions_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Actions_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_Filter = __toESM(require("./Filter"));
|
|
37
36
|
var import_QuickFilter = __toESM(require("./Filter/QuickFilter"));
|
|
38
|
-
var import_Sort = __toESM(require("./Sort"));
|
|
39
37
|
var import_index = require("./index.less");
|
|
40
38
|
var Actions = ({ filter, sort }) => {
|
|
41
39
|
const showActions = (0, import_react.useMemo)(() => {
|
|
42
40
|
return (filter == null ? void 0 : filter.show) || (sort == null ? void 0 : sort.show);
|
|
43
41
|
}, [filter == null ? void 0 : filter.show, sort == null ? void 0 : sort.show]);
|
|
44
|
-
return showActions ? /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-actions" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "left-wrap" }, /* @__PURE__ */ import_react.default.createElement(import_QuickFilter.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { className: "right-wrap" }
|
|
42
|
+
return showActions ? /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-actions" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "left-wrap" }, /* @__PURE__ */ import_react.default.createElement(import_QuickFilter.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { className: "right-wrap" })) : null;
|
|
45
43
|
};
|
|
46
44
|
var Actions_default = Actions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAC;AAIzC,QAAA,MAAM,UAAU,UAAW,WAAW,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAC;AAIzC,QAAA,MAAM,UAAU,UAAW,WAAW,GAAG,CAAC,gBA2EzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -36,12 +36,20 @@ var import_antd = require("antd");
|
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_Pagination = __toESM(require("../../Pagination"));
|
|
38
38
|
var BasicTable = (props) => {
|
|
39
|
+
var _a;
|
|
39
40
|
const { dataSource, pagination, ...other } = props;
|
|
40
41
|
const [currentPage, setCurrentPage] = (0, import_react.useState)(1);
|
|
41
42
|
const [pageSize, setPageSize] = (0, import_react.useState)(10);
|
|
43
|
+
const { showTotal } = pagination;
|
|
44
|
+
const _showTotal = (0, import_react.useCallback)((total2, range) => {
|
|
45
|
+
return showTotal(total2, range, pageSize);
|
|
46
|
+
}, [showTotal, pageSize, currentPage]);
|
|
42
47
|
(0, import_react.useEffect)(() => {
|
|
43
48
|
setCurrentPage(1);
|
|
44
49
|
}, [dataSource]);
|
|
50
|
+
(0, import_react.useEffect)(() => {
|
|
51
|
+
setPageSize(pagination == null ? void 0 : pagination.pageSize);
|
|
52
|
+
}, [pagination.pageSize]);
|
|
45
53
|
const _dataSource = (0, import_react.useMemo)(() => {
|
|
46
54
|
let list = (dataSource == null ? void 0 : dataSource.list) || [];
|
|
47
55
|
let total2 = (dataSource == null ? void 0 : dataSource.total) || 0;
|
|
@@ -62,10 +70,12 @@ var BasicTable = (props) => {
|
|
|
62
70
|
setCurrentPage(page);
|
|
63
71
|
setPageSize(pageSize2);
|
|
64
72
|
};
|
|
65
|
-
|
|
73
|
+
console.log(pagination, "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(
|
|
66
75
|
import_Pagination.default,
|
|
67
76
|
{
|
|
68
77
|
...pagination,
|
|
78
|
+
showTotal: _showTotal,
|
|
69
79
|
current: currentPage,
|
|
70
80
|
pageSize,
|
|
71
81
|
onShowSizeChange: onPaginationChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;;AA4E5C,wBAAgC"}
|
|
@@ -46,7 +46,9 @@ var Edit = (props, ref) => {
|
|
|
46
46
|
style,
|
|
47
47
|
bordered,
|
|
48
48
|
presets,
|
|
49
|
-
showTime
|
|
49
|
+
showTime,
|
|
50
|
+
format,
|
|
51
|
+
...others
|
|
50
52
|
} = props;
|
|
51
53
|
const dayjsVal = (0, import_react.useMemo)(() => {
|
|
52
54
|
if ((0, import_utils.isString)(value)) {
|
|
@@ -62,6 +64,7 @@ var Edit = (props, ref) => {
|
|
|
62
64
|
}, [value]);
|
|
63
65
|
const rangePresets = [
|
|
64
66
|
{ label: "Today", value: [(0, import_dayjs.default)().startOf("day"), (0, import_dayjs.default)().endOf("day")] },
|
|
67
|
+
{ label: "Yesterday", value: [(0, import_dayjs.default)().add(-1, "d").startOf("day"), (0, import_dayjs.default)().add(-1, "d").endOf("day")] },
|
|
65
68
|
{ label: "Last 3 Days", value: [(0, import_dayjs.default)().add(-3, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")] },
|
|
66
69
|
{ label: "Last 7 Days", value: [(0, import_dayjs.default)().add(-7, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")] },
|
|
67
70
|
{ label: "Last 14 Days", value: [(0, import_dayjs.default)().add(-14, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")] },
|
|
@@ -77,6 +80,8 @@ var Edit = (props, ref) => {
|
|
|
77
80
|
return /* @__PURE__ */ React.createElement(
|
|
78
81
|
RangePicker,
|
|
79
82
|
{
|
|
83
|
+
...others,
|
|
84
|
+
format,
|
|
80
85
|
showTime: _showTime,
|
|
81
86
|
presets: presets || rangePresets,
|
|
82
87
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,cAAc,CAAC;AAkBtB,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,cAAc,CAAC;AAkBtB,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAwHhC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -99,14 +99,15 @@ var GridViewTable = ({ tableProps }) => {
|
|
|
99
99
|
});
|
|
100
100
|
}, [defaultColumns]);
|
|
101
101
|
const showTotal = (0, import_react.useCallback)(
|
|
102
|
-
(total, range) => {
|
|
102
|
+
(total, range, pageSize) => {
|
|
103
|
+
console.log(range, "range");
|
|
103
104
|
let start = range[0] - 1;
|
|
104
|
-
let _current = start /
|
|
105
|
+
let _current = start / pageSize + 1;
|
|
105
106
|
return `Page ${_current} of ${Math.ceil(
|
|
106
|
-
total /
|
|
107
|
+
total / pageSize
|
|
107
108
|
)}`;
|
|
108
109
|
},
|
|
109
|
-
[
|
|
110
|
+
[]
|
|
110
111
|
);
|
|
111
112
|
const _paginationConfig = (0, import_react.useMemo)(() => {
|
|
112
113
|
if (tableProps.pagination === false) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
.cell-provider {
|
|
2
|
-
// position: relative;
|
|
3
|
-
cursor: pointer;
|
|
4
2
|
width: 100%;
|
|
5
3
|
height: 100%;
|
|
6
4
|
display: flex;
|
|
@@ -8,7 +6,6 @@
|
|
|
8
6
|
justify-content: center;
|
|
9
7
|
border-radius: 4px;
|
|
10
8
|
padding: 12px;
|
|
11
|
-
// cursor: pointer;
|
|
12
9
|
|
|
13
10
|
&.focus {
|
|
14
11
|
box-shadow: var(--theme-color) 0px 0px 0px 1px !important;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM8 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM16 20a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 6a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Zm3 6a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Zm11.258-3.976a2 2 0 0 0-2.225 1.308 1 1 0 1 1-1.886-.664 4 4 0 0 1 7.773 1.333c0 1.53-1.135 2.54-1.945 3.081a8.044 8.044 0 0 1-1.686.848l-.035.013-.011.003-.004.002h-.002L11.92 13l.316.949a1 1 0 0 1-.633-1.897l.016-.006.074-.027a6.051 6.051 0 0 0 1.172-.6c.69-.46 1.055-.95 1.055-1.419v-.001a2 2 0 0 0-1.662-1.975ZM11 17a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1Z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.293 3.293a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L8 6.414V20a1 1 0 1 1-2 0V6.414L3.707 8.707a1 1 0 0 1-1.414-1.414l4-4ZM16 17.586V4a1 1 0 1 1 2 0v13.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 1.414-1.414L16 17.586Z"/></svg>
|