Sort

Facade APIPaid VersionUniver ServerUniver on Node.jsPreset
---UniverSheetsSortPreset

The sort plugin provides sorting functionality for cells in ranges.

This feature includes the following plugin packages:

Installation with Presets

import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core';
import UniverPresetSheetsCoreEnUS from '@univerjs/presets/preset-sheets-core/locales/en-US';
import { UniverSheetsSortPreset } from '@univerjs/presets/preset-sheets-sort';
import SheetsSortEnUS from '@univerjs/presets/preset-sheets-sort/locale/en-US';
 
const { univerAPI } = createUniver({
  locale: LocaleType.EN_US,
  locales: {
    enUS: Tools.deepMerge(
      {},
      UniverPresetSheetsCoreEnUS,
      SheetsSortEnUS 
    ),
  },
  theme: defaultTheme,
  presets: [
    UniverSheetsCorePreset(),
    UniverSheetsSortPreset()
  ]
});

Advanced Installation

npm install @univerjs/sheets-sort @univerjs/sheets-sort-ui
import { LocaleType, Tools } from '@univerjs/core';
import { UniverSheetsSortPlugin } from '@univerjs/sheets-sort';
import { UniverSheetsSortUIPlugin } from '@univerjs/sheets-sort-ui';
import SheetsSortUIEnUS from '@univerjs/sheets-sort-ui/locale/en-US';
 
import '@univerjs/sheets-sort-ui/lib/index.css';
 
const univer = new Univer({
  theme: defaultTheme,
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: Tools.deepMerge(
      SheetsSortUIEnUS
    ),
  },
});
 
univer.registerPlugin(UniverSheetsSortPlugin);
univer.registerPlugin(UniverSheetsSortUIPlugin);