schummar-table 0.46.9 → 0.47.2

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.
Files changed (55) hide show
  1. package/dist/chunk-CTAAG5j7.js +13 -0
  2. package/dist/chunk-pbleEpgJ.cjs +44 -0
  3. package/dist/csvExporter-BGoiph1b.cjs +41 -0
  4. package/dist/csvExporter-BGoiph1b.cjs.map +1 -0
  5. package/dist/csvExporter-DRm4V8We.js +35 -0
  6. package/dist/csvExporter-DRm4V8We.js.map +1 -0
  7. package/dist/csvExporter.cjs +2 -78
  8. package/dist/csvExporter.d.cts +15 -13
  9. package/dist/csvExporter.d.ts +15 -13
  10. package/dist/csvExporter.js +3 -8
  11. package/dist/excelExporter.cjs +18 -38
  12. package/dist/excelExporter.cjs.map +1 -1
  13. package/dist/excelExporter.d.cts +7 -6
  14. package/dist/excelExporter.d.ts +7 -5
  15. package/dist/excelExporter.js +16 -19
  16. package/dist/excelExporter.js.map +1 -1
  17. package/dist/exporter-BxgFAyWA.d.ts +24 -0
  18. package/dist/exporter-ztSF5GbY.d.cts +24 -0
  19. package/dist/index.cjs +3422 -5328
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +207 -168
  22. package/dist/index.d.ts +205 -168
  23. package/dist/index.js +3378 -4413
  24. package/dist/index.js.map +1 -1
  25. package/dist/mui4Theme.cjs +62 -905
  26. package/dist/mui4Theme.cjs.map +1 -1
  27. package/dist/mui4Theme.d.cts +14 -10
  28. package/dist/mui4Theme.d.ts +14 -10
  29. package/dist/mui4Theme.js +54 -77
  30. package/dist/mui4Theme.js.map +1 -1
  31. package/dist/mui5Theme.cjs +62 -901
  32. package/dist/mui5Theme.cjs.map +1 -1
  33. package/dist/mui5Theme.d.cts +14 -10
  34. package/dist/mui5Theme.d.ts +14 -10
  35. package/dist/mui5Theme.js +57 -76
  36. package/dist/mui5Theme.js.map +1 -1
  37. package/dist/tableSettings-BxCzVAiu.cjs +740 -0
  38. package/dist/tableSettings-BxCzVAiu.cjs.map +1 -0
  39. package/dist/tableSettings-C5bAcuVw.js +675 -0
  40. package/dist/tableSettings-C5bAcuVw.js.map +1 -0
  41. package/dist/types-CemO-cBr.d.ts +433 -0
  42. package/dist/types-lBtXAU-l.d.cts +433 -0
  43. package/package.json +30 -70
  44. package/dist/chunk-EEBUKP6F.js +0 -64
  45. package/dist/chunk-EEBUKP6F.js.map +0 -1
  46. package/dist/chunk-NTYYITKA.js +0 -803
  47. package/dist/chunk-NTYYITKA.js.map +0 -1
  48. package/dist/chunk-WFCJ3D3G.js +0 -47
  49. package/dist/chunk-WFCJ3D3G.js.map +0 -1
  50. package/dist/csvExporter.cjs.map +0 -1
  51. package/dist/csvExporter.js.map +0 -1
  52. package/dist/exporter-u6SatTo6.d.cts +0 -22
  53. package/dist/exporter-u6SatTo6.d.ts +0 -22
  54. package/dist/types-CADdapzE.d.cts +0 -437
  55. package/dist/types-DNdXIGcn.d.ts +0 -437
@@ -1,437 +0,0 @@
1
- import { Interpolation, Theme } from '@emotion/react';
2
- import React__default, { DependencyList, CSSProperties, ReactNode, ComponentType, Ref } from 'react';
3
- import { a as ExportOptions } from './exporter-u6SatTo6.js';
4
-
5
- type TableStateStorage = {
6
- getItem: (key: string) => string | null | Promise<string | null>;
7
- setItem: (key: string, value: string) => unknown | Promise<unknown>;
8
- removeItem: (key: string) => unknown | Promise<unknown>;
9
- } & ({
10
- keys: () => string[] | Promise<string[]>;
11
- } | {
12
- length: number | (() => number | Promise<number>);
13
- key: (keyIndex: number) => string | null | Promise<string | null>;
14
- });
15
-
16
- type Sort = {
17
- columnId: string | number;
18
- direction: SortDirection;
19
- };
20
- type SortDirection = 'asc' | 'desc';
21
- type Id = string | number;
22
- type KeyOfType<T, S> = {
23
- [K in keyof T]: T[K] extends S ? K : never;
24
- }[keyof T];
25
- type FunctionWithDeps<F extends (...args: any[]) => any> = F | [function: F, ...deps: DependencyList];
26
- type MemoizedFunctions<T> = {
27
- [K in keyof T]: Exclude<T[K], [function: (...args: any[]) => any, ...deps: DependencyList]>;
28
- };
29
- type CSSInterpolation = Exclude<Interpolation<Theme>, ((...args: any[]) => any) | Array<any>>;
30
- type Falsy = false | 0 | '' | null | undefined;
31
- type DisplaySize = 'desktop' | 'mobile' | (string & {});
32
- type DisplaySizes = Partial<Record<DisplaySize, number>>;
33
- interface TableTheme<TItem = unknown> {
34
- /** Define display texts. */
35
- text: {
36
- selectColumns: ReactNode;
37
- showAllColumns: ReactNode;
38
- hideAllColumns: ReactNode;
39
- noResults: ReactNode;
40
- exportTitle: ReactNode;
41
- exportCopy: ReactNode;
42
- exportDownload: ReactNode;
43
- today: ReactNode;
44
- thisWeek: ReactNode;
45
- thisMonth: ReactNode;
46
- thisYear: ReactNode;
47
- lastSevenDays: ReactNode;
48
- lastThirtyDays: ReactNode;
49
- reset: ReactNode;
50
- loading: ReactNode;
51
- clearFilters: ReactNode;
52
- deselectAll: ReactNode;
53
- resetAll: ReactNode;
54
- rangeMin: ReactNode;
55
- rangeMax: ReactNode;
56
- calendarWeek: ReactNode;
57
- };
58
- /** Define styles. */
59
- classes?: {
60
- table?: string;
61
- row?: string | FunctionWithDeps<(item: TItem, index: number) => string | undefined>;
62
- headerCell?: string;
63
- footerCell?: string;
64
- cell?: string | FunctionWithDeps<(item: TItem, index: number) => string | undefined>;
65
- evenCell?: string;
66
- oddCell?: string;
67
- popover?: string;
68
- popoverBackdrop?: string;
69
- columnDivider?: string;
70
- details?: string | FunctionWithDeps<(item: TItem, index: number) => string | undefined>;
71
- };
72
- styles?: {
73
- table?: Interpolation<Theme>;
74
- row?: CSSInterpolation | FunctionWithDeps<(item: TItem, index: number) => CSSInterpolation | CSSInterpolation[]>;
75
- headerCell?: Interpolation<Theme>;
76
- footerCell?: Interpolation<Theme>;
77
- cell?: CSSInterpolation | FunctionWithDeps<(item: TItem, index: number) => Interpolation<Theme>>;
78
- evenCell?: Interpolation<Theme>;
79
- oddCell?: Interpolation<Theme>;
80
- columnDivider?: Interpolation<Theme>;
81
- details?: Exclude<Interpolation<Theme>, ((...args: any[]) => any) | Array<any>> | FunctionWithDeps<(item: TItem, index: number) => Interpolation<Theme>>;
82
- };
83
- /** Define components to be used in the table. */
84
- components: {
85
- IconButton: ComponentType<{
86
- children: ReactNode;
87
- onClick?: (event: React__default.MouseEvent<Element>) => void;
88
- onContextMenu?: (event: React__default.MouseEvent<Element>) => void;
89
- className?: string;
90
- type?: React__default.ButtonHTMLAttributes<HTMLButtonElement>['type'];
91
- }>;
92
- Button: ComponentType<{
93
- children: ReactNode;
94
- onClick?: (event: React__default.MouseEvent<Element>) => void;
95
- onContextMenu?: (event: React__default.MouseEvent<Element>) => void;
96
- startIcon?: ReactNode;
97
- variant?: 'text' | 'outlined' | 'contained';
98
- disabled?: boolean;
99
- className?: string;
100
- type?: React__default.ButtonHTMLAttributes<HTMLButtonElement>['type'];
101
- }>;
102
- Checkbox: ComponentType<{
103
- checked: boolean;
104
- onChange: (event: React__default.ChangeEvent) => void;
105
- disabled?: boolean;
106
- className?: string;
107
- }>;
108
- Popover: ComponentType<{
109
- anchorEl: Element | null;
110
- open: boolean;
111
- hidden?: boolean;
112
- onClose: () => void;
113
- children: ReactNode;
114
- className?: string;
115
- backdropClassName?: string;
116
- align?: 'center' | 'left';
117
- }>;
118
- Badge: ComponentType<{
119
- children: ReactNode;
120
- badgeContent: ReactNode;
121
- }>;
122
- TextField: ComponentType<{
123
- value?: string | null;
124
- onChange?: (event: React__default.ChangeEvent<HTMLInputElement>) => void;
125
- onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
126
- startIcon?: ReactNode;
127
- endIcon?: ReactNode;
128
- className?: string;
129
- inputRef?: Ref<HTMLInputElement>;
130
- placeholder?: string;
131
- }>;
132
- Spinner: (props: {
133
- className?: string;
134
- }) => JSX.Element;
135
- };
136
- /** Define icons for the table. */
137
- icons: {
138
- [K in 'Settings' | 'Export' | 'Clipboard' | 'ChevronRight' | 'Search' | 'Clear' | 'ArrowDropDown' | 'FilterList' | 'ArrowUpward']: ComponentType<{
139
- className?: string;
140
- }>;
141
- };
142
- /** Define colors */
143
- colors: {
144
- primary: {
145
- main: string;
146
- light: string;
147
- contrastText: string;
148
- };
149
- secondary: {
150
- main: string;
151
- light: string;
152
- contrastText: string;
153
- };
154
- blocked: {
155
- main: string;
156
- light: string;
157
- contrastText: string;
158
- };
159
- background: string;
160
- text: string;
161
- border: string;
162
- borderLight: string;
163
- };
164
- /** Spacing. */
165
- spacing: string | number;
166
- /** Locale for number and date rendering */
167
- locale?: string;
168
- }
169
- type PartialTableTheme<TItem = unknown> = {
170
- [K in keyof TableTheme<TItem>]?: TableTheme<TItem>[K] extends Record<string, any> ? Partial<TableTheme<TItem>[K]> : TableTheme<TItem>[K];
171
- };
172
- type MemoizedTableTheme<TItem> = Omit<TableTheme, 'classes' | 'styles' | 'text'> & {
173
- classes: MemoizedFunctions<TableTheme<TItem>['classes']>;
174
- styles: MemoizedFunctions<TableTheme<TItem>['styles']>;
175
- text: MemoizedFunctions<TableTheme<TItem>['text']>;
176
- };
177
- type ColumnGenerator<TItem> = (col: ColumnFactory<TItem>) => (Column<TItem, any> | Falsy)[];
178
- type ColumnFactory<TItem> = <TColumnValue>(value: (item: TItem) => TColumnValue, column: Omit<Column<TItem, TColumnValue>, 'value'>) => Column<TItem, TColumnValue>;
179
- interface TableProps<TItem> extends PartialTableTheme<TItem> {
180
- /** The data to be rendered. One item per row. */
181
- items?: readonly TItem[];
182
- /** Unique id for each item/row. */
183
- id: FunctionWithDeps<(item: TItem) => Id> | KeyOfType<TItem, Id>;
184
- /** Create a nested structure by assigning parents to items. Child items are hidden until the parent is expanded. */
185
- parentId?: FunctionWithDeps<(item: TItem) => Id | undefined> | KeyOfType<TItem, Id | undefined | null>;
186
- /** If true for an item, it means that children will be loaded asynchronously as soon as item is expanded. */
187
- hasDeferredChildren?: (item: TItem) => boolean;
188
- /** Column definitions. */
189
- columns: (Column<TItem, any> | Falsy)[] | ColumnGenerator<TItem>;
190
- /** Default props for all column. Will take effect if not overriden in column definition. */
191
- defaultColumnProps?: Omit<Column<TItem, unknown>, 'id' | 'value'>;
192
- /** Set props for multiple columns at once. Will take effect if not overriden in column definition. */
193
- columnProps?: FunctionWithDeps<(id: Id) => Partial<Omit<Column<TItem, unknown>, 'id'>>>;
194
- /** Wrap each row */
195
- wrapRow?: FunctionWithDeps<(props: {
196
- className?: string;
197
- style?: CSSProperties;
198
- children?: ReactNode;
199
- }, item: TItem, index: number) => ReactNode>;
200
- /** Wrap each cell */
201
- wrapCell?: FunctionWithDeps<(content: ReactNode, value: unknown, item: TItem, index: number) => ReactNode>;
202
- /** Display a cell at the start of each row. Useful for "go to details" button for example. */
203
- rowAction?: ReactNode | FunctionWithDeps<(item: TItem, index: number) => ReactNode>;
204
- /** Expand row to show details. */
205
- rowDetails?: ReactNode | FunctionWithDeps<(item: TItem, index: number) => ReactNode>;
206
- /** Default sort order. */
207
- defaultSort?: Sort[];
208
- /** If given, controls the sort order. */
209
- sort?: Sort[];
210
- /** Called when sort order changes. */
211
- onSortChange?: (sort: Sort[]) => void;
212
- /** Handle sorting externally, e.g. server side */
213
- externalSort?: boolean;
214
- /** Disable sort for all columns (can be override per column) */
215
- disableSort?: boolean;
216
- /** Default selection. */
217
- defaultSelection?: Set<Id>;
218
- /** If given, controls the selection. */
219
- selection?: Set<Id>;
220
- /** Called when selection changes. */
221
- onSelectionChange?: (selection: Set<Id>) => void;
222
- /** Whether to show checkboxes at the start of each row.
223
- * @default true
224
- */
225
- enableSelection?: boolean;
226
- /** Select and deselect children if a parent is selected or deselected.
227
- * @default true
228
- */
229
- selectSyncChildren?: boolean;
230
- /** Expand parents whose children fit a newly selected filter
231
- * @default false
232
- */
233
- revealFiltered?: boolean;
234
- /** Default expanded rows. */
235
- defaultExpanded?: Set<Id>;
236
- /** If given, controls expanded rows. */
237
- expanded?: Set<Id>;
238
- /** Called when expanded rows change. */
239
- onExpandedChange?: (expanded: Set<Id>) => void;
240
- /** If enabled and one row is expanded, other rows will be closed.
241
- * @default false
242
- */
243
- expandOnlyOne?: boolean;
244
- /** Default hidden columns. */
245
- defaultHiddenColumns?: Set<Id>;
246
- /** If given, controls hidden columns. */
247
- hiddenColumns?: Set<Id>;
248
- /** Called when hidden columns change. */
249
- onHiddenColumnsChange?: (hiddenColumns: Set<Id>) => void;
250
- /** Whether to stretch the table component over the available space. If value is "left" or "right", align accordingly. */
251
- fullWidth?: boolean | 'left' | 'right';
252
- /** Whether the table header should be sticky.
253
- * @default true
254
- */
255
- stickyHeader?: boolean | {
256
- top: number;
257
- };
258
- /** Whether the table footer should be sticky.
259
- * @default true
260
- */
261
- stickyFooter?: boolean | {
262
- bottom: number;
263
- };
264
- /** Whether the table cells should only be rendered when in viewport.
265
- * @default true
266
- */
267
- virtual?: boolean | {
268
- rowHeight?: number;
269
- initalRowHeight?: number;
270
- throttleScroll?: number;
271
- overscan?: number;
272
- overscanBottom?: number;
273
- overscanTop?: number;
274
- };
275
- /** Whether to use a subgrid layout */
276
- subgrid?: boolean;
277
- /** Enable menu to select which columns are visible.
278
- * @default true
279
- */
280
- enableColumnSelection?: boolean;
281
- /** Enable exporting to csv.
282
- * @default false
283
- */
284
- enableExport?: boolean | ExportOptions;
285
- /** Shows a button to clear all filters while any are active
286
- * @default false
287
- */
288
- enableClearFiltersButton?: boolean;
289
- /** Allow to drag and drop column separators to resize the column left of it.
290
- * @default true
291
- */
292
- enableColumnResize?: boolean | 'visualOnly';
293
- /** Allow to drag and drop column header to reorder columns.
294
- * @default true
295
- */
296
- enableColumnReorder?: boolean;
297
- /** If enabled, automatically store table state in localStorage, localForage or another compatible storage. */
298
- persist?: {
299
- storage: TableStateStorage;
300
- id: string;
301
- include?: ('sort' | 'selection' | 'expanded' | 'hiddenColumns' | 'filterValues' | 'columnWidths' | 'columnOrder')[];
302
- exclude?: ('sort' | 'selection' | 'expanded' | 'hiddenColumns' | 'filterValues' | 'columnWidths' | 'columnOrder')[];
303
- };
304
- /** The current screen size. Used to determine which columns to display.
305
- * Either assert the size manually - e.g. "mobile" or "desktop".
306
- * Or provide a map of screen sizes to maximum pixel widths of the screen.
307
- * If not provided, <= 400 px will be "mobile", else "desktop".
308
- *
309
- * @example
310
- * displaySize: 'mobile' // assert the size manually
311
- * displaySize: { mobile: 450, desktop: Infinity } // provide a map of screen sizes
312
- * */
313
- displaySize?: DisplaySize | DisplaySizes;
314
- displaySizeOverrides?: Partial<Record<DisplaySize, Partial<Omit<TableProps<TItem>, 'displaySize' | 'displaySizeOverrides'>>>>;
315
- debug?: (...output: any) => void;
316
- debugRender?: (...output: any) => void;
317
- onReset?: (scope?: 'table' | 'filters') => void;
318
- }
319
- interface TableRef {
320
- getSort: () => Sort[];
321
- setSort: (sort: Sort[]) => void;
322
- getSelection: () => Set<Id>;
323
- setSelection: (selection: Set<Id>) => void;
324
- getExpanded: () => Set<Id>;
325
- setExpanded: (expanded: Set<Id>) => void;
326
- getHiddenColumns: () => Set<Id>;
327
- setHiddenColumns: (hidden: Set<Id>) => void;
328
- }
329
- type InternalTableProps<TItem> = MemoizedFunctions<Omit<TableProps<TItem>, 'id' | 'parentId' | 'columns' | 'defaultColumnProps' | 'displaySizeOverrides'> & {
330
- id: (item: TItem) => Id;
331
- parentId?: (item: TItem) => Id | undefined;
332
- columns: InternalColumn<TItem, unknown>[];
333
- displaySizeOverrides?: Partial<Record<DisplaySize, Partial<Omit<InternalTableProps<TItem>, 'displaySize' | 'displaySizeOverrides'>>>>;
334
- }>;
335
- type TableItem<TItem = unknown> = {
336
- id: Id;
337
- parentId?: Id | null;
338
- children: TableItem<TItem>[];
339
- value: TItem;
340
- };
341
- type Column<TItem, TColumnValue> = {
342
- /** Column id. If not provided, the index in the column array will be used.
343
- * An explicit id is better however for controlling column related states, persitance etc.
344
- */
345
- id?: string;
346
- /** Render table header for this column. */
347
- header?: ReactNode;
348
- exportHeader?: string | number | Date;
349
- /** Render table header for this column. */
350
- footer?: ReactNode;
351
- /** Extract value for this column */
352
- value: FunctionWithDeps<(item: TItem) => TColumnValue>;
353
- /** Render table cell. If not provided, a string representation of the value will be rendered. */
354
- renderCell?: FunctionWithDeps<(value: TColumnValue, item: TItem) => ReactNode>;
355
- /** Serialize column value for exports. If not provided, a string representation of the value will be used. */
356
- exportCell?: (value: TColumnValue, item: TItem) => string | number | Date;
357
- /** Customize sort criteria. By default it will be the value itself in case it's a number or Date, or a string representation of the value otherwise. */
358
- sortBy?: FunctionWithDeps<(value: TColumnValue, item: TItem) => unknown>[];
359
- /** Disable sort for this column */
360
- disableSort?: boolean;
361
- /** Set filter component that will be displayed in the column header */
362
- filter?: ReactNode;
363
- /** Override whether the column is hidden. If set, prevents toggling the column via menu. */
364
- hidden?: boolean;
365
- /** Specify a css width.
366
- * @default 'max-content'
367
- */
368
- width?: string;
369
- /** Provide css class names to override columns styles. */
370
- classes?: Omit<NonNullable<TableTheme<TItem>['classes']>, 'table' | 'details'>;
371
- /** Provide css styles to override columns styles. */
372
- styles?: Omit<NonNullable<TableTheme<TItem>['styles']>, 'table' | 'details'>;
373
- /** Specify the screen size(s) for which this column should be displayed. */
374
- displaySize?: DisplaySize | DisplaySize[];
375
- };
376
- type InternalColumn<TItem, TColumnValue> = MemoizedFunctions<Required<Omit<Column<TItem, TColumnValue>, 'id' | 'sortBy' | 'displaySize'>, 'header' | 'exportHeader' | 'renderCell' | 'exportCell' | 'sortBy'> & {
377
- id: Id;
378
- sortBy: ((value: TColumnValue, item: TItem) => unknown)[];
379
- displaySize: DisplaySize[] | undefined;
380
- }>;
381
- type Required<T, S> = T & {
382
- [P in keyof T as P extends S ? P : never]-?: T[P];
383
- };
384
- type InternalTableState<TItem> = {
385
- normalizedProps: InternalTableProps<TItem>;
386
- props: InternalTableProps<TItem>;
387
- key: any;
388
- sort: Sort[];
389
- selection: Set<Id>;
390
- expanded: Set<Id>;
391
- rowHeights: Map<Id, number>;
392
- filters: Map<Id, MemoizedFunctions<FilterImplementation<TItem, any, any, any>>>;
393
- filterValues: Map<Id, any>;
394
- hiddenColumns: Set<Id>;
395
- columnWidths: Map<Id, string>;
396
- columnOrder: Id[];
397
- columnStyleOverride: Map<Id, CSSProperties>;
398
- activeColumns: InternalColumn<TItem, unknown>[];
399
- visibleColumns: InternalColumn<TItem, unknown>[];
400
- items: TableItem<TItem>[];
401
- itemsById: Map<Id, TableItem<TItem>>;
402
- activeItems: TableItem<TItem>[];
403
- activeItemsById: Map<Id, TableItem<TItem>>;
404
- lastSelectedId?: Id;
405
- displaySizePx: number | undefined;
406
- displaySize: DisplaySize | undefined;
407
- };
408
- type CommonFilterProps<TItem, TColumnValue, TFilterBy, TFilterValue> = {
409
- /** Filter by? By default the column value will be used. If filterBy returns an array, an items will be active if at least one entry matches the active filter. */
410
- filterBy?: FunctionWithDeps<(value: TColumnValue, item: TItem) => TFilterBy | TFilterBy[]>;
411
- /** Preselected filter value. */
412
- defaultValue?: TFilterValue;
413
- /** Controlled filter value. */
414
- value?: TFilterValue;
415
- /** Notifies on filter change. */
416
- onChange?: (value?: TFilterValue) => void;
417
- /** Table should not filter using this filter. It will be done externally, e.g. server side. */
418
- external?: boolean;
419
- /** Whether to persist filter value (given that filter persitance is enabled for the table).
420
- * @default true
421
- */
422
- persist?: boolean;
423
- classNames?: {
424
- popover?: string;
425
- popoverBackdrop?: string;
426
- };
427
- };
428
- type FilterImplementation<TItem, TColumnValue, TFilterBy, TFilterValue> = CommonFilterProps<TItem, TColumnValue, TFilterBy, TFilterValue> & {
429
- /** Unique filter id. Used to persist filter values. */
430
- id: string;
431
- /** Whether the filter is active currently. */
432
- isActive: (filterValue: TFilterValue) => boolean;
433
- /** When the filter is active, this function is used to filter the items to be displayed. */
434
- test: (filterValue: TFilterValue, value: TFilterBy) => boolean;
435
- };
436
-
437
- export type { CommonFilterProps as C, FilterImplementation as F, Id as I, MemoizedTableTheme as M, PartialTableTheme as P, Sort as S, TableTheme as T, TableProps as a, TableRef as b, TableItem as c, InternalTableState as d, TableStateStorage as e, Column as f, FunctionWithDeps as g, InternalColumn as h, SortDirection as i };