UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

34 lines (33 loc) 1.16 kB
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details. v3.2.1 */ import { c as customElement } from "../../chunks/runtime.js"; import { html } from "lit"; import { LitElement, createEvent } from "@arcgis/lumina"; import { css } from "@lit/reactive-element/css-tag.js"; const styles = css`:host{display:block}:host([hidden]){display:none}[hidden]{display:none}`; class OptionGroup extends LitElement { constructor() { super(...arguments); this.disabled = false; this.calciteInternalOptionGroupChange = createEvent({ cancelable: false }); } static { this.properties = { disabled: [7, {}, { reflect: true, type: Boolean }], label: 1 }; } static { this.styles = styles; } willUpdate(changes) { if (changes.has("disabled") && (this.hasUpdated || this.disabled !== false) || changes.has("label")) { this.calciteInternalOptionGroupChange.emit(); } } render() { return html`<div>${this.label}</div><slot></slot>`; } } customElement("calcite-option-group", OptionGroup); export { OptionGroup };