@gov-design-system-ce/components 4.0.8-rc13 → 4.0.8-rc15

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 (85) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  3. package/dist/cjs/gov-tabs-item.cjs.entry.js +2 -3
  4. package/dist/cjs/gov-tabs-item.cjs.entry.js.map +1 -1
  5. package/dist/cjs/gov-tabs.cjs.entry.js +7 -3
  6. package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
  7. package/dist/cjs/gov-tooltip.cjs.entry.js +6 -4
  8. package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/components/gov-tabs/gov-tabs-item.js +1 -4
  11. package/dist/collection/components/gov-tabs/gov-tabs-item.js.map +1 -1
  12. package/dist/collection/components/gov-tabs/gov-tabs.js +7 -3
  13. package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
  14. package/dist/collection/components/gov-tooltip/gov-tooltip.js +6 -4
  15. package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
  16. package/dist/components/gov-accordion-item.js +1 -1
  17. package/dist/components/gov-attachments-item.js +1 -1
  18. package/dist/components/gov-breadcrumbs.js +1 -1
  19. package/dist/components/gov-button.js +1 -1
  20. package/dist/components/gov-card.js +1 -1
  21. package/dist/components/gov-chip.js +1 -1
  22. package/dist/components/gov-form-autocomplete.js +1 -1
  23. package/dist/components/gov-form-checkbox.js +1 -1
  24. package/dist/components/gov-form-file.js +1 -1
  25. package/dist/components/gov-form-input.js +1 -1
  26. package/dist/components/gov-form-multi-select.js +1 -1
  27. package/dist/components/gov-form-select.js +1 -1
  28. package/dist/components/gov-icon.js +1 -1
  29. package/dist/components/gov-infobar.js +1 -1
  30. package/dist/components/gov-loading.js +1 -1
  31. package/dist/components/gov-modal.js +1 -1
  32. package/dist/components/gov-pagination.js +1 -1
  33. package/dist/components/gov-prompt.js +1 -1
  34. package/dist/components/gov-side-nav-item.js +1 -1
  35. package/dist/components/gov-tabs-item.js +1 -1
  36. package/dist/components/gov-tabs-item.js.map +1 -1
  37. package/dist/components/gov-tabs.js +1 -1
  38. package/dist/components/gov-tabs.js.map +1 -1
  39. package/dist/components/gov-tag.js +1 -1
  40. package/dist/components/gov-toast.js +1 -1
  41. package/dist/components/gov-tooltip-content.js +1 -1
  42. package/dist/components/gov-tooltip.js +1 -1
  43. package/dist/components/gov-tooltip.js.map +1 -1
  44. package/dist/components/gov-wizard-item.js +1 -1
  45. package/dist/components/{p-3605bf8d.js → p-073f7584.js} +2 -2
  46. package/dist/components/{p-84d0a332.js → p-081fbcdd.js} +2 -2
  47. package/dist/components/{p-9c9fc4ae.js → p-45c5da49.js} +2 -2
  48. package/dist/components/{p-d9dda24d.js → p-c1c267f1.js} +2 -2
  49. package/dist/components/{p-479edf55.js → p-c5855f08.js} +2 -2
  50. package/dist/components/{p-e01962d9.js → p-caf1986b.js} +2 -2
  51. package/dist/components/{p-137f86d1.js → p-d0c49a55.js} +2 -2
  52. package/dist/core/core.esm.js +1 -1
  53. package/dist/core/core.esm.js.map +1 -1
  54. package/dist/core/p-1046221c.entry.js +2 -0
  55. package/dist/core/{p-56d42f3e.entry.js.map → p-1046221c.entry.js.map} +1 -1
  56. package/dist/core/p-31a7316b.entry.js +2 -0
  57. package/dist/core/p-31a7316b.entry.js.map +1 -0
  58. package/dist/core/{p-618df4db.entry.js → p-62f335de.entry.js} +2 -2
  59. package/dist/core/p-62f335de.entry.js.map +1 -0
  60. package/dist/core/{p-10dbd2e1.entry.js → p-868e1b14.entry.js} +2 -2
  61. package/dist/esm/core.js +1 -1
  62. package/dist/esm/gov-icon.entry.js +1 -1
  63. package/dist/esm/gov-tabs-item.entry.js +2 -3
  64. package/dist/esm/gov-tabs-item.entry.js.map +1 -1
  65. package/dist/esm/gov-tabs.entry.js +7 -3
  66. package/dist/esm/gov-tabs.entry.js.map +1 -1
  67. package/dist/esm/gov-tooltip.entry.js +6 -4
  68. package/dist/esm/gov-tooltip.entry.js.map +1 -1
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/hydrate/index.js +15 -10
  71. package/dist/hydrate/index.mjs +15 -10
  72. package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +1 -0
  73. package/package.json +1 -1
  74. package/dist/core/p-56d42f3e.entry.js +0 -2
  75. package/dist/core/p-618df4db.entry.js.map +0 -1
  76. package/dist/core/p-7a0b3094.entry.js +0 -2
  77. package/dist/core/p-7a0b3094.entry.js.map +0 -1
  78. /package/dist/components/{p-3605bf8d.js.map → p-073f7584.js.map} +0 -0
  79. /package/dist/components/{p-84d0a332.js.map → p-081fbcdd.js.map} +0 -0
  80. /package/dist/components/{p-9c9fc4ae.js.map → p-45c5da49.js.map} +0 -0
  81. /package/dist/components/{p-d9dda24d.js.map → p-c1c267f1.js.map} +0 -0
  82. /package/dist/components/{p-479edf55.js.map → p-c5855f08.js.map} +0 -0
  83. /package/dist/components/{p-e01962d9.js.map → p-caf1986b.js.map} +0 -0
  84. /package/dist/components/{p-137f86d1.js.map → p-d0c49a55.js.map} +0 -0
  85. /package/dist/core/{p-10dbd2e1.entry.js.map → p-868e1b14.entry.js.map} +0 -0
@@ -7592,7 +7592,7 @@ class GovTabs {
7592
7592
  await this.validateWcag();
7593
7593
  }
7594
7594
  }
7595
- prepareControllers() {
7595
+ prepareControllers(ignoreIndexing = false) {
7596
7596
  this.controllers = [];
7597
7597
  const promises = [];
7598
7598
  this.host.querySelectorAll(TabsItemClass.root).forEach((tab) => {
@@ -7614,6 +7614,10 @@ class GovTabs {
7614
7614
  });
7615
7615
  promises.push(controlItem);
7616
7616
  });
7617
+ if (ignoreIndexing) {
7618
+ this.reRender();
7619
+ return;
7620
+ }
7617
7621
  Promise.all(promises).then(controllers => {
7618
7622
  let defaultTabIndex = controllers.findIndex(controller => controller.default);
7619
7623
  if (defaultTabIndex === -1)
@@ -7638,7 +7642,7 @@ class GovTabs {
7638
7642
  });
7639
7643
  }
7640
7644
  render() {
7641
- return (hAsync(Host, { key: 'fa6bb0777c56edcb61f5acfa4cac75fae2f8bb78', class: this.h.classes(TabsClass.root), variant: this.variant, type: this.type, role: "tablist", "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, onKeyDown: this.onKeydownHandler.bind(this) }, hAsync("div", { key: '3e764b20b9a1e3221232d7567e45acae8701a963', class: TabsClass.tabs, "aria-hidden": toBoolAttr(this.compactControls) }, hAsync("ul", { key: 'adedeb20cd2d5608502410f1b843ba6293000e7c', class: TabsClass.list }, this.controllers.map(control => (hAsync("li", { class: TabsClass.item }, this.type == "text" ? (hAsync("button", { class: TabsClass.btn, id: control.triggerIdentifier, role: "tab", onClick: () => this.onSelectHandler(control), disabled: control.disabled, "aria-disabled": toBoolAttr(control.disabled), "aria-selected": toBoolAttr(control.active), "aria-controls": control.contentIdentifier, tabindex: control.active && !control.disabled ? 0 : -1, ref: el => (this.triggerRefs[control.triggerIdentifier] = el) }, control.label)) : (hAsync("gov-chip", { role: "tab", tag: 'button', identifier: control.triggerIdentifier, "wcag-selected": control.active, "wcag-controls": control.contentIdentifier, focusable: control.active, disabled: control.disabled, variant: this.variant, inverse: !control.active, ref: el => (this.triggerRefs[control.triggerIdentifier] = el), "on-gov-click": () => this.onSelectHandler(control) }, control.label))))))), hAsync("span", { key: '6d855cd5195673b6a13aaf4b357b74bdcfd0ef4d', id: this.formSelectId, hidden: true }, this.wcagSelectLabel), this.compactControls ? (hAsync("gov-form-select", { "wcag-labelled-by": this.formSelectId, "onGov-change": this.onChangeHandler.bind(this) }, this.controllers.map(control => (hAsync("option", { value: control.triggerIdentifier, selected: control.active }, control.label))))) : null, hAsync("slot", { key: 'd7ea30baebad93b05c1f978fcca0c19989be7227' })));
7645
+ return (hAsync(Host, { key: '4973320b8b4d6a8cf6e2a6ee1b8843be6d7a024a', class: this.h.classes(TabsClass.root), variant: this.variant, type: this.type, role: "tablist", "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, onKeyDown: this.onKeydownHandler.bind(this) }, hAsync("div", { key: '515c305c1a3bc3f7f3ff47e5bcf9def23248e9a6', class: TabsClass.tabs, "aria-hidden": toBoolAttr(this.compactControls) }, hAsync("ul", { key: '116d648283cf69d841d69d535249e76413dc035d', class: TabsClass.list }, this.controllers.map(control => (hAsync("li", { class: TabsClass.item }, this.type == "text" ? (hAsync("button", { class: TabsClass.btn, id: control.triggerIdentifier, role: "tab", onClick: () => this.onSelectHandler(control), disabled: control.disabled, "aria-disabled": toBoolAttr(control.disabled), "aria-selected": toBoolAttr(control.active), "aria-controls": control.contentIdentifier, tabindex: control.active && !control.disabled ? 0 : -1, ref: el => (this.triggerRefs[control.triggerIdentifier] = el) }, control.label)) : (hAsync("gov-chip", { role: "tab", tag: 'button', identifier: control.triggerIdentifier, "wcag-selected": control.active, "wcag-controls": control.contentIdentifier, focusable: control.active, disabled: control.disabled, variant: this.variant, inverse: !control.active, ref: el => (this.triggerRefs[control.triggerIdentifier] = el), "on-gov-click": () => this.onSelectHandler(control) }, control.label))))))), hAsync("span", { key: '5a0ee113d2584b09ae9d0b641e7c95dfcdc65b19', id: this.formSelectId, hidden: true }, this.wcagSelectLabel), this.compactControls ? (hAsync("gov-form-select", { "wcag-labelled-by": this.formSelectId, "onGov-change": this.onChangeHandler.bind(this) }, this.controllers.map(control => (hAsync("option", { value: control.triggerIdentifier, selected: control.active }, control.label))))) : null, hAsync("slot", { key: 'fe421d8bafa21f960e897dacbc84db723fca3362' })));
7642
7646
  }
7643
7647
  getCurrentTab() {
7644
7648
  return this.controllers.find(control => control.active) || null;
@@ -7725,7 +7729,7 @@ class GovTabs {
7725
7729
  * Regenerate tabs controllers
7726
7730
  */
7727
7731
  async rerender() {
7728
- this.prepareControllers();
7732
+ this.prepareControllers(true);
7729
7733
  }
7730
7734
  /**
7731
7735
  * Validate the WCAG attributes of the component
@@ -7788,7 +7792,7 @@ class GovTabsItem {
7788
7792
  }
7789
7793
  }
7790
7794
  render() {
7791
- return (hAsync(Host, { key: 'b316d961cabc1aed647deaa504ddca1184860f70', class: this.h.classes(TabsItemClass.root), default: this.default }, hAsync("div", { key: 'd73aa35cc5131b81eaceff6afab13250b2587aec', class: TabsItemClass.inner, role: "tabpanel", id: this.identifier || this.contentId, hidden: !this.isActive, "aria-labelledby": this.triggerIdentifier || this.triggerId, "aria-hidden": toBoolAttrIfDefined(!this.isActive) }, hAsync("slot", { key: '4bdf7cd566204ab3ac1883a5194abce6526fc0f0' }))));
7795
+ return (hAsync(Host, { key: 'b032a1e0fe87bcf0648a5a0056b94a426aef8480', class: this.h.classes(TabsItemClass.root), default: this.default }, hAsync("div", { key: '56d17e372058ee7239e008688dce4c41440879f7', class: TabsItemClass.inner, role: "tabpanel", id: this.identifier || this.contentId, hidden: !this.isActive, "aria-labelledby": this.triggerIdentifier || this.triggerId, "aria-hidden": toBoolAttrIfDefined(!this.isActive) }, hAsync("slot", { key: 'ecc6972f9500d619b856865cfd3d264fd222d3d1' }))));
7792
7796
  }
7793
7797
  /**
7794
7798
  * Returns a unique tab content identifier
@@ -7817,8 +7821,7 @@ class GovTabsItem {
7817
7821
  get host() { return getElement(this); }
7818
7822
  static get watchers() { return {
7819
7823
  "label": ["rerenderParent"],
7820
- "disabled": ["rerenderParent"],
7821
- "default": ["rerenderParent"]
7824
+ "disabled": ["rerenderParent"]
7822
7825
  }; }
7823
7826
  static get style() { return GovTabsItemStyle0; }
7824
7827
  static get cmpMeta() { return {
@@ -8126,12 +8129,14 @@ class GovTooltip {
8126
8129
  rerenderMessage() {
8127
8130
  this.createContentWrapper();
8128
8131
  }
8132
+ connectedCallback() {
8133
+ this.createContentWrapper();
8134
+ this.registerListeners();
8135
+ }
8129
8136
  componentWillLoad() {
8130
8137
  this.validateVariant(this.variant);
8131
8138
  this.validateSize(this.size);
8132
8139
  this.validatePosition(this.position);
8133
- this.createContentWrapper();
8134
- this.registerListeners();
8135
8140
  }
8136
8141
  componentDidUpdate() {
8137
8142
  this.createContentWrapper();
@@ -8288,11 +8293,11 @@ class GovTooltip {
8288
8293
  }
8289
8294
  render() {
8290
8295
  var _a;
8291
- return (hAsync(Host, { key: 'd16d7493cc470032d16e762e75c426c919b683d5', id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position }, hAsync("span", { key: 'd80316da39311fde00a00bb7867fd4c73864bd7e', role: 'button', tabindex: 0, onKeyPress: () => this.showTooltip(), onBlur: () => {
8296
+ return (hAsync(Host, { key: '79f1e7f55aa44da4cc08be8f388921c2c940d834', id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position }, hAsync("span", { key: '361c2997c12aa96a171ebb1558986b83990b5778', role: 'button', tabindex: 0, onKeyPress: () => this.showTooltip(), onBlur: () => {
8292
8297
  if (this.persist === false) {
8293
8298
  this.hideTooltip();
8294
8299
  }
8295
- }, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, hAsync("slot", { key: '1ccc180def543def370a189a5c10351fc166dcdd' }))));
8300
+ }, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, hAsync("slot", { key: 'bffc64135254b57fb4514a8afdc44bfe4b8f3015' }))));
8296
8301
  }
8297
8302
  /**
8298
8303
  * Showing the modal
@@ -7588,7 +7588,7 @@ class GovTabs {
7588
7588
  await this.validateWcag();
7589
7589
  }
7590
7590
  }
7591
- prepareControllers() {
7591
+ prepareControllers(ignoreIndexing = false) {
7592
7592
  this.controllers = [];
7593
7593
  const promises = [];
7594
7594
  this.host.querySelectorAll(TabsItemClass.root).forEach((tab) => {
@@ -7610,6 +7610,10 @@ class GovTabs {
7610
7610
  });
7611
7611
  promises.push(controlItem);
7612
7612
  });
7613
+ if (ignoreIndexing) {
7614
+ this.reRender();
7615
+ return;
7616
+ }
7613
7617
  Promise.all(promises).then(controllers => {
7614
7618
  let defaultTabIndex = controllers.findIndex(controller => controller.default);
7615
7619
  if (defaultTabIndex === -1)
@@ -7634,7 +7638,7 @@ class GovTabs {
7634
7638
  });
7635
7639
  }
7636
7640
  render() {
7637
- return (hAsync(Host, { key: 'fa6bb0777c56edcb61f5acfa4cac75fae2f8bb78', class: this.h.classes(TabsClass.root), variant: this.variant, type: this.type, role: "tablist", "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, onKeyDown: this.onKeydownHandler.bind(this) }, hAsync("div", { key: '3e764b20b9a1e3221232d7567e45acae8701a963', class: TabsClass.tabs, "aria-hidden": toBoolAttr(this.compactControls) }, hAsync("ul", { key: 'adedeb20cd2d5608502410f1b843ba6293000e7c', class: TabsClass.list }, this.controllers.map(control => (hAsync("li", { class: TabsClass.item }, this.type == "text" ? (hAsync("button", { class: TabsClass.btn, id: control.triggerIdentifier, role: "tab", onClick: () => this.onSelectHandler(control), disabled: control.disabled, "aria-disabled": toBoolAttr(control.disabled), "aria-selected": toBoolAttr(control.active), "aria-controls": control.contentIdentifier, tabindex: control.active && !control.disabled ? 0 : -1, ref: el => (this.triggerRefs[control.triggerIdentifier] = el) }, control.label)) : (hAsync("gov-chip", { role: "tab", tag: 'button', identifier: control.triggerIdentifier, "wcag-selected": control.active, "wcag-controls": control.contentIdentifier, focusable: control.active, disabled: control.disabled, variant: this.variant, inverse: !control.active, ref: el => (this.triggerRefs[control.triggerIdentifier] = el), "on-gov-click": () => this.onSelectHandler(control) }, control.label))))))), hAsync("span", { key: '6d855cd5195673b6a13aaf4b357b74bdcfd0ef4d', id: this.formSelectId, hidden: true }, this.wcagSelectLabel), this.compactControls ? (hAsync("gov-form-select", { "wcag-labelled-by": this.formSelectId, "onGov-change": this.onChangeHandler.bind(this) }, this.controllers.map(control => (hAsync("option", { value: control.triggerIdentifier, selected: control.active }, control.label))))) : null, hAsync("slot", { key: 'd7ea30baebad93b05c1f978fcca0c19989be7227' })));
7641
+ return (hAsync(Host, { key: '4973320b8b4d6a8cf6e2a6ee1b8843be6d7a024a', class: this.h.classes(TabsClass.root), variant: this.variant, type: this.type, role: "tablist", "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, onKeyDown: this.onKeydownHandler.bind(this) }, hAsync("div", { key: '515c305c1a3bc3f7f3ff47e5bcf9def23248e9a6', class: TabsClass.tabs, "aria-hidden": toBoolAttr(this.compactControls) }, hAsync("ul", { key: '116d648283cf69d841d69d535249e76413dc035d', class: TabsClass.list }, this.controllers.map(control => (hAsync("li", { class: TabsClass.item }, this.type == "text" ? (hAsync("button", { class: TabsClass.btn, id: control.triggerIdentifier, role: "tab", onClick: () => this.onSelectHandler(control), disabled: control.disabled, "aria-disabled": toBoolAttr(control.disabled), "aria-selected": toBoolAttr(control.active), "aria-controls": control.contentIdentifier, tabindex: control.active && !control.disabled ? 0 : -1, ref: el => (this.triggerRefs[control.triggerIdentifier] = el) }, control.label)) : (hAsync("gov-chip", { role: "tab", tag: 'button', identifier: control.triggerIdentifier, "wcag-selected": control.active, "wcag-controls": control.contentIdentifier, focusable: control.active, disabled: control.disabled, variant: this.variant, inverse: !control.active, ref: el => (this.triggerRefs[control.triggerIdentifier] = el), "on-gov-click": () => this.onSelectHandler(control) }, control.label))))))), hAsync("span", { key: '5a0ee113d2584b09ae9d0b641e7c95dfcdc65b19', id: this.formSelectId, hidden: true }, this.wcagSelectLabel), this.compactControls ? (hAsync("gov-form-select", { "wcag-labelled-by": this.formSelectId, "onGov-change": this.onChangeHandler.bind(this) }, this.controllers.map(control => (hAsync("option", { value: control.triggerIdentifier, selected: control.active }, control.label))))) : null, hAsync("slot", { key: 'fe421d8bafa21f960e897dacbc84db723fca3362' })));
7638
7642
  }
7639
7643
  getCurrentTab() {
7640
7644
  return this.controllers.find(control => control.active) || null;
@@ -7721,7 +7725,7 @@ class GovTabs {
7721
7725
  * Regenerate tabs controllers
7722
7726
  */
7723
7727
  async rerender() {
7724
- this.prepareControllers();
7728
+ this.prepareControllers(true);
7725
7729
  }
7726
7730
  /**
7727
7731
  * Validate the WCAG attributes of the component
@@ -7784,7 +7788,7 @@ class GovTabsItem {
7784
7788
  }
7785
7789
  }
7786
7790
  render() {
7787
- return (hAsync(Host, { key: 'b316d961cabc1aed647deaa504ddca1184860f70', class: this.h.classes(TabsItemClass.root), default: this.default }, hAsync("div", { key: 'd73aa35cc5131b81eaceff6afab13250b2587aec', class: TabsItemClass.inner, role: "tabpanel", id: this.identifier || this.contentId, hidden: !this.isActive, "aria-labelledby": this.triggerIdentifier || this.triggerId, "aria-hidden": toBoolAttrIfDefined(!this.isActive) }, hAsync("slot", { key: '4bdf7cd566204ab3ac1883a5194abce6526fc0f0' }))));
7791
+ return (hAsync(Host, { key: 'b032a1e0fe87bcf0648a5a0056b94a426aef8480', class: this.h.classes(TabsItemClass.root), default: this.default }, hAsync("div", { key: '56d17e372058ee7239e008688dce4c41440879f7', class: TabsItemClass.inner, role: "tabpanel", id: this.identifier || this.contentId, hidden: !this.isActive, "aria-labelledby": this.triggerIdentifier || this.triggerId, "aria-hidden": toBoolAttrIfDefined(!this.isActive) }, hAsync("slot", { key: 'ecc6972f9500d619b856865cfd3d264fd222d3d1' }))));
7788
7792
  }
7789
7793
  /**
7790
7794
  * Returns a unique tab content identifier
@@ -7813,8 +7817,7 @@ class GovTabsItem {
7813
7817
  get host() { return getElement(this); }
7814
7818
  static get watchers() { return {
7815
7819
  "label": ["rerenderParent"],
7816
- "disabled": ["rerenderParent"],
7817
- "default": ["rerenderParent"]
7820
+ "disabled": ["rerenderParent"]
7818
7821
  }; }
7819
7822
  static get style() { return GovTabsItemStyle0; }
7820
7823
  static get cmpMeta() { return {
@@ -8122,12 +8125,14 @@ class GovTooltip {
8122
8125
  rerenderMessage() {
8123
8126
  this.createContentWrapper();
8124
8127
  }
8128
+ connectedCallback() {
8129
+ this.createContentWrapper();
8130
+ this.registerListeners();
8131
+ }
8125
8132
  componentWillLoad() {
8126
8133
  this.validateVariant(this.variant);
8127
8134
  this.validateSize(this.size);
8128
8135
  this.validatePosition(this.position);
8129
- this.createContentWrapper();
8130
- this.registerListeners();
8131
8136
  }
8132
8137
  componentDidUpdate() {
8133
8138
  this.createContentWrapper();
@@ -8284,11 +8289,11 @@ class GovTooltip {
8284
8289
  }
8285
8290
  render() {
8286
8291
  var _a;
8287
- return (hAsync(Host, { key: 'd16d7493cc470032d16e762e75c426c919b683d5', id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position }, hAsync("span", { key: 'd80316da39311fde00a00bb7867fd4c73864bd7e', role: 'button', tabindex: 0, onKeyPress: () => this.showTooltip(), onBlur: () => {
8292
+ return (hAsync(Host, { key: '79f1e7f55aa44da4cc08be8f388921c2c940d834', id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position }, hAsync("span", { key: '361c2997c12aa96a171ebb1558986b83990b5778', role: 'button', tabindex: 0, onKeyPress: () => this.showTooltip(), onBlur: () => {
8288
8293
  if (this.persist === false) {
8289
8294
  this.hideTooltip();
8290
8295
  }
8291
- }, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, hAsync("slot", { key: '1ccc180def543def370a189a5c10351fc166dcdd' }))));
8296
+ }, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, hAsync("slot", { key: 'bffc64135254b57fb4514a8afdc44bfe4b8f3015' }))));
8292
8297
  }
8293
8298
  /**
8294
8299
  * Showing the modal
@@ -34,6 +34,7 @@ export declare class GovTooltip {
34
34
  validateSize(newValue: string): void;
35
35
  validatePosition(newValue: string): void;
36
36
  rerenderMessage(): void;
37
+ connectedCallback(): void;
37
38
  componentWillLoad(): void;
38
39
  componentDidUpdate(): void;
39
40
  disconnectedCallback(): void;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gov-design-system-ce/components",
3
3
  "description": "This package includes Gov Design System Web Components and related utilities.",
4
4
  "author": "Zdeněk Vítek",
5
- "version": "4.0.8-rc13",
5
+ "version": "4.0.8-rc15",
6
6
  "license": "EUPL v1.2 Licensed",
7
7
  "main": "./dist/index.cjs.js",
8
8
  "unpkg": "./dist/core/core.esm.js",
@@ -1,2 +0,0 @@
1
- import{r as t,h as e,a,g as s}from"./p-0a5b0f7d.js";import{g as i,t as r}from"./p-4191acf2.js";import{c as n}from"./p-95d41a3b.js";import{a as o,T as c}from"./p-4faa3ba6.js";import"./p-03dbb8b1.js";import"./p-e0e2e9c1.js";const d=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-tabs-item{color:var(--gov-tabs-text-color, var(--gov-color-secondary-700))}.gov-tabs-item__inner>*:last-child{margin-bottom:0}";const f=d;const h=class{constructor(e){t(this,e);this.identifier=undefined;this.triggerIdentifier=undefined;this.label=undefined;this.disabled=false;this.default=false;this.isActive=false;this.h=i(this.host);this.contentId=n("GovTabContent");this.triggerId=n("GovTabTrigger")}rerenderParent(){const t=this.h.getParent(o.root);if(t){t.rerender().catch()}}render(){return e(a,{key:"b316d961cabc1aed647deaa504ddca1184860f70",class:this.h.classes(c.root),default:this.default},e("div",{key:"d73aa35cc5131b81eaceff6afab13250b2587aec",class:c.inner,role:"tabpanel",id:this.identifier||this.contentId,hidden:!this.isActive,"aria-labelledby":this.triggerIdentifier||this.triggerId,"aria-hidden":r(!this.isActive)},e("slot",{key:"4bdf7cd566204ab3ac1883a5194abce6526fc0f0"})))}async getIdentifier(){return this.identifier||this.contentId}async getTriggerIdentifier(){return this.triggerIdentifier||this.triggerId}async getDisableState(){return this.disabled}async setActiveStatus(t){this.isActive=t}get host(){return s(this)}static get watchers(){return{label:["rerenderParent"],disabled:["rerenderParent"],default:["rerenderParent"]}}};h.style=f;export{h as gov_tabs_item};
2
- //# sourceMappingURL=p-56d42f3e.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govTabsCss","GovTabsStyle0","GovTabs","constructor","hostRef","this","triggerRefs","h","govHost","host","formSelectId","createID","validateType","newValue","validateProp","TabTypes","TabsClass","root","validateVariant","TabVariants","componentWillLoad","prepareControllers","componentDidRender","canValidateWcagOnRender","delay","validateWcag","controllers","promises","querySelectorAll","TabsItemClass","forEach","tab","controlItem","Promise","all","getIdentifier","getTriggerIdentifier","getDisableState","then","identifier","triggerIdentifier","disabled","isDefault","getAttribute","label","contentIdentifier","element","active","default","push","defaultTabIndex","findIndex","controller","focusIndex","reRender","setActiveByIdentifier","temp","map","item","control","setActiveStatus","catch","render","Host","key","class","classes","variant","type","role","wcagLabel","wcagLabelledBy","onKeyDown","onKeydownHandler","bind","tabs","toBoolAttr","compactControls","list","btn","id","onClick","onSelectHandler","tabindex","ref","el","tag","focusable","inverse","hidden","wcagSelectLabel","onChangeHandler","value","selected","getCurrentTab","find","index","t","govChange","emit","e","triggerId","target","stopPropagation","keyCode","goToPrevNext","includes","length","current","trigger","nodeName","toLowerCase","setFocus","focus","refresh","currentTab","setActiveTab","rerender","validateWcagProp","validateWcagLabel"],"sources":["../../../packages/core/src/components/gov-tabs/gov-tabs.scss?tag=gov-tabs","../../../packages/core/src/components/gov-tabs/gov-tabs.tsx"],"sourcesContent":["/*\n * Tabs\n */\n\n$class: \".gov-tabs\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@extend %reset-ul;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tmargin: rem-calc(0 0 20);\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tmargin: 0;\n\t}\n\t&__btn {\n\t\t@include typography($font-size-s);\n\t\t@include button-core();\n\t\t@include focus-outline();\n\t\tmargin: 0;\n\t\tpadding: rem-calc(12 0 10);\n\t\tborder-bottom: rem-calc(2) solid transparent;\n\t\tfont-weight: 700;\n\t\ttext-align: center;\n\t\ttransition: $t linear color, $t linear border-color;\n\t\t&[disabled] {\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $type, $definitions in $tabs-types {\n\t\t&[type=\"#{$type}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__list {\n\t\t\t\t\tgap: get(\"item-spacing\", $definitions);\n\t\t\t\t\t@if deep-map-check($definitions, \"border\") {\n\t\t\t\t\t\tborder-bottom: $tabs-list-border;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $definitions in $tabs-variants {\n\t\t&[variant=\"#{$variant}\"][type=\"text\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__btn:not([disabled]) {\n\t\t\t\t\tcolor: get(\"color\", $definitions);\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tcolor: get(\"color-hover\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// STATES\n\t\t\t\t&__btn[aria-selected=\"true\"] {\n\t\t\t\t\tborder-bottom-color: get(\"color-active\", $definitions);\n\t\t\t\t\tcolor: get(\"color-active\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t&[orientation=\"vertical\"] {\n\t\t#{$class}__btn {\n\t\t\ttext-align: left;\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: xl) {\n\t\t&[orientation=\"vertical\"] {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\n\t\t\t#{$class}__list {\n\t\t\t\tflex-wrap: nowrap;\n\t\t\t\tflex-direction: column;\n\t\t\t\twidth: max-content;\n\t\t\t\tmax-width: 30vw;\n\t\t\t\tmargin-right: rem-calc(20);\n\t\t\t\tpadding: rem-calc(0 8);\n\t\t\t\tborder-bottom: none;\n\t\t\t\tborder-right: $tabs-list-border;\n\t\t\t}\n\n\t\t\t#{$class}__item {\n\t\t\t\tjustify-content: flex-end;\n\t\t\t}\n\n\t\t\t#{$class}__btn {\n\t\t\t\tpadding: rem-calc(8 12);\n\t\t\t\ttext-align: right;\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\n\nimport {govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {canValidateWcagOnRender} from \"../../helpers/Dom/win\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {validateWcagLabel, validateWcagProp} from \"../../helpers/Validate/wcag\"\nimport {Nullable} from \"../../types/interfaces\"\nimport {createID} from \"../../utils/string.utils\"\nimport {delay} from \"../../utils/utils\"\nimport {TabOrientationType, TabsClass, TabsItemClass, TabType, TabTypes, TabVariants, VariantType} from \"./constants\"\nimport {GovTabControllerItem} from \"./gov-tabs.types\"\n\n@Component({\n\ttag: \"gov-tabs\",\n\tstyleUrl: \"gov-tabs.scss\",\n})\nexport class GovTabs {\n\tprivate h: GovHost\n\tprivate triggerRefs: Record<string, HTMLButtonElement | HTMLGovChipElement> = {}\n\n\tprivate readonly formSelectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.formSelectId = createID(\"GovFormSelect\")\n\t}\n\n\t@Element() host: HTMLGovTabsElement\n\t@State() controllers: GovTabControllerItem[] = []\n\t@State() focusIndex = 0\n\t@State() compactControls = false\n\t/**\n\t * Tabs type\n\t */\n\t@Prop() readonly type: TabType = \"text\"\n\t/**\n\t * Style variation of the tab chips.\n\t */\n\t@Prop() readonly variant?: VariantType = \"primary\"\n\t/**\n\t * Tabs orientation\n\t */\n\t@Prop() readonly orientation: TabOrientationType = \"horizontal\"\n\t/**\n\t * Adds accessible label for the tabs that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"wcag-label\"}) readonly wcagLabel: string\n\t/**\n\t * Adds accessible label for the tabs select\n\t */\n\t@Prop({attribute: \"wcag-select-label\"}) readonly wcagSelectLabel: string\n\t/**\n\t * Indicates the id of a component that labels the tabs.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the tab is changed.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<HTMLGovTabsItemElement>\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(TabTypes, newValue, TabsClass.root)\n\t}\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TabVariants, newValue, TabsClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.prepareControllers()\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate prepareControllers(): void {\n\t\tthis.controllers = []\n\t\tconst promises: Promise<GovTabControllerItem>[] = []\n\t\tthis.host.querySelectorAll(TabsItemClass.root).forEach((tab: HTMLGovTabsItemElement) => {\n\t\t\tconst controlItem = Promise.all([\n\t\t\t\ttab.getIdentifier(),\n\t\t\t\ttab.getTriggerIdentifier(),\n\t\t\t\ttab.getDisableState()\n\t\t\t]).then(([identifier, triggerIdentifier, disabled]) => {\n\t\t\t\tconst isDefault = typeof tab.getAttribute(\"default\") === \"string\"\n\t\t\t\treturn {\n\t\t\t\t\tlabel: tab.getAttribute(\"label\"),\n\t\t\t\t\tcontentIdentifier: identifier,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\ttriggerIdentifier: triggerIdentifier,\n\t\t\t\t\telement: tab,\n\t\t\t\t\tactive: false,\n\t\t\t\t\tdefault: isDefault,\n\t\t\t\t}\n\t\t\t})\n\t\t\tpromises.push(controlItem)\n\t\t});\n\t\tPromise.all(promises).then(controllers => {\n\t\t\tlet defaultTabIndex = controllers.findIndex(controller => controller.default)\n\t\t\tif (defaultTabIndex === -1) defaultTabIndex = 0\n\t\t\tthis.focusIndex = defaultTabIndex\n\t\t\tcontrollers[defaultTabIndex].active = true\n\t\t\tthis.controllers = [...controllers]\n\t\t\tthis.reRender()\n\t\t})\n\t}\n\n\tprivate setActiveByIdentifier(identifier: string) {\n\t\tconst temp = []\n\t\tthis.controllers.map(item => {\n\t\t\titem.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier\n\t\t\ttemp.push(item)\n\t\t})\n\t\tthis.controllers = [...temp]\n\t}\n\n\tprivate reRender() {\n\t\tthis.controllers.map(control => {\n\t\t\tcontrol.element.setActiveStatus(control.active).catch()\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TabsClass.root)}\n\t\t\t\tvariant={this.variant}\n\t\t\t\ttype={this.type}\n\t\t\t\trole=\"tablist\"\n\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\tonKeyDown={this.onKeydownHandler.bind(this)}\n\t\t\t>\n\t\t\t\t<div class={TabsClass.tabs} aria-hidden={toBoolAttr(this.compactControls)}>\n\t\t\t\t\t<ul class={TabsClass.list}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<li class={TabsClass.item}>\n\t\t\t\t\t\t\t\t{this.type == \"text\" ? (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tclass={TabsClass.btn}\n\t\t\t\t\t\t\t\t\t\tid={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\taria-disabled={toBoolAttr(control.disabled)}\n\t\t\t\t\t\t\t\t\t\taria-selected={toBoolAttr(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\ttabindex={control.active && !control.disabled ? 0 : -1}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLButtonElement)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<gov-chip\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttag={'button'}\n\t\t\t\t\t\t\t\t\t\tidentifier={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\twcag-selected={control.active}\n\t\t\t\t\t\t\t\t\t\twcag-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\tfocusable={control.active}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\tinverse={!control.active}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLGovChipElement)}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t</gov-chip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\n\t\t\t\t<span id={this.formSelectId} hidden>\n\t\t\t\t\t{this.wcagSelectLabel}\n\t\t\t\t</span>\n\t\t\t\t{this.compactControls ? (\n\t\t\t\t\t<gov-form-select wcag-labelled-by={this.formSelectId} onGov-change={this.onChangeHandler.bind(this)}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<option value={control.triggerIdentifier} selected={control.active}>\n\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</gov-form-select>\n\t\t\t\t) : null}\n\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate getCurrentTab(): GovTabControllerItem | null {\n\t\treturn this.controllers.find(control => control.active) || null\n\t}\n\n\tprivate onSelectHandler(control: GovTabControllerItem) {\n\t\tconst index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);\n\t\tthis.focusIndex = index\n\t\tthis.setActiveByIdentifier(control.triggerIdentifier)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onChangeHandler(e: CustomEvent) {\n\t\tconst triggerId = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.setActiveByIdentifier(triggerId)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onKeydownHandler(e: KeyboardEvent) {\n\t\tconst keyCode = e.keyCode\n\n\t\te.stopPropagation()\n\t\tthis.goToPrevNext(keyCode)\n\t}\n\n\tprivate goToPrevNext(keyCode: number) {\n\t\tif ([37, 38, 39, 40].includes(keyCode)) {\n\t\t\tif (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.controllers[this.focusIndex].active = false\n\n\t\t\tif (keyCode === 39 || keyCode === 40) {\n\t\t\t\tthis.focusIndex++\n\t\t\t\tif (this.focusIndex >= this.controllers.length) {\n\t\t\t\t\tthis.focusIndex = 0\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(40)\n\t\t\t\t}\n\t\t\t} else if (keyCode === 37 || keyCode === 38) {\n\t\t\t\tthis.focusIndex--\n\t\t\t\tif (this.focusIndex < 0) {\n\t\t\t\t\tthis.focusIndex = this.controllers.length - 1\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(38)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {\n\t\t\t\tconst current = this.controllers[this.focusIndex]\n\t\t\t\tcurrent.active = true\n\t\t\t\tconst trigger = this.triggerRefs[current.triggerIdentifier]\n\t\t\t\tif (trigger.nodeName.toLowerCase() === 'gov-chip') {\n\t\t\t\t\t(this.triggerRefs[current.triggerIdentifier] as HTMLGovChipElement).setFocus()\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerRefs[current.triggerIdentifier].focus()\n\t\t\t\t}\n\n\t\t\t\tthis.controllers = [...this.controllers]\n\t\t\t\tthis.reRender()\n\t\t\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync refresh(): Promise<void> {\n\t\tthis.prepareControllers()\n\t}\n\n\t/**\n\t * Returns the currently selected tabs-item\n\t */\n\t@Method()\n\tasync currentTab(): Promise<Nullable<HTMLGovTabsItemElement>> {\n\t\treturn this.getCurrentTab().element || null\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync setActiveTab(identifier: string): Promise<void> {\n\t\tthis.setActiveByIdentifier(identifier)\n\t\tthis.reRender()\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync rerender(): Promise<void> {\n\t\tthis.prepareControllers();\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagSelectLabel, \"wcag-select-label\", TabsClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, TabsClass.root)\n\t}\n}\n"],"mappings":"0YAAA,MAAMA,EAAa,wgKACnB,MAAAC,EAAeD,E,MCgBFE,EAAO,MAMnB,WAAAC,CAAAC,G,gDAJQC,KAAAC,YAAsE,G,iBAU/B,G,gBACzB,E,qBACK,M,UAIM,O,aAIQ,U,iBAIU,a,sFAnBlDD,KAAKE,EAAIC,EAA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D,KAAKqB,YAAYrB,KAAKgD,YAAYZ,SAAU,CAC/CpC,KAAKoG,aAAa,G,OAEb,GAAID,IAAY,IAAMA,IAAY,GAAI,CAC5CnG,KAAKgD,aACL,GAAIhD,KAAKgD,WAAa,EAAG,CACxBhD,KAAKgD,WAAahD,KAAKqB,YAAYiF,OAAS,C,CAE7C,GAAItG,KAAKqB,YAAYrB,KAAKgD,YAAYZ,SAAU,CAC/CpC,KAAKoG,aAAa,G,EAIpB,GAAIpG,KAAKgD,YAAc,GAAKhD,KAAKgD,YAAchD,KAAKqB,YAAYiF,OAAS,EAAG,CAC3E,MAAMC,EAAUvG,KAAKqB,YAAYrB,KAAKgD,YACtCuD,EAAQ7D,OAAS,KACjB,MAAM8D,EAAUxG,KAAKC,YAAYsG,EAAQpE,mBACzC,GAAIqE,EAAQC,SAASC,gBAAkB,WAAY,CACjD1G,KAAKC,YAAYsG,EAAQpE,mBAA0CwE,U,KAC9D,CACN3G,KAAKC,YAAYsG,EAAQpE,mBAAmByE,O,CAG7C5G,KAAKqB,YAAc,IAAIrB,KAAKqB,aAC5BrB,KAAKiD,WACLjD,KAAK6F,UAAUC,KAAK9F,KAAKyF,gBAAgBhD,Q,GAS5C,aAAMoE,GACL7G,KAAKgB,oB,CAON,gBAAM8F,GACL,OAAO9G,KAAKyF,gBAAgBhD,SAAW,I,CAOxC,kBAAMsE,CAAa7E,GAClBlC,KAAKkD,sBAAsBhB,GAC3BlC,KAAKiD,U,CAON,cAAM+D,GACLhH,KAAKgB,oB,CAON,kBAAMI,GACL6F,EAAiBjH,KAAKqF,gBAAiB,oBAAqB1E,EAAUC,MACtEsG,EAAkBlH,KAAKiE,UAAWjE,KAAKkE,eAAgBvD,EAAUC,K","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as i,h as t,a as s,g as o}from"./p-0a5b0f7d.js";import{v as e}from"./p-344c72d7.js";import{T as h,a as n,b as a,c as r,d as c}from"./p-ce45c786.js";import{c as p}from"./p-95d41a3b.js";import{g as d}from"./p-4191acf2.js";import{d as f}from"./p-e618f1cb.js";import{t as l}from"./p-240c302e.js";import"./p-e296ca83.js";import"./p-03dbb8b1.js";import"./p-92f420cb.js";import"./p-e0e2e9c1.js";const m='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-tooltip{display:inline-block;border-bottom:1px dashed currentcolor;color:var(--gov-color-primary);cursor:help}.gov-tooltip[icon=""],.gov-tooltip[icon=true i],.gov-tooltip[icon="1"]{border-bottom:0}';const u=m;const v=class{constructor(t){i(this,t);this.tooltipContentId=undefined;this.tooltipId=undefined;this.variant=h.PRIMARY;this.size=n._M;this.position="right";this.message=undefined;this.identifier=undefined;this.icon=undefined;this.persist=false;this.h=d(this.host);this.tooltipId=p("GovTooltip");this.tooltipContentId=p("GovContentTooltip")}validateVariant(i){e(h,i,c.root)}validateSize(i){e(n,i,c.root)}validatePosition(i){e(r,i,c.root)}rerenderMessage(){this.createContentWrapper()}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.validatePosition(this.position);this.createContentWrapper();this.registerListeners()}componentDidUpdate(){this.createContentWrapper()}disconnectedCallback(){this.removeContent()}createContentWrapper(){var i;if(this.tooltipContent){if(this.message){this.tooltipContent.innerHTML=this.message}else if(this.insideContent){this.tooltipContent.innerHTML=this.insideContent.innerHTML}return}let t;if(this.insideContent){t=this.insideContent}else{t=f().createElement(a.root);t.innerHTML=this.message}t.setAttribute("id",(i=this.identifier)!==null&&i!==void 0?i:this.tooltipContentId);t.setAttribute("parent-id",this.tooltipId);t.setAttribute("variant",this.variant);t.setAttribute("size",this.size);f().body.appendChild(t)}get tooltipContent(){var i;return f().body.querySelector(`#${(i=this.identifier)!==null&&i!==void 0?i:this.tooltipContentId}`)}get insideContent(){return this.host.querySelector(a.root)}registerListeners(){this.host.addEventListener("click",(i=>{i.preventDefault();this.persist=true;if(this.tooltipContent){this.tooltipContent.setAttribute("persist","true")}this.showTooltip()}));this.host.addEventListener("mouseenter",(i=>{i.preventDefault();this.showTooltip()}));this.host.addEventListener("mouseleave",(i=>{i.preventDefault();if(this.persist===false){this.hideTooltip()}}))}verifyPositionSpace(){const i=12;const t=window.innerWidth-(window.innerWidth-document.documentElement.clientWidth);const s=this.host.getBoundingClientRect();const o=this.host.offsetWidth;const e=this.host.offsetHeight;const h=this.tooltipContent.offsetWidth;const n=this.tooltipContent.offsetHeight;const a={left:s.left+document.documentElement.scrollLeft,top:s.top+document.documentElement.scrollTop};const c=a.left+i+s.width+h<=t;const p=a.left>h;if(this.position===r.LEFT||this.position===r.RIGHT){this.tooltipContent.style.top=a.top-(n-e)/2+"px";if(c===false&&p===false){this.position=r.TOP;this.tooltipContent.setAttribute("position",r.TOP)}if(p&&c===false&&this.position===r.RIGHT){this.position=r.LEFT}if(c&&p===false&&this.position===r.LEFT){this.position=r.RIGHT}}if(this.position===r.RIGHT){this.tooltipContent.setAttribute("position",r.RIGHT);this.tooltipContent.style.left=a.left+i+s.width+"px"}if(this.position===r.LEFT){this.tooltipContent.setAttribute("position",r.LEFT);this.tooltipContent.style.left=a.left-(h+i)+"px"}if(this.position===r.TOP||this.position===r.BOTTOM){if(h>o){let s=a.left-(h-o)/2;const e=s<0;const n=s+h>t;if(e&&n){this.tooltipContent.style.width="auto";this.tooltipContent.style.left=i+"px";this.tooltipContent.style.right=i+"px"}else{if(e){s=i}if(n){s=s-(t-(s+h+i))*-1}this.tooltipContent.style.left=s+"px"}}else{const i=a.left+(o-h)/2;this.tooltipContent.style.left=i+"px"}}if(this.position===r.TOP){this.tooltipContent.setAttribute("position",r.TOP);this.tooltipContent.style.top=a.top-(n+i)+"px"}if(this.position===r.BOTTOM){this.tooltipContent.setAttribute("position",r.BOTTOM);this.tooltipContent.style.top=a.top+(e+i)+"px"}this.tooltipContent.style.opacity="1"}showTooltip(){if(this.tooltipContent){this.tooltipContent.style.opacity="0";this.tooltipContent.hidden=false;this.tooltipContent.setAttribute("is-visible","true");l((()=>{this.verifyPositionSpace()}))}}hideTooltip(){if(this.tooltipContent){this.tooltipContent.setAttribute("is-visible","false");this.tooltipContent.setAttribute("persist","false");this.tooltipContent.removeAttribute("style")}}removeContent(){const i=document.getElementById(this.tooltipContentId);if(i){i.remove()}}render(){var i;return t(s,{key:"d16d7493cc470032d16e762e75c426c919b683d5",id:this.tooltipId,class:this.h.classes(c.root),position:this.position},t("span",{key:"d80316da39311fde00a00bb7867fd4c73864bd7e",role:"button",tabindex:0,onKeyPress:()=>this.showTooltip(),onBlur:()=>{if(this.persist===false){this.hideTooltip()}},"aria-describedby":(i=this.identifier)!==null&&i!==void 0?i:this.tooltipContentId},t("slot",{key:"1ccc180def543def370a189a5c10351fc166dcdd"})))}async show(){this.showTooltip()}async hide(){this.persist=false;this.hideTooltip()}get host(){return o(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize"],position:["validatePosition"],message:["rerenderMessage"]}}};v.style=u;export{v as gov_tooltip};
2
- //# sourceMappingURL=p-7a0b3094.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govTooltipCss","GovTooltipStyle0","GovTooltip","constructor","hostRef","this","tooltipContentId","undefined","tooltipId","TooltipVariant","PRIMARY","TooltipSize","_M","h","govHost","host","createID","validateVariant","newValue","validateProp","TooltipClass","root","validateSize","validatePosition","TooltipPosition","rerenderMessage","createContentWrapper","componentWillLoad","variant","size","position","registerListeners","componentDidUpdate","disconnectedCallback","removeContent","tooltipContent","message","innerHTML","insideContent","content","documentNode","createElement","TooltipContentClass","setAttribute","_a","identifier","body","appendChild","querySelector","addEventListener","e","preventDefault","persist","showTooltip","hideTooltip","verifyPositionSpace","offset","windowWidth","window","innerWidth","document","documentElement","clientWidth","trigger","getBoundingClientRect","trgWidth","offsetWidth","trgHeight","offsetHeight","contentWidth","contentHeight","triggerPos","left","scrollLeft","top","scrollTop","isRightSpace","width","isLeftSpace","LEFT","RIGHT","style","TOP","BOTTOM","leftPosition","isNotLeftSpace","isNotRightSpace","right","opacity","hidden","tick","removeAttribute","contentEl","getElementById","remove","render","Host","key","id","class","classes","role","tabindex","onKeyPress","onBlur","show","hide"],"sources":["../../../packages/core/src/components/gov-tooltip/gov-tooltip.scss?tag=gov-tooltip","../../../packages/core/src/components/gov-tooltip/gov-tooltip.tsx"],"sourcesContent":["/*\n * Tooltip\n */\n\n$class: \".gov-tooltip\";\n\n#{$class} {\n\tdisplay: inline-block;\n\tborder-bottom: 1px dashed currentcolor;\n\tcolor: color(\"primary\");\n\tcursor: help;\n\n\t@include parameter(\"icon\") {\n\t\tborder-bottom: 0;\n\t}\n}\n","import {Component, Element, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipVariant,\n\tTooltipVariantType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {documentNode} from \"../../helpers/Dom/win\";\nimport {Nullable} from \"../../utils/helpers.types\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-tooltip\",\n\tstyleUrl: \"gov-tooltip.scss\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly variant?: TooltipVariantType = TooltipVariant.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop({mutable: true}) position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({reflect: true}) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TooltipVariant, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"message\")\n\trerenderMessage(): void {\n\t\tthis.createContentWrapper();\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.createContentWrapper()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tif (this.tooltipContent) {\n\t\t\tif (this.message) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.message\n\t\t\t} else if (this.insideContent) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.insideContent.innerHTML\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet content: HTMLGovTooltipContentElement;\n\t\tif (this.insideContent) {\n\t\t\tcontent = this.insideContent\n\t\t} else {\n\t\t\tcontent = documentNode().createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tcontent.innerHTML = this.message\n\t\t}\n\n\t\tcontent.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tcontent.setAttribute(\"parent-id\", this.tooltipId)\n\t\tcontent.setAttribute(\"variant\", this.variant)\n\t\tcontent.setAttribute(\"size\", this.size)\n\t\tdocumentNode().body.appendChild(content)\n\t}\n\n\tprivate get tooltipContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn documentNode().body.querySelector(`#${this.identifier ?? this.tooltipContentId}`);\n\t}\n\n\tprivate get insideContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn this.host.querySelector(TooltipContentClass.root)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tif (this.tooltipContent) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst windowWidth = window.innerWidth - (window.innerWidth - document.documentElement.clientWidth);\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.tooltipContent.offsetWidth\n\t\tconst contentHeight = this.tooltipContent.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\n\t\tconst isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n\t\tconst isLeftSpace = triggerPos.left > contentWidth;\n\n\t\t// LEFT/RIGHT\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n\t\t\tif (isRightSpace === false && isLeftSpace === false) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\t}\n\t\t\tif (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n\t\t\t\tthis.position = TooltipPosition.LEFT\n\t\t\t}\n\t\t\tif (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n\t\t\t\tthis.position = TooltipPosition.RIGHT\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\n\t\t// LEFT/RIGHT FOR TOP/BOTTOM\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tlet leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n\t\t\t\tconst isNotLeftSpace = leftPosition < 0;\n\t\t\t\tconst isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n\t\t\t\tif (isNotLeftSpace && isNotRightSpace) {\n\t\t\t\t\tthis.tooltipContent.style.width = \"auto\";\n\t\t\t\t\tthis.tooltipContent.style.left = offset + \"px\";\n\t\t\t\t\tthis.tooltipContent.style.right = offset + \"px\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isNotLeftSpace) {\n\t\t\t\t\t\tleftPosition = offset\n\t\t\t\t\t}\n\t\t\t\t\tif (isNotRightSpace) {\n\t\t\t\t\t\tleftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n\t\t\t\t\t}\n\t\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\n\t\tthis.tooltipContent.style.opacity = '1'\n\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.style.opacity = '0'\n\t\t\tthis.tooltipContent.hidden = false\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"true\")\n\t\t\ttick(() => {\n\t\t\t\tthis.verifyPositionSpace()\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"false\")\n\t\t\tthis.tooltipContent.removeAttribute('style')\n\t\t}\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}>\n\t\t\t\t<span role={'button'}\n\t\t\t\t\t\t\ttabindex={0}\n\t\t\t\t\t\t\tonKeyPress={() => this.showTooltip()}\n\t\t\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\t\t\tif (this.persist === false) {\n\t\t\t\t\t\t\t\t\tthis.hideTooltip()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}><slot/></span>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.persist = false\n\t\tthis.hideTooltip()\n\t}\n}\n"],"mappings":"6YAAA,MAAMA,EAAgB,miBACtB,MAAAC,EAAeD,E,MCsBFE,EAAU,MAKtB,WAAAC,CAAAC,G,UAHiBC,KAAAC,iBAAmBC,UACnBF,KAAAG,UAAYD,U,aAYmBE,EAAeC,Q,UAIrBC,EAAYC,G,cAIC,Q,aAIpBL,U,oCAQaA,U,aAE7B,MA/BlBF,KAAKQ,EAAIC,EAAQT,KAAKU,MACtBV,KAAKG,UAAYQ,EAAS,cAC1BX,KAAKC,iBAAmBU,EAAS,oB,CAgClC,eAAAC,CAAgBC,GACfC,EAAaV,EAAgBS,EAAUE,EAAaC,K,CAIrD,YAAAC,CAAaJ,GACZC,EAAaR,EAAaO,EAAUE,EAAaC,K,CAIlD,gBAAAE,CAAiBL,GAChBC,EAAaK,EAAiBN,EAAUE,EAAaC,K,CAItD,eAAAI,GACCpB,KAAKqB,sB,CAGN,iBAAAC,GACCtB,KAAKY,gBAAgBZ,KAAKuB,SAC1BvB,KAAKi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