sccoreui 6.1.98 → 6.2.10
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.
|
@@ -17,6 +17,6 @@ const LicenceKey_1 = require("./LicenceKey");
|
|
|
17
17
|
core_1.ModuleRegistry.registerModules([client_side_row_model_1.ClientSideRowModelModule, range_selection_1.RangeSelectionModule, infinite_row_model_1.InfiniteRowModelModule, server_side_row_model_1.ServerSideRowModelModule, row_grouping_1.RowGroupingModule, set_filter_1.SetFilterModule]);
|
|
18
18
|
core_2.LicenseManager.setLicenseKey(LicenceKey_1.LICENSEKEY);
|
|
19
19
|
const AgGrid = ({ style, gridOptions, onGridReady, gridRef }) => {
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ ref: gridRef, onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }));
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style === null || style === void 0 ? void 0 : style.height, width: style === null || style === void 0 ? void 0 : style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ ref: gridRef, onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }));
|
|
21
21
|
};
|
|
22
22
|
exports.default = AgGrid;
|
|
@@ -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
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
18
18
|
const [gridData, setGridData] = (0, react_1.useState)({
|
|
19
19
|
rowData: [],
|
|
20
20
|
columnData: (0, helper_1.sortColumns)(props === null || props === void 0 ? void 0 : props.columnData),
|
|
@@ -142,7 +142,7 @@ function ParentForGrid(props) {
|
|
|
142
142
|
});
|
|
143
143
|
// Gets call onLoad,scroll and whenever any featureDetails changed
|
|
144
144
|
const onGridReady = (params, updatedFeatures) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
145
|
-
var
|
|
145
|
+
var _m, _o;
|
|
146
146
|
setApi(params.api);
|
|
147
147
|
setGridReadyEvent(params);
|
|
148
148
|
let currentFeatures = updatedFeatures;
|
|
@@ -155,21 +155,21 @@ function ParentForGrid(props) {
|
|
|
155
155
|
if (result.rowData) {
|
|
156
156
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: result.rowData }));
|
|
157
157
|
gridRef.current.api.hideOverlay();
|
|
158
|
-
(
|
|
158
|
+
(_m = params === null || params === void 0 ? void 0 : params.api) === null || _m === void 0 ? void 0 : _m.applyTransaction({ add: result.rowData });
|
|
159
159
|
}
|
|
160
160
|
else {
|
|
161
|
-
(
|
|
161
|
+
(_o = params === null || params === void 0 ? void 0 : params.api) === null || _o === void 0 ? void 0 : _o.applyTransaction({ add: [] });
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
else if (props.rowModelType === constants_1.ROWMODELTYPE.SERVER_SIDE) {
|
|
165
165
|
const dataSource = {
|
|
166
166
|
getRows: (params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
var
|
|
167
|
+
var _p, _q, _r;
|
|
168
168
|
const startRow = params.request.startRow;
|
|
169
169
|
const endRow = params.request.endRow;
|
|
170
170
|
// Scroll should not exit MAX_RECORDS_TO_LOAD
|
|
171
171
|
if (endRow > maxLength && maxLength > 0) {
|
|
172
|
-
(
|
|
172
|
+
(_p = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current.api) === null || _p === void 0 ? void 0 : _p.hideOverlay();
|
|
173
173
|
// supply rows for requested block to grid
|
|
174
174
|
params.success({
|
|
175
175
|
rowData: gridData.rowData,
|
|
@@ -180,7 +180,7 @@ function ParentForGrid(props) {
|
|
|
180
180
|
// get data for request from our fake server
|
|
181
181
|
const response = yield getData(startRow, endRow, currentFeatures, params);
|
|
182
182
|
// simulating real server call with a 500ms delay
|
|
183
|
-
if (((
|
|
183
|
+
if (((_q = response.rowData) === null || _q === void 0 ? void 0 : _q.length) > 0) {
|
|
184
184
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: response.rowData }));
|
|
185
185
|
gridRef.current.api.hideOverlay();
|
|
186
186
|
// supply rows for requested block to grid
|
|
@@ -190,7 +190,7 @@ function ParentForGrid(props) {
|
|
|
190
190
|
else {
|
|
191
191
|
// params.fail();
|
|
192
192
|
const gridRows = startRow >= constants_1.BLOCK_SIZE ? gridData.rowData : [];
|
|
193
|
-
if (!((
|
|
193
|
+
if (!((_r = params === null || params === void 0 ? void 0 : params.parentNode) === null || _r === void 0 ? void 0 : _r.id))
|
|
194
194
|
gridRef.current.api.showNoRowsOverlay();
|
|
195
195
|
params.success({ rowData: gridRows });
|
|
196
196
|
return;
|
|
@@ -292,12 +292,13 @@ function ParentForGrid(props) {
|
|
|
292
292
|
setIntialColumns(deepCopyOfColumns);
|
|
293
293
|
}
|
|
294
294
|
}, [intialColumns]);
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
// const gridStyle = {
|
|
296
|
+
// width: props?.style?.width, // Full width
|
|
297
|
+
// ...(totalRecords > 6 && { height: props?.style?.height }), // Set height only if records > 6
|
|
298
|
+
// };
|
|
298
299
|
// Options that grid should have
|
|
299
300
|
const gridOptions = {
|
|
300
|
-
columnDefs: (
|
|
301
|
+
columnDefs: (_c = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _c === void 0 ? void 0 : _c.map((column) => {
|
|
301
302
|
var _a, _b;
|
|
302
303
|
if ((column === null || column === void 0 ? void 0 : column.enableChildCheckbox) && (column === null || column === void 0 ? void 0 : column.enableHeaderCheckbox)) {
|
|
303
304
|
return Object.assign(Object.assign({}, column), { headerComponent: (params) => headerCheckBoxRenderer(params === null || params === void 0 ? void 0 : params.displayName, (column === null || column === void 0 ? void 0 : column.headerComponent) && ""), cellRenderer: (params) => (0, utilComponents_1.dataCellRenderer)(params, column, props), cellRendererParams: {
|
|
@@ -328,13 +329,13 @@ function ParentForGrid(props) {
|
|
|
328
329
|
suppressCellFocus: true,
|
|
329
330
|
suppressPropertyNamesCheck: true,
|
|
330
331
|
suppressServerSideFullWidthLoadingRow: true,
|
|
331
|
-
enableRangeSelection: (
|
|
332
|
-
enableFillHandle: (
|
|
332
|
+
enableRangeSelection: (_d = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _d === void 0 ? void 0 : _d.enableFillHandle,
|
|
333
|
+
enableFillHandle: (_e = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _e === void 0 ? void 0 : _e.enableFillHandle,
|
|
333
334
|
onFillEnd: wrapperToFillOpertation,
|
|
334
335
|
fillOperation: myOpertaion,
|
|
335
336
|
getRowId: getRowId,
|
|
336
337
|
fillHandleDirection: "y",
|
|
337
|
-
domLayout:
|
|
338
|
+
// ...(totalRecords > 6 && { domLayout: 'autoHeight' }) // for auto height based on table content
|
|
338
339
|
};
|
|
339
340
|
// Fucntion to call the grid
|
|
340
341
|
const callGrid = (featureDetails) => {
|
|
@@ -393,7 +394,7 @@ function ParentForGrid(props) {
|
|
|
393
394
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
|
|
394
395
|
}
|
|
395
396
|
}, [props === null || props === void 0 ? void 0 : props.emptyCheckboxStatus]);
|
|
396
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: style.height, width: style.width }, className: "ag-grid-container border-1 border-gray-200 border-round" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: {
|
|
397
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: style === null || style === void 0 ? void 0 : style.height, width: style === null || style === void 0 ? void 0 : style.width }, className: "ag-grid-container border-1 border-gray-200 border-round" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: {
|
|
397
398
|
featureDetails,
|
|
398
399
|
setFeatureDetails,
|
|
399
400
|
gridData,
|
|
@@ -402,11 +403,11 @@ function ParentForGrid(props) {
|
|
|
402
403
|
initialFeature,
|
|
403
404
|
defaultFilters,
|
|
404
405
|
createView: props === null || props === void 0 ? void 0 : props.createView,
|
|
405
|
-
enableViewCreate: (
|
|
406
|
-
filterModelText: (
|
|
407
|
-
sortModelText: (
|
|
408
|
-
recordDetailModelText: (
|
|
409
|
-
sidePanelText: (
|
|
406
|
+
enableViewCreate: (_f = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _f === void 0 ? void 0 : _f.enableViewCreate,
|
|
407
|
+
filterModelText: (_g = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _g === void 0 ? void 0 : _g.filterModelText,
|
|
408
|
+
sortModelText: (_h = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _h === void 0 ? void 0 : _h.sortModelText,
|
|
409
|
+
recordDetailModelText: (_j = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _j === void 0 ? void 0 : _j.recordDetailModelText,
|
|
410
|
+
sidePanelText: (_k = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _k === void 0 ? void 0 : _k.sidePanelText,
|
|
410
411
|
sortOptions: (props === null || props === void 0 ? void 0 : props.sortOptions)
|
|
411
412
|
? props.sortOptions
|
|
412
413
|
: constants_1.COLUMN_SORT_OPTIONS,
|
|
@@ -422,6 +423,6 @@ function ParentForGrid(props) {
|
|
|
422
423
|
initialCheckBoxData: initialCheckBoxData,
|
|
423
424
|
intialColumns,
|
|
424
425
|
setIntialColumns
|
|
425
|
-
} }, { children: ((
|
|
426
|
+
} }, { children: ((_l = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _l === void 0 ? void 0 : _l.displayFeaturesHeader) && ((0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props })) })), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady, gridRef: gridRef })] }) })) }) }));
|
|
426
427
|
}
|
|
427
428
|
exports.default = ParentForGrid;
|