@pisell/materials 1.0.10 → 1.0.12
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/config-provider/index.d.ts +6 -2
- package/es/components/config-provider/index.js +10 -11
- package/es/components/page/index.d.ts +6 -0
- package/es/components/page/index.js +85 -0
- package/es/components/table/Actions/Filter/Dropdown/index.less +1 -1
- package/es/components/table/Actions/index.less +1 -1
- package/es/components/table/Pagination/index.d.ts +3 -1
- package/es/components/table/Pagination/index.js +3 -1
- package/es/components/table/Pagination/index.less +11 -11
- package/es/components/table/Table/AddFieldModal/index.less +1 -1
- package/es/components/table/Table/index.js +16 -4
- package/es/hooks/index.d.ts +2 -1
- package/es/hooks/index.js +2 -1
- package/es/hooks/useResponsive.d.ts +4 -0
- package/es/hooks/useResponsive.js +95 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/lib/components/config-provider/index.d.ts +6 -2
- package/lib/components/page/index.d.ts +6 -0
- package/lib/components/page/index.js +122 -0
- package/lib/components/table/Actions/Filter/Dropdown/index.less +1 -1
- package/lib/components/table/Actions/index.less +1 -1
- package/lib/components/table/Pagination/index.d.ts +3 -1
- package/lib/components/table/Pagination/index.js +3 -1
- package/lib/components/table/Pagination/index.less +11 -11
- package/lib/components/table/Table/AddFieldModal/index.less +1 -1
- package/lib/components/table/Table/index.js +18 -5
- package/lib/hooks/index.d.ts +2 -1
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/useResponsive.d.ts +4 -0
- package/lib/hooks/useResponsive.js +104 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +29 -0
- package/lowcode/config-provider/meta.ts +113 -109
- package/lowcode/page/meta.ts +44 -0
- package/package.json +1 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { ConfigProviderProps as OriginalConfigProviderProps } from "antd/es/config-provider";
|
|
3
|
+
import "dayjs/locale/zh-cn";
|
|
4
|
+
export interface ConfigProviderProps extends OriginalConfigProviderProps {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
declare const ConfigProvider: (props: ConfigProviderProps) => JSX.Element;
|
|
4
8
|
export default ConfigProvider;
|
|
@@ -2,23 +2,22 @@ var _excluded = ["locale"];
|
|
|
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
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; }
|
|
4
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; }
|
|
5
|
-
import React from
|
|
6
|
-
import { ConfigProvider as OriginalConfigProvider } from
|
|
7
|
-
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { ConfigProvider as OriginalConfigProvider } from "antd";
|
|
8
7
|
// 由于 antd 组件的默认文案是英文,所以需要修改为中文
|
|
9
|
-
import dayjs from
|
|
10
|
-
import
|
|
11
|
-
import zhCN from
|
|
8
|
+
import dayjs from "dayjs";
|
|
9
|
+
import "dayjs/locale/zh-cn";
|
|
10
|
+
import zhCN from "antd/locale/zh_CN";
|
|
12
11
|
var ConfigProvider = function ConfigProvider(props) {
|
|
13
12
|
var locale = props.locale,
|
|
14
13
|
rest = _objectWithoutProperties(props, _excluded);
|
|
15
14
|
var localeData = locale;
|
|
16
|
-
if (typeof locale ===
|
|
17
|
-
if (locale.toLowerCase() ===
|
|
18
|
-
dayjs.locale(
|
|
15
|
+
if (typeof locale === "string") {
|
|
16
|
+
if (locale.toLowerCase() === "zh-cn") {
|
|
17
|
+
dayjs.locale("zh-cn");
|
|
19
18
|
localeData = zhCN;
|
|
20
|
-
} else if (locale.toLowerCase() ===
|
|
21
|
-
dayjs.locale(
|
|
19
|
+
} else if (locale.toLowerCase() === "en-us") {
|
|
20
|
+
dayjs.locale("en");
|
|
22
21
|
// 默认为英文
|
|
23
22
|
localeData = undefined;
|
|
24
23
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
import React from "react";
|
|
3
|
+
import ConfigProvider from "../config-provider";
|
|
4
|
+
var theme = {
|
|
5
|
+
components: {
|
|
6
|
+
Table: {
|
|
7
|
+
colorFillContent: "rgba(0, 0, 0, 0.06)",
|
|
8
|
+
colorFillSecondary: "rgba(0, 0, 0, 0.06)",
|
|
9
|
+
colorBorderSecondary: "#EAECF0",
|
|
10
|
+
colorFillAlter: "rgba(0, 0, 0, 0.02)"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
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)"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var Page = function Page(props) {
|
|
80
|
+
return /*#__PURE__*/React.createElement(ConfigProvider, _extends({}, props, {
|
|
81
|
+
prefixCls: props.prefixCls || "pisell-lowcode",
|
|
82
|
+
theme: props.theme || theme
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
export default Page;
|
|
@@ -5,7 +5,9 @@ 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" | "prev" | "next" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
|
+
responsive: boolean;
|
|
10
|
+
size: string;
|
|
9
11
|
};
|
|
10
12
|
declare const Pagination: (props: PaginationProps) => JSX.Element | null;
|
|
11
13
|
export default Pagination;
|
|
@@ -31,7 +31,9 @@ export var paginationConfig = {
|
|
|
31
31
|
showTotal: function showTotal(total, range) {
|
|
32
32
|
return "Page ".concat(range[0], " of ").concat(range[1]);
|
|
33
33
|
},
|
|
34
|
-
itemRender: itemRender
|
|
34
|
+
itemRender: itemRender,
|
|
35
|
+
responsive: true,
|
|
36
|
+
size: "small"
|
|
35
37
|
};
|
|
36
38
|
var Pagination = function Pagination(props) {
|
|
37
39
|
console.log(props);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
padding: 0 20px;
|
|
13
13
|
margin: 0 !important;
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.pisell-lowcode-pagination-total-text {
|
|
16
16
|
margin-right: auto;
|
|
17
17
|
color: var(--gray-500, #667085);
|
|
18
18
|
/* Text sm/Medium */
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
/* 142.857% */
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.pisell-lowcode-pagination-item {
|
|
27
27
|
position: relative;
|
|
28
28
|
border: none;
|
|
29
29
|
margin: 0;
|
|
@@ -32,37 +32,37 @@
|
|
|
32
32
|
border-right: 0;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.
|
|
35
|
+
.pisell-lowcode-pagination-jump-prev {
|
|
36
36
|
border: 1px solid #D0D5DD;
|
|
37
37
|
margin: 0;
|
|
38
38
|
border-radius: 0;
|
|
39
39
|
border-right: none;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.
|
|
42
|
+
.pisell-lowcode-pagination-jump-next {
|
|
43
43
|
border: 1px solid #D0D5DD;
|
|
44
44
|
margin: 0;
|
|
45
45
|
border-radius: 0;
|
|
46
46
|
border-right: none;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
49
|
+
.pisell-lowcode-pagination-item-link:hover {
|
|
50
50
|
font-weight: 450 !important;
|
|
51
51
|
color: rgba(0, 0, 0, 0.88) !important;
|
|
52
52
|
|
|
53
|
-
.
|
|
53
|
+
.pisell-lowcode-pagination-item-link-icon {
|
|
54
54
|
font-weight: 450 !important;
|
|
55
55
|
color: rgba(0, 0, 0, 0.88) !important;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.
|
|
59
|
+
.pisell-lowcode-pagination-disabled {}
|
|
60
60
|
|
|
61
|
-
.
|
|
61
|
+
.pisell-lowcode-pagination-item-active:hover {
|
|
62
62
|
border-color: #D0D5DD !important;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.
|
|
65
|
+
.pisell-lowcode-pagination-item-active {
|
|
66
66
|
a {
|
|
67
67
|
font-weight: 450 !important;
|
|
68
68
|
color: rgba(0, 0, 0, 0.88) !important;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
background-color: rgba(0, 0, 0, 0.06);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.
|
|
75
|
+
.pisell-lowcode-pagination-prev {
|
|
76
76
|
display: flex;
|
|
77
77
|
align-items: center;
|
|
78
78
|
justify-content: center;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
.
|
|
87
|
+
.pisell-lowcode-pagination-next {
|
|
88
88
|
display: flex;
|
|
89
89
|
align-items: center;
|
|
90
90
|
justify-content: center;
|
|
@@ -11,7 +11,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
11
11
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
12
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
13
|
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; }
|
|
14
|
-
import { useSharedState } from "../../../hooks";
|
|
14
|
+
import { useSharedState, useResponsive } from "../../../hooks";
|
|
15
15
|
import { Table } from "antd";
|
|
16
16
|
// import { Access } from '@umijs/max';
|
|
17
17
|
import React, { useCallback, useMemo } from "react";
|
|
@@ -25,6 +25,7 @@ import Header from "./tableConfig/header";
|
|
|
25
25
|
import { paginationConfig } from "../Pagination";
|
|
26
26
|
var GridViewTable = function GridViewTable(_ref) {
|
|
27
27
|
var tableProps = _ref.tableProps;
|
|
28
|
+
var responsive = useResponsive();
|
|
28
29
|
var _useSharedState = useSharedState(Context),
|
|
29
30
|
state = _useSharedState.state,
|
|
30
31
|
dispatch = _useSharedState.dispatch;
|
|
@@ -91,6 +92,19 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
91
92
|
var _current = start / tableProps.pagination.pageSize + 1;
|
|
92
93
|
return "Page ".concat(_current, " of ").concat(Math.ceil(total / tableProps.pagination.pageSize));
|
|
93
94
|
}, [tableProps.pagination.pageSize]);
|
|
95
|
+
var _paginationConfig = useMemo(function () {
|
|
96
|
+
if (tableProps.pagination === false) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (responsive === "phone") {
|
|
100
|
+
return _objectSpread(_objectSpread({}, tableProps.pagination), {}, {
|
|
101
|
+
size: "small"
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return _objectSpread(_objectSpread(_objectSpread({}, paginationConfig), tableProps.pagination), {}, {
|
|
105
|
+
showTotal: showTotal
|
|
106
|
+
});
|
|
107
|
+
}, [responsive, tableProps.pagination]);
|
|
94
108
|
return /*#__PURE__*/React.createElement("div", {
|
|
95
109
|
className: "materials-grid-table-wrap"
|
|
96
110
|
}, /*#__PURE__*/React.createElement(SortRow, null, /*#__PURE__*/React.createElement(Table, _extends({
|
|
@@ -111,9 +125,7 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
111
125
|
scroll: {
|
|
112
126
|
x: "max-content"
|
|
113
127
|
},
|
|
114
|
-
pagination:
|
|
115
|
-
showTotal: showTotal
|
|
116
|
-
})
|
|
128
|
+
pagination: _paginationConfig
|
|
117
129
|
}))));
|
|
118
130
|
};
|
|
119
131
|
export default GridViewTable;
|
package/es/hooks/index.d.ts
CHANGED
package/es/hooks/index.js
CHANGED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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; } }
|
|
4
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
5
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
|
+
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); }
|
|
7
|
+
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; }
|
|
8
|
+
import { useEffect, useState, useMemo } from 'react';
|
|
9
|
+
import { isBrowser } from "../utils";
|
|
10
|
+
var subscribers = new Set();
|
|
11
|
+
var info;
|
|
12
|
+
var responsiveConfig = {
|
|
13
|
+
phone: 0,
|
|
14
|
+
ipad: 700,
|
|
15
|
+
pc: 1080
|
|
16
|
+
};
|
|
17
|
+
function handleResize() {
|
|
18
|
+
var oldInfo = info;
|
|
19
|
+
calculate();
|
|
20
|
+
if (oldInfo === info) return;
|
|
21
|
+
var _iterator = _createForOfIteratorHelper(subscribers),
|
|
22
|
+
_step;
|
|
23
|
+
try {
|
|
24
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
25
|
+
var subscriber = _step.value;
|
|
26
|
+
subscriber();
|
|
27
|
+
}
|
|
28
|
+
} catch (err) {
|
|
29
|
+
_iterator.e(err);
|
|
30
|
+
} finally {
|
|
31
|
+
_iterator.f();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
var listening = false;
|
|
35
|
+
function calculate() {
|
|
36
|
+
var width = window.innerWidth;
|
|
37
|
+
var newInfo = {};
|
|
38
|
+
var shouldUpdate = false;
|
|
39
|
+
for (var _i = 0, _Object$keys = Object.keys(responsiveConfig); _i < _Object$keys.length; _i++) {
|
|
40
|
+
var key = _Object$keys[_i];
|
|
41
|
+
newInfo[key] = width >= responsiveConfig[key];
|
|
42
|
+
if (newInfo[key] !== info[key]) {
|
|
43
|
+
shouldUpdate = true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (shouldUpdate) {
|
|
47
|
+
info = newInfo;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function configResponsive(config) {
|
|
51
|
+
responsiveConfig = config;
|
|
52
|
+
if (info) calculate();
|
|
53
|
+
}
|
|
54
|
+
export default function useResponsive() {
|
|
55
|
+
if (isBrowser && !listening) {
|
|
56
|
+
info = {};
|
|
57
|
+
calculate();
|
|
58
|
+
window.addEventListener('resize', handleResize);
|
|
59
|
+
listening = true;
|
|
60
|
+
}
|
|
61
|
+
var _useState = useState(info),
|
|
62
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
63
|
+
state = _useState2[0],
|
|
64
|
+
setState = _useState2[1];
|
|
65
|
+
useEffect(function () {
|
|
66
|
+
if (!isBrowser) return;
|
|
67
|
+
|
|
68
|
+
// In React 18's StrictMode, useEffect perform twice, resize listener is remove, so handleResize is never perform.
|
|
69
|
+
// https://github.com/alibaba/hooks/issues/1910
|
|
70
|
+
if (!listening) {
|
|
71
|
+
window.addEventListener('resize', handleResize);
|
|
72
|
+
}
|
|
73
|
+
var subscriber = function subscriber() {
|
|
74
|
+
setState(info);
|
|
75
|
+
};
|
|
76
|
+
subscribers.add(subscriber);
|
|
77
|
+
return function () {
|
|
78
|
+
subscribers.delete(subscriber);
|
|
79
|
+
if (subscribers.size === 0) {
|
|
80
|
+
window.removeEventListener('resize', handleResize);
|
|
81
|
+
listening = false;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}, []);
|
|
85
|
+
var current = useMemo(function () {
|
|
86
|
+
if (state !== null && state !== void 0 && state.pc) {
|
|
87
|
+
return 'pc';
|
|
88
|
+
}
|
|
89
|
+
if (state !== null && state !== void 0 && state.ipad) {
|
|
90
|
+
return 'ipad';
|
|
91
|
+
}
|
|
92
|
+
return 'phone';
|
|
93
|
+
}, [state]);
|
|
94
|
+
return current;
|
|
95
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -61,3 +61,4 @@ export { default as Select } from './components/select';
|
|
|
61
61
|
export { default as Cascader } from './components/cascader';
|
|
62
62
|
export { default as AutoComplete } from './components/auto-complete';
|
|
63
63
|
export { default as Div } from './components/div';
|
|
64
|
+
export { default as Page } from './components/page';
|
package/es/index.js
CHANGED
|
@@ -85,4 +85,5 @@ export { default as Input } from "./components/input";
|
|
|
85
85
|
export { default as Select } from "./components/select";
|
|
86
86
|
export { default as Cascader } from "./components/cascader";
|
|
87
87
|
export { default as AutoComplete } from "./components/auto-complete";
|
|
88
|
-
export { default as Div } from "./components/div";
|
|
88
|
+
export { default as Div } from "./components/div";
|
|
89
|
+
export { default as Page } from "./components/page";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isBrowser: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var isBrowser = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { ConfigProviderProps as OriginalConfigProviderProps } from "antd/es/config-provider";
|
|
3
|
+
import "dayjs/locale/zh-cn";
|
|
4
|
+
export interface ConfigProviderProps extends OriginalConfigProviderProps {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
declare const ConfigProvider: (props: ConfigProviderProps) => JSX.Element;
|
|
4
8
|
export default ConfigProvider;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/page/index.tsx
|
|
30
|
+
var page_exports = {};
|
|
31
|
+
__export(page_exports, {
|
|
32
|
+
default: () => page_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(page_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_config_provider = __toESM(require("../config-provider"));
|
|
37
|
+
var theme = {
|
|
38
|
+
components: {
|
|
39
|
+
Table: {
|
|
40
|
+
colorFillContent: "rgba(0, 0, 0, 0.06)",
|
|
41
|
+
colorFillSecondary: "rgba(0, 0, 0, 0.06)",
|
|
42
|
+
colorBorderSecondary: "#EAECF0",
|
|
43
|
+
colorFillAlter: "rgba(0, 0, 0, 0.02)"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
token: {
|
|
47
|
+
colorPrimary: "#7F56D9",
|
|
48
|
+
colorPrimaryBg: "#F9F5FF",
|
|
49
|
+
colorPrimaryBgHover: "#F4EBFF",
|
|
50
|
+
colorPrimaryBorder: "#E9D7FE",
|
|
51
|
+
colorPrimaryBorderHover: "#D6BBFB",
|
|
52
|
+
colorPrimaryHover: "#6941C6",
|
|
53
|
+
colorPrimaryActive: "#53389E",
|
|
54
|
+
colorPrimaryTextHover: "#53389E",
|
|
55
|
+
colorPrimaryText: "#6941C6",
|
|
56
|
+
colorPrimaryTextActive: "#42307D",
|
|
57
|
+
colorSuccess: "#079455",
|
|
58
|
+
colorSuccessBg: "#ECFDF3",
|
|
59
|
+
colorSuccessBgHover: "#DCFAE6",
|
|
60
|
+
colorSuccessBorder: "#ABEFC6",
|
|
61
|
+
colorSuccessBorderHover: "#75E0A7",
|
|
62
|
+
colorSuccessHover: "#067647",
|
|
63
|
+
colorSuccessText: "#067647",
|
|
64
|
+
colorSuccessActive: "#085D3A",
|
|
65
|
+
colorSuccessTextHover: "#085D3A",
|
|
66
|
+
colorSuccessTextActive: "#074D31",
|
|
67
|
+
colorWarning: "#dc6803",
|
|
68
|
+
colorWarningBg: "#FFFAEB",
|
|
69
|
+
colorWarningBgHover: "#FEF0C7",
|
|
70
|
+
colorWarningBorder: "#FEDF89",
|
|
71
|
+
colorWarningBorderHover: "#FEC84B",
|
|
72
|
+
colorWarningHover: "#B54708",
|
|
73
|
+
colorWarningText: "#B54708",
|
|
74
|
+
colorWarningActive: "#93370D",
|
|
75
|
+
colorWarningTextHover: "#93370D",
|
|
76
|
+
colorWarningTextActive: "#7A2E0E",
|
|
77
|
+
colorError: "#d92d20",
|
|
78
|
+
colorErrorBg: "#FEF3F2",
|
|
79
|
+
colorErrorBgHover: "#FEE4E2",
|
|
80
|
+
colorErrorBorder: "#FECDCA",
|
|
81
|
+
colorErrorBorderHover: "#FDA29B",
|
|
82
|
+
colorErrorHover: "#B42318",
|
|
83
|
+
colorErrorText: "#B42318",
|
|
84
|
+
colorErrorActive: "#912018",
|
|
85
|
+
colorErrorTextHover: "#912018",
|
|
86
|
+
colorErrorTextActive: "#7A271A",
|
|
87
|
+
colorInfo: "#1570ef",
|
|
88
|
+
colorInfoBg: "#EFF8FF",
|
|
89
|
+
colorInfoBgHover: "#D1E9FF",
|
|
90
|
+
colorInfoBorder: "#B2DDFF",
|
|
91
|
+
colorInfoBorderHover: "#84CAFF",
|
|
92
|
+
colorInfoHover: "#175CD3",
|
|
93
|
+
colorInfoText: "#175CD3",
|
|
94
|
+
colorInfoActive: "#1849A9",
|
|
95
|
+
colorInfoTextHover: "#1849A9",
|
|
96
|
+
colorInfoTextActive: "#194185",
|
|
97
|
+
colorText: "#101828",
|
|
98
|
+
colorTextSecondary: "#475467",
|
|
99
|
+
colorTextTertiary: "#667085",
|
|
100
|
+
colorTextQuaternary: "#D0D5DD",
|
|
101
|
+
colorBorder: "#D0D5DD",
|
|
102
|
+
colorBorderSecondary: "#EAECF0",
|
|
103
|
+
colorFill: "#D0D5DD",
|
|
104
|
+
colorFillSecondary: "#EAECF0",
|
|
105
|
+
colorFillTertiary: "#F2F4F7",
|
|
106
|
+
colorFillQuaternary: "#F9FAFB",
|
|
107
|
+
colorBgLayout: "#F2F4F7",
|
|
108
|
+
colorBgSpotlight: "#101828",
|
|
109
|
+
colorBgMask: "rgba(0, 0, 0, 0.5)"
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var Page = (props) => {
|
|
113
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
114
|
+
import_config_provider.default,
|
|
115
|
+
{
|
|
116
|
+
...props,
|
|
117
|
+
prefixCls: props.prefixCls || "pisell-lowcode",
|
|
118
|
+
theme: props.theme || theme
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
var page_default = Page;
|
|
@@ -5,7 +5,9 @@ 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" | "prev" | "next" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
|
+
responsive: boolean;
|
|
10
|
+
size: string;
|
|
9
11
|
};
|
|
10
12
|
declare const Pagination: (props: PaginationProps) => JSX.Element | null;
|
|
11
13
|
export default Pagination;
|
|
@@ -51,7 +51,9 @@ var paginationConfig = {
|
|
|
51
51
|
className: "materials-grid-paginator",
|
|
52
52
|
defaultCurrent: 1,
|
|
53
53
|
showTotal: (total, range) => `Page ${range[0]} of ${range[1]}`,
|
|
54
|
-
itemRender
|
|
54
|
+
itemRender,
|
|
55
|
+
responsive: true,
|
|
56
|
+
size: "small"
|
|
55
57
|
};
|
|
56
58
|
var Pagination = (props) => {
|
|
57
59
|
console.log(props);
|