@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
108 lines (107 loc) • 2.74 kB
JavaScript
/*!
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
* v1.5.0-next.4
*/
import { Fragment, h } from "@stencil/core";
/**
* @slot - A slot for adding `calcite-option`s.
*/
export class OptionGroup {
constructor() {
this.disabled = false;
this.label = undefined;
}
handlePropChange() {
this.calciteInternalOptionGroupChange.emit();
}
//--------------------------------------------------------------------------
//
// Render Methods
//
//--------------------------------------------------------------------------
render() {
return (h(Fragment, null, h("div", null, this.label), h("slot", null)));
}
static get is() { return "calcite-option-group"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() {
return {
"$": ["option-group.scss"]
};
}
static get styleUrls() {
return {
"$": ["option-group.css"]
};
}
static get properties() {
return {
"disabled": {
"type": "boolean",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "When `true`, interaction is prevented and the component is displayed with lower opacity."
},
"attribute": "disabled",
"reflect": true,
"defaultValue": "false"
},
"label": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": true,
"optional": false,
"docs": {
"tags": [],
"text": "Accessible name for the component."
},
"attribute": "label",
"reflect": false
}
};
}
static get events() {
return [{
"method": "calciteInternalOptionGroupChange",
"name": "calciteInternalOptionGroupChange",
"bubbles": true,
"cancelable": false,
"composed": true,
"docs": {
"tags": [{
"name": "internal",
"text": undefined
}],
"text": ""
},
"complexType": {
"original": "void",
"resolved": "void",
"references": {}
}
}];
}
static get watchers() {
return [{
"propName": "disabled",
"methodName": "handlePropChange"
}, {
"propName": "label",
"methodName": "handlePropChange"
}];
}
}