@lemon-fe/kits 1.0.0-3 → 1.0.0-5
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/components/DataGrid/index.d.ts +1 -0
- package/es/components/DataGrid/index.js +19 -7
- package/es/components/DataGrid/index.less +20 -8
- package/es/components/DataGrid/typings.d.ts +1 -0
- package/es/components/Layout/index.d.ts +1 -0
- package/es/components/Layout/index.js +2 -1
- package/es/components/Section/index.d.ts +1 -0
- package/es/components/Section/index.js +4 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +1 -4
|
@@ -195,7 +195,8 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
195
195
|
});
|
|
196
196
|
|
|
197
197
|
_this.state = _objectSpread({
|
|
198
|
-
colDefs: _this.getColumDefs()
|
|
198
|
+
colDefs: _this.getColumDefs(),
|
|
199
|
+
loading: false
|
|
199
200
|
}, _this.getPagination());
|
|
200
201
|
_this.store = new Store({
|
|
201
202
|
errors: new Map(),
|
|
@@ -665,7 +666,9 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
665
666
|
pageSize = _this$state.pageSize;
|
|
666
667
|
var columnState = this.columnApi.getColumnState();
|
|
667
668
|
var id = this.requestId;
|
|
668
|
-
this.
|
|
669
|
+
this.setState({
|
|
670
|
+
loading: true
|
|
671
|
+
});
|
|
669
672
|
fetch({
|
|
670
673
|
current: page,
|
|
671
674
|
pageSize: pageSize,
|
|
@@ -678,7 +681,9 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
678
681
|
};
|
|
679
682
|
})
|
|
680
683
|
}).then(function (res) {
|
|
681
|
-
_this6.
|
|
684
|
+
_this6.setState({
|
|
685
|
+
loading: false
|
|
686
|
+
});
|
|
682
687
|
|
|
683
688
|
if (id !== _this6.requestId) {
|
|
684
689
|
return;
|
|
@@ -710,7 +715,9 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
710
715
|
} // 重置滚动条
|
|
711
716
|
|
|
712
717
|
|
|
713
|
-
_this6.api.
|
|
718
|
+
var bean = _this6.api.__getContext().getBean('ctrlsService');
|
|
719
|
+
|
|
720
|
+
bean.getGridBodyCtrl().getScrollFeature().scrollToTop();
|
|
714
721
|
|
|
715
722
|
_this6.api.setPinnedBottomRowData(pinned);
|
|
716
723
|
|
|
@@ -720,7 +727,9 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
720
727
|
onLoad(res.extra);
|
|
721
728
|
}
|
|
722
729
|
}).catch(function () {
|
|
723
|
-
_this6.
|
|
730
|
+
_this6.setState({
|
|
731
|
+
loading: false
|
|
732
|
+
});
|
|
724
733
|
});
|
|
725
734
|
}
|
|
726
735
|
}
|
|
@@ -944,7 +953,8 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
944
953
|
enablePagination = _this$state2.pagination,
|
|
945
954
|
page = _this$state2.page,
|
|
946
955
|
pageSize = _this$state2.pageSize,
|
|
947
|
-
total = _this$state2.total
|
|
956
|
+
total = _this$state2.total,
|
|
957
|
+
loading = _this$state2.loading;
|
|
948
958
|
var mPage = _typeof(pagination) === 'object' ? pagination : {};
|
|
949
959
|
return /*#__PURE__*/React.createElement(GridContext.Provider, {
|
|
950
960
|
value: this.store
|
|
@@ -999,7 +1009,9 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
999
1009
|
mPage.onChange(page, pageSize);
|
|
1000
1010
|
}
|
|
1001
1011
|
}
|
|
1002
|
-
})))
|
|
1012
|
+
}))), loading && /*#__PURE__*/React.createElement(Spin, {
|
|
1013
|
+
className: prefix('spin')
|
|
1014
|
+
})));
|
|
1003
1015
|
}
|
|
1004
1016
|
}]);
|
|
1005
1017
|
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
|
|
152
152
|
.ag-cell-inline-editing & {
|
|
153
153
|
padding: 0;
|
|
154
|
-
box-shadow: 0 0 0 2px var(
|
|
154
|
+
box-shadow: 0 0 0 2px ~'var(--@{ant-prefix}-primary-5)' inset;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
&-text {
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
left: -6px;
|
|
182
182
|
z-index: 10;
|
|
183
183
|
border: 6px solid transparent;
|
|
184
|
-
border-top-color: var(
|
|
184
|
+
border-top-color: ~'var(--@{ant-prefix}-error-color-active)';
|
|
185
185
|
transform: rotate(135deg);
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -196,6 +196,18 @@
|
|
|
196
196
|
vertical-align: top;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
+
|
|
200
|
+
&-spin {
|
|
201
|
+
position: absolute;
|
|
202
|
+
top: 0;
|
|
203
|
+
right: 0;
|
|
204
|
+
bottom: 0;
|
|
205
|
+
left: 0;
|
|
206
|
+
display: flex;
|
|
207
|
+
justify-content: center;
|
|
208
|
+
align-items: center;
|
|
209
|
+
background-color: rgba(255, 255, 255, 0.6);
|
|
210
|
+
}
|
|
199
211
|
}
|
|
200
212
|
|
|
201
213
|
.ag-theme-@{prefixCls} {
|
|
@@ -217,13 +229,13 @@
|
|
|
217
229
|
--ag-header-column-resize-handle-color: #bbb;
|
|
218
230
|
--ag-cell-horizontal-padding: 8px;
|
|
219
231
|
--ag-icon-font-family: agGridAlpine;
|
|
220
|
-
--ag-selected-row-background-color: var(
|
|
232
|
+
--ag-selected-row-background-color: ~'var(--@{ant-prefix}-primary-1)';
|
|
221
233
|
--ag-selected-tab-underline-width: 2px;
|
|
222
|
-
--ag-range-selection-border-color: var(
|
|
223
|
-
--ag-range-selection-highlight-color: var(
|
|
234
|
+
--ag-range-selection-border-color: ~'var(--@{ant-prefix}-primary-5)';
|
|
235
|
+
--ag-range-selection-highlight-color: ~'var(--@{ant-prefix}-primary-1)';
|
|
224
236
|
--ag-checkbox-unchecked-color: #ccc;
|
|
225
237
|
--ag-checkbox-background-color: var(--ag-background-color);
|
|
226
|
-
--ag-checkbox-checked-color: var(
|
|
238
|
+
--ag-checkbox-checked-color: 'var(--@{ant-prefix}-primary-color)';
|
|
227
239
|
--ag-input-border-color: transparent;
|
|
228
240
|
--ag-input-focus-border-color: transparent;
|
|
229
241
|
|
|
@@ -263,7 +275,7 @@
|
|
|
263
275
|
bottom: 0;
|
|
264
276
|
left: 0;
|
|
265
277
|
display: block;
|
|
266
|
-
border: 2px solid var(
|
|
278
|
+
border: 2px solid ~'var(--@{ant-prefix}-primary-5)';
|
|
267
279
|
border-radius: 4px;
|
|
268
280
|
content: '';
|
|
269
281
|
pointer-events: none;
|
|
@@ -291,7 +303,7 @@
|
|
|
291
303
|
}
|
|
292
304
|
|
|
293
305
|
.ag-tab-selected {
|
|
294
|
-
color: var(
|
|
306
|
+
color: ~'var(--@{ant-prefix}-primary-color)';
|
|
295
307
|
}
|
|
296
308
|
|
|
297
309
|
.ag-tabs-header {
|
|
@@ -2,6 +2,7 @@ import type { AgGridReactProps } from '@ag-grid-community/react';
|
|
|
2
2
|
import type { ColDef, ColGroupDef, ICellRendererParams, IHeaderParams } from '@ag-grid-community/core';
|
|
3
3
|
import type { RuleItem } from 'async-validator/dist-types/interface';
|
|
4
4
|
import type { ReactElement, ReactNode, RefObject } from 'react';
|
|
5
|
+
export type { ColDef, ColGroupDef, ColumnState } from '@ag-grid-community/core';
|
|
5
6
|
export declare type GetRowKey<T> = string | ((data: T) => string);
|
|
6
7
|
export declare type PathType = string | (string | number)[];
|
|
7
8
|
export declare type ValidateRule<T> = Pick<RuleItem, 'required' | 'message' | 'pattern' | 'min' | 'max' | 'len' | 'type'> & {
|
|
@@ -156,7 +156,8 @@ function LayoutTabs(props) {
|
|
|
156
156
|
var tab = tabs[index];
|
|
157
157
|
return /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
158
158
|
tab: (_get = get(node, ['props', 'tab'])) !== null && _get !== void 0 ? _get : tab.title,
|
|
159
|
-
key: (_get2 = get(node, 'key')) !== null && _get2 !== void 0 ? _get2 : getKey(tab)
|
|
159
|
+
key: (_get2 = get(node, 'key')) !== null && _get2 !== void 0 ? _get2 : getKey(tab),
|
|
160
|
+
forceRender: get(node, ['props', 'forceRender'])
|
|
160
161
|
}, node);
|
|
161
162
|
});
|
|
162
163
|
return /*#__PURE__*/React.createElement(Layout, _extends({
|
|
@@ -66,12 +66,14 @@ export default function Section(props) {
|
|
|
66
66
|
}, mapChildren(children, function (child, index) {
|
|
67
67
|
var _tabs$index = tabs[index],
|
|
68
68
|
tab = _tabs$index.title,
|
|
69
|
-
key = _tabs$index.key
|
|
69
|
+
key = _tabs$index.key,
|
|
70
|
+
forceRender = _tabs$index.forceRender;
|
|
70
71
|
return /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
71
72
|
tab: tab,
|
|
72
73
|
key: key,
|
|
73
74
|
className: "".concat(prefixCls, "-body"),
|
|
74
|
-
style: bodyStyle
|
|
75
|
+
style: bodyStyle,
|
|
76
|
+
forceRender: true
|
|
75
77
|
}, child);
|
|
76
78
|
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TabBar, {
|
|
77
79
|
activeKey: activeKey,
|
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from 'antd';
|
|
2
2
|
export * from '@lemon-fe/hooks';
|
|
3
3
|
export * from '@lemon-fe/utils';
|
|
4
|
+
export { default as zhCN } from 'antd/es/locale/zh_CN';
|
|
4
5
|
export * from './constants';
|
|
5
6
|
export { default as init } from './init';
|
|
6
7
|
export { default as BaseTable } from './components/BaseTable';
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from 'antd';
|
|
2
2
|
export * from '@lemon-fe/hooks';
|
|
3
3
|
export * from '@lemon-fe/utils';
|
|
4
|
+
export { default as zhCN } from 'antd/es/locale/zh_CN';
|
|
4
5
|
export * from "./constants";
|
|
5
6
|
export { default as init } from "./init";
|
|
6
7
|
export { default as BaseTable } from "./components/BaseTable";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/kits",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-5",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -22,9 +22,6 @@
|
|
|
22
22
|
"module": "es/index.js",
|
|
23
23
|
"typings": "es/index.d.ts",
|
|
24
24
|
"main": "es/index.js",
|
|
25
|
-
"gitHooks": {
|
|
26
|
-
"pre-commit": "lint-staged"
|
|
27
|
-
},
|
|
28
25
|
"lint-staged": {
|
|
29
26
|
"*.{js,jsx,less,md,json}": [
|
|
30
27
|
"prettier --write"
|