@pisell/materials 1.0.38 → 1.0.39
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/dist/umd/materials.min.css +1 -1
- package/dist/umd/materials.min.js +1 -1
- package/es/components/Pagination/index.d.ts +2 -1
- package/es/components/Pagination/index.js +44 -1
- package/es/components/Pagination/index.less +8 -1
- package/es/components/date-picker/index.js +12 -2
- package/es/components/page/index.js +156 -72
- package/es/components/table/Actions/Filter/FilterItem/index.js +3 -2
- package/es/components/table/Actions/Sort/index.d.ts +3 -3
- package/es/components/table/Actions/Sort/index.js +53 -17
- package/es/components/table/Actions/index.js +6 -5
- package/es/components/table/Actions/index.less +2 -0
- package/es/components/table/BasicTable/index.js +32 -48
- package/es/components/table/Table/fields/index.d.ts +29 -0
- package/es/components/table/Table/fields/index.js +5 -2
- package/es/components/table/Table/fields/link/Show/index.js +5 -2
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +13 -3
- package/es/components/table/Table/fields/search/Config/index.d.ts +3 -0
- package/es/components/table/Table/fields/search/Config/index.js +4 -0
- package/es/components/table/Table/fields/search/Edit/index.d.ts +4 -0
- package/es/components/table/Table/fields/search/Edit/index.js +28 -0
- package/es/components/table/Table/fields/search/Edit/index.less +0 -0
- package/es/components/table/Table/fields/search/Show/index.d.ts +4 -0
- package/es/components/table/Table/fields/search/Show/index.js +16 -0
- package/es/components/table/Table/fields/search/Show/index.less +0 -0
- package/es/components/table/Table/fields/search/Sort/index.d.ts +3 -0
- package/es/components/table/Table/fields/search/Sort/index.js +4 -0
- package/es/components/table/Table/fields/search/index.d.ts +14 -0
- package/es/components/table/Table/fields/search/index.js +17 -0
- package/es/components/table/Table/fields/search/index.less +0 -0
- package/es/components/table/Table/index.js +4 -4
- 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/Table/tableConfig/header/CellProvider/index.less +1 -1
- package/es/components/table/index.js +21 -4
- package/es/components/table/model.js +1 -1
- package/es/index.d.ts +64 -63
- package/es/index.js +41 -43
- package/lib/components/Pagination/index.d.ts +2 -1
- package/lib/components/Pagination/index.js +34 -0
- package/lib/components/Pagination/index.less +8 -1
- package/lib/components/date-picker/index.js +2 -8
- package/lib/components/page/index.js +147 -72
- package/lib/components/table/Actions/Filter/FilterItem/index.js +2 -2
- package/lib/components/table/Actions/Sort/index.d.ts +3 -3
- package/lib/components/table/Actions/Sort/index.js +47 -2
- package/lib/components/table/Actions/index.js +2 -2
- package/lib/components/table/Actions/index.less +2 -0
- package/lib/components/table/BasicTable/index.js +31 -25
- package/lib/components/table/Table/fields/index.d.ts +29 -0
- package/lib/components/table/Table/fields/index.js +5 -2
- package/lib/components/table/Table/fields/link/Show/index.js +11 -2
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +6 -1
- package/lib/components/table/Table/fields/search/Config/index.d.ts +3 -0
- package/lib/components/table/Table/fields/search/Config/index.js +28 -0
- package/lib/components/table/Table/fields/search/Edit/index.d.ts +4 -0
- package/lib/components/table/Table/fields/search/Edit/index.js +51 -0
- package/lib/components/table/Table/fields/search/Edit/index.less +0 -0
- package/lib/components/table/Table/fields/search/Show/index.d.ts +4 -0
- package/lib/components/table/Table/fields/search/Show/index.js +37 -0
- package/lib/components/table/Table/fields/search/Show/index.less +0 -0
- package/lib/components/table/Table/fields/search/Sort/index.d.ts +3 -0
- package/lib/components/table/Table/fields/search/Sort/index.js +28 -0
- package/lib/components/table/Table/fields/search/index.d.ts +14 -0
- package/lib/components/table/Table/fields/search/index.js +51 -0
- package/lib/components/table/Table/fields/search/index.less +0 -0
- package/lib/components/table/Table/index.js +4 -6
- 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/Table/tableConfig/header/CellProvider/index.less +1 -1
- package/lib/components/table/index.js +21 -3
- package/lib/components/table/model.js +1 -1
- package/lib/index.d.ts +64 -63
- package/lib/index.js +3 -0
- package/lowcode/div/meta.ts +6 -2
- 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
|
@@ -5,9 +5,10 @@ export declare const paginationConfig: {
|
|
|
5
5
|
className: string;
|
|
6
6
|
defaultCurrent: number;
|
|
7
7
|
showTotal: (total: number, range: [number, number]) => string;
|
|
8
|
-
itemRender: (page: number, type: "page" | "
|
|
8
|
+
itemRender: (page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
9
|
responsive: boolean;
|
|
10
10
|
size: string;
|
|
11
11
|
};
|
|
12
12
|
declare const Pagination: (props: PaginationProps) => JSX.Element | null;
|
|
13
13
|
export default Pagination;
|
|
14
|
+
export declare const FormPagination: ({ value, onChange, page, pageSize, ...other }: any) => JSX.Element;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
var _excluded = ["value", "onChange", "page", "pageSize"];
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
1
10
|
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
|
-
import React, { useMemo } from "react";
|
|
11
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
3
12
|
import { ArrowLeft, ArrowRight } from "@pisell/icon";
|
|
4
13
|
import { Pagination as OriginPagination } from "antd";
|
|
5
14
|
import classNames from "classnames";
|
|
@@ -139,4 +148,38 @@ var MiniPagination = function MiniPagination(props) {
|
|
|
139
148
|
}, /*#__PURE__*/React.createElement(ArrowRight, {
|
|
140
149
|
className: "paginator-page-btn-right-icon"
|
|
141
150
|
}))));
|
|
151
|
+
};
|
|
152
|
+
export var FormPagination = function FormPagination(_ref) {
|
|
153
|
+
var _ref$value = _ref.value,
|
|
154
|
+
value = _ref$value === void 0 ? {} : _ref$value,
|
|
155
|
+
onChange = _ref.onChange,
|
|
156
|
+
page = _ref.page,
|
|
157
|
+
pageSize = _ref.pageSize,
|
|
158
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
159
|
+
var _useState = useState(1),
|
|
160
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
161
|
+
_p = _useState2[0],
|
|
162
|
+
_setP = _useState2[1];
|
|
163
|
+
var _useState3 = useState(10),
|
|
164
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
165
|
+
_ps = _useState4[0],
|
|
166
|
+
_setPs = _useState4[1];
|
|
167
|
+
var _onChange = function _onChange(p, ps) {
|
|
168
|
+
onChange && onChange({
|
|
169
|
+
page: ps === _ps ? p : 1,
|
|
170
|
+
size: ps
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
useEffect(function () {
|
|
174
|
+
var _page = (value === null || value === void 0 ? void 0 : value.page) || 1;
|
|
175
|
+
var _size = (value === null || value === void 0 ? void 0 : value.size) || 10;
|
|
176
|
+
_setP(_page);
|
|
177
|
+
_setPs(_size);
|
|
178
|
+
}, [value]);
|
|
179
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pagination, _extends({}, other, {
|
|
180
|
+
pageSize: _ps,
|
|
181
|
+
current: _p,
|
|
182
|
+
onChange: _onChange,
|
|
183
|
+
onShowSizeChange: _onChange
|
|
184
|
+
})));
|
|
142
185
|
};
|
|
@@ -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;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { DatePicker as OriginalDatePicker } from 'antd';
|
|
2
2
|
import { withMomentProps } from "../../utils/hoc";
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
|
+
import { RangePicker } from "@pisell/date-picker";
|
|
4
5
|
import localeData from 'dayjs/plugin/localeData';
|
|
5
6
|
import weekday from 'dayjs/plugin/weekday';
|
|
6
7
|
dayjs.extend(weekday);
|
|
7
8
|
dayjs.extend(localeData);
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
// const OriginalRangePicker = OriginalDatePicker.RangePicker;
|
|
11
|
+
|
|
9
12
|
var DatePicker = withMomentProps(OriginalDatePicker, ['defaultPickerValue', 'defaultValue', 'showTime.defaultValue', 'value']);
|
|
10
|
-
|
|
13
|
+
|
|
14
|
+
// const RangePicker = withMomentProps(OriginalRangePicker, [
|
|
15
|
+
// 'defaultPickerValue',
|
|
16
|
+
// 'defaultValue',
|
|
17
|
+
// 'showTime.defaultValue',
|
|
18
|
+
// 'value',
|
|
19
|
+
// ]);
|
|
20
|
+
|
|
11
21
|
DatePicker.RangePicker = RangePicker;
|
|
12
22
|
export default DatePicker;
|
|
@@ -1,85 +1,169 @@
|
|
|
1
|
+
var _excluded = ["children"];
|
|
2
|
+
var _theme$token;
|
|
1
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
|
+
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; }
|
|
5
|
+
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; }
|
|
2
6
|
import React from "react";
|
|
3
7
|
import ConfigProvider from "../config-provider";
|
|
8
|
+
import { AdapterDayjs } from '@pisell/date-picker/es/AdapterDayjs';
|
|
9
|
+
import { LocalizationProvider, createTheme, ThemeProvider } from '@pisell/date-picker';
|
|
4
10
|
var theme = {
|
|
5
|
-
components: {
|
|
6
|
-
Table: {
|
|
7
|
-
colorFillContent: "
|
|
8
|
-
colorFillSecondary: "
|
|
9
|
-
colorBorderSecondary: "#EAECF0",
|
|
10
|
-
colorFillAlter: "
|
|
11
|
+
"components": {
|
|
12
|
+
"Table": {
|
|
13
|
+
"colorFillContent": "#EAECF0",
|
|
14
|
+
"colorFillSecondary": "#F2F4F7",
|
|
15
|
+
"colorBorderSecondary": "#EAECF0",
|
|
16
|
+
"colorFillAlter": "#F9FAFB",
|
|
17
|
+
"controlItemBgHover": "#F9FAFB",
|
|
18
|
+
"colorTextHeading": "#475467",
|
|
19
|
+
"colorTextDescription": "#667085",
|
|
20
|
+
"colorText": "#101828",
|
|
21
|
+
"controlHeight": 32,
|
|
22
|
+
"padding": 24,
|
|
23
|
+
"margin": 16
|
|
24
|
+
},
|
|
25
|
+
"Button": {
|
|
26
|
+
"borderRadiusSM": 6,
|
|
27
|
+
"borderRadiusLG": 9,
|
|
28
|
+
"borderRadius": 8,
|
|
29
|
+
"controlHeight": 36,
|
|
30
|
+
"colorBgContainerDisabled": "#F2F4F7",
|
|
31
|
+
"colorBgTextHover": "#F9FAFB",
|
|
32
|
+
"colorBorder": "#D0D5DD",
|
|
33
|
+
"colorError": "#D92D20",
|
|
34
|
+
"colorErrorActive": "#D92D20",
|
|
35
|
+
"colorErrorHover": "#B42318",
|
|
36
|
+
"colorErrorBg": "#FEF3F2",
|
|
37
|
+
"colorErrorBorderHover": "#FDA29B",
|
|
38
|
+
"colorErrorOutline": "rgba(217, 45, 32, 0.06)",
|
|
39
|
+
"colorLink": "#175CD3",
|
|
40
|
+
"colorLinkActive": "#194185",
|
|
41
|
+
"colorLinkHover": "#1849A9",
|
|
42
|
+
"colorPrimaryActive": "#7f56d9",
|
|
43
|
+
"colorPrimaryBorder": "#E9D7FE",
|
|
44
|
+
"colorText": "#344054",
|
|
45
|
+
"colorTextDisabled": "#D0D5DD",
|
|
46
|
+
"colorTextLightSolid": "#fff",
|
|
47
|
+
"colorBgTextActive": "#D0D5DD",
|
|
48
|
+
"controlOutline": "rgba(127, 86, 217, 0.04)",
|
|
49
|
+
"controlTmpOutline": "#F9FAFB",
|
|
50
|
+
"paddingContentHorizontal": 14,
|
|
51
|
+
"marginXS": 8
|
|
52
|
+
},
|
|
53
|
+
"Divider": {
|
|
54
|
+
"colorSplit": "#EAECF0"
|
|
55
|
+
},
|
|
56
|
+
"Breadcrumb": {
|
|
57
|
+
"itemColor": "#475467",
|
|
58
|
+
"colorTextDescription": "#475467",
|
|
59
|
+
"lastItemColor": "#6941C6",
|
|
60
|
+
"separatorMargin": 12,
|
|
61
|
+
"separatorColor": "#D0D5DD",
|
|
62
|
+
"linkHoverColor": "#1D2939",
|
|
63
|
+
"linkColor": "#475467",
|
|
64
|
+
"colorBgTextHover": "#F9FAFB",
|
|
65
|
+
"paddingXXS": 8
|
|
66
|
+
},
|
|
67
|
+
"Dropdown": {
|
|
68
|
+
"borderRadiusLG": 8,
|
|
69
|
+
// "boxShadowPopoverArrow": "2px 2px 5px rgba(0, 0, 0, 0.05)",
|
|
70
|
+
"controlHeight": 42,
|
|
71
|
+
"fontSize": 14
|
|
72
|
+
},
|
|
73
|
+
"DatePicker": {
|
|
74
|
+
"borderRadius": 8,
|
|
75
|
+
"colorTextPlaceholder": "#667085",
|
|
76
|
+
"colorIcon": "#667085",
|
|
77
|
+
"colorTextQuaternary": "#D0D5DD",
|
|
78
|
+
"colorBgContainerDisabled": "#F9FAFB",
|
|
79
|
+
"colorTextDisabled": "#98A2B3"
|
|
11
80
|
}
|
|
12
81
|
},
|
|
13
|
-
token: {
|
|
14
|
-
colorPrimary: "#7F56D9",
|
|
15
|
-
colorPrimaryBg: "#F9F5FF",
|
|
16
|
-
colorPrimaryBgHover: "#F4EBFF",
|
|
17
|
-
colorPrimaryBorder: "#E9D7FE",
|
|
18
|
-
colorPrimaryBorderHover: "#D6BBFB",
|
|
19
|
-
colorPrimaryHover: "#6941C6",
|
|
20
|
-
colorPrimaryActive: "#53389E",
|
|
21
|
-
colorPrimaryTextHover: "#53389E",
|
|
22
|
-
colorPrimaryText: "#6941C6",
|
|
23
|
-
colorPrimaryTextActive: "#42307D",
|
|
24
|
-
colorSuccess: "#079455",
|
|
25
|
-
colorSuccessBg: "#ECFDF3",
|
|
26
|
-
colorSuccessBgHover: "#DCFAE6",
|
|
27
|
-
colorSuccessBorder: "#ABEFC6",
|
|
28
|
-
colorSuccessBorderHover: "#75E0A7",
|
|
29
|
-
colorSuccessHover: "#067647",
|
|
30
|
-
colorSuccessText: "#067647",
|
|
31
|
-
colorSuccessActive: "#085D3A",
|
|
32
|
-
colorSuccessTextHover: "#085D3A",
|
|
33
|
-
colorSuccessTextActive: "#074D31",
|
|
34
|
-
colorWarning: "#dc6803",
|
|
35
|
-
colorWarningBg: "#FFFAEB",
|
|
36
|
-
colorWarningBgHover: "#FEF0C7",
|
|
37
|
-
colorWarningBorder: "#FEDF89",
|
|
38
|
-
colorWarningBorderHover: "#FEC84B",
|
|
39
|
-
colorWarningHover: "#B54708",
|
|
40
|
-
colorWarningText: "#B54708",
|
|
41
|
-
colorWarningActive: "#93370D",
|
|
42
|
-
colorWarningTextHover: "#93370D",
|
|
43
|
-
colorWarningTextActive: "#7A2E0E",
|
|
44
|
-
colorError: "#d92d20",
|
|
45
|
-
colorErrorBg: "#FEF3F2",
|
|
46
|
-
colorErrorBgHover: "#FEE4E2",
|
|
47
|
-
colorErrorBorder: "#FECDCA",
|
|
48
|
-
colorErrorBorderHover: "#FDA29B",
|
|
49
|
-
colorErrorHover: "#B42318",
|
|
50
|
-
colorErrorText: "#B42318",
|
|
51
|
-
colorErrorActive: "#912018",
|
|
52
|
-
colorErrorTextHover: "#912018",
|
|
53
|
-
colorErrorTextActive: "#7A271A",
|
|
54
|
-
colorInfo: "#1570ef",
|
|
55
|
-
colorInfoBg: "#EFF8FF",
|
|
56
|
-
colorInfoBgHover: "#D1E9FF",
|
|
57
|
-
colorInfoBorder: "#B2DDFF",
|
|
58
|
-
colorInfoBorderHover: "#84CAFF",
|
|
59
|
-
colorInfoHover: "#175CD3",
|
|
60
|
-
colorInfoText: "#175CD3",
|
|
61
|
-
colorInfoActive: "#1849A9",
|
|
62
|
-
colorInfoTextHover: "#1849A9",
|
|
63
|
-
colorInfoTextActive: "#194185",
|
|
64
|
-
colorText: "#101828",
|
|
65
|
-
colorTextSecondary: "#475467",
|
|
66
|
-
colorTextTertiary: "#667085",
|
|
67
|
-
colorTextQuaternary: "#D0D5DD",
|
|
68
|
-
colorBorder: "#D0D5DD",
|
|
69
|
-
colorBorderSecondary: "#EAECF0",
|
|
70
|
-
colorFill: "#D0D5DD",
|
|
71
|
-
colorFillSecondary: "#EAECF0",
|
|
72
|
-
colorFillTertiary: "#F2F4F7",
|
|
73
|
-
colorFillQuaternary: "#F9FAFB",
|
|
74
|
-
colorBgLayout: "#F2F4F7",
|
|
75
|
-
colorBgSpotlight: "#101828",
|
|
76
|
-
colorBgMask: "rgba(0, 0, 0, 0.5)"
|
|
82
|
+
"token": {
|
|
83
|
+
"colorPrimary": "#7F56D9",
|
|
84
|
+
"colorPrimaryBg": "#F9F5FF",
|
|
85
|
+
"colorPrimaryBgHover": "#F4EBFF",
|
|
86
|
+
"colorPrimaryBorder": "#E9D7FE",
|
|
87
|
+
"colorPrimaryBorderHover": "#D6BBFB",
|
|
88
|
+
"colorPrimaryHover": "#6941C6",
|
|
89
|
+
"colorPrimaryActive": "#53389E",
|
|
90
|
+
"colorPrimaryTextHover": "#53389E",
|
|
91
|
+
"colorPrimaryText": "#6941C6",
|
|
92
|
+
"colorPrimaryTextActive": "#42307D",
|
|
93
|
+
"colorSuccess": "#079455",
|
|
94
|
+
"colorSuccessBg": "#ECFDF3",
|
|
95
|
+
"colorSuccessBgHover": "#DCFAE6",
|
|
96
|
+
"colorSuccessBorder": "#ABEFC6",
|
|
97
|
+
"colorSuccessBorderHover": "#75E0A7",
|
|
98
|
+
"colorSuccessHover": "#067647",
|
|
99
|
+
"colorSuccessText": "#067647",
|
|
100
|
+
"colorSuccessActive": "#085D3A",
|
|
101
|
+
"colorSuccessTextHover": "#085D3A",
|
|
102
|
+
"colorSuccessTextActive": "#074D31",
|
|
103
|
+
"colorWarning": "#dc6803",
|
|
104
|
+
"colorWarningBg": "#FFFAEB",
|
|
105
|
+
"colorWarningBgHover": "#FEF0C7",
|
|
106
|
+
"colorWarningBorder": "#FEDF89",
|
|
107
|
+
"colorWarningBorderHover": "#FEC84B",
|
|
108
|
+
"colorWarningHover": "#B54708",
|
|
109
|
+
"colorWarningText": "#B54708",
|
|
110
|
+
"colorWarningActive": "#93370D",
|
|
111
|
+
"colorWarningTextHover": "#93370D",
|
|
112
|
+
"colorWarningTextActive": "#7A2E0E",
|
|
113
|
+
"colorError": "#d92d20",
|
|
114
|
+
"colorErrorBg": "#FEF3F2",
|
|
115
|
+
"colorErrorBgHover": "#FEE4E2",
|
|
116
|
+
"colorErrorBorder": "#FECDCA",
|
|
117
|
+
"colorErrorBorderHover": "#FDA29B",
|
|
118
|
+
"colorErrorHover": "#B42318",
|
|
119
|
+
"colorErrorText": "#B42318",
|
|
120
|
+
"colorErrorActive": "#912018",
|
|
121
|
+
"colorErrorTextHover": "#912018",
|
|
122
|
+
"colorErrorTextActive": "#7A271A",
|
|
123
|
+
"colorInfo": "#1570ef",
|
|
124
|
+
"colorInfoBg": "#EFF8FF",
|
|
125
|
+
"colorInfoBgHover": "#D1E9FF",
|
|
126
|
+
"colorInfoBorder": "#B2DDFF",
|
|
127
|
+
"colorInfoBorderHover": "#84CAFF",
|
|
128
|
+
"colorInfoHover": "#175CD3",
|
|
129
|
+
"colorInfoText": "#175CD3",
|
|
130
|
+
"colorInfoActive": "#1849A9",
|
|
131
|
+
"colorInfoTextHover": "#1849A9",
|
|
132
|
+
"colorInfoTextActive": "#194185",
|
|
133
|
+
"colorText": "#101828",
|
|
134
|
+
"colorTextSecondary": "#475467",
|
|
135
|
+
"colorTextTertiary": "#667085",
|
|
136
|
+
"colorTextQuaternary": "#D0D5DD",
|
|
137
|
+
"colorBorder": "#D0D5DD",
|
|
138
|
+
"colorBorderSecondary": "#EAECF0",
|
|
139
|
+
"colorFill": "#D0D5DD",
|
|
140
|
+
"colorFillSecondary": "#EAECF0",
|
|
141
|
+
"colorFillTertiary": "#F2F4F7",
|
|
142
|
+
"colorFillQuaternary": "#F9FAFB",
|
|
143
|
+
"colorBgLayout": "#F2F4F7",
|
|
144
|
+
"colorBgSpotlight": "#101828",
|
|
145
|
+
"colorBgMask": "rgba(0, 0, 0, 0.5)",
|
|
146
|
+
"wireframe": false,
|
|
147
|
+
"borderRadius": 8
|
|
77
148
|
}
|
|
78
149
|
};
|
|
150
|
+
var datePickerTheme = createTheme({
|
|
151
|
+
palette: {
|
|
152
|
+
primary: {
|
|
153
|
+
main: ((_theme$token = theme.token) === null || _theme$token === void 0 ? void 0 : _theme$token.colorPrimary) || "#7F56D9"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
79
157
|
var Page = function Page(props) {
|
|
80
|
-
|
|
158
|
+
var children = props.children,
|
|
159
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
160
|
+
return /*#__PURE__*/React.createElement(ConfigProvider, _extends({}, others, {
|
|
81
161
|
prefixCls: props.prefixCls || "pisell-lowcode",
|
|
82
162
|
theme: props.theme || theme
|
|
83
|
-
})
|
|
163
|
+
}), /*#__PURE__*/React.createElement(LocalizationProvider, {
|
|
164
|
+
dateAdapter: AdapterDayjs
|
|
165
|
+
}, /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
166
|
+
theme: datePickerTheme
|
|
167
|
+
}, children)));
|
|
84
168
|
};
|
|
85
169
|
export default Page;
|
|
@@ -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,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare type SortItemProps = {
|
|
3
|
-
type: "
|
|
3
|
+
type: "date" | "string" | "number";
|
|
4
|
+
label: string;
|
|
4
5
|
name: string;
|
|
5
|
-
props: object;
|
|
6
|
-
title: string;
|
|
7
6
|
};
|
|
8
7
|
declare type SortListProps = {
|
|
9
8
|
list: SortItemProps[];
|
|
9
|
+
onChange?: (val: string) => void;
|
|
10
10
|
};
|
|
11
11
|
declare const Sort: React.FC<SortListProps>;
|
|
12
12
|
export default Sort;
|
|
@@ -1,23 +1,59 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Button } from "antd";
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { Button, Dropdown } from "antd";
|
|
3
3
|
import { SwitchVertical01 } from "@pisell/icon";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
var sortChildrenMap = {
|
|
5
|
+
date: function date(key) {
|
|
6
|
+
return [{
|
|
7
|
+
key: "".concat(key, ":desc"),
|
|
8
|
+
label: "Oldest to newest"
|
|
9
|
+
}, {
|
|
10
|
+
key: "".concat(key, ":asc"),
|
|
11
|
+
label: "Newest to oldest"
|
|
12
|
+
}];
|
|
13
|
+
},
|
|
14
|
+
string: function string(key) {
|
|
15
|
+
return [{
|
|
16
|
+
key: "".concat(key, ":asc"),
|
|
17
|
+
label: "A to Z"
|
|
18
|
+
}, {
|
|
19
|
+
key: "".concat(key, ":desc"),
|
|
20
|
+
label: "Z to A"
|
|
21
|
+
}];
|
|
22
|
+
},
|
|
23
|
+
number: function number(key) {
|
|
24
|
+
return [{
|
|
25
|
+
key: "".concat(key, ":asc"),
|
|
26
|
+
label: "Lowest to highest"
|
|
27
|
+
}, {
|
|
28
|
+
key: "".concat(key, ":desc"),
|
|
29
|
+
label: "Highest to lowest"
|
|
30
|
+
}];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
16
33
|
var Sort = function Sort(_ref) {
|
|
17
34
|
var _ref$list = _ref.list,
|
|
18
|
-
list = _ref$list === void 0 ? [] : _ref$list
|
|
19
|
-
|
|
35
|
+
list = _ref$list === void 0 ? [] : _ref$list,
|
|
36
|
+
onChange = _ref.onChange;
|
|
37
|
+
var sortItems = useMemo(function () {
|
|
38
|
+
return list.map(function (d) {
|
|
39
|
+
return {
|
|
40
|
+
key: d.name,
|
|
41
|
+
label: d.label,
|
|
42
|
+
children: sortChildrenMap[d.type](d.name)
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}, [list]);
|
|
46
|
+
var onClick = function onClick(detail) {
|
|
47
|
+
var _detail$keyPath;
|
|
48
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(detail === null || detail === void 0 ? void 0 : (_detail$keyPath = detail.keyPath) === null || _detail$keyPath === void 0 ? void 0 : _detail$keyPath[0]);
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
51
|
+
menu: {
|
|
52
|
+
items: sortItems,
|
|
53
|
+
onClick: onClick
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
20
56
|
icon: /*#__PURE__*/React.createElement(SwitchVertical01, null)
|
|
21
|
-
}, "Sort");
|
|
57
|
+
}, "Sort"));
|
|
22
58
|
};
|
|
23
59
|
export default Sort;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
|
-
import
|
|
2
|
+
import { Form } from "antd";
|
|
3
3
|
import QuickFilter from "./Filter/QuickFilter";
|
|
4
4
|
import Sort from "./Sort";
|
|
5
5
|
import "./index.less";
|
|
@@ -15,10 +15,11 @@ var Actions = function Actions(_ref) {
|
|
|
15
15
|
className: "left-wrap"
|
|
16
16
|
}, /*#__PURE__*/React.createElement(QuickFilter, null)), /*#__PURE__*/React.createElement("div", {
|
|
17
17
|
className: "right-wrap"
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
}, sort !== null && sort !== void 0 && sort.show ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
19
|
+
name: "order_by",
|
|
20
|
+
noStyle: true
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Sort, {
|
|
21
22
|
list: (sort === null || sort === void 0 ? void 0 : sort.list) || []
|
|
22
|
-
}) : null)) : null;
|
|
23
|
+
})) : null)) : null;
|
|
23
24
|
};
|
|
24
25
|
export default Actions;
|
|
@@ -1,74 +1,58 @@
|
|
|
1
|
-
var _excluded = ["dataSource", "pagination"];
|
|
1
|
+
var _excluded = ["dataSource", "pagination", "value"];
|
|
2
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); }
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
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."); }
|
|
5
|
-
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); }
|
|
6
|
-
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; }
|
|
7
|
-
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; } }
|
|
8
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
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; }
|
|
10
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; }
|
|
11
|
-
import { Table } from "antd";
|
|
12
|
-
import React, {
|
|
13
|
-
import
|
|
5
|
+
import { Table, Form } from "antd";
|
|
6
|
+
import React, { useMemo, useCallback } from "react";
|
|
7
|
+
import { FormPagination } from "../../Pagination";
|
|
14
8
|
var BasicTable = function BasicTable(props) {
|
|
9
|
+
var _pagination$pageSizeO;
|
|
15
10
|
var dataSource = props.dataSource,
|
|
16
11
|
pagination = props.pagination,
|
|
12
|
+
value = props.value,
|
|
17
13
|
other = _objectWithoutProperties(props, _excluded);
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, [dataSource]);
|
|
14
|
+
var form = Form.useFormInstance();
|
|
15
|
+
var formPagination = Form.useWatch("pagination", form) || {
|
|
16
|
+
page: 1,
|
|
17
|
+
size: 10
|
|
18
|
+
};
|
|
19
|
+
var showTotal = pagination.showTotal;
|
|
20
|
+
var _showTotal = useCallback(function (total, range) {
|
|
21
|
+
var _size = formPagination.size;
|
|
22
|
+
return showTotal(total, range, _size);
|
|
23
|
+
}, [showTotal, formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size]);
|
|
29
24
|
|
|
30
25
|
// 分割数据源
|
|
31
26
|
var _dataSource = useMemo(function () {
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
|
|
27
|
+
var _page = formPagination.page;
|
|
28
|
+
var _size = formPagination.size;
|
|
29
|
+
var list = [];
|
|
30
|
+
var _total = total;
|
|
31
|
+
if (dataSource.length > _size) {
|
|
32
|
+
list = dataSource;
|
|
33
|
+
_total = list.length;
|
|
34
|
+
list = list.slice((_page - 1) * _size, _page * _size);
|
|
35
|
+
} else {
|
|
35
36
|
list = dataSource;
|
|
36
|
-
total = list.length;
|
|
37
37
|
}
|
|
38
|
-
list = list.slice((currentPage - 1) * pageSize, currentPage * pageSize);
|
|
39
38
|
return {
|
|
40
39
|
list: list,
|
|
41
|
-
total:
|
|
40
|
+
total: _total
|
|
42
41
|
};
|
|
43
|
-
}, [dataSource,
|
|
42
|
+
}, [dataSource, formPagination === null || formPagination === void 0 ? void 0 : formPagination.page, formPagination === null || formPagination === void 0 ? void 0 : formPagination.size]);
|
|
44
43
|
|
|
45
44
|
// 总数
|
|
46
45
|
var total = useMemo(function () {
|
|
47
46
|
return (pagination === null || pagination === void 0 ? void 0 : pagination.total) || (_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.total) || 0;
|
|
48
47
|
}, [dataSource, pagination]);
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @title: 翻页回调
|
|
52
|
-
* @description:
|
|
53
|
-
* @param {number} page
|
|
54
|
-
* @param {number} pageSize
|
|
55
|
-
* @return {*}
|
|
56
|
-
* @Author: zhiwei.Wang
|
|
57
|
-
* @Date: 2023-07-20 17:01
|
|
58
|
-
*/
|
|
59
|
-
var onPaginationChange = function onPaginationChange(page, pageSize) {
|
|
60
|
-
setCurrentPage(page);
|
|
61
|
-
setPageSize(pageSize);
|
|
62
|
-
};
|
|
63
48
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, _extends({}, other, {
|
|
64
49
|
pagination: false,
|
|
65
50
|
dataSource: _dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list
|
|
66
|
-
})), total >
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
onChange: onPaginationChange,
|
|
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, {
|
|
52
|
+
name: "pagination"
|
|
53
|
+
}, /*#__PURE__*/React.createElement(FormPagination, _extends({}, pagination, {
|
|
54
|
+
showTotal: _showTotal,
|
|
71
55
|
total: total
|
|
72
|
-
})) : null);
|
|
56
|
+
}))) : null);
|
|
73
57
|
};
|
|
74
58
|
export default BasicTable;
|