@aloudata/aloudata-design 0.1.0-beta.4 → 0.2.0-beta.2
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/es/Empty/index.d.ts +8 -0
- package/es/Empty/index.js +57 -0
- package/es/Empty/style/index.d.ts +1 -0
- package/es/Empty/style/index.js +1 -0
- package/es/Empty/style/index.less +23 -0
- package/es/Icon/iconfont/demo_index.html +3 -3
- package/es/Icon/iconfont/iconfont.css +3 -3
- package/es/Icon/iconfont/iconfont.ttf +0 -0
- package/es/Icon/iconfont/iconfont.woff +0 -0
- package/es/Icon/iconfont/iconfont.woff2 +0 -0
- package/es/Icon/index.less +2 -2
- package/es/Input/components/Group/index.d.ts +0 -1
- package/es/Input/components/Password/index.d.ts +3 -3
- package/es/Input/components/Password/index.js +1 -1
- package/es/Input/demo/basic/index.less +8 -0
- package/es/Menu/Divider.d.ts +0 -1
- package/es/Menu/style/index.less +4 -0
- package/es/Navigator/components/Menu/index.d.ts +19 -0
- package/es/Navigator/components/Menu/index.js +187 -0
- package/es/Navigator/demo/basic/index.d.ts +4 -0
- package/es/Navigator/demo/basic/index.js +45 -0
- package/es/Navigator/demo/basic/index.less +3 -0
- package/es/Navigator/demo/example/index.d.ts +4 -0
- package/es/Navigator/demo/example/index.js +153 -0
- package/es/Navigator/demo/example/index.less +10 -0
- package/es/Navigator/demo/logo.png +0 -0
- package/es/Navigator/demo/menuWithFooter/index.d.ts +4 -0
- package/es/Navigator/demo/menuWithFooter/index.js +73 -0
- package/es/Navigator/demo/menuWithFooter/index.less +3 -0
- package/es/Navigator/demo/subMenu/index.d.ts +4 -0
- package/es/Navigator/demo/subMenu/index.js +71 -0
- package/es/Navigator/demo/subMenu/index.less +3 -0
- package/es/Navigator/index.d.ts +41 -0
- package/es/Navigator/index.js +45 -0
- package/es/Navigator/style/index.d.ts +2 -0
- package/es/Navigator/style/index.js +2 -0
- package/es/Navigator/style/index.less +224 -0
- package/es/Table/demo/basic/createData.d.ts +9 -0
- package/es/Table/demo/basic/createData.js +18 -0
- package/es/Table/demo/basic/index.d.ts +2 -0
- package/es/Table/demo/basic/index.js +64 -0
- package/es/Table/demo/editCell/index.d.ts +2 -0
- package/es/Table/demo/editCell/index.js +39 -0
- package/es/Table/demo/renderHeaderRight/index.d.ts +2 -0
- package/es/Table/demo/renderHeaderRight/index.js +37 -0
- package/es/Table/demo/rowSelect/index.d.ts +2 -0
- package/es/Table/demo/rowSelect/index.js +40 -0
- package/es/Table/demo/sort/index.d.ts +2 -0
- package/es/Table/demo/sort/index.js +32 -0
- package/es/Table/demo/virtualList/index.d.ts +2 -0
- package/es/Table/demo/virtualList/index.js +88 -0
- package/es/Table/index.d.ts +5 -0
- package/es/Table/index.js +201 -0
- package/es/Table/interface.d.ts +14 -0
- package/es/Table/interface.js +1 -0
- package/es/Table/style/index.d.ts +2 -0
- package/es/Table/style/index.js +2 -0
- package/es/Table/style/index.less +111 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/Empty/index.d.ts +8 -0
- package/lib/Empty/index.js +71 -0
- package/lib/Empty/style/index.d.ts +1 -0
- package/lib/Empty/style/index.js +3 -0
- package/lib/Empty/style/index.less +23 -0
- package/lib/Icon/iconfont/demo_index.html +3 -3
- package/lib/Icon/iconfont/iconfont.css +3 -3
- package/lib/Icon/iconfont/iconfont.ttf +0 -0
- package/lib/Icon/iconfont/iconfont.woff +0 -0
- package/lib/Icon/iconfont/iconfont.woff2 +0 -0
- package/lib/Icon/index.less +2 -2
- package/lib/Input/components/Group/index.d.ts +0 -1
- package/lib/Input/components/Password/index.d.ts +3 -3
- package/lib/Input/components/Password/index.js +2 -2
- package/lib/Input/demo/basic/index.less +8 -0
- package/lib/Menu/Divider.d.ts +0 -1
- package/lib/Menu/style/index.less +4 -0
- package/lib/Navigator/components/Menu/index.d.ts +19 -0
- package/lib/Navigator/components/Menu/index.js +205 -0
- package/lib/Navigator/demo/basic/index.d.ts +4 -0
- package/lib/Navigator/demo/basic/index.js +62 -0
- package/lib/Navigator/demo/basic/index.less +3 -0
- package/lib/Navigator/demo/example/index.d.ts +4 -0
- package/lib/Navigator/demo/example/index.js +179 -0
- package/lib/Navigator/demo/example/index.less +10 -0
- package/lib/Navigator/demo/logo.png +0 -0
- package/lib/Navigator/demo/menuWithFooter/index.d.ts +4 -0
- package/lib/Navigator/demo/menuWithFooter/index.js +92 -0
- package/lib/Navigator/demo/menuWithFooter/index.less +3 -0
- package/lib/Navigator/demo/subMenu/index.d.ts +4 -0
- package/lib/Navigator/demo/subMenu/index.js +88 -0
- package/lib/Navigator/demo/subMenu/index.less +3 -0
- package/lib/Navigator/index.d.ts +41 -0
- package/lib/Navigator/index.js +64 -0
- package/lib/Navigator/style/index.d.ts +2 -0
- package/lib/Navigator/style/index.js +5 -0
- package/lib/Navigator/style/index.less +224 -0
- package/lib/Table/demo/basic/createData.d.ts +9 -0
- package/lib/Table/demo/basic/createData.js +23 -0
- package/lib/Table/demo/basic/index.d.ts +2 -0
- package/lib/Table/demo/basic/index.js +80 -0
- package/lib/Table/demo/editCell/index.d.ts +2 -0
- package/lib/Table/demo/editCell/index.js +54 -0
- package/lib/Table/demo/renderHeaderRight/index.d.ts +2 -0
- package/lib/Table/demo/renderHeaderRight/index.js +52 -0
- package/lib/Table/demo/rowSelect/index.d.ts +2 -0
- package/lib/Table/demo/rowSelect/index.js +55 -0
- package/lib/Table/demo/sort/index.d.ts +2 -0
- package/lib/Table/demo/sort/index.js +47 -0
- package/lib/Table/demo/virtualList/index.d.ts +2 -0
- package/lib/Table/demo/virtualList/index.js +103 -0
- package/lib/Table/index.d.ts +5 -0
- package/lib/Table/index.js +225 -0
- package/lib/Table/interface.d.ts +14 -0
- package/lib/Table/interface.js +5 -0
- package/lib/Table/style/index.d.ts +2 -0
- package/lib/Table/style/index.js +5 -0
- package/lib/Table/style/index.less +111 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +16 -0
- package/package.json +10 -4
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
@import '../../style/index.less';
|
|
2
|
+
@import '../../Icon/index.less';
|
|
3
|
+
|
|
4
|
+
/* stylelint-disable */
|
|
5
|
+
|
|
6
|
+
@ald-prefix:ant;
|
|
7
|
+
|
|
8
|
+
.supTitle() {
|
|
9
|
+
font-family: 'PingFang SC';
|
|
10
|
+
font-style: normal;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
line-height: 20px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.subTitle() {
|
|
17
|
+
font-family: 'PingFang SC';
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
line-height: 16px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ald-nav {
|
|
25
|
+
width: 216px;
|
|
26
|
+
background-color: @BBG15;
|
|
27
|
+
height: 100%;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
user-select: none;
|
|
32
|
+
|
|
33
|
+
&-logo {
|
|
34
|
+
height: 72px;
|
|
35
|
+
padding: 24px;
|
|
36
|
+
width: 100%;
|
|
37
|
+
|
|
38
|
+
&-able-click {
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&-menu-icon-right.anticon {
|
|
44
|
+
color: @ND60;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&-menu {
|
|
48
|
+
flex: 1;
|
|
49
|
+
overflow-y: auto;
|
|
50
|
+
overflow-x: hidden;
|
|
51
|
+
|
|
52
|
+
.ant-menu-sub.ant-menu-inline {
|
|
53
|
+
background-color: unset;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.anticon.ant-menu-item-icon {
|
|
57
|
+
font-size: 20px !important;
|
|
58
|
+
width: 20px !important;
|
|
59
|
+
height: 20px !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&::-webkit-scrollbar-thumb {
|
|
63
|
+
border-radius: 6px;
|
|
64
|
+
background: @ND90;
|
|
65
|
+
border: 3px solid transparent;
|
|
66
|
+
background-clip: padding-box;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&::-webkit-scrollbar {
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
width: 12px;
|
|
72
|
+
height: 12px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ant-menu-inline,
|
|
76
|
+
.ant-menu-vertical,
|
|
77
|
+
.ant-menu-vertical-left {
|
|
78
|
+
border-right: unset;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ant-menu {
|
|
82
|
+
background: @BBG15;
|
|
83
|
+
color: @ND0;
|
|
84
|
+
|
|
85
|
+
&.ant-menu-root {
|
|
86
|
+
|
|
87
|
+
.ant-menu-item {
|
|
88
|
+
margin-bottom: 16px;
|
|
89
|
+
padding: 0 12px !important;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
li:nth-last-child(1) {
|
|
93
|
+
margin-bottom: 0;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.ant-menu-sub {
|
|
98
|
+
.ant-menu-item {
|
|
99
|
+
margin-top: 4px;
|
|
100
|
+
margin-bottom: 0;
|
|
101
|
+
padding: 0 12px 0 44px!important;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 只有子级菜单相关颜色操作
|
|
106
|
+
.ant-menu-item-only-child {
|
|
107
|
+
color: @ND30;
|
|
108
|
+
height: 32px !important;
|
|
109
|
+
line-height: 32px !important;
|
|
110
|
+
font-size: 12px !important;
|
|
111
|
+
.subTitle();
|
|
112
|
+
|
|
113
|
+
&:hover {
|
|
114
|
+
color: @ND30 !important;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.ant-menu-item-selected {
|
|
118
|
+
font-weight: 500;
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
color: @ND0 !important;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ant-menu-item {
|
|
127
|
+
height: 40px;
|
|
128
|
+
width: 100%;
|
|
129
|
+
border-radius: 8px;
|
|
130
|
+
.supTitle();
|
|
131
|
+
|
|
132
|
+
&-selected {
|
|
133
|
+
background-color: @BBG20 !important;
|
|
134
|
+
color: @ND0;
|
|
135
|
+
position: relative;
|
|
136
|
+
overflow: unset;
|
|
137
|
+
|
|
138
|
+
::before {
|
|
139
|
+
width: 4px;
|
|
140
|
+
content: '';
|
|
141
|
+
background: @B40;
|
|
142
|
+
height: 100%;
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 0;
|
|
145
|
+
left: -12px;
|
|
146
|
+
border-radius: 1px;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&::after {
|
|
151
|
+
display: none !important;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ant-menu-submenu {
|
|
156
|
+
margin-bottom: 16px;
|
|
157
|
+
|
|
158
|
+
.ant-menu-submenu-title {
|
|
159
|
+
padding: 0 12px !important;
|
|
160
|
+
height: 40px;
|
|
161
|
+
line-height: 40px;
|
|
162
|
+
.supTitle();
|
|
163
|
+
|
|
164
|
+
&:hover {
|
|
165
|
+
color: @ND0;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&-selected {
|
|
170
|
+
color: @ND0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&-active {
|
|
174
|
+
color: @ND0;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// 修改icon和文字的margin
|
|
179
|
+
.ant-menu-item .ant-menu-item-icon + span,
|
|
180
|
+
.ant-menu-submenu-title .ant-menu-item-icon + span,
|
|
181
|
+
.ant-menu-item .anticon + span,
|
|
182
|
+
.ant-menu-submenu-title .anticon + span {
|
|
183
|
+
margin-left: 12px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// 取消item点击时的高亮背景色
|
|
187
|
+
.ant-menu-item:active,
|
|
188
|
+
.ant-menu-submenu-title:active {
|
|
189
|
+
background: unset;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.ant-menu-inline .ant-menu-item,
|
|
193
|
+
.ant-menu-inline .ant-menu-submenu-title {
|
|
194
|
+
width: 100% !important;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// 删除右侧的高亮
|
|
198
|
+
.ant-menu-vertical .ant-menu-item::after,
|
|
199
|
+
.ant-menu-vertical-left .ant-menu-item::after,
|
|
200
|
+
.ant-menu-vertical-right .ant-menu-item::after,
|
|
201
|
+
.ant-menu-inline .ant-menu-item::after {
|
|
202
|
+
display: none;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.ant-menu-light .ant-menu-item:hover,
|
|
207
|
+
.ant-menu-light .ant-menu-item-active,
|
|
208
|
+
.ant-menu-light .ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open,
|
|
209
|
+
.ant-menu-light .ant-menu-submenu-active,
|
|
210
|
+
.ant-menu-light .ant-menu-submenu-title:hover {
|
|
211
|
+
color: unset;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&-footer {
|
|
216
|
+
height: 56px;
|
|
217
|
+
|
|
218
|
+
&-wrap {
|
|
219
|
+
border: 1px solid @ND0;
|
|
220
|
+
color: @ND0;
|
|
221
|
+
height: 100%;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.makeData = makeData;
|
|
7
|
+
|
|
8
|
+
function makeData(length) {
|
|
9
|
+
var data = [];
|
|
10
|
+
|
|
11
|
+
for (var i = 0; i < length; i++) {
|
|
12
|
+
data.push({
|
|
13
|
+
firstName: 'supermarket',
|
|
14
|
+
lastName: 'charity',
|
|
15
|
+
age: i + 1,
|
|
16
|
+
visits: 47,
|
|
17
|
+
progress: 41,
|
|
18
|
+
status: 'relationship'
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
require("antd/es/radio/style");
|
|
9
|
+
|
|
10
|
+
var _radio = _interopRequireDefault(require("antd/es/radio"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _aloudataDesign = require("@aloudata/aloudata-design");
|
|
15
|
+
|
|
16
|
+
var _createData = require("./createData");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
+
|
|
22
|
+
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."); }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
29
|
+
|
|
30
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
+
|
|
32
|
+
// import Table from '../../Example'
|
|
33
|
+
var columns = [{
|
|
34
|
+
Header: 'First Name',
|
|
35
|
+
accessor: 'firstName',
|
|
36
|
+
width: 150
|
|
37
|
+
}, {
|
|
38
|
+
Header: 'Last Name',
|
|
39
|
+
accessor: 'lastName'
|
|
40
|
+
}, {
|
|
41
|
+
Header: 'Age',
|
|
42
|
+
accessor: 'age'
|
|
43
|
+
}, {
|
|
44
|
+
Header: 'Visits',
|
|
45
|
+
accessor: 'visits'
|
|
46
|
+
}, {
|
|
47
|
+
Header: 'Status',
|
|
48
|
+
accessor: 'status'
|
|
49
|
+
}, {
|
|
50
|
+
Header: 'Profile Progress',
|
|
51
|
+
accessor: 'progress'
|
|
52
|
+
}];
|
|
53
|
+
|
|
54
|
+
var _default = function _default() {
|
|
55
|
+
var _React$useState = _react.default.useState(0),
|
|
56
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
57
|
+
scrollY = _React$useState2[0],
|
|
58
|
+
setScrollY = _React$useState2[1];
|
|
59
|
+
|
|
60
|
+
var handleChange = function handleChange(e) {
|
|
61
|
+
setScrollY(e.target.value);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
+
className: "ald-table-demo"
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(_radio.default.Group, {
|
|
67
|
+
value: scrollY,
|
|
68
|
+
onChange: handleChange
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_radio.default.Button, {
|
|
70
|
+
value: 0
|
|
71
|
+
}, "\u65E0\u6EDA\u52A8"), /*#__PURE__*/_react.default.createElement(_radio.default.Button, {
|
|
72
|
+
value: 200
|
|
73
|
+
}, "\u5185\u90E8\u6EDA\u52A8")), /*#__PURE__*/_react.default.createElement(_aloudataDesign.Table, {
|
|
74
|
+
columns: columns,
|
|
75
|
+
scrollY: scrollY,
|
|
76
|
+
data: (0, _createData.makeData)(10)
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.default = _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _aloudataDesign = require("@aloudata/aloudata-design");
|
|
11
|
+
|
|
12
|
+
var _createData = require("../basic/createData");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
// import Table from '../../Example'
|
|
17
|
+
var columns = [{
|
|
18
|
+
Header: 'First Name',
|
|
19
|
+
accessor: 'firstName',
|
|
20
|
+
width: 150
|
|
21
|
+
}, {
|
|
22
|
+
Header: 'Last Name',
|
|
23
|
+
accessor: 'lastName'
|
|
24
|
+
}, {
|
|
25
|
+
Header: 'Age',
|
|
26
|
+
accessor: 'age'
|
|
27
|
+
}, {
|
|
28
|
+
Header: 'Visits',
|
|
29
|
+
accessor: 'visits'
|
|
30
|
+
}, {
|
|
31
|
+
Header: 'Status',
|
|
32
|
+
accessor: 'status'
|
|
33
|
+
}, {
|
|
34
|
+
Header: 'Profile Progress',
|
|
35
|
+
accessor: 'progress',
|
|
36
|
+
Cell: function Cell(row) {
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
+
style: {
|
|
39
|
+
color: 'red'
|
|
40
|
+
}
|
|
41
|
+
}, "\u8FDB\u5EA6\uFF1A", row.progress);
|
|
42
|
+
}
|
|
43
|
+
}];
|
|
44
|
+
|
|
45
|
+
var _default = function _default() {
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
className: "ald-table-demo"
|
|
48
|
+
}, /*#__PURE__*/_react.default.createElement(_aloudataDesign.Table, {
|
|
49
|
+
columns: columns,
|
|
50
|
+
data: (0, _createData.makeData)(10)
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.default = _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _aloudataDesign = require("@aloudata/aloudata-design");
|
|
11
|
+
|
|
12
|
+
var _createData = require("../basic/createData");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
// import Table from '../../Example'
|
|
17
|
+
var columns = [{
|
|
18
|
+
Header: 'First Name',
|
|
19
|
+
accessor: 'firstName',
|
|
20
|
+
width: 150
|
|
21
|
+
}, {
|
|
22
|
+
Header: 'Last Name',
|
|
23
|
+
accessor: 'lastName'
|
|
24
|
+
}, {
|
|
25
|
+
Header: 'Age',
|
|
26
|
+
accessor: 'age'
|
|
27
|
+
}, {
|
|
28
|
+
Header: 'Visits',
|
|
29
|
+
accessor: 'visits'
|
|
30
|
+
}, {
|
|
31
|
+
Header: 'Status',
|
|
32
|
+
accessor: 'status'
|
|
33
|
+
}, {
|
|
34
|
+
Header: 'Profile Progress',
|
|
35
|
+
accessor: 'progress'
|
|
36
|
+
}];
|
|
37
|
+
|
|
38
|
+
var _default = function _default() {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
className: "ald-table-demo"
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_aloudataDesign.Table, {
|
|
42
|
+
columns: columns,
|
|
43
|
+
data: (0, _createData.makeData)(10),
|
|
44
|
+
renderHeaderRight: function renderHeaderRight() {
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement(_aloudataDesign.Input, {
|
|
46
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports.default = _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _aloudataDesign = require("@aloudata/aloudata-design");
|
|
11
|
+
|
|
12
|
+
var _createData = require("../basic/createData");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
// import Table from '../../Example'
|
|
17
|
+
var columns = [{
|
|
18
|
+
Header: 'First Name',
|
|
19
|
+
accessor: 'firstName',
|
|
20
|
+
width: 150
|
|
21
|
+
}, {
|
|
22
|
+
Header: 'Last Name',
|
|
23
|
+
accessor: 'lastName'
|
|
24
|
+
}, {
|
|
25
|
+
Header: 'Age',
|
|
26
|
+
accessor: 'age'
|
|
27
|
+
}, {
|
|
28
|
+
Header: 'Visits',
|
|
29
|
+
accessor: 'visits'
|
|
30
|
+
}, {
|
|
31
|
+
Header: 'Status',
|
|
32
|
+
accessor: 'status'
|
|
33
|
+
}, {
|
|
34
|
+
Header: 'Profile Progress',
|
|
35
|
+
accessor: 'progress'
|
|
36
|
+
}];
|
|
37
|
+
|
|
38
|
+
var _default = function _default() {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
className: "ald-table-demo"
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_aloudataDesign.Table, {
|
|
42
|
+
columns: columns,
|
|
43
|
+
onRowSelected: function onRowSelected(record) {
|
|
44
|
+
console.log(record);
|
|
45
|
+
},
|
|
46
|
+
data: (0, _createData.makeData)(10),
|
|
47
|
+
renderHeaderRight: function renderHeaderRight() {
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_aloudataDesign.Input, {
|
|
49
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.default = _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _aloudataDesign = require("@aloudata/aloudata-design");
|
|
11
|
+
|
|
12
|
+
var _createData = require("../basic/createData");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
// import Table from '../../Example'
|
|
17
|
+
var columns = [{
|
|
18
|
+
Header: 'First Name',
|
|
19
|
+
accessor: 'firstName',
|
|
20
|
+
width: 150
|
|
21
|
+
}, {
|
|
22
|
+
Header: 'Last Name',
|
|
23
|
+
accessor: 'lastName'
|
|
24
|
+
}, {
|
|
25
|
+
Header: 'Age',
|
|
26
|
+
accessor: 'age'
|
|
27
|
+
}, {
|
|
28
|
+
Header: 'Visits',
|
|
29
|
+
accessor: 'visits'
|
|
30
|
+
}, {
|
|
31
|
+
Header: 'Status',
|
|
32
|
+
accessor: 'status'
|
|
33
|
+
}, {
|
|
34
|
+
Header: 'Profile Progress',
|
|
35
|
+
accessor: 'progress'
|
|
36
|
+
}];
|
|
37
|
+
|
|
38
|
+
var _default = function _default() {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
className: "ald-table-demo"
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_aloudataDesign.Table, {
|
|
42
|
+
columns: columns,
|
|
43
|
+
data: (0, _createData.makeData)(10)
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.default = _default;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _aloudataDesign = require("@aloudata/aloudata-design");
|
|
11
|
+
|
|
12
|
+
var _createData = require("../basic/createData");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
+
|
|
18
|
+
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."); }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
25
|
+
|
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
|
|
28
|
+
var columns = [{
|
|
29
|
+
Header: 'First Name',
|
|
30
|
+
accessor: 'firstName',
|
|
31
|
+
width: 150
|
|
32
|
+
}, {
|
|
33
|
+
Header: 'Last Name',
|
|
34
|
+
accessor: 'lastName'
|
|
35
|
+
}, {
|
|
36
|
+
Header: 'Age',
|
|
37
|
+
accessor: 'age'
|
|
38
|
+
}, {
|
|
39
|
+
Header: 'Visits',
|
|
40
|
+
accessor: 'visits'
|
|
41
|
+
}, {
|
|
42
|
+
Header: 'Status',
|
|
43
|
+
accessor: 'status'
|
|
44
|
+
}, {
|
|
45
|
+
Header: 'Profile Progress',
|
|
46
|
+
accessor: 'progress'
|
|
47
|
+
}];
|
|
48
|
+
|
|
49
|
+
var _default = function _default() {
|
|
50
|
+
var _React$useState = _react.default.useState([]),
|
|
51
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
52
|
+
data = _React$useState2[0],
|
|
53
|
+
setData = _React$useState2[1];
|
|
54
|
+
|
|
55
|
+
var _React$useState3 = _react.default.useState(false),
|
|
56
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
57
|
+
loading = _React$useState4[0],
|
|
58
|
+
setLoading = _React$useState4[1];
|
|
59
|
+
|
|
60
|
+
var _React$useState5 = _react.default.useState(true),
|
|
61
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
62
|
+
hasNextPage = _React$useState6[0],
|
|
63
|
+
setHasNextPage = _React$useState6[1];
|
|
64
|
+
|
|
65
|
+
var _React$useState7 = _react.default.useState(1),
|
|
66
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
67
|
+
currentPage = _React$useState8[0],
|
|
68
|
+
setCurrentPage = _React$useState8[1];
|
|
69
|
+
|
|
70
|
+
var pageSize = 10;
|
|
71
|
+
|
|
72
|
+
var loadMoreItems = function loadMoreItems() {
|
|
73
|
+
return new Promise(function (resolve) {
|
|
74
|
+
setLoading(true);
|
|
75
|
+
setTimeout(function () {
|
|
76
|
+
var newData = (0, _createData.makeData)(pageSize * currentPage);
|
|
77
|
+
setCurrentPage(currentPage + 1);
|
|
78
|
+
setLoading(false);
|
|
79
|
+
|
|
80
|
+
if (newData.length > 100) {
|
|
81
|
+
setHasNextPage(false);
|
|
82
|
+
} else {
|
|
83
|
+
setData(newData);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
resolve();
|
|
87
|
+
}, 1000);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
className: "ald-input-demo"
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_aloudataDesign.Table, {
|
|
94
|
+
columns: columns,
|
|
95
|
+
scrollY: 450,
|
|
96
|
+
loading: loading,
|
|
97
|
+
data: data,
|
|
98
|
+
loadMore: loadMoreItems,
|
|
99
|
+
hasNextPage: hasNextPage
|
|
100
|
+
}));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
exports.default = _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
import { ITableProps } from './interface';
|
|
4
|
+
declare function Table<T extends Record<string, unknown>>({ columns, data, total, renderHeaderLeft, renderHeaderRight, scrollY, onRowSelected, loadMore, hasNextPage, loading, }: ITableProps<T>): ReactElement;
|
|
5
|
+
export default Table;
|