@pisell/materials 1.0.27 → 1.0.28
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 +1 -1
- 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.js +1 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/date-picker/index.d.ts.map +1 -1
- package/es/components/date-picker/index.js +1 -0
- package/es/components/page/index.d.ts.map +1 -1
- package/es/components/page/index.js +156 -72
- package/es/components/table/Actions/Sort/index.d.ts +3 -3
- package/es/components/table/Actions/Sort/index.d.ts.map +1 -1
- package/es/components/table/Actions/Sort/index.js +53 -17
- package/es/components/table/Actions/index.d.ts.map +1 -1
- package/es/components/table/Actions/index.js +7 -1
- package/es/components/table/BasicTable/index.d.ts.map +1 -1
- package/es/components/table/BasicTable/index.js +1 -2
- package/es/components/table/Table/index.d.ts.map +1 -1
- package/es/components/table/Table/index.js +0 -1
- package/es/components/table/Table/index.less +2 -0
- package/es/components/table/index.js +2 -2
- package/lib/components/date-picker/index.d.ts.map +1 -1
- package/lib/components/page/index.d.ts.map +1 -1
- package/lib/components/page/index.js +147 -72
- package/lib/components/table/Actions/Sort/index.d.ts +3 -3
- package/lib/components/table/Actions/Sort/index.d.ts.map +1 -1
- package/lib/components/table/Actions/Sort/index.js +47 -2
- package/lib/components/table/Actions/index.d.ts.map +1 -1
- package/lib/components/table/Actions/index.js +3 -1
- package/lib/components/table/BasicTable/index.d.ts.map +1 -1
- package/lib/components/table/BasicTable/index.js +1 -2
- package/lib/components/table/Table/index.d.ts.map +1 -1
- package/lib/components/table/Table/index.js +0 -1
- package/lib/components/table/Table/index.less +2 -0
- package/lib/components/table/index.js +2 -2
- package/lowcode/table/meta.ts +63 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
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>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAYA,QAAA,MAAM,UAAU,6BAKd,CAAC;AAWH,eAAe,UAAU,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
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);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AACA,OAAuB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AACA,OAAuB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAKzE,UAAU,SAAU,SAAQ,mBAAmB;CAAG;AAqJlD,QAAA,MAAM,IAAI,UAAW,SAAS,gBAgB7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -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;
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,oBAAY,aAAa,GAAG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,aAAK,aAAa,GAAG;IACnB,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAmCF,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoBjC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAKA,OAAO,cAAc,CAAC;AAEtB,QAAA,MAAM,OAAO,qBAAsB,GAAG,uBAmBrC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
|
+
import { Form } from "antd";
|
|
2
3
|
import QuickFilter from "./Filter/QuickFilter";
|
|
4
|
+
import Sort from "./Sort";
|
|
3
5
|
import "./index.less";
|
|
4
6
|
var Actions = function Actions(_ref) {
|
|
5
7
|
var filter = _ref.filter,
|
|
@@ -13,6 +15,10 @@ var Actions = function Actions(_ref) {
|
|
|
13
15
|
className: "left-wrap"
|
|
14
16
|
}, /*#__PURE__*/React.createElement(QuickFilter, null)), /*#__PURE__*/React.createElement("div", {
|
|
15
17
|
className: "right-wrap"
|
|
16
|
-
}
|
|
18
|
+
}, sort !== null && sort !== void 0 && sort.show ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
19
|
+
name: "order_by"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Sort, {
|
|
21
|
+
list: (sort === null || sort === void 0 ? void 0 : sort.list) || []
|
|
22
|
+
})) : null)) : null;
|
|
17
23
|
};
|
|
18
24
|
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,gBAyEzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -32,7 +32,7 @@ var BasicTable = function BasicTable(props) {
|
|
|
32
32
|
setCurrentPage(1);
|
|
33
33
|
}, [dataSource]);
|
|
34
34
|
useEffect(function () {
|
|
35
|
-
setPageSize(pagination === null || pagination === void 0 ? void 0 : pagination.pageSize);
|
|
35
|
+
(pagination === null || pagination === void 0 ? void 0 : pagination.pageSize) && setPageSize(pagination === null || pagination === void 0 ? void 0 : pagination.pageSize);
|
|
36
36
|
}, [pagination.pageSize]);
|
|
37
37
|
|
|
38
38
|
// 分割数据源
|
|
@@ -68,7 +68,6 @@ var BasicTable = function BasicTable(props) {
|
|
|
68
68
|
setCurrentPage(page);
|
|
69
69
|
setPageSize(pageSize);
|
|
70
70
|
};
|
|
71
|
-
console.log(pagination, 'pagination');
|
|
72
71
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, _extends({}, other, {
|
|
73
72
|
pagination: false,
|
|
74
73
|
dataSource: _dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.list
|
|
@@ -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,CAuHhC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -88,7 +88,6 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
88
88
|
});
|
|
89
89
|
}, [defaultColumns]);
|
|
90
90
|
var showTotal = useCallback(function (total, range, pageSize) {
|
|
91
|
-
console.log(range, 'range');
|
|
92
91
|
var start = range[0] - 1;
|
|
93
92
|
var _current = start / pageSize + 1;
|
|
94
93
|
return "Page ".concat(_current, " of ").concat(Math.ceil(total / pageSize));
|
|
@@ -62,11 +62,11 @@ var GridView = Provider(function (props) {
|
|
|
62
62
|
});
|
|
63
63
|
}, [filter]);
|
|
64
64
|
var initialValues = useMemo(function () {
|
|
65
|
-
return (filter.list || []).reduce(function (p, c) {
|
|
65
|
+
return ((filter === null || filter === void 0 ? void 0 : filter.list) || []).reduce(function (p, c) {
|
|
66
66
|
var _c$other;
|
|
67
67
|
return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.name, c === null || c === void 0 ? void 0 : (_c$other = c.other) === null || _c$other === void 0 ? void 0 : _c$other.defaultValue));
|
|
68
68
|
}, {});
|
|
69
|
-
}, [filter.list]);
|
|
69
|
+
}, [filter === null || filter === void 0 ? void 0 : filter.list]);
|
|
70
70
|
return /*#__PURE__*/React.createElement(Form, {
|
|
71
71
|
form: form,
|
|
72
72
|
layout: "vertical",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AAYA,QAAA,MAAM,UAAU,6BAKd,CAAC;AAWH,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AACA,OAAuB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";AACA,OAAuB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAKzE,UAAU,SAAU,SAAQ,mBAAmB;CAAG;AAqJlD,QAAA,MAAM,IAAI,UAAW,SAAS,gBAgB7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|