@vuu-ui/vuu-table-types 1.0.3 → 2.0.0-alpha.1

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 (2) hide show
  1. package/index.d.ts +44 -23
  2. package/package.json +4 -4
package/index.d.ts CHANGED
@@ -137,7 +137,7 @@ export interface TableCellRendererProps
137
137
  */
138
138
  export declare type ColumnLayout = "static" | "fit" | "manual";
139
139
 
140
- export interface TableAttributes {
140
+ export interface TableDisplayAttributes {
141
141
  /**
142
142
  * In the case of checkbox selection, allows width of checkbox columns to be specified
143
143
  */
@@ -146,7 +146,6 @@ export interface TableAttributes {
146
146
  columnFormatHeader?: "capitalize" | "uppercase";
147
147
  columnLayout?: ColumnLayout;
148
148
  columnSeparators?: boolean;
149
- // showHighlightedRow?: boolean;
150
149
  rowSeparators?: boolean;
151
150
  /**
152
151
  * Selection Bookends style the left and right edge of a selection block.
@@ -162,9 +161,13 @@ export interface TableAttributes {
162
161
  * edited using Settings Editors (Table and Column) and can be persisted
163
162
  * across sessions.
164
163
  */
165
- export interface TableConfig extends TableAttributes {
164
+ export declare type TableConfig = TableDisplayAttributes & {
166
165
  columns: readonly ColumnDescriptor[];
167
166
  rowClassNameGenerators?: string[];
167
+ };
168
+ export interface GridConfig extends TableConfig {
169
+ headings: TableHeadings;
170
+ selectionBookendWidth?: number;
168
171
  }
169
172
 
170
173
  // TODO tidy up this definition, currently split beween here and data-types
@@ -401,20 +404,8 @@ export declare type GridAction =
401
404
  | GridActionResizeCol
402
405
  | GridActionSelection;
403
406
 
404
- /**
405
- * Describes the props for a Column Configuration Editor, for which
406
- * an implementation is provided in vuu-table-extras
407
- */
408
- export interface ColumnSettingsProps {
409
- column: ColumnDescriptor;
410
- onConfigChange: (config: TableConfig) => void;
411
- onCancelCreateColumn: () => void;
412
- onCreateCalculatedColumn: (column: ColumnDescriptor) => void;
413
- tableConfig: TableConfig;
414
- vuuTable: VuuTable;
415
- }
416
-
417
407
  export interface ColumnListPermissions {
408
+ allowCalculatedColumns?: boolean;
418
409
  allowColumnSearch?: boolean;
419
410
  allowHideColumns?: boolean;
420
411
  allowRemoveColumns?: boolean;
@@ -422,11 +413,10 @@ export interface ColumnListPermissions {
422
413
  allowSelectAll?: boolean;
423
414
  }
424
415
 
425
- export interface TableSettingsPermissions extends ColumnListPermissions {
416
+ export interface TableSettingsPermissions {
426
417
  allowColumnLabelCase?: boolean;
427
418
  allowColumnDefaultWidth?: boolean;
428
419
  allowGridSeparators?: boolean;
429
- allowCalculatedColumns?: boolean;
430
420
  }
431
421
 
432
422
  /**
@@ -522,23 +512,54 @@ export interface HeaderCellProps
522
512
  showColumnHeaderMenus?: ShowColumnHeaderNMenus;
523
513
  }
524
514
 
525
- export interface TableConfigChangeColumnRemoved {
515
+ export interface TableConfigCalculatedColumnAdded {
516
+ type: "calculated-column-added";
517
+ column: ColumnDescriptor;
518
+ }
519
+ export interface TableConfigColumnAdded {
520
+ type: "column-added";
521
+ column: ColumnDescriptor;
522
+ }
523
+ export interface TableConfigColumnMoved {
524
+ type: "column-moved";
525
+ columnName: string;
526
+ columns: ColumnDescriptor[];
527
+ }
528
+ export interface TableConfigColumnRemoved {
526
529
  type: "column-removed";
527
530
  column: ColumnDescriptor;
528
531
  }
532
+ export interface TableConfigColumnResized {
533
+ type: "column-resized";
534
+ column: ColumnDescriptor;
535
+ width: number;
536
+ }
537
+ export interface TableConfigColumnsHidden {
538
+ type: "columns-hidden";
539
+ columns: ColumnDescriptor[];
540
+ }
529
541
 
530
- export interface TableConfigChangeColumnPinned {
542
+ export interface TableConfigColumnPinned {
531
543
  type: "column-pinned";
532
544
  column: ColumnDescriptor;
533
545
  }
546
+ export interface TableConfigSettingsPanel {
547
+ type: "settings-panel";
548
+ }
534
549
 
535
550
  export declare type TableConfigChangeType =
536
- | TableConfigChangeColumnRemoved
537
- | TableConfigChangeColumnPinned;
551
+ | TableConfigCalculatedColumnAdded
552
+ | TableConfigColumnAdded
553
+ | TableConfigColumnMoved
554
+ | TableConfigColumnRemoved
555
+ | TableConfigColumnResized
556
+ | TableConfigColumnPinned
557
+ | TableConfigColumnsHidden
558
+ | TableConfigSettingsPanel;
538
559
 
539
560
  export declare type TableConfigChangeHandler = (
540
561
  config: TableConfig,
541
- configChangeType?: TableConfigChangeType,
562
+ configChangeType: TableConfigChangeType,
542
563
  ) => void;
543
564
 
544
565
  export declare type CustomHeaderComponent = ComponentType<BaseRowProps>;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-table-types",
3
- "version": "1.0.3",
3
+ "version": "2.0.0-alpha.1",
4
4
  "devDependencies": {
5
- "@vuu-ui/vuu-data-types": "1.0.3",
6
- "@vuu-ui/vuu-filter-types": "1.0.3",
7
- "@vuu-ui/vuu-protocol-types": "1.0.3"
5
+ "@vuu-ui/vuu-data-types": "2.0.0-alpha.1",
6
+ "@vuu-ui/vuu-filter-types": "2.0.0-alpha.1",
7
+ "@vuu-ui/vuu-protocol-types": "2.0.0-alpha.1"
8
8
  },
9
9
  "author": "heswell",
10
10
  "license": "Apache-2.0",