@kanunilabs/datagrid-react 1.8.3 → 1.8.4
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/index.cjs +3 -3
- package/dist/index.d.cts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +3 -3
- package/dist/styles.css +12 -0
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, RemoteDistinctList, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, ValidationRule, CrudHandlers, EditingPermissions, NewRowPosition, RowEditSession, LookupMatchMode } from '@kanunilabs/datagrid-core';
|
|
3
|
+
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, RemoteDistinctList, PortalKind, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, ValidationRule, CrudHandlers, EditingPermissions, NewRowPosition, RowEditSession, LookupMatchMode } from '@kanunilabs/datagrid-core';
|
|
4
4
|
export { BusyChangedEvent, BusyPhase, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, ContentReadyEvent, CustomFilterOperator, CustomFilterOperatorId, DEFAULT_ROW_HEIGHT, DENSITY_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, FilterChangedEvent, FilterCondition, FilterGroupNode, FilterNode, FilterOperator, FocusedRowChangedEvent, GRID_COLOR_SCHEMES, GRID_PALETTES, GRID_THEMES, GridColorScheme, GridColumnDef, GridDataType, GridDensity, GridEventMap, GridPalette, GridPaletteName, GridRowData, GridStateStore, GridTheme, GridThemeName, GridViewState, GroupRowNode, GroupingConfig, HeaderBandCell, InferColumnsOptions, LoadOptions, LoadResult, LookupItem, NewRowPosition, PortalContainer, RowDropPosition, RowKey, RowNode, SUMMARY_TYPE_LABEL, ScrollingConfig, SelectionDescriptor, SortChangedEvent, SortDescriptor, SortDirection, StateStoringConfig, SummaryDef, SummaryType, THEME_ROW_HEIGHT, ToolbarOptions, ToolbarSearchOptions, ViewportChangedEvent, VirtualWindow, VirtualWindowEngine, allowedSummaryTypes, andFilters, attachStateStoring, bandDepth, bandPath, computeColumnLayout, computeHeaderBands, createRestDataSource, describeFilter, downloadBlob, fillText, filterInputFromNode, formatSummaryValue, humanizeField, importCsv, inferColumns, isDataRow, isDataSource, isFilterGroup, isGroupRow, isPackagedTheme, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } from '@kanunilabs/datagrid-core';
|
|
5
5
|
|
|
6
6
|
/** Formats an export menu can offer. */
|
|
@@ -649,7 +649,9 @@ interface DataGridProps<TRow = GridRowData> extends Omit<DataGridCoreConfig<TRow
|
|
|
649
649
|
* chevron is not rendered, because a control that opens nothing is worse than
|
|
650
650
|
* no control. `EnterpriseDataGrid` wires this to its own builder.
|
|
651
651
|
*/
|
|
652
|
-
onOpenFilterBuilder?: (
|
|
652
|
+
onOpenFilterBuilder?: (context?: {
|
|
653
|
+
columnId?: string;
|
|
654
|
+
}) => void;
|
|
653
655
|
/** Funnel button per header opening the distinct-value checklist popup. */
|
|
654
656
|
headerFilter?: boolean;
|
|
655
657
|
/**
|
|
@@ -1501,6 +1503,12 @@ interface GridHeaderFilterPopupProps {
|
|
|
1501
1503
|
*/
|
|
1502
1504
|
onApply: (filter: FilterNode | null) => void;
|
|
1503
1505
|
onClose: () => void;
|
|
1506
|
+
/**
|
|
1507
|
+
* Shows a "(Custom…)" entry above the list that opens the filter builder on
|
|
1508
|
+
* this column. Given only where a builder can be opened (the app's
|
|
1509
|
+
* `onOpenFilterBuilder`, or the Enterprise grid's own).
|
|
1510
|
+
*/
|
|
1511
|
+
onCustom?: () => void;
|
|
1504
1512
|
/**
|
|
1505
1513
|
* `entries` is only the first page of a longer list.
|
|
1506
1514
|
*
|
|
@@ -1526,7 +1534,7 @@ interface GridHeaderFilterPopupProps {
|
|
|
1526
1534
|
pager?: RemoteDistinctList;
|
|
1527
1535
|
labels?: Partial<Record<'search' | 'selectAll' | 'clear' | 'apply' | 'cancel' | 'blank' | 'noMatch' | 'loading' | 'truncated', string>>;
|
|
1528
1536
|
}
|
|
1529
|
-
declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
|
|
1537
|
+
declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, onCustom, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
|
|
1530
1538
|
|
|
1531
1539
|
interface GridContextMenuProps<TContext> {
|
|
1532
1540
|
x: number;
|
|
@@ -1543,8 +1551,10 @@ declare function GridContextMenu<TContext>({ x, y, items, context, onClose, dark
|
|
|
1543
1551
|
interface GridPortalProps {
|
|
1544
1552
|
children: ReactNode;
|
|
1545
1553
|
dark?: boolean;
|
|
1554
|
+
/** `data-kanuni-portal`'s value: a `popup` (default) the user works in, or a `tooltip`. */
|
|
1555
|
+
kind?: PortalKind;
|
|
1546
1556
|
}
|
|
1547
|
-
declare function GridPortal({ children, dark }: GridPortalProps): react.ReactPortal | null;
|
|
1557
|
+
declare function GridPortal({ children, dark, kind }: GridPortalProps): react.ReactPortal | null;
|
|
1548
1558
|
|
|
1549
1559
|
interface GridGroupPanelProps<TRow = GridRowData> {
|
|
1550
1560
|
/** Columns offered for grouping (groupable and visible). */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, RemoteDistinctList, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, ValidationRule, CrudHandlers, EditingPermissions, NewRowPosition, RowEditSession, LookupMatchMode } from '@kanunilabs/datagrid-core';
|
|
3
|
+
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, RemoteDistinctList, PortalKind, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, ValidationRule, CrudHandlers, EditingPermissions, NewRowPosition, RowEditSession, LookupMatchMode } from '@kanunilabs/datagrid-core';
|
|
4
4
|
export { BusyChangedEvent, BusyPhase, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, ContentReadyEvent, CustomFilterOperator, CustomFilterOperatorId, DEFAULT_ROW_HEIGHT, DENSITY_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, FilterChangedEvent, FilterCondition, FilterGroupNode, FilterNode, FilterOperator, FocusedRowChangedEvent, GRID_COLOR_SCHEMES, GRID_PALETTES, GRID_THEMES, GridColorScheme, GridColumnDef, GridDataType, GridDensity, GridEventMap, GridPalette, GridPaletteName, GridRowData, GridStateStore, GridTheme, GridThemeName, GridViewState, GroupRowNode, GroupingConfig, HeaderBandCell, InferColumnsOptions, LoadOptions, LoadResult, LookupItem, NewRowPosition, PortalContainer, RowDropPosition, RowKey, RowNode, SUMMARY_TYPE_LABEL, ScrollingConfig, SelectionDescriptor, SortChangedEvent, SortDescriptor, SortDirection, StateStoringConfig, SummaryDef, SummaryType, THEME_ROW_HEIGHT, ToolbarOptions, ToolbarSearchOptions, ViewportChangedEvent, VirtualWindow, VirtualWindowEngine, allowedSummaryTypes, andFilters, attachStateStoring, bandDepth, bandPath, computeColumnLayout, computeHeaderBands, createRestDataSource, describeFilter, downloadBlob, fillText, filterInputFromNode, formatSummaryValue, humanizeField, importCsv, inferColumns, isDataRow, isDataSource, isFilterGroup, isGroupRow, isPackagedTheme, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } from '@kanunilabs/datagrid-core';
|
|
5
5
|
|
|
6
6
|
/** Formats an export menu can offer. */
|
|
@@ -649,7 +649,9 @@ interface DataGridProps<TRow = GridRowData> extends Omit<DataGridCoreConfig<TRow
|
|
|
649
649
|
* chevron is not rendered, because a control that opens nothing is worse than
|
|
650
650
|
* no control. `EnterpriseDataGrid` wires this to its own builder.
|
|
651
651
|
*/
|
|
652
|
-
onOpenFilterBuilder?: (
|
|
652
|
+
onOpenFilterBuilder?: (context?: {
|
|
653
|
+
columnId?: string;
|
|
654
|
+
}) => void;
|
|
653
655
|
/** Funnel button per header opening the distinct-value checklist popup. */
|
|
654
656
|
headerFilter?: boolean;
|
|
655
657
|
/**
|
|
@@ -1501,6 +1503,12 @@ interface GridHeaderFilterPopupProps {
|
|
|
1501
1503
|
*/
|
|
1502
1504
|
onApply: (filter: FilterNode | null) => void;
|
|
1503
1505
|
onClose: () => void;
|
|
1506
|
+
/**
|
|
1507
|
+
* Shows a "(Custom…)" entry above the list that opens the filter builder on
|
|
1508
|
+
* this column. Given only where a builder can be opened (the app's
|
|
1509
|
+
* `onOpenFilterBuilder`, or the Enterprise grid's own).
|
|
1510
|
+
*/
|
|
1511
|
+
onCustom?: () => void;
|
|
1504
1512
|
/**
|
|
1505
1513
|
* `entries` is only the first page of a longer list.
|
|
1506
1514
|
*
|
|
@@ -1526,7 +1534,7 @@ interface GridHeaderFilterPopupProps {
|
|
|
1526
1534
|
pager?: RemoteDistinctList;
|
|
1527
1535
|
labels?: Partial<Record<'search' | 'selectAll' | 'clear' | 'apply' | 'cancel' | 'blank' | 'noMatch' | 'loading' | 'truncated', string>>;
|
|
1528
1536
|
}
|
|
1529
|
-
declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
|
|
1537
|
+
declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, onCustom, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
|
|
1530
1538
|
|
|
1531
1539
|
interface GridContextMenuProps<TContext> {
|
|
1532
1540
|
x: number;
|
|
@@ -1543,8 +1551,10 @@ declare function GridContextMenu<TContext>({ x, y, items, context, onClose, dark
|
|
|
1543
1551
|
interface GridPortalProps {
|
|
1544
1552
|
children: ReactNode;
|
|
1545
1553
|
dark?: boolean;
|
|
1554
|
+
/** `data-kanuni-portal`'s value: a `popup` (default) the user works in, or a `tooltip`. */
|
|
1555
|
+
kind?: PortalKind;
|
|
1546
1556
|
}
|
|
1547
|
-
declare function GridPortal({ children, dark }: GridPortalProps): react.ReactPortal | null;
|
|
1557
|
+
declare function GridPortal({ children, dark, kind }: GridPortalProps): react.ReactPortal | null;
|
|
1548
1558
|
|
|
1549
1559
|
interface GridGroupPanelProps<TRow = GridRowData> {
|
|
1550
1560
|
/** Columns offered for grouping (groupable and visible). */
|