@linzjs/step-ag-grid 23.0.1 → 24.0.0
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/src/components/ComponentLoadingWrapper.d.ts +1 -1
- package/dist/src/components/Grid.d.ts +17 -17
- package/dist/src/components/GridCell.d.ts +9 -9
- package/dist/src/components/GridCellFiller.d.ts +2 -2
- package/dist/src/components/GridCellMultiEditor.d.ts +6 -6
- package/dist/src/components/GridCellMultiSelectClassRules.d.ts +1 -1
- package/dist/src/components/GridIcon.d.ts +2 -2
- package/dist/src/components/GridNoRowsOverlay.d.ts +1 -1
- package/dist/src/components/GridPopoverHook.d.ts +2 -2
- package/dist/src/components/GridWrapper.d.ts +1 -1
- package/dist/src/components/PostSortRowsHook.d.ts +1 -1
- package/dist/src/components/clickInputWhenContainingCellClicked.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterButtons.d.ts +5 -5
- package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterDownloadCsvButton.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterHeaderIconButton.d.ts +2 -2
- package/dist/src/components/gridFilter/GridFilters.d.ts +1 -1
- package/dist/src/components/gridFilter/index.d.ts +7 -7
- package/dist/src/components/gridFilter/useGridFilter.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +8 -8
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormMessage.d.ts +3 -3
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormMultiSelectGrid.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +5 -5
- package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +3 -3
- package/dist/src/components/gridForm/index.d.ts +10 -10
- package/dist/src/components/gridHeader/GridHeaderSelect.d.ts +1 -1
- package/dist/src/components/gridHeader/index.d.ts +1 -1
- package/dist/src/components/gridHook/index.d.ts +1 -1
- package/dist/src/components/gridHook/useGridContextMenu.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridButton.d.ts +5 -5
- package/dist/src/components/gridPopoverEdit/GridEditBoolean.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverMessage.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverTextArea.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverTextInput.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/index.d.ts +11 -11
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +5 -5
- package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +1 -1
- package/dist/src/components/gridRender/index.d.ts +2 -2
- package/dist/src/components/gridUtil.d.ts +1 -1
- package/dist/src/components/index.d.ts +19 -19
- package/dist/src/contexts/GridContext.d.ts +4 -4
- package/dist/src/contexts/GridContextProvider.d.ts +3 -3
- package/dist/src/contexts/GridPopoverContext.d.ts +3 -3
- package/dist/src/contexts/GridPopoverContextProvider.d.ts +4 -4
- package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
- package/dist/src/index.d.ts +17 -17
- package/dist/src/lui/ActionButton.d.ts +9 -9
- package/dist/src/lui/FormError.d.ts +2 -2
- package/dist/src/lui/TextAreaInput.d.ts +1 -1
- package/dist/src/lui/TextInputFormatted.d.ts +2 -2
- package/dist/src/lui/reactUtils.d.ts +1 -1
- package/dist/src/lui/stateDeferredHook.d.ts +1 -1
- package/dist/src/react-menu3/components/ControlledMenu.d.ts +2 -2
- package/dist/src/react-menu3/components/FocusableItem.d.ts +3 -3
- package/dist/src/react-menu3/components/Menu.d.ts +3 -3
- package/dist/src/react-menu3/components/MenuButton.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuDivider.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuGroup.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuHeader.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuItem.d.ts +3 -3
- package/dist/src/react-menu3/components/MenuList.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuRadioGroup.d.ts +2 -2
- package/dist/src/react-menu3/components/SubMenu.d.ts +5 -5
- package/dist/src/react-menu3/contexts/EventHandlersContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/MenuListContext.d.ts +2 -2
- package/dist/src/react-menu3/contexts/MenuListItemContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/RadioGroupContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/SettingsContext.d.ts +2 -2
- package/dist/src/react-menu3/hooks/index.d.ts +9 -9
- package/dist/src/react-menu3/hooks/useBEM.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useCombinedRef.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useIsomorphicLayoutEffect.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItemEffect.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItemState.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItems.d.ts +2 -2
- package/dist/src/react-menu3/hooks/useMenuChange.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useMenuState.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useMenuStateAndFocus.d.ts +1 -1
- package/dist/src/react-menu3/index.d.ts +11 -11
- package/dist/src/react-menu3/positionUtils/getPositionHelpers.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/index.d.ts +3 -3
- package/dist/src/react-menu3/positionUtils/placeArrowHorizontal.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/placeArrowVertical.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/placeLeftorRight.d.ts +4 -4
- package/dist/src/react-menu3/positionUtils/placeToporBottom.d.ts +5 -5
- package/dist/src/react-menu3/positionUtils/positionContextMenu.d.ts +2 -2
- package/dist/src/react-menu3/positionUtils/positionMenu.d.ts +5 -5
- package/dist/src/react-menu3/style-utils/index.d.ts +1 -1
- package/dist/src/react-menu3/types.d.ts +15 -15
- package/dist/src/react-menu3/utils/constants.d.ts +1 -1
- package/dist/src/react-menu3/utils/index.d.ts +3 -3
- package/dist/src/react-menu3/utils/utils.d.ts +5 -5
- package/dist/src/react-menu3/utils/withHovering.d.ts +1 -1
- package/dist/src/utils/testQuick.d.ts +2 -2
- package/dist/src/utils/testUtil.d.ts +2 -2
- package/dist/src/utils/textValidator.d.ts +2 -2
- package/dist/step-ag-grid.cjs.js +966 -952
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +968 -954
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +26 -41
- package/src/components/ComponentLoadingWrapper.tsx +5 -6
- package/src/components/Grid.tsx +85 -83
- package/src/components/GridCell.test.tsx +15 -15
- package/src/components/GridCell.tsx +46 -44
- package/src/components/GridCellFiller.tsx +5 -4
- package/src/components/GridCellMultiEditor.tsx +7 -7
- package/src/components/GridCellMultiSelectClassRules.tsx +3 -3
- package/src/components/GridIcon.tsx +6 -7
- package/src/components/GridLoadableCell.tsx +2 -2
- package/src/components/GridNoRowsOverlay.tsx +8 -8
- package/src/components/GridPopoverHook.tsx +16 -16
- package/src/components/GridWrapper.tsx +2 -2
- package/src/components/PostSortRowsHook.ts +11 -11
- package/src/components/clickInputWhenContainingCellClicked.tsx +5 -5
- package/src/components/gridFilter/GridFilterButtons.tsx +8 -9
- package/src/components/gridFilter/GridFilterColumnsToggle.tsx +25 -26
- package/src/components/gridFilter/GridFilterDownloadCsvButton.tsx +12 -13
- package/src/components/gridFilter/GridFilterHeaderIconButton.tsx +9 -10
- package/src/components/gridFilter/GridFilterQuick.tsx +6 -6
- package/src/components/gridFilter/GridFilters.tsx +1 -1
- package/src/components/gridFilter/index.ts +7 -7
- package/src/components/gridFilter/useGridFilter.ts +3 -3
- package/src/components/gridForm/GridFormDropDown.tsx +56 -52
- package/src/components/gridForm/GridFormEditBearing.tsx +12 -12
- package/src/components/gridForm/GridFormMessage.tsx +10 -10
- package/src/components/gridForm/GridFormMultiSelect.tsx +53 -51
- package/src/components/gridForm/GridFormMultiSelectGrid.tsx +25 -26
- package/src/components/gridForm/GridFormPopoverMenu.tsx +32 -29
- package/src/components/gridForm/GridFormSubComponentTextArea.tsx +10 -10
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +8 -8
- package/src/components/gridForm/GridFormTextArea.tsx +11 -11
- package/src/components/gridForm/GridFormTextInput.tsx +11 -11
- package/src/components/gridForm/index.ts +10 -10
- package/src/components/gridHeader/GridHeaderSelect.tsx +9 -9
- package/src/components/gridHeader/index.ts +1 -1
- package/src/components/gridHook/index.ts +1 -1
- package/src/components/gridHook/useGridContextMenu.tsx +7 -7
- package/src/components/gridPopoverEdit/GridButton.tsx +13 -12
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +19 -18
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +7 -6
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.ts +7 -6
- package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +9 -9
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +8 -7
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +6 -6
- package/src/components/gridPopoverEdit/GridPopoverMessage.ts +4 -4
- package/src/components/gridPopoverEdit/GridPopoverTextArea.ts +4 -4
- package/src/components/gridPopoverEdit/GridPopoverTextInput.ts +4 -4
- package/src/components/gridPopoverEdit/index.ts +11 -11
- package/src/components/gridRender/GridRenderGenericCell.tsx +5 -5
- package/src/components/gridRender/GridRenderPopoutMenuCell.tsx +8 -9
- package/src/components/gridRender/index.ts +2 -2
- package/src/components/gridUtil.ts +3 -3
- package/src/components/index.ts +19 -19
- package/src/contexts/GridContext.tsx +52 -46
- package/src/contexts/GridContextProvider.test.tsx +14 -14
- package/src/contexts/GridContextProvider.tsx +42 -41
- package/src/contexts/GridPopoverContext.tsx +10 -7
- package/src/contexts/GridPopoverContextProvider.tsx +12 -10
- package/src/contexts/GridSubComponentContext.ts +6 -5
- package/src/contexts/GridUpdatingContext.tsx +5 -4
- package/src/contexts/GridUpdatingContextProvider.tsx +3 -3
- package/src/index.ts +17 -21
- package/src/lui/ActionButton.tsx +42 -41
- package/src/lui/FormError.tsx +4 -4
- package/src/lui/TextAreaInput.tsx +9 -9
- package/src/lui/TextInputFormatted.tsx +11 -11
- package/src/lui/reactUtils.test.tsx +8 -8
- package/src/lui/reactUtils.tsx +2 -2
- package/src/lui/stateDeferredHook.tsx +3 -5
- package/src/lui/timeoutHook.test.tsx +5 -5
- package/src/lui/timeoutHook.tsx +1 -1
- package/src/react-app-env.d.ts +1 -1
- package/src/react-menu3/components/ControlledMenu.tsx +48 -48
- package/src/react-menu3/components/FocusableItem.tsx +7 -7
- package/src/react-menu3/components/Menu.tsx +11 -11
- package/src/react-menu3/components/MenuButton.tsx +4 -4
- package/src/react-menu3/components/MenuDivider.tsx +4 -4
- package/src/react-menu3/components/MenuGroup.tsx +5 -5
- package/src/react-menu3/components/MenuHeader.tsx +4 -4
- package/src/react-menu3/components/MenuItem.tsx +14 -14
- package/src/react-menu3/components/MenuList.tsx +55 -55
- package/src/react-menu3/components/MenuRadioGroup.tsx +7 -7
- package/src/react-menu3/components/SubMenu.tsx +24 -24
- package/src/react-menu3/contexts/EventHandlersContext.ts +2 -2
- package/src/react-menu3/contexts/HoverItemContext.ts +1 -1
- package/src/react-menu3/contexts/ItemSettingsContext.ts +1 -1
- package/src/react-menu3/contexts/MenuListContext.ts +2 -2
- package/src/react-menu3/contexts/MenuListItemContext.ts +2 -2
- package/src/react-menu3/contexts/RadioGroupContext.ts +2 -2
- package/src/react-menu3/contexts/SettingsContext.ts +2 -2
- package/src/react-menu3/hooks/index.ts +9 -9
- package/src/react-menu3/hooks/useBEM.ts +4 -4
- package/src/react-menu3/hooks/useCombinedRef.ts +2 -2
- package/src/react-menu3/hooks/useIsomorphicLayoutEffect.ts +4 -4
- package/src/react-menu3/hooks/useItemEffect.ts +3 -3
- package/src/react-menu3/hooks/useItemState.ts +5 -5
- package/src/react-menu3/hooks/useItems.ts +8 -8
- package/src/react-menu3/hooks/useMenuChange.ts +3 -3
- package/src/react-menu3/hooks/useMenuState.ts +5 -5
- package/src/react-menu3/hooks/useMenuStateAndFocus.ts +4 -4
- package/src/react-menu3/index.ts +11 -11
- package/src/react-menu3/positionUtils/getPositionHelpers.ts +2 -2
- package/src/react-menu3/positionUtils/index.ts +3 -3
- package/src/react-menu3/positionUtils/placeArrowHorizontal.ts +1 -1
- package/src/react-menu3/positionUtils/placeArrowVertical.ts +1 -1
- package/src/react-menu3/positionUtils/placeLeftorRight.ts +13 -13
- package/src/react-menu3/positionUtils/placeToporBottom.ts +15 -15
- package/src/react-menu3/positionUtils/positionContextMenu.ts +4 -4
- package/src/react-menu3/positionUtils/positionMenu.ts +14 -14
- package/src/react-menu3/style-utils/index.ts +24 -24
- package/src/react-menu3/types.ts +15 -15
- package/src/react-menu3/utils/constants.ts +33 -33
- package/src/react-menu3/utils/index.ts +3 -4
- package/src/react-menu3/utils/propTypes2.ts +10 -10
- package/src/react-menu3/utils/utils.ts +14 -14
- package/src/react-menu3/utils/withHovering.tsx +3 -3
- package/src/stories/components/ActionButton.stories.tsx +23 -24
- package/src/stories/grid/FormTest.tsx +15 -16
- package/src/stories/grid/GridDragRow.stories.tsx +33 -34
- package/src/stories/grid/GridFilterButtons.stories.tsx +32 -33
- package/src/stories/grid/GridNoRowsOverlay.stories.tsx +9 -10
- package/src/stories/grid/GridNonEditableRow.stories.tsx +40 -41
- package/src/stories/grid/GridPinnedRow.stories.tsx +25 -26
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +33 -32
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +21 -22
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +18 -19
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +50 -49
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +25 -26
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +93 -94
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +62 -63
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +28 -28
- package/src/stories/grid/GridReadOnly.stories.tsx +66 -67
- package/src/stories/grid/GridViewList.stories.tsx +37 -38
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +37 -38
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +25 -26
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +25 -26
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +31 -31
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +47 -48
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +44 -45
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +19 -20
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +21 -22
- package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +40 -41
- package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +14 -15
- package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +14 -15
- package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +10 -11
- package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +20 -21
- package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +16 -17
- package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +13 -14
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +13 -14
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +68 -71
- package/src/stories/react-menu/ReactMenu.stories.tsx +26 -26
- package/src/utils/bearing.test.ts +44 -44
- package/src/utils/bearing.ts +20 -20
- package/src/utils/deferredPromise.ts +1 -1
- package/src/utils/storybookTestUtil.ts +2 -2
- package/src/utils/testQuick.ts +15 -14
- package/src/utils/testUtil.ts +31 -36
- package/src/utils/textMatcher.test.ts +9 -9
- package/src/utils/textMatcher.ts +8 -8
- package/src/utils/textValidator.test.ts +56 -56
- package/src/utils/textValidator.ts +11 -11
- package/src/utils/util.test.ts +20 -20
- package/src/utils/util.ts +7 -7
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ColDef, ICellEditorParams, ICellRendererParams } from
|
|
1
|
+
import { ColDef, ICellEditorParams, ICellRendererParams } from 'ag-grid-community';
|
|
2
2
|
import {
|
|
3
|
+
EditableCallbackParams,
|
|
3
4
|
SuppressKeyboardEventParams,
|
|
4
5
|
ValueFormatterFunc,
|
|
5
6
|
ValueFormatterParams,
|
|
6
7
|
ValueGetterFunc,
|
|
7
8
|
ValueGetterParams,
|
|
8
|
-
|
|
9
|
-
} from
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { GenericCellColDef, GenericCellRendererParams } from "./gridRender";
|
|
9
|
+
} from 'ag-grid-community';
|
|
10
|
+
import { forwardRef, ReactElement, useContext } from 'react';
|
|
11
|
+
|
|
12
|
+
import { GridPopoverContextProvider } from '../contexts/GridPopoverContextProvider';
|
|
13
|
+
import { GridUpdatingContext } from '../contexts/GridUpdatingContext';
|
|
14
|
+
import { fnOrVar } from '../utils/util';
|
|
15
|
+
import { GridBaseRow } from './Grid';
|
|
16
|
+
import { GridCellMultiSelectClassRules } from './GridCellMultiSelectClassRules';
|
|
17
|
+
import { GridIcon } from './GridIcon';
|
|
18
|
+
import { GridLoadableCell } from './GridLoadableCell';
|
|
19
|
+
import { GenericCellColDef, GenericCellRendererParams } from './gridRender';
|
|
20
20
|
|
|
21
21
|
export interface GenericCellEditorProps<E> {
|
|
22
22
|
multiEdit?: boolean;
|
|
@@ -25,7 +25,7 @@ export interface GenericCellEditorProps<E> {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface SAICellRendererParams<TData = any, TValue = any, TContext = any>
|
|
28
|
-
extends Omit<ICellRendererParams<TData, TValue, TContext>,
|
|
28
|
+
extends Omit<ICellRendererParams<TData, TValue, TContext>, 'data'> {
|
|
29
29
|
data: TData;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -38,18 +38,18 @@ export const GridCellRenderer = (props: ICellRendererParams) => {
|
|
|
38
38
|
let warningText = props.data !== undefined && warningFn ? warningFn(props) : undefined;
|
|
39
39
|
const infoFn = rendererParams?.info;
|
|
40
40
|
let infoText = props.data !== undefined && infoFn ? infoFn(props) : undefined;
|
|
41
|
-
if (Array.isArray(warningText)) warningText = warningText.join(
|
|
42
|
-
if (Array.isArray(infoText)) infoText = infoText.join(
|
|
41
|
+
if (Array.isArray(warningText)) warningText = warningText.join('\n');
|
|
42
|
+
if (Array.isArray(infoText)) infoText = infoText.join('\n');
|
|
43
43
|
|
|
44
|
-
return checkUpdating(colDef.field ?? colDef.colId ??
|
|
44
|
+
return checkUpdating(colDef.field ?? colDef.colId ?? '', props.data.id) ? (
|
|
45
45
|
<GridLoadableCell />
|
|
46
46
|
) : (
|
|
47
47
|
<>
|
|
48
48
|
{!!warningText && (
|
|
49
|
-
<GridIcon icon={
|
|
49
|
+
<GridIcon icon={'ic_warning_outline'} title={typeof warningText === 'string' ? warningText : 'Warning'} />
|
|
50
50
|
)}
|
|
51
|
-
{!!infoText && <GridIcon icon={
|
|
52
|
-
<div className={
|
|
51
|
+
{!!infoText && <GridIcon icon={'ic_info_outline'} title={typeof infoText === 'string' ? infoText : 'Info'} />}
|
|
52
|
+
<div className={'GridCell-container'}>
|
|
53
53
|
{colDef.cellRendererParams?.originalCellRenderer ? (
|
|
54
54
|
<colDef.cellRendererParams.originalCellRenderer {...props} />
|
|
55
55
|
) : (
|
|
@@ -57,13 +57,13 @@ export const GridCellRenderer = (props: ICellRendererParams) => {
|
|
|
57
57
|
)}
|
|
58
58
|
</div>
|
|
59
59
|
{fnOrVar(colDef.editable, props) && rendererParams?.rightHoverElement && (
|
|
60
|
-
<div className={
|
|
60
|
+
<div className={'GridCell-hoverRight'}>{rendererParams?.rightHoverElement}</div>
|
|
61
61
|
)}
|
|
62
62
|
</>
|
|
63
63
|
);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
export interface SAValueGetterParams<TData = any, TValue = any> extends Omit<ValueGetterParams<TData, TValue>,
|
|
66
|
+
export interface SAValueGetterParams<TData = any, TValue = any> extends Omit<ValueGetterParams<TData, TValue>, 'data'> {
|
|
67
67
|
data: TData;
|
|
68
68
|
getValue: (field: string) => any;
|
|
69
69
|
}
|
|
@@ -73,7 +73,7 @@ export interface SAValueGetterFunc<TData = any, TValue = any> {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export interface SAEditableCallbackParams<TData = any, TValue = any>
|
|
76
|
-
extends Omit<EditableCallbackParams<TData, TValue>,
|
|
76
|
+
extends Omit<EditableCallbackParams<TData, TValue>, 'data'> {
|
|
77
77
|
data: TData;
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -82,7 +82,7 @@ export interface SAEditableCallback<TData = any, TValue = any> {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
export interface SAValueFormatterParams<TData = any, TValue = any>
|
|
85
|
-
extends Omit<ValueFormatterParams<TData, TValue>,
|
|
85
|
+
extends Omit<ValueFormatterParams<TData, TValue>, 'data' | 'value'> {
|
|
86
86
|
data: TData;
|
|
87
87
|
value: TValue;
|
|
88
88
|
}
|
|
@@ -92,7 +92,7 @@ export interface SAValueFormatterFunc<TData = any, TValue = any> {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// This is so that typescript retains the row type to pass to the GridCells
|
|
95
|
-
// @ts-
|
|
95
|
+
// @ts-expect-error types
|
|
96
96
|
export interface ColDefT<TData extends GridBaseRow, ValueType = any> extends ColDef<TData, ValueType> {
|
|
97
97
|
_?: TData;
|
|
98
98
|
editable?: boolean | SAEditableCallback<TData, ValueType>;
|
|
@@ -116,13 +116,13 @@ export interface ColDefT<TData extends GridBaseRow, ValueType = any> extends Col
|
|
|
116
116
|
export const suppressCellKeyboardEvents = (e: SuppressKeyboardEventParams) => {
|
|
117
117
|
const shortcutKeys = e.colDef.cellRendererParams?.shortcutKeys ?? {};
|
|
118
118
|
const exec = shortcutKeys[e.event.key];
|
|
119
|
-
if (exec && !e.editing && !e.event.repeat && e.event.type ===
|
|
119
|
+
if (exec && !e.editing && !e.event.repeat && e.event.type === 'keydown') {
|
|
120
120
|
const editable = fnOrVar(e.colDef?.editable, e);
|
|
121
121
|
return editable ? (exec(e) ?? true) : true;
|
|
122
122
|
}
|
|
123
123
|
// It's important that aggrid doesn't trigger edit on enter
|
|
124
124
|
// as the incorrect selected rows will be returned
|
|
125
|
-
return ![
|
|
125
|
+
return !['ArrowLeft', 'ArrowRight', 'ArrowDown', 'ArrowUp', 'Tab', ' ', 'Home', 'End', 'PageUp', 'PageDown'].includes(
|
|
126
126
|
e.event.key,
|
|
127
127
|
);
|
|
128
128
|
};
|
|
@@ -134,17 +134,17 @@ export const generateFilterGetter = <TData extends GridBaseRow, ValueType>(
|
|
|
134
134
|
): string | SAValueGetterFunc<TData, ValueType> | undefined => {
|
|
135
135
|
if (filterValueGetter) return filterValueGetter;
|
|
136
136
|
// aggrid will default to valueGetter
|
|
137
|
-
if (typeof valueFormatter !==
|
|
137
|
+
if (typeof valueFormatter !== 'function' || !field) return undefined;
|
|
138
138
|
|
|
139
139
|
return (params: ValueGetterParams<TData, ValueType>): any => {
|
|
140
140
|
const value = params.getValue(field);
|
|
141
141
|
let formattedValue = valueFormatter({ ...params, value });
|
|
142
142
|
// Search for null values using standard dash
|
|
143
|
-
if (formattedValue ===
|
|
143
|
+
if (formattedValue === '–') formattedValue += ' -';
|
|
144
144
|
// Search by raw value as well as formatted
|
|
145
|
-
const gotValue = [
|
|
146
|
-
return (formattedValue + (gotValue != null && formattedValue != gotValue ?
|
|
147
|
-
.replace(/\s+/g,
|
|
145
|
+
const gotValue = ['string', 'number'].includes(typeof value) ? value : undefined;
|
|
146
|
+
return (formattedValue + (gotValue != null && formattedValue != gotValue ? ' ' + gotValue : '')) //
|
|
147
|
+
.replace(/\s+/g, ' ')
|
|
148
148
|
.trim();
|
|
149
149
|
};
|
|
150
150
|
};
|
|
@@ -196,13 +196,13 @@ export const GridCell = <TData extends GridBaseRow, TValue = any, Props extends
|
|
|
196
196
|
filterValueGetter: filterValueGetter as any,
|
|
197
197
|
// Default value formatter, otherwise react freaks out on objects
|
|
198
198
|
valueFormatter: (params: ValueFormatterParams) => {
|
|
199
|
-
if (params.value == null) return
|
|
200
|
-
const types = [
|
|
199
|
+
if (params.value == null) return '–';
|
|
200
|
+
const types = ['number', 'boolean', 'string'];
|
|
201
201
|
if (types.includes(typeof params.value)) return `${params.value}`;
|
|
202
202
|
else return JSON.stringify(params.value);
|
|
203
203
|
},
|
|
204
204
|
...props,
|
|
205
|
-
cellRenderer: typeof props.cellRenderer ===
|
|
205
|
+
cellRenderer: typeof props.cellRenderer === 'string' ? props.cellRenderer : GridCellRenderer,
|
|
206
206
|
cellRendererParams: {
|
|
207
207
|
originalCellRenderer: props.cellRenderer,
|
|
208
208
|
...props.cellRendererParams,
|
|
@@ -223,17 +223,19 @@ export const GenericCellEditorComponentWrapper = (editor?: (props: any) => React
|
|
|
223
223
|
return forwardRef(function GenericCellEditorComponentFr(cellEditorParams: ICellEditorParams, _) {
|
|
224
224
|
const valueFormatted = cellEditorParams.formatValue
|
|
225
225
|
? cellEditorParams.formatValue(cellEditorParams.value)
|
|
226
|
-
:
|
|
226
|
+
: 'Missing formatter';
|
|
227
227
|
return (
|
|
228
228
|
<GridPopoverContextProvider props={cellEditorParams}>
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
229
|
+
<>
|
|
230
|
+
{
|
|
231
|
+
<cellEditorParams.colDef.cellRenderer
|
|
232
|
+
{...cellEditorParams}
|
|
233
|
+
valueFormatted={valueFormatted}
|
|
234
|
+
{...cellEditorParams.colDef.cellRendererParams}
|
|
235
|
+
/>
|
|
236
|
+
}
|
|
237
|
+
{obj.editor && <obj.editor {...cellEditorParams} />}
|
|
238
|
+
</>
|
|
237
239
|
</GridPopoverContextProvider>
|
|
238
240
|
);
|
|
239
241
|
});
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ColDef } from
|
|
2
|
-
import { GridBaseRow } from "./Grid";
|
|
1
|
+
import { ColDef } from 'ag-grid-community';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
import { GridBaseRow } from './Grid';
|
|
4
|
+
|
|
5
|
+
export const GridCellFillerColId = 'gridCellFiller';
|
|
5
6
|
|
|
6
7
|
export const isGridCellFiller = (col: ColDef) => col.colId === GridCellFillerColId;
|
|
7
8
|
|
|
8
9
|
export const GridCellFiller = <TData extends GridBaseRow>(): ColDef<TData, any> => ({
|
|
9
10
|
colId: GridCellFillerColId,
|
|
10
|
-
headerName:
|
|
11
|
+
headerName: '',
|
|
11
12
|
flex: 1,
|
|
12
13
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CellEditorSelectorResult } from
|
|
2
|
-
import { ICellEditorParams } from
|
|
3
|
-
import { ComponentProps, ReactElement } from
|
|
1
|
+
import { CellEditorSelectorResult } from 'ag-grid-community';
|
|
2
|
+
import { ICellEditorParams } from 'ag-grid-community';
|
|
3
|
+
import { ComponentProps, ReactElement } from 'react';
|
|
4
4
|
|
|
5
|
-
import { GridBaseRow } from
|
|
6
|
-
import { ColDefT, GenericCellEditorComponentWrapper, GridCell } from
|
|
7
|
-
import { GridCellMultiSelectClassRules } from
|
|
8
|
-
import { GenericCellColDef } from
|
|
5
|
+
import { GridBaseRow } from './Grid';
|
|
6
|
+
import { ColDefT, GenericCellEditorComponentWrapper, GridCell } from './GridCell';
|
|
7
|
+
import { GridCellMultiSelectClassRules } from './GridCellMultiSelectClassRules';
|
|
8
|
+
import { GenericCellColDef } from './gridRender';
|
|
9
9
|
|
|
10
10
|
export const Editor = <FN extends (param: any) => ReactElement>(props: {
|
|
11
11
|
multiEdit: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CellClassParams, CellClassRules } from
|
|
2
|
-
import { ICellEditorParams } from
|
|
1
|
+
import { CellClassParams, CellClassRules } from 'ag-grid-community';
|
|
2
|
+
import { ICellEditorParams } from 'ag-grid-community';
|
|
3
3
|
|
|
4
4
|
export const GridCellMultiSelectClassRules: CellClassRules = {
|
|
5
|
-
|
|
5
|
+
'ag-selected-for-edit': (params: CellClassParams) => {
|
|
6
6
|
const { api, node, colDef } = params;
|
|
7
7
|
const cep = colDef.cellEditorSelector
|
|
8
8
|
? colDef.cellEditorSelector(params as ICellEditorParams)?.params
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import { IconName, IconSize } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
|
|
1
|
+
import { LuiIcon } from '@linzjs/lui';
|
|
2
|
+
import { IconName, IconSize } from '@linzjs/lui/dist/components/LuiIcon/LuiIcon';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { ReactElement } from 'react';
|
|
6
5
|
|
|
7
6
|
export const GridIcon = (props: {
|
|
8
7
|
icon: IconName;
|
|
@@ -15,11 +14,11 @@ export const GridIcon = (props: {
|
|
|
15
14
|
name={props.icon}
|
|
16
15
|
title={props.title}
|
|
17
16
|
alt={props.title}
|
|
18
|
-
size={props.size ??
|
|
17
|
+
size={props.size ?? 'md'}
|
|
19
18
|
className={clsx(
|
|
20
19
|
`AgGridGenericCellRenderer-${props.icon}Icon`,
|
|
21
20
|
props.className,
|
|
22
|
-
props.disabled &&
|
|
21
|
+
props.disabled && 'GridIcon-disabled',
|
|
23
22
|
)}
|
|
24
23
|
/>
|
|
25
24
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LuiMiniSpinner } from
|
|
1
|
+
import { LuiMiniSpinner } from '@linzjs/lui';
|
|
2
2
|
|
|
3
3
|
export const GridLoadableCell = () => (
|
|
4
4
|
<LuiMiniSpinner
|
|
5
5
|
size={22}
|
|
6
|
-
divProps={{ className:
|
|
6
|
+
divProps={{ className: 'GridLoadableCell-container', role: 'status', 'aria-label': 'Loading' }}
|
|
7
7
|
/>
|
|
8
8
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LuiStatusSpinner } from
|
|
2
|
-
import { ForwardedRef, forwardRef } from
|
|
1
|
+
import { LuiStatusSpinner } from '@linzjs/lui';
|
|
2
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
3
3
|
|
|
4
4
|
const GridLoadingOverlayComponentFr = (
|
|
5
5
|
props: { headerRowHeight: number },
|
|
@@ -12,12 +12,12 @@ const GridLoadingOverlayComponentFr = (
|
|
|
12
12
|
top: 0,
|
|
13
13
|
bottom: 0,
|
|
14
14
|
right: 0,
|
|
15
|
-
position:
|
|
16
|
-
backgroundColor:
|
|
15
|
+
position: 'absolute',
|
|
16
|
+
backgroundColor: 'rgba(255,255,255,0.5)',
|
|
17
17
|
}}
|
|
18
18
|
>
|
|
19
|
-
<div style={{ height:
|
|
20
|
-
<div style={{ position:
|
|
19
|
+
<div style={{ height: '100%', position: 'relative' }}>
|
|
20
|
+
<div style={{ position: 'absolute', left: 0, top: props.headerRowHeight, right: 0, bottom: 0 }}>
|
|
21
21
|
<LuiStatusSpinner />
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
@@ -40,10 +40,10 @@ export const GridNoRowsOverlayFr = (props: GridNoRowsOverlayProps, externalRef:
|
|
|
40
40
|
return <GridLoadingOverlayComponent ref={externalRef} headerRowHeight={props.headerRowHeight} />;
|
|
41
41
|
}
|
|
42
42
|
if (props.rowCount === 0) {
|
|
43
|
-
return <div ref={externalRef}>{props.noRowsOverlayText ??
|
|
43
|
+
return <div ref={externalRef}>{props.noRowsOverlayText ?? 'There are currently no rows'}</div>;
|
|
44
44
|
}
|
|
45
45
|
if (props.filteredRowCount === 0) {
|
|
46
|
-
return <div ref={externalRef}>{props.noRowsMatchingOverlayText ??
|
|
46
|
+
return <div ref={externalRef}>{props.noRowsMatchingOverlayText ?? 'All rows have been filtered'}</div>;
|
|
47
47
|
}
|
|
48
48
|
return <div ref={externalRef} />;
|
|
49
49
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ReactElement, useCallback, useContext, useEffect, useRef, useState } from
|
|
1
|
+
import { ReactElement, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { GridContext } from
|
|
4
|
-
import { useGridPopoverContext } from
|
|
5
|
-
import { ControlledMenu } from
|
|
6
|
-
import { MenuCloseEvent } from
|
|
7
|
-
import { CloseReason } from
|
|
8
|
-
import { GridBaseRow } from
|
|
3
|
+
import { GridContext } from '../contexts/GridContext';
|
|
4
|
+
import { useGridPopoverContext } from '../contexts/GridPopoverContext';
|
|
5
|
+
import { ControlledMenu } from '../react-menu3';
|
|
6
|
+
import { MenuCloseEvent } from '../react-menu3/types';
|
|
7
|
+
import { CloseReason } from '../react-menu3/utils';
|
|
8
|
+
import { GridBaseRow } from './Grid';
|
|
9
9
|
|
|
10
10
|
export interface GridPopoverHookProps<TData> {
|
|
11
11
|
className: string | undefined;
|
|
@@ -64,36 +64,36 @@ export const useGridPopoverHook = <TData extends GridBaseRow>(props: GridPopover
|
|
|
64
64
|
<>
|
|
65
65
|
{anchorRef.current && (
|
|
66
66
|
<ControlledMenu
|
|
67
|
-
state={isOpen ?
|
|
67
|
+
state={isOpen ? 'open' : 'closed'}
|
|
68
68
|
portal={true}
|
|
69
69
|
unmountOnClose={true}
|
|
70
70
|
anchorRef={anchorRef}
|
|
71
71
|
saveButtonRef={saveButtonRef}
|
|
72
|
-
menuClassName={
|
|
72
|
+
menuClassName={'step-ag-grid-react-menu'}
|
|
73
73
|
onClose={(event: MenuCloseEvent) => {
|
|
74
74
|
// Prevent menu from closing when modals are invoked
|
|
75
75
|
if (event.reason === CloseReason.BLUR) return;
|
|
76
|
-
triggerSave(event.reason)
|
|
76
|
+
void triggerSave(event.reason);
|
|
77
77
|
}}
|
|
78
|
-
viewScroll={
|
|
78
|
+
viewScroll={'auto'}
|
|
79
79
|
dontShrinkIfDirectionIsTop={true}
|
|
80
80
|
className={props.className}
|
|
81
81
|
>
|
|
82
82
|
{saving && ( // This is the overlay that prevents editing when the editor is saving
|
|
83
|
-
<div className={
|
|
83
|
+
<div className={'ComponentLoadingWrapper-saveOverlay'} />
|
|
84
84
|
)}
|
|
85
85
|
{children}
|
|
86
86
|
<button
|
|
87
87
|
ref={saveButtonRef}
|
|
88
|
-
data-reason={
|
|
88
|
+
data-reason={''}
|
|
89
89
|
onClick={(e) => {
|
|
90
|
-
let reason = e.currentTarget.getAttribute(
|
|
90
|
+
let reason = e.currentTarget.getAttribute('data-reason') ?? undefined;
|
|
91
91
|
if (props.dontSaveOnExternalClick && reason === CloseReason.BLUR) {
|
|
92
92
|
reason = CloseReason.CANCEL;
|
|
93
93
|
}
|
|
94
|
-
triggerSave(reason)
|
|
94
|
+
void triggerSave(reason);
|
|
95
95
|
}}
|
|
96
|
-
style={{ display:
|
|
96
|
+
style={{ display: 'none' }}
|
|
97
97
|
/>
|
|
98
98
|
</ControlledMenu>
|
|
99
99
|
)}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { PropsWithChildren } from
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface GridWrapperProps {
|
|
4
4
|
maxHeight?: number | string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export const GridWrapper = ({ children, maxHeight }: PropsWithChildren<GridWrapperProps>) => (
|
|
8
|
-
<div className={
|
|
8
|
+
<div className={'Grid-wrapper'} style={{ maxHeight }}>
|
|
9
9
|
{children}
|
|
10
10
|
</div>
|
|
11
11
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IRowNode } from
|
|
2
|
-
import { ColumnState } from
|
|
3
|
-
import { PostSortRowsParams } from
|
|
4
|
-
import { isEmpty } from
|
|
5
|
-
import { useCallback, useContext, useRef } from
|
|
1
|
+
import { IRowNode } from 'ag-grid-community';
|
|
2
|
+
import { ColumnState } from 'ag-grid-community';
|
|
3
|
+
import { PostSortRowsParams } from 'ag-grid-community';
|
|
4
|
+
import { isEmpty } from 'lodash-es';
|
|
5
|
+
import { useCallback, useContext, useRef } from 'react';
|
|
6
6
|
|
|
7
|
-
import { GridContext } from
|
|
7
|
+
import { GridContext } from '../contexts/GridContext';
|
|
8
8
|
|
|
9
9
|
interface PostSortRowsHookProps {
|
|
10
10
|
setStaleGrid: (stale: boolean) => void;
|
|
@@ -22,7 +22,7 @@ export const usePostSortRowsHook = ({ setStaleGrid }: PostSortRowsHookProps) =>
|
|
|
22
22
|
const initialised = useRef(false);
|
|
23
23
|
|
|
24
24
|
// Used to detect sort order has changed since last run
|
|
25
|
-
const lastSortOrderHash = useRef<string>(
|
|
25
|
+
const lastSortOrderHash = useRef<string>('');
|
|
26
26
|
|
|
27
27
|
// Used to detect if sort order was the same, has the direction changed
|
|
28
28
|
const previousRowSortIndexRef = useRef<Record<string, { index: number; hash: string } | undefined>>({});
|
|
@@ -35,7 +35,7 @@ export const usePostSortRowsHook = ({ setStaleGrid }: PostSortRowsHookProps) =>
|
|
|
35
35
|
// As a sort on a stale row should just resort, not change sort direction
|
|
36
36
|
const previousColSort = useRef<ColumnState[]>([]);
|
|
37
37
|
|
|
38
|
-
const previousQuickFilter = useRef(
|
|
38
|
+
const previousQuickFilter = useRef('');
|
|
39
39
|
|
|
40
40
|
return useCallback(
|
|
41
41
|
({ api, nodes }: PostSortRowsParams) => {
|
|
@@ -45,7 +45,7 @@ export const usePostSortRowsHook = ({ setStaleGrid }: PostSortRowsHookProps) =>
|
|
|
45
45
|
const previousRowSortIndex = previousRowSortIndexRef.current;
|
|
46
46
|
|
|
47
47
|
const hashNode = (node: IRowNode | undefined) => {
|
|
48
|
-
return node ? JSON.stringify(node.data) :
|
|
48
|
+
return node ? JSON.stringify(node.data) : '';
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const copyCurrentSortSettings = (): ColumnState[] =>
|
|
@@ -83,7 +83,7 @@ export const usePostSortRowsHook = ({ setStaleGrid }: PostSortRowsHookProps) =>
|
|
|
83
83
|
|
|
84
84
|
const quickFilter = api.getQuickFilter();
|
|
85
85
|
if (previousQuickFilter.current != quickFilter) {
|
|
86
|
-
previousQuickFilter.current = quickFilter ??
|
|
86
|
+
previousQuickFilter.current = quickFilter ?? '';
|
|
87
87
|
sortOrderChanged = true;
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -110,7 +110,7 @@ export const usePostSortRowsHook = ({ setStaleGrid }: PostSortRowsHookProps) =>
|
|
|
110
110
|
setStaleGrid(false);
|
|
111
111
|
|
|
112
112
|
// trigger a recapture of sort order
|
|
113
|
-
lastSortOrderHash.current =
|
|
113
|
+
lastSortOrderHash.current = '';
|
|
114
114
|
restorePreviousSortColumnState();
|
|
115
115
|
} else {
|
|
116
116
|
// Sort was on a different column so clear sort and sort like normal
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CellClickedEvent } from
|
|
1
|
+
import { CellClickedEvent } from 'ag-grid-community';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AgGrid checkbox select does not pass clicks within cell but not on the checkbox to checkbox.
|
|
@@ -11,13 +11,13 @@ export const clickInputWhenContainingCellClicked = (params: CellClickedEvent) =>
|
|
|
11
11
|
const element = event.target as Element;
|
|
12
12
|
// Already handled
|
|
13
13
|
if (
|
|
14
|
-
element.closest(
|
|
15
|
-
([
|
|
14
|
+
element.closest('.GridCell-readonly') ||
|
|
15
|
+
(['BUTTON', 'INPUT'].includes(element?.tagName) && element.closest('.ag-cell-inline-editing'))
|
|
16
16
|
) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const row = element.closest(
|
|
20
|
+
const row = element.closest('[row-id]');
|
|
21
21
|
if (!row) return;
|
|
22
22
|
|
|
23
23
|
const colId = colDef.colId;
|
|
@@ -27,7 +27,7 @@ export const clickInputWhenContainingCellClicked = (params: CellClickedEvent) =>
|
|
|
27
27
|
const cell = row.querySelector(`[col-id='${colId}']`);
|
|
28
28
|
if (!cell) return;
|
|
29
29
|
|
|
30
|
-
const input = cell.querySelector(
|
|
30
|
+
const input = cell.querySelector('input, button');
|
|
31
31
|
if (!input) return;
|
|
32
32
|
|
|
33
33
|
input?.dispatchEvent(event);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { LuiButton, LuiButtonGroup } from '@linzjs/lui';
|
|
2
|
+
import { LuiButtonProps } from '@linzjs/lui/dist/components/LuiButton/LuiButton';
|
|
3
|
+
import clsx, { ClassValue } from 'clsx';
|
|
4
|
+
import { ReactElement, useMemo, useState } from 'react';
|
|
3
5
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { GridFilterExternal } from "../../contexts/GridContext";
|
|
8
|
-
import { GridBaseRow } from "../Grid";
|
|
9
|
-
import { useGridFilter } from "./useGridFilter";
|
|
6
|
+
import { GridFilterExternal } from '../../contexts/GridContext';
|
|
7
|
+
import { GridBaseRow } from '../Grid';
|
|
8
|
+
import { useGridFilter } from './useGridFilter';
|
|
10
9
|
|
|
11
10
|
export interface GridFilterButtonsOption<TData extends GridBaseRow> {
|
|
12
11
|
defaultSelected?: boolean;
|
|
@@ -32,7 +31,7 @@ export const GridFilterButtons = <TData extends GridBaseRow>({
|
|
|
32
31
|
useGridFilter(filter);
|
|
33
32
|
|
|
34
33
|
return (
|
|
35
|
-
<div className={clsx(className,
|
|
34
|
+
<div className={clsx(className, 'flex-col-center')}>
|
|
36
35
|
<LuiButtonGroup>
|
|
37
36
|
{options.map((option, index) => (
|
|
38
37
|
<LuiButton
|