sccoreui 6.2.78 → 6.2.79
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/App.scss +14 -0
- package/dist/components/ag-grid/parent-for-grid.js +15 -12
- package/package.json +1 -1
package/dist/App.scss
CHANGED
|
@@ -187,9 +187,17 @@
|
|
|
187
187
|
color: var(--_primary-400);
|
|
188
188
|
padding: 8px 14px;
|
|
189
189
|
border: 0 !important;
|
|
190
|
+
display: flex;
|
|
191
|
+
gap: 4px;
|
|
192
|
+
align-items: center;
|
|
190
193
|
&:hover {
|
|
191
194
|
background-color: var(--_primary-25) !important;
|
|
192
195
|
color: var(--_primary-600) !important;
|
|
196
|
+
svg {
|
|
197
|
+
path {
|
|
198
|
+
stroke: var(--primary-600);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
193
201
|
}
|
|
194
202
|
&:focus {
|
|
195
203
|
background-color: var(--_primary-25) !important;
|
|
@@ -198,6 +206,12 @@
|
|
|
198
206
|
&:disabled {
|
|
199
207
|
color: var(--_gray-300);
|
|
200
208
|
}
|
|
209
|
+
|
|
210
|
+
svg {
|
|
211
|
+
path {
|
|
212
|
+
stroke: var(--primary-400);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
201
215
|
}
|
|
202
216
|
}
|
|
203
217
|
|
|
@@ -14,7 +14,7 @@ const context_provider_1 = tslib_1.__importDefault(require("./context-provider")
|
|
|
14
14
|
const group_checkbox_1 = tslib_1.__importDefault(require("./group-checkbox"));
|
|
15
15
|
const utilComponents_1 = require("./utilComponents");
|
|
16
16
|
function ParentForGrid(props) {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
18
18
|
const { gridProps = {} } = props;
|
|
19
19
|
const [gridData, setGridData] = (0, react_1.useState)({
|
|
20
20
|
rowData: [],
|
|
@@ -118,12 +118,12 @@ function ParentForGrid(props) {
|
|
|
118
118
|
};
|
|
119
119
|
// Callback to products for getting data
|
|
120
120
|
const getData = (startRow, endRow, currentFeatures, params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
var
|
|
121
|
+
var _s, _t;
|
|
122
122
|
if (!(props === null || props === void 0 ? void 0 : props.getRowData)) {
|
|
123
123
|
return emptyResponse; // If callback function to get row data is not provided
|
|
124
124
|
}
|
|
125
125
|
if (props.rowModelType !== constants_1.ROWMODELTYPE.SERVER_SIDE) {
|
|
126
|
-
(
|
|
126
|
+
(_t = (_s = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current) === null || _s === void 0 ? void 0 : _s.api) === null || _t === void 0 ? void 0 : _t.showLoadingOverlay();
|
|
127
127
|
}
|
|
128
128
|
const response = yield (props === null || props === void 0 ? void 0 : props.getRowData(startRow, endRow, currentFeatures, params));
|
|
129
129
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: [] }));
|
|
@@ -145,8 +145,8 @@ function ParentForGrid(props) {
|
|
|
145
145
|
});
|
|
146
146
|
// Gets call onLoad,scroll and whenever any featureDetails changed
|
|
147
147
|
const onGridReady = (params, updatedFeatures) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
148
|
-
var
|
|
149
|
-
params.api.setGridOption(
|
|
148
|
+
var _u, _v;
|
|
149
|
+
params.api.setGridOption("rowSelection", "multiple");
|
|
150
150
|
params && setApi(params === null || params === void 0 ? void 0 : params.api);
|
|
151
151
|
setGridReadyEvent(params);
|
|
152
152
|
let currentFeatures = updatedFeatures;
|
|
@@ -159,21 +159,21 @@ function ParentForGrid(props) {
|
|
|
159
159
|
if (result.rowData) {
|
|
160
160
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: result.rowData }));
|
|
161
161
|
gridRef.current.api.hideOverlay();
|
|
162
|
-
(
|
|
162
|
+
(_u = params === null || params === void 0 ? void 0 : params.api) === null || _u === void 0 ? void 0 : _u.applyTransaction({ add: result.rowData });
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
|
-
(
|
|
165
|
+
(_v = params === null || params === void 0 ? void 0 : params.api) === null || _v === void 0 ? void 0 : _v.applyTransaction({ add: [] });
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
else if (props.rowModelType === constants_1.ROWMODELTYPE.SERVER_SIDE) {
|
|
169
169
|
const dataSource = {
|
|
170
170
|
getRows: (params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
171
|
-
var
|
|
171
|
+
var _w, _x, _y;
|
|
172
172
|
const startRow = params.request.startRow;
|
|
173
173
|
const endRow = params.request.endRow;
|
|
174
174
|
// Scroll should not exit MAX_RECORDS_TO_LOAD
|
|
175
175
|
if (endRow > maxLength && maxLength > 0) {
|
|
176
|
-
(
|
|
176
|
+
(_w = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current.api) === null || _w === void 0 ? void 0 : _w.hideOverlay();
|
|
177
177
|
// supply rows for requested block to grid
|
|
178
178
|
params.success({
|
|
179
179
|
rowData: gridData.rowData,
|
|
@@ -185,7 +185,7 @@ function ParentForGrid(props) {
|
|
|
185
185
|
const response = yield getData(startRow, endRow, currentFeatures, params);
|
|
186
186
|
console.log(response, "response");
|
|
187
187
|
// simulating real server call with a 500ms delay
|
|
188
|
-
if (((
|
|
188
|
+
if (((_x = response.rowData) === null || _x === void 0 ? void 0 : _x.length) > 0) {
|
|
189
189
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: response.rowData }));
|
|
190
190
|
gridRef.current.api.hideOverlay();
|
|
191
191
|
// supply rows for requested block to grid
|
|
@@ -195,7 +195,7 @@ function ParentForGrid(props) {
|
|
|
195
195
|
else {
|
|
196
196
|
// params.fail();
|
|
197
197
|
const gridRows = startRow >= constants_1.BLOCK_SIZE ? gridData.rowData : [];
|
|
198
|
-
if (!((
|
|
198
|
+
if (!((_y = params === null || params === void 0 ? void 0 : params.parentNode) === null || _y === void 0 ? void 0 : _y.id))
|
|
199
199
|
gridRef.current.api.showNoRowsOverlay();
|
|
200
200
|
params.success({ rowData: gridRows });
|
|
201
201
|
return;
|
|
@@ -421,6 +421,9 @@ function ParentForGrid(props) {
|
|
|
421
421
|
defaultFilters, createView: props === null || props === void 0 ? void 0 : props.createView, enableViewCreate: (_k = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _k === void 0 ? void 0 : _k.enableViewCreate, filterModelText: (_l = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _l === void 0 ? void 0 : _l.filterModelText, sortModelText: (_m = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _m === void 0 ? void 0 : _m.sortModelText, recordDetailModelText: (_o = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _o === void 0 ? void 0 : _o.recordDetailModelText, sidePanelText: (_p = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _p === void 0 ? void 0 : _p.sidePanelText, sortOptions: (props === null || props === void 0 ? void 0 : props.sortOptions)
|
|
422
422
|
? props.sortOptions
|
|
423
423
|
: constants_1.COLUMN_SORT_OPTIONS, filterConditions: props === null || props === void 0 ? void 0 : props.filterConditions, clearFilters: props === null || props === void 0 ? void 0 : props.clearFilters, setGridData, gridApi: gridRef, updateColumnsForGrid: props === null || props === void 0 ? void 0 : props.updateColumnsForGrid, enableManageColumnsCallback: props.enableManageColumnsCallback, columnToRender: gridData.columnData, selectedGroup: selectedGroup, setSelectedGroup: setSelectedGroup, initialCheckBoxData: initialCheckBoxData, intialColumns,
|
|
424
|
-
setIntialColumns, enableAdvancedFilter: props === null || props === void 0 ? void 0 : props.enableAdvancedFilter }, ((props === null || props === void 0 ? void 0 : props.rowData) && { rowData: props === null || props === void 0 ? void 0 : props.rowData })), { conditionsToDisplay: props === null || props === void 0 ? void 0 : props.conditionsToDisplay }) }, { children: ((_q = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _q === void 0 ? void 0 : _q.displayFeaturesHeader) && ((0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props })) })), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: gridStyle,
|
|
424
|
+
setIntialColumns, enableAdvancedFilter: props === null || props === void 0 ? void 0 : props.enableAdvancedFilter }, ((props === null || props === void 0 ? void 0 : props.rowData) && { rowData: props === null || props === void 0 ? void 0 : props.rowData })), { conditionsToDisplay: props === null || props === void 0 ? void 0 : props.conditionsToDisplay }) }, { children: ((_q = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _q === void 0 ? void 0 : _q.displayFeaturesHeader) && ((0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props })) })), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: Object.assign(Object.assign({}, gridStyle), { height: ((_r = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _r === void 0 ? void 0 : _r.displayFeaturesHeader) &&
|
|
425
|
+
gridStyle.height
|
|
426
|
+
? gridStyle.height - constants_1.ROW_HEIGHT
|
|
427
|
+
: gridStyle.height }), gridOptions: gridOptions, onGridReady: (props === null || props === void 0 ? void 0 : props.rowData) ? undefined : onGridReady, gridRef: gridRef })] }) })) }) }));
|
|
425
428
|
}
|
|
426
429
|
exports.default = ParentForGrid;
|