mn-angular-lib 1.0.146 → 1.0.147

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mn-angular-lib",
3
- "version": "1.0.146",
3
+ "version": "1.0.147",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3",
@@ -4261,7 +4261,14 @@ type MnTableRowAction<T> = {
4261
4261
  icon?: TemplateRef<unknown>;
4262
4262
  /** Invoked with the row when the action is chosen. */
4263
4263
  run: (row: T) => void;
4264
- /** Predicate deciding whether the action is disabled for a given row. */
4264
+ /**
4265
+ * Predicate deciding whether the action is hidden for a given row. A hidden action is
4266
+ * dropped entirely for that row (not shown, not counted). When every action is hidden
4267
+ * for a row its cell is left empty — no buttons and no ⋯ menu. Use this for "row 1 has
4268
+ * actions, row 2 doesn't", or per-permission actions (e.g. only admins can delete).
4269
+ */
4270
+ hidden?: (row: T) => boolean;
4271
+ /** Predicate deciding whether the action is disabled (shown but non-interactive) for a row. */
4265
4272
  disabled?: (row: T) => boolean;
4266
4273
  /**
4267
4274
  * Tints the action's button and its ⋯-menu item. Defaults to `'secondary'` (or
@@ -4661,14 +4668,18 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
4661
4668
  getCellValue(column: ColumnDefinition<T>, row: T): string;
4662
4669
  /** Returns the small-screen cell value for a column with cellSm defined. */
4663
4670
  getCellSmValue(column: ColumnDefinition<T>, row: T): string;
4664
- /**
4665
- * Whether an actions column should offer the collapsing ⋯ variant: only when it has at
4666
- * least its threshold's worth of actions (default 3). Below that, the inline buttons
4667
- * stay put at every width — one or two fit on a phone. The width switch itself is a
4668
- * pure container query in the template; this only decides whether to render the ⋯ path
4669
- * at all.
4670
- */
4671
- shouldCollapseActions(column: ColumnDefinition<T>): boolean;
4671
+ /** The actions visible for a given row — those whose `hidden(row)` is not true. */
4672
+ visibleRowActions(column: ColumnDefinition<T>, row: T): MnTableRowAction<T>[];
4673
+ /** Whether a row has any visible actions at all; when false its cell is left empty. */
4674
+ hasRowActions(column: ColumnDefinition<T>, row: T): boolean;
4675
+ /**
4676
+ * Whether a row's actions should offer the collapsing ⋯ variant: only when it has at
4677
+ * least its threshold's worth of *visible* actions (default 3). Below that, the inline
4678
+ * buttons stay put at every width — one or two fit on a phone. The width switch itself
4679
+ * is a pure container query in the template; this only decides whether to render the ⋯
4680
+ * path at all, per row.
4681
+ */
4682
+ shouldCollapseActions(column: ColumnDefinition<T>, row: T): boolean;
4672
4683
  /** The resolved label for an inline action button (translation key wins once resolved). */
4673
4684
  rowActionLabel(action: MnTableRowAction<T>): string;
4674
4685
  /** Whether an inline action button should render its icon. */
@@ -4691,7 +4702,7 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
4691
4702
  runRowAction(action: MnTableRowAction<T>, row: T): void;
4692
4703
  /** A stable, unique element id for a row's actions dropdown (aria wiring). */
4693
4704
  actionsDropdownId(column: ColumnDefinition<T>, row: T): string;
4694
- /** Maps a column's actions to mn-dropdown commands, binding the row into each. */
4705
+ /** Maps a row's visible actions to mn-dropdown commands, binding the row into each. */
4695
4706
  rowDropdownActions(column: ColumnDefinition<T>, row: T): MnDropdownAction[];
4696
4707
  trackByKey: (_index: number, column: ColumnDefinition<T>) => string;
4697
4708
  /** True when the table is narrower than the filter-collapse breakpoint. */