@gov-design-system-ce/components 0.0.41 → 0.0.43

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 (186) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-app.cjs.entry.js +11 -4
  3. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-dropdown.cjs.entry.js +7 -1
  5. package/dist/cjs/gov-dropdown.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gov-form-file.cjs.entry.js +3 -2
  7. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  9. package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
  10. package/dist/cjs/gov-stepper-item.cjs.entry.js.map +1 -1
  11. package/dist/cjs/gov-wizzard-item.cjs.entry.js +1 -1
  12. package/dist/cjs/gov-wizzard-item.cjs.entry.js.map +1 -1
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/components/gov-button/dropdown/gov-dropdown.js +28 -3
  15. package/dist/collection/components/gov-button/dropdown/gov-dropdown.js.map +1 -1
  16. package/dist/collection/components/gov-form/file/gov-form-file.js +23 -1
  17. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  18. package/dist/collection/components/gov-stepper/gov-stepper-item.css +7 -0
  19. package/dist/collection/components/gov-wizzard/gov-wizzard-item.css +7 -0
  20. package/dist/collection/pages/Forms.js +9 -2
  21. package/dist/collection/pages/Forms.js.map +1 -1
  22. package/dist/collection/pages/Wizzard.js +2 -2
  23. package/dist/collection/pages/Wizzard.js.map +1 -1
  24. package/dist/collection/utils/file.utils.js +1 -1
  25. package/dist/collection/utils/file.utils.js.map +1 -1
  26. package/dist/components/gov-accordion-item.js +0 -1
  27. package/dist/components/gov-accordion-item.js.map +1 -1
  28. package/dist/components/gov-accordion.js +0 -1
  29. package/dist/components/gov-accordion.js.map +1 -1
  30. package/dist/components/gov-alert.js +0 -1
  31. package/dist/components/gov-alert.js.map +1 -1
  32. package/dist/components/gov-app.js +11 -5
  33. package/dist/components/gov-app.js.map +1 -1
  34. package/dist/components/gov-attachments-item2.js +0 -1
  35. package/dist/components/gov-attachments-item2.js.map +1 -1
  36. package/dist/components/gov-attachments2.js +0 -1
  37. package/dist/components/gov-attachments2.js.map +1 -1
  38. package/dist/components/gov-backdrop2.js +0 -1
  39. package/dist/components/gov-backdrop2.js.map +1 -1
  40. package/dist/components/gov-badge2.js +0 -1
  41. package/dist/components/gov-badge2.js.map +1 -1
  42. package/dist/components/gov-breadcrumbs.js +0 -1
  43. package/dist/components/gov-breadcrumbs.js.map +1 -1
  44. package/dist/components/gov-button2.js +0 -1
  45. package/dist/components/gov-button2.js.map +1 -1
  46. package/dist/components/gov-card.js +0 -1
  47. package/dist/components/gov-card.js.map +1 -1
  48. package/dist/components/gov-container.js +0 -1
  49. package/dist/components/gov-container.js.map +1 -1
  50. package/dist/components/gov-control-group.js +0 -1
  51. package/dist/components/gov-control-group.js.map +1 -1
  52. package/dist/components/gov-cookiebar.js +0 -1
  53. package/dist/components/gov-cookiebar.js.map +1 -1
  54. package/dist/components/gov-dropdown.js +9 -3
  55. package/dist/components/gov-dropdown.js.map +1 -1
  56. package/dist/components/gov-empty.js +0 -1
  57. package/dist/components/gov-empty.js.map +1 -1
  58. package/dist/components/gov-error-code.js +0 -1
  59. package/dist/components/gov-error-code.js.map +1 -1
  60. package/dist/components/gov-form-autocomplete2.js +0 -1
  61. package/dist/components/gov-form-autocomplete2.js.map +1 -1
  62. package/dist/components/gov-form-checkbox.js +0 -1
  63. package/dist/components/gov-form-checkbox.js.map +1 -1
  64. package/dist/components/gov-form-control.js +0 -1
  65. package/dist/components/gov-form-control.js.map +1 -1
  66. package/dist/components/gov-form-file.js +4 -3
  67. package/dist/components/gov-form-file.js.map +1 -1
  68. package/dist/components/gov-form-group.js +0 -1
  69. package/dist/components/gov-form-group.js.map +1 -1
  70. package/dist/components/gov-form-input2.js +0 -1
  71. package/dist/components/gov-form-input2.js.map +1 -1
  72. package/dist/components/gov-form-label.js +0 -1
  73. package/dist/components/gov-form-label.js.map +1 -1
  74. package/dist/components/gov-form-message2.js +0 -1
  75. package/dist/components/gov-form-message2.js.map +1 -1
  76. package/dist/components/gov-form-multi-select.js +0 -1
  77. package/dist/components/gov-form-multi-select.js.map +1 -1
  78. package/dist/components/gov-form-password-power.js +0 -1
  79. package/dist/components/gov-form-password-power.js.map +1 -1
  80. package/dist/components/gov-form-radio.js +0 -1
  81. package/dist/components/gov-form-radio.js.map +1 -1
  82. package/dist/components/gov-form-search.js +0 -1
  83. package/dist/components/gov-form-search.js.map +1 -1
  84. package/dist/components/gov-form-select2.js +0 -1
  85. package/dist/components/gov-form-select2.js.map +1 -1
  86. package/dist/components/gov-form-switch.js +0 -1
  87. package/dist/components/gov-form-switch.js.map +1 -1
  88. package/dist/components/gov-grid-item.js +0 -1
  89. package/dist/components/gov-grid-item.js.map +1 -1
  90. package/dist/components/gov-grid.js +0 -1
  91. package/dist/components/gov-grid.js.map +1 -1
  92. package/dist/components/gov-icon2.js +1 -2
  93. package/dist/components/gov-icon2.js.map +1 -1
  94. package/dist/components/gov-layout-column.js +0 -1
  95. package/dist/components/gov-layout-column.js.map +1 -1
  96. package/dist/components/gov-layout.js +0 -1
  97. package/dist/components/gov-layout.js.map +1 -1
  98. package/dist/components/gov-loading.js +0 -1
  99. package/dist/components/gov-loading.js.map +1 -1
  100. package/dist/components/gov-message.js +0 -1
  101. package/dist/components/gov-message.js.map +1 -1
  102. package/dist/components/gov-modal.js +0 -1
  103. package/dist/components/gov-modal.js.map +1 -1
  104. package/dist/components/gov-nav-item.js +0 -1
  105. package/dist/components/gov-nav-item.js.map +1 -1
  106. package/dist/components/gov-nav.js +0 -1
  107. package/dist/components/gov-nav.js.map +1 -1
  108. package/dist/components/gov-pagination.js +0 -1
  109. package/dist/components/gov-pagination.js.map +1 -1
  110. package/dist/components/gov-prompt.js +0 -1
  111. package/dist/components/gov-prompt.js.map +1 -1
  112. package/dist/components/gov-side-nav-item.js +0 -1
  113. package/dist/components/gov-side-nav-item.js.map +1 -1
  114. package/dist/components/gov-side-nav.js +0 -1
  115. package/dist/components/gov-side-nav.js.map +1 -1
  116. package/dist/components/gov-skeleton.js +0 -1
  117. package/dist/components/gov-skeleton.js.map +1 -1
  118. package/dist/components/gov-spacer.js +0 -1
  119. package/dist/components/gov-spacer.js.map +1 -1
  120. package/dist/components/gov-statsbar-item.js +0 -1
  121. package/dist/components/gov-statsbar-item.js.map +1 -1
  122. package/dist/components/gov-statsbar.js +0 -1
  123. package/dist/components/gov-statsbar.js.map +1 -1
  124. package/dist/components/gov-stepper-item.js +1 -2
  125. package/dist/components/gov-stepper-item.js.map +1 -1
  126. package/dist/components/gov-stepper.js +0 -1
  127. package/dist/components/gov-stepper.js.map +1 -1
  128. package/dist/components/gov-tabs-item.js +0 -1
  129. package/dist/components/gov-tabs-item.js.map +1 -1
  130. package/dist/components/gov-tabs.js +0 -1
  131. package/dist/components/gov-tabs.js.map +1 -1
  132. package/dist/components/gov-tile.js +0 -1
  133. package/dist/components/gov-tile.js.map +1 -1
  134. package/dist/components/gov-tiles.js +0 -1
  135. package/dist/components/gov-tiles.js.map +1 -1
  136. package/dist/components/gov-toast.js +0 -1
  137. package/dist/components/gov-toast.js.map +1 -1
  138. package/dist/components/gov-tooltip-content.js +0 -1
  139. package/dist/components/gov-tooltip-content.js.map +1 -1
  140. package/dist/components/gov-tooltip.js +0 -1
  141. package/dist/components/gov-tooltip.js.map +1 -1
  142. package/dist/components/gov-wizzard-item.js +1 -2
  143. package/dist/components/gov-wizzard-item.js.map +1 -1
  144. package/dist/components/gov-wizzard.js +0 -1
  145. package/dist/components/gov-wizzard.js.map +1 -1
  146. package/dist/core/core.esm.js +1 -1
  147. package/dist/core/core.esm.js.map +1 -1
  148. package/dist/core/p-2507a42a.entry.js +2 -0
  149. package/dist/core/p-2507a42a.entry.js.map +1 -0
  150. package/dist/core/{p-ad89c9e7.entry.js → p-3932645b.entry.js} +2 -2
  151. package/dist/core/{p-09cda4ea.entry.js → p-bc1c8436.entry.js} +2 -2
  152. package/dist/core/p-bc1c8436.entry.js.map +1 -0
  153. package/dist/core/{p-2f0f56fc.entry.js → p-bd47b407.entry.js} +2 -2
  154. package/dist/core/p-bd47b407.entry.js.map +1 -0
  155. package/dist/core/p-ca2b9685.entry.js +2 -0
  156. package/dist/core/{p-d389c001.entry.js.map → p-ca2b9685.entry.js.map} +1 -1
  157. package/dist/core/p-fb895b07.entry.js +2 -0
  158. package/dist/core/{p-0563bda3.entry.js.map → p-fb895b07.entry.js.map} +1 -1
  159. package/dist/custom-elements/index.js +1 -1
  160. package/dist/custom-elements/index.js.map +1 -1
  161. package/dist/esm/core.js +1 -1
  162. package/dist/esm/gov-app.entry.js +11 -4
  163. package/dist/esm/gov-app.entry.js.map +1 -1
  164. package/dist/esm/gov-dropdown.entry.js +7 -1
  165. package/dist/esm/gov-dropdown.entry.js.map +1 -1
  166. package/dist/esm/gov-form-file.entry.js +3 -2
  167. package/dist/esm/gov-form-file.entry.js.map +1 -1
  168. package/dist/esm/gov-icon.entry.js +1 -1
  169. package/dist/esm/gov-stepper-item.entry.js +1 -1
  170. package/dist/esm/gov-stepper-item.entry.js.map +1 -1
  171. package/dist/esm/gov-wizzard-item.entry.js +1 -1
  172. package/dist/esm/gov-wizzard-item.entry.js.map +1 -1
  173. package/dist/esm/loader.js +1 -1
  174. package/dist/hydrate/index.js +26 -10
  175. package/dist/types/components/gov-button/dropdown/gov-dropdown.d.ts +5 -1
  176. package/dist/types/components/gov-form/file/gov-form-file.d.ts +5 -0
  177. package/dist/types/components.d.ts +15 -1
  178. package/hydrate/index.js +26 -10
  179. package/package.json +1 -1
  180. package/dist/core/p-0563bda3.entry.js +0 -2
  181. package/dist/core/p-09cda4ea.entry.js.map +0 -1
  182. package/dist/core/p-2f0f56fc.entry.js.map +0 -1
  183. package/dist/core/p-bfc5e0f7.entry.js +0 -2
  184. package/dist/core/p-bfc5e0f7.entry.js.map +0 -1
  185. package/dist/core/p-d389c001.entry.js +0 -2
  186. /package/dist/core/{p-ad89c9e7.entry.js.map → p-3932645b.entry.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/stencil-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.scss?tag=gov-dropdown","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"names":["ClickOutsideOptionsDefaults","triggerEvents","exclude","registerClickOutside","component","element","callback","opt","excludedNodes","getExcludedNodes","getTriggerEvents","forEach","triggerEvent","window","addEventListener","e","initClickOutside","event","target","contains","isExcluded","call","split","map","trim","Array","from","document","querySelectorAll","err","console","warn","excudedNodes","excludedNode","Position","DropdownClass","root","list","govDropdownCss","GovDropdown","[object Object]","hostRef","LEFT","this","h","govHost","host","listId","createID","controlId","trigger","setAttribute","toBoolAttr","preventDefault","stopPropagation","open","govChange","emit","originalEvent","querySelector","ButtonClass","getSlot","Host","class","classes","position","ref","el","id","aria-labelledby","aria-hidden","hidden","name"],"mappings":"2PACA,MAAMA,EAA8B,CAChCC,cAAe,QACfC,QAAS,IA2CN,SAASC,EAAqBC,EAAWC,EAASC,EAAUC,EAAMP,GACrE,MAAMQ,EAAgBC,EAAiBF,GACvCG,EAAiBH,GAAKI,SAAQC,IAC1BC,OAAOC,iBAAiBF,GAAeG,IACnCC,EAAiBD,EAAGX,EAAWC,EAASC,EAAUE,KACnD,UAaX,SAASQ,EAAiBC,EAAOb,EAAWC,EAASC,EAAUE,GAC3D,MAAMU,EAASD,EAAMC,OACrB,IAAKb,EAAQc,SAASD,KAAYE,EAAWF,EAAQV,GAAgB,CACjEF,EAASe,KAAKjB,IAGtB,SAASM,EAAiBH,GACtB,GAAIA,EAAIN,cAAe,CACnB,OAAOM,EAAIN,cAAcqB,MAAM,KAAKC,K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,KAAMZ,KAAKY,KAAMU,SAAUtB,KAAKsB,UAClFrB,EAAA,OAAA,MACAA,EAAA,MAAA,CACCsB,IAAKC,GAAMhE,EAAqBwC,KAAMwB,GAAI,IAAMxB,KAAKY,KAAO,QAC5DQ,MAAO5B,EAAcE,KACrB+B,GAAIzB,KAAKI,OAAMsB,kBACE1B,KAAKM,UAASqB,cAClBlB,GAAYT,KAAKY,MAC9BgB,QAAS5B,KAAKY,MACdX,EAAA,OAAA,CAAM4B,KAAK,WAUfhC,iBACC,OAAOG,KAAKY","sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","/*\n * Dropdown\n */\n\n$class: \".gov-dropdown\";\n\n#{$class} {\n\tposition: relative;\n\n\t&__list {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tz-index: 100;\n\t}\n\tul {\n\t\tpadding: rem-calc(4);\n\t\tborder-radius: $border-radius;\n\t\tbackground-color: $dropdown-bg-color;\n\t\tbox-shadow: $dropdown-box-shadow;\n\t}\n\tli {\n\t\tmargin: 0;\n\t\twhite-space: nowrap;\n\t\t&::before {\n\t\t\tcontent: none;\n\t\t}\n\t\t> * {\n\t\t\twidth: 100%;\n\t\t}\n\t\t> * .element {\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t\tpadding: rem-calc(8) !important;\n\t\t\tfont-weight: 400 !important;\n\t\t}\n\t}\n\t&[position=\"right\"] {\n\t\t#{$class}__list {\n\t\t\tright: 0;\n\t\t\tleft: initial;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from \"@stencil/core\"\nimport { registerClickOutside } from 'stencil-click-outside'\nimport { govHost, toBoolAttr } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { Nullable } from \"../../../types/interfaces\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { ButtonClass } from \"../default/constants\"\nimport { DropdownClass, Position, PositionType } from \"./constants\"\nimport { DropdownEvent } from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n\tstyleUrl: \"gov-dropdown.scss\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\t/**\n\t * Dropdown open state\n\t */\n\t@Prop({ mutable: true }) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<DropdownEvent>\n\n\tcomponentWillLoad() {\n\t\tif (this.trigger) {\n\t\t\tthis.trigger.setAttribute(\"wcag-controls\", this.listId)\n\t\t\tthis.trigger.setAttribute(\"wcag-has-popup\", toBoolAttr(!!this.list))\n\t\t\tthis.trigger.setAttribute(\"identifier\", this.controlId)\n\n\t\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.open = !this.open\n\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\t\toriginalEvent: e,\n\t\t\t\t\topen: this.open,\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n}\n"]}
@@ -1,2 +0,0 @@
1
- import{r as e,c as o,h as i,H as l,g as a}from"./p-4af5e4f4.js";import{c as r}from"./p-24636c53.js";import{g as t,a as f,t as s}from"./p-3f37ddb6.js";import{b as n,c as d}from"./p-0f5e2b0a.js";import{c as m}from"./p-34152b51.js";import{d as v}from"./p-03990da5.js";import{g}from"./p-34ed07f6.js";import"./p-561fa17b.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";const h={root:"gov-form-file",area:"gov-form-file__area",label:"gov-form-file__label",input:"gov-form-file__input",list:"gov-form-file__list",item:"gov-form-file__item",attachments:"gov-form-file__attachments"};function _(e){const o=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let i=0,l=parseInt(e,10)||0;while(l>=1024&&++i){l=l/1024}return l.toFixed(l<10&&i>0?1:0)+" "+o[i]}function b(e,o){if(typeof o==="string"&&o.length){return o.replace(/\s/g,"").split(",").filter((o=>new RegExp(o.replace("*",".*")).test(e.type))).length>0}else{return true}}function p(e,o){const i=Math.round(e.size/1024);return i<=o}const c='.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-form-file{position:relative;display:block;width:100%}.gov-form-file__label .gov-form-label__label>*:last-child{margin-bottom:0}.gov-form-file__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0.0001;cursor:pointer}.gov-form-file__attachments{margin-top:1rem 0rem 0rem}.gov-form-file__item{display:flex;gap:1rem;align-items:center}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label{pointer-events:none}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label *{color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}.gov-form-file[expanded=""] .gov-form-file__area,.gov-form-file[expanded=true i] .gov-form-file__area,.gov-form-file[expanded="1"] .gov-form-file__area{position:relative;width:100%;padding:2rem 1.375rem 1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center;transition:background-color 150ms ease-in-out;will-change:background-color}.gov-form-file[expanded=""] .gov-form-file__area.highlight,.gov-form-file[expanded=true i] .gov-form-file__area.highlight,.gov-form-file[expanded="1"] .gov-form-file__area.highlight{background-color:var(--gov-color-primary-200)}.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{width:100%;padding:1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center}.gov-form-file[expanded=""] .gov-form-file__attachments,.gov-form-file[expanded=true i] .gov-form-file__attachments,.gov-form-file[expanded="1"] .gov-form-file__attachments{margin:1.5rem 0rem 0rem}.gov-form-file[expanded=""][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__label .gov-form-label__label{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][invalid=""] .gov-form-file__area,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__area,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__area{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][disabled=""] .gov-form-file__area,.gov-form-file[expanded=""][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=""][disabled="1"] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=""] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=true i][disabled="1"] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=""] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=true i] .gov-form-file__area,.gov-form-file[expanded="1"][disabled="1"] .gov-form-file__area{pointer-events:none;color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}@media (min-width: 30em){.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{padding:2rem}}';const u=class{constructor(i){e(this,i);this.govFocus=o(this,"gov-focus",7);this.govBlur=o(this,"gov-blur",7);this.govFiles=o(this,"gov-files",7);this.govAddFile=o(this,"gov-add-file",7);this.govRemoveFile=o(this,"gov-remove-file",7);this.expanded=false;this.required=false;this.disabled=undefined;this.displayAttachments=true;this.name=undefined;this.accept=undefined;this.maxFileSize=-1;this.identifier=undefined;this.invalid=undefined;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.attachmentsLabel="Přílohy";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagRemoveLabel="Odebrat soubor {FILE_NAME}";this.wcagAttachmentsLabel="Přílohy";this.files=[];this.fileId=r("GovInputFile");this.h=t(this.host);this.f=g(this.h)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("disabled",f(this.disabled));this.f.passAttrToControl("invalid",f(this.invalid));this.f.passAttrToControl("type","File")}registerListeners(){function e(){this.areaRef.classList.add("highlight")}function o(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(e=>{e.preventDefault();e.stopPropagation();const o=e.target.files;this.validateFiles(o)}),false);if(this.expanded){const i=["dragover","dragleave"];const l=["dragenter","dragover","mouseenter"];const a=["dragleave","drop","mouseleave"];i.map((e=>this.inputRef.addEventListener(e,this.preventDefaults.bind(this),false)));l.map((o=>this.inputRef.addEventListener(o,e.bind(this),false)));a.forEach((e=>this.inputRef.addEventListener(e,o.bind(this),false)));this.areaRef.addEventListener("drop",this.handleDrop.bind(this),false)}}preventDefaults(e){e.preventDefault();e.stopPropagation()}handleDrop(e){const o=e.dataTransfer;this.validateFiles(o.files)}validateFiles(e){Array.from(e).map((e=>{const o=this.files.find((o=>o.file.name===e.name&&o.file.size===e.size))||null;if(o===null){const o=typeof this.maxFileSize==="number"&&this.maxFileSize>0?p(e,this.maxFileSize):true;const i=b(e,this.accept);const l={id:r("GovFormFile"),file:e,acceptValid:i,sizeValid:o};this.files=[...this.files,l];this.govAddFile.emit({component:h.root,file:l})}}));this.govFiles.emit({component:h.root,files:this.files})}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.watchDisabled()}async componentDidRender(){if(m()){await v(500);await this.validateWcag()}this.registerListeners()}render(){return i(l,{class:this.h.classes([h.root]),invalid:s(this.invalid),expanded:s(this.expanded)},i("div",{class:h.area,ref:e=>this.areaRef=e},i("slot",null),i("input",{class:h.input,ref:e=>this.inputRef=e,id:this.identifier||this.fileId,type:"file",name:this.name,accept:this.accept,onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,"aria-required":s(this.required),"aria-invalid":s(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":s(this.disabled)})),this.h.hasSlot("attachments")?i("div",{class:h.attachments},i("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?i("div",{class:h.attachments},i("gov-attachments",{label:this.wcagAttachmentsLabel,"wcag-label":this.wcagAttachmentsLabel},this.files.map((e=>i("gov-attachments-item",{"wcag-remove-labelled-by":e.id,"on-gov-remove":()=>this.onRemoveFileHandler(e)},i("span",{class:"sr-only",id:e.id},this.wcagRemoveLabel.replace("{FILE_NAME}",e.file.name)),e.file.name,e.acceptValid===false?i("gov-form-message",{slot:"message",variant:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),e.acceptValid===false?this.errorAccept:null):null,e.sizeValid===false?i("gov-form-message",{slot:"message",variant:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),this.errorSize.replace("{FILE_SIZE}",_(this.maxFileSize*1024))):null,i("span",{slot:"info"},"(",_(e.file.size),")")))))):null)}onRemoveFileHandler(e){const o=this.files.findIndex((o=>o.id===e.id));if(o!==-1){const e=this.files;const i=this.files[o];e.splice(o,1);this.files=[...e];this.govRemoveFile.emit({component:h.root,file:i});this.govFiles.emit({component:h.root,files:e})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:h.root,originalEvent:e})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:h.root,originalEvent:e})}onChangeHandler(e){e.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async validateWcag(){n(this.wcagDescribedBy,"wcag-described-by",h.root);n(this.wcagLabelledBy,"wcag-labelled-by",h.root);d(this.identifier||this.fileId,this.wcagLabelledBy,h.root)}get host(){return a(this)}static get watchers(){return{disabled:["watchDisabled"],invalid:["watchDisabled"]}}};u.style=c;export{u as gov_form_file};
2
- //# sourceMappingURL=p-bfc5e0f7.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.scss?tag=gov-form-file","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"names":["FormFileClass","root","area","label","input","list","item","attachments","formatBytes","bytes","units","l","n","parseInt","toFixed","fileAcceptValidation","file","accept","length","replace","split","filter","RegExp","test","type","fileSizeValidation","maxSize","fileSize","Math","round","size","govFormFileCss","GovFormFile","[object Object]","hostRef","this","fileId","createID","h","govHost","host","f","govForm","passControlAttrs","passAttrToControl","toBoolAttr","disabled","invalid","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","files","target","validateFiles","expanded","events","inEvents","outEvents","map","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","Array","from","isFile","find","name","isSizeValid","maxFileSize","isAcceptValid","newFile","id","acceptValid","sizeValid","govAddFile","emit","component","govFiles","passAttrToLabel","String","required","watchDisabled","canValidateWcagOnRender","delay","validateWcag","registerListeners","Host","class","classes","toBoolAttrIfDefined","ref","el","identifier","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","aria-required","aria-invalid","aria-describedby","wcagDescribedBy","aria-labelledby","wcagLabelledBy","aria-disabled","hasSlot","displayAttachments","wcagAttachmentsLabel","wcag-label","wcag-remove-labelled-by","on-gov-remove","onRemoveFileHandler","wcagRemoveLabel","slot","variant","errorAccept","errorSize","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","validateWcagRef","validateWcagLabelFor"],"mappings":"wbAAO,MAAMA,EAAgB,CAC5BC,KAAM,gBACNC,KAAM,sBACNC,MAAO,uBACPC,MAAO,uBACPC,KAAM,sBACNC,KAAM,sBACNC,YAAa,uCCPEC,EAAYC,GAC3B,MAAMC,EAAQ,CAAC,QAAS,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OACzE,IAAIC,EAAI,EACPC,EAAIC,SAASJ,EAAO,KAAO,EAE5B,MAAOG,GAAK,QAAUD,EAAG,CACxBC,EAAIA,EAAI,KAGT,OAAOA,EAAEE,QAAQF,EAAI,IAAMD,EAAI,EAAI,EAAI,GAAK,IAAMD,EAAMC,YAGzCI,EAAqBC,EAAYC,GAChD,UAAWA,IAAW,UAAYA,EAAOC,OAAQ,CAChD,OACCD,EACEE,QAAQ,MAAO,IACfC,MAAM,KACNC,QAAOJ,GACA,IAAIK,OAAOL,EAAOE,QAAQ,IAAK,OAAOI,KAAKP,EAAKQ,QACrDN,OAAS,MAER,CACN,OAAO,eAIO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Q,SACxCxF,EAAA,WAAA,CAAUuF,KAAK,OAAOhD,KAAK,8BAC1B1C,KAAK6F,UAAU7G,QAAQ,cAAeX,EAAY2B,KAAK4C,YAAc,QAEpE,KACJzC,EAAA,OAAA,CAAMuF,KAAK,QAAM,IAAGrH,EAAYF,EAAKU,KAAKc,MAAK,UAKhD,MAKCG,oBAAoBjB,GAC3B,MAAMiH,EAAQ9F,KAAKwB,MAAMuE,WAAU5H,GAAQA,EAAK4E,KAAOlE,EAAKkE,KAC5D,GAAI+C,KAAW,EAAG,CACjB,MAAMtE,EAAQxB,KAAKwB,MACnB,MAAMwE,EAAahG,KAAKwB,MAAMsE,GAC9BtE,EAAMyE,OAAOH,EAAO,GACpB9F,KAAKwB,MAAQ,IAAIA,GACjBxB,KAAKkG,cAAc/C,KAAK,CACvBC,UAAWvF,EAAcC,KACzBe,KAAMmH,IAEPhG,KAAKqD,SAASF,KAAK,CAClBC,UAAWvF,EAAcC,KACzB0D,MAAAA,KAKK1B,eAAeuB,GACtBA,EAAEE,kBACFvB,KAAKmG,SAAShD,KAAK,CAClBC,UAAWvF,EAAcC,KACzBsI,cAAe/E,IAITvB,cAAcuB,GACrBA,EAAEE,kBACFvB,KAAKqG,QAAQlD,KAAK,CACjBC,UAAWvF,EAAcC,KACzBsI,cAAe/E,IAITvB,gBAAgBuB,GACvBA,EAAEE,kBAOHzB,eACC,OAAOE,KAAKmB,SAObrB,mBACC,OAAOE,KAAKc,QAObhB,qBACCwG,EAAgBtG,KAAK8E,gBAAiB,oBAAqBjH,EAAcC,MACzEwI,EAAgBtG,KAAKgF,eAAgB,mBAAoBnH,EAAcC,MACvEyI,EAAqBvG,KAAKoE,YAAcpE,KAAKC,OAAQD,KAAKgF,eAAgBnH,EAAcC","sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tlabel: 'gov-form-file__label',\n\tinput: 'gov-form-file__input',\n\tlist: 'gov-form-file__list',\n\titem: 'gov-form-file__item',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept === 'string' && accept.length) {\n\t\treturn (\n\t\t\taccept\n\t\t\t\t.replace(/\\s/g, '')\n\t\t\t\t.split(',')\n\t\t\t\t.filter(accept => {\n\t\t\t\t\treturn new RegExp(accept.replace('*', '.*')).test(file.type)\n\t\t\t\t}).length > 0\n\t\t)\n\t} else {\n\t\treturn true\n\t}\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size / 1024)\n\treturn fileSize <= maxSize\n}\n","/*\n * File\n */\n\n$class: \".gov-form-file\";\n\n#{$class} {\n\t@include base();\n\t&__label .gov-form-label__label {\n\t\t@include reset-last-margin();\n\t}\n\t&__input {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\topacity: 0.0001;\n\t\tcursor: pointer;\n\t}\n\t&__attachments {\n\t\tmargin-top: rem-calc(16 0 0);\n\t}\n\t&__item {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: center;\n\t}\n\n\t// STATES\n\t@include parameter(\"disabled\") {\n\t\t#{$class} {\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\tpointer-events: none;\n\t\t\t\t* {\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"expanded\") {\n\t\t#{$class} {\n\t\t\t&__area {\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(32) rem-calc(22) rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t\ttransition: background-color $t ease-in-out;\n\t\t\t\twill-change: background-color;\n\t\t\t\t&.highlight {\n\t\t\t\t\tbackground-color: color(\"primary.200\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t}\n\t\t\t&__attachments {\n\t\t\t\tmargin: rem-calc(24 0 0);\n\t\t\t}\n\t\t}\n\n\t\t// STATES\n\t\t@include parameter(\"invalid\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t\t&__area {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t@include parameter(\"disabled\") {\n\t\t\t#{$class} {\n\t\t\t\t&__area {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t@include parameter(\"expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tpadding: rem-calc(32);\n\t\t\t\t}\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\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { FormFileClass } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { fileAcceptValidation, fileSizeValidation, formatBytes } from \"../../../utils/file.utils\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { GovFormFileEvent, GovFormFileItem } from \"./gov-form-file.types\"\n\n@Component({\n\ttag: \"gov-form-file\",\n\tstyleUrl: \"gov-form-file.scss\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({ attribute: \"display-attachments\" }) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({ attribute: \"max-file-size\" }) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({ attribute: \"error-size\" }) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({ attribute: \"error-accept\" }) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Description of the list of attachments\n\t */\n\t@Prop({ attribute: \"attachments-label\" }) readonly attachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: \"wcag-remove-label\" }) readonly wcagRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({ attribute: \"wcag-attachments-label\" }) readonly wcagAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({ eventName: \"gov-files\" }) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({ eventName: \"gov-add-file\" }) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({ eventName: \"gov-remove-file\" }) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\t@State() files: GovFormFileItem[] = []\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tthis.validateFiles(files)\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\t\t//this.inputRef.addEventListener('focus')\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"drop\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\n\t\t\tthis.areaRef.addEventListener(\"drop\", this.handleDrop.bind(this), false)\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: this.files,\n\t\t})\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.watchDisabled()\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\n\t\tthis.registerListeners()\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])} invalid={toBoolAttrIfDefined(this.invalid)} expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot />\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"} />\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.wcagAttachmentsLabel} wcag-label={this.wcagAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item wcag-remove-labelled-by={item.id} on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.wcagRemoveLabel.replace(\"{FILE_NAME}\", item.file.name)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize * 1024))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\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: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\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\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormFileClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormFileClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.fileId, this.wcagLabelledBy, FormFileClass.root)\n\t}\n}\n"]}
@@ -1,2 +0,0 @@
1
- import{r as e,c as t,h as r,H as o,g as i}from"./p-4af5e4f4.js";import{a}from"./p-561fa17b.js";import{v as s}from"./p-26acf964.js";import{S as g,c as p}from"./p-9144dde1.js";import{c as v}from"./p-24636c53.js";import{g as n,p as c}from"./p-3f37ddb6.js";import"./p-ff7365ae.js";import"./p-55500e5a.js";import"./p-03990da5.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-stepper-item{position:relative;display:block;width:100%}.gov-stepper-item__header{position:relative;width:100%}.gov-stepper-item__arrow{flex:0 0 auto;width:0.75rem;height:0.75rem}.gov-stepper-item__title{margin:0;padding:0;font-family:var(--gov-font-family, "Roboto", sans-serif);font-weight:400;box-sizing:border-box;display:flex;gap:1rem;align-items:baseline}.gov-stepper-item__prefix{display:flex;flex:0 0 auto;justify-content:center;align-items:center;border-radius:50%;text-align:center}.gov-stepper-item__prefix .gov-icon{width:45%;height:45%}.gov-stepper-item__name{display:flex;flex-direction:column}.gov-stepper-item__label{display:flex;gap:0.5rem;align-items:center}.gov-stepper-item__annot{color:var(--gov-color-secondary)}.gov-stepper-item__content>*:last-child{margin-bottom:0}.gov-stepper-item[variant=primary] .gov-stepper-item__header{color:var(--gov-wizzard-primary-color, var(--gov-color-primary-800))}.gov-stepper-item[variant=primary] .gov-stepper-item__prefix{background:var(--gov-wizzard-primary-indicator-bg, var(--gov-color-primary-300));color:var(--gov-wizzard-primary-indicator-color, var(--gov-color-primary-800))}.gov-stepper-item[variant=secondary] .gov-stepper-item__header{color:var(--gov-wizzard-secondary-color, var(--gov-color-secondary-700))}.gov-stepper-item[variant=secondary] .gov-stepper-item__prefix{background:var(--gov-wizzard-secondary-indicator-bg, var(--gov-color-secondary-400));color:var(--gov-wizzard-secondary-indicator-color, var(--gov-color-secondary-700))}.gov-stepper-item[variant=success] .gov-stepper-item__header{color:var(--gov-wizzard-success-color, var(--gov-color-success-500))}.gov-stepper-item[variant=success] .gov-stepper-item__prefix{background:var(--gov-wizzard-success-indicator-bg, var(--gov-color-success));color:var(--gov-wizzard-success-indicator-color, var(--gov-color-neutral-white))}.gov-stepper-item[variant=error] .gov-stepper-item__header{color:var(--gov-wizzard-error-color, var(--gov-color-error-500))}.gov-stepper-item[variant=error] .gov-stepper-item__prefix{background:var(--gov-wizzard-error-indicator-bg, var(--gov-color-error));color:var(--gov-wizzard-error-indicator-color, var(--gov-color-neutral-white))}.gov-stepper-item[variant=warning] .gov-stepper-item__header{color:var(--gov-wizzard-warning-color, var(--gov-color-warning-500))}.gov-stepper-item[variant=warning] .gov-stepper-item__prefix{background:var(--gov-wizzard-warning-indicator-bg, var(--gov-color-warning));color:var(--gov-wizzard-warning-indicator-color, var(--gov-color-neutral-white))}.gov-stepper-item::before{content:"";position:absolute;display:block;width:0.125rem}.gov-stepper-item:last-child::before{content:none}.gov-stepper-item[variant=primary]::before{background:var(--gov-wizzard-primary-indicator-bg, var(--gov-color-primary-300))}.gov-stepper-item[variant=secondary]::before{background:var(--gov-wizzard-secondary-indicator-bg, var(--gov-color-secondary-400))}.gov-stepper-item[variant=success]::before{background:var(--gov-wizzard-success-indicator-bg, var(--gov-color-success))}.gov-stepper-item[variant=error]::before{background:var(--gov-wizzard-error-indicator-bg, var(--gov-color-error))}.gov-stepper-item[variant=warning]::before{background:var(--gov-wizzard-warning-indicator-bg, var(--gov-color-warning))}.gov-stepper-item[size=xs]{min-height:calc(var(--gov-stepper-xs-indicator-size, 1.5rem) + 3 * var(--gov-stepper-xs-connect-gap, 0.5rem))}.gov-stepper-item[size=xs]::before{top:calc(var(--gov-stepper-xs-indicator-size, 1.5rem) + var(--gov-stepper-xs-connect-gap, 0.5rem));bottom:var(--gov-stepper-xs-connect-gap, 0.5rem);left:calc((var(--gov-stepper-xs-indicator-size, 1.5rem) - 0.125rem) / 2)}.gov-stepper-item[size=xs]:last-child{min-height:0}.gov-stepper-item[size=xs] .gov-stepper-item__title{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-stepper-item[size=xs] .gov-stepper-item__annot{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing)}.gov-stepper-item[size=xs] .gov-stepper-item__prefix{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);width:var(--gov-stepper-xs-indicator-size, 1.5rem);height:var(--gov-stepper-xs-indicator-size, 1.5rem);box-shadow:0 0 0 var(--gov-stepper-xs-connect-gap, 0.5rem) var(--gov-color-neutral-white)}.gov-stepper-item[size=xs] .gov-stepper-item__content{padding:var(--gov-stepper-xs-content-padding, 1rem 1rem 2rem 2.5rem)}.gov-stepper-item--w-annot[size=xs]{min-height:calc(var(--gov-stepper-xs-indicator-size, 1.5rem) * 1.5 + 3 * var(--gov-stepper-xs-connect-gap, 0.5rem))}.gov-stepper-item[size=s]{min-height:calc(var(--gov-stepper-s-indicator-size, 2rem) + 3 * var(--gov-stepper-s-connect-gap, 1rem))}.gov-stepper-item[size=s]::before{top:calc(var(--gov-stepper-s-indicator-size, 2rem) + var(--gov-stepper-s-connect-gap, 1rem));bottom:var(--gov-stepper-s-connect-gap, 1rem);left:calc((var(--gov-stepper-s-indicator-size, 2rem) - 0.125rem) / 2)}.gov-stepper-item[size=s]:last-child{min-height:0}.gov-stepper-item[size=s] .gov-stepper-item__title{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing)}.gov-stepper-item[size=s] .gov-stepper-item__annot{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-stepper-item[size=s] .gov-stepper-item__prefix{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);width:var(--gov-stepper-s-indicator-size, 2rem);height:var(--gov-stepper-s-indicator-size, 2rem);box-shadow:0 0 0 var(--gov-stepper-s-connect-gap, 1rem) var(--gov-color-neutral-white)}.gov-stepper-item[size=s] .gov-stepper-item__content{padding:var(--gov-stepper-s-content-padding, 1rem 1rem 2rem 3rem)}.gov-stepper-item--w-annot[size=s]{min-height:calc(var(--gov-stepper-s-indicator-size, 2rem) * 1.5 + 3 * var(--gov-stepper-s-connect-gap, 1rem))}.gov-stepper-item[size=m]{min-height:calc(var(--gov-stepper-m-indicator-size, 2.5rem) + 3 * var(--gov-stepper-m-connect-gap, 1rem))}.gov-stepper-item[size=m]::before{top:calc(var(--gov-stepper-m-indicator-size, 2.5rem) + var(--gov-stepper-m-connect-gap, 1rem));bottom:var(--gov-stepper-m-connect-gap, 1rem);left:calc((var(--gov-stepper-m-indicator-size, 2.5rem) - 0.125rem) / 2)}.gov-stepper-item[size=m]:last-child{min-height:0}.gov-stepper-item[size=m] .gov-stepper-item__title{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing)}.gov-stepper-item[size=m] .gov-stepper-item__annot{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-stepper-item[size=m] .gov-stepper-item__prefix{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);width:var(--gov-stepper-m-indicator-size, 2.5rem);height:var(--gov-stepper-m-indicator-size, 2.5rem);box-shadow:0 0 0 var(--gov-stepper-m-connect-gap, 1rem) var(--gov-color-neutral-white)}.gov-stepper-item[size=m] .gov-stepper-item__content{padding:var(--gov-stepper-m-content-padding, 1rem 1rem 2rem 3.5rem)}.gov-stepper-item--w-annot[size=m]{min-height:calc(var(--gov-stepper-m-indicator-size, 2.5rem) * 1.5 + 3 * var(--gov-stepper-m-connect-gap, 1rem))}';const l=class{constructor(r){e(this,r);this.govChange=t(this,"gov-change",7);this.isExpandedState=undefined;this.variant="primary";this.size="m";this.identifier=undefined;this.label=undefined;this.annotation=undefined;this.triggerTag="h3";this.h=n(this.host);this.triggerId=v("GovStepperItem");this.contentId=v("GovStepperContent")}validateLabel(e){if(!e){a(`[${g.root}]: Parameter label is required.`)}}validateTriggerTag(e){const t=["h1","h2","h3","h4","h5","h6","span"];if(e){if(!t.includes(e)){a(`[${g.root}]: Tag ${e} is not allowed.`)}}}validateVariant(e){s(p,e,g.root)}componentWillLoad(){this.validateLabel(this.label);this.validateVariant(this.variant);this.validateTriggerTag(this.triggerTag)}render(){const e=this.identifier||this.triggerId;const t=this.contentId;const{label:i}=this;const a=this.triggerTag;return r(o,{class:c([g.root,this.annotation&&g.rootWithAnnot]),variant:this.variant},r("div",{id:e,class:g.header,role:"listitem"},r(a,{class:g.title},this.h.hasSlot("prefix")&&r("span",{class:g.prefix},r("slot",{name:"prefix"})),r("span",{class:g.name},r("span",{class:g.label},i),this.annotation&&r("span",{class:g.annot},this.annotation)))),this.h.hasSlot("content")&&r("div",{class:g.content,id:t,"aria-labelledby":e,role:"tabpanel"},r("slot",{name:"content"})))}async currentState(){return this.isExpandedState}get host(){return i(this)}static get watchers(){return{label:["validateLabel"],triggerTag:["validateTriggerTag"],variant:["validateVariant"]}}};l.style=m;export{l as gov_stepper_item};
2
- //# sourceMappingURL=p-d389c001.entry.js.map