@vuu-ui/vuu-table-types 1.0.3 → 2.0.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.
Files changed (2) hide show
  1. package/index.d.ts +45 -29
  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
  /**
@@ -446,12 +436,7 @@ export interface TableSettingsProps {
446
436
  permissions?: TableSettingsPermissions | boolean;
447
437
  }
448
438
 
449
- export interface SettingsPermissions {
450
- allowColumnSettings: boolean;
451
- allowTableSettings: boolean | TableSettingsPermissions;
452
- }
453
-
454
- export interface ColumnMenuPermissions extends SettingsPermissions {
439
+ export interface ColumnMenuPermissions {
455
440
  allowSort?: boolean;
456
441
  allowGroup?: boolean;
457
442
  allowAggregation?: boolean;
@@ -522,23 +507,54 @@ export interface HeaderCellProps
522
507
  showColumnHeaderMenus?: ShowColumnHeaderNMenus;
523
508
  }
524
509
 
525
- export interface TableConfigChangeColumnRemoved {
510
+ export interface TableConfigCalculatedColumnAdded {
511
+ type: "calculated-column-added";
512
+ column: ColumnDescriptor;
513
+ }
514
+ export interface TableConfigColumnAdded {
515
+ type: "column-added";
516
+ column: ColumnDescriptor;
517
+ }
518
+ export interface TableConfigColumnMoved {
519
+ type: "column-moved";
520
+ columnName: string;
521
+ columns: ColumnDescriptor[];
522
+ }
523
+ export interface TableConfigColumnRemoved {
526
524
  type: "column-removed";
527
525
  column: ColumnDescriptor;
528
526
  }
527
+ export interface TableConfigColumnResized {
528
+ type: "column-resized";
529
+ column: ColumnDescriptor;
530
+ width: number;
531
+ }
532
+ export interface TableConfigColumnsHidden {
533
+ type: "columns-hidden";
534
+ columns: ColumnDescriptor[];
535
+ }
529
536
 
530
- export interface TableConfigChangeColumnPinned {
537
+ export interface TableConfigColumnPinned {
531
538
  type: "column-pinned";
532
539
  column: ColumnDescriptor;
533
540
  }
541
+ export interface TableConfigSettingsPanel {
542
+ type: "settings-panel";
543
+ }
534
544
 
535
545
  export declare type TableConfigChangeType =
536
- | TableConfigChangeColumnRemoved
537
- | TableConfigChangeColumnPinned;
546
+ | TableConfigCalculatedColumnAdded
547
+ | TableConfigColumnAdded
548
+ | TableConfigColumnMoved
549
+ | TableConfigColumnRemoved
550
+ | TableConfigColumnResized
551
+ | TableConfigColumnPinned
552
+ | TableConfigColumnsHidden
553
+ | TableConfigSettingsPanel;
538
554
 
539
555
  export declare type TableConfigChangeHandler = (
540
556
  config: TableConfig,
541
- configChangeType?: TableConfigChangeType,
557
+ configChangeType: TableConfigChangeType,
542
558
  ) => void;
543
559
 
544
560
  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",
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",
6
+ "@vuu-ui/vuu-filter-types": "2.0.0",
7
+ "@vuu-ui/vuu-protocol-types": "2.0.0"
8
8
  },
9
9
  "author": "heswell",
10
10
  "license": "Apache-2.0",