From b1daaef4a24fb8e206b98ca63fdf023346a06664 Mon Sep 17 00:00:00 2001 From: Illia Obukhau <8282906+iobuhov@users.noreply.github.com> Date: Fri, 12 Dec 2025 11:20:21 +0100 Subject: [PATCH 1/2] feat: add aria live in dg footer --- .../src/components/WidgetFooter.tsx | 4 ++ .../select-all/SelectAllModule.container.ts | 14 +----- .../selection-counter/SelectionAriaLive.tsx | 12 +++++ .../selection-counter/SelectionCounter.tsx | 4 +- .../selection-counter/injection-hooks.ts | 3 +- .../src/model/containers/Root.container.ts | 10 ++++ .../src/model/hooks/injection-hooks.ts | 1 + .../datagrid-web/src/model/tokens.ts | 11 ++--- .../src/core/models/selection.model.ts | 37 ++++++++++++++ .../shared/widget-plugin-grid/src/main.ts | 1 + .../src/select-all/select-all.model.ts | 48 +------------------ 11 files changed, 76 insertions(+), 69 deletions(-) create mode 100644 packages/pluggableWidgets/datagrid-web/src/features/selection-counter/SelectionAriaLive.tsx diff --git a/packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx b/packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx index 4f5211c4b7..36551871f7 100644 --- a/packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx +++ b/packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx @@ -1,6 +1,7 @@ import { If } from "@mendix/widget-plugin-component-kit/If"; import { observer } from "mobx-react-lite"; import { ReactElement } from "react"; +import { SelectionAriaLive } from "../features/selection-counter/SelectionAriaLive"; import { SelectionCounter } from "../features/selection-counter/SelectionCounter"; import { useSelectionCounterViewModel } from "../features/selection-counter/injection-hooks"; import { useDatagridConfig, usePaginationService, useTexts } from "../model/hooks/injection-hooks"; @@ -14,6 +15,9 @@ export const WidgetFooter = observer(function WidgetFooter(): ReactElement { return (
+ + +
diff --git a/packages/pluggableWidgets/datagrid-web/src/features/select-all/SelectAllModule.container.ts b/packages/pluggableWidgets/datagrid-web/src/features/select-all/SelectAllModule.container.ts index 1d86ba4f7c..5784ae7083 100644 --- a/packages/pluggableWidgets/datagrid-web/src/features/select-all/SelectAllModule.container.ts +++ b/packages/pluggableWidgets/datagrid-web/src/features/select-all/SelectAllModule.container.ts @@ -4,7 +4,7 @@ import { generateUUID } from "@mendix/widget-plugin-platform/framework/generate- import { Container, injected } from "brandi"; import { SelectAllFeature } from "@mendix/widget-plugin-grid/select-all/select-all.feature"; -import { selectAllEmitter, selectAllTextsStore } from "@mendix/widget-plugin-grid/select-all/select-all.model"; +import { selectAllEmitter } from "@mendix/widget-plugin-grid/select-all/select-all.model"; import { SelectAllBarStore } from "@mendix/widget-plugin-grid/select-all/SelectAllBar.store"; import { DerivedPropsGate } from "@mendix/widget-plugin-mobx-kit/main"; import { MainGateProps } from "../../../typings/MainGateProps"; @@ -13,21 +13,12 @@ import { CORE_TOKENS as CORE, DG_TOKENS as DG, SA_TOKENS } from "../../model/tok import { SelectAllBarViewModel } from "./SelectAllBar.viewModel"; import { SelectionProgressDialogViewModel } from "./SelectionProgressDialog.viewModel"; -injected( - selectAllTextsStore, - SA_TOKENS.gate, - CORE.selection.selectedCount, - CORE.selection.selectedCounterTextsStore, - CORE.atoms.totalCount, - CORE.selection.isAllItemsSelected -); - injected( SelectAllBarViewModel, SA_TOKENS.emitter, SA_TOKENS.barStore, CORE.selection.selectedCounterTextsStore, - SA_TOKENS.selectAllTextsStore, + CORE.selection.selectAllTexts, SA_TOKENS.enableSelectAll ); @@ -62,7 +53,6 @@ export class SelectAllModule extends Container { this.bind(SA_TOKENS.emitter).toInstance(selectAllEmitter).inSingletonScope(); this.bind(DG.query).toInstance(DatasourceService).inSingletonScope(); this.bind(SA_TOKENS.selectAllService).toInstance(SelectAllService).inSingletonScope(); - this.bind(SA_TOKENS.selectAllTextsStore).toInstance(selectAllTextsStore).inSingletonScope(); this.bind(SA_TOKENS.selectAllBarVM).toInstance(SelectAllBarViewModel).inSingletonScope(); this.bind(SA_TOKENS.selectionDialogVM).toInstance(SelectionProgressDialogViewModel).inSingletonScope(); this.bind(SA_TOKENS.feature).toInstance(SelectAllFeature).inSingletonScope(); diff --git a/packages/pluggableWidgets/datagrid-web/src/features/selection-counter/SelectionAriaLive.tsx b/packages/pluggableWidgets/datagrid-web/src/features/selection-counter/SelectionAriaLive.tsx new file mode 100644 index 0000000000..7ea88f4b45 --- /dev/null +++ b/packages/pluggableWidgets/datagrid-web/src/features/selection-counter/SelectionAriaLive.tsx @@ -0,0 +1,12 @@ +import { observer } from "mobx-react-lite"; +import { useSelectionCounterTexts } from "./injection-hooks"; + +export const SelectionAriaLive = observer(function SelectionAriaLive() { + const texts = useSelectionCounterTexts(); + + return ( + + {texts.selectedCountText} + + ); +}); diff --git a/packages/pluggableWidgets/datagrid-web/src/features/selection-counter/SelectionCounter.tsx b/packages/pluggableWidgets/datagrid-web/src/features/selection-counter/SelectionCounter.tsx index 978025e56d..53aea617c2 100644 --- a/packages/pluggableWidgets/datagrid-web/src/features/selection-counter/SelectionCounter.tsx +++ b/packages/pluggableWidgets/datagrid-web/src/features/selection-counter/SelectionCounter.tsx @@ -8,9 +8,7 @@ export const SelectionCounter = observer(function SelectionCounter() { return (
- - {selectionCountStore.selectedCountText} - + {selectionCountStore.selectedCountText}  |