@masterteam/components 0.0.352 → 0.0.353

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.
@@ -2890,17 +2890,20 @@ class Table {
2890
2890
  ];
2891
2891
  }
2892
2892
  /**
2893
- * True for the first destructive item, which is where the divider goes. The
2894
- * divider is rendered above it rather than below the last routine item so a
2895
- * menu that is *only* destructive does not open with a stray rule.
2893
+ * Whether a divider goes above this item: at the first destructive item, or
2894
+ * under an item flagged `dividerAfter`. The divider is rendered above an
2895
+ * item rather than below the previous one so a menu never opens or ends
2896
+ * with a stray rule (e.g. one that is *only* destructive).
2896
2897
  */
2897
2898
  isFirstDestructiveAction(row, index) {
2898
2899
  const menu = this.getMenuRowActions(row);
2899
2900
  const action = menu[index];
2900
- return (index > 0 &&
2901
- !!action &&
2902
- Table.isDestructiveAction(action) &&
2903
- !Table.isDestructiveAction(menu[index - 1]));
2901
+ if (index === 0 || !action) {
2902
+ return false;
2903
+ }
2904
+ return (!!menu[index - 1]?.dividerAfter ||
2905
+ (Table.isDestructiveAction(action) &&
2906
+ !Table.isDestructiveAction(menu[index - 1])));
2904
2907
  }
2905
2908
  /** Deleting, or anything the caller flagged `danger`. */
2906
2909
  static isDestructiveAction(action) {