@gov-design-system-ce/components 4.2.3 → 4.2.4

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 (126) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-button.cjs.entry.js +4 -3
  3. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-empty.cjs.entry.js +7 -1
  5. package/dist/cjs/gov-empty.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gov-flex_3.cjs.entry.js +3 -3
  7. package/dist/cjs/gov-flex_3.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
  9. package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-infobar.cjs.entry.js +6 -2
  11. package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/components/gov-button/button/gov-button.js +22 -3
  14. package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
  15. package/dist/collection/components/gov-empty/constants.js +5 -0
  16. package/dist/collection/components/gov-empty/constants.js.map +1 -1
  17. package/dist/collection/components/gov-empty/gov-empty.js +26 -1
  18. package/dist/collection/components/gov-empty/gov-empty.js.map +1 -1
  19. package/dist/collection/components/gov-form/label/gov-form-label.js +1 -1
  20. package/dist/collection/components/gov-form/label/gov-form-label.js.map +1 -1
  21. package/dist/collection/components/gov-infobar/gov-infobar.js +6 -2
  22. package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
  23. package/dist/collection/components/gov-theme-switch/gov-theme-switch.js +5 -5
  24. package/dist/collection/components/gov-theme-switch/gov-theme-switch.js.map +1 -1
  25. package/dist/collection/pages/Banner.js +10 -0
  26. package/dist/collection/pages/Banner.js.map +1 -1
  27. package/dist/collection/pages/Button.js +18 -0
  28. package/dist/collection/pages/Button.js.map +1 -1
  29. package/dist/collection/pages/Empty.js +26 -0
  30. package/dist/collection/pages/Empty.js.map +1 -1
  31. package/dist/collection/pages/Forms.js +31 -31
  32. package/dist/collection/pages/Forms.js.map +1 -1
  33. package/dist/collection/pages/Home.js +8 -2
  34. package/dist/collection/pages/Home.js.map +1 -1
  35. package/dist/components/gov-accordion-item.js +1 -1
  36. package/dist/components/gov-attachments-item.js +1 -1
  37. package/dist/components/gov-blockquote.js +1 -1
  38. package/dist/components/gov-breadcrumbs.js +1 -1
  39. package/dist/components/gov-button.js +1 -1
  40. package/dist/components/gov-card.js +1 -1
  41. package/dist/components/gov-chip.js +1 -1
  42. package/dist/components/gov-dialog.js +1 -1
  43. package/dist/components/gov-empty.js +1 -1
  44. package/dist/components/gov-empty.js.map +1 -1
  45. package/dist/components/gov-form-autocomplete.js +1 -1
  46. package/dist/components/gov-form-checkbox.js +1 -1
  47. package/dist/components/gov-form-file.js +1 -1
  48. package/dist/components/gov-form-input.js +1 -1
  49. package/dist/components/gov-form-label.js +1 -1
  50. package/dist/components/gov-form-label.js.map +1 -1
  51. package/dist/components/gov-form-multi-select.js +1 -1
  52. package/dist/components/gov-form-range.js +1 -1
  53. package/dist/components/gov-form-select.js +1 -1
  54. package/dist/components/gov-form-switch.js +1 -1
  55. package/dist/components/gov-icon.js +1 -1
  56. package/dist/components/gov-infobar.js +1 -1
  57. package/dist/components/gov-infobar.js.map +1 -1
  58. package/dist/components/gov-link.js +1 -1
  59. package/dist/components/gov-loading.js +1 -1
  60. package/dist/components/gov-pagination.js +1 -1
  61. package/dist/components/gov-tabs.js +1 -1
  62. package/dist/components/gov-tabs.js.map +1 -1
  63. package/dist/components/gov-tag.js +1 -1
  64. package/dist/components/gov-theme-switch.js +1 -1
  65. package/dist/components/gov-theme-switch.js.map +1 -1
  66. package/dist/components/gov-tile.js +1 -1
  67. package/dist/components/gov-toast.js +1 -1
  68. package/dist/components/gov-tooltip-content.js +1 -1
  69. package/dist/components/gov-wizard-item.js +1 -1
  70. package/dist/components/{p-8e888b01.js → p-043a676e.js} +2 -2
  71. package/dist/components/{p-5b0a3c98.js → p-2b33d27c.js} +2 -2
  72. package/dist/components/{p-1572effa.js → p-90657523.js} +2 -2
  73. package/dist/components/p-abea96cf.js +2 -0
  74. package/dist/components/p-abea96cf.js.map +1 -0
  75. package/dist/components/{p-c150610c.js → p-b56d6b99.js} +2 -2
  76. package/dist/components/{p-11fa70ff.js → p-bd393ff0.js} +2 -2
  77. package/dist/components/{p-93f4a242.js → p-cbe3bc71.js} +2 -2
  78. package/dist/core/core.css +115 -42
  79. package/dist/core/core.esm.js +1 -1
  80. package/dist/core/core.esm.js.map +1 -1
  81. package/dist/core/p-39d6e51d.entry.js +2 -0
  82. package/dist/core/p-39d6e51d.entry.js.map +1 -0
  83. package/dist/core/{p-83e14b47.entry.js → p-9e5eb19a.entry.js} +2 -2
  84. package/dist/core/{p-83e14b47.entry.js.map → p-9e5eb19a.entry.js.map} +1 -1
  85. package/dist/core/p-ac800db4.entry.js +2 -0
  86. package/dist/core/p-ac800db4.entry.js.map +1 -0
  87. package/dist/core/p-d45bcd43.entry.js +2 -0
  88. package/dist/core/p-d45bcd43.entry.js.map +1 -0
  89. package/dist/core/p-e7e00fe3.entry.js +2 -0
  90. package/dist/core/{p-774ea182.entry.js.map → p-e7e00fe3.entry.js.map} +1 -1
  91. package/dist/esm/core.js +1 -1
  92. package/dist/esm/gov-button.entry.js +4 -3
  93. package/dist/esm/gov-button.entry.js.map +1 -1
  94. package/dist/esm/gov-empty.entry.js +7 -1
  95. package/dist/esm/gov-empty.entry.js.map +1 -1
  96. package/dist/esm/gov-flex_3.entry.js +3 -3
  97. package/dist/esm/gov-flex_3.entry.js.map +1 -1
  98. package/dist/esm/gov-form-label.entry.js +1 -1
  99. package/dist/esm/gov-form-label.entry.js.map +1 -1
  100. package/dist/esm/gov-infobar.entry.js +6 -2
  101. package/dist/esm/gov-infobar.entry.js.map +1 -1
  102. package/dist/esm/loader.js +1 -1
  103. package/dist/hydrate/index.js +25 -12
  104. package/dist/hydrate/index.mjs +25 -12
  105. package/dist/types/components/gov-button/button/gov-button.d.ts +4 -0
  106. package/dist/types/components/gov-empty/constants.d.ts +5 -0
  107. package/dist/types/components/gov-empty/gov-empty.d.ts +5 -1
  108. package/dist/types/components/gov-infobar/gov-infobar.d.ts +2 -0
  109. package/dist/types/components/gov-theme-switch/gov-theme-switch.d.ts +1 -1
  110. package/dist/types/components.d.ts +20 -4
  111. package/package.json +1 -1
  112. package/dist/components/p-62d01259.js +0 -2
  113. package/dist/components/p-62d01259.js.map +0 -1
  114. package/dist/core/p-774ea182.entry.js +0 -2
  115. package/dist/core/p-a1c825f3.entry.js +0 -2
  116. package/dist/core/p-a1c825f3.entry.js.map +0 -1
  117. package/dist/core/p-c1584cfe.entry.js +0 -2
  118. package/dist/core/p-c1584cfe.entry.js.map +0 -1
  119. package/dist/core/p-c5a49469.entry.js +0 -2
  120. package/dist/core/p-c5a49469.entry.js.map +0 -1
  121. /package/dist/components/{p-8e888b01.js.map → p-043a676e.js.map} +0 -0
  122. /package/dist/components/{p-5b0a3c98.js.map → p-2b33d27c.js.map} +0 -0
  123. /package/dist/components/{p-1572effa.js.map → p-90657523.js.map} +0 -0
  124. /package/dist/components/{p-c150610c.js.map → p-b56d6b99.js.map} +0 -0
  125. /package/dist/components/{p-11fa70ff.js.map → p-bd393ff0.js.map} +0 -0
  126. /package/dist/components/{p-93f4a242.js.map → p-cbe3bc71.js.map} +0 -0
@@ -3121,6 +3121,7 @@ class GovButton {
3121
3121
  this.size = "m";
3122
3122
  this.type = undefined;
3123
3123
  this.expanded = false;
3124
+ this.expandedMobile = false;
3124
3125
  this.name = undefined;
3125
3126
  this.disabled = false;
3126
3127
  this.nativeType = "button";
@@ -3181,9 +3182,9 @@ class GovButton {
3181
3182
  render() {
3182
3183
  const Tag = this.href ? Tags$3.A : Tags$3.BUTTON;
3183
3184
  const nativeType = Tag === Tags$3.A ? undefined : this.nativeType;
3184
- return (hAsync(Host, { key: 'cd3d644c54ac882be5adf1645391a873d426e549', size: this.size, hydrated: this.hydrated, color: this.color, class: this.h.classes(ButtonClass.root), type: this.type }, hAsync(Tag, Object.assign({ key: '39c76efc161144865f6bde8cf50e2808d0566415', class: "element", ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), disabled: this.disabled, id: this.identifier, href: this.href, target: this.target, download: this.download, hreflang: this.hreflang, rel: this.rel, name: this.name, type: nativeType, tabindex: this.disabled ? "-1" : "0" }, this.inheritedAttributes, { "aria-disabled": toBoolAttrIfDefined(this.disabled) }), toBool(this.loading) && !this.h.hasSlot("icon-end") &&
3185
- hAsync("gov-icon", { key: 'b75ed857aacc2b914810fbdbb3c0d39ede423639', name: "loader", class: "gov-spin-animation", type: "components" }), this.h.hasSlot("icon-start") && hAsync("slot", { key: '838152233ab4f51b36217ae0b4077a3f3efc3ecf', name: "icon-start" }), hAsync("slot", { key: '0dbfd16b6de4ea9c0bb92a97297262f10b9a335c' }), this.h.hasSlot("icon-end") && hAsync("slot", { key: '8854b0bced36cabfe85988e22d10d49f9761a910', name: "icon-end" }), toBool(this.loading) && this.h.hasSlot("icon-end") &&
3186
- hAsync("gov-icon", { key: '607c848e0a9e4abf1c4232658a38922ade4accf9', name: "loader", class: "gov-spin-animation", type: "components" }))));
3185
+ return (hAsync(Host, { key: '1f7bae74ab0d6f1b451c6ccc60cf614fb2671303', size: this.size, hydrated: this.hydrated, color: this.color, class: this.h.classes(ButtonClass.root), type: this.type }, hAsync(Tag, Object.assign({ key: '23e34ef9581b3dfa0c571aaef6a5b9a82dfe7c91', class: "element", ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), disabled: this.disabled, id: this.identifier, href: this.href, target: this.target, download: this.download, hreflang: this.hreflang, rel: this.rel, name: this.name, type: nativeType, tabindex: this.disabled ? "-1" : "0" }, this.inheritedAttributes, { "aria-disabled": toBoolAttrIfDefined(this.disabled) }), toBool(this.loading) && !this.h.hasSlot("icon-end") &&
3186
+ hAsync("gov-icon", { key: '03f9d20b44f5424f5fe71e02d1c66fba64875c04', name: "loader", class: "gov-spin-animation", type: "components" }), this.h.hasSlot("icon-start") && hAsync("slot", { key: '674ca625c6c5a9678c4a87ce370b894e704dbb1c', name: "icon-start" }), hAsync("slot", { key: 'd7443ddf6d04ef50934ddb11be083eb6abf1448a' }), this.h.hasSlot("icon-end") && hAsync("slot", { key: '977ea88979aae53ff5f0c8e5801e0682833e4f41', name: "icon-end" }), toBool(this.loading) && this.h.hasSlot("icon-end") &&
3187
+ hAsync("gov-icon", { key: '755b00182e3af1734483ee7bbeb63e541ad015f2', name: "loader", class: "gov-spin-animation", type: "components" }))));
3187
3188
  }
3188
3189
  onClickHandler(e) {
3189
3190
  e.stopPropagation();
@@ -3246,6 +3247,7 @@ class GovButton {
3246
3247
  "size": [513],
3247
3248
  "type": [513],
3248
3249
  "expanded": [516],
3250
+ "expandedMobile": [516, "expanded-mobile"],
3249
3251
  "name": [1],
3250
3252
  "disabled": [516],
3251
3253
  "nativeType": [1, "native-type"],
@@ -3265,7 +3267,7 @@ class GovButton {
3265
3267
  },
3266
3268
  "$listeners$": undefined,
3267
3269
  "$lazyBundleId$": "-",
3268
- "$attrsToReflect$": [["color", "color"], ["size", "size"], ["type", "type"], ["expanded", "expanded"], ["disabled", "disabled"]]
3270
+ "$attrsToReflect$": [["color", "color"], ["size", "size"], ["type", "type"], ["expanded", "expanded"], ["expandedMobile", "expanded-mobile"], ["disabled", "disabled"]]
3269
3271
  }; }
3270
3272
  }
3271
3273
 
@@ -3834,6 +3836,11 @@ class GovDropdown {
3834
3836
  }
3835
3837
 
3836
3838
  pick(Sizes, ['_S', '_M', '_L']);
3839
+ var EmptyDirection;
3840
+ (function (EmptyDirection) {
3841
+ EmptyDirection["HORIZONTAL"] = "horizontal";
3842
+ EmptyDirection["VERTICAL"] = "vertical";
3843
+ })(EmptyDirection || (EmptyDirection = {}));
3837
3844
  const EmptyClass = {
3838
3845
  root: 'gov-empty',
3839
3846
  content: 'gov-empty__content',
@@ -3843,6 +3850,7 @@ class GovEmpty {
3843
3850
  constructor(hostRef) {
3844
3851
  registerInstance(this, hostRef);
3845
3852
  this.size = 'm';
3853
+ this.direction = "vertical";
3846
3854
  this.h = govHost(this.host);
3847
3855
  }
3848
3856
  validateSize(newValue) {
@@ -3852,7 +3860,7 @@ class GovEmpty {
3852
3860
  this.validateSize(this.size);
3853
3861
  }
3854
3862
  render() {
3855
- return (hAsync(Host, { key: '93155f92af0574538fd919e52f312b0f02d07e21', class: this.h.classes(EmptyClass.root), size: this.size }, this.h.hasSlot('icon') && (hAsync("slot", { key: 'e9504c9396c9743ea7e454bb2df5d0f2a046aabe', name: "icon" })), hAsync("div", { key: '78f2d30f570c6123a58d2ac93db58b4e471796b3', class: EmptyClass.content }, hAsync("slot", { key: '7b5e1121dbfccf6d647e168e80c60cad4a1ca136', name: "headline" }), hAsync("slot", { key: 'd435390c88c0304f9ee129b268c454b2147fddb0' }))));
3863
+ return (hAsync(Host, { key: 'e1da3889a26333688dc65efaa66664219de109f5', class: this.h.classes(EmptyClass.root), size: this.size, direction: this.direction }, this.h.hasSlot('icon') && (hAsync("slot", { key: '592a4e748c922485301a5c24fb459948e854acae', name: "icon" })), hAsync("div", { key: 'e8b2296af06278720ab78cbb6f4b3ef2ce8b09e7', class: EmptyClass.content }, hAsync("slot", { key: 'ec87498dbf98c45455f7d5247c5938dce0acf6e6', name: "headline" }), hAsync("slot", { key: '9f9a00c7bc8404a81ddaf6025d023e1ee7058834' }))));
3856
3864
  }
3857
3865
  get host() { return getElement(this); }
3858
3866
  static get watchers() { return {
@@ -3862,7 +3870,8 @@ class GovEmpty {
3862
3870
  "$flags$": 4,
3863
3871
  "$tagName$": "gov-empty",
3864
3872
  "$members$": {
3865
- "size": [1]
3873
+ "size": [1],
3874
+ "direction": [1]
3866
3875
  },
3867
3876
  "$listeners$": undefined,
3868
3877
  "$lazyBundleId$": "-",
@@ -5232,7 +5241,7 @@ class GovFormLabel {
5232
5241
  }
5233
5242
  render() {
5234
5243
  const Tag = this.legend ? 'legend' : 'label';
5235
- return (hAsync(Host, { key: '5227d00ebe3e8923687d4e8d0f3a74bad0da82b3', class: FormLabelClass.root, size: this.size }, hAsync(Tag, { key: '981d363fdf7435a0b242b9610a7dd68e11d4f05e', class: FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, hAsync("slot", { key: 'bdf282178e200fa69d9f871354786ecbd024fa90' }), this.required ? hAsync("span", { class: "gov-color--error-500" }, "\u00A0*") : null)));
5244
+ return (hAsync(Host, { key: '5227d00ebe3e8923687d4e8d0f3a74bad0da82b3', class: FormLabelClass.root, size: this.size }, hAsync(Tag, { key: '981d363fdf7435a0b242b9610a7dd68e11d4f05e', class: FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, hAsync("slot", { key: 'bdf282178e200fa69d9f871354786ecbd024fa90' }), this.required ? hAsync("span", { class: "gov-color--text-status-error" }, "\u00A0*") : null)));
5236
5245
  }
5237
5246
  static get cmpMeta() { return {
5238
5247
  "$flags$": 4,
@@ -6408,7 +6417,7 @@ const IconClass = {
6408
6417
  holder: 'gov-icon__holder',
6409
6418
  };
6410
6419
 
6411
- const version = "4.2.3";
6420
+ const version = "4.2.4";
6412
6421
 
6413
6422
  const dsVersion = () => {
6414
6423
  return version;
@@ -6599,6 +6608,7 @@ class GovInfobar {
6599
6608
  constructor(hostRef) {
6600
6609
  registerInstance(this, hostRef);
6601
6610
  this.govClose = createEvent(this, "gov-close", 7);
6611
+ this.hydrated = false;
6602
6612
  this.color = 'primary';
6603
6613
  this.type = "bold";
6604
6614
  this.role = undefined;
@@ -6630,9 +6640,12 @@ class GovInfobar {
6630
6640
  this.host.removeAttribute(attributeName);
6631
6641
  this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
6632
6642
  }
6643
+ connectedCallback() {
6644
+ this.hydrated = true;
6645
+ }
6633
6646
  render() {
6634
- const closeButton = (hAsync("gov-button", { key: 'bf4dbf4e33374f5827d51c7fab56ce1de0e86103', size: "s", "aria-label": this.accessibleCloseLabel, type: "base", color: this.isBold ? this.color : "neutral", "on-gov-click": this.onCloseHandler.bind(this), class: InfobarClass.close }, hAsync("gov-icon", { key: 'c85cebe33a0b06adc79c0adb97d9cabe3d648651', name: "x-lg", type: "components" })));
6635
- return (hAsync(Host, { key: '82fe497b7f6d4f3aba3bcad0295bb626587952c1', class: this.h.classes(InfobarClass.root), color: this.color, type: this.type }, hAsync("section", Object.assign({ key: 'd2b1a013623206d9662c252f189a5b9edeff009d', class: InfobarClass.section }, this.inheritedAttributes, { role: this.role }), this.h.hasSlot("icon") && (hAsync("span", { key: '18efd7eecd6eeb683ba2982f9abb2cfc09e90dab' }, hAsync("slot", { key: 'cc093214b7fd417c1baec6918e5613f843a7bb55', name: "icon" }))), hAsync("div", { key: '07d2db35c654390b08318273dbd76456b75ae5e4', class: InfobarClass.content }, this.h.hasSlot('headline') ? (hAsync(Fragment, null, hAsync("div", { class: InfobarClass.headline }, hAsync("slot", { name: "headline" }), hAsync("gov-button", { size: "s", type: "base", color: this.isBold ? this.color : "neutral", "aria-label": this.accessibleToggleLabel, "on-gov-click": () => (this.toggleContent = !this.toggleContent) }, hAsync("gov-icon", { name: this.toggleContent ? 'chevron-up' : 'chevron-down', type: "components" }))), hAsync("div", { hidden: !this.toggleContent, "aria-hidden": toBoolAttr(this.toggleContent) }, hAsync("slot", null)))) : (hAsync("slot", null))), this.closable && closeButton)));
6647
+ const closeButton = (hAsync("gov-button", { key: '43dfaa83a5cbf0c8ac3ffe055b9b2df56ee95252', size: "s", "aria-label": this.accessibleCloseLabel, type: "base", color: this.isBold ? this.color : "neutral", "on-gov-click": this.onCloseHandler.bind(this), class: InfobarClass.close }, hAsync("gov-icon", { key: '9a04704a5679dbd328b150975cd01b13a9a8939b', name: "x-lg", type: "components" })));
6648
+ return (hAsync(Host, { key: '61a672fe70509238f25f353f0f97c4170f958b18', class: this.h.classes(InfobarClass.root), color: this.color, type: this.type, hydrated: this.hydrated }, hAsync("section", Object.assign({ key: '2cebebdc62541a0c71578b06f677c3814b2dfd36', class: InfobarClass.section }, this.inheritedAttributes, { role: this.role }), this.h.hasSlot("icon") && (hAsync("span", { key: 'de201f0008f3ec11533e0712cb95391e2694318a' }, hAsync("slot", { key: 'fe5ff9dca68dad254be183b31174123f7218f8ff', name: "icon" }))), hAsync("div", { key: 'd2201cd542519895dbab9329c7bef7190ad42783', class: InfobarClass.content }, this.h.hasSlot('headline') ? (hAsync(Fragment, null, hAsync("div", { class: InfobarClass.headline }, hAsync("slot", { name: "headline" }), hAsync("gov-button", { size: "s", type: "base", color: this.isBold ? this.color : "neutral", "aria-label": this.accessibleToggleLabel, "on-gov-click": () => (this.toggleContent = !this.toggleContent) }, hAsync("gov-icon", { name: this.toggleContent ? 'chevron-up' : 'chevron-down', type: "components" }))), hAsync("div", { hidden: !this.toggleContent, "aria-hidden": toBoolAttr(this.toggleContent) }, hAsync("slot", null)))) : (hAsync("slot", null))), this.closable && closeButton)));
6636
6649
  }
6637
6650
  onCloseHandler(e) {
6638
6651
  this.govClose.emit({
@@ -7817,7 +7830,7 @@ class GovThemeSwitch {
7817
7830
  };
7818
7831
  this.size = "m";
7819
7832
  this.displayLabel = false;
7820
- this.ariaLabelLight = "Přenout na tmavý mód";
7833
+ this.ariaLabelLight = "Přepnout na tmavý mód";
7821
7834
  this.ariaLabelDark = "Přepnout na světlý mód";
7822
7835
  this.labelLight = "Světlý mód";
7823
7836
  this.labelDark = "Tmavý mód";
@@ -7865,7 +7878,7 @@ class GovThemeSwitch {
7865
7878
  if (this.theme === ThemeList.auto) {
7866
7879
  isDark = this.isSystemPrefersColorDark;
7867
7880
  }
7868
- return (hAsync(Host, { key: '492cf756810462ba0764668a134b2ecd5133d562', class: this.h.classes(ThemeSwitchClass.root), theme: isDark ? ThemeList.dark : ThemeList.light, size: this.size }, hAsync("button", { key: '02b94994619dd3fbb998acdcc16c907c69ea6723', onClick: () => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark), "aria-current": this.theme, "aria-label": isDark ? this.ariaLabelDark : this.ariaLabelLight }, hAsync("span", { key: '0beb069c94ed4337a6c2de4d8ee8640123bc3bc5' }, hAsync("span", { key: '57d9fc00520b8cf98108d9b5a9710d6066861157', class: ThemeSwitchClass.indicator }, ThemeList.light && hAsync("gov-icon", { key: '3cd1693dcf28658943146386c97b834e5cf4534a', name: "sun", class: ThemeSwitchClass.iconLight, type: "components" }), ThemeList.dark && hAsync("gov-icon", { key: '139adcafc399eed5482c15273a37331598bbe179', name: "moon", class: ThemeSwitchClass.iconDark, type: "components" })), this.displayLabel ? (hAsync("span", { class: ThemeSwitchClass.label }, isDark ? this.labelDark : this.labelLight)) : null))));
7881
+ return (hAsync(Host, { key: '544d940df577f621ba8ee0d8f46bc6b6b41815ca', class: this.h.classes(ThemeSwitchClass.root), theme: isDark ? ThemeList.dark : ThemeList.light, size: this.size }, hAsync("button", { key: '8b1165e9c7ade60a00f4b8dcc65ba50dd0ee9408', onClick: () => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark), "aria-current": this.theme, "aria-label": isDark ? this.ariaLabelDark : this.ariaLabelLight }, hAsync("span", { key: '3d78b019112d3b3bcf75517d85d61e2ed17cd717' }, hAsync("span", { key: 'cf2293cd960946e2be0fe54bd847a0d616219887', class: ThemeSwitchClass.indicator }, ThemeList.light && hAsync("gov-icon", { key: '7d1affc44645eca82d285a51a138ddf73b03ad3e', name: "sun", class: ThemeSwitchClass.iconLight, type: "components" }), ThemeList.dark && hAsync("gov-icon", { key: 'df70460dc0cf1530f2ca36917f2bd203aee324ab', name: "moon", class: ThemeSwitchClass.iconDark, type: "components" })), this.displayLabel ? (hAsync("span", { class: ThemeSwitchClass.label }, isDark ? this.labelDark : this.labelLight)) : null))));
7869
7882
  }
7870
7883
  get host() { return getElement(this); }
7871
7884
  static get watchers() { return {
@@ -3117,6 +3117,7 @@ class GovButton {
3117
3117
  this.size = "m";
3118
3118
  this.type = undefined;
3119
3119
  this.expanded = false;
3120
+ this.expandedMobile = false;
3120
3121
  this.name = undefined;
3121
3122
  this.disabled = false;
3122
3123
  this.nativeType = "button";
@@ -3177,9 +3178,9 @@ class GovButton {
3177
3178
  render() {
3178
3179
  const Tag = this.href ? Tags$3.A : Tags$3.BUTTON;
3179
3180
  const nativeType = Tag === Tags$3.A ? undefined : this.nativeType;
3180
- return (hAsync(Host, { key: 'cd3d644c54ac882be5adf1645391a873d426e549', size: this.size, hydrated: this.hydrated, color: this.color, class: this.h.classes(ButtonClass.root), type: this.type }, hAsync(Tag, Object.assign({ key: '39c76efc161144865f6bde8cf50e2808d0566415', class: "element", ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), disabled: this.disabled, id: this.identifier, href: this.href, target: this.target, download: this.download, hreflang: this.hreflang, rel: this.rel, name: this.name, type: nativeType, tabindex: this.disabled ? "-1" : "0" }, this.inheritedAttributes, { "aria-disabled": toBoolAttrIfDefined(this.disabled) }), toBool(this.loading) && !this.h.hasSlot("icon-end") &&
3181
- hAsync("gov-icon", { key: 'b75ed857aacc2b914810fbdbb3c0d39ede423639', name: "loader", class: "gov-spin-animation", type: "components" }), this.h.hasSlot("icon-start") && hAsync("slot", { key: '838152233ab4f51b36217ae0b4077a3f3efc3ecf', name: "icon-start" }), hAsync("slot", { key: '0dbfd16b6de4ea9c0bb92a97297262f10b9a335c' }), this.h.hasSlot("icon-end") && hAsync("slot", { key: '8854b0bced36cabfe85988e22d10d49f9761a910', name: "icon-end" }), toBool(this.loading) && this.h.hasSlot("icon-end") &&
3182
- hAsync("gov-icon", { key: '607c848e0a9e4abf1c4232658a38922ade4accf9', name: "loader", class: "gov-spin-animation", type: "components" }))));
3181
+ return (hAsync(Host, { key: '1f7bae74ab0d6f1b451c6ccc60cf614fb2671303', size: this.size, hydrated: this.hydrated, color: this.color, class: this.h.classes(ButtonClass.root), type: this.type }, hAsync(Tag, Object.assign({ key: '23e34ef9581b3dfa0c571aaef6a5b9a82dfe7c91', class: "element", ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), disabled: this.disabled, id: this.identifier, href: this.href, target: this.target, download: this.download, hreflang: this.hreflang, rel: this.rel, name: this.name, type: nativeType, tabindex: this.disabled ? "-1" : "0" }, this.inheritedAttributes, { "aria-disabled": toBoolAttrIfDefined(this.disabled) }), toBool(this.loading) && !this.h.hasSlot("icon-end") &&
3182
+ hAsync("gov-icon", { key: '03f9d20b44f5424f5fe71e02d1c66fba64875c04', name: "loader", class: "gov-spin-animation", type: "components" }), this.h.hasSlot("icon-start") && hAsync("slot", { key: '674ca625c6c5a9678c4a87ce370b894e704dbb1c', name: "icon-start" }), hAsync("slot", { key: 'd7443ddf6d04ef50934ddb11be083eb6abf1448a' }), this.h.hasSlot("icon-end") && hAsync("slot", { key: '977ea88979aae53ff5f0c8e5801e0682833e4f41', name: "icon-end" }), toBool(this.loading) && this.h.hasSlot("icon-end") &&
3183
+ hAsync("gov-icon", { key: '755b00182e3af1734483ee7bbeb63e541ad015f2', name: "loader", class: "gov-spin-animation", type: "components" }))));
3183
3184
  }
3184
3185
  onClickHandler(e) {
3185
3186
  e.stopPropagation();
@@ -3242,6 +3243,7 @@ class GovButton {
3242
3243
  "size": [513],
3243
3244
  "type": [513],
3244
3245
  "expanded": [516],
3246
+ "expandedMobile": [516, "expanded-mobile"],
3245
3247
  "name": [1],
3246
3248
  "disabled": [516],
3247
3249
  "nativeType": [1, "native-type"],
@@ -3261,7 +3263,7 @@ class GovButton {
3261
3263
  },
3262
3264
  "$listeners$": undefined,
3263
3265
  "$lazyBundleId$": "-",
3264
- "$attrsToReflect$": [["color", "color"], ["size", "size"], ["type", "type"], ["expanded", "expanded"], ["disabled", "disabled"]]
3266
+ "$attrsToReflect$": [["color", "color"], ["size", "size"], ["type", "type"], ["expanded", "expanded"], ["expandedMobile", "expanded-mobile"], ["disabled", "disabled"]]
3265
3267
  }; }
3266
3268
  }
3267
3269
 
@@ -3830,6 +3832,11 @@ class GovDropdown {
3830
3832
  }
3831
3833
 
3832
3834
  pick(Sizes, ['_S', '_M', '_L']);
3835
+ var EmptyDirection;
3836
+ (function (EmptyDirection) {
3837
+ EmptyDirection["HORIZONTAL"] = "horizontal";
3838
+ EmptyDirection["VERTICAL"] = "vertical";
3839
+ })(EmptyDirection || (EmptyDirection = {}));
3833
3840
  const EmptyClass = {
3834
3841
  root: 'gov-empty',
3835
3842
  content: 'gov-empty__content',
@@ -3839,6 +3846,7 @@ class GovEmpty {
3839
3846
  constructor(hostRef) {
3840
3847
  registerInstance(this, hostRef);
3841
3848
  this.size = 'm';
3849
+ this.direction = "vertical";
3842
3850
  this.h = govHost(this.host);
3843
3851
  }
3844
3852
  validateSize(newValue) {
@@ -3848,7 +3856,7 @@ class GovEmpty {
3848
3856
  this.validateSize(this.size);
3849
3857
  }
3850
3858
  render() {
3851
- return (hAsync(Host, { key: '93155f92af0574538fd919e52f312b0f02d07e21', class: this.h.classes(EmptyClass.root), size: this.size }, this.h.hasSlot('icon') && (hAsync("slot", { key: 'e9504c9396c9743ea7e454bb2df5d0f2a046aabe', name: "icon" })), hAsync("div", { key: '78f2d30f570c6123a58d2ac93db58b4e471796b3', class: EmptyClass.content }, hAsync("slot", { key: '7b5e1121dbfccf6d647e168e80c60cad4a1ca136', name: "headline" }), hAsync("slot", { key: 'd435390c88c0304f9ee129b268c454b2147fddb0' }))));
3859
+ return (hAsync(Host, { key: 'e1da3889a26333688dc65efaa66664219de109f5', class: this.h.classes(EmptyClass.root), size: this.size, direction: this.direction }, this.h.hasSlot('icon') && (hAsync("slot", { key: '592a4e748c922485301a5c24fb459948e854acae', name: "icon" })), hAsync("div", { key: 'e8b2296af06278720ab78cbb6f4b3ef2ce8b09e7', class: EmptyClass.content }, hAsync("slot", { key: 'ec87498dbf98c45455f7d5247c5938dce0acf6e6', name: "headline" }), hAsync("slot", { key: '9f9a00c7bc8404a81ddaf6025d023e1ee7058834' }))));
3852
3860
  }
3853
3861
  get host() { return getElement(this); }
3854
3862
  static get watchers() { return {
@@ -3858,7 +3866,8 @@ class GovEmpty {
3858
3866
  "$flags$": 4,
3859
3867
  "$tagName$": "gov-empty",
3860
3868
  "$members$": {
3861
- "size": [1]
3869
+ "size": [1],
3870
+ "direction": [1]
3862
3871
  },
3863
3872
  "$listeners$": undefined,
3864
3873
  "$lazyBundleId$": "-",
@@ -5228,7 +5237,7 @@ class GovFormLabel {
5228
5237
  }
5229
5238
  render() {
5230
5239
  const Tag = this.legend ? 'legend' : 'label';
5231
- return (hAsync(Host, { key: '5227d00ebe3e8923687d4e8d0f3a74bad0da82b3', class: FormLabelClass.root, size: this.size }, hAsync(Tag, { key: '981d363fdf7435a0b242b9610a7dd68e11d4f05e', class: FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, hAsync("slot", { key: 'bdf282178e200fa69d9f871354786ecbd024fa90' }), this.required ? hAsync("span", { class: "gov-color--error-500" }, "\u00A0*") : null)));
5240
+ return (hAsync(Host, { key: '5227d00ebe3e8923687d4e8d0f3a74bad0da82b3', class: FormLabelClass.root, size: this.size }, hAsync(Tag, { key: '981d363fdf7435a0b242b9610a7dd68e11d4f05e', class: FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, hAsync("slot", { key: 'bdf282178e200fa69d9f871354786ecbd024fa90' }), this.required ? hAsync("span", { class: "gov-color--text-status-error" }, "\u00A0*") : null)));
5232
5241
  }
5233
5242
  static get cmpMeta() { return {
5234
5243
  "$flags$": 4,
@@ -6404,7 +6413,7 @@ const IconClass = {
6404
6413
  holder: 'gov-icon__holder',
6405
6414
  };
6406
6415
 
6407
- const version = "4.2.3";
6416
+ const version = "4.2.4";
6408
6417
 
6409
6418
  const dsVersion = () => {
6410
6419
  return version;
@@ -6595,6 +6604,7 @@ class GovInfobar {
6595
6604
  constructor(hostRef) {
6596
6605
  registerInstance(this, hostRef);
6597
6606
  this.govClose = createEvent(this, "gov-close", 7);
6607
+ this.hydrated = false;
6598
6608
  this.color = 'primary';
6599
6609
  this.type = "bold";
6600
6610
  this.role = undefined;
@@ -6626,9 +6636,12 @@ class GovInfobar {
6626
6636
  this.host.removeAttribute(attributeName);
6627
6637
  this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
6628
6638
  }
6639
+ connectedCallback() {
6640
+ this.hydrated = true;
6641
+ }
6629
6642
  render() {
6630
- const closeButton = (hAsync("gov-button", { key: 'bf4dbf4e33374f5827d51c7fab56ce1de0e86103', size: "s", "aria-label": this.accessibleCloseLabel, type: "base", color: this.isBold ? this.color : "neutral", "on-gov-click": this.onCloseHandler.bind(this), class: InfobarClass.close }, hAsync("gov-icon", { key: 'c85cebe33a0b06adc79c0adb97d9cabe3d648651', name: "x-lg", type: "components" })));
6631
- return (hAsync(Host, { key: '82fe497b7f6d4f3aba3bcad0295bb626587952c1', class: this.h.classes(InfobarClass.root), color: this.color, type: this.type }, hAsync("section", Object.assign({ key: 'd2b1a013623206d9662c252f189a5b9edeff009d', class: InfobarClass.section }, this.inheritedAttributes, { role: this.role }), this.h.hasSlot("icon") && (hAsync("span", { key: '18efd7eecd6eeb683ba2982f9abb2cfc09e90dab' }, hAsync("slot", { key: 'cc093214b7fd417c1baec6918e5613f843a7bb55', name: "icon" }))), hAsync("div", { key: '07d2db35c654390b08318273dbd76456b75ae5e4', class: InfobarClass.content }, this.h.hasSlot('headline') ? (hAsync(Fragment, null, hAsync("div", { class: InfobarClass.headline }, hAsync("slot", { name: "headline" }), hAsync("gov-button", { size: "s", type: "base", color: this.isBold ? this.color : "neutral", "aria-label": this.accessibleToggleLabel, "on-gov-click": () => (this.toggleContent = !this.toggleContent) }, hAsync("gov-icon", { name: this.toggleContent ? 'chevron-up' : 'chevron-down', type: "components" }))), hAsync("div", { hidden: !this.toggleContent, "aria-hidden": toBoolAttr(this.toggleContent) }, hAsync("slot", null)))) : (hAsync("slot", null))), this.closable && closeButton)));
6643
+ const closeButton = (hAsync("gov-button", { key: '43dfaa83a5cbf0c8ac3ffe055b9b2df56ee95252', size: "s", "aria-label": this.accessibleCloseLabel, type: "base", color: this.isBold ? this.color : "neutral", "on-gov-click": this.onCloseHandler.bind(this), class: InfobarClass.close }, hAsync("gov-icon", { key: '9a04704a5679dbd328b150975cd01b13a9a8939b', name: "x-lg", type: "components" })));
6644
+ return (hAsync(Host, { key: '61a672fe70509238f25f353f0f97c4170f958b18', class: this.h.classes(InfobarClass.root), color: this.color, type: this.type, hydrated: this.hydrated }, hAsync("section", Object.assign({ key: '2cebebdc62541a0c71578b06f677c3814b2dfd36', class: InfobarClass.section }, this.inheritedAttributes, { role: this.role }), this.h.hasSlot("icon") && (hAsync("span", { key: 'de201f0008f3ec11533e0712cb95391e2694318a' }, hAsync("slot", { key: 'fe5ff9dca68dad254be183b31174123f7218f8ff', name: "icon" }))), hAsync("div", { key: 'd2201cd542519895dbab9329c7bef7190ad42783', class: InfobarClass.content }, this.h.hasSlot('headline') ? (hAsync(Fragment, null, hAsync("div", { class: InfobarClass.headline }, hAsync("slot", { name: "headline" }), hAsync("gov-button", { size: "s", type: "base", color: this.isBold ? this.color : "neutral", "aria-label": this.accessibleToggleLabel, "on-gov-click": () => (this.toggleContent = !this.toggleContent) }, hAsync("gov-icon", { name: this.toggleContent ? 'chevron-up' : 'chevron-down', type: "components" }))), hAsync("div", { hidden: !this.toggleContent, "aria-hidden": toBoolAttr(this.toggleContent) }, hAsync("slot", null)))) : (hAsync("slot", null))), this.closable && closeButton)));
6632
6645
  }
6633
6646
  onCloseHandler(e) {
6634
6647
  this.govClose.emit({
@@ -7813,7 +7826,7 @@ class GovThemeSwitch {
7813
7826
  };
7814
7827
  this.size = "m";
7815
7828
  this.displayLabel = false;
7816
- this.ariaLabelLight = "Přenout na tmavý mód";
7829
+ this.ariaLabelLight = "Přepnout na tmavý mód";
7817
7830
  this.ariaLabelDark = "Přepnout na světlý mód";
7818
7831
  this.labelLight = "Světlý mód";
7819
7832
  this.labelDark = "Tmavý mód";
@@ -7861,7 +7874,7 @@ class GovThemeSwitch {
7861
7874
  if (this.theme === ThemeList.auto) {
7862
7875
  isDark = this.isSystemPrefersColorDark;
7863
7876
  }
7864
- return (hAsync(Host, { key: '492cf756810462ba0764668a134b2ecd5133d562', class: this.h.classes(ThemeSwitchClass.root), theme: isDark ? ThemeList.dark : ThemeList.light, size: this.size }, hAsync("button", { key: '02b94994619dd3fbb998acdcc16c907c69ea6723', onClick: () => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark), "aria-current": this.theme, "aria-label": isDark ? this.ariaLabelDark : this.ariaLabelLight }, hAsync("span", { key: '0beb069c94ed4337a6c2de4d8ee8640123bc3bc5' }, hAsync("span", { key: '57d9fc00520b8cf98108d9b5a9710d6066861157', class: ThemeSwitchClass.indicator }, ThemeList.light && hAsync("gov-icon", { key: '3cd1693dcf28658943146386c97b834e5cf4534a', name: "sun", class: ThemeSwitchClass.iconLight, type: "components" }), ThemeList.dark && hAsync("gov-icon", { key: '139adcafc399eed5482c15273a37331598bbe179', name: "moon", class: ThemeSwitchClass.iconDark, type: "components" })), this.displayLabel ? (hAsync("span", { class: ThemeSwitchClass.label }, isDark ? this.labelDark : this.labelLight)) : null))));
7877
+ return (hAsync(Host, { key: '544d940df577f621ba8ee0d8f46bc6b6b41815ca', class: this.h.classes(ThemeSwitchClass.root), theme: isDark ? ThemeList.dark : ThemeList.light, size: this.size }, hAsync("button", { key: '8b1165e9c7ade60a00f4b8dcc65ba50dd0ee9408', onClick: () => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark), "aria-current": this.theme, "aria-label": isDark ? this.ariaLabelDark : this.ariaLabelLight }, hAsync("span", { key: '3d78b019112d3b3bcf75517d85d61e2ed17cd717' }, hAsync("span", { key: 'cf2293cd960946e2be0fe54bd847a0d616219887', class: ThemeSwitchClass.indicator }, ThemeList.light && hAsync("gov-icon", { key: '7d1affc44645eca82d285a51a138ddf73b03ad3e', name: "sun", class: ThemeSwitchClass.iconLight, type: "components" }), ThemeList.dark && hAsync("gov-icon", { key: 'df70460dc0cf1530f2ca36917f2bd203aee324ab', name: "moon", class: ThemeSwitchClass.iconDark, type: "components" })), this.displayLabel ? (hAsync("span", { class: ThemeSwitchClass.label }, isDark ? this.labelDark : this.labelLight)) : null))));
7865
7878
  }
7866
7879
  get host() { return getElement(this); }
7867
7880
  static get watchers() { return {
@@ -25,6 +25,10 @@ export declare class GovButton {
25
25
  * Expands the button to fill 100% of the container width
26
26
  */
27
27
  readonly expanded: boolean;
28
+ /**
29
+ * Expands the button to fill 100% of the container width only on mobile
30
+ */
31
+ readonly expandedMobile: boolean;
28
32
  /**
29
33
  * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute
30
34
  */
@@ -2,6 +2,11 @@ import { Sizes } from "../../core/constants/sizes";
2
2
  import { ValueOf } from "../../types/interfaces";
3
3
  export declare const EmptySizes: Pick<typeof Sizes, "_S" | "_M" | "_L">;
4
4
  export type EmptySizesType = `${ValueOf<typeof EmptySizes>}`;
5
+ export declare enum EmptyDirection {
6
+ HORIZONTAL = "horizontal",
7
+ VERTICAL = "vertical"
8
+ }
9
+ export type EmptyDirectionType = `${ValueOf<typeof EmptyDirection>}`;
5
10
  export declare const EmptyClass: {
6
11
  root: string;
7
12
  content: string;
@@ -1,4 +1,4 @@
1
- import { EmptySizesType } from './constants';
1
+ import { EmptyDirectionType, EmptySizesType } from './constants';
2
2
  export declare class GovEmpty {
3
3
  private h;
4
4
  constructor();
@@ -7,6 +7,10 @@ export declare class GovEmpty {
7
7
  * Element size.
8
8
  */
9
9
  readonly size?: EmptySizesType;
10
+ /**
11
+ * Element direction
12
+ */
13
+ readonly direction: EmptyDirectionType;
10
14
  validateSize(newValue: string): void;
11
15
  componentWillLoad(): void;
12
16
  render(): any;
@@ -6,6 +6,7 @@ import { Attributes } from "../../helpers/Dom/attribute";
6
6
  export declare class GovInfobar {
7
7
  private h;
8
8
  private attributeObserver;
9
+ private hydrated;
9
10
  constructor();
10
11
  host: HTMLGovInfobarElement;
11
12
  /**
@@ -43,6 +44,7 @@ export declare class GovInfobar {
43
44
  componentWillLoad(): void;
44
45
  disconnectedCallback(): void;
45
46
  onAriaAttributeChange(attributeName: string, newValue: string): void;
47
+ connectedCallback(): void;
46
48
  render(): any;
47
49
  onCloseHandler(e: CustomEvent<ButtonEvent>): void;
48
50
  get isBold(): boolean;
@@ -16,7 +16,7 @@ export declare class GovThemeSwitch {
16
16
  /**
17
17
  * Label in light mode
18
18
  */
19
- readonly ariaLabelLight? = "P\u0159enout na tmav\u00FD m\u00F3d";
19
+ readonly ariaLabelLight? = "P\u0159epnout na tmav\u00FD m\u00F3d";
20
20
  /**
21
21
  * Label in dark mode
22
22
  */
@@ -19,7 +19,7 @@ import { ControlGroupColorType } from "./components/gov-control-group/constants"
19
19
  import { Nullable } from "./types/interfaces";
20
20
  import { PositionType } from "./components/gov-button/dropdown/constants";
21
21
  import { DropdownEvent } from "./components/gov-button/dropdown/gov-dropdown.types";
22
- import { EmptySizesType } from "./components/gov-empty/constants";
22
+ import { EmptyDirectionType, EmptySizesType } from "./components/gov-empty/constants";
23
23
  import { FlexSizesType } from "./components/gov-flex/constants";
24
24
  import { FormAutocompleteEvent, GovFormAutocompleteItem } from "./components/gov-form/autocomplete/gov-form-autocomplete.types";
25
25
  import { SizesType } from "./components/gov-form/autocomplete/constants";
@@ -81,7 +81,7 @@ export { ControlGroupColorType } from "./components/gov-control-group/constants"
81
81
  export { Nullable } from "./types/interfaces";
82
82
  export { PositionType } from "./components/gov-button/dropdown/constants";
83
83
  export { DropdownEvent } from "./components/gov-button/dropdown/gov-dropdown.types";
84
- export { EmptySizesType } from "./components/gov-empty/constants";
84
+ export { EmptyDirectionType, EmptySizesType } from "./components/gov-empty/constants";
85
85
  export { FlexSizesType } from "./components/gov-flex/constants";
86
86
  export { FormAutocompleteEvent, GovFormAutocompleteItem } from "./components/gov-form/autocomplete/gov-form-autocomplete.types";
87
87
  export { SizesType } from "./components/gov-form/autocomplete/constants";
@@ -288,6 +288,10 @@ export namespace Components {
288
288
  * Expands the button to fill 100% of the container width
289
289
  */
290
290
  "expanded": boolean;
291
+ /**
292
+ * Expands the button to fill 100% of the container width only on mobile
293
+ */
294
+ "expandedMobile": boolean;
291
295
  /**
292
296
  * Same as original parameter
293
297
  * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable
@@ -534,6 +538,10 @@ export namespace Components {
534
538
  "toggle": () => Promise<void>;
535
539
  }
536
540
  interface GovEmpty {
541
+ /**
542
+ * Element direction
543
+ */
544
+ "direction": EmptyDirectionType;
537
545
  /**
538
546
  * Element size.
539
547
  */
@@ -1700,7 +1708,7 @@ export namespace Components {
1700
1708
  /**
1701
1709
  * Label in light mode
1702
1710
  */
1703
- "ariaLabelLight"?: "Přenout na tmavý mód";
1711
+ "ariaLabelLight"?: "Přepnout na tmavý mód";
1704
1712
  /**
1705
1713
  * Display switch label
1706
1714
  */
@@ -2975,6 +2983,10 @@ declare namespace LocalJSX {
2975
2983
  * Expands the button to fill 100% of the container width
2976
2984
  */
2977
2985
  "expanded"?: boolean;
2986
+ /**
2987
+ * Expands the button to fill 100% of the container width only on mobile
2988
+ */
2989
+ "expandedMobile"?: boolean;
2978
2990
  /**
2979
2991
  * Same as original parameter
2980
2992
  * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable
@@ -3209,6 +3221,10 @@ declare namespace LocalJSX {
3209
3221
  "position"?: PositionType;
3210
3222
  }
3211
3223
  interface GovEmpty {
3224
+ /**
3225
+ * Element direction
3226
+ */
3227
+ "direction"?: EmptyDirectionType;
3212
3228
  /**
3213
3229
  * Element size.
3214
3230
  */
@@ -4406,7 +4422,7 @@ declare namespace LocalJSX {
4406
4422
  /**
4407
4423
  * Label in light mode
4408
4424
  */
4409
- "ariaLabelLight"?: "Přenout na tmavý mód";
4425
+ "ariaLabelLight"?: "Přepnout na tmavý mód";
4410
4426
  /**
4411
4427
  * Display switch label
4412
4428
  */
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.2.3",
5
+ "version": "4.2.4",
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{p as e,H as t,c as i,h as s,d as a}from"./p-42200001.js";import{v as n}from"./p-0b3574c2.js";import{B as o,a as d,b as h,N as r}from"./p-44a8a668.js";import{g as c,t as l}from"./p-ea7fdd2e.js";import{S as f}from"./p-92f420cb.js";import{a as p}from"./p-10cad7f1.js";import{c as u}from"./p-e8ec030e.js";import{d as b}from"./p-e0e2e9c1.js";import{A as m,a as v,i as y}from"./p-33d5d1ed.js";import{d as g}from"./p-5b0a3c98.js";function k(e){if(typeof e==="string"){return["true","True","TRUE","1"].indexOf(e)!==-1}else if(typeof e==="number"){return e>0}else if(typeof e==="boolean"){return e}else{return e?true:false}}var j;(function(e){e["A"]="a";e["BUTTON"]="button"})(j||(j={}));const T=e(class e extends t{constructor(){super();this.__registerHost();this.govClick=i(this,"gov-click",7);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.hydrated=false;this.color=undefined;this.size="m";this.type=undefined;this.expanded=false;this.name=undefined;this.disabled=false;this.nativeType="button";this.href=undefined;this.target=undefined;this.download=undefined;this.hreflang=undefined;this.referrerpolicy=undefined;this.rel=undefined;this.loading=undefined;this.focusable=true;this.identifier=undefined;this.inheritedAttributes={};this.h=c(this.host)}validateColor(e){n(d,e,o.root)}validateType(e){n(h,e,o.root)}validateSize(e){n(f,e,o.root)}validateNativeType(e){n(r,e,o.root)}componentDidLoad(){this.attributeObserver=new m(this.host,((e,t)=>{this.onAriaAttributeChange(e,t)}));this.attributeObserver.startObserving(v)}onAriaAttributeChange(e,t){this.host.removeAttribute(e);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[e]:t})}disconnectedCallback(){var e;(e=this.attributeObserver)===null||e===void 0?void 0:e.stopObserving()}componentWillLoad(){this.validateColor(this.color);this.validateType(this.type);this.validateSize(this.size);this.validateNativeType(this.nativeType);this.inheritedAttributes=y(this.host)}async componentDidRender(){if(u()){await b(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const e=this.href?j.A:j.BUTTON;const t=e===j.A?undefined:this.nativeType;return s(a,{key:"cd3d644c54ac882be5adf1645391a873d426e549",size:this.size,hydrated:this.hydrated,color:this.color,class:this.h.classes(o.root),type:this.type},s(e,Object.assign({key:"39c76efc161144865f6bde8cf50e2808d0566415",class:"element",ref:e=>this.triggerRef=e,onClick:this.onClickHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),disabled:this.disabled,id:this.identifier,href:this.href,target:this.target,download:this.download,hreflang:this.hreflang,rel:this.rel,name:this.name,type:t,tabindex:this.disabled?"-1":"0"},this.inheritedAttributes,{"aria-disabled":l(this.disabled)}),k(this.loading)&&!this.h.hasSlot("icon-end")&&s("gov-icon",{key:"b75ed857aacc2b914810fbdbb3c0d39ede423639",name:"loader",class:"gov-spin-animation",type:"components"}),this.h.hasSlot("icon-start")&&s("slot",{key:"838152233ab4f51b36217ae0b4077a3f3efc3ecf",name:"icon-start"}),s("slot",{key:"0dbfd16b6de4ea9c0bb92a97297262f10b9a335c"}),this.h.hasSlot("icon-end")&&s("slot",{key:"8854b0bced36cabfe85988e22d10d49f9761a910",name:"icon-end"}),k(this.loading)&&this.h.hasSlot("icon-end")&&s("gov-icon",{key:"607c848e0a9e4abf1c4232658a38922ade4accf9",name:"loader",class:"gov-spin-animation",type:"components"})))}onClickHandler(e){e.stopPropagation();if(this.disabled===false){this.govClick.emit({component:o.root,originalEvent:e,ref:this.host})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:o.root,originalEvent:e,ref:this.host})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:o.root,originalEvent:e,ref:this.host})}async setFocus(){this.triggerRef.focus()}async getRef(){return this.triggerRef}async validateAccessibility(){if(this.focusable){p(this.triggerRef.getAttribute("aria-label"),this.triggerRef.getAttribute("aria-labelledby"),o.root,this.host)}}get host(){return this}static get watchers(){return{color:["validateColor"],type:["validateType"],size:["validateSize"],nativeType:["validateNativeType"]}}},[4,"gov-button",{color:[513],size:[513],type:[513],expanded:[516],name:[1],disabled:[516],nativeType:[1,"native-type"],href:[1],target:[1],download:[4],hreflang:[1],referrerpolicy:[1],rel:[1],loading:[1],focusable:[4],identifier:[1],inheritedAttributes:[32],setFocus:[64],getRef:[64],validateAccessibility:[64]},undefined,{color:["validateColor"],type:["validateType"],size:["validateSize"],nativeType:["validateNativeType"]}]);function C(){if(typeof customElements==="undefined"){return}const e=["gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-button":if(!customElements.get(e)){customElements.define(e,T)}break;case"gov-icon":if(!customElements.get(e)){g()}break}}))}C();export{T as G,C as d};
2
- //# sourceMappingURL=p-62d01259.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["toBool","value","indexOf","Tags","GovButton","proxyCustomElement","H","constructor","this","hydrated","h","govHost","host","validateColor","newValue","validateProp","ButtonColors","ButtonClass","root","validateType","ButtonType","validateSize","Sizes","validateNativeType","NativeType","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","removeAttribute","inheritedAttributes","Object","assign","disconnectedCallback","_a","stopObserving","componentWillLoad","color","type","size","nativeType","inheritAriaAttributes","componentDidRender","canValidateWcagOnRender","delay","validateAccessibility","connectedCallback","render","Tag","href","A","BUTTON","undefined","Host","key","class","classes","ref","el","triggerRef","onClick","onClickHandler","bind","onFocus","onFocusHandler","onBlur","onBlurHandler","disabled","id","identifier","target","download","hreflang","rel","name","tabindex","toBoolAttrIfDefined","loading","hasSlot","e","stopPropagation","govClick","emit","component","originalEvent","govFocus","govBlur","setFocus","focus","getRef","focusable","validateAccessibleLabel","getAttribute"],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {\n\tButtonClass,\n\tButtonColors,\n\tButtonColorType,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonType,\n\tButtonTypesType,\n\tNativeType,\n\tNativeTypesType,\n} from \"./constants\"\nimport {govHost, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {toBool} from \"../../../utils/bool.utils\"\nimport {Sizes} from \"../../../core/constants/sizes\"\nimport {validateAccessibleLabel} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\tprivate attributeObserver: AttributeObserver\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({reflect: true}) readonly type: ButtonTypesType\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(ButtonType, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host size={this.size}\n\t\t\t\t hydrated={this.hydrated}\n\t\t\t\t color={this.color}\n\t\t\t\t class={this.h.classes(ButtonClass.root)}\n\t\t\t\t type={this.type}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.disabled ? \"-1\" : \"0\"}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"icon-start\") && <slot name=\"icon-start\"></slot>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{this.h.hasSlot(\"icon-end\") && <slot name=\"icon-end\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Validate the Accessibility attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tif (this.focusable) {\n\t\t\tvalidateAccessibleLabel(this.triggerRef.getAttribute('aria-label'), this.triggerRef.getAttribute('aria-labelledby'), ButtonClass.root, this.host)\n\t\t}\n\t}\n}\n"],"mappings":"ubAAgBA,EAAOC,GACtB,UAAWA,IAAU,SAAU,CAC9B,MAAO,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E,EAAEuE,QAAQ,aAAevE,EAAA,QAAA+C,IAAA,2CAAMoB,KAAK,aACzC7E,EAAOQ,KAAKwE,UAAYxE,KAAKE,EAAEuE,QAAQ,aACvCvE,EAAA,YAAA+C,IAAA,2CAAUoB,KAAK,SAASnB,MAAM,qBAAqBjB,KAAK,gB,CAMrD,cAAAuB,CAAekB,GACtBA,EAAEC,kBACF,GAAI3E,KAAK8D,WAAa,MAAO,CAC5B9D,KAAK4E,SAASC,KAAK,CAClBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,EAKL,cAAAuD,CAAee,GACtBA,EAAEC,kBACF3E,KAAKgF,SAASH,KAAK,CAClBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,CAIJ,aAAAyD,CAAca,GACrBA,EAAEC,kBACF3E,KAAKiF,QAAQJ,KAAK,CACjBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,CAQZ,cAAM8E,GACLlF,KAAKsD,WAAW6B,O,CAOjB,YAAMC,GACL,OAAOpF,KAAKsD,U,CAOb,2BAAMd,GACL,GAAIxC,KAAKqF,UAAW,CACnBC,EAAwBtF,KAAKsD,WAAWiC,aAAa,cAAevF,KAAKsD,WAAWiC,aAAa,mBAAoB9E,EAAYC,KAAMV,KAAKI,K","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as s,c as e,h as a,a as t}from"./p-9dea2efa.js";import{F as o}from"./p-7ba4daf4.js";import"./p-e0e2e9c1.js";import"./p-92f420cb.js";const i=class{constructor(a){s(this,a);this.govClick=e(this,"gov-click",7);this.identifier=undefined;this.size="m";this.required=false;this.legend=false}render(){const s=this.legend?"legend":"label";return a(t,{key:"5227d00ebe3e8923687d4e8d0f3a74bad0da82b3",class:o.root,size:this.size},a(s,{key:"981d363fdf7435a0b242b9610a7dd68e11d4f05e",class:o.label,htmlFor:this.identifier,onClick:()=>this.govClick.emit()},a("slot",{key:"bdf282178e200fa69d9f871354786ecbd024fa90"}),this.required?a("span",{class:"gov-color--error-500"}," *"):null))}};export{i as gov_form_label};
2
- //# sourceMappingURL=p-774ea182.entry.js.map
@@ -1,2 +0,0 @@
1
- import{r as t,c as s,h as e,a as i,g as o}from"./p-9dea2efa.js";import{g as a,c as n}from"./p-ea7fdd2e.js";import{F as c}from"./p-1c1d0bbe.js";import{v as r}from"./p-0b3574c2.js";import{C as h}from"./p-5aad3497.js";import{p as l}from"./p-e0e2e9c1.js";import{A as d,a as b}from"./p-9ac55bd1.js";import{i as f}from"./p-d9a299a4.js";import"./p-e8ec030e.js";const p=l(h,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var m;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(m||(m={}));const v={root:"gov-infobar",section:"gov-infobar__section",content:"gov-infobar__content",headline:"gov-infobar__headline",close:"gov-infobar__close"};const g=class{constructor(e){t(this,e);this.govClose=s(this,"gov-close",7);this.color="primary";this.type="bold";this.role=undefined;this.accessibleCloseLabel="Zavřít informační lištu";this.accessibleToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.inheritedAttributes={};this.h=a(this.host)}validateColor(t){r(p,t,v.root)}componentDidLoad(){this.attributeObserver=new d(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateColor(this.color);this.inheritedAttributes=f(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){const t=e("gov-button",{key:"bf4dbf4e33374f5827d51c7fab56ce1de0e86103",size:"s","aria-label":this.accessibleCloseLabel,type:"base",color:this.isBold?this.color:"neutral","on-gov-click":this.onCloseHandler.bind(this),class:v.close},e("gov-icon",{key:"c85cebe33a0b06adc79c0adb97d9cabe3d648651",name:"x-lg",type:"components"}));return e(i,{key:"82fe497b7f6d4f3aba3bcad0295bb626587952c1",class:this.h.classes(v.root),color:this.color,type:this.type},e("section",Object.assign({key:"d2b1a013623206d9662c252f189a5b9edeff009d",class:v.section},this.inheritedAttributes,{role:this.role}),this.h.hasSlot("icon")&&e("span",{key:"18efd7eecd6eeb683ba2982f9abb2cfc09e90dab"},e("slot",{key:"cc093214b7fd417c1baec6918e5613f843a7bb55",name:"icon"})),e("div",{key:"07d2db35c654390b08318273dbd76456b75ae5e4",class:v.content},this.h.hasSlot("headline")?e(c,null,e("div",{class:v.headline},e("slot",{name:"headline"}),e("gov-button",{size:"s",type:"base",color:this.isBold?this.color:"neutral","aria-label":this.accessibleToggleLabel,"on-gov-click":()=>this.toggleContent=!this.toggleContent},e("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down",type:"components"}))),e("div",{hidden:!this.toggleContent,"aria-hidden":n(this.toggleContent)},e("slot",null))):e("slot",null)),this.closable&&t))}onCloseHandler(t){this.govClose.emit({component:v.root,ref:this.host,originalEvent:t})}get isBold(){return this.type==="bold"}get host(){return o(this)}static get watchers(){return{color:["validateColor"]}}};export{g as gov_infobar};
2
- //# sourceMappingURL=p-a1c825f3.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["InfobarColors","pick","Colors","InfobarType","InfobarClass","root","section","content","headline","close","GovInfobar","constructor","hostRef","undefined","this","h","govHost","host","validateColor","newValue","validateProp","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","color","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","closeButton","key","size","accessibleCloseLabel","type","isBold","onCloseHandler","bind","class","name","Host","classes","role","hasSlot","Fragment","accessibleToggleLabel","toggleContent","hidden","toBoolAttr","closable","e","govClose","emit","component","ref","originalEvent"],"sources":["../../../packages/core/src/components/gov-infobar/constants.ts","../../../packages/core/src/components/gov-infobar/gov-infobar.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const InfobarColors = pick(Colors, ['PRIMARY', 'SECONDARY', 'NEUTRAL', 'ERROR', 'SUCCESS', 'WARNING'])\nexport type ColorType = `${ValueOf<typeof InfobarColors>}`\n\nexport enum InfobarType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type InfobarTypesType = `${ValueOf<typeof InfobarType>}`\n\nexport const InfobarClass = {\n\troot: 'gov-infobar',\n\tsection: 'gov-infobar__section',\n\tcontent: 'gov-infobar__content',\n\theadline: 'gov-infobar__headline',\n\tclose: 'gov-infobar__close',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from '@stencil/core'\nimport {govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport Fragment from '../../helpers/Fragment'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonEvent} from '../gov-button/button/gov-button.types'\nimport {ColorType, InfobarClass, InfobarColors, InfobarTypesType} from './constants'\nimport {InfobarEvent} from './gov-infobar.types'\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-infobar',\n})\nexport class GovInfobar {\n\tprivate h: GovHost\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovInfobarElement\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly color: ColorType = 'primary'\n\t/**\n\t * Infobar appearance\n\t */\n\t@Prop() readonly type?: InfobarTypesType = \"bold\"\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly role: HTMLElement['role'] = undefined\n\t/**\n\t * Aria label for the closing button. It is mandatory if the infobar is closable\n\t */\n\t@Prop({attribute: 'accessible-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít informační lištu'\n\t/**\n\t * Aria label for the toggle button. It is mandatory if the infobar has headline\n\t */\n\t@Prop({attribute: 'accessible-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit více informací'\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<InfobarEvent>\n\t/**\n\t * Displays the option to close the infobar\n\t */\n\t@Prop() readonly closable?: boolean = false\n\n\t@State() toggleContent = false\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(InfobarColors, newValue, InfobarClass.root)\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\tconst closeButton = (\n\t\t\t<gov-button size=\"s\"\n\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tcolor={this.isBold ? this.color : \"neutral\"}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\tclass={InfobarClass.close}>\n\t\t\t\t<gov-icon name=\"x-lg\" type=\"components\"></gov-icon>\n\t\t\t</gov-button>\n\t\t)\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(InfobarClass.root)} color={this.color} type={this.type}>\n\t\t\t\t<section class={InfobarClass.section} {...this.inheritedAttributes} role={this.role}>\n\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t\t<div class={InfobarClass.content}>\n\t\t\t\t\t\t{this.h.hasSlot('headline') ? (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<div class={InfobarClass.headline}>\n\t\t\t\t\t\t\t\t\t<slot name={\"headline\"}/>\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tcolor={this.isBold ? this.color : \"neutral\"}\n\t\t\t\t\t\t\t\t\t\taria-label={this.accessibleToggleLabel}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => (this.toggleContent = !this.toggleContent)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name={this.toggleContent ? 'chevron-up' : 'chevron-down'} type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div hidden={!this.toggleContent} aria-hidden={toBoolAttr(this.toggleContent)}>\n\t\t\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.closable && closeButton}\n\t\t\t\t</section>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tonCloseHandler(e: CustomEvent<ButtonEvent>) {\n\t\tthis.govClose.emit({\n\t\t\tcomponent: InfobarClass.root,\n\t\t\tref: this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c2.js";import{B as o,a as h,c as d,N as r}from"./p-3bbb77a0.js";import{g as c,t as f}from"./p-ea7fdd2e.js";import{S as l}from"./p-92f420cb.js";import{v as p}from"./p-6d54ce5f.js";import{c as b}from"./p-e8ec030e.js";import{d as m}from"./p-e0e2e9c1.js";import{i as u}from"./p-d9a299a4.js";import{A as v,a as y}from"./p-9ac55bd1.js";import"./p-5aad3497.js";import"./p-cd6c2938.js";import"./p-2fe7d728.js";function g(t){if(typeof t==="string"){return["true","True","TRUE","1"].indexOf(t)!==-1}else if(typeof t==="number"){return t>0}else if(typeof t==="boolean"){return t}else{return t?true:false}}var j;(function(t){t["A"]="a";t["BUTTON"]="button"})(j||(j={}));const k=class{constructor(e){t(this,e);this.govClick=i(this,"gov-click",7);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.hydrated=false;this.color=undefined;this.size="m";this.type=undefined;this.expanded=false;this.name=undefined;this.disabled=false;this.nativeType="button";this.href=undefined;this.target=undefined;this.download=undefined;this.hreflang=undefined;this.referrerpolicy=undefined;this.rel=undefined;this.loading=undefined;this.focusable=true;this.identifier=undefined;this.inheritedAttributes={};this.h=c(this.host)}validateColor(t){n(h,t,o.root)}validateType(t){n(d,t,o.root)}validateSize(t){n(l,t,o.root)}validateNativeType(t){n(r,t,o.root)}componentDidLoad(){this.attributeObserver=new v(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(y)}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}componentWillLoad(){this.validateColor(this.color);this.validateType(this.type);this.validateSize(this.size);this.validateNativeType(this.nativeType);this.inheritedAttributes=u(this.host)}async componentDidRender(){if(b()){await m(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const t=this.href?j.A:j.BUTTON;const i=t===j.A?undefined:this.nativeType;return e(s,{key:"cd3d644c54ac882be5adf1645391a873d426e549",size:this.size,hydrated:this.hydrated,color:this.color,class:this.h.classes(o.root),type:this.type},e(t,Object.assign({key:"39c76efc161144865f6bde8cf50e2808d0566415",class:"element",ref:t=>this.triggerRef=t,onClick:this.onClickHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),disabled:this.disabled,id:this.identifier,href:this.href,target:this.target,download:this.download,hreflang:this.hreflang,rel:this.rel,name:this.name,type:i,tabindex:this.disabled?"-1":"0"},this.inheritedAttributes,{"aria-disabled":f(this.disabled)}),g(this.loading)&&!this.h.hasSlot("icon-end")&&e("gov-icon",{key:"b75ed857aacc2b914810fbdbb3c0d39ede423639",name:"loader",class:"gov-spin-animation",type:"components"}),this.h.hasSlot("icon-start")&&e("slot",{key:"838152233ab4f51b36217ae0b4077a3f3efc3ecf",name:"icon-start"}),e("slot",{key:"0dbfd16b6de4ea9c0bb92a97297262f10b9a335c"}),this.h.hasSlot("icon-end")&&e("slot",{key:"8854b0bced36cabfe85988e22d10d49f9761a910",name:"icon-end"}),g(this.loading)&&this.h.hasSlot("icon-end")&&e("gov-icon",{key:"607c848e0a9e4abf1c4232658a38922ade4accf9",name:"loader",class:"gov-spin-animation",type:"components"})))}onClickHandler(t){t.stopPropagation();if(this.disabled===false){this.govClick.emit({component:o.root,originalEvent:t,ref:this.host})}}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:o.root,originalEvent:t,ref:this.host})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:o.root,originalEvent:t,ref:this.host})}async setFocus(){this.triggerRef.focus()}async getRef(){return this.triggerRef}async validateAccessibility(){if(this.focusable){p(this.triggerRef.getAttribute("aria-label"),this.triggerRef.getAttribute("aria-labelledby"),o.root,this.host)}}get host(){return a(this)}static get watchers(){return{color:["validateColor"],type:["validateType"],size:["validateSize"],nativeType:["validateNativeType"]}}};export{k as gov_button};
2
- //# sourceMappingURL=p-c1584cfe.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["toBool","value","indexOf","Tags","GovButton","constructor","hostRef","this","hydrated","h","govHost","host","validateColor","newValue","validateProp","ButtonColors","ButtonClass","root","validateType","ButtonType","validateSize","Sizes","validateNativeType","NativeType","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","removeAttribute","inheritedAttributes","Object","assign","disconnectedCallback","_a","stopObserving","componentWillLoad","color","type","size","nativeType","inheritAriaAttributes","componentDidRender","canValidateWcagOnRender","delay","validateAccessibility","connectedCallback","render","Tag","href","A","BUTTON","undefined","Host","key","class","classes","ref","el","triggerRef","onClick","onClickHandler","bind","onFocus","onFocusHandler","onBlur","onBlurHandler","disabled","id","identifier","target","download","hreflang","rel","name","tabindex","toBoolAttrIfDefined","loading","hasSlot","e","stopPropagation","govClick","emit","component","originalEvent","govFocus","govBlur","setFocus","focus","getRef","focusable","validateAccessibleLabel","getAttribute"],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {\n\tButtonClass,\n\tButtonColors,\n\tButtonColorType,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonType,\n\tButtonTypesType,\n\tNativeType,\n\tNativeTypesType,\n} from \"./constants\"\nimport {govHost, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {toBool} from \"../../../utils/bool.utils\"\nimport {Sizes} from \"../../../core/constants/sizes\"\nimport {validateAccessibleLabel} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\tprivate attributeObserver: AttributeObserver\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({reflect: true}) readonly type: ButtonTypesType\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(ButtonType, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host size={this.size}\n\t\t\t\t hydrated={this.hydrated}\n\t\t\t\t color={this.color}\n\t\t\t\t class={this.h.classes(ButtonClass.root)}\n\t\t\t\t type={this.type}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.disabled ? \"-1\" : \"0\"}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"icon-start\") && <slot name=\"icon-start\"></slot>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{this.h.hasSlot(\"icon-end\") && <slot name=\"icon-end\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Validate the Accessibility attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tif (this.focusable) {\n\t\t\tvalidateAccessibleLabel(this.triggerRef.getAttribute('aria-label'), this.triggerRef.getAttribute('aria-labelledby'), ButtonClass.root, this.host)\n\t\t}\n\t}\n}\n"],"mappings":"wfAAgBA,EAAOC,GACtB,UAAWA,IAAU,SAAU,CAC9B,MAAO,CAAC,OAAQ,OAAQ,OAAQ,KAAKC,QAAQD,MAAY,C,MACnD,UAAWA,IAAU,SAAU,CACrC,OAAOA,EAAQ,C,MACT,UAAWA,IAAU,UAAW,CACtC,OAAOA,C,KACD,CACN,OAAOA,EAAQ,KAAO,K,CAExB,CCeA,IAAKE,GAAL,SAAKA,GACJA,EAAA,SACAA,EAAA,kBACA,EAHD,CAAKA,MAAI,K,MAQIC,EAAS,MAMrB,WAAAC,CAAAC,G,oHAFQC,KAAAC,SAAW,M,+BAesC,I,kCAQL,M,kCASA,M,gBAKJ,S,iLAuCV,K,mDAsCK,GA/G1CD,KAAKE,EAAIC,EAAQH,KAAKI,K,CA4FvB,aAAAC,CAAcC,GACbC,EAAaC,EAAcF,EAAUG,EAAYC,K,CAIlD,YAAAC,CAAaL,GACZC,EAAaK,EAAYN,EAAUG,EAAYC,K,CAIhD,YAAAG,CAAaP,GACZC,EAAaO,EAAOR,EAAUG,EAAYC,K,CAI3C,kBAAAK,CAAmBT,GAClBC,EAAaS,EAAYV,EAAUG,EAAYC,K,CAKhD,gBAAAO,GACCjB,KAAKkB,kBAAoB,IAAIC,EAAkBnB,KAAKI,MAAM,CAACgB,EAAed,KACzEN,KAAKqB,sBAAsBD,EAAed,EAAS,IAGpDN,KAAKkB,kBAAkBI,eAAeC,E,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,KAAMV,KAAKI,K","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as e,h as t,a as s,g as a}from"./p-9dea2efa.js";import{p as o}from"./p-e0e2e9c1.js";import{S as c}from"./p-92f420cb.js";import{g as i}from"./p-ea7fdd2e.js";import{v as r}from"./p-0b3574c2.js";import{a as d,b as f}from"./p-5f1000da.js";import"./p-e8ec030e.js";o(c,["_S","_M","_L"]);const m={root:"gov-empty",content:"gov-empty__content"};const p=class{constructor(t){e(this,t);this.size="m";this.h=i(this.host)}validateSize(e){r(f,e,d.root)}componentWillLoad(){this.validateSize(this.size)}render(){return t(s,{key:"93155f92af0574538fd919e52f312b0f02d07e21",class:this.h.classes(m.root),size:this.size},this.h.hasSlot("icon")&&t("slot",{key:"e9504c9396c9743ea7e454bb2df5d0f2a046aabe",name:"icon"}),t("div",{key:"78f2d30f570c6123a58d2ac93db58b4e471796b3",class:m.content},t("slot",{key:"7b5e1121dbfccf6d647e168e80c60cad4a1ca136",name:"headline"}),t("slot",{key:"d435390c88c0304f9ee129b268c454b2147fddb0"})))}get host(){return a(this)}static get watchers(){return{size:["validateSize"]}}};export{p as gov_empty};
2
- //# sourceMappingURL=p-c5a49469.entry.js.map