@melodicdev/components 1.0.18 → 1.0.20

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.
@@ -11734,6 +11734,7 @@ function tableTemplate(c) {
11734
11734
  [`ml-table--${c.size}`]: true,
11735
11735
  "ml-table--striped": c.striped,
11736
11736
  "ml-table--hoverable": c.hoverable,
11737
+ "ml-table--row-clickable": c._rowClickable,
11737
11738
  "ml-table--sticky-header": c.stickyHeader,
11738
11739
  "ml-table--virtual": c.virtual
11739
11740
  })}>
@@ -11977,6 +11978,10 @@ const tableStyles = () => css`
11977
11978
  background-color: var(--ml-color-surface-sunken);
11978
11979
  }
11979
11980
 
11981
+ .ml-table--row-clickable .ml-table__row {
11982
+ cursor: pointer;
11983
+ }
11984
+
11980
11985
  .ml-table__row--selected {
11981
11986
  background-color: var(--ml-color-primary-subtle, rgba(99, 102, 241, 0.04));
11982
11987
  }
@@ -12083,8 +12088,15 @@ const tableStyles = () => css`
12083
12088
  padding: var(--ml-space-2) var(--ml-space-4);
12084
12089
  }
12085
12090
  `;
12091
+ var _rowClickTargets = /* @__PURE__ */ new WeakSet();
12092
+ var _origAddEventListener = EventTarget.prototype.addEventListener;
12093
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
12094
+ if (type === "ml:row-click") _rowClickTargets.add(this);
12095
+ _origAddEventListener.call(this, type, listener, options);
12096
+ };
12086
12097
  var TableComponent = class TableComponent$1 {
12087
12098
  constructor() {
12099
+ this._rowClickable = false;
12088
12100
  this.hasFooter = false;
12089
12101
  this.hasHeaderActions = false;
12090
12102
  this.selectable = false;
@@ -12153,6 +12165,9 @@ var TableComponent = class TableComponent$1 {
12153
12165
  onPropertyChange(name, _oldVal, _newVal) {
12154
12166
  if (name === "rows" || name === "columns") this._scroller.invalidate();
12155
12167
  }
12168
+ onInit() {
12169
+ this._rowClickable = _rowClickTargets.has(this.elementRef);
12170
+ }
12156
12171
  onCreate() {
12157
12172
  const shadow = this.elementRef.shadowRoot;
12158
12173
  if (!shadow) return;