@bit.rhplus/ui.grid 0.0.24 → 0.0.26
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/AgGridColumns.js +2 -0
- package/ColumnBuilder.jsx +172 -97
- package/dist/AgGridColumns.js +2 -0
- package/dist/AgGridColumns.js.map +1 -1
- package/dist/ColumnBuilder.js +155 -83
- package/dist/ColumnBuilder.js.map +1 -1
- package/dist/functions.d.ts +13 -0
- package/dist/functions.js +45 -0
- package/dist/functions.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +40 -29
- package/dist/index.js.map +1 -1
- package/dist/style.css +0 -0
- package/dist/utils.d.ts +1 -13
- package/dist/utils.js +24 -42
- package/dist/utils.js.map +1 -1
- package/index.jsx +117 -94
- package/package.json +4 -4
- package/style.css +0 -0
- package/utils.jsx +35 -0
- /package/dist/{preview-1748952580414.js → preview-1750330600954.js} +0 -0
- /package/{utils.js → functions.js} +0 -0
package/AgGridColumns.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import ColumnBuilder from './ColumnBuilder';
|
|
3
4
|
import * as Tooltip from './tooltips';
|
|
@@ -49,3 +50,4 @@ export const AgGridColumns = (columnDefs, options) => {
|
|
|
49
50
|
const cols = resolvedColumnDefs && resolvedColumnDefs.map((column) => AgGridColumn(column, options));
|
|
50
51
|
return cols;
|
|
51
52
|
};
|
|
53
|
+
/* eslint-enable */
|
package/ColumnBuilder.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { Menu, Dropdown, Divider } from 'antd';
|
|
3
|
-
import { prepareCellStyle, prepareColDef, getValueByPath } from './
|
|
3
|
+
import { Menu, Dropdown, Button, Divider } from 'antd';
|
|
4
|
+
import { prepareCellStyle, prepareColDef, getValueByPath } from './functions';
|
|
4
5
|
import { currencySymbols } from './enums';
|
|
5
6
|
import { ActionIcon } from './Icons';
|
|
6
7
|
|
|
@@ -121,6 +122,72 @@ const useObjectCellRenderer = (params, editable, onEditClick) => {
|
|
|
121
122
|
};
|
|
122
123
|
};
|
|
123
124
|
|
|
125
|
+
// Vytvoříme React hook funkci pro row hover action renderer
|
|
126
|
+
const useRowHoverActionRenderer = (params) => {
|
|
127
|
+
const [isRowHovered, setIsRowHovered] = React.useState(false);
|
|
128
|
+
const rowRef = React.useRef(null);
|
|
129
|
+
|
|
130
|
+
React.useEffect(() => {
|
|
131
|
+
if (!params.node) return undefined;
|
|
132
|
+
|
|
133
|
+
// Funkce pro kontrolu, zda je řádek v hover stavu
|
|
134
|
+
const checkRowHoverState = () => {
|
|
135
|
+
// Najdeme DOM element řádku pomocí rowIndex
|
|
136
|
+
const rowElement = document.querySelector(
|
|
137
|
+
`.ag-row[row-index="${params.rowIndex}"]`
|
|
138
|
+
);
|
|
139
|
+
if (rowElement) {
|
|
140
|
+
rowRef.current = rowElement;
|
|
141
|
+
// AG-Grid automaticky přidává třídu ag-row-hover k řádku při najetí myší
|
|
142
|
+
const isHovered = rowElement.classList.contains('ag-row-hover');
|
|
143
|
+
setIsRowHovered(isHovered);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// Vytvoříme MutationObserver pro sledování změn tříd na řádku
|
|
148
|
+
const observer = new MutationObserver((mutations) => {
|
|
149
|
+
mutations.forEach((mutation) => {
|
|
150
|
+
if (
|
|
151
|
+
mutation.type === 'attributes' &&
|
|
152
|
+
mutation.attributeName === 'class'
|
|
153
|
+
) {
|
|
154
|
+
checkRowHoverState();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// Inicializujeme stav
|
|
160
|
+
checkRowHoverState();
|
|
161
|
+
|
|
162
|
+
// Přidáme observer k element řádku, pokud existuje
|
|
163
|
+
if (rowRef.current) {
|
|
164
|
+
observer.observe(rowRef.current, { attributes: true });
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Přidáme event listeners na grid container pro sledování pohybu myši
|
|
168
|
+
const gridContainer = document.querySelector('.ag-root-wrapper');
|
|
169
|
+
if (gridContainer) {
|
|
170
|
+
gridContainer.addEventListener('mouseover', checkRowHoverState);
|
|
171
|
+
gridContainer.addEventListener('mouseout', checkRowHoverState);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Cleanup při odmontování komponenty
|
|
175
|
+
return () => {
|
|
176
|
+
if (rowRef.current) {
|
|
177
|
+
observer.disconnect();
|
|
178
|
+
}
|
|
179
|
+
if (gridContainer) {
|
|
180
|
+
gridContainer.removeEventListener('mouseover', checkRowHoverState);
|
|
181
|
+
gridContainer.removeEventListener('mouseout', checkRowHoverState);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}, [params.node, params.rowIndex]);
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
isRowHovered,
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
|
|
124
191
|
class ColumnBuilder {
|
|
125
192
|
#addPreparedColumn(props) {
|
|
126
193
|
this.columns.push(prepareColDef(this.intl, props));
|
|
@@ -261,7 +328,7 @@ class ColumnBuilder {
|
|
|
261
328
|
hoverStyle,
|
|
262
329
|
cellAlign = 'left',
|
|
263
330
|
editable,
|
|
264
|
-
overviewToggle = false,
|
|
331
|
+
overviewToggle = false, // Přidán výchozí parametr pro overview
|
|
265
332
|
...restProps
|
|
266
333
|
}) {
|
|
267
334
|
// Vytvořím komponentu pro cell renderer, která používá hook
|
|
@@ -281,12 +348,6 @@ class ColumnBuilder {
|
|
|
281
348
|
overviewToggle
|
|
282
349
|
);
|
|
283
350
|
|
|
284
|
-
const handleKeyPress = React.useCallback((event) => {
|
|
285
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
286
|
-
handleClick(event);
|
|
287
|
-
}
|
|
288
|
-
}, [handleClick]);
|
|
289
|
-
|
|
290
351
|
return (
|
|
291
352
|
<div
|
|
292
353
|
className="link-cell-container"
|
|
@@ -301,10 +362,14 @@ class ColumnBuilder {
|
|
|
301
362
|
onClick={handleClick}
|
|
302
363
|
onMouseEnter={handleMouseEnter}
|
|
303
364
|
onMouseLeave={handleMouseLeave}
|
|
304
|
-
onKeyPress={handleKeyPress}
|
|
305
365
|
style={isHovered ? computedHoverStyle : computedLinkStyle}
|
|
306
366
|
role="button"
|
|
307
367
|
tabIndex={0}
|
|
368
|
+
onKeyPress={(event) => {
|
|
369
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
370
|
+
handleClick(event);
|
|
371
|
+
}
|
|
372
|
+
}}
|
|
308
373
|
>
|
|
309
374
|
{params.value}
|
|
310
375
|
</span>
|
|
@@ -321,7 +386,7 @@ class ColumnBuilder {
|
|
|
321
386
|
cellAlign,
|
|
322
387
|
cellRenderer,
|
|
323
388
|
editable: this.#resolveEditable(editable),
|
|
324
|
-
overviewToggle,
|
|
389
|
+
overviewToggle, // Předání příznaku dál
|
|
325
390
|
...restProps,
|
|
326
391
|
});
|
|
327
392
|
return this;
|
|
@@ -395,7 +460,6 @@ class ColumnBuilder {
|
|
|
395
460
|
}}
|
|
396
461
|
onClick={handleEditClick}
|
|
397
462
|
title="Upravit"
|
|
398
|
-
type="button"
|
|
399
463
|
>
|
|
400
464
|
<span style={{ fontSize: '16px' }}>⋮</span>
|
|
401
465
|
</button>
|
|
@@ -486,29 +550,58 @@ class ColumnBuilder {
|
|
|
486
550
|
const currentHoveredRowRef = React.useRef(null);
|
|
487
551
|
const mouseListenersSetupRef = React.useRef(false);
|
|
488
552
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
553
|
+
React.useEffect(() => {
|
|
554
|
+
return () => {
|
|
555
|
+
isMountedRef.current = false;
|
|
556
|
+
cleanup();
|
|
557
|
+
};
|
|
558
|
+
}, []);
|
|
492
559
|
|
|
493
|
-
|
|
494
|
-
|
|
560
|
+
// Cleanup funkce
|
|
561
|
+
const cleanup = () => {
|
|
562
|
+
if (observerRef.current) {
|
|
563
|
+
observerRef.current.disconnect();
|
|
564
|
+
observerRef.current = null;
|
|
495
565
|
}
|
|
496
566
|
|
|
497
|
-
if (
|
|
498
|
-
|
|
567
|
+
if (gridContainerRef.current && mouseListenersSetupRef.current) {
|
|
568
|
+
gridContainerRef.current.removeEventListener(
|
|
569
|
+
'mousemove',
|
|
570
|
+
handleMouseMove
|
|
571
|
+
);
|
|
572
|
+
gridContainerRef.current.removeEventListener(
|
|
573
|
+
'mouseleave',
|
|
574
|
+
handleMouseLeave
|
|
575
|
+
);
|
|
576
|
+
// gridContainerRef.current.removeEventListener(
|
|
577
|
+
// 'mouseenter',
|
|
578
|
+
// handleMouseEnter
|
|
579
|
+
// );
|
|
580
|
+
mouseListenersSetupRef.current = false;
|
|
499
581
|
}
|
|
500
|
-
}
|
|
582
|
+
};
|
|
501
583
|
|
|
502
|
-
//
|
|
584
|
+
// Získáme row index z params
|
|
585
|
+
React.useEffect(() => {
|
|
586
|
+
if (params.node && params.node.rowIndex !== undefined) {
|
|
587
|
+
rowIndexRef.current = params.node.rowIndex.toString();
|
|
588
|
+
} else if (params.rowIndex !== undefined) {
|
|
589
|
+
rowIndexRef.current = params.rowIndex.toString();
|
|
590
|
+
}
|
|
591
|
+
}, [params.node, params.rowIndex]);
|
|
592
|
+
|
|
593
|
+
// Mouse event handlers
|
|
503
594
|
const handleMouseMove = React.useCallback((event) => {
|
|
504
595
|
if (!isMountedRef.current) return;
|
|
505
596
|
|
|
506
|
-
const
|
|
597
|
+
const target = event.target;
|
|
507
598
|
if (!target) return;
|
|
508
599
|
|
|
509
|
-
|
|
600
|
+
// Najdeme nejbližší AG-Grid row element
|
|
601
|
+
let rowElement = target.closest('.ag-row');
|
|
510
602
|
|
|
511
603
|
if (rowElement) {
|
|
604
|
+
// Získáme row index z AG-Grid attributů
|
|
512
605
|
const rowIndex =
|
|
513
606
|
rowElement.getAttribute('row-index') ||
|
|
514
607
|
rowElement.getAttribute('aria-rowindex') ||
|
|
@@ -518,26 +611,34 @@ class ColumnBuilder {
|
|
|
518
611
|
if (rowIndex !== null) {
|
|
519
612
|
const normalizedRowIndex = rowIndex.toString();
|
|
520
613
|
|
|
614
|
+
// KLÍČOVÁ ZMĚNA: Explicitně resetujeme předchozí řádek při změně
|
|
521
615
|
if (normalizedRowIndex !== currentHoveredRowRef.current) {
|
|
616
|
+
// Pokud jsme měli předchozí řádek, nastavíme mu hover false
|
|
522
617
|
if (currentHoveredRowRef.current !== null) {
|
|
523
618
|
notifyRowHoverChange(currentHoveredRowRef.current, false);
|
|
524
619
|
}
|
|
525
620
|
|
|
621
|
+
// Nastavíme nový řádek jako hovered
|
|
526
622
|
currentHoveredRowRef.current = normalizedRowIndex;
|
|
527
623
|
notifyRowHoverChange(normalizedRowIndex, true);
|
|
528
624
|
}
|
|
529
625
|
}
|
|
530
|
-
} else
|
|
531
|
-
|
|
532
|
-
currentHoveredRowRef.current
|
|
626
|
+
} else {
|
|
627
|
+
// Myš není nad žádným řádkem - resetujeme všechny
|
|
628
|
+
if (currentHoveredRowRef.current !== null) {
|
|
629
|
+
notifyRowHoverChange(currentHoveredRowRef.current, false);
|
|
630
|
+
currentHoveredRowRef.current = null;
|
|
631
|
+
}
|
|
533
632
|
}
|
|
534
|
-
}, [
|
|
633
|
+
}, []);
|
|
535
634
|
|
|
536
635
|
const handleMouseLeave = React.useCallback((event) => {
|
|
537
636
|
if (!isMountedRef.current) return;
|
|
538
637
|
|
|
539
|
-
|
|
638
|
+
// Lepší detekce opuštění gridu
|
|
639
|
+
const relatedTarget = event.relatedTarget;
|
|
540
640
|
|
|
641
|
+
// Pokud myš opustí celý grid container NEBO jde mimo dokument
|
|
541
642
|
if (
|
|
542
643
|
gridContainerRef.current &&
|
|
543
644
|
(!relatedTarget || !gridContainerRef.current.contains(relatedTarget))
|
|
@@ -547,53 +648,31 @@ class ColumnBuilder {
|
|
|
547
648
|
currentHoveredRowRef.current = null;
|
|
548
649
|
}
|
|
549
650
|
}
|
|
550
|
-
}, [
|
|
651
|
+
}, []);
|
|
551
652
|
|
|
552
|
-
//
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
555
|
-
observerRef.current.disconnect();
|
|
556
|
-
observerRef.current = null;
|
|
557
|
-
}
|
|
653
|
+
// Notifikace o změně hover stavu pro tento specifický grid
|
|
654
|
+
const notifyRowHoverChange = (rowIndex, isHovered) => {
|
|
655
|
+
if (!isMountedRef.current) return;
|
|
558
656
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
handleMouseMove
|
|
563
|
-
);
|
|
564
|
-
gridContainerRef.current.removeEventListener(
|
|
565
|
-
'mouseleave',
|
|
566
|
-
handleMouseLeave
|
|
567
|
-
);
|
|
568
|
-
mouseListenersSetupRef.current = false;
|
|
657
|
+
// EXPLICITNÍ ŘÍZENÍ: Pokud nastavujeme hover false, resetujeme stav pro všechny řádky
|
|
658
|
+
if (!isHovered && rowIndexRef.current) {
|
|
659
|
+
setIsRowHovered(false);
|
|
569
660
|
}
|
|
570
|
-
}, [handleMouseMove, handleMouseLeave]);
|
|
571
661
|
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
cleanup();
|
|
576
|
-
};
|
|
577
|
-
}, [cleanup]);
|
|
578
|
-
|
|
579
|
-
// Získáme row index z params
|
|
580
|
-
React.useEffect(() => {
|
|
581
|
-
const { node, rowIndex } = params;
|
|
582
|
-
if (node && node.rowIndex !== undefined) {
|
|
583
|
-
rowIndexRef.current = node.rowIndex.toString();
|
|
584
|
-
} else if (rowIndex !== undefined) {
|
|
585
|
-
rowIndexRef.current = rowIndex.toString();
|
|
662
|
+
// Pokud je toto náš řádek a nastavujeme hover true, aktualizujeme stav
|
|
663
|
+
if (isHovered && rowIndexRef.current === rowIndex) {
|
|
664
|
+
setIsRowHovered(true);
|
|
586
665
|
}
|
|
587
|
-
}
|
|
666
|
+
};
|
|
588
667
|
|
|
589
668
|
// Nastavení observer pro tento konkrétní grid
|
|
590
669
|
const setupGridObserver = React.useCallback(() => {
|
|
591
|
-
|
|
592
|
-
if (!api || observerRef.current || !isMountedRef.current) return;
|
|
670
|
+
if (!params.api || observerRef.current || !isMountedRef.current) return;
|
|
593
671
|
|
|
672
|
+
// Najdeme grid container pro tento konkrétní grid instance
|
|
594
673
|
const findThisGridContainer = () => {
|
|
595
|
-
if (eGridCell) {
|
|
596
|
-
let current = eGridCell;
|
|
674
|
+
if (params.eGridCell) {
|
|
675
|
+
let current = params.eGridCell;
|
|
597
676
|
while (current && current !== document.body) {
|
|
598
677
|
if (
|
|
599
678
|
current.classList &&
|
|
@@ -616,12 +695,14 @@ class ColumnBuilder {
|
|
|
616
695
|
|
|
617
696
|
const gridContainer = findThisGridContainer();
|
|
618
697
|
if (!gridContainer) {
|
|
698
|
+
// Zkusíme znovu za chvíli
|
|
619
699
|
setTimeout(setupGridObserver, 100);
|
|
620
700
|
return;
|
|
621
701
|
}
|
|
622
702
|
|
|
623
703
|
gridContainerRef.current = gridContainer;
|
|
624
704
|
|
|
705
|
+
// Přidáme mouse event listenery pouze pokud ještě nejsou
|
|
625
706
|
if (!mouseListenersSetupRef.current) {
|
|
626
707
|
gridContainer.addEventListener('mousemove', handleMouseMove, {
|
|
627
708
|
passive: true,
|
|
@@ -630,8 +711,10 @@ class ColumnBuilder {
|
|
|
630
711
|
passive: true,
|
|
631
712
|
});
|
|
632
713
|
|
|
714
|
+
// DŮLEŽITÉ: Přidáme také mouseenter pro reset při vstupu do gridu
|
|
633
715
|
const handleMouseEnter = () => {
|
|
634
716
|
if (isMountedRef.current) {
|
|
717
|
+
// Reset stavu při vstupu do gridu
|
|
635
718
|
currentHoveredRowRef.current = null;
|
|
636
719
|
setIsRowHovered(false);
|
|
637
720
|
}
|
|
@@ -643,6 +726,7 @@ class ColumnBuilder {
|
|
|
643
726
|
mouseListenersSetupRef.current = true;
|
|
644
727
|
}
|
|
645
728
|
|
|
729
|
+
// Nastavíme MutationObserver pro tento grid
|
|
646
730
|
observerRef.current = new MutationObserver((mutations) => {
|
|
647
731
|
if (!isMountedRef.current) return;
|
|
648
732
|
|
|
@@ -671,9 +755,11 @@ class ColumnBuilder {
|
|
|
671
755
|
});
|
|
672
756
|
|
|
673
757
|
if (shouldRecalculate) {
|
|
758
|
+
// Reset hover stavu
|
|
674
759
|
currentHoveredRowRef.current = null;
|
|
675
760
|
setIsRowHovered(false);
|
|
676
761
|
|
|
762
|
+
// Znovu detekujeme aktuální pozici myši po krátké době
|
|
677
763
|
setTimeout(() => {
|
|
678
764
|
if (isMountedRef.current && gridContainerRef.current) {
|
|
679
765
|
const rect = gridContainerRef.current.getBoundingClientRect();
|
|
@@ -688,12 +774,14 @@ class ColumnBuilder {
|
|
|
688
774
|
}
|
|
689
775
|
});
|
|
690
776
|
|
|
777
|
+
// Spustíme observer na grid container
|
|
691
778
|
observerRef.current.observe(gridContainer, {
|
|
692
779
|
childList: true,
|
|
693
780
|
subtree: true,
|
|
694
781
|
attributes: false,
|
|
695
782
|
});
|
|
696
783
|
|
|
784
|
+
// Sledujeme pozici myši globálně pro tento observer
|
|
697
785
|
const trackMouse = (e) => {
|
|
698
786
|
window.lastMouseX = e.clientX;
|
|
699
787
|
window.lastMouseY = e.clientY;
|
|
@@ -701,13 +789,13 @@ class ColumnBuilder {
|
|
|
701
789
|
|
|
702
790
|
document.addEventListener('mousemove', trackMouse, { passive: true });
|
|
703
791
|
|
|
704
|
-
|
|
792
|
+
// Cleanup tracking při unmount
|
|
793
|
+
return () => {
|
|
705
794
|
document.removeEventListener('mousemove', trackMouse);
|
|
706
795
|
};
|
|
796
|
+
}, [params.api, params.eGridCell, handleMouseMove, handleMouseLeave]);
|
|
707
797
|
|
|
708
|
-
|
|
709
|
-
}, [params, handleMouseMove, handleMouseLeave]);
|
|
710
|
-
|
|
798
|
+
// Spustíme setup při mount a při změně params
|
|
711
799
|
React.useEffect(() => {
|
|
712
800
|
setupGridObserver();
|
|
713
801
|
}, [setupGridObserver]);
|
|
@@ -727,7 +815,7 @@ class ColumnBuilder {
|
|
|
727
815
|
setCurrentMenuItems(updatedMenuItems);
|
|
728
816
|
}
|
|
729
817
|
} catch (error) {
|
|
730
|
-
|
|
818
|
+
console.error('Chyba při volání onBeforeShow:', error);
|
|
731
819
|
if (isMountedRef.current) {
|
|
732
820
|
setCurrentMenuItems(menuItems);
|
|
733
821
|
}
|
|
@@ -738,14 +826,14 @@ class ColumnBuilder {
|
|
|
738
826
|
setIsDropdownVisible(visible);
|
|
739
827
|
}
|
|
740
828
|
},
|
|
741
|
-
[params]
|
|
829
|
+
[params, menuItems, onBeforeShow]
|
|
742
830
|
);
|
|
743
831
|
|
|
744
832
|
React.useEffect(() => {
|
|
745
833
|
if (isMountedRef.current) {
|
|
746
834
|
setCurrentMenuItems(menuItems);
|
|
747
835
|
}
|
|
748
|
-
}, []);
|
|
836
|
+
}, [menuItems]);
|
|
749
837
|
|
|
750
838
|
const menu = React.useMemo(
|
|
751
839
|
() => (
|
|
@@ -763,14 +851,13 @@ class ColumnBuilder {
|
|
|
763
851
|
return <Divider key={item.key} style={{ margin: '4px 0' }} />;
|
|
764
852
|
}
|
|
765
853
|
|
|
766
|
-
const { disable, disabled } = item;
|
|
767
854
|
let isDisabled = false;
|
|
768
|
-
if (typeof disable === 'function') {
|
|
769
|
-
isDisabled = disable(params);
|
|
770
|
-
} else if (typeof disable === 'boolean') {
|
|
771
|
-
isDisabled = disable;
|
|
772
|
-
} else if (disabled !== undefined) {
|
|
773
|
-
isDisabled = disabled;
|
|
855
|
+
if (typeof item.disable === 'function') {
|
|
856
|
+
isDisabled = item.disable(params);
|
|
857
|
+
} else if (typeof item.disable === 'boolean') {
|
|
858
|
+
isDisabled = item.disable;
|
|
859
|
+
} else if (item.disabled !== undefined) {
|
|
860
|
+
isDisabled = item.disabled;
|
|
774
861
|
}
|
|
775
862
|
|
|
776
863
|
return (
|
|
@@ -781,7 +868,7 @@ class ColumnBuilder {
|
|
|
781
868
|
})}
|
|
782
869
|
</Menu>
|
|
783
870
|
),
|
|
784
|
-
[currentMenuItems, params]
|
|
871
|
+
[currentMenuItems, onActionClick, params]
|
|
785
872
|
);
|
|
786
873
|
|
|
787
874
|
const containerStyle = {
|
|
@@ -810,17 +897,6 @@ class ColumnBuilder {
|
|
|
810
897
|
pointerEvents: isRowHovered || isDropdownVisible ? 'auto' : 'none',
|
|
811
898
|
};
|
|
812
899
|
|
|
813
|
-
const handleDropdownClick = React.useCallback((e) => {
|
|
814
|
-
e.stopPropagation();
|
|
815
|
-
}, []);
|
|
816
|
-
|
|
817
|
-
const handleKeyDown = React.useCallback((e) => {
|
|
818
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
819
|
-
e.preventDefault();
|
|
820
|
-
setIsDropdownVisible(!isDropdownVisible);
|
|
821
|
-
}
|
|
822
|
-
}, [isDropdownVisible]);
|
|
823
|
-
|
|
824
900
|
return (
|
|
825
901
|
<div style={containerStyle}>
|
|
826
902
|
<Dropdown
|
|
@@ -833,11 +909,9 @@ class ColumnBuilder {
|
|
|
833
909
|
>
|
|
834
910
|
<div
|
|
835
911
|
style={buttonStyle}
|
|
836
|
-
onClick={
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
tabIndex={0}
|
|
840
|
-
aria-label="Otevřít akční menu"
|
|
912
|
+
onClick={(e) => {
|
|
913
|
+
e.stopPropagation();
|
|
914
|
+
}}
|
|
841
915
|
>
|
|
842
916
|
<ActionIcon />
|
|
843
917
|
</div>
|
|
@@ -894,4 +968,5 @@ class ColumnBuilder {
|
|
|
894
968
|
}
|
|
895
969
|
}
|
|
896
970
|
|
|
897
|
-
export default ColumnBuilder;
|
|
971
|
+
export default ColumnBuilder;
|
|
972
|
+
/* eslint-enable */
|
package/dist/AgGridColumns.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import ColumnBuilder from './ColumnBuilder';
|
|
3
4
|
import * as Tooltip from './tooltips';
|
|
@@ -40,4 +41,5 @@ export const AgGridColumns = (columnDefs, options) => {
|
|
|
40
41
|
const cols = resolvedColumnDefs && resolvedColumnDefs.map((column) => AgGridColumn(column, options));
|
|
41
42
|
return cols;
|
|
42
43
|
};
|
|
44
|
+
/* eslint-enable */
|
|
43
45
|
//# sourceMappingURL=AgGridColumns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgGridColumns.js","sourceRoot":"","sources":["../AgGridColumns.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;CACb,CAAA;AAED,sCAAsC;AACtC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,EAAE;IACrC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAErE,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,EAAE;QACvC,QAAQ,cAAc,EAAE,CAAC;YACvB,KAAK,YAAY,CAAC,IAAI;gBACpB,OAAO,OAAO,CAAC,IAAI,CAAC;YACtB;gBACE,MAAM,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,CAAA;IAED,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;YAC/B,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;gBACpD,mBAAmB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,uBAAuB;YAC5D,CAAC;QACH,CAAC,CAAC;QAEF,aAA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