@gov-design-system-ce/components 0.0.45 → 0.0.46

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 (44) hide show
  1. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +4 -3
  2. package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
  3. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  4. package/dist/cjs/gov-wizzard-item.cjs.entry.js +5 -1
  5. package/dist/cjs/gov-wizzard-item.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gov-wizzard.cjs.entry.js +8 -6
  7. package/dist/cjs/gov-wizzard.cjs.entry.js.map +1 -1
  8. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +4 -3
  9. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
  10. package/dist/collection/components/gov-wizzard/gov-wizzard-item.js +5 -1
  11. package/dist/collection/components/gov-wizzard/gov-wizzard-item.js.map +1 -1
  12. package/dist/collection/components/gov-wizzard/gov-wizzard.js +16 -14
  13. package/dist/collection/components/gov-wizzard/gov-wizzard.js.map +1 -1
  14. package/dist/components/gov-form-autocomplete2.js +4 -3
  15. package/dist/components/gov-form-autocomplete2.js.map +1 -1
  16. package/dist/components/gov-icon2.js +1 -1
  17. package/dist/components/gov-wizzard-item.js +5 -1
  18. package/dist/components/gov-wizzard-item.js.map +1 -1
  19. package/dist/components/gov-wizzard.js +8 -6
  20. package/dist/components/gov-wizzard.js.map +1 -1
  21. package/dist/core/core.esm.js +1 -1
  22. package/dist/core/{p-f656fffe.entry.js → p-06ed5529.entry.js} +2 -2
  23. package/dist/core/p-06ed5529.entry.js.map +1 -0
  24. package/dist/core/{p-df223dfd.entry.js → p-220f189d.entry.js} +2 -2
  25. package/dist/core/p-220f189d.entry.js.map +1 -0
  26. package/dist/core/{p-65aa3b0c.entry.js → p-25e53e01.entry.js} +2 -2
  27. package/dist/core/p-25e53e01.entry.js.map +1 -0
  28. package/dist/core/{p-8021c562.entry.js → p-5ffa24e9.entry.js} +2 -2
  29. package/dist/custom-elements/index.js +1 -1
  30. package/dist/custom-elements/index.js.map +1 -1
  31. package/dist/esm/gov-form-autocomplete.entry.js +4 -3
  32. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  33. package/dist/esm/gov-icon.entry.js +1 -1
  34. package/dist/esm/gov-wizzard-item.entry.js +5 -1
  35. package/dist/esm/gov-wizzard-item.entry.js.map +1 -1
  36. package/dist/esm/gov-wizzard.entry.js +8 -6
  37. package/dist/esm/gov-wizzard.entry.js.map +1 -1
  38. package/dist/hydrate/index.js +17 -10
  39. package/dist/types/components/gov-wizzard/gov-wizzard.d.ts +3 -3
  40. package/package.json +1 -1
  41. package/dist/core/p-65aa3b0c.entry.js.map +0 -1
  42. package/dist/core/p-df223dfd.entry.js.map +0 -1
  43. package/dist/core/p-f656fffe.entry.js.map +0 -1
  44. /package/dist/core/{p-8021c562.entry.js.map → p-5ffa24e9.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/core/src/components/gov-wizzard/gov-wizzard-item.scss?tag=gov-wizzard-item","../../../packages/core/src/components/gov-wizzard/gov-wizzard-item.tsx"],"names":["govWizzardItemCss","Tags","GovWizzardItem","[object Object]","hostRef","this","h","govHost","host","triggerId","createID","contentId","newValue","govErrorLog","WizzardItemClass","root","validTags","includes","validateProp","WizardVariants","govChange","emit","expanded","isExpanded","component","validateLabel","label","validateVariant","variant","validateTriggerTag","labelTag","identifier","LabelTag","Tag","collapsible","BUTTON","DIV","prefixSlot","hasSlot","class","prefix","name","title","arrow","annotation","annot","Host","classes","is-expanded","size","role","Fragment","id","header","aria-expanded","booleanString","aria-controls","disabled","aria-disabled","toBoolAttrIfDefined","onClick","e","preventDefault","stopPropagation","toggle","content","aria-hidden","hidden","aria-labelledby","emmitChange"],"mappings":"qXAAA,MAAMA,EAAoB,00SCU1B,IAAKC,GAAL,SAAKA,GACJA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\";\n$class: \".gov-wizzard-item\";\n\n#{$class} {\n\t@include wizzard-item-core;\n\tmargin-bottom: rem-calc(16);\n\tbackground: $wizzard-bg-color;\n\t&__header {\n\t\t@include focus-outline();\n\t\tgap: rem-calc(16);\n\t\tpadding: rem-calc(16);\n\t\tborder-radius: 0;\n\t\ttext-align: left;\n\t\ttransition: $t linear color;\n\t}\n\t&__prefix {\n\t\tposition: absolute;\n\t\tleft: rem-calc(16);\n\t}\n\n\t// STATES\n\t&__header[aria-expanded=\"true\"] {\n\t\t#{$class}__label {\n\t\t\t.gov-icon {\n\t\t\t\ttransform: scale(-1);\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t&[size=\"#{$size-xs}\"],\n\t&[size=\"#{$size-s}\"],\n\t&[size=\"#{$size-m}\"] {\n\t\t#{$class} {\n\t\t\t&__title {\n\t\t\t\t@include typography(deep-map-get($wizzard-sizes, $size-xs, \"font-size\"));\n\t\t\t}\n\t\t\t&__annot {\n\t\t\t\t@include typography(deep-map-get($wizzard-sizes, $size-xs, \"font-size-annot\"));\n\t\t\t}\n\t\t\t&__prefix {\n\t\t\t\t@include typography(deep-map-get($wizzard-sizes, $size-xs, \"font-size-indicator\"));\n\t\t\t\twidth: deep-map-get($wizzard-sizes, $size-xs, \"indicator-size\");\n\t\t\t\theight: deep-map-get($wizzard-sizes, $size-xs, \"indicator-size\");\n\t\t\t\ttop: deep-map-get($wizzard-sizes, $size-xs, \"top\");\n\t\t\t\t+ #{$class}__header {\n\t\t\t\t\tpadding: deep-map-get($wizzard-sizes, $size-xs, \"header-padding\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__content {\n\t\t\t\tpadding: $wizzard-content-padding;\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $definitions in $wizzard-core-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t@include parameter(\"collapsible\") {\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__header {\n\t\t\t\t\t\t@include hover() {\n\t\t\t\t\t\t\tcolor: get(\"hover-color\", $definitions);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// HOVERS\n\t@at-root button#{&}__header {\n\t\t@include button-core();\n\t\tjustify-content: flex-start;\n\t\ttext-align: left;\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t&[size=\"#{$size-s}\"],\n\t\t&[size=\"#{$size-m}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__title {\n\t\t\t\t\t@include typography(deep-map-get($wizzard-sizes, $size-s, \"font-size\"));\n\t\t\t\t}\n\t\t\t\t&__prefix {\n\t\t\t\t\t@include typography(deep-map-get($wizzard-sizes, $size-s, \"font-size-indicator\"));\n\t\t\t\t\twidth: deep-map-get($wizzard-sizes, $size-s, \"indicator-size\");\n\t\t\t\t\theight: deep-map-get($wizzard-sizes, $size-s, \"indicator-size\");\n\t\t\t\t\ttop: deep-map-get($wizzard-sizes, $size-s, \"top\");\n\t\t\t\t\t+ #{$class}__header {\n\t\t\t\t\t\tpadding: deep-map-get($wizzard-sizes, $size-s, \"header-padding\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t@include mq($from: md) {\n\t\t&[size=\"#{$size-m}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__title {\n\t\t\t\t\t@include typography(deep-map-get($wizzard-sizes, $size-m, \"font-size\"));\n\t\t\t\t}\n\t\t\t\t&__prefix {\n\t\t\t\t\t@include typography(deep-map-get($wizzard-sizes, $size-m, \"font-size-indicator\"));\n\t\t\t\t\twidth: deep-map-get($wizzard-sizes, $size-m, \"indicator-size\");\n\t\t\t\t\theight: deep-map-get($wizzard-sizes, $size-m, \"indicator-size\");\n\t\t\t\t\ttop: deep-map-get($wizzard-sizes, $size-m, \"top\");\n\t\t\t\t\t+ #{$class}__header {\n\t\t\t\t\t\tpadding: deep-map-get($wizzard-sizes, $size-m, \"header-padding\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t@each $size, $definitions in $wizzard-sizes {\n\t\t\t&[size=\"#{$size}\"] {\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__content {\n\t\t\t\t\t\tpadding: get(\"content-padding\", $definitions);\n\t\t\t\t\t}\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, Watch } from \"@stencil/core\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { WizardSizesType, WizardVariants, WizardVariantsType, WizzardItemClass } from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { booleanString, govHost, toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { WizzardItemEvent } from \"./gov-wizzard-item.types\"\nimport Fragment from \"../../helpers/Fragment\"\n\nenum Tags {\n\tDIV = \"div\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-wizzard-item\",\n\tstyleUrl: \"gov-wizzard-item.scss\",\n})\nexport class GovWizzardItem {\n\tprivate h: GovHost\n\tprivate readonly triggerId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.triggerId = createID(\"GovWizzardItem\")\n\t\tthis.contentId = createID(\"GovWizzardContent\")\n\t}\n\n\t@Element() readonly host: HTMLGovWizzardItemElement\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant?: WizardVariantsType = \"primary\"\n\t/**\n\t * Size of wizzard\n\t */\n\t@Prop() readonly size?: WizardSizesType = \"m\"\n\t/**\n\t * Custom wizzard item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Defines weather the wizzard item can be collapsible\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Item annotation of the wizzard\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Item label of the wizzard\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Makes the wizzard component disabled.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by default\n\t */\n\t@Prop({ attribute: \"is-expanded\", mutable: true }) isExpanded = false\n\t/**\n\t * Used to change the HTML tag in the accordion trigger for correct semantic structure\n\t */\n\t@Prop({ attribute: \"label-tag\" }) readonly labelTag: string = \"h3\"\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<WizzardItemEvent>\n\n\t@Watch(\"label\")\n\tprivate validateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${WizzardItemClass.root}]: Parameter label is required.`)\n\t\t}\n\t}\n\n\t@Watch(\"labelTag\")\n\tprivate validateTriggerTag(newValue: string): void {\n\t\tconst validTags = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"span\"]\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${WizzardItemClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch(\"variant\")\n\tprivate validateVariant(newValue: string): void {\n\t\tvalidateProp(WizardVariants, newValue, WizzardItemClass.root)\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govChange.emit({ expanded: this.isExpanded, component: WizzardItemClass.root })\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateLabel(this.label)\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateTriggerTag(this.labelTag)\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst LabelTag = this.labelTag\n\t\tconst Tag = this.collapsible ? Tags.BUTTON : Tags.DIV\n\t\tconst prefixSlot = this.h.hasSlot(\"prefix\") && (<span class={WizzardItemClass.prefix}><slot name=\"prefix\" /></span>)\n\n\t\tconst label = (\n\t\t\t<LabelTag class={WizzardItemClass.title}>\n\t\t\t\t<span class={WizzardItemClass.name}>\n\t\t\t\t\t<span class={WizzardItemClass.label}>\n\t\t\t\t\t\t<span>{this.label}</span>\n\t\t\t\t\t\t{this.collapsible && <gov-icon class={WizzardItemClass.arrow} name=\"chevron-down\"></gov-icon>}\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{this.annotation && <span class={WizzardItemClass.annot}>{this.annotation}</span>}\n\t\t\t\t</span>\n\t\t\t</LabelTag>\n\t\t)\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(WizzardItemClass.root)} is-expanded={this.isExpanded} variant={this.variant} size={this.size} role=\"listitem\" collapsible={this.collapsible}>\n\t\t\t\t{this.collapsible ? (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{prefixSlot}\n\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\tid={triggerId}\n\t\t\t\t\t\t\tclass={WizzardItemClass.header}\n\t\t\t\t\t\t\taria-expanded={booleanString(this.isExpanded)}\n\t\t\t\t\t\t\taria-controls={this.contentId}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\t\tthis.collapsible ? this.toggle() : false\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</Tag>\n\t\t\t\t\t</Fragment>\n\t\t\t\t) : (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{prefixSlot}\n\t\t\t\t\t\t<div class={WizzardItemClass.header}>{label}</div>\n\t\t\t\t\t</Fragment>\n\t\t\t\t)}\n\t\t\t\t{this.collapsible ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={WizzardItemClass.content}\n\t\t\t\t\t\tid={this.contentId}\n\t\t\t\t\t\taria-hidden={booleanString(!this.isExpanded)}\n\t\t\t\t\t\thidden={!this.isExpanded}\n\t\t\t\t\t\taria-labelledby={triggerId}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div class={WizzardItemClass.content} aria-hidden={booleanString(!this.isExpanded)} hidden={!this.isExpanded}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Opening the Wizzard\n\t */\n\t@Method()\n\tasync open(): Promise<void> {\n\t\tthis.isExpanded = true\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Closing the Wizzard\n\t */\n\t@Method()\n\tpublic async close(): Promise<void> {\n\t\tthis.isExpanded = false\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Wizzard switch\n\t */\n\t@Method()\n\tpublic async toggle(): Promise<void> {\n\t\tthis.isExpanded = !this.isExpanded\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tpublic async currentState(): Promise<boolean> {\n\t\treturn this.isExpanded\n\t}\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as s,c as i,h as t,H as a,g as o}from"./p-4af5e4f4.js";import{v as e}from"./p-26acf964.js";import{W as r,a as n,b as p}from"./p-64ced668.js";import{g as m}from"./p-3f37ddb6.js";import{v as c}from"./p-0f5e2b0a.js";import{c as d}from"./p-34152b51.js";import{d as f}from"./p-03990da5.js";import"./p-561fa17b.js";import"./p-ff7365ae.js";import"./p-55500e5a.js";import"./p-24636c53.js";const h=".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-wizzard{position:relative;display:block;width:100%}.gov-wizzard>*:last-child{margin-bottom:0}";const l=class{constructor(t){s(this,t);this.govChange=i(this,"gov-change",7);this.size="m";this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.h=m(this.host)}validateSize(s){e(p,s,n.root)}componentWillLoad(){this.validateSize(this.size)}componentDidLoad(){this.host.querySelectorAll(r.root).forEach((s=>{s.setAttribute("size",this.size);s.addEventListener("gov-change",(s=>{s.stopPropagation();this.govChange.emit(s.detail)}))}))}async componentDidRender(){if(d()){await f(500);await this.validateWcag()}}render(){return t(a,{class:this.h.classes(n.root),role:"list",size:this.size},t("slot",null))}async validateWcag(){c(this.wcagLabel,this.wcagLabelledBy,n.root)}get host(){return o(this)}static get watchers(){return{size:["validateSize"]}}};l.style=h;export{l as gov_wizzard};
2
- //# sourceMappingURL=p-65aa3b0c.entry.js.map
1
+ import{r as s,c as i,h as t,H as a,g as o}from"./p-4af5e4f4.js";import{v as e}from"./p-26acf964.js";import{W as r,a as n,b as p}from"./p-64ced668.js";import{g as m}from"./p-3f37ddb6.js";import{v as c}from"./p-0f5e2b0a.js";import{c as d}from"./p-34152b51.js";import{d as f}from"./p-03990da5.js";import"./p-561fa17b.js";import"./p-ff7365ae.js";import"./p-55500e5a.js";import"./p-24636c53.js";const h=".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-wizzard{position:relative;display:block;width:100%}.gov-wizzard>*:last-child{margin-bottom:0}";const l=class{constructor(t){s(this,t);this.govChange=i(this,"gov-change",7);this.size="m";this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.h=m(this.host)}validateSize(s){e(p,s,n.root)}componentWillLoad(){this.validateSize(this.size)}componentDidLoad(){this.host.querySelectorAll(r.root).forEach((s=>{s.setAttribute("size",this.size)}))}async componentDidRender(){if(d()){await f(500);await this.validateWcag()}}render(){return t(a,{class:this.h.classes(n.root),role:"list",size:this.size},t("slot",null))}async validateWcag(){c(this.wcagLabel,this.wcagLabelledBy,n.root)}get host(){return o(this)}static get watchers(){return{size:["validateSize"]}}};l.style=h;export{l as gov_wizzard};
2
+ //# sourceMappingURL=p-25e53e01.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/core/src/components/gov-wizzard/gov-wizzard.scss?tag=gov-wizzard","../../../packages/core/src/components/gov-wizzard/gov-wizzard.tsx"],"names":["govWizzardCss","GovWizzard","[object Object]","hostRef","this","h","govHost","host","newValue","validateProp","WizardSizes","WizzardClass","root","validateSize","size","querySelectorAll","WizzardItemClass","forEach","child","setAttribute","canValidateWcagOnRender","delay","validateWcag","Host","class","classes","role","validateWcagLabel","wcagLabel","wcagLabelledBy"],"mappings":"sYAAA,MAAMA,EAAgB,icCcTC,EAAU,MAKtBC,YAAAC,6DAO0C,2DANzCC,KAAKC,EAAIC,EAAQF,KAAKG,MAqBfL,aAAaM,GACpBC,EAAaC,EAAaF,EAAUG,EAAaC,MAGlDV,oBACCE,KAAKS,aAAaT,KAAKU,MAGxBZ,mBACCE,KAAKG,KAAKQ,iBAAiBC,EAAiBJ,MAAMK,SAASC,IAC1DA,EAAMC,aAAa,OAAQf,KAAKU,SAUlCZ,2BACC,GAAIkB,IAA2B,OACxBC,EAAM,WACNjB,KAAKkB,gBAIbpB,SACC,OACCG,EAACkB,EAAI,CAACC,MAAOpB,KAAKC,EAAEoB,QAAQd,EAAaC,MAAOc,KAAK,OAAOZ,KAAMV,KAAKU,MACtET,EAAA,OAAA,OASIH,qBACNyB,EAAkBvB,KAAKwB,UAAWxB,KAAKyB,eAAgBlB,EAAaC","sourcesContent":["/*\n * Wizzard\n */\n\n$class: \".gov-wizzard\";\n\n#{$class} {\n\t@include base();\n\t@include reset-last-margin();\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { WizardSizes, WizardSizesType, WizzardClass, WizzardItemClass } from \"./constants\"\nimport { GovWizzardItemChangeEvent } from \"./gov-wizzard-item.d\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateWcagLabel } from \"../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../helpers/Dom/win\"\nimport { delay } from \"../../utils/utils\"\n\n@Component({\n\ttag: \"gov-wizzard\",\n\tstyleUrl: \"gov-wizzard.scss\",\n})\nexport class GovWizzard {\n\tprivate h: GovHost\n\n\t@Element() readonly host: HTMLGovWizzardElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t/**\n\t * Size of wizzard\n\t */\n\t@Prop() readonly size?: WizardSizesType = \"m\"\n\t/**\n\t * Adds accessible label for the wizzard that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Called when the wizzard children state changes\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<GovWizzardItemChangeEvent>\n\n\t@Watch(\"size\")\n\tprivate validateSize(newValue: string): void {\n\t\tvalidateProp(WizardSizes, newValue, WizzardClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateSize(this.size)\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.host.querySelectorAll(WizzardItemClass.root).forEach((child: HTMLGovWizzardItemElement) => {\n\t\t\tchild.setAttribute(\"size\", this.size)\n\t\t\t/*\n\t\t\tchild.addEventListener('gov-change', (e: GovWizzardItemCustomEvent<GovWizzardItemChangeEvent>) => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.govChange.emit(e.detail)\n\t\t\t})\n\t\t\t*/\n\t\t})\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(WizzardClass.root)} role=\"list\" size={this.size}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tpublic async validateWcag(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, WizzardClass.root)\n\t}\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{a as t,r as s,h as i,H as n,g as o}from"./p-4af5e4f4.js";import{i as e}from"./p-34152b51.js";import{g as a}from"./p-3f37ddb6.js";import"./p-03990da5.js";var r;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(r||(r={}));const c={root:"gov-icon",holder:"gov-icon__holder"};const h="0.0.45";const l=()=>h;const p={};const f={};const d=t=>t.startsWith("http://")||t.startsWith("https://");const u=(s,i,n)=>{if(d(s)){return`${s}/${n}/${i}.svg?v=${l()}`}return t(`${s}/${n}/${i}.svg`)+`?v=${l()}`};async function g({name:t,type:s}){if(p[t]){return p[t]}if(!f[t]){f[t]=fetch(u(e(),t,s)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const i=await f[t];p[t]=i;return i}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-icon{display:inline-flex}.gov-icon__holder,.gov-icon svg{display:inline-flex;width:100%;height:100%}";const y=class{constructor(t){s(this,t);this.name=null;this.type="basic";this.iconData=undefined;this.visible=false;this.error=false;this.h=a(this.host)}async loadIconPathData(){const{name:t,visible:s,type:i}=this;if(!t||!s){return}try{this.iconData=await g({name:t,type:i})}catch(t){this.error=true}}connectedCallback(){this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}disconnectedCallback(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((s=>{s.forEach((s=>{if(s.isIntersecting){this.intersectionObserver.disconnect();this.intersectionObserver=null;t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}render(){if(this.error){return null}return i(n,{class:this.h.classes(c.root)},i("span",{class:c.holder,innerHTML:this.iconData}))}static get assetsDirs(){return["assets"]}get host(){return o(this)}static get watchers(){return{name:["loadIconPathData"]}}};y.style=m;export{y as gov_icon};
2
- //# sourceMappingURL=p-8021c562.entry.js.map
1
+ import{a as t,r as s,h as i,H as n,g as o}from"./p-4af5e4f4.js";import{i as e}from"./p-34152b51.js";import{g as a}from"./p-3f37ddb6.js";import"./p-03990da5.js";var r;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(r||(r={}));const c={root:"gov-icon",holder:"gov-icon__holder"};const h="0.0.46";const l=()=>h;const p={};const f={};const d=t=>t.startsWith("http://")||t.startsWith("https://");const u=(s,i,n)=>{if(d(s)){return`${s}/${n}/${i}.svg?v=${l()}`}return t(`${s}/${n}/${i}.svg`)+`?v=${l()}`};async function g({name:t,type:s}){if(p[t]){return p[t]}if(!f[t]){f[t]=fetch(u(e(),t,s)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const i=await f[t];p[t]=i;return i}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-icon{display:inline-flex}.gov-icon__holder,.gov-icon svg{display:inline-flex;width:100%;height:100%}";const y=class{constructor(t){s(this,t);this.name=null;this.type="basic";this.iconData=undefined;this.visible=false;this.error=false;this.h=a(this.host)}async loadIconPathData(){const{name:t,visible:s,type:i}=this;if(!t||!s){return}try{this.iconData=await g({name:t,type:i})}catch(t){this.error=true}}connectedCallback(){this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}disconnectedCallback(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((s=>{s.forEach((s=>{if(s.isIntersecting){this.intersectionObserver.disconnect();this.intersectionObserver=null;t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}render(){if(this.error){return null}return i(n,{class:this.h.classes(c.root)},i("span",{class:c.holder,innerHTML:this.iconData}))}static get assetsDirs(){return["assets"]}get host(){return o(this)}static get watchers(){return{name:["loadIconPathData"]}}};y.style=m;export{y as gov_icon};
2
+ //# sourceMappingURL=p-5ffa24e9.entry.js.map