@nokecy/qc-ui 0.0.4 → 0.0.6

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"));
@@ -125,8 +127,7 @@ function AgGridPlus(props) {
125
127
 
126
128
  var defaultColDef = {
127
129
  resizable: true,
128
- sortable: true,
129
- flex: 1
130
+ sortable: true
130
131
  };
131
132
  (0, _react.useEffect)(function () {
132
133
  if (ready && request) {
@@ -168,6 +169,8 @@ function AgGridPlus(props) {
168
169
  total: rowCount
169
170
  }));
170
171
  setLoading(false);
172
+ }).catch(function () {
173
+ setLoading(false);
171
174
  });
172
175
  };
173
176
 
@@ -187,7 +190,16 @@ function AgGridPlus(props) {
187
190
  };
188
191
 
189
192
  return /*#__PURE__*/_react.default.createElement(_antd.Spin, {
190
- spinning: loading
193
+ spinning: loading,
194
+ wrapperClassName: "grid-spin"
195
+ }, /*#__PURE__*/_react.default.createElement("div", {
196
+ className: "grid-container",
197
+ style: {
198
+ display: "flex",
199
+ flexDirection: "column",
200
+ flex: 1,
201
+ height: "100%"
202
+ }
191
203
  }, search == false ? null : /*#__PURE__*/_react.default.createElement(_queryForm.default, {
192
204
  columns: columnDefs,
193
205
  gridApi: apiRef.current,
@@ -203,7 +215,13 @@ function AgGridPlus(props) {
203
215
  bodyStyle: {
204
216
  margin: 0,
205
217
  padding: 12,
206
- paddingTop: 0
218
+ paddingTop: 0,
219
+ height: "100%",
220
+ display: "flex",
221
+ flexDirection: "column"
222
+ },
223
+ style: {
224
+ height: "100%"
207
225
  }
208
226
  }, /*#__PURE__*/_react.default.createElement("div", {
209
227
  style: _objectSpread({
@@ -233,6 +251,23 @@ function AgGridPlus(props) {
233
251
  sortChanged(event.columnApi);
234
252
  },
235
253
  columnTypes: {
254
+ bool: {
255
+ cellRenderer: function cellRenderer(params) {
256
+ switch (params.value) {
257
+ case true:
258
+ case "0":
259
+ return /*#__PURE__*/_react.default.createElement(_antd.Tag, {
260
+ color: "success"
261
+ }, "\u662F");
262
+
263
+ case false:
264
+ case "1":
265
+ return /*#__PURE__*/_react.default.createElement(_antd.Tag, {
266
+ color: "error"
267
+ }, "\u5426");
268
+ }
269
+ }
270
+ },
236
271
  numberColumn: {
237
272
  width: 130,
238
273
  filter: 'agNumberColumnFilter'
@@ -286,7 +321,7 @@ function AgGridPlus(props) {
286
321
  pageSizeOptions: [10, 100, 200, 500, 1000],
287
322
  hideOnSinglePage: false,
288
323
  showQuickJumper: false
289
- }))));
324
+ })))));
290
325
  }
291
326
 
292
327
  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;
@@ -25,11 +25,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
25
25
  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; }
26
26
 
27
27
  import { AgGridReact } from 'ag-grid-react';
28
- import { Spin, Pagination, Card } from 'antd';
28
+ import { Spin, Pagination, Card, Tag } from 'antd';
29
29
  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";
@@ -99,8 +100,7 @@ function AgGridPlus(props) {
99
100
 
100
101
  var defaultColDef = {
101
102
  resizable: true,
102
- sortable: true,
103
- flex: 1
103
+ sortable: true
104
104
  };
105
105
  useEffect(function () {
106
106
  if (ready && request) {
@@ -142,6 +142,8 @@ function AgGridPlus(props) {
142
142
  total: rowCount
143
143
  }));
144
144
  setLoading(false);
145
+ }).catch(function () {
146
+ setLoading(false);
145
147
  });
146
148
  };
147
149
 
@@ -161,7 +163,16 @@ function AgGridPlus(props) {
161
163
  };
162
164
 
163
165
  return /*#__PURE__*/React.createElement(Spin, {
164
- spinning: loading
166
+ spinning: loading,
167
+ wrapperClassName: "grid-spin"
168
+ }, /*#__PURE__*/React.createElement("div", {
169
+ className: "grid-container",
170
+ style: {
171
+ display: "flex",
172
+ flexDirection: "column",
173
+ flex: 1,
174
+ height: "100%"
175
+ }
165
176
  }, search == false ? null : /*#__PURE__*/React.createElement(FormRender, {
166
177
  columns: columnDefs,
167
178
  gridApi: apiRef.current,
@@ -177,7 +188,13 @@ function AgGridPlus(props) {
177
188
  bodyStyle: {
178
189
  margin: 0,
179
190
  padding: 12,
180
- paddingTop: 0
191
+ paddingTop: 0,
192
+ height: "100%",
193
+ display: "flex",
194
+ flexDirection: "column"
195
+ },
196
+ style: {
197
+ height: "100%"
181
198
  }
182
199
  }, /*#__PURE__*/React.createElement("div", {
183
200
  style: _objectSpread({
@@ -207,6 +224,23 @@ function AgGridPlus(props) {
207
224
  sortChanged(event.columnApi);
208
225
  },
209
226
  columnTypes: {
227
+ bool: {
228
+ cellRenderer: function cellRenderer(params) {
229
+ switch (params.value) {
230
+ case true:
231
+ case "0":
232
+ return /*#__PURE__*/React.createElement(Tag, {
233
+ color: "success"
234
+ }, "\u662F");
235
+
236
+ case false:
237
+ case "1":
238
+ return /*#__PURE__*/React.createElement(Tag, {
239
+ color: "error"
240
+ }, "\u5426");
241
+ }
242
+ }
243
+ },
210
244
  numberColumn: {
211
245
  width: 130,
212
246
  filter: 'agNumberColumnFilter'
@@ -260,7 +294,7 @@ function AgGridPlus(props) {
260
294
  pageSizeOptions: [10, 100, 200, 500, 1000],
261
295
  hideOnSinglePage: false,
262
296
  showQuickJumper: false
263
- }))));
297
+ })))));
264
298
  }
265
299
 
266
300
  export default AgGridPlus;
@@ -0,0 +1,7 @@
1
+ .grid-spin {
2
+ height: 100%;
3
+
4
+ .ant-spin-container {
5
+ height: 100%;
6
+ }
7
+ }