Commit Graph

5 Commits

Author SHA1 Message Date
Atanas Korchev
609622692e Add culture-aware editing, display, and formula entry to RadzenSpreadsheet
The spreadsheet engine parsed typed input with the invariant culture while
displaying values with the current culture, breaking the edit round-trip on
non-en-US hosts and making comma-decimal entry (10,50) impossible.

Workbook gains a Culture property (defaults to CurrentCulture) which the
component stamps from its inherited Culture parameter. It drives:

- Cell input parsing (CellData type inference), including day-month date
  handling for cultures where the group and date separators collide (de-DE)
- Edit text and display rendering (GetValue, GetValueAsString, GetDisplayText)
- Number format rendering - format codes stay canonical invariant tokens while
  separators, month names, and AM/PM designators follow the culture
- Formula entry and display via the new FormulaLocalizer (Excel FormulaLocal
  semantics: ';' argument separators and ',' decimals in comma-decimal
  cultures, lenient comma acceptance where unambiguous, canonical invariant
  storage)
- Dialog input (data validation, conditional format, filter) via shared
  conversion helpers on SpreadsheetDialogBase

XLSX and CSV files read and write canonical invariant values regardless of
the workbook culture, including autofit column widths. Malformed formulas now
surface as error trees instead of an unhandled lexer exception. Number format
parsing is cached (hard-bounded) since CellView reparsed per render.

Includes localization demos for the Spreadsheet and Document Processing
sections and culture test suites.

Note: headless code on non-en-US hosts now parses string values with the
host culture; set Workbook.Culture explicitly (or to InvariantCulture) for
host-independent processing.
2026-07-08 14:54:55 +03:00
Atanas Korchev
8befb201ef Add screen-reader and keyboard accessibility to RadzenSpreadsheet
Make the spreadsheet usable with a screen reader and fully operable by keyboard,
keeping the virtualized cell hot path perf-neutral, with no breaking change
beyond the intended one (the toolbar becomes Tab-navigable).

- role="application" on the root + an isolated, self-rendering live-region
  announcer (RadzenLiveRegion + SpreadsheetAccessibility) that speaks the active
  cell (address, value, frozen-row header, position, state), selection size, and
  structural actions (sort/filter/insert) without re-rendering the grid.
- Contextual keyboard gate: Tab moves the active cell in the grid but stays native
  in the chrome; F6/Shift+F6 cycle regions (ribbon/toolbar/formula bar/grid/sheet
  tabs) - the WCAG 2.1.2 escape. Full nav set added: Home/End, Ctrl+Home/End,
  Ctrl+A, Ctrl+Arrow edge-jump, Ctrl+Space/Shift+Space, PageUp/Down, Ctrl+D/R fill;
  RTL arrow swap; IME/"Home types H" guard; F2, Ctrl+Y; Shift+F10 context menu.
- Accessible names on every toolbar tool + SelectBar item (localized via nameof);
  inner editor gets role=textbox + a mode-specific label via InputAttributes.
- Image/chart keyboard layer (Ctrl+Alt+5 select/cycle, arrows move, Size dialog
  resize), undoable column/row resize, Alt+/ shortcut-help dialog, dialog focus
  restore.
- 19 new bUnit/xUnit tests; full suite green; verified live in Chrome.
2026-06-29 17:33:23 +03:00
Atanas Korchev
9853c4aa2e Inherit RadzenSpreadsheetToolBase in merge/borders/conditional/validation tools
Replace the duplicated selection-binding boilerplate (cascading parameters,
IsDisabled, EventBinding<Selection>, OnParametersSet/OnSelectionChanged/Dispose)
with @inherits RadzenSpreadsheetToolBase, overriding only Feature - matching the
Insert* tools.
2026-06-17 18:27:36 +03:00
Atanas Korchev
cae0e7d3a1 Fix RadzenSpreadsheet edit refresh, table sort, filter and tool issues
- Edited value cells now repaint: fire the changed cell's notification even
  inside a command batch (only dependent recalc is deferred to EndUpdate).
- Table sort excludes the header (and totals) row by sorting DataBodyRange;
  the cell-menu and context-menu sorts are now table/auto-filter aware.
- Re-apply active filters after a sort (and on sort undo) so filtered-out
  rows stay hidden by value.
- Enable Merge, Borders, Conditional and Data Validation tools when a range
  is selected by subscribing to Selection.Changed.
- Keep the worksheet prefix on cross-sheet references in the formula-bar
  syntax highlighter (use the raw token text).

Adds regression tests for all of the above.
2026-06-17 18:08:12 +03:00
Atanas Korchev
98db8bd1fa Spreadsheet: prefix public toolbar tools with RadzenSpreadsheet, fix standalone Open/Save
Rename the 34 public toolbar tool components and the two public base classes
to the RadzenSpreadsheet* convention in the Radzen.Blazor namespace, matching
RadzenHtmlEditor*. This removes name collisions (Color, Bold, Open, Save...),
makes them discoverable via the Radzen prefix, and drops the special
@using Radzen.Blazor.Spreadsheet.Tools a custom toolbar previously needed.

Make Open and Save work in a custom toolbar: they now read the cascaded
context instead of host-wired parameters. Add ISpreadsheet.LoadWorkbookAsync
(one host render, reused by the built-in Open) so the grid refreshes on load;
Save derives the workbook from the cascaded Worksheet.

The internal dialogs and ConditionalFormatRuleType stay in their sub-namespace.
2026-06-15 18:45:19 +03:00