@stenajs-webui/grid 19.0.0-next.2 → 19.0.0-next.21
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/features/standard-table/components/TextCell.d.ts +3 -0
- package/dist/features/standard-table/config/StandardTableColumnConfig.d.ts +8 -1
- package/dist/features/standard-table/config/StandardTableConfig.d.ts +14 -1
- package/dist/features/standard-table/helpers/cell-renderers/editable-text-cell/EditableTextCell.d.ts +2 -1
- package/dist/features/table-ui/components/table/SortOrderIcon.d.ts +1 -1
- package/dist/index.es.js +1503 -1448
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +11 -9
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
import { UseGridCellOptions, UseGridCellResult } from "../../grid-cell/hooks/UseGridCell";
|
|
3
4
|
import { SortOrderIconVariant } from "../../table-ui/components/table/SortOrderIcon";
|
|
4
5
|
import { StandardTableOnKeyDownArgs } from "./StandardTableConfig";
|
|
5
|
-
import
|
|
6
|
+
import { TextSize } from "@stenajs-webui/core";
|
|
6
7
|
export declare type StandardTableColumnConfig<TItem, TItemValue, TColumnKey extends string> = StandardTableColumnOptions<TItem, TItemValue, TColumnKey> & StandardTableColumnOptionsWithNoGroups & ItemValueResolver<TItem, TItemValue>;
|
|
7
8
|
export declare type StandardTableColumnConfigWithGroups<TItem, TItemValue, TColumnKey extends string> = StandardTableColumnOptions<TItem, TItemValue, TColumnKey> & ItemValueResolver<TItem, TItemValue>;
|
|
8
9
|
export interface StandardTableColumnOptionsWithNoGroups {
|
|
@@ -142,11 +143,17 @@ export interface StandardTableCellRendererArgObject<TItemValue, TItem> {
|
|
|
142
143
|
gridCell: UseGridCellResult<string>;
|
|
143
144
|
isEditable?: boolean;
|
|
144
145
|
isSelected: boolean;
|
|
146
|
+
textSize?: TextSize;
|
|
145
147
|
/**
|
|
146
148
|
* The z-index used for that cell. Usable if the cell has a popover which should get same z-index for example.
|
|
147
149
|
*/
|
|
148
150
|
zIndex?: number | string;
|
|
149
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Default renderer. This is defined in config, not for a specific column.
|
|
154
|
+
* Therefor, it can not know "value: TItemValue", since it has not been defined yet.
|
|
155
|
+
*/
|
|
156
|
+
export declare type DefaultStandardTableCellRenderer<TItem> = (arg: StandardTableCellRendererArgObject<unknown, TItem>) => ReactNode;
|
|
150
157
|
export declare type BackgroundResolver<TItem> = (item: TItem) => string | undefined;
|
|
151
158
|
export interface ItemValueResolver<TItem, TItemValue> {
|
|
152
159
|
itemValueResolver: (item: TItem) => TItemValue;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { UseGridCellOptions } from "../../grid-cell/hooks/UseGridCell";
|
|
3
3
|
import { SortOrderIconVariant } from "../../table-ui/components/table/SortOrderIcon";
|
|
4
|
-
import { StandardTableColumnConfig, StandardTableColumnConfigWithGroups } from "./StandardTableColumnConfig";
|
|
4
|
+
import { DefaultStandardTableCellRenderer, StandardTableColumnConfig, StandardTableColumnConfigWithGroups } from "./StandardTableColumnConfig";
|
|
5
5
|
import { StandardTableColumnGroupConfig } from "./StandardTableColumnGroupConfig";
|
|
6
|
+
import { TextSize } from "@stenajs-webui/core";
|
|
6
7
|
export interface RowExpansionArgs {
|
|
7
8
|
onRequestCollapse?: () => void;
|
|
8
9
|
}
|
|
@@ -149,6 +150,18 @@ export interface StandardTableConfigBase<TItem, TColumnKey extends string> {
|
|
|
149
150
|
* @default amount
|
|
150
151
|
*/
|
|
151
152
|
sortOrderIconVariant?: SortOrderIconVariant;
|
|
153
|
+
/**
|
|
154
|
+
* This can be used to override default text renderer for the whole table.
|
|
155
|
+
* Column cellRenderer will still override this. Since this is global for the table, and not local to a column,
|
|
156
|
+
* the type of itemValue can not be known. It should use `label` as source of text instead.
|
|
157
|
+
* If omitted, TextCell is used as usual.
|
|
158
|
+
*/
|
|
159
|
+
defaultCellRenderer?: DefaultStandardTableCellRenderer<TItem>;
|
|
160
|
+
/**
|
|
161
|
+
* This config specifies the text size to be used by the default TextCell component.
|
|
162
|
+
* If omitted, "normal" is used.
|
|
163
|
+
*/
|
|
164
|
+
defaultTextSize?: TextSize;
|
|
152
165
|
}
|
|
153
166
|
export interface RowBackgroundResolverColorCombination {
|
|
154
167
|
background: string;
|
package/dist/features/standard-table/helpers/cell-renderers/editable-text-cell/EditableTextCell.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { TextSize } from "@stenajs-webui/core";
|
|
1
2
|
import { StandardTableCellRenderer } from "../../../config/StandardTableColumnConfig";
|
|
2
|
-
export declare const createStandardEditableTextCell: <TItemValue, TItem>() => StandardTableCellRenderer<TItemValue, TItem>;
|
|
3
|
+
export declare const createStandardEditableTextCell: <TItemValue, TItem>(textSize?: TextSize) => StandardTableCellRenderer<TItemValue, TItem>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconDefinition } from "@fortawesome/
|
|
1
|
+
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
export declare type SortOrderDirection = "up" | "down";
|
|
4
4
|
export declare type SortOrderIconVariant = "numeric" | "alpha" | "amount";
|