calcite-option-group.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client/index.js';
  7. const optionGroupCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block}";
  8. const OptionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  9. constructor() {
  10. super();
  11. this.__registerHost();
  12. this.__attachShadow();
  13. this.calciteInternalOptionGroupChange = createEvent(this, "calciteInternalOptionGroupChange", 6);
  14. //--------------------------------------------------------------------------
  15. //
  16. // Properties
  17. //
  18. //--------------------------------------------------------------------------
  19. /**
  20. * When `true`, interaction is prevented and the component is displayed with lower opacity.
  21. */
  22. this.disabled = false;
  23. }
  24. handlePropChange() {
  25. this.calciteInternalOptionGroupChange.emit();
  26. }
  27. //--------------------------------------------------------------------------
  28. //
  29. // Render Methods
  30. //
  31. //--------------------------------------------------------------------------
  32. render() {
  33. return (h(Fragment, null, h("div", null, this.label), h("slot", null)));
  34. }
  35. static get watchers() { return {
  36. "disabled": ["handlePropChange"],
  37. "label": ["handlePropChange"]
  38. }; }
  39. static get style() { return optionGroupCss; }
  40. }, [1, "calcite-option-group", {
  41. "disabled": [516],
  42. "label": [1]
  43. }]);
  44. function defineCustomElement$1() {
  45. if (typeof customElements === "undefined") {
  46. return;
  47. }
  48. const components = ["calcite-option-group"];
  49. components.forEach(tagName => { switch (tagName) {
  50. case "calcite-option-group":
  51. if (!customElements.get(tagName)) {
  52. customElements.define(tagName, OptionGroup);
  53. }
  54. break;
  55. } });
  56. }
  57. defineCustomElement$1();
  58. const CalciteOptionGroup = OptionGroup;
  59. const defineCustomElement = defineCustomElement$1;
  60. export { CalciteOptionGroup, defineCustomElement };