@nokecy/qc-ui 0.0.4 → 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.
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import "ag-grid-enterprise";
3
3
  import './global.scss';
4
+ import './index.less';
4
5
  import { GridProps } from './interface';
5
6
  declare function AgGridPlus(props: GridProps): JSX.Element;
6
7
  export default AgGridPlus;
@@ -19,6 +19,8 @@ require("ag-grid-enterprise");
19
19
 
20
20
  require("./global.scss");
21
21
 
22
+ require("./index.less");
23
+
22
24
  var _interface = require("./interface");
23
25
 
24
26
  var _queryForm = _interopRequireDefault(require("./queryForm"));
@@ -168,6 +170,8 @@ function AgGridPlus(props) {
168
170
  total: rowCount
169
171
  }));
170
172
  setLoading(false);
173
+ }).catch(function () {
174
+ setLoading(false);
171
175
  });
172
176
  };
173
177
 
@@ -187,7 +191,16 @@ function AgGridPlus(props) {
187
191
  };
188
192
 
189
193
  return /*#__PURE__*/_react.default.createElement(_antd.Spin, {
190
- spinning: loading
194
+ spinning: loading,
195
+ wrapperClassName: "grid-spin"
196
+ }, /*#__PURE__*/_react.default.createElement("div", {
197
+ className: "grid-container",
198
+ style: {
199
+ display: "flex",
200
+ flexDirection: "column",
201
+ flex: 1,
202
+ height: "100%"
203
+ }
191
204
  }, search == false ? null : /*#__PURE__*/_react.default.createElement(_queryForm.default, {
192
205
  columns: columnDefs,
193
206
  gridApi: apiRef.current,
@@ -203,7 +216,13 @@ function AgGridPlus(props) {
203
216
  bodyStyle: {
204
217
  margin: 0,
205
218
  padding: 12,
206
- paddingTop: 0
219
+ paddingTop: 0,
220
+ height: "100%",
221
+ display: "flex",
222
+ flexDirection: "column"
223
+ },
224
+ style: {
225
+ height: "100%"
207
226
  }
208
227
  }, /*#__PURE__*/_react.default.createElement("div", {
209
228
  style: _objectSpread({
@@ -286,7 +305,7 @@ function AgGridPlus(props) {
286
305
  pageSizeOptions: [10, 100, 200, 500, 1000],
287
306
  hideOnSinglePage: false,
288
307
  showQuickJumper: false
289
- }))));
308
+ })))));
290
309
  }
291
310
 
292
311
  var _default = AgGridPlus;
@@ -0,0 +1,7 @@
1
+ .grid-spin {
2
+ height: 100%;
3
+
4
+ .ant-spin-container {
5
+ height: 100%;
6
+ }
7
+ }
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import "ag-grid-enterprise";
3
3
  import './global.scss';
4
+ import './index.less';
4
5
  import { GridProps } from './interface';
5
6
  declare function AgGridPlus(props: GridProps): JSX.Element;
6
7
  export default AgGridPlus;
@@ -30,6 +30,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
30
30
  import GridManage from "./gridManager";
31
31
  import "ag-grid-enterprise";
32
32
  import "./global.scss";
33
+ import "./index.less";
33
34
  import { AgGridColumn } from "./interface";
34
35
  import FormRender from "./queryForm";
35
36
  import ToolBar from "./toolBar";
@@ -142,6 +143,8 @@ function AgGridPlus(props) {
142
143
  total: rowCount
143
144
  }));
144
145
  setLoading(false);
146
+ }).catch(function () {
147
+ setLoading(false);
145
148
  });
146
149
  };
147
150
 
@@ -161,7 +164,16 @@ function AgGridPlus(props) {
161
164
  };
162
165
 
163
166
  return /*#__PURE__*/React.createElement(Spin, {
164
- spinning: loading
167
+ spinning: loading,
168
+ wrapperClassName: "grid-spin"
169
+ }, /*#__PURE__*/React.createElement("div", {
170
+ className: "grid-container",
171
+ style: {
172
+ display: "flex",
173
+ flexDirection: "column",
174
+ flex: 1,
175
+ height: "100%"
176
+ }
165
177
  }, search == false ? null : /*#__PURE__*/React.createElement(FormRender, {
166
178
  columns: columnDefs,
167
179
  gridApi: apiRef.current,
@@ -177,7 +189,13 @@ function AgGridPlus(props) {
177
189
  bodyStyle: {
178
190
  margin: 0,
179
191
  padding: 12,
180
- paddingTop: 0
192
+ paddingTop: 0,
193
+ height: "100%",
194
+ display: "flex",
195
+ flexDirection: "column"
196
+ },
197
+ style: {
198
+ height: "100%"
181
199
  }
182
200
  }, /*#__PURE__*/React.createElement("div", {
183
201
  style: _objectSpread({
@@ -260,7 +278,7 @@ function AgGridPlus(props) {
260
278
  pageSizeOptions: [10, 100, 200, 500, 1000],
261
279
  hideOnSinglePage: false,
262
280
  showQuickJumper: false
263
- }))));
281
+ })))));
264
282
  }
265
283
 
266
284
  export default AgGridPlus;
@@ -0,0 +1,7 @@
1
+ .grid-spin {
2
+ height: 100%;
3
+
4
+ .ant-spin-container {
5
+ height: 100%;
6
+ }
7
+ }