option-group.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*!
  2. * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
  4. * v1.0.0-beta.97
  5. */
  6. import { h, Fragment } from "@stencil/core";
  7. /**
  8. * @slot - A slot for adding `calcite-option`s.
  9. */
  10. export class OptionGroup {
  11. constructor() {
  12. //--------------------------------------------------------------------------
  13. //
  14. // Properties
  15. //
  16. //--------------------------------------------------------------------------
  17. /**
  18. * When `true`, interaction is prevented and the component is displayed with lower opacity.
  19. */
  20. this.disabled = false;
  21. }
  22. handlePropChange() {
  23. this.calciteInternalOptionGroupChange.emit();
  24. }
  25. //--------------------------------------------------------------------------
  26. //
  27. // Render Methods
  28. //
  29. //--------------------------------------------------------------------------
  30. render() {
  31. return (h(Fragment, null, h("div", null, this.label), h("slot", null)));
  32. }
  33. static get is() { return "calcite-option-group"; }
  34. static get encapsulation() { return "shadow"; }
  35. static get originalStyleUrls() {
  36. return {
  37. "$": ["option-group.scss"]
  38. };
  39. }
  40. static get styleUrls() {
  41. return {
  42. "$": ["option-group.css"]
  43. };
  44. }
  45. static get properties() {
  46. return {
  47. "disabled": {
  48. "type": "boolean",
  49. "mutable": false,
  50. "complexType": {
  51. "original": "boolean",
  52. "resolved": "boolean",
  53. "references": {}
  54. },
  55. "required": false,
  56. "optional": false,
  57. "docs": {
  58. "tags": [],
  59. "text": "When `true`, interaction is prevented and the component is displayed with lower opacity."
  60. },
  61. "attribute": "disabled",
  62. "reflect": true,
  63. "defaultValue": "false"
  64. },
  65. "label": {
  66. "type": "string",
  67. "mutable": false,
  68. "complexType": {
  69. "original": "string",
  70. "resolved": "string",
  71. "references": {}
  72. },
  73. "required": true,
  74. "optional": false,
  75. "docs": {
  76. "tags": [],
  77. "text": "Accessible name for the component."
  78. },
  79. "attribute": "label",
  80. "reflect": false
  81. }
  82. };
  83. }
  84. static get events() {
  85. return [{
  86. "method": "calciteInternalOptionGroupChange",
  87. "name": "calciteInternalOptionGroupChange",
  88. "bubbles": true,
  89. "cancelable": false,
  90. "composed": true,
  91. "docs": {
  92. "tags": [{
  93. "name": "internal",
  94. "text": undefined
  95. }],
  96. "text": ""
  97. },
  98. "complexType": {
  99. "original": "void",
  100. "resolved": "void",
  101. "references": {}
  102. }
  103. }];
  104. }
  105. static get watchers() {
  106. return [{
  107. "propName": "disabled",
  108. "methodName": "handlePropChange"
  109. }, {
  110. "propName": "label",
  111. "methodName": "handlePropChange"
  112. }];
  113. }
  114. }