igniteui-webcomponents 4.3.0-alpha.0 → 4.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/animations/player.js +10 -6
  3. package/animations/player.js.map +1 -1
  4. package/animations/presets/fade/index.d.ts +3 -0
  5. package/animations/presets/fade/index.js +12 -0
  6. package/animations/presets/fade/index.js.map +1 -0
  7. package/animations/presets/index.d.ts +1 -0
  8. package/animations/presets/index.js +1 -0
  9. package/animations/presets/index.js.map +1 -1
  10. package/components/avatar/themes/dark/avatar.base.bootstrap.css.js +5 -3
  11. package/components/avatar/themes/dark/avatar.base.bootstrap.css.js.map +1 -1
  12. package/components/avatar/themes/light/avatar.base.css.js +5 -3
  13. package/components/avatar/themes/light/avatar.base.css.js.map +1 -1
  14. package/components/avatar/themes/light/avatar.bootstrap.css.js +5 -3
  15. package/components/avatar/themes/light/avatar.bootstrap.css.js.map +1 -1
  16. package/components/button/themes/button/dark/button.bootstrap.css.js +5 -3
  17. package/components/button/themes/button/dark/button.bootstrap.css.js.map +1 -1
  18. package/components/button/themes/button/dark/button.fluent.css.js +5 -3
  19. package/components/button/themes/button/dark/button.fluent.css.js.map +1 -1
  20. package/components/button/themes/button/dark/button.indigo.css.js +5 -3
  21. package/components/button/themes/button/dark/button.indigo.css.js.map +1 -1
  22. package/components/button/themes/button/dark/button.material.css.js +5 -3
  23. package/components/button/themes/button/dark/button.material.css.js.map +1 -1
  24. package/components/button/themes/button/light/button.bootstrap.css.js +5 -3
  25. package/components/button/themes/button/light/button.bootstrap.css.js.map +1 -1
  26. package/components/button/themes/button/light/button.fluent.css.js +5 -3
  27. package/components/button/themes/button/light/button.fluent.css.js.map +1 -1
  28. package/components/button/themes/button/light/button.indigo.css.js +5 -3
  29. package/components/button/themes/button/light/button.indigo.css.js.map +1 -1
  30. package/components/button/themes/button/light/button.material.css.js +5 -3
  31. package/components/button/themes/button/light/button.material.css.js.map +1 -1
  32. package/components/checkbox/themes/dark/checkbox.bootstrap.css.js +5 -3
  33. package/components/checkbox/themes/dark/checkbox.bootstrap.css.js.map +1 -1
  34. package/components/checkbox/themes/dark/checkbox.fluent.css.js +5 -3
  35. package/components/checkbox/themes/dark/checkbox.fluent.css.js.map +1 -1
  36. package/components/checkbox/themes/dark/checkbox.indigo.css.js +5 -3
  37. package/components/checkbox/themes/dark/checkbox.indigo.css.js.map +1 -1
  38. package/components/checkbox/themes/dark/checkbox.material.css.js +5 -3
  39. package/components/checkbox/themes/dark/checkbox.material.css.js.map +1 -1
  40. package/components/checkbox/themes/dark/switch.bootstrap.css.js +5 -3
  41. package/components/checkbox/themes/dark/switch.bootstrap.css.js.map +1 -1
  42. package/components/checkbox/themes/dark/switch.fluent.css.js +5 -3
  43. package/components/checkbox/themes/dark/switch.fluent.css.js.map +1 -1
  44. package/components/checkbox/themes/dark/switch.indigo.css.js +5 -3
  45. package/components/checkbox/themes/dark/switch.indigo.css.js.map +1 -1
  46. package/components/checkbox/themes/dark/switch.material.css.js +5 -3
  47. package/components/checkbox/themes/dark/switch.material.css.js.map +1 -1
  48. package/components/checkbox/themes/light/checkbox.base.css.js +5 -3
  49. package/components/checkbox/themes/light/checkbox.base.css.js.map +1 -1
  50. package/components/checkbox/themes/light/checkbox.bootstrap.css.js +5 -3
  51. package/components/checkbox/themes/light/checkbox.bootstrap.css.js.map +1 -1
  52. package/components/checkbox/themes/light/checkbox.fluent.css.js +5 -3
  53. package/components/checkbox/themes/light/checkbox.fluent.css.js.map +1 -1
  54. package/components/checkbox/themes/light/checkbox.indigo.css.js +5 -3
  55. package/components/checkbox/themes/light/checkbox.indigo.css.js.map +1 -1
  56. package/components/checkbox/themes/light/checkbox.material.css.js +5 -3
  57. package/components/checkbox/themes/light/checkbox.material.css.js.map +1 -1
  58. package/components/checkbox/themes/light/switch.base.css.js +5 -3
  59. package/components/checkbox/themes/light/switch.base.css.js.map +1 -1
  60. package/components/checkbox/themes/light/switch.bootstrap.css.js +5 -3
  61. package/components/checkbox/themes/light/switch.bootstrap.css.js.map +1 -1
  62. package/components/checkbox/themes/light/switch.fluent.css.js +5 -3
  63. package/components/checkbox/themes/light/switch.fluent.css.js.map +1 -1
  64. package/components/checkbox/themes/light/switch.indigo.css.js +5 -3
  65. package/components/checkbox/themes/light/switch.indigo.css.js.map +1 -1
  66. package/components/checkbox/themes/light/switch.material.css.js +5 -3
  67. package/components/checkbox/themes/light/switch.material.css.js.map +1 -1
  68. package/components/combo/combo.d.ts +2 -2
  69. package/components/combo/combo.js +1 -0
  70. package/components/combo/combo.js.map +1 -1
  71. package/components/combo/controllers/selection.js +4 -5
  72. package/components/combo/controllers/selection.js.map +1 -1
  73. package/components/combo/types.d.ts +3 -1
  74. package/components/combo/types.js.map +1 -1
  75. package/components/dialog/dialog.d.ts +8 -1
  76. package/components/dialog/dialog.js +34 -7
  77. package/components/dialog/dialog.js.map +1 -1
  78. package/components/dialog/themes/light/dialog.base.css.js +18 -1
  79. package/components/dialog/themes/light/dialog.base.css.js.map +1 -1
  80. package/components/icon/dark/icon.bootstrap.css.js +5 -3
  81. package/components/icon/dark/icon.bootstrap.css.js.map +1 -1
  82. package/components/icon/dark/icon.fluent.css.js +5 -3
  83. package/components/icon/dark/icon.fluent.css.js.map +1 -1
  84. package/components/icon/dark/icon.indigo.css.js +5 -3
  85. package/components/icon/dark/icon.indigo.css.js.map +1 -1
  86. package/components/icon/dark/icon.material.css.js +5 -3
  87. package/components/icon/dark/icon.material.css.js.map +1 -1
  88. package/components/icon/light/icon.bootstrap.css.js +7 -5
  89. package/components/icon/light/icon.bootstrap.css.js.map +1 -1
  90. package/components/icon/light/icon.fluent.css.js +7 -5
  91. package/components/icon/light/icon.fluent.css.js.map +1 -1
  92. package/components/icon/light/icon.indigo.css.js +6 -4
  93. package/components/icon/light/icon.indigo.css.js.map +1 -1
  94. package/components/icon/light/icon.material.css.js +7 -5
  95. package/components/icon/light/icon.material.css.js.map +1 -1
  96. package/components/navbar/themes/dark/navbar.bootstrap.css.js +5 -3
  97. package/components/navbar/themes/dark/navbar.bootstrap.css.js.map +1 -1
  98. package/components/navbar/themes/dark/navbar.fluent.css.js +5 -3
  99. package/components/navbar/themes/dark/navbar.fluent.css.js.map +1 -1
  100. package/components/navbar/themes/dark/navbar.indigo.css.js +5 -3
  101. package/components/navbar/themes/dark/navbar.indigo.css.js.map +1 -1
  102. package/components/navbar/themes/dark/navbar.material.css.js +5 -3
  103. package/components/navbar/themes/dark/navbar.material.css.js.map +1 -1
  104. package/components/navbar/themes/light/navbar.bootstrap.css.js +5 -3
  105. package/components/navbar/themes/light/navbar.bootstrap.css.js.map +1 -1
  106. package/components/navbar/themes/light/navbar.fluent.css.js +5 -3
  107. package/components/navbar/themes/light/navbar.fluent.css.js.map +1 -1
  108. package/components/navbar/themes/light/navbar.indigo.css.js +5 -3
  109. package/components/navbar/themes/light/navbar.indigo.css.js.map +1 -1
  110. package/components/navbar/themes/light/navbar.material.css.js +5 -3
  111. package/components/navbar/themes/light/navbar.material.css.js.map +1 -1
  112. package/components/radio/themes/dark/radio.bootstrap.css.js +5 -3
  113. package/components/radio/themes/dark/radio.bootstrap.css.js.map +1 -1
  114. package/components/radio/themes/dark/radio.fluent.css.js +5 -3
  115. package/components/radio/themes/dark/radio.fluent.css.js.map +1 -1
  116. package/components/radio/themes/dark/radio.indigo.css.js +5 -3
  117. package/components/radio/themes/dark/radio.indigo.css.js.map +1 -1
  118. package/components/radio/themes/dark/radio.material.css.js +5 -3
  119. package/components/radio/themes/dark/radio.material.css.js.map +1 -1
  120. package/components/radio/themes/light/radio.base.css.js +5 -3
  121. package/components/radio/themes/light/radio.base.css.js.map +1 -1
  122. package/components/radio/themes/light/radio.bootstrap.css.js +5 -3
  123. package/components/radio/themes/light/radio.bootstrap.css.js.map +1 -1
  124. package/components/radio/themes/light/radio.fluent.css.js +5 -3
  125. package/components/radio/themes/light/radio.fluent.css.js.map +1 -1
  126. package/components/radio/themes/light/radio.indigo.css.js +5 -3
  127. package/components/radio/themes/light/radio.indigo.css.js.map +1 -1
  128. package/components/radio/themes/light/radio.material.css.js +5 -3
  129. package/components/radio/themes/light/radio.material.css.js.map +1 -1
  130. package/components/select/select.d.ts +6 -0
  131. package/components/select/select.js +2 -0
  132. package/components/select/select.js.map +1 -1
  133. package/components/snackbar/snackbar.d.ts +5 -1
  134. package/components/snackbar/snackbar.js +19 -2
  135. package/components/snackbar/snackbar.js.map +1 -1
  136. package/components/toast/toast.d.ts +4 -1
  137. package/components/toast/toast.js +17 -2
  138. package/components/toast/toast.js.map +1 -1
  139. package/components/toggle/toggle.directive.d.ts +9 -3
  140. package/components/toggle/toggle.directive.js +54 -38
  141. package/components/toggle/toggle.directive.js.map +1 -1
  142. package/custom-elements.json +8 -4
  143. package/package.json +6 -4
  144. package/themes/dark/bootstrap.css +7 -5
  145. package/themes/dark/fluent.css +6 -4
  146. package/themes/dark/indigo.css +6 -4
  147. package/themes/dark/material.css +7 -5
  148. package/vscode-html-custom-data.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"snackbar.js","sourceRoot":"","sources":["../../../src/components/snackbar/snackbar.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAG5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,MAAM,IAA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AI,CAAC,WAAW;;kBAEvB,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;;aAE/B;YACH,CAAC,CAAC,OAAO;;KAEd,CAAC;IACJ,CAAC;;AA3Fa,4BAAO,GAAG,cAAc,AAAjB,CAAkB;AAGzB,2BAAM,GAAG,MAAM,AAAT,CAAU;AASvB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACvB;AAOb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;yDAC5B;AAOnB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;sDAC5B;AAOjB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;wDACZ;AAtCR,oBAAoB;IADxC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GACjB,oBAAoB,CAiGxC;eAjGoB,oBAAoB","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { themes } from '../../theming/theming-decorator.js';\n\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { styles } from './themes/light/snackbar.base.css.js';\nimport { styles as bootstrap } from './themes/light/snackbar.bootstrap.css.js';\nimport { styles as fluent } from './themes/light/snackbar.fluent.css.js';\nimport { styles as indigo } from './themes/light/snackbar.indigo.css.js';\n\nimport { defineComponents } from '../common/definitions/defineComponents.js';\nimport IgcButtonComponent from '../button/button.js';\n\ndefineComponents(IgcButtonComponent);\n\nexport interface IgcSnackbarEventMap {\n igcAction: CustomEvent<void>;\n}\n\n/**\n * A snackbar component is used to provide feedback about an operation\n * by showing a brief message at the bottom of the screen.\n *\n * @element igc-snackbar\n *\n * @slot - Renders the snackbar content.\n *\n * @fires igcAction - Emitted when the snackbar action button is clicked.\n *\n * @csspart base - The base wrapper of the snackbar component.\n * @csspart message - The snackbar message.\n * @csspart action - The snackbar action button.\n */\n@themes({ bootstrap, fluent, indigo })\nexport default class IgcSnackbarComponent extends EventEmitterMixin<\n IgcSnackbarEventMap,\n Constructor<LitElement>\n>(LitElement) {\n /** @private */\n public static tagName = 'igc-snackbar';\n\n /** @private */\n public static styles = styles;\n\n private autoHideTimeout!: number;\n\n /**\n * Determines whether the snackbar is opened.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Determines the duration in ms in which the snackbar will be visible.\n * @attr display-time\n */\n @property({ type: Number, attribute: 'display-time' })\n public displayTime = 4000;\n\n /**\n * Determines whether the snackbar should close after the displayTime is over.\n * @attr keep-open\n */\n @property({ type: Boolean, attribute: 'keep-open' })\n public keepOpen = false;\n\n /**\n * The snackbar action button.\n * @attr action-text\n */\n @property({ attribute: 'action-text' })\n public actionText!: string;\n\n /** Opens the snackbar. */\n public show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n\n clearTimeout(this.autoHideTimeout);\n if (this.open && !this.keepOpen) {\n this.autoHideTimeout = window.setTimeout(\n () => this.hide(),\n this.displayTime\n );\n }\n }\n\n /** Closes the snackbar. */\n public hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n clearTimeout(this.autoHideTimeout);\n }\n\n /** Toggles the open state of the component. */\n public toggle() {\n this.open ? this.hide() : this.show();\n }\n\n private handleClick() {\n this.emitEvent('igcAction');\n }\n\n protected override render() {\n return html`\n <div part=\"base\">\n <span part=\"message\">\n <slot></slot>\n </span>\n ${this.actionText\n ? html`\n <igc-button\n variant=\"flat\"\n part=\"action\"\n size=\"small\"\n @click=${this.handleClick}\n >\n ${ifDefined(this.actionText)}\n </igc-button>\n `\n : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-snackbar': IgcSnackbarComponent;\n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AAU;YACf,CAAC,CAAC,IAAI,CAAA;;;;;yBAKS,IAAI,CAAC,WAAW;;kBAEvB,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;;aAE/B;YACH,CAAC,CAAC,OAAO;;KAEd,CAAC;IACJ,CAAC;;AAhHa,4BAAO,GAAG,cAAc,AAAjB,CAAkB;AAGzB,2BAAM,GAAG,MAAM,AAAT,CAAU;AAMpB;IADT,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC;qDACE;AAOzB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACvB;AAOb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;yDAC5B;AAOnB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;sDAC5B;AAOjB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;wDACZ;AA1CR,oBAAoB;IADxC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GACjB,oBAAoB,CAsHxC;eAtHoB,oBAAoB","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { themes } from '../../theming/theming-decorator.js';\n\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { styles } from './themes/light/snackbar.base.css.js';\nimport { styles as bootstrap } from './themes/light/snackbar.bootstrap.css.js';\nimport { styles as fluent } from './themes/light/snackbar.fluent.css.js';\nimport { styles as indigo } from './themes/light/snackbar.indigo.css.js';\n\nimport { defineComponents } from '../common/definitions/defineComponents.js';\nimport IgcButtonComponent from '../button/button.js';\nimport { AnimationPlayer, fadeIn, fadeOut } from '../../animations/index.js';\n\ndefineComponents(IgcButtonComponent);\n\nexport interface IgcSnackbarEventMap {\n igcAction: CustomEvent<void>;\n}\n\n/**\n * A snackbar component is used to provide feedback about an operation\n * by showing a brief message at the bottom of the screen.\n *\n * @element igc-snackbar\n *\n * @slot - Renders the snackbar content.\n *\n * @fires igcAction - Emitted when the snackbar action button is clicked.\n *\n * @csspart base - The base wrapper of the snackbar component.\n * @csspart message - The snackbar message.\n * @csspart action - The snackbar action button.\n */\n@themes({ bootstrap, fluent, indigo })\nexport default class IgcSnackbarComponent extends EventEmitterMixin<\n IgcSnackbarEventMap,\n Constructor<LitElement>\n>(LitElement) {\n /** @private */\n public static tagName = 'igc-snackbar';\n\n /** @private */\n public static styles = styles;\n\n private autoHideTimeout!: number;\n private animationPlayer!: AnimationPlayer;\n\n @query('[part~=\"base\"]', true)\n protected content!: HTMLElement;\n\n /**\n * Determines whether the snackbar is opened.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Determines the duration in ms in which the snackbar will be visible.\n * @attr display-time\n */\n @property({ type: Number, attribute: 'display-time' })\n public displayTime = 4000;\n\n /**\n * Determines whether the snackbar should close after the displayTime is over.\n * @attr keep-open\n */\n @property({ type: Boolean, attribute: 'keep-open' })\n public keepOpen = false;\n\n /**\n * The snackbar action button.\n * @attr action-text\n */\n @property({ attribute: 'action-text' })\n public actionText!: string;\n\n public override firstUpdated() {\n this.animationPlayer = new AnimationPlayer(this.content);\n }\n\n private async toggleAnimation(dir: 'open' | 'close') {\n const animation = dir === 'open' ? fadeIn : fadeOut;\n\n const [_, event] = await Promise.all([\n this.animationPlayer.stopAll(),\n this.animationPlayer.play(animation),\n ]);\n\n return event.type === 'finish';\n }\n\n /** Opens the snackbar. */\n public show() {\n if (this.open) {\n return;\n }\n\n this.toggleAnimation('open');\n this.open = true;\n\n clearTimeout(this.autoHideTimeout);\n if (this.open && !this.keepOpen) {\n this.autoHideTimeout = window.setTimeout(\n () => this.hide(),\n this.displayTime\n );\n }\n }\n\n /** Closes the snackbar. */\n public async hide() {\n if (!this.open) {\n return;\n }\n\n await this.toggleAnimation('close');\n this.open = false;\n clearTimeout(this.autoHideTimeout);\n }\n\n /** Toggles the open state of the component. */\n public toggle() {\n this.open ? this.hide() : this.show();\n }\n\n private handleClick() {\n this.emitEvent('igcAction');\n }\n\n protected override render() {\n return html`\n <div part=\"base\">\n <span part=\"message\">\n <slot></slot>\n </span>\n ${this.actionText\n ? html`\n <igc-button\n variant=\"flat\"\n part=\"action\"\n size=\"small\"\n @click=${this.handleClick}\n >\n ${ifDefined(this.actionText)}\n </igc-button>\n `\n : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-snackbar': IgcSnackbarComponent;\n }\n}\n"]}
@@ -10,6 +10,7 @@ export default class IgcToastComponent extends LitElement {
10
10
  static readonly tagName = "igc-toast";
11
11
  static styles: import("lit").CSSResult[];
12
12
  private displayTimeout;
13
+ private animationPlayer;
13
14
  /**
14
15
  * Determines whether the toast is opened.
15
16
  * @attr
@@ -25,8 +26,10 @@ export default class IgcToastComponent extends LitElement {
25
26
  * @attr keep-open
26
27
  */
27
28
  keepOpen: boolean;
29
+ firstUpdated(): void;
30
+ private toggleAnimation;
28
31
  /** Closes the toast. */
29
- hide(): void;
32
+ hide(): Promise<void>;
30
33
  /** Opens the toast. */
31
34
  show(): void;
32
35
  /** Toggles the open state of the toast. */
@@ -11,6 +11,7 @@ import { styles } from './themes/toast.base.css.js';
11
11
  import { styles as bootstrap } from './themes/toast.bootstrap.css.js';
12
12
  import { styles as fluent } from './themes/toast.fluent.css.js';
13
13
  import { styles as indigo } from './themes/toast.indigo.css.js';
14
+ import { AnimationPlayer, fadeIn, fadeOut } from '../../animations/index.js';
14
15
  let IgcToastComponent = class IgcToastComponent extends LitElement {
15
16
  constructor() {
16
17
  super(...arguments);
@@ -18,18 +19,32 @@ let IgcToastComponent = class IgcToastComponent extends LitElement {
18
19
  this.displayTime = 4000;
19
20
  this.keepOpen = false;
20
21
  }
21
- hide() {
22
+ firstUpdated() {
23
+ this.animationPlayer = new AnimationPlayer(this);
24
+ }
25
+ async toggleAnimation(dir) {
26
+ const animation = dir === 'open' ? fadeIn : fadeOut;
27
+ const [_, event] = await Promise.all([
28
+ this.animationPlayer.stopAll(),
29
+ this.animationPlayer.play(animation),
30
+ ]);
31
+ return event.type === 'finish';
32
+ }
33
+ async hide() {
22
34
  if (this.open) {
35
+ await this.toggleAnimation('close');
23
36
  this.open = false;
24
37
  }
25
38
  }
26
39
  show() {
27
40
  window.clearTimeout(this.displayTimeout);
28
41
  if (!this.open) {
42
+ this.toggleAnimation('open');
29
43
  this.open = true;
30
44
  }
31
45
  if (this.keepOpen === false) {
32
- this.displayTimeout = setTimeout(() => {
46
+ this.displayTimeout = setTimeout(async () => {
47
+ await this.toggleAnimation('close');
33
48
  this.open = false;
34
49
  }, this.displayTime);
35
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/components/toast/toast.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAWhE,IAAqB,iBAAiB,GAAtC,MAAqB,iBAAkB,SAAQ,UAAU;IAAzD;;QAWS,SAAI,GAAG,KAAK,CAAC;QAOb,gBAAW,GAAG,IAAI,CAAC;QAOnB,aAAQ,GAAG,KAAK,CAAC;IA8C1B,CAAC;IA3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EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;sDAC5C;AAOnB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;mDAC3C;AAzBL,iBAAiB;IADrC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GACjB,iBAAiB,CAuErC;eAvEoB,iBAAiB","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { styles } from './themes/toast.base.css.js';\nimport { styles as bootstrap } from './themes/toast.bootstrap.css.js';\nimport { styles as fluent } from './themes/toast.fluent.css.js';\nimport { styles as indigo } from './themes/toast.indigo.css.js';\n\n/**\n * A toast component is used to show a notification\n *\n * @element igc-toast\n *\n * @csspart base - The base wrapper of the toast.\n */\n\n@themes({ bootstrap, fluent, indigo })\nexport default class IgcToastComponent extends LitElement {\n public static readonly tagName = 'igc-toast';\n public static override styles = [styles];\n\n private displayTimeout!: ReturnType<typeof setTimeout>;\n\n /**\n * Determines whether the toast is opened.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Determines the time after which the toast will close\n * @attr display-time\n */\n @property({ type: Number, reflect: false, attribute: 'display-time' })\n public displayTime = 4000;\n\n /**\n * Determines whether the toast is closed automatically or not.\n * @attr keep-open\n */\n @property({ type: Boolean, reflect: true, attribute: 'keep-open' })\n public keepOpen = false;\n\n /** Closes the toast. */\n public hide() {\n if (this.open) {\n this.open = false;\n }\n }\n\n /** Opens the toast. */\n public show() {\n window.clearTimeout(this.displayTimeout);\n\n if (!this.open) {\n this.open = true;\n }\n\n if (this.keepOpen === false) {\n this.displayTimeout = setTimeout(() => {\n this.open = false;\n }, this.displayTime);\n }\n }\n\n /** Toggles the open state of the toast. */\n public toggle() {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'alert');\n }\n if (!this.hasAttribute('aria-live')) {\n this.setAttribute('aria-live', 'polite');\n }\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-toast': IgcToastComponent;\n }\n}\n"]}
1
+ {"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/components/toast/toast.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAW7E,IAAqB,iBAAiB,GAAtC,MAAqB,iBAAkB,SAAQ,UAAU;IAAzD;;QAYS,SAAI,GAAG,KAAK,CAAC;QAOb,gBAAW,GAAG,IAAI,CAAC;QAOnB,aAAQ,GAAG,KAAK,CAAC;IAgE1B,CAAC;IA9DiB,YAAY;QAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,GAAqB;QACjD,MAAM,SAAS,GAAG,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QAEpD,MAAM,CAAC,CAAC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AAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YACnC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;SAC1C;IACH,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AAxFsB,yBAAO,GAAG,WAAW,AAAd,CAAe;AACtB,wBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAUlC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACvB;AAOb;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;sDAC5C;AAOnB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;mDAC3C;AA1BL,iBAAiB;IADrC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;GACjB,iBAAiB,CA0FrC;eA1FoB,iBAAiB","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { styles } from './themes/toast.base.css.js';\nimport { styles as bootstrap } from './themes/toast.bootstrap.css.js';\nimport { styles as fluent } from './themes/toast.fluent.css.js';\nimport { styles as indigo } from './themes/toast.indigo.css.js';\nimport { AnimationPlayer, fadeIn, fadeOut } from '../../animations/index.js';\n\n/**\n * A toast component is used to show a notification\n *\n * @element igc-toast\n *\n * @csspart base - The base wrapper of the toast.\n */\n\n@themes({ bootstrap, fluent, indigo })\nexport default class IgcToastComponent extends LitElement {\n public static readonly tagName = 'igc-toast';\n public static override styles = [styles];\n\n private displayTimeout!: ReturnType<typeof setTimeout>;\n private animationPlayer!: AnimationPlayer;\n\n /**\n * Determines whether the toast is opened.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Determines the time after which the toast will close\n * @attr display-time\n */\n @property({ type: Number, reflect: false, attribute: 'display-time' })\n public displayTime = 4000;\n\n /**\n * Determines whether the toast is closed automatically or not.\n * @attr keep-open\n */\n @property({ type: Boolean, reflect: true, attribute: 'keep-open' })\n public keepOpen = false;\n\n public override firstUpdated() {\n this.animationPlayer = new AnimationPlayer(this);\n }\n\n private async toggleAnimation(dir: 'open' | 'close') {\n const animation = dir === 'open' ? fadeIn : fadeOut;\n\n const [_, event] = await Promise.all([\n this.animationPlayer.stopAll(),\n this.animationPlayer.play(animation),\n ]);\n\n return event.type === 'finish';\n }\n\n /** Closes the toast. */\n public async hide() {\n if (this.open) {\n await this.toggleAnimation('close');\n this.open = false;\n }\n }\n\n /** Opens the toast. */\n public show() {\n window.clearTimeout(this.displayTimeout);\n\n if (!this.open) {\n this.toggleAnimation('open');\n this.open = true;\n }\n\n if (this.keepOpen === false) {\n this.displayTimeout = setTimeout(async () => {\n await this.toggleAnimation('close');\n this.open = false;\n }, this.displayTime);\n }\n }\n\n /** Toggles the open state of the toast. */\n public toggle() {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'alert');\n }\n if (!this.hasAttribute('aria-live')) {\n this.setAttribute('aria-live', 'polite');\n }\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-toast': IgcToastComponent;\n }\n}\n"]}
@@ -3,10 +3,16 @@ import type { IgcToggleOptions } from './types.js';
3
3
  import type { IgcToggleController } from './toggle.controller.js';
4
4
  export declare class IgcToggleDirective extends Directive {
5
5
  private part;
6
- private shiftOptions?;
7
- private floatingElement;
6
+ private _floatingElement;
7
+ private _dispose;
8
+ private target;
9
+ private options;
10
+ private controller?;
11
+ private get floatingElement();
12
+ private dispose;
13
+ private notifyController;
8
14
  private updatePosition;
9
- private createFloatingElement;
15
+ private reposition;
10
16
  private createMiddleware;
11
17
  constructor(partInfo: PartInfo);
12
18
  render(target: HTMLElement, options: IgcToggleOptions, controller?: IgcToggleController): symbol;
@@ -1,41 +1,37 @@
1
- import { computePosition, flip, offset, shift, size, } from '@floating-ui/dom';
1
+ import { computePosition, flip, offset, shift, size, autoUpdate, } from '@floating-ui/dom';
2
2
  import { directive, Directive, PartType, } from 'lit/directive.js';
3
3
  import { noChange } from 'lit';
4
4
  export class IgcToggleDirective extends Directive {
5
- updatePosition(target, options, controller) {
6
- var _a, _b;
7
- this.floatingElement = this.createFloatingElement(options.open);
8
- if (!target) {
9
- if (controller) {
10
- controller.rendered = Promise.resolve();
11
- }
12
- return noChange;
5
+ get floatingElement() {
6
+ if (!this._floatingElement) {
7
+ this._floatingElement = this.part.element;
13
8
  }
14
- const promise = computePosition(target, this.floatingElement, {
15
- placement: (_a = options.placement) !== null && _a !== void 0 ? _a : 'bottom-start',
16
- strategy: (_b = options.positionStrategy) !== null && _b !== void 0 ? _b : 'absolute',
17
- middleware: this.createMiddleware(options),
18
- }).then(({ x, y }) => {
19
- Object.assign(this.floatingElement.style, {
20
- left: 0,
21
- top: 0,
22
- transform: `translate(${x}px,${y}px)`,
23
- });
9
+ Object.assign(this._floatingElement.style, {
10
+ display: this.options.open ? '' : 'none',
24
11
  });
25
- if (controller) {
26
- controller.rendered = promise;
12
+ return this._floatingElement;
13
+ }
14
+ dispose() {
15
+ if (this._dispose) {
16
+ this._dispose();
17
+ }
18
+ }
19
+ notifyController(promise) {
20
+ if (this.controller) {
21
+ this.controller.rendered = promise;
27
22
  }
28
- return noChange;
29
23
  }
30
- createFloatingElement(open = false) {
31
- if (!this.floatingElement) {
32
- this.floatingElement = this.part.element;
24
+ updatePosition() {
25
+ this.dispose();
26
+ if (!this.floatingElement || !this.target || !this.options.open) {
27
+ return noChange;
33
28
  }
34
- this.floatingElement.style.display = open ? '' : 'none';
35
- return this.floatingElement;
29
+ this._dispose = autoUpdate(this.target, this.floatingElement, this.reposition);
30
+ return noChange;
36
31
  }
37
32
  createMiddleware(options) {
38
33
  const middleware = [];
34
+ const { style: floatingStyles } = this._floatingElement;
39
35
  if (options.distance) {
40
36
  middleware.push(offset({
41
37
  mainAxis: options.distance,
@@ -44,27 +40,46 @@ export class IgcToggleDirective extends Directive {
44
40
  if (options.flip) {
45
41
  middleware.push(flip());
46
42
  }
47
- if (this.shiftOptions) {
48
- middleware.push(shift(this.shiftOptions));
49
- }
50
- Object.assign(this.floatingElement.style, { width: '' });
43
+ middleware.push(shift({
44
+ mainAxis: true,
45
+ }));
51
46
  if (options.sameWidth) {
52
- const floatingElement = this.floatingElement;
53
47
  middleware.push(size({
54
- apply: (args) => {
55
- const { rects } = args;
56
- Object.assign(floatingElement.style, {
48
+ apply: ({ rects }) => {
49
+ Object.assign(floatingStyles, {
57
50
  width: `${rects.reference.width}px`,
58
51
  });
59
52
  },
60
53
  }));
61
54
  }
55
+ else {
56
+ Object.assign(floatingStyles, { width: '' });
57
+ }
62
58
  return middleware;
63
59
  }
64
60
  constructor(partInfo) {
65
61
  super(partInfo);
66
- this.shiftOptions = {
67
- mainAxis: true,
62
+ this.reposition = () => {
63
+ var _a, _b;
64
+ if (!this.target) {
65
+ this.dispose();
66
+ this.notifyController(Promise.resolve());
67
+ return noChange;
68
+ }
69
+ const config = {
70
+ placement: (_a = this.options.placement) !== null && _a !== void 0 ? _a : 'bottom-start',
71
+ strategy: (_b = this.options.positionStrategy) !== null && _b !== void 0 ? _b : 'absolute',
72
+ middleware: this.createMiddleware(this.options),
73
+ };
74
+ const promise = computePosition(this.target, this.floatingElement, config).then(({ x, y }) => {
75
+ Object.assign(this.floatingElement.style, {
76
+ left: 0,
77
+ top: 0,
78
+ transform: `translate(${x}px,${y}px)`,
79
+ });
80
+ });
81
+ this.notifyController(promise);
82
+ return noChange;
68
83
  };
69
84
  this.part = partInfo;
70
85
  if (partInfo.type !== PartType.ELEMENT) {
@@ -72,7 +87,8 @@ export class IgcToggleDirective extends Directive {
72
87
  }
73
88
  }
74
89
  render(target, options, controller) {
75
- return this.updatePosition(target, options, controller);
90
+ Object.assign(this, { target, options, controller });
91
+ return this.updatePosition();
76
92
  }
77
93
  }
78
94
  export const igcToggle = directive(IgcToggleDirective);
@@ -1 +1 @@
1
- {"version":3,"file":"toggle.directive.js","sourceRoot":"","sources":["../../../src/components/toggle/toggle.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,GAEL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,SAAS,EAGT,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAK/B,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAQvC,cAAc,CACpB,MAAmB,EACnB,OAAyB,EACzB,UAAgC;;QAEhC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEhE,IAAI,CAAC,MAAM,EAAE;YACX,IAAI,UAAU,EAAE;gBACd,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;aACzC;YACD,OAAO,QAAQ,CAAC;SACjB;QAED,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE;YAC5D,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,cAAc;YAC9C,QAAQ,EAAE,MAAA,OAAO,CAAC,gBAAgB,mCAAI,UAAU;YAChD,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;SAC3C,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;YACnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE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BACH,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;oBACd,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;oBACvB,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE;wBACnC,KAAK,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI;qBACpC,CAAC,CAAC;gBACL,CAAC;aACF,CAAC,CACH,CAAC;SACH;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,YAAY,QAAkB;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAzFV,iBAAY,GAAI;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;QAwFA,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,OAAO,EAAE;YACtC,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;SACH;IACH,CAAC;IAEM,MAAM,CACX,MAAmB,EACnB,OAAyB,EACzB,UAAgC;QAEhC,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;CACF;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import {\n computePosition,\n flip,\n offset,\n shift,\n size,\n Middleware,\n} from '@floating-ui/dom';\nimport {\n directive,\n Directive,\n PartInfo,\n ElementPart,\n PartType,\n} from 'lit/directive.js';\nimport { noChange } from 'lit';\nimport type { IgcToggleOptions } from './types.js';\nimport type { IgcToggleController } from './toggle.controller.js';\n\n/* blazorSuppressComponent */\nexport class IgcToggleDirective extends Directive {\n private part: PartInfo;\n private shiftOptions? = {\n mainAxis: true,\n };\n\n private floatingElement!: HTMLElement;\n\n private updatePosition(\n target: HTMLElement,\n options: IgcToggleOptions,\n controller?: IgcToggleController\n ) {\n this.floatingElement = this.createFloatingElement(options.open);\n\n if (!target) {\n if (controller) {\n controller.rendered = Promise.resolve();\n }\n return noChange;\n }\n\n const promise = computePosition(target, this.floatingElement, {\n placement: options.placement ?? 'bottom-start',\n strategy: options.positionStrategy ?? 'absolute',\n middleware: this.createMiddleware(options),\n }).then(({ x, y }) => {\n Object.assign(this.floatingElement.style, {\n left: 0,\n top: 0,\n transform: `translate(${x}px,${y}px)`,\n });\n });\n\n if (controller) {\n controller.rendered = promise;\n }\n\n return noChange;\n }\n\n private createFloatingElement(open = false) {\n if (!this.floatingElement) {\n this.floatingElement = (this.part as ElementPart).element as HTMLElement;\n }\n\n this.floatingElement.style.display = open ? '' : 'none';\n\n return this.floatingElement;\n }\n\n private createMiddleware(options: IgcToggleOptions) {\n const middleware: Middleware[] = [];\n\n if (options.distance) {\n middleware.push(\n offset({\n mainAxis: options.distance,\n })\n );\n }\n\n if (options.flip) {\n middleware.push(flip());\n }\n\n if (this.shiftOptions) {\n middleware.push(shift(this.shiftOptions));\n }\n\n // Toggling `sameWidth` does not reset the applied style on the floater element\n Object.assign(this.floatingElement.style, { width: '' });\n\n if (options.sameWidth) {\n const floatingElement = this.floatingElement;\n middleware.push(\n size({\n apply: (args) => {\n const { rects } = args;\n Object.assign(floatingElement.style, {\n width: `${rects.reference.width}px`,\n });\n },\n })\n );\n }\n\n return middleware;\n }\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n this.part = partInfo;\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error(\n 'The `igcToggle` directive must be attached to an element tag.'\n );\n }\n }\n\n public render(\n target: HTMLElement,\n options: IgcToggleOptions,\n controller?: IgcToggleController\n ) {\n return this.updatePosition(target, options, controller);\n }\n}\n\nexport const igcToggle = directive(IgcToggleDirective);\n"]}
1
+ {"version":3,"file":"toggle.directive.js","sourceRoot":"","sources":["../../../src/components/toggle/toggle.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EAEJ,UAAU,GAEX,MAAM,kB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AAI,UAAU;gBACrD,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC;aAChD,CAAC;YAEF,MAAM,OAAO,GAAG,eAAe,CAC7B,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,eAAe,EACpB,MAAM,CACP,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;gBAClB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;oBACxC,IAAI,EAAE,CAAC;oBACP,GAAG,EAAE,CAAC;oBACN,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK;iBACtC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAC/B,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC;QA4CA,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,OAAO,EAAE;YACtC,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;SACH;IACH,CAAC;IAEM,MAAM,CACX,MAAmB,EACnB,OAAyB,EACzB,UAAgC;QAEhC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import {\n computePosition,\n flip,\n offset,\n shift,\n size,\n Middleware,\n autoUpdate,\n ComputePositionConfig,\n} from '@floating-ui/dom';\nimport {\n directive,\n Directive,\n PartInfo,\n ElementPart,\n PartType,\n} from 'lit/directive.js';\nimport { noChange } from 'lit';\nimport type { IgcToggleOptions } from './types.js';\nimport type { IgcToggleController } from './toggle.controller.js';\n\n/* blazorSuppressComponent */\nexport class IgcToggleDirective extends Directive {\n private part: PartInfo;\n\n private _floatingElement!: HTMLElement;\n private _dispose!: Function;\n\n private target!: HTMLElement;\n private options!: IgcToggleOptions;\n private controller?: IgcToggleController;\n\n private get floatingElement() {\n if (!this._floatingElement) {\n this._floatingElement = (this.part as ElementPart).element as HTMLElement;\n }\n\n Object.assign(this._floatingElement.style, {\n display: this.options.open ? '' : 'none',\n });\n\n return this._floatingElement;\n }\n\n private dispose() {\n if (this._dispose) {\n this._dispose();\n }\n }\n\n private notifyController(promise: Promise<void>) {\n if (this.controller) {\n this.controller.rendered = promise;\n }\n }\n\n private updatePosition() {\n this.dispose();\n\n if (!this.floatingElement || !this.target || !this.options.open) {\n return noChange;\n }\n\n this._dispose = autoUpdate(\n this.target,\n this.floatingElement,\n this.reposition\n );\n\n return noChange;\n }\n\n private reposition = () => {\n if (!this.target) {\n this.dispose();\n this.notifyController(Promise.resolve());\n return noChange;\n }\n\n const config: Partial<ComputePositionConfig> = {\n placement: this.options.placement ?? 'bottom-start',\n strategy: this.options.positionStrategy ?? 'absolute',\n middleware: this.createMiddleware(this.options),\n };\n\n const promise = computePosition(\n this.target,\n this.floatingElement,\n config\n ).then(({ x, y }) => {\n Object.assign(this.floatingElement.style, {\n left: 0,\n top: 0,\n transform: `translate(${x}px,${y}px)`,\n });\n });\n\n this.notifyController(promise);\n return noChange;\n };\n\n private createMiddleware(options: IgcToggleOptions) {\n const middleware: Middleware[] = [];\n const { style: floatingStyles } = this._floatingElement;\n\n if (options.distance) {\n middleware.push(\n offset({\n mainAxis: options.distance,\n })\n );\n }\n\n if (options.flip) {\n middleware.push(flip());\n }\n\n middleware.push(\n shift({\n mainAxis: true,\n })\n );\n\n if (options.sameWidth) {\n middleware.push(\n size({\n apply: ({ rects }) => {\n Object.assign(floatingStyles, {\n width: `${rects.reference.width}px`,\n });\n },\n })\n );\n } else {\n // Reset previously applied `same-width` styles\n Object.assign(floatingStyles, { width: '' });\n }\n\n return middleware;\n }\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n this.part = partInfo;\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error(\n 'The `igcToggle` directive must be attached to an element tag.'\n );\n }\n }\n\n public render(\n target: HTMLElement,\n options: IgcToggleOptions,\n controller?: IgcToggleController\n ) {\n Object.assign(this, { target, options, controller });\n return this.updatePosition();\n }\n}\n\nexport const igcToggle = directive(IgcToggleDirective);\n"]}
@@ -5385,7 +5385,8 @@
5385
5385
  "name": "position-strategy",
5386
5386
  "description": "Sets the component's positioning strategy.",
5387
5387
  "type": "\"absolute\" | \"fixed\"",
5388
- "default": "\"absolute\""
5388
+ "default": "\"fixed\"",
5389
+ "deprecatedMessage": "since version 5.0. It will be removed in the next major release."
5389
5390
  },
5390
5391
  {
5391
5392
  "name": "flip",
@@ -5403,7 +5404,8 @@
5403
5404
  "name": "same-width",
5404
5405
  "description": "Whether the dropdown's width should be the same as the target's one.",
5405
5406
  "type": "boolean",
5406
- "default": "true"
5407
+ "default": "true",
5408
+ "deprecatedMessage": "since version 5.0. It will be removed in the next major release."
5407
5409
  },
5408
5410
  {
5409
5411
  "name": "size",
@@ -5523,7 +5525,8 @@
5523
5525
  "attribute": "position-strategy",
5524
5526
  "description": "Sets the component's positioning strategy.",
5525
5527
  "type": "\"absolute\" | \"fixed\"",
5526
- "default": "\"absolute\""
5528
+ "default": "\"fixed\"",
5529
+ "deprecatedMessage": "since version 5.0. It will be removed in the next major release."
5527
5530
  },
5528
5531
  {
5529
5532
  "name": "flip",
@@ -5544,7 +5547,8 @@
5544
5547
  "attribute": "same-width",
5545
5548
  "description": "Whether the dropdown's width should be the same as the target's one.",
5546
5549
  "type": "boolean",
5547
- "default": "true"
5550
+ "default": "true",
5551
+ "deprecatedMessage": "since version 5.0. It will be removed in the next major release."
5548
5552
  },
5549
5553
  {
5550
5554
  "name": "size",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-webcomponents",
3
- "version": "4.3.0-alpha.0",
3
+ "version": "4.3.0-beta.0",
4
4
  "description": "Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.",
5
5
  "author": "Infragistics",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -34,6 +34,7 @@
34
34
  "chip",
35
35
  "combo",
36
36
  "date input",
37
+ "dialog",
37
38
  "dropdown",
38
39
  "expansion panel",
39
40
  "form",
@@ -50,6 +51,7 @@
50
51
  "radio",
51
52
  "rating",
52
53
  "snackbar",
54
+ "stepper",
53
55
  "switch",
54
56
  "slider",
55
57
  "tabs",
@@ -57,8 +59,8 @@
57
59
  "tree"
58
60
  ],
59
61
  "dependencies": {
60
- "@floating-ui/dom": "^1.2.7",
61
- "@lit-labs/virtualizer": "^2.0.1",
62
- "lit": "^2.7.4"
62
+ "@floating-ui/dom": "^1.4.1",
63
+ "@lit-labs/virtualizer": "^2.0.3",
64
+ "lit": "^2.7.5"
63
65
  }
64
66
  }
@@ -69,15 +69,17 @@
69
69
  }
70
70
  }
71
71
  /* stylelint-disable max-line-length */
72
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
72
73
  /* stylelint-disable max-line-length */
73
74
  /* stylelint-disable max-line-length */
74
75
  /* stylelint-disable max-line-length */
75
- /* stylelint-disable max-line-length */
76
- /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
76
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
77
77
  /* stylelint-disable max-line-length */
78
78
  /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
79
+ /* stylelint-disable max-line-length */
79
80
  /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
80
- /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
81
+ /* stylelint-disable max-line-length */
82
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
81
83
  :root {
82
84
  --ig-theme: bootstrap;
83
85
  --ig-radius-factor: 1;
@@ -989,9 +991,9 @@ igc-button[variant=fab] [igxButton=fab], igc-button[variant=fab] .igx-button--fa
989
991
 
990
992
  igc-icon,
991
993
  igc-icon ig-icon {
992
- --color: var(--ig-icon-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));
994
+ --color: var(--ig-icon-color, 'currentColor');
993
995
  --size: var(--ig-icon-size, 1.5rem);
994
- --disabled-color: var(--ig-icon-disabled-color, hsla(var(--ig-gray-500), var(--ig-gray-a)));
996
+ --disabled-color: var(--ig-icon-disabled-color, 'currentColor');
995
997
  }
996
998
 
997
999
  igc-navbar,
@@ -69,15 +69,17 @@
69
69
  }
70
70
  }
71
71
  /* stylelint-disable max-line-length */
72
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
72
73
  /* stylelint-disable max-line-length */
73
74
  /* stylelint-disable max-line-length */
74
75
  /* stylelint-disable max-line-length */
75
- /* stylelint-disable max-line-length */
76
- /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
76
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
77
77
  /* stylelint-disable max-line-length */
78
78
  /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
79
+ /* stylelint-disable max-line-length */
79
80
  /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
80
- /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
81
+ /* stylelint-disable max-line-length */
82
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
81
83
  :root {
82
84
  --ig-theme: fluent;
83
85
  --ig-radius-factor: 1;
@@ -1077,7 +1079,7 @@ igc-combo::part(input) {
1077
1079
 
1078
1080
  igc-icon,
1079
1081
  igc-icon ig-icon {
1080
- --color: var(--ig-icon-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));
1082
+ --color: var(--ig-icon-color, 'currentColor');
1081
1083
  --size: var(--ig-icon-size, 1.5rem);
1082
1084
  --disabled-color: var(--ig-icon-disabled-color, hsla(var(--ig-gray-500), var(--ig-gray-a)));
1083
1085
  }
@@ -69,15 +69,17 @@
69
69
  }
70
70
  }
71
71
  /* stylelint-disable max-line-length */
72
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
72
73
  /* stylelint-disable max-line-length */
73
74
  /* stylelint-disable max-line-length */
74
75
  /* stylelint-disable max-line-length */
75
- /* stylelint-disable max-line-length */
76
- /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
76
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
77
77
  /* stylelint-disable max-line-length */
78
78
  /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
79
+ /* stylelint-disable max-line-length */
79
80
  /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
80
- /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
81
+ /* stylelint-disable max-line-length */
82
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
81
83
  :root {
82
84
  --ig-theme: indigo;
83
85
  --ig-radius-factor: 1;
@@ -826,7 +828,7 @@ igc-button[variant=fab] [igxButton=fab], igc-button[variant=fab] .igx-button--fa
826
828
 
827
829
  igc-icon,
828
830
  igc-icon ig-icon {
829
- --color: var(--ig-icon-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));
831
+ --color: var(--ig-icon-color, 'currentColor');
830
832
  --size: var(--ig-icon-size, 1.5rem);
831
833
  --disabled-color: var(--ig-icon-disabled-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));
832
834
  }
@@ -69,15 +69,17 @@
69
69
  }
70
70
  }
71
71
  /* stylelint-disable max-line-length */
72
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
72
73
  /* stylelint-disable max-line-length */
73
74
  /* stylelint-disable max-line-length */
74
75
  /* stylelint-disable max-line-length */
75
- /* stylelint-disable max-line-length */
76
- /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
76
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
77
77
  /* stylelint-disable max-line-length */
78
78
  /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
79
+ /* stylelint-disable max-line-length */
79
80
  /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
80
- /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
81
+ /* stylelint-disable max-line-length */
82
+ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */ /* stylelint-disable max-line-length */
81
83
  :root {
82
84
  --ig-theme: material;
83
85
  --ig-radius-factor: 1;
@@ -978,9 +980,9 @@ igc-button[variant=fab] [igxButton=fab], igc-button[variant=fab] .igx-button--fa
978
980
 
979
981
  igc-icon,
980
982
  igc-icon ig-icon {
981
- --color: var(--ig-icon-color, hsla(var(--ig-gray-800), var(--ig-gray-a)));
983
+ --color: var(--ig-icon-color, 'currentColor');
982
984
  --size: var(--ig-icon-size, 1.5rem);
983
- --disabled-color: var(--ig-icon-disabled-color, hsla(var(--ig-gray-500), var(--ig-gray-a)));
985
+ --disabled-color: var(--ig-icon-disabled-color, 'currentColor');
984
986
  }
985
987
 
986
988
  igc-navbar,
@@ -1113,7 +1113,7 @@
1113
1113
  },
1114
1114
  {
1115
1115
  "name": "igc-dialog",
1116
- "description": "Represents a Dialog component.\n\nEvents:\n\n * `igcClosing` {} - Emitter just before the dialog is closed.\n\n * `igcClosed` {} - Emitted after closing the dialog.\n\nSlots:\n\n * ` ` {} - Renders content inside the default slot.\n\n * `title` {} - Renders the title of the dialog header.\n\n * `footer` {} - Renders the dialog footer.\n\nAttributes:\n\n * `close-on-escape` {`boolean`} - Whether the dialog should be closed when pressing the 'ESCAPE' button.\n\n * `keep-open-on-escape` {`boolean`} - Whether the dialog should be kept open when pressing the 'ESCAPE' button.\n\n * `close-on-outside-click` {`boolean`} - Whether the dialog should be closed when clicking outside of it.\n\n * `hide-default-action` {`boolean`} - Whether to hide the default action button for the dialog.\n\nWhen there is projected content in the `footer` slot this property\nhas no effect.\n\n * `open` {`boolean`} - Whether the dialog is opened.\n\n * `title` {`string`} - Sets the title of the dialog.\n\nProperties:\n\n * `tagName` {`\"igc-dialog\"`} - \n\n * `styles` {`CSSResult[]`} - \n\n * `increment` - \n\n * `titleId` {`string`} - \n\n * `dialog` {`HTMLDialogElement`} - \n\n * `closeOnEscape` {`boolean`} - Whether the dialog should be closed when pressing the 'ESCAPE' button.\n\n * `keepOpenOnEscape` {`boolean`} - Whether the dialog should be kept open when pressing the 'ESCAPE' button.\n\n * `closeOnOutsideClick` {`boolean`} - Whether the dialog should be closed when clicking outside of it.\n\n * `hideDefaultAction` {`boolean`} - Whether to hide the default action button for the dialog.\n\nWhen there is projected content in the `footer` slot this property\nhas no effect.\n\n * `open` {`boolean`} - Whether the dialog is opened.\n\n * `title` {`string`} - Sets the title of the dialog.\n\n * `returnValue` {`string`} - Sets the return value for the dialog.\n\n * `formSubmitHandler` - ",
1116
+ "description": "Represents a Dialog component.\n\nEvents:\n\n * `igcClosing` {} - Emitter just before the dialog is closed.\n\n * `igcClosed` {} - Emitted after closing the dialog.\n\nSlots:\n\n * ` ` {} - Renders content inside the default slot.\n\n * `title` {} - Renders the title of the dialog header.\n\n * `footer` {} - Renders the dialog footer.\n\nAttributes:\n\n * `close-on-escape` {`boolean`} - Whether the dialog should be closed when pressing the 'ESCAPE' button.\n\n * `keep-open-on-escape` {`boolean`} - Whether the dialog should be kept open when pressing the 'ESCAPE' button.\n\n * `close-on-outside-click` {`boolean`} - Whether the dialog should be closed when clicking outside of it.\n\n * `hide-default-action` {`boolean`} - Whether to hide the default action button for the dialog.\n\nWhen there is projected content in the `footer` slot this property\nhas no effect.\n\n * `open` {`boolean`} - Whether the dialog is opened.\n\n * `title` {`string`} - Sets the title of the dialog.\n\nProperties:\n\n * `tagName` {`\"igc-dialog\"`} - \n\n * `styles` {`CSSResult[]`} - \n\n * `increment` - \n\n * `titleId` {`string`} - \n\n * `animationPlayer` - \n\n * `dialog` {`HTMLDialogElement`} - \n\n * `closeOnEscape` {`boolean`} - Whether the dialog should be closed when pressing the 'ESCAPE' button.\n\n * `keepOpenOnEscape` {`boolean`} - Whether the dialog should be kept open when pressing the 'ESCAPE' button.\n\n * `closeOnOutsideClick` {`boolean`} - Whether the dialog should be closed when clicking outside of it.\n\n * `hideDefaultAction` {`boolean`} - Whether to hide the default action button for the dialog.\n\nWhen there is projected content in the `footer` slot this property\nhas no effect.\n\n * `open` {`boolean`} - Whether the dialog is opened.\n\n * `animating` {`boolean`} - Backdrop animation helper.\n\n * `title` {`string`} - Sets the title of the dialog.\n\n * `returnValue` {`string`} - Sets the return value for the dialog.\n\n * `formSubmitHandler` - ",
1117
1117
  "attributes": [
1118
1118
  {
1119
1119
  "name": "close-on-escape",
@@ -2278,7 +2278,7 @@
2278
2278
  },
2279
2279
  {
2280
2280
  "name": "position-strategy",
2281
- "description": "`position-strategy` {`\"absolute\" | \"fixed\"`} - Sets the component's positioning strategy.\n\nProperty: positionStrategy\n\nDefault: absolute",
2281
+ "description": "`position-strategy` {`\"absolute\" | \"fixed\"`} - Sets the component's positioning strategy.\n\nProperty: positionStrategy\n\nDefault: fixed",
2282
2282
  "values": [
2283
2283
  {
2284
2284
  "name": "absolute"
@@ -2575,7 +2575,7 @@
2575
2575
  },
2576
2576
  {
2577
2577
  "name": "igc-snackbar",
2578
- "description": "A snackbar component is used to provide feedback about an operation\nby showing a brief message at the bottom of the screen.\n\nEvents:\n\n * `igcAction` {} - Emitted when the snackbar action button is clicked.\n\nSlots:\n\n * ` ` {} - Renders the snackbar content.\n\nAttributes:\n\n * `open` {`boolean`} - Determines whether the snackbar is opened.\n\n * `display-time` {`number`} - Determines the duration in ms in which the snackbar will be visible.\n\n * `keep-open` {`boolean`} - Determines whether the snackbar should close after the displayTime is over.\n\n * `action-text` {`string`} - The snackbar action button.\n\nProperties:\n\n * `tagName` {`string`} - \n\n * `styles` - \n\n * `autoHideTimeout` {`number`} - \n\n * `open` {`boolean`} - Determines whether the snackbar is opened.\n\n * `displayTime` {`number`} - Determines the duration in ms in which the snackbar will be visible.\n\n * `keepOpen` {`boolean`} - Determines whether the snackbar should close after the displayTime is over.\n\n * `actionText` {`string`} - The snackbar action button.",
2578
+ "description": "A snackbar component is used to provide feedback about an operation\nby showing a brief message at the bottom of the screen.\n\nEvents:\n\n * `igcAction` {} - Emitted when the snackbar action button is clicked.\n\nSlots:\n\n * ` ` {} - Renders the snackbar content.\n\nAttributes:\n\n * `open` {`boolean`} - Determines whether the snackbar is opened.\n\n * `display-time` {`number`} - Determines the duration in ms in which the snackbar will be visible.\n\n * `keep-open` {`boolean`} - Determines whether the snackbar should close after the displayTime is over.\n\n * `action-text` {`string`} - The snackbar action button.\n\nProperties:\n\n * `tagName` {`string`} - \n\n * `styles` - \n\n * `autoHideTimeout` {`number`} - \n\n * `animationPlayer` - \n\n * `content` {`HTMLElement`} - \n\n * `open` {`boolean`} - Determines whether the snackbar is opened.\n\n * `displayTime` {`number`} - Determines the duration in ms in which the snackbar will be visible.\n\n * `keepOpen` {`boolean`} - Determines whether the snackbar should close after the displayTime is over.\n\n * `actionText` {`string`} - The snackbar action button.",
2579
2579
  "attributes": [
2580
2580
  {
2581
2581
  "name": "open",
@@ -2799,7 +2799,7 @@
2799
2799
  },
2800
2800
  {
2801
2801
  "name": "igc-toast",
2802
- "description": "A toast component is used to show a notification\n\nAttributes:\n\n * `open` {`boolean`} - Determines whether the toast is opened.\n\n * `display-time` {`number`} - Determines the time after which the toast will close\n\n * `keep-open` {`boolean`} - Determines whether the toast is closed automatically or not.\n\nProperties:\n\n * `tagName` {`\"igc-toast\"`} - \n\n * `styles` {`CSSResult[]`} - \n\n * `displayTimeout` {`Timeout`} - \n\n * `open` {`boolean`} - Determines whether the toast is opened.\n\n * `displayTime` {`number`} - Determines the time after which the toast will close\n\n * `keepOpen` {`boolean`} - Determines whether the toast is closed automatically or not.",
2802
+ "description": "A toast component is used to show a notification\n\nAttributes:\n\n * `open` {`boolean`} - Determines whether the toast is opened.\n\n * `display-time` {`number`} - Determines the time after which the toast will close\n\n * `keep-open` {`boolean`} - Determines whether the toast is closed automatically or not.\n\nProperties:\n\n * `tagName` {`\"igc-toast\"`} - \n\n * `styles` {`CSSResult[]`} - \n\n * `displayTimeout` {`Timeout`} - \n\n * `animationPlayer` - \n\n * `open` {`boolean`} - Determines whether the toast is opened.\n\n * `displayTime` {`number`} - Determines the time after which the toast will close\n\n * `keepOpen` {`boolean`} - Determines whether the toast is closed automatically or not.",
2803
2803
  "attributes": [
2804
2804
  {
2805
2805
  "name": "open",