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, Host, h, Element, Prop, Watch } from '@stencil/core';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, methodPlaceholder, } from 'vega-slimmer/core';
import { VegaTextTooltipRenderer } from './slimmers/renderers/vega-text-tooltip-renderer';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
/**
 * @vegaVersion 1.9.1
 */
/**
 * This is an internal used component and shouldn't be used by client,
 *    it doesn't show up in storybook either.
 */
export class VegaText {
  constructor() {
    this.globalSlimmers = {};
    this.tooltipRenderer = new VegaTextTooltipRenderer();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    /**
     * Specifies the behavior of text when it exceeds the
     *    available space within its container.
     *
     * @vegaVersion 1.18.0
     */
    this.overflow = 'newline';
  }
  /**
   * The below method is e2e-test covered in
   * @see{module:vega-text-with-tooltip-placement}
   */
  /* istanbul ignore next */
  /** Watching the tooltip prop. */
  watchTooltip() {
    methodPlaceholder();
  }
  componentDidLoad() {
    methodPlaceholder();
  }
  render() {
    return (h(Host, { class: {
        'vega-container-text-ellipsis': this.overflow === 'ellipsis',
        'vega-container-text-newline': this.overflow === 'newline',
      } },
      h("slot", null)));
  }
  static get is() { return "vega-text"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-text.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-text.css"]
  }; }
  static get properties() { return {
    "overflow": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "'ellipsis' | 'newline'",
        "resolved": "\"ellipsis\" | \"newline\"",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.18.0"
          }],
        "text": "Specifies the behavior of text when it exceeds the\n   available space within its container."
      },
      "attribute": "overflow",
      "reflect": false,
      "defaultValue": "'newline'"
    },
    "tooltip": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "VegaTextTooltipProps",
        "resolved": "{ minWidth?: ResponsiveType<SizeType>; maxWidth?: ResponsiveType<SizeType>; placement?: ElementAppenderPlacementType; }",
        "references": {
          "VegaTextTooltipProps": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.0.0"
          }],
        "text": "Specifies the properties of the vega-tooltip in vega-text."
      }
    }
  }; }
  static get elementRef() { return "host"; }
  static get watchers() { return [{
      "propName": "tooltip",
      "methodName": "watchTooltip"
    }]; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaText.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaText.prototype, "tooltipRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaText.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
