@brickclay-org/ui 0.0.77 → 0.0.78

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/index.d.ts CHANGED
@@ -631,12 +631,19 @@ interface TableColumn<T = any> {
631
631
  icons?: TableIcon[] | ((row: T) => TableIcon[]);
632
632
  /** show / hide both th + td */
633
633
  visible?: boolean;
634
+ actions?: TableAction[] | ((row: T) => TableAction[]);
634
635
  }
635
- interface TableAction {
636
+ interface TableAction<T = any> {
636
637
  name: string;
637
638
  icon: string;
638
639
  tooltip: string;
639
640
  hasPermission: boolean;
641
+ /** Dynamic visibility */
642
+ visible?: boolean | ((row: T) => boolean);
643
+ /** Disabled state */
644
+ disabled?: boolean | ((row: T) => boolean);
645
+ /** Click handler */
646
+ onClick?: (row: T) => void;
640
647
  }
641
648
  interface TableBadge {
642
649
  label: string;
@@ -657,7 +664,7 @@ declare class BkGrid<T = any> {
657
664
  draggable: boolean;
658
665
  columns: TableColumn<T>[];
659
666
  result: T[];
660
- actions: TableAction[];
667
+ actions: TableAction<T>[] | ((row: T) => TableAction<T>[]);
661
668
  customClass: string;
662
669
  actionClick: EventEmitter<{
663
670
  action: string;
@@ -676,12 +683,15 @@ declare class BkGrid<T = any> {
676
683
  sort(column: TableColumn<T>, index: number): void;
677
684
  isColumnVisible(column: TableColumn<T>): boolean;
678
685
  getCellValue(row: T, column: TableColumn<T>): string;
679
- emitAction(action: TableAction, row: T): void;
686
+ getBadge(row: T, column: TableColumn<T>): TableBadge | undefined;
687
+ getIcons(row: T, column: TableColumn<T>): TableIcon[];
688
+ getRowActions(row: T, column?: TableColumn<T>): TableAction<T>[];
689
+ isActionVisible(action: TableAction<T>, row: T): boolean;
690
+ isActionDisabled(action: TableAction<T>, row: T): boolean;
691
+ emitAction(action: TableAction<T>, row: T): void;
680
692
  dropList(event: CdkDragDrop<T[]>): void;
681
693
  onDragMoved(event: CdkDragMove<any>): void;
682
694
  onDragStart(event: CdkDragStart<any>): void;
683
- getBadge(row: T, column: TableColumn<T>): TableBadge | undefined;
684
- getIcons(row: T, column: TableColumn<T>): TableIcon[];
685
695
  static ɵfac: i0.ɵɵFactoryDeclaration<BkGrid<any>, never>;
686
696
  static ɵcmp: i0.ɵɵComponentDeclaration<BkGrid<any>, "bk-grid", never, { "draggable": { "alias": "draggable"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "result": { "alias": "result"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "customClass": { "alias": "customClass"; "required": false; }; }, { "actionClick": "actionClick"; "sortChange": "sortChange"; "dragDropChange": "dragDropChange"; }, never, never, true, never>;
687
697
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "ng-add": {
6
6
  "save": "dependencies"