@cdmx/wappler_ag_grid 0.5.0 → 0.5.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/README.md +3 -4
- package/app_connect/components.hjson +32 -3
- package/dmx-ag-grid.js +36 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,12 +7,11 @@ The AG Grid module allows you to create a flexible and customizable data grid wi
|
|
|
7
7
|
|
|
8
8
|
1. **ID**: Unique ID for the grid. (Required)
|
|
9
9
|
2. **Data Source**: Data source for the grid. Enter the data source to populate the grid. (Required)
|
|
10
|
-
3. **No Auto Load**: Set to true to disable auto-load of the grid. (Default:
|
|
10
|
+
3. **No Auto Load**: Set to true to disable auto-load of the grid. (Default: false)
|
|
11
11
|
4. **Theme**: Select a theme for the grid.
|
|
12
|
-
- "Alpine"
|
|
12
|
+
- "Alpine" (Default)
|
|
13
13
|
- "Balham"
|
|
14
14
|
- "Material"
|
|
15
|
-
- "Base" (Default)
|
|
16
15
|
5. **Locale**: Select the locale for the grid. Currently supported locales: English (EN) and Hebrew (HE). (Default: EN)
|
|
17
16
|
|
|
18
17
|
## AG Grid Options
|
|
@@ -30,7 +29,7 @@ The AG Grid module allows you to create a flexible and customizable data grid wi
|
|
|
30
29
|
17. **Row Selection**: Row Selection (single or multiple).
|
|
31
30
|
- "Single"
|
|
32
31
|
- "Multiple" (Default)
|
|
33
|
-
18. **Timezone**: Timezone for Date Fields. Select the appropriate timezone from the dropdown list.
|
|
32
|
+
18. **Timezone**: Timezone for Date Fields. Select the appropriate timezone from the dropdown list. (Default: Local)
|
|
34
33
|
19. **Date Format**: Date Format for displaying date values. (Default: "dd/MM/yyyy hh:mm A")
|
|
35
34
|
20. **Sticky Header**: Enable sticky header. Optionally specify the header offset and topbar class.
|
|
36
35
|
- Header Offset: Specifies offset from the top of the viewport area (Optional). (Default: 100)
|
|
@@ -263,19 +263,30 @@
|
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
265
|
"name": "fixedHeader",
|
|
266
|
-
"
|
|
267
|
-
"title": "Sticky Header",
|
|
266
|
+
"title": "Sticky Header and Horizonal Scrollbar",
|
|
268
267
|
"type": "boolean",
|
|
269
268
|
"display": "fieldset",
|
|
270
269
|
"noChangeOnHide": true,
|
|
271
270
|
"groupEnabler": true,
|
|
272
271
|
"defaultValue": false,
|
|
273
272
|
"show": [
|
|
273
|
+
"enableFixedHeader",
|
|
274
274
|
"fixedHeaderOffset",
|
|
275
275
|
"topbarClass",
|
|
276
|
-
"fixedTopOffset"
|
|
276
|
+
"fixedTopOffset",
|
|
277
|
+
"fixedHorizonalScroll",
|
|
278
|
+
"fixedHorizonalScrollWidth"
|
|
277
279
|
],
|
|
278
280
|
"children": [
|
|
281
|
+
{
|
|
282
|
+
"name": "enableFixedHeader",
|
|
283
|
+
"attribute": "dmx-bind:fixed_header",
|
|
284
|
+
"title": "Fixed Header",
|
|
285
|
+
"type": "boolean",
|
|
286
|
+
"initDisplay": "none",
|
|
287
|
+
"defaultValue": false,
|
|
288
|
+
"help": "Enables Sticky header"
|
|
289
|
+
},
|
|
279
290
|
{
|
|
280
291
|
"name": "fixedHeaderOffset",
|
|
281
292
|
"attribute": "fixed_header_offset",
|
|
@@ -302,6 +313,24 @@
|
|
|
302
313
|
"initDisplay": "none",
|
|
303
314
|
"defaultValue": 80,
|
|
304
315
|
"help": "Specify topbar offset, Default: 80"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "fixedHorizonalScroll",
|
|
319
|
+
"attribute": "dmx-bind:fixed_horizonatal_scroll",
|
|
320
|
+
"title": "Fixed Horizonal Scroll",
|
|
321
|
+
"type": "boolean",
|
|
322
|
+
"initDisplay": "none",
|
|
323
|
+
"defaultValue": false,
|
|
324
|
+
"help": "Enables bottom fixed horizontal scroll"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"name": "fixedHorizonalScrollWidth",
|
|
328
|
+
"attribute": "dmx-bind:fixed_horizonatal_scroll_width",
|
|
329
|
+
"title": "Fixed Horizonal Scroll Width",
|
|
330
|
+
"type": "number",
|
|
331
|
+
"initDisplay": "none",
|
|
332
|
+
"defaultValue": 80,
|
|
333
|
+
"help": "Fixed horizontal scroll width percentage (Default: 80%)"
|
|
305
334
|
}
|
|
306
335
|
]
|
|
307
336
|
},
|
package/dmx-ag-grid.js
CHANGED
|
@@ -54,6 +54,7 @@ dmx.Component('ag-grid', {
|
|
|
54
54
|
fixed_header_offset: { type: Number, default: 100 },
|
|
55
55
|
fixed_top_offset: { type: Number, default: 80 },
|
|
56
56
|
fixed_horizonatal_scroll: { type: Boolean, default: false },
|
|
57
|
+
fixed_horizonatal_scroll_width: { type: Number, default: 80 },
|
|
57
58
|
timezone: {type: Text, default: '' },
|
|
58
59
|
cell_click_event: {type: Boolean, default: false },
|
|
59
60
|
row_click_event: {type: Boolean, default: false },
|
|
@@ -107,8 +108,8 @@ dmx.Component('ag-grid', {
|
|
|
107
108
|
const cnames = this.props.cnames
|
|
108
109
|
const cwidths = this.props.cwidths
|
|
109
110
|
const ctypes = this.props.ctypes
|
|
110
|
-
const enableRowClickEvent = this.props.row_click_event && !this.props.
|
|
111
|
-
const enableCellClickEvent = this.props.row_click_event && (this.props.
|
|
111
|
+
const enableRowClickEvent = this.props.row_click_event && !this.props.enable_actions && !this.props.row_checkbox_event;
|
|
112
|
+
const enableCellClickEvent = this.props.row_click_event && (this.props.enable_actions || this.props.row_checkbox_event);
|
|
112
113
|
let localeText;
|
|
113
114
|
let columnDefs = [];
|
|
114
115
|
let exportToCSV = this.props.export_to_csv;
|
|
@@ -867,13 +868,13 @@ dmx.Component('ag-grid', {
|
|
|
867
868
|
console.error('Grid container not found.');
|
|
868
869
|
return;
|
|
869
870
|
}
|
|
871
|
+
console.log(options.fixed_header)
|
|
870
872
|
if (options.fixed_header) {
|
|
871
873
|
window.addEventListener('scroll', function () {
|
|
872
874
|
const header = document.querySelector('.ag-header');
|
|
873
875
|
const topbar = document.querySelector('.' + options.topbar_class);
|
|
874
|
-
const topbarHeight = (topbar ? topbar.getBoundingClientRect().height : 0) + options.
|
|
875
|
-
const headerPos = (topbar ? topbar.getBoundingClientRect().bottom : 0) + options.
|
|
876
|
-
|
|
876
|
+
const topbarHeight = (topbar ? topbar.getBoundingClientRect().height : 0) + options.fixed_top_offset;
|
|
877
|
+
const headerPos = (topbar ? topbar.getBoundingClientRect().bottom : 0) + options.fixed_header_offset;
|
|
877
878
|
if (window.pageYOffset > headerPos) {
|
|
878
879
|
header.style.position = 'fixed';
|
|
879
880
|
header.style.top = `${topbarHeight}px`;
|
|
@@ -885,6 +886,36 @@ dmx.Component('ag-grid', {
|
|
|
885
886
|
}
|
|
886
887
|
});
|
|
887
888
|
}
|
|
889
|
+
const gridId = `${options.id}-grid`;
|
|
890
|
+
const agGridElement = document.getElementById(gridId);
|
|
891
|
+
function updateHoveringBarStyles() {
|
|
892
|
+
const existingStyle = document.getElementById('hovering-bar-style');
|
|
893
|
+
if (options.fixed_horizonatal_scroll) {
|
|
894
|
+
// Create a new style element
|
|
895
|
+
const styleElement = document.createElement('style');
|
|
896
|
+
styleElement.id = 'hovering-bar-style';
|
|
897
|
+
const barWidthPercentage = options.fixed_horizonatal_scroll_width;
|
|
898
|
+
const barWidth = `calc(${barWidthPercentage}vw - 10px)`;
|
|
899
|
+
// Add the styles for the hovering horizontal bottom bar
|
|
900
|
+
styleElement.innerHTML = `
|
|
901
|
+
.ag-body-horizontal-scroll {
|
|
902
|
+
width: ${barWidth};
|
|
903
|
+
position: fixed;
|
|
904
|
+
bottom: 0;
|
|
905
|
+
}
|
|
906
|
+
`;
|
|
907
|
+
if (existingStyle) {
|
|
908
|
+
existingStyle.parentNode.replaceChild(styleElement, existingStyle);
|
|
909
|
+
} else {
|
|
910
|
+
document.head.appendChild(styleElement);
|
|
911
|
+
}
|
|
912
|
+
} else if (existingStyle) {
|
|
913
|
+
// Remove the style element if it exists
|
|
914
|
+
existingStyle.parentNode.removeChild(existingStyle);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
updateHoveringBarStyles();
|
|
918
|
+
window.addEventListener('resize', updateHoveringBarStyles);
|
|
888
919
|
|
|
889
920
|
// Create the export button
|
|
890
921
|
if (exportToCSV) {
|