@melodicdev/components 1.0.18 → 1.0.19

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
  }
@@ -12085,6 +12090,7 @@ const tableStyles = () => css`
12085
12090
  `;
12086
12091
  var TableComponent = class TableComponent$1 {
12087
12092
  constructor() {
12093
+ this._rowClickable = false;
12088
12094
  this.hasFooter = false;
12089
12095
  this.hasHeaderActions = false;
12090
12096
  this.selectable = false;
@@ -12153,6 +12159,13 @@ var TableComponent = class TableComponent$1 {
12153
12159
  onPropertyChange(name, _oldVal, _newVal) {
12154
12160
  if (name === "rows" || name === "columns") this._scroller.invalidate();
12155
12161
  }
12162
+ onInit() {
12163
+ const original = this.elementRef.addEventListener.bind(this.elementRef);
12164
+ this.elementRef.addEventListener = (type, listener, options) => {
12165
+ if (type === "ml:row-click") this._rowClickable = true;
12166
+ return original(type, listener, options);
12167
+ };
12168
+ }
12156
12169
  onCreate() {
12157
12170
  const shadow = this.elementRef.shadowRoot;
12158
12171
  if (!shadow) return;