@ishibashi0112/spreadsheet-grid-core 0.39.0 → 0.41.0
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.
- package/dist/controllers/asyncSelectOptionsSource.cjs +1 -0
- package/dist/controllers/asyncSelectOptionsSource.d.ts +32 -0
- package/dist/controllers/asyncSelectOptionsSource.js +90 -0
- package/dist/controllers/autoHeightMeasurer.cjs +1 -1
- package/dist/controllers/autoHeightMeasurer.js +19 -19
- package/dist/controllers/clipboardController.cjs +2 -2
- package/dist/controllers/clipboardController.js +54 -47
- package/dist/controllers/columnAutosizeRunner.cjs +1 -1
- package/dist/controllers/columnAutosizeRunner.js +7 -7
- package/dist/controllers/filterPopoverController.cjs +1 -1
- package/dist/controllers/filterPopoverController.js +7 -7
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.js +10 -4
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.js +71 -71
- package/dist/controllers/selectOptionsCollector.cjs +1 -1
- package/dist/controllers/selectOptionsCollector.d.ts +4 -1
- package/dist/controllers/selectOptionsCollector.js +7 -7
- package/dist/engine/columnCommands.cjs +1 -1
- package/dist/engine/columnCommands.js +54 -54
- package/dist/engine/filterPopoverCommands.cjs +1 -1
- package/dist/engine/filterPopoverCommands.d.ts +5 -2
- package/dist/engine/filterPopoverCommands.js +12 -12
- package/dist/engine/gridApi.cjs +1 -1
- package/dist/engine/gridApi.d.ts +6 -0
- package/dist/engine/gridApi.js +75 -56
- package/dist/engine/notifiers.cjs +1 -1
- package/dist/engine/notifiers.d.ts +3 -1
- package/dist/engine/notifiers.js +11 -11
- package/dist/engine/rowPipeline.cjs +1 -1
- package/dist/engine/rowPipeline.d.ts +13 -2
- package/dist/engine/rowPipeline.js +51 -39
- package/dist/engine/verticalLayout.cjs +1 -1
- package/dist/engine/verticalLayout.d.ts +4 -0
- package/dist/engine/verticalLayout.js +40 -28
- package/dist/logic/exportCsv.cjs +2 -2
- package/dist/logic/exportCsv.d.ts +4 -1
- package/dist/logic/exportCsv.js +16 -11
- package/dist/logic/exportData.cjs +1 -1
- package/dist/logic/exportData.d.ts +3 -1
- package/dist/logic/exportData.js +29 -13
- package/dist/logic/gridState.cjs +1 -1
- package/dist/logic/gridState.d.ts +5 -0
- package/dist/logic/gridState.js +10 -7
- package/dist/logic/labelRows.cjs +1 -0
- package/dist/logic/labelRows.d.ts +45 -0
- package/dist/logic/labelRows.js +157 -0
- package/dist/logic/verticalGeometry.cjs +1 -1
- package/dist/logic/verticalGeometry.d.ts +5 -0
- package/dist/logic/verticalGeometry.js +39 -5
- package/dist/model/gridTypes.core.d.ts +50 -0
- package/dist/model/gridTypes.unbound.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export type RowModel<T> = {
|
|
|
9
9
|
getSourceIndex: (viewIndex: number) => number;
|
|
10
10
|
getRowKey: (viewIndex: number) => GridRowKey;
|
|
11
11
|
getGroupRow?: (viewIndex: number) => GridGroupRow | undefined;
|
|
12
|
+
getLabelRow?: (viewIndex: number) => GridLabelRow<T> | undefined;
|
|
12
13
|
};
|
|
13
14
|
export type ServerSideQuery = {
|
|
14
15
|
globalText?: string;
|
|
@@ -108,6 +109,17 @@ export type GridSelectFilterOption = {
|
|
|
108
109
|
label: string;
|
|
109
110
|
value: string;
|
|
110
111
|
};
|
|
112
|
+
export type GetFilterOptionsParams<T, F extends GridFrameworkTypes = GridFrameworkTypes> = {
|
|
113
|
+
columnKey: string;
|
|
114
|
+
column: GridColumn<T, F>;
|
|
115
|
+
columnFilters: Record<string, ColumnFilterValue>;
|
|
116
|
+
globalText: string;
|
|
117
|
+
signal: AbortSignal;
|
|
118
|
+
};
|
|
119
|
+
export type GetFilterOptionsResult = {
|
|
120
|
+
options: GridSelectFilterOption[];
|
|
121
|
+
truncated?: boolean;
|
|
122
|
+
};
|
|
111
123
|
export type ColumnFilterUiType = 'text' | 'textSet' | 'number' | 'numberSet' | 'date' | 'dateSet' | 'select' | 'set' | 'custom';
|
|
112
124
|
export type ColumnFilterTypeOption = ColumnFilterUiType | 'auto';
|
|
113
125
|
export type SetColumnFilterValue = {
|
|
@@ -253,6 +265,33 @@ export type DetailRowOptions<T, F extends GridFrameworkTypes = GridFrameworkType
|
|
|
253
265
|
showToggleColumn?: boolean;
|
|
254
266
|
className?: GridSlotProps<F>;
|
|
255
267
|
};
|
|
268
|
+
export type LabelRowSortMode = 'section' | 'follow' | 'hide';
|
|
269
|
+
export type GridLabelRow<T> = {
|
|
270
|
+
kind: 'label';
|
|
271
|
+
row: T;
|
|
272
|
+
sourceIndex: number;
|
|
273
|
+
label: string;
|
|
274
|
+
sectionRowCount: number | undefined;
|
|
275
|
+
};
|
|
276
|
+
export type LabelRowRenderContext<T> = {
|
|
277
|
+
row: T;
|
|
278
|
+
rowKey: GridRowKey;
|
|
279
|
+
rowIndex: number;
|
|
280
|
+
sourceRowIndex: number;
|
|
281
|
+
label: string;
|
|
282
|
+
sectionRowCount: number | undefined;
|
|
283
|
+
};
|
|
284
|
+
export type LabelRowOptions<T, F extends GridFrameworkTypes = GridFrameworkTypes> = {
|
|
285
|
+
isLabelRow: (row: T, sourceIndex: number) => boolean;
|
|
286
|
+
getLabel: (row: T) => string;
|
|
287
|
+
render?: (ctx: LabelRowRenderContext<T>) => F['node'];
|
|
288
|
+
height?: number | ((row: T) => number);
|
|
289
|
+
className?: GridSlotProps<F> | ((row: T) => GridSlotProps<F> | undefined);
|
|
290
|
+
sticky?: boolean;
|
|
291
|
+
sortMode?: LabelRowSortMode;
|
|
292
|
+
keepEmptySections?: boolean;
|
|
293
|
+
exportText?: (row: T) => string | ReadonlyArray<string | number | null | undefined>;
|
|
294
|
+
};
|
|
256
295
|
export type RowDragContext = {
|
|
257
296
|
rowKey: GridRowKey;
|
|
258
297
|
sourceRowIndex: number;
|
|
@@ -560,6 +599,8 @@ export type GridClassNames<F extends GridFrameworkTypes = GridFrameworkTypes> =
|
|
|
560
599
|
groupCell?: GridSlotProps<F>;
|
|
561
600
|
detailBand?: GridSlotProps<F>;
|
|
562
601
|
detailCard?: GridSlotProps<F>;
|
|
602
|
+
labelRow?: GridSlotProps<F>;
|
|
603
|
+
labelRowContent?: GridSlotProps<F>;
|
|
563
604
|
popover?: GridSlotProps<F>;
|
|
564
605
|
menuItem?: GridSlotProps<F>;
|
|
565
606
|
tooltip?: GridSlotProps<F>;
|
|
@@ -603,9 +644,11 @@ export type CsvExportOptions = {
|
|
|
603
644
|
includeHeaders?: boolean;
|
|
604
645
|
delimiter?: string;
|
|
605
646
|
bom?: boolean;
|
|
647
|
+
includeLabelRows?: boolean;
|
|
606
648
|
};
|
|
607
649
|
export type GridExportOptions = {
|
|
608
650
|
scope?: CsvExportScope;
|
|
651
|
+
includeLabelRows?: boolean;
|
|
609
652
|
};
|
|
610
653
|
export type GridExportCell = {
|
|
611
654
|
value: unknown;
|
|
@@ -617,6 +660,7 @@ export type GridExportData = {
|
|
|
617
660
|
title: string;
|
|
618
661
|
}[];
|
|
619
662
|
rows: GridExportCell[][];
|
|
663
|
+
rowKinds?: Array<'data' | 'label'>;
|
|
620
664
|
};
|
|
621
665
|
export type GridColumnState = {
|
|
622
666
|
key: string;
|
|
@@ -713,6 +757,8 @@ export type ScrollHintOptions<T = unknown, F extends GridFrameworkTypes = GridFr
|
|
|
713
757
|
};
|
|
714
758
|
export type SpreadsheetGridProps<T, F extends GridFrameworkTypes = GridFrameworkTypes> = {
|
|
715
759
|
onStateChange?: (state: GridState) => void;
|
|
760
|
+
onFiltersChange?: (filters: GridFilterState) => void;
|
|
761
|
+
onSortChange?: (sort: GridSortState) => void;
|
|
716
762
|
onScroll?: (params: GridScrollEventParams) => void;
|
|
717
763
|
rows?: readonly T[];
|
|
718
764
|
dataSource?: ServerSideDataSource<T>;
|
|
@@ -756,7 +802,10 @@ export type SpreadsheetGridProps<T, F extends GridFrameworkTypes = GridFramework
|
|
|
756
802
|
enableGlobalFilter?: boolean;
|
|
757
803
|
enableColumnFilter?: boolean;
|
|
758
804
|
renderFilterDateInput?: (ctx: FilterDateInputContext) => F['node'];
|
|
805
|
+
getFilterOptions?: (params: GetFilterOptionsParams<T, F>) => Promise<GetFilterOptionsResult>;
|
|
759
806
|
enableSorting?: boolean;
|
|
807
|
+
manualFiltering?: boolean;
|
|
808
|
+
manualSorting?: boolean;
|
|
760
809
|
enableColumnResize?: boolean;
|
|
761
810
|
autoSizeColumns?: AutoSizeColumnsMode;
|
|
762
811
|
showCellOverflowTooltip?: boolean;
|
|
@@ -787,6 +836,7 @@ export type SpreadsheetGridProps<T, F extends GridFrameworkTypes = GridFramework
|
|
|
787
836
|
getRowClassName?: (row: T, rowIndex: number, ctx: RowStyleContext<T>) => GridSlotProps<F> | undefined;
|
|
788
837
|
detailRow?: DetailRowOptions<T, F>;
|
|
789
838
|
onExpandedDetailRowKeysChange?: (keys: GridRowKey[]) => void;
|
|
839
|
+
labelRow?: LabelRowOptions<T, F>;
|
|
790
840
|
enableRowDrag?: boolean;
|
|
791
841
|
isRowDraggable?: (row: T, ctx: RowDragContext) => boolean;
|
|
792
842
|
onRowMove?: (params: RowMoveParams<T>) => void;
|
|
@@ -6,6 +6,7 @@ export type UnboundGridTypes = {
|
|
|
6
6
|
};
|
|
7
7
|
export type CellRenderContext<T> = Core.CellRenderContext<T, UnboundGridTypes>;
|
|
8
8
|
export type DetailRowOptions<T> = Core.DetailRowOptions<T, UnboundGridTypes>;
|
|
9
|
+
export type LabelRowOptions<T> = Core.LabelRowOptions<T, UnboundGridTypes>;
|
|
9
10
|
export type CellStyleContext<T> = Core.CellStyleContext<T, UnboundGridTypes>;
|
|
10
11
|
export type HeaderRenderContext<T> = Core.HeaderRenderContext<T, UnboundGridTypes>;
|
|
11
12
|
export type CellValueFormatterParams<T> = Core.CellValueFormatterParams<T, UnboundGridTypes>;
|
package/package.json
CHANGED