UNPKG

webwriter-chart

Version:

ww-chart is an interactive data visualization widget for the WebWriter tool that implements various charts and diagrams for static and exploratory data visualization.

50 lines (49 loc) 2.01 kB
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 { html } from "lit"; import { customElement, property } from "lit/decorators.js"; import "@shoelace-style/shoelace/dist/components/switch/switch.js"; import { LitElementWw } from "@webwriter/lit"; import SlSwitch from "@shoelace-style/shoelace/dist/components/switch/switch.js"; let Switch = class Switch extends LitElementWw { #checked_accessor_storage = false; get checked() { return this.#checked_accessor_storage; } set checked(value) { this.#checked_accessor_storage = value; } #disabled_accessor_storage = false; get disabled() { return this.#disabled_accessor_storage; } set disabled(value) { this.#disabled_accessor_storage = value; } change(e) { this.checked = e.target.checked; this.dispatchEvent(new CustomEvent("wwci-change", { detail: { value: this.checked }, composed: true, })); } render() { return html ` <sl-switch ?checked=${this.checked} ?disabled=${this.disabled} @sl-change=${this.change} ><slot></slot ></sl-switch>`; } static get scopedElements() { return { "sl-switch": SlSwitch, }; } }; __decorate([ property({ type: Boolean }) ], Switch.prototype, "checked", null); __decorate([ property({ type: Boolean }) ], Switch.prototype, "disabled", null); Switch = __decorate([ customElement("wwci-switch") ], Switch); export { Switch };