var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, Prop, Element, State, Event, h, Host, Watch } from '@stencil/core';
import { InjectVegaSlimmer, slotPlaceholder, methodPlaceholder, InjectVegaGlobalSlimmer, } from 'vega-slimmer/core';
import { VegaTableRowRenderer } from './slimmers/renderers/vega-table-row-renderer';
import { VegaTableRowSelectionController } from './slimmers/controllers/vega-table-row-selection-controller';
import { VegaTableRowExpandController } from './slimmers/controllers/vega-table-row-expand-controller';
import { VegaTableRowClickController } from './slimmers/controllers/vega-table-row-click-controller';
import { sanitizeVegaComponent } from '../../../utils/component';
import { VegaTableRowStateController } from './slimmers/controllers/vega-table-row-state-controller';
import { createEventEmitSlimmer, } from '../../../helpers/event-manager/slimmers/event-emit-slimmer';
import { VegaClick, VegaExpand } from '../../../helpers/event-manager/event-id/vega-event-id';
import { ChildNodesEventPreventSlimmer } from '../../../helpers/event-manager/slimmers/child-nodes-event-prevent-slimmer';
import ResponsiveFormatFacade from '../../../helpers/formatter/responsive-map-formatter/responsive-format-facade';
import { getCurrentBreakpoint } from '../../../utils/breakpoints';
import { PageResizeObserverSlimmer } from '../../../helpers/slimmers/page-resize-observer-slimmer';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../../helpers/slimmers/component-usage-runtime-metrics';
import { createSubStateNotifySlimmer } from '../../../helpers/slimmers/sub-state/sub-state-notify-slimmer';
/**
 * @vegaVersion 1.44.0
 */
export class VegaTableRow {
  constructor() {
    this.globalSlimmers = {};
    this.vegaTableRowRenderer = new VegaTableRowRenderer();
    this.vegaTableRowSelectionController = new VegaTableRowSelectionController();
    this.vegaTableRowExpandController = new VegaTableRowExpandController();
    this.vegaTableRowClickController = new VegaTableRowClickController();
    this.vegaTableRowStateController = new VegaTableRowStateController();
    this.clickEventEmitter = createEventEmitSlimmer(VegaTableRow, VegaClick);
    this.expandEventEmitter = createEventEmitSlimmer(VegaTableRow, VegaExpand);
    this.checkboxValueChangeEventPrevent = new ChildNodesEventPreventSlimmer([VegaClick], () => this.host, undefined, true);
    this.pageResizeObserverSlimmer = new PageResizeObserverSlimmer();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    this.checkedNotifySlimmer = createSubStateNotifySlimmer(VegaTableRow, 'checked', 'watchChecked');
    this.expandedNotifySlimmer = createSubStateNotifySlimmer(VegaTableRow, 'expanded', 'watchExpanded');
    this.stripedNotifySlimmer = createSubStateNotifySlimmer(VegaTableRow, 'striped', 'watchStriped');
    this.rowDividerNotifySlimmer = createSubStateNotifySlimmer(VegaTableRow, 'rowDivider', 'watchRowDivider');
    this.currentBreakpoint = getCurrentBreakpoint();
    /**
     * Indicates whether the table has an expandable row.
     */
    this.hasExpandableRow = false;
    /**
     * Sync from {@link VegaTable.rowDraggable}
     */
    this.draggable = false;
  }
  watchSelectionType() {
    methodPlaceholder();
  }
  watchChecked() {
    methodPlaceholder();
  }
  watchExpanded() {
    methodPlaceholder();
  }
  watchStriped() {
    methodPlaceholder();
  }
  watchRowDivider() {
    methodPlaceholder();
  }
  render() {
    slotPlaceholder(h("slot", null));
    return sanitizeVegaComponent(h(Host, { class: {
        'row-divider': this.rowDivider,
        'column-divider': this.columnDivider,
        'striped': this.striped,
        [`density-${ResponsiveFormatFacade.formatCustom(this.density)}`]: true,
      } }, this.vegaTableRowRenderer.render()), this.host);
  }
  static get is() { return "vega-table-row"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-table-row.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-table-row.css"]
  }; }
  static get properties() { return {
    "rowKey": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": true,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.44.0"
          }],
        "text": "Defines a unique key for the row."
      },
      "attribute": "row-key",
      "reflect": false
    },
    "striped": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.61.0"
          }],
        "text": "Specifies whether alternate colors should be applied to the row."
      },
      "attribute": "striped",
      "reflect": false
    },
    "rowDivider": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.61.0"
          }],
        "text": "Specifies whether dividers should be displayed in the row."
      },
      "attribute": "row-divider",
      "reflect": false
    }
  }; }
  static get states() { return {
    "currentBreakpoint": {},
    "clicked": {},
    "hasExpandableRow": {},
    "expandable": {},
    "clickable": {},
    "paddingX": {},
    "selectionType": {},
    "checked": {},
    "expanded": {},
    "columnDivider": {},
    "density": {},
    "draggable": {}
  }; }
  static get events() { return [{
      "method": "vegaClick",
      "name": "vegaClick",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.44.0"
          }],
        "text": "An event emitter notifying that the row has been clicked."
      },
      "complexType": {
        "original": "VegaTableRowClickEvent",
        "resolved": "{ rowKey: string; }",
        "references": {
          "VegaTableRowClickEvent": {
            "location": "import",
            "path": "../interface"
          }
        }
      }
    }, {
      "method": "click",
      "name": "click",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.0.0"
          }],
        "text": "An event emitter notifying that the row has been clicked."
      },
      "complexType": {
        "original": "VegaTableRowClickEvent",
        "resolved": "{ rowKey: string; }",
        "references": {
          "VegaTableRowClickEvent": {
            "location": "import",
            "path": "../interface"
          }
        }
      }
    }, {
      "method": "vegaExpand",
      "name": "vegaExpand",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.20.0"
          }],
        "text": "An event emitter notifying that the expand icon has been clicked."
      },
      "complexType": {
        "original": "VegaTableRowExpandEvent",
        "resolved": "{ rowKey: string; expanded: boolean; }",
        "references": {
          "VegaTableRowExpandEvent": {
            "location": "import",
            "path": "../interface"
          }
        }
      }
    }, {
      "method": "expand",
      "name": "expand",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.20.0"
          }],
        "text": "An event emitter notifying that the expand icon has been clicked."
      },
      "complexType": {
        "original": "VegaTableRowExpandEvent",
        "resolved": "{ rowKey: string; expanded: boolean; }",
        "references": {
          "VegaTableRowExpandEvent": {
            "location": "import",
            "path": "../interface"
          }
        }
      }
    }]; }
  static get elementRef() { return "host"; }
  static get watchers() { return [{
      "propName": "selectionType",
      "methodName": "watchSelectionType"
    }, {
      "propName": "checked",
      "methodName": "watchChecked"
    }, {
      "propName": "expanded",
      "methodName": "watchExpanded"
    }, {
      "propName": "striped",
      "methodName": "watchStriped"
    }, {
      "propName": "rowDivider",
      "methodName": "watchRowDivider"
    }]; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaTableRow.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "vegaTableRowRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "vegaTableRowSelectionController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "vegaTableRowExpandController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "vegaTableRowClickController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "vegaTableRowStateController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "clickEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "expandEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "checkboxValueChangeEventPrevent", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "pageResizeObserverSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "checkedNotifySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "expandedNotifySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "stripedNotifySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaTableRow.prototype, "rowDividerNotifySlimmer", void 0);
