@nokecy/qc-ui 0.3.30 → 0.3.32
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/dist/cjs/ag-grid-plus/ag-gridPlus.js +4 -1
- package/dist/cjs/ag-grid-plus/context/gridContext.d.ts +1 -1
- package/dist/cjs/ag-grid-plus/context/gridContext.js +4 -1
- package/dist/cjs/ag-grid-plus/setting/index.d.ts +2 -1
- package/dist/cjs/ag-grid-plus/setting/index.js +7 -1
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +4 -1
- package/dist/esm/ag-grid-plus/context/gridContext.d.ts +1 -1
- package/dist/esm/ag-grid-plus/context/gridContext.js +4 -1
- package/dist/esm/ag-grid-plus/setting/index.d.ts +2 -1
- package/dist/esm/ag-grid-plus/setting/index.js +7 -1
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +1 -1
|
@@ -273,7 +273,9 @@ function AgGridPlus(props) {
|
|
|
273
273
|
}, []);
|
|
274
274
|
|
|
275
275
|
var onColumnStateChanged = function onColumnStateChanged(columnState) {
|
|
276
|
-
|
|
276
|
+
if (gridKey) {
|
|
277
|
+
onSaveColumnState && onSaveColumnState(gridKey, columnState);
|
|
278
|
+
}
|
|
277
279
|
};
|
|
278
280
|
|
|
279
281
|
(0, _react.useEffect)(function () {
|
|
@@ -348,6 +350,7 @@ function AgGridPlus(props) {
|
|
|
348
350
|
onClick: onRefresh,
|
|
349
351
|
icon: /*#__PURE__*/_react.default.createElement(_icons.RedoOutlined, null)
|
|
350
352
|
}), /*#__PURE__*/_react.default.createElement(_setting.default, {
|
|
353
|
+
gridKey: gridKey,
|
|
351
354
|
gridApi: apiRef.current,
|
|
352
355
|
columnApi: columnsRef.current,
|
|
353
356
|
onSaveColumnState: onColumnStateChanged
|
|
@@ -9,6 +9,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
var GridPlusContext = /*#__PURE__*/_react.default.createContext(
|
|
12
|
+
var GridPlusContext = /*#__PURE__*/_react.default.createContext({
|
|
13
|
+
columnState: undefined,
|
|
14
|
+
onSaveColumnState: function onSaveColumnState(gridKey, columnState) {}
|
|
15
|
+
});
|
|
13
16
|
|
|
14
17
|
exports.GridPlusContext = GridPlusContext;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ColumnApi, GridApi } from 'ag-grid-community';
|
|
3
3
|
declare const Setting: (props: {
|
|
4
|
+
gridKey?: string | undefined;
|
|
4
5
|
gridApi?: GridApi<any> | undefined;
|
|
5
6
|
columnApi: ColumnApi;
|
|
6
7
|
onSaveColumnState: (state: any) => void;
|
|
7
|
-
}) => JSX.Element;
|
|
8
|
+
}) => JSX.Element | null;
|
|
8
9
|
export default Setting;
|
|
@@ -38,7 +38,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
38
38
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
39
|
|
|
40
40
|
var Setting = function Setting(props) {
|
|
41
|
-
var
|
|
41
|
+
var gridKey = props.gridKey,
|
|
42
|
+
gridApi = props.gridApi,
|
|
42
43
|
columnApi = props.columnApi,
|
|
43
44
|
onSaveColumnState = props.onSaveColumnState;
|
|
44
45
|
var SchemaField = (0, _react2.useMemo)(function () {
|
|
@@ -80,6 +81,11 @@ var Setting = function Setting(props) {
|
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
var portalId = "workProcedure".concat((0, _uniqueId2.default)());
|
|
84
|
+
|
|
85
|
+
if (!gridKey) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
83
89
|
return /*#__PURE__*/_react2.default.createElement(_antdV.FormDialog.Portal, {
|
|
84
90
|
id: portalId
|
|
85
91
|
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
@@ -246,7 +246,9 @@ function AgGridPlus(props) {
|
|
|
246
246
|
}, []);
|
|
247
247
|
|
|
248
248
|
var onColumnStateChanged = function onColumnStateChanged(columnState) {
|
|
249
|
-
|
|
249
|
+
if (gridKey) {
|
|
250
|
+
onSaveColumnState && onSaveColumnState(gridKey, columnState);
|
|
251
|
+
}
|
|
250
252
|
};
|
|
251
253
|
|
|
252
254
|
useEffect(function () {
|
|
@@ -319,6 +321,7 @@ function AgGridPlus(props) {
|
|
|
319
321
|
onClick: onRefresh,
|
|
320
322
|
icon: /*#__PURE__*/React.createElement(RedoOutlined, null)
|
|
321
323
|
}), /*#__PURE__*/React.createElement(Setting, {
|
|
324
|
+
gridKey: gridKey,
|
|
322
325
|
gridApi: apiRef.current,
|
|
323
326
|
columnApi: columnsRef.current,
|
|
324
327
|
onSaveColumnState: onColumnStateChanged
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export var GridPlusContext = /*#__PURE__*/React.createContext(
|
|
2
|
+
export var GridPlusContext = /*#__PURE__*/React.createContext({
|
|
3
|
+
columnState: undefined,
|
|
4
|
+
onSaveColumnState: function onSaveColumnState(gridKey, columnState) {}
|
|
5
|
+
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ColumnApi, GridApi } from 'ag-grid-community';
|
|
3
3
|
declare const Setting: (props: {
|
|
4
|
+
gridKey?: string | undefined;
|
|
4
5
|
gridApi?: GridApi<any> | undefined;
|
|
5
6
|
columnApi: ColumnApi;
|
|
6
7
|
onSaveColumnState: (state: any) => void;
|
|
7
|
-
}) => JSX.Element;
|
|
8
|
+
}) => JSX.Element | null;
|
|
8
9
|
export default Setting;
|
|
@@ -21,7 +21,8 @@ import React, { useMemo } from "react";
|
|
|
21
21
|
import { SettingOutlined } from '@ant-design/icons';
|
|
22
22
|
|
|
23
23
|
var Setting = function Setting(props) {
|
|
24
|
-
var
|
|
24
|
+
var gridKey = props.gridKey,
|
|
25
|
+
gridApi = props.gridApi,
|
|
25
26
|
columnApi = props.columnApi,
|
|
26
27
|
onSaveColumnState = props.onSaveColumnState;
|
|
27
28
|
var SchemaField = useMemo(function () {
|
|
@@ -63,6 +64,11 @@ var Setting = function Setting(props) {
|
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
var portalId = "workProcedure".concat(_uniqueId());
|
|
67
|
+
|
|
68
|
+
if (!gridKey) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
66
72
|
return /*#__PURE__*/React.createElement(FormDialog.Portal, {
|
|
67
73
|
id: portalId
|
|
68
74
|
}, /*#__PURE__*/React.createElement("div", {
|