WarUI

Natural Sort for Alphanumeric Values

GRID-A09-F10P1beyond-baselinePlanned

Natural sort orders embedded numbers by their numeric value, so 'file2' comes before 'file10'. The feature uses the collator's numeric option combined with the locale settings from F09. Leading zeros are handled in a defined way. Natural sort is enabled per column.

Planned. This page shows the specification from issue #186. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

A file list containing img1.png, img10.png, img2.png, v1.10, v1.9, Item 007 and Item 7.

Expected behavior

With natural sort off, the order is img1, img10, img2. With natural sort on, the order is img1, img2, img10. Version strings order v1.9 before v1.10. 'Item 007' and 'Item 7' compare as equal and keep their original relative order.

Planned API surface

columns[].naturalSortcollatorOptions.numeric

Acceptance criteria

  • naturalSort=true sets numeric:true on that column's collator (pending)
  • Numeric segments compare by their value (pending)
  • Segments that compare equal fall back to the stable order (F13) (pending)
  • Natural sort combines with the locale and sensitivity options from F09 (pending)