sccoreui 5.7.0 → 5.7.2
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/components/ag-grid/AgGrid.js +2 -31
- package/dist/components/ag-grid/ParentForGrid.js +40 -2
- package/dist/components/ag-grid/RowDetailsRenderer.js +9 -0
- package/dist/components/ag-grid/StatusDropdown.js +24 -0
- package/dist/types/components/ag-grid/AgGrid.d.ts +5 -1
- package/dist/types/components/ag-grid/RowDetailsRenderer.d.ts +4 -0
- package/dist/types/components/ag-grid/StatusDropdown.d.ts +5 -0
- package/dist/types/components/ag-grid/Types.d.ts +10 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
4
|
const react_1 = require("@ag-grid-community/react");
|
|
6
5
|
const core_1 = require("@ag-grid-community/core");
|
|
@@ -9,37 +8,9 @@ require("ag-grid-community/styles/ag-theme-quartz.css");
|
|
|
9
8
|
const client_side_row_model_1 = require("@ag-grid-community/client-side-row-model");
|
|
10
9
|
const core_2 = require("@ag-grid-enterprise/core");
|
|
11
10
|
const range_selection_1 = require("@ag-grid-enterprise/range-selection");
|
|
12
|
-
const react_2 = require("react");
|
|
13
|
-
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
14
11
|
core_1.ModuleRegistry.registerModules([client_side_row_model_1.ClientSideRowModelModule, range_selection_1.RangeSelectionModule]);
|
|
15
12
|
core_2.LicenseManager.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-056800}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Sellers_Commerce_LLC}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{SellersCommerce}_only_for_{2}_Front-End_JavaScript_developers___All_Front-End_JavaScript_developers_working_on_{SellersCommerce}_need_to_be_licensed___{SellersCommerce}_has_been_granted_a_Deployment_License_Add-on_for_{1}_Production_Environment___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{14_April_2025}____[v3]_[01]_MTc0NDU4NTIwMDAwMA==895f2234e1659afcfba586110daf0549");
|
|
16
|
-
const AgGrid = () => {
|
|
17
|
-
|
|
18
|
-
const [columnDefs] = (0, react_2.useState)([
|
|
19
|
-
{ field: "athlete", minWidth: 150 },
|
|
20
|
-
{ field: "age", maxWidth: 90 },
|
|
21
|
-
{ field: "country", minWidth: 150 },
|
|
22
|
-
{ field: "year", maxWidth: 90 },
|
|
23
|
-
{ field: "date", minWidth: 150 },
|
|
24
|
-
{ field: "sport", minWidth: 150 },
|
|
25
|
-
{ field: "gold" },
|
|
26
|
-
{ field: "silver" },
|
|
27
|
-
{ field: "bronze" },
|
|
28
|
-
{ field: "total" },
|
|
29
|
-
]);
|
|
30
|
-
const defaultColDef = (0, react_2.useMemo)(() => {
|
|
31
|
-
return {
|
|
32
|
-
flex: 1,
|
|
33
|
-
minWidth: 100,
|
|
34
|
-
};
|
|
35
|
-
}, []);
|
|
36
|
-
// Get api call for rows
|
|
37
|
-
const onGridReady = (0, react_2.useCallback)((params) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
-
console.log(params, 'params');
|
|
39
|
-
const result = (yield axios_1.default.get("https://www.ag-grid.com/example-assets/olympic-winners.json")).data;
|
|
40
|
-
console.log(result.length, result, "length of data");
|
|
41
|
-
setRowData(result);
|
|
42
|
-
}), []);
|
|
43
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-alpine ", style: { height: 800, width: 1200 } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, { rowData: rowData, columnDefs: columnDefs, defaultColDef: defaultColDef, onGridReady: onGridReady, enableRangeSelection: true }) })) }) }));
|
|
13
|
+
const AgGrid = ({ style, gridOptions, onGridReady }) => {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { 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({ onGridReady: onGridReady }, gridOptions)) })) }) }));
|
|
44
15
|
};
|
|
45
16
|
exports.default = AgGrid;
|
|
@@ -2,9 +2,47 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const AgGrid_1 = tslib_1.__importDefault(require("./AgGrid"));
|
|
6
7
|
function ParentForGrid(props) {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
const [gridData] = (0, react_1.useState)({
|
|
9
|
+
rowData: props === null || props === void 0 ? void 0 : props.rowData,
|
|
10
|
+
columnData: props === null || props === void 0 ? void 0 : props.columnData,
|
|
11
|
+
});
|
|
12
|
+
const [style] = (0, react_1.useState)(props.style);
|
|
13
|
+
const [api, setApi] = (0, react_1.useState)(null);
|
|
14
|
+
const defaultColDef = (0, react_1.useMemo)(() => {
|
|
15
|
+
return {
|
|
16
|
+
flex: 1,
|
|
17
|
+
minWidth: 100,
|
|
18
|
+
editable: true,
|
|
19
|
+
filter: true,
|
|
20
|
+
sortable: true,
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
const onGridReady = (params) => {
|
|
24
|
+
setApi(params.api);
|
|
25
|
+
};
|
|
26
|
+
// Get selected checkBox data
|
|
27
|
+
const onSelectionChanged = () => {
|
|
28
|
+
if (api) {
|
|
29
|
+
const selectedNodes = api === null || api === void 0 ? void 0 : api.getSelectedNodes();
|
|
30
|
+
const selectedData = selectedNodes.map(node => node.data);
|
|
31
|
+
console.log(selectedData, 'selected from checkbox'); // Send a callback to products
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
// Options that grid should have
|
|
35
|
+
const gridOptions = {
|
|
36
|
+
columnDefs: gridData.columnData,
|
|
37
|
+
rowData: gridData.rowData,
|
|
38
|
+
defaultColDef: defaultColDef,
|
|
39
|
+
enableRangeSelection: true,
|
|
40
|
+
suppressMenuHide: false,
|
|
41
|
+
onSelectionChanged: onSelectionChanged,
|
|
42
|
+
rowSelection: 'multiple',
|
|
43
|
+
suppressRowClickSelection: true,
|
|
44
|
+
rowHeight: 60
|
|
45
|
+
};
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady }) }));
|
|
9
47
|
}
|
|
10
48
|
exports.default = ParentForGrid;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const RowDetailsRenderer = ({ node }) => {
|
|
5
|
+
const data = node === null || node === void 0 ? void 0 : node.data;
|
|
6
|
+
console.log(data, node, 'details from node');
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { children: [data.gold, " "] }) }));
|
|
8
|
+
};
|
|
9
|
+
exports.default = RowDetailsRenderer;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const primereact_1 = require("primereact");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
function StatusDropdown({ value, statusChanged }) {
|
|
7
|
+
let options;
|
|
8
|
+
if (value === 1) {
|
|
9
|
+
options = [
|
|
10
|
+
{ id: 1, name: "Draft", value: 1 },
|
|
11
|
+
{ id: 2, name: "Active", value: 2 },
|
|
12
|
+
{ id: 3, name: "Inactive", value: 3 },
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
options = [
|
|
17
|
+
{ id: 2, name: "Active", value: 2 },
|
|
18
|
+
{ id: 3, name: "Inactive", value: 3 },
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
const selectedOption = (0, react_1.useMemo)(() => options.find((option) => option.value === value), [value]);
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [" ", (0, jsx_runtime_1.jsx)(primereact_1.Dropdown, { value: selectedOption.value, options: options, onChange: (e) => { statusChanged(e.target.value), console.log(e, 'value selected'); }, optionLabel: "name", placeholder: "Select a Status" })] }));
|
|
23
|
+
}
|
|
24
|
+
exports.default = StatusDropdown;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import "ag-grid-community/styles/ag-grid.css";
|
|
2
2
|
import "ag-grid-community/styles/ag-theme-quartz.css";
|
|
3
|
-
declare const AgGrid: (
|
|
3
|
+
declare const AgGrid: ({ style, gridOptions, onGridReady }: {
|
|
4
|
+
style: any;
|
|
5
|
+
gridOptions: any;
|
|
6
|
+
onGridReady: any;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
8
|
export default AgGrid;
|
|
@@ -11,3 +11,13 @@ export interface IOlympicData {
|
|
|
11
11
|
total: number;
|
|
12
12
|
color: string;
|
|
13
13
|
}
|
|
14
|
+
export interface Style {
|
|
15
|
+
height: number;
|
|
16
|
+
width: number;
|
|
17
|
+
}
|
|
18
|
+
export interface StatusOptions {
|
|
19
|
+
id: number;
|
|
20
|
+
name: string;
|
|
21
|
+
value: number;
|
|
22
|
+
}
|
|
23
|
+
export type { ColDef as gridColType } from "@ag-grid-community/core";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -104,6 +104,7 @@ export { default as ListBoxDropdown } from './components/list-box-dropdown/list-
|
|
|
104
104
|
export { default as CustomColorPicker } from "./components/custom-color-picker/color-picker";
|
|
105
105
|
export { useClickOutside, useOverlayListener, useOverlayScrollListener } from 'primereact/hooks';
|
|
106
106
|
export { default as AGGridComponent } from './components/ag-grid/ParentForGrid';
|
|
107
|
+
export { gridColType } from './components/ag-grid/Types';
|
|
107
108
|
import { DropdownChangeEvent } from "primereact/dropdown";
|
|
108
109
|
import { ColorPickerChangeEvent } from "primereact/colorpicker";
|
|
109
110
|
import { SliderChangeEvent } from "primereact/slider";
|