@gov-design-system-ce/components 0.0.59 → 0.0.61
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.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-app.cjs.entry.js +78 -0
- package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/gov-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +15 -15
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +0 -17
- package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +29 -24
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +18 -17
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +2 -2
- package/dist/cjs/gov-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-infobar.cjs.entry.js +1 -1
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-stepper-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-toast.cjs.entry.js +4 -1
- package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-wizard-item.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.css +0 -2
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +23 -22
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +4 -3
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
- package/dist/collection/components/gov-form/control/gov-form-control.js +0 -17
- package/dist/collection/components/gov-form/control/gov-form-control.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +3 -2
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.js +3 -2
- package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +48 -3
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +86 -25
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/radio/gov-form-radio.js +3 -2
- package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.css +48 -0
- package/dist/collection/components/gov-form/select/gov-form-select.js +38 -19
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.js +4 -3
- package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
- package/dist/collection/components/gov-icon/gov-icon.css +2 -0
- package/dist/collection/components/gov-infobar/default/gov-infobar.css +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.css +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper-item.css +1 -0
- package/dist/collection/components/gov-toast/gov-toast.js +4 -1
- package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard-item.css +1 -3
- package/dist/collection/data/color-definitions.js +307 -0
- package/dist/collection/data/font-definitions.js +94 -0
- package/dist/collection/pages/Forms.js +75 -0
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Stepper.js +3 -0
- package/dist/collection/pages/Stepper.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-app.js +1 -1
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-dropdown.js +1 -1
- package/dist/components/gov-dropdown.js.map +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-checkbox.js.map +1 -1
- package/dist/components/gov-form-control.js +1 -1
- package/dist/components/gov-form-control.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-radio.js.map +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-form-switch.js.map +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-infobar.js.map +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-stepper-item.js +1 -1
- package/dist/components/gov-stepper-item.js.map +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-toast.js.map +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard-item.js.map +1 -1
- package/dist/components/p-522dd298.js +2 -0
- package/dist/components/{p-afb7fc88.js.map → p-522dd298.js.map} +1 -1
- package/dist/components/{p-5d8154f9.js → p-94542a50.js} +2 -2
- package/dist/components/p-94542a50.js.map +1 -0
- package/dist/components/{p-ae179d8a.js → p-9ba6e755.js} +2 -2
- package/dist/components/{p-e24896b9.js → p-b3cb7945.js} +2 -2
- package/dist/components/p-bc5d5903.js +2 -0
- package/dist/components/p-bc5d5903.js.map +1 -0
- package/dist/components/{p-30af8d08.js → p-f72ecbef.js} +2 -2
- package/dist/components/p-f72ecbef.js.map +1 -0
- package/dist/core/core.css +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-f9dfaff1.entry.js → p-0553eb92.entry.js} +2 -2
- package/dist/core/{p-f9dfaff1.entry.js.map → p-0553eb92.entry.js.map} +1 -1
- package/dist/core/{p-cb37644f.entry.js → p-19a54ee9.entry.js} +2 -2
- package/dist/core/p-19a54ee9.entry.js.map +1 -0
- package/dist/core/p-19b897c0.entry.js +2 -0
- package/dist/core/p-19b897c0.entry.js.map +1 -0
- package/dist/core/{p-73fb7ac7.entry.js → p-1c40fdd5.entry.js} +2 -2
- package/dist/core/p-1c40fdd5.entry.js.map +1 -0
- package/dist/core/{p-fea58abc.entry.js → p-28f39f69.entry.js} +2 -2
- package/dist/core/p-28f39f69.entry.js.map +1 -0
- package/dist/core/{p-2c0ac7ab.entry.js → p-35c1c12c.entry.js} +2 -2
- package/dist/core/p-35c1c12c.entry.js.map +1 -0
- package/dist/core/p-80f5140b.entry.js +2 -0
- package/dist/core/{p-2944bf77.entry.js.map → p-80f5140b.entry.js.map} +1 -1
- package/dist/core/p-84f6b11a.entry.js +2 -0
- package/dist/core/{p-0c769f1a.entry.js.map → p-84f6b11a.entry.js.map} +1 -1
- package/dist/core/p-a7719b55.entry.js +2 -0
- package/dist/core/p-a7719b55.entry.js.map +1 -0
- package/dist/core/{p-ce262a72.entry.js → p-acd6a9f4.entry.js} +2 -2
- package/dist/core/p-acd6a9f4.entry.js.map +1 -0
- package/dist/core/p-bc6f1479.entry.js +2 -0
- package/dist/core/p-bc6f1479.entry.js.map +1 -0
- package/dist/core/p-c5d3efc2.entry.js +2 -0
- package/dist/core/{p-f8252fea.entry.js.map → p-c5d3efc2.entry.js.map} +1 -1
- package/dist/core/{p-307d4c56.entry.js → p-d84b290e.entry.js} +2 -2
- package/dist/core/{p-307d4c56.entry.js.map → p-d84b290e.entry.js.map} +1 -1
- package/dist/core/{p-49729bd4.entry.js → p-e2d6efaf.entry.js} +2 -2
- package/dist/core/p-e2d6efaf.entry.js.map +1 -0
- package/dist/core/{p-ff97a688.entry.js → p-e5227e40.entry.js} +2 -2
- package/dist/core/{p-ff97a688.entry.js.map → p-e5227e40.entry.js.map} +1 -1
- package/dist/core/p-f62efc34.entry.js +2 -0
- package/dist/core/p-f62efc34.entry.js.map +1 -0
- package/dist/core/{p-8667d5df.entry.js → p-fab698a7.entry.js} +2 -2
- package/dist/core/p-fab698a7.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-app.entry.js +78 -0
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-dropdown.entry.js +1 -1
- package/dist/esm/gov-dropdown.entry.js.map +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +15 -15
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +2 -2
- package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
- package/dist/esm/gov-form-control.entry.js +0 -17
- package/dist/esm/gov-form-control.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +1 -1
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-input.entry.js +1 -1
- package/dist/esm/gov-form-input.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +29 -24
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +1 -1
- package/dist/esm/gov-form-radio.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +18 -17
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-form-switch.entry.js +2 -2
- package/dist/esm/gov-form-switch.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +2 -2
- package/dist/esm/gov-icon.entry.js.map +1 -1
- package/dist/esm/gov-infobar.entry.js +1 -1
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/gov-pagination.entry.js +1 -1
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-stepper-item.entry.js +1 -1
- package/dist/esm/gov-stepper-item.entry.js.map +1 -1
- package/dist/esm/gov-toast.entry.js +4 -1
- package/dist/esm/gov-toast.entry.js.map +1 -1
- package/dist/esm/gov-wizard-item.entry.js +1 -1
- package/dist/esm/gov-wizard-item.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +159 -85
- package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +3 -3
- package/dist/types/components/gov-form/control/gov-form-control.d.ts +0 -1
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +15 -3
- package/dist/types/components/gov-form/select/gov-form-select.d.ts +7 -3
- package/dist/types/components.d.ts +32 -0
- package/package.json +2 -2
- package/dist/components/p-30af8d08.js.map +0 -1
- package/dist/components/p-5d8154f9.js.map +0 -1
- package/dist/components/p-afb7fc88.js +0 -2
- package/dist/components/p-b430ee05.js +0 -2
- package/dist/components/p-b430ee05.js.map +0 -1
- package/dist/core/p-0c769f1a.entry.js +0 -2
- package/dist/core/p-243a61bf.entry.js +0 -2
- package/dist/core/p-243a61bf.entry.js.map +0 -1
- package/dist/core/p-2944bf77.entry.js +0 -2
- package/dist/core/p-2c0ac7ab.entry.js.map +0 -1
- package/dist/core/p-49729bd4.entry.js.map +0 -1
- package/dist/core/p-73fb7ac7.entry.js.map +0 -1
- package/dist/core/p-8033916b.entry.js +0 -2
- package/dist/core/p-8033916b.entry.js.map +0 -1
- package/dist/core/p-8667d5df.entry.js.map +0 -1
- package/dist/core/p-ab426e50.entry.js +0 -2
- package/dist/core/p-ab426e50.entry.js.map +0 -1
- package/dist/core/p-ae04e58f.entry.js +0 -2
- package/dist/core/p-ae04e58f.entry.js.map +0 -1
- package/dist/core/p-cb37644f.entry.js.map +0 -1
- package/dist/core/p-ce262a72.entry.js.map +0 -1
- package/dist/core/p-f8252fea.entry.js +0 -2
- package/dist/core/p-fea58abc.entry.js.map +0 -1
- /package/dist/components/{p-ae179d8a.js.map → p-9ba6e755.js.map} +0 -0
- /package/dist/components/{p-e24896b9.js.map → p-b3cb7945.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govFormCheckboxCss","GovFormCheckbox","constructor","hostRef","this","checkboxId","createID","h","govHost","host","f","govForm","validateSize","newValue","validateProp","FormCheckboxSizes","FormCheckboxClass","root","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","disabled","invalid","componentWillLoad","componentDidRender","passAttrToLabel","identifier","String","required","canValidateWcagOnRender","delay","validateWcag","render","wrapCheckbox","children","noLabel","Host","class","checked","toBoolAttrIfDefined","Fragment","id","type","value","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","ref","el","inputRef","wcagDescribedBy","wcagLabelledBy","check","e","stopPropagation","govFocus","emit","component","originalEvent","govBlur","target","govChange","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.scss?tag=gov-form-checkbox","../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"sourcesContent":["/*\n * Checkbox\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n$class: \".gov-form-checkbox\";\n\n#{$class} {\n\t@extend %form-checkbox-core;\n\tinput + span {\n\t\t&::before {\n\t\t\tborder-radius: $border-radius;\n\t\t}\n\t}\n\t&__check {\n\t\tposition: absolute;\n\t\tcolor: $form-checkbox-check-color;\n\t\topacity: 0;\n\t\ttransition: $t linear opacity;\n\t}\n\n\t// STATES\n\tinput:checked + span::before {\n\t\tbackground: $form-checkbox-indicator-bg;\n\t}\n\tinput:checked + span &__check {\n\t\topacity: 1;\n\t}\n\t@include parameter(\"invalid\") {\n\t\tinput:checked + span::before {\n\t\t\tbackground: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\tinput:checked + span::before {\n\t\t\tborder-color: $form-state-bg-disabled;\n\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__check {\n\t\t\t\t\ttop: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n\t\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n\t\t\t\t\twidth: get(\"check-size\", $definitions);\n\t\t\t\t\theight: get(\"check-size\", $definitions);\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 { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\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 Fragment from \"../../../helpers/Fragment\"\nimport { FormCheckboxEvent } from \"./gov-form-checkbox.types\"\n\n@Component({\n\ttag: \"gov-form-checkbox\",\n\tstyleUrl: \"gov-form-checkbox.scss\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox default state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = 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 checkbox component disabled.\n\t * This prevents users from being able to interact with the checkbox, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkboxes size.\n\t */\n\t@Prop() readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\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 * 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 * Emitted when the checkbox has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormCheckboxEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\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\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.checked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\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: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\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 * 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\", FormCheckboxClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormCheckboxClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormCheckboxClass.root)\n\t}\n}\n"],"mappings":"ygBAAA,MAAMA,EAAqB,g7P,MCkBdC,EAAe,MAO3B,WAAAC,CAAAC,G,wJAekD,M,cAKb,M,cAKA,M,8BAQW,I,uCAQa,M,oFAxC5DC,KAAKC,WAAaC,EAAS,eAE3BF,KAAKG,EAAIC,EAAQJ,KAAKK,MACtBL,KAAKM,EAAIC,EAAQP,KAAKG,E,CAgEvB,YAAAK,CAAaC,GACZC,E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nCW,EAAoBrC,KAAKoB,SAAQ,mBAC7BpB,KAAKuD,gBAAe,kBACrBvD,KAAKwD,eAAc,gBACrBnB,EAAoBrC,KAAKmB,YAEzChB,EAAA,YACCA,EAAA,QAAMuC,KAAK,UACXvC,EAAA,YAAUgC,MAAOvB,EAAkB6C,MAAOf,KAAK,gB,CAQ7C,cAAAO,CAAeS,GACtBA,EAAEC,kBACF3D,KAAK4D,SAASC,KAAK,CAClBC,UAAWlD,EAAkBC,KAC7B4B,MAAOzC,KAAKyC,MACZL,QAASpC,KAAKoC,QACd2B,cAAeL,G,CAIT,aAAAP,CAAcO,GACrBA,EAAEC,kBACF3D,KAAKgE,QAAQH,KAAK,CACjBC,UAAWlD,EAAkBC,KAC7B4B,MAAOzC,KAAKyC,MACZL,QAASpC,KAAKoC,QACd2B,cAAeL,G,CAIT,cAAAd,CAAec,GACtBA,EAAEC,iB,CAGK,eAAAZ,CAAgBW,GACvB1D,KAAKoC,QAAWsB,EAAEO,OAA4B7B,QAC9CsB,EAAEC,kBACF3D,KAAKkE,UAAUL,KAAK,CACnBC,UAAWlD,EAAkBC,KAC7B4B,MAAOzC,KAAKyC,MACZL,QAASpC,KAAKoC,QACd2B,cAAeL,G,CAQjB,YAAMS,GACL,OAAOnE,KAAKsD,Q,CAOb,kBAAMzB,GACLuC,EAAgBpE,KAAKuD,gBAAiB,oBAAqB3C,EAAkBC,MAC7EuD,EAAgBpE,KAAKwD,eAAgB,mBAAoB5C,EAAkBC,MAC3EwD,EAAqBrE,KAAKwB,YAAcxB,KAAKC,WAAYD,KAAKwD,eAAgB5C,EAAkBC,K"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as t,h as r,H as o,g as i}from"./p-10cbc3fe.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 n}from"./p-24636c53.js";import{g as v,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__prefix span[slot=prefix]{display:flex;justify-content:center;align-items:center;width:100%;height:100%}.gov-stepper-item__name{display:flex;flex-direction:column}.gov-stepper-item__label{display:flex;gap:0.5rem;align-items:center;font-weight:var(--gov-wizard-title-font-weight, 700)}.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-wizard-primary-color, var(--gov-color-primary-800))}.gov-stepper-item[variant=primary] .gov-stepper-item__prefix{background:var(--gov-wizard-primary-indicator-bg, var(--gov-color-primary-300));color:var(--gov-wizard-primary-indicator-color, var(--gov-color-primary-800))}.gov-stepper-item[variant=secondary] .gov-stepper-item__header{color:var(--gov-wizard-secondary-color, var(--gov-color-secondary-700))}.gov-stepper-item[variant=secondary] .gov-stepper-item__prefix{background:var(--gov-wizard-secondary-indicator-bg, var(--gov-color-secondary-400));color:var(--gov-wizard-secondary-indicator-color, var(--gov-color-secondary-700))}.gov-stepper-item[variant=success] .gov-stepper-item__header{color:var(--gov-wizard-success-color, var(--gov-color-success-500))}.gov-stepper-item[variant=success] .gov-stepper-item__prefix{background:var(--gov-wizard-success-indicator-bg, var(--gov-color-success));color:var(--gov-wizard-success-indicator-color, var(--gov-color-neutral-white))}.gov-stepper-item[variant=error] .gov-stepper-item__header{color:var(--gov-wizard-error-color, var(--gov-color-error-500))}.gov-stepper-item[variant=error] .gov-stepper-item__prefix{background:var(--gov-wizard-error-indicator-bg, var(--gov-color-error));color:var(--gov-wizard-error-indicator-color, var(--gov-color-neutral-white))}.gov-stepper-item[variant=warning] .gov-stepper-item__header{color:var(--gov-wizard-warning-color, var(--gov-color-warning-500))}.gov-stepper-item[variant=warning] .gov-stepper-item__prefix{background:var(--gov-wizard-warning-indicator-bg, var(--gov-color-warning));color:var(--gov-wizard-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-wizard-primary-indicator-bg, var(--gov-color-primary-300))}.gov-stepper-item[variant=secondary]::before{background:var(--gov-wizard-secondary-indicator-bg, var(--gov-color-secondary-400))}.gov-stepper-item[variant=success]::before{background:var(--gov-wizard-success-indicator-bg, var(--gov-color-success))}.gov-stepper-item[variant=error]::before{background:var(--gov-wizard-error-indicator-bg, var(--gov-color-error))}.gov-stepper-item[variant=warning]::before{background:var(--gov-wizard-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=v(this.host);this.triggerId=n("GovStepperItem");this.contentId=n("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-80f5140b.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["govStepperItemCss","GovStepperItem","constructor","hostRef","this","h","govHost","host","triggerId","createID","contentId","validateLabel","newValue","govErrorLog","StepperItemClass","root","validateTriggerTag","validTags","includes","validateVariant","validateProp","StepperVariants","componentWillLoad","label","variant","triggerTag","render","identifier","TriggerTag","Host","class","prepareClasses","annotation","rootWithAnnot","id","header","role","title","hasSlot","prefix","name","annot","content","currentState","isExpandedState"],"sources":["../../../packages/core/src/components/gov-stepper/gov-stepper-item.scss?tag=gov-stepper-item","../../../packages/core/src/components/gov-stepper/gov-stepper-item.tsx"],"sourcesContent":["/*\n * Stepper - Item\n */\n\n@import \"../gov-wizard/gov-wizard-item-core.scss\";\n$class: \".gov-stepper-item\";\n\n#{$class} {\n\t@include wizard-item-core;\n\t&::before {\n\t\t@include pseudo();\n\t\twidth: rem-calc(2);\n\t}\n\t&:last-child::before {\n\t\tcontent: none;\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $wizard-core-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t&::before {\n\t\t\t\tbackground: get(\"indicator-bg\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n\t@each $size, $definitions in $stepper-sizes {\n\t\t$connect-gap: get(\"connect-gap\", $definitions);\n\t\t&[size=\"#{$size}\"] {\n\t\t\tmin-height: calc(get(\"indicator-size\", $definitions) + 3 * $connect-gap);\n\t\t\t&::before {\n\t\t\t\ttop: calc(get(\"indicator-size\", $definitions) + $connect-gap);\n\t\t\t\tbottom: $connect-gap;\n\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - rem-calc(2)) / 2);\n\t\t\t}\n\t\t\t&:last-child {\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\t\t\t#{$class} {\n\t\t\t\t&__title {\n\t\t\t\t\t@include typography(get(\"font-size\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__annot {\n\t\t\t\t\t@include typography(get(\"font-size-annot\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__prefix {\n\t\t\t\t\t@include typography(get(\"font-size-indicator\", $definitions));\n\t\t\t\t\twidth: get(\"indicator-size\", $definitions);\n\t\t\t\t\theight: get(\"indicator-size\", $definitions);\n\t\t\t\t\tbox-shadow: 0 0 0 $connect-gap color(\"neutral.white\");\n\t\t\t\t}\n\t\t\t\t&__content {\n\t\t\t\t\tpadding: get(\"content-padding\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t&--w-annot[size=\"#{$size}\"] {\n\t\t\tmin-height: calc(get(\"indicator-size\", $definitions) * 1.5 + 3 * $connect-gap);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Prop, State, Watch, Host, Method, Event, EventEmitter } from '@stencil/core'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\nimport { validateProp } from '../../helpers/Validate/props'\nimport { StepperSizesType, StepperItemClass, StepperVariantType, StepperVariants } from './constants'\nimport { createID } from '../../utils/string.utils'\nimport { govHost, prepareClasses } from '../../helpers/Dom/template'\nimport { GovStepperItemChangeEvent } from './gov-stepper-item.d'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-stepper-item',\n\tstyleUrl: 'gov-stepper-item.scss',\n})\nexport class GovStepperItem {\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('GovStepperItem')\n\t\tthis.contentId = createID('GovStepperContent')\n\t}\n\n\t@Element() readonly host: HTMLGovStepperItemElement\n\t@State() isExpandedState: boolean\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant?: StepperVariantType = 'primary'\n\t/**\n\t * Size of stepper\n\t */\n\t@Prop() readonly size?: StepperSizesType = 'm'\n\t/**\n\t * Custom stepper item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Item name of the stepper\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Item annotation of the stepper\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Used to change the HMTL tag in the stepper trigger for correct semantic structure\n\t */\n\t@Prop({ attribute: 'trigger-tag' }) readonly triggerTag: string = 'h3'\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovStepperItemChangeEvent>\n\n\t@Watch('label')\n\tvalidateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${StepperItemClass.root}]: Parameter label is required.`)\n\t\t}\n\t}\n\n\t@Watch('triggerTag')\n\tvalidateTriggerTag(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(`[${StepperItemClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(StepperVariants, newValue, StepperItemClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateLabel(this.label)\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateTriggerTag(this.triggerTag)\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst contentId = this.contentId\n\t\tconst { label } = this\n\t\tconst TriggerTag = this.triggerTag\n\n\t\treturn (\n\t\t\t<Host class={prepareClasses([StepperItemClass.root, this.annotation && StepperItemClass.rootWithAnnot])} variant={this.variant}>\n\t\t\t\t<div id={triggerId} class={StepperItemClass.header} role=\"listitem\">\n\t\t\t\t\t<TriggerTag class={StepperItemClass.title}>\n\t\t\t\t\t\t{this.h.hasSlot('prefix') && (\n\t\t\t\t\t\t\t<span class={StepperItemClass.prefix}>\n\t\t\t\t\t\t\t\t<slot name=\"prefix\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span class={StepperItemClass.name}>\n\t\t\t\t\t\t\t<span class={StepperItemClass.label}>{label}</span>\n\t\t\t\t\t\t\t{this.annotation && <span class={StepperItemClass.annot}>{this.annotation}</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</TriggerTag>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot('content') && (\n\t\t\t\t\t<div class={StepperItemClass.content} id={contentId} aria-labelledby={triggerId} role=\"tabpanel\">\n\t\t\t\t\t\t<slot name=\"content\" />\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 * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.isExpandedState\n\t}\n}\n"],"mappings":"qUAAA,MAAMA,EAAoB,
|
|
1
|
+
{"version":3,"names":["govStepperItemCss","GovStepperItem","constructor","hostRef","this","h","govHost","host","triggerId","createID","contentId","validateLabel","newValue","govErrorLog","StepperItemClass","root","validateTriggerTag","validTags","includes","validateVariant","validateProp","StepperVariants","componentWillLoad","label","variant","triggerTag","render","identifier","TriggerTag","Host","class","prepareClasses","annotation","rootWithAnnot","id","header","role","title","hasSlot","prefix","name","annot","content","currentState","isExpandedState"],"sources":["../../../packages/core/src/components/gov-stepper/gov-stepper-item.scss?tag=gov-stepper-item","../../../packages/core/src/components/gov-stepper/gov-stepper-item.tsx"],"sourcesContent":["/*\n * Stepper - Item\n */\n\n@import \"../gov-wizard/gov-wizard-item-core.scss\";\n$class: \".gov-stepper-item\";\n\n#{$class} {\n\t@include wizard-item-core;\n\t&::before {\n\t\t@include pseudo();\n\t\twidth: rem-calc(2);\n\t}\n\t&:last-child::before {\n\t\tcontent: none;\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $wizard-core-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t&::before {\n\t\t\t\tbackground: get(\"indicator-bg\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n\t@each $size, $definitions in $stepper-sizes {\n\t\t$connect-gap: get(\"connect-gap\", $definitions);\n\t\t&[size=\"#{$size}\"] {\n\t\t\tmin-height: calc(get(\"indicator-size\", $definitions) + 3 * $connect-gap);\n\t\t\t&::before {\n\t\t\t\ttop: calc(get(\"indicator-size\", $definitions) + $connect-gap);\n\t\t\t\tbottom: $connect-gap;\n\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - rem-calc(2)) / 2);\n\t\t\t}\n\t\t\t&:last-child {\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\t\t\t#{$class} {\n\t\t\t\t&__title {\n\t\t\t\t\t@include typography(get(\"font-size\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__annot {\n\t\t\t\t\t@include typography(get(\"font-size-annot\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__prefix {\n\t\t\t\t\t@include typography(get(\"font-size-indicator\", $definitions));\n\t\t\t\t\twidth: get(\"indicator-size\", $definitions);\n\t\t\t\t\theight: get(\"indicator-size\", $definitions);\n\t\t\t\t\tbox-shadow: 0 0 0 $connect-gap color(\"neutral.white\");\n\t\t\t\t}\n\t\t\t\t&__content {\n\t\t\t\t\tpadding: get(\"content-padding\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t&--w-annot[size=\"#{$size}\"] {\n\t\t\tmin-height: calc(get(\"indicator-size\", $definitions) * 1.5 + 3 * $connect-gap);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Prop, State, Watch, Host, Method, Event, EventEmitter } from '@stencil/core'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\nimport { validateProp } from '../../helpers/Validate/props'\nimport { StepperSizesType, StepperItemClass, StepperVariantType, StepperVariants } from './constants'\nimport { createID } from '../../utils/string.utils'\nimport { govHost, prepareClasses } from '../../helpers/Dom/template'\nimport { GovStepperItemChangeEvent } from './gov-stepper-item.d'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-stepper-item',\n\tstyleUrl: 'gov-stepper-item.scss',\n})\nexport class GovStepperItem {\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('GovStepperItem')\n\t\tthis.contentId = createID('GovStepperContent')\n\t}\n\n\t@Element() readonly host: HTMLGovStepperItemElement\n\t@State() isExpandedState: boolean\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant?: StepperVariantType = 'primary'\n\t/**\n\t * Size of stepper\n\t */\n\t@Prop() readonly size?: StepperSizesType = 'm'\n\t/**\n\t * Custom stepper item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Item name of the stepper\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Item annotation of the stepper\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Used to change the HMTL tag in the stepper trigger for correct semantic structure\n\t */\n\t@Prop({ attribute: 'trigger-tag' }) readonly triggerTag: string = 'h3'\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovStepperItemChangeEvent>\n\n\t@Watch('label')\n\tvalidateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${StepperItemClass.root}]: Parameter label is required.`)\n\t\t}\n\t}\n\n\t@Watch('triggerTag')\n\tvalidateTriggerTag(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(`[${StepperItemClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(StepperVariants, newValue, StepperItemClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateLabel(this.label)\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateTriggerTag(this.triggerTag)\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst contentId = this.contentId\n\t\tconst { label } = this\n\t\tconst TriggerTag = this.triggerTag\n\n\t\treturn (\n\t\t\t<Host class={prepareClasses([StepperItemClass.root, this.annotation && StepperItemClass.rootWithAnnot])} variant={this.variant}>\n\t\t\t\t<div id={triggerId} class={StepperItemClass.header} role=\"listitem\">\n\t\t\t\t\t<TriggerTag class={StepperItemClass.title}>\n\t\t\t\t\t\t{this.h.hasSlot('prefix') && (\n\t\t\t\t\t\t\t<span class={StepperItemClass.prefix}>\n\t\t\t\t\t\t\t\t<slot name=\"prefix\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span class={StepperItemClass.name}>\n\t\t\t\t\t\t\t<span class={StepperItemClass.label}>{label}</span>\n\t\t\t\t\t\t\t{this.annotation && <span class={StepperItemClass.annot}>{this.annotation}</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</TriggerTag>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot('content') && (\n\t\t\t\t\t<div class={StepperItemClass.content} id={contentId} aria-labelledby={triggerId} role=\"tabpanel\">\n\t\t\t\t\t\t<slot name=\"content\" />\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 * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.isExpandedState\n\t}\n}\n"],"mappings":"qUAAA,MAAMA,EAAoB,+wQ,MCabC,EAAc,MAK1B,WAAAC,CAAAC,G,4FAYgD,U,UAIL,I,yFAgBuB,KA/BjEC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,UAAYC,EAAS,kBAC1BL,KAAKM,UAAYD,EAAS,oB,CAoC3B,aAAAE,CAAcC,GACb,IAAKA,EAAU,CACdC,EAAY,IAAIC,EAAiBC,sC,EAKnC,kBAAAC,CAAmBJ,GAClB,MAAMK,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,QACvD,GAAIL,EAAU,CACb,IAAKK,EAAUC,SAASN,GAAW,CAClCC,EAAY,IAAIC,EAAiBC,cAAcH,oB,GAMlD,eAAAO,CAAgBP,GACfQ,EAAaC,EAAiBT,EAAUE,EAAiBC,K,CAG1D,iBAAAO,GACClB,KAAKO,cAAcP,KAAKmB,OACxBnB,KAAKe,gBAAgBf,KAAKoB,SAC1BpB,KAAKY,mBAAmBZ,KAAKqB,W,CAG9B,MAAAC,GACC,MAAMlB,EAAYJ,KAAKuB,YAAcvB,KAAKI,UAC1C,MAAME,EAAYN,KAAKM,UACvB,MAAMa,MAAEA,GAAUnB,KAClB,MAAMwB,EAAaxB,KAAKqB,WAExB,OACCpB,EAACwB,EAAI,CAACC,MAAOC,EAAe,CAACjB,EAAiBC,KAAMX,KAAK4B,YAAclB,EAAiBmB,gBAAiBT,QAASpB,KAAKoB,SACtHnB,EAAA,OAAK6B,GAAI1B,EAAWsB,MAAOhB,EAAiBqB,OAAQC,KAAK,YACxD/B,EAACuB,EAAU,CAACE,MAAOhB,EAAiBuB,OAClCjC,KAAKC,EAAEiC,QAAQ,WACfjC,EAAA,QAAMyB,MAAOhB,EAAiByB,QAC7BlC,EAAA,QAAMmC,KAAK,YAGbnC,EAAA,QAAMyB,MAAOhB,EAAiB0B,MAC7BnC,EAAA,QAAMyB,MAAOhB,EAAiBS,OAAQA,GACrCnB,KAAK4B,YAAc3B,EAAA,QAAMyB,MAAOhB,EAAiB2B,OAAQrC,KAAK4B,eAKjE5B,KAAKC,EAAEiC,QAAQ,YACfjC,EAAA,OAAKyB,MAAOhB,EAAiB4B,QAASR,GAAIxB,EAAS,kBAAmBF,EAAW4B,KAAK,YACrF/B,EAAA,QAAMmC,KAAK,a,CAWhB,kBAAMG,GACL,OAAOvC,KAAKwC,e"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,c as t,h as i,H as s,g as r}from"./p-10cbc3fe.js";import{g as n,a as e}from"./p-3f37ddb6.js";import{c as a}from"./p-24636c53.js";import{B as d}from"./p-3bacd021.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-03990da5.js";const c={triggerEvents:"click",exclude:""};function p(o,t,i,s=c){const r=g(s);h(s).forEach((s=>{window.addEventListener(s,(s=>{l(s,o,t,i,r)}),false)}))}function l(o,t,i,s,r){const n=o.target;if(!i.contains(n)&&!f(n,r)){s.call(t)}}function h(o){if(o.triggerEvents){return o.triggerEvents.split(",").map((o=>o.trim()))}return["click"]}function g(o){if(o.exclude){try{return Array.from(document.querySelectorAll(o.exclude))}catch(t){console.warn(`@ClickOutside: Exclude: '${o.exclude}' will not be evaluated. Check your exclude selector syntax.`,t)}}return}function f(o,t){if(o&&t){for(let i of t){if(i.contains(o)){return true}}}return false}var u;(function(o){o["LEFT"]="left";o["RIGHT"]="right"})(u||(u={}));const v={root:"gov-dropdown",list:"gov-dropdown__list"};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-dropdown{position:relative}.gov-dropdown__list{position:absolute;left:0;z-index:100}.gov-dropdown ul{padding:0.25rem;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-dropdown-bg-color, var(--gov-color-neutral-white));box-shadow:var(--gov-dropdown-box-shadow, 0 0.25rem 1.25rem rgba(0, 0, 0, 0.1))}.gov-dropdown li{margin:0;white-space:nowrap}.gov-dropdown li::before{content:none}.gov-dropdown li>*{width:100%}.gov-dropdown li>* .element{justify-content:space-between;width:100%}.gov-dropdown[position=right] .gov-dropdown__list{right:0;left:initial}";const w=class{constructor(i){o(this,i);this.govChange=t(this,"gov-change",7);this.open=false;this.position=u.LEFT;this.h=n(this.host);this.listId=a("GovDropdownList");this.controlId=a("GovDropdownControl")}componentWillLoad(){if(this.trigger){this.trigger.setAttribute("wcag-controls",this.listId);this.trigger.setAttribute("wcag-has-popup",e(!!this.list));this.trigger.setAttribute("identifier",this.controlId);this.trigger.addEventListener("gov-click",(o=>{o.preventDefault();o.stopPropagation();this.open=!this.open;this.govChange.emit({component:v.root,originalEvent:o,open:this.open})}))}}get trigger(){return this.host.querySelector(`* > ${d.root}`)}get list(){return this.h.getSlot("list")}render(){return i(s,{class:this.h.classes([v.root]),open:this.open,position:this.position},i("slot",null),i("div",{ref:o=>p(this,o,(()=>this.open=false)),class:v.list,id:this.listId,"aria-labelledby":this.controlId,"aria-hidden":e(!this.open),hidden:!this.open},i("slot",{name:"list"})))}async getState(){return this.open}async setOpen(o){this.open=o}get host(){return r(this)}};w.style=m;export{w as gov_dropdown};
|
|
2
|
+
//# sourceMappingURL=p-84f6b11a.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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","constructor","hostRef","LEFT","this","h","govHost","host","listId","createID","controlId","componentWillLoad","trigger","setAttribute","toBoolAttr","preventDefault","stopPropagation","open","govChange","emit","originalEvent","querySelector","ButtonClass","getSlot","render","Host","class","classes","position","ref","el","id","hidden","name","getState","setOpen","state"],"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"],"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 the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Sets the dropdown state\n\t */\n\t@Method()\n\tasync setOpen(state: boolean) {\n\t\tthis.open = state\n\t}\n}\n"],"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,EAAc,GACjE,MAAM,GAEjB,CAWA,SAASQ,EAAiBC,EAAOb,EAAWC,EAASC,EAAUE,GAC3D,MAAMU,EAASD,EAAMC,OACrB,IAAKb,EAAQc,SAASD,KAAYE,EAAWF,EAAQV,GAAgB,CACjEF,EAASe,KAAKjB,EACtB,CACA,CACA,SAASM,EAAiBH,GACtB,GAAIA,EAAIN,cAAe,CACnB,OAAOM,EAAIN,cAAcqB,MAAM,KAAKC,KAAIR,GAAKA,EAAES,QACvD,CACI,MAAO,CAAC,QACZ,CACA,SAASf,EAAiBF,GACtB,GAAIA,EAAIL,QAAS,CACb,IACI,OAAOuB,MAAMC,KAAKC,SAASC,iBAAiBrB,EAAIL,SAC5D,CACQ,MAAO2B,GACHC,QAAQC,KAAK,4BAA4BxB,EAAIL,sEAAuE2B,EAChI,CACA,CACI,MACJ,CACA,SAAST,EAAWF,EAAQc,GACxB,GAAId,GAAUc,EAAc,CACxB,IAAK,IAAIC,KAAgBD,EAAc,CACnC,GAAIC,EAAad,SAASD,GAAS,CAC/B,OAAO,IACvB,CACA,CACA,CACI,OAAO,KACX,CC9FA,IAAYgB,GAAZ,SAA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C,GACbhC,KAAKa,KAAOmB,C"}
|
|
1
|
+
{"version":3,"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","constructor","hostRef","LEFT","this","h","govHost","host","listId","createID","controlId","componentWillLoad","trigger","setAttribute","toBoolAttr","preventDefault","stopPropagation","open","govChange","emit","originalEvent","querySelector","ButtonClass","getSlot","render","Host","class","classes","position","ref","el","id","hidden","name","getState","setOpen","state"],"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"],"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}\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 the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Sets the dropdown state\n\t */\n\t@Method()\n\tasync setOpen(state: boolean) {\n\t\tthis.open = state\n\t}\n}\n"],"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,EAAG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AiB,aAAcC,IAC3CA,EAAEuC,iBACFvC,EAAEwC,kBACFZ,KAAKa,MAAQb,KAAKa,KAElBb,KAAKc,UAAUC,KAAK,CACnBtD,UAAW+B,EAAcC,KACzBuB,cAAe5C,EACfyC,KAAMb,KAAKa,MACV,G,EAKL,WAAIL,GACH,OAAOR,KAAKG,KAAKc,cAAc,OAAOC,EAAYzB,O,CAGnD,QAAIC,GACH,OAAOM,KAAKC,EAAEkB,QAAQ,O,CAGvB,MAAAC,GACC,OACCnB,EAACoB,EAAI,CAACC,MAAOtB,KAAKC,EAAEsB,QAAQ,CAAC/B,EAAcC,OAAQoB,KAAMb,KAAKa,KAAMW,SAAUxB,KAAKwB,UAClFvB,EAAA,aACAA,EAAA,OACCwB,IAAKC,GAAMlE,EAAqBwC,KAAM0B,GAAI,IAAM1B,KAAKa,KAAO,QAC5DS,MAAO9B,EAAcE,KACrBiC,GAAI3B,KAAKI,OAAM,kBACEJ,KAAKM,UAAS,cAClBI,GAAYV,KAAKa,MAC9Be,QAAS5B,KAAKa,MACdZ,EAAA,QAAM4B,KAAK,U,CAUf,cAAMC,GACL,OAAO9B,KAAKa,I,CAOb,aAAMkB,CAAQC,GACbhC,KAAKa,KAAOmB,C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as o}from"./p-10cbc3fe.js";import{a}from"./p-3f37ddb6.js";import{v as r}from"./p-26acf964.js";import{c as n}from"./p-24636c53.js";import{d as h,t as l,h as c}from"./p-03990da5.js";import{F as m,a as d,b as p}from"./p-9dab01be.js";import"./p-561fa17b.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";const g='.gov-form-autocomplete__list{margin:0;padding:0}.gov-form-autocomplete__list>.gov-form-autocomplete__item{margin:0;padding:0;background:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item::before{display:none}.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-autocomplete{position:relative;display:block;width:100%}.gov-form-autocomplete__list{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);position:absolute;top:100%;right:0;left:0;z-index:5;max-height:14.0625rem;margin-top:0.5rem;border:var(--gov-autocomplete-item-hover, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-autocomplete-bg, var(--gov-color-neutral-white));overflow-x:hidden;overflow-y:auto;overscroll-behavior:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item{padding:0.75rem 0.5rem;cursor:pointer}.gov-form-autocomplete__item--empty,.gov-form-autocomplete__item--loading{padding:0.75rem 0.5rem;color:var(--gov-autocomplete-item-disable-color, var(--gov-color-secondary-600))}.gov-form-autocomplete__item--empty .gov-icon,.gov-form-autocomplete__item--loading .gov-icon{height:12px}.gov-form-autocomplete__list:empty{display:none}.gov-form-autocomplete__item[aria-selected=""],.gov-form-autocomplete__item[aria-selected=true i],.gov-form-autocomplete__item[aria-selected="1"]{background:var(--gov-autocomplete-item-select, var(--gov-color-secondary-400))}@media not all and (pointer: coarse){.gov-form-autocomplete__item:hover{background:var(--gov-autocomplete-item-hover, var(--gov-color-primary-100))}}';const u=class{constructor(e){t(this,e);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govSelect=i(this,"gov-select",7);this.templateResolver=t=>t[this.nameKey];this.value="";this.identifier=undefined;this.variant=undefined;this.success=undefined;this.size="m";this.nameKey="name";this.name=undefined;this.required=false;this.disabled=false;this.placeholder=undefined;this.readonly=undefined;this.invalid=undefined;this.minlength=3;this.maxlength=undefined;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.processing=false;this.arrowCounter=-1;this.list=[];this.listBoxId=n("GovListBox")}validateVariant(t){r(d,t,m.root)}validateSize(t){r(p,t,m.root)}onArrowUp(){if(this.arrowCounter>0){this.arrowCounter=this.arrowCounter-1;this.moveToView().finally()}}onArrowDown(){if(this.arrowCounter<this.list.length-1){this.arrowCounter=this.arrowCounter+1;this.moveToView().finally()}}async moveToView(){await h(200);const t=this.listRef.offsetHeight;const i=this.listRef.querySelector('li[aria-selected="true"]');if(i&&t){const t=i.offsetTop;this.listRef.scrollTo({top:t,behavior:"smooth"})}}doSearch(){if(Number.isInteger(this.minlength)&&this.isValueAccepted===false&&this.minlength){this.list=[];this.arrowCounter=-1;this.processing=false;return}if(this.searchCallback){this.processing=true;this.searchCallback(this.value).then((t=>this.list=t)).catch((()=>this.list=[])).finally((()=>{this.arrowCounter=-1;this.processing=false}))}}get isValueAccepted(){if(typeof this.value==="string"){return this.value.length>=this.minlength}else{return false}}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size)}render(){return e(s,{class:m.root,size:this.size,variant:this.variant},e("gov-form-input",{placeholder:this.placeholder,name:this.name,disabled:this.disabled,readonly:this.readonly,autocomplete:false,size:this.size,variant:this.variant,required:this.required,invalid:this.invalid,success:this.success,role:"searchbox",value:this.value,minlength:this.minlength,maxlength:this.maxlength,"on-gov-input":l(this.onInputHandler.bind(this),200),"on-gov-keyup":this.onKeyUpHandler.bind(this),"on-gov-keydown":this.onKeyDownHandler.bind(this),"on-gov-focus":this.onFocusHandler.bind(this),"on-gov-blur":this.onBlurHandler.bind(this),wcagAutocomplete:"list",wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:[this.listBoxId,this.wcagOwns].join(" "),wcagExpanded:this.list.length&&this.focused,ref:t=>this.inputRef=t},e("slot",{slot:"right-icon",name:"right-icon"})),e("ul",{class:m.list,role:"listbox",id:this.listBoxId,ref:t=>this.listRef=t},this.focused&&this.list.length===0&&this.processing===false&&this.isValueAccepted&&this.messageEmpty?e("li",{class:m.empty},this.messageEmpty):null,this.focused&&this.processing===true&&this.isValueAccepted?e("li",{class:m.loading},e("gov-icon",{name:"loader",class:"gov-spin-animation"})," ",this.messageLoading):null,this.list.map(((t,i)=>{const s=this.arrowCounter===i;return e("li",{class:m.item,innerHTML:this.templateResolver(t,s),role:"option","aria-posinset":i,tabindex:s?0:-1,"aria-setsize":this.list.length,onClick:t=>this.onSelectHandler(t,i),"aria-selected":a(s)})}))))}onFocusHandler(t){this.focused=true;this.arrowCounter=-1;if((this.value||this.minlength===0)&&this.searchCallback){this.doSearch()}t.stopPropagation();this.govFocus.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onBlurHandler(t){this.focused=false;setTimeout((()=>this.list=[]),200);this.arrowCounter=-1;t.stopPropagation();this.govBlur.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({originalEvent:t,component:m.root,value:this.value,selected:null});this.doSearch()}onSelectHandler(t,i=-1){let e=null;if(i>-1){e=this.list[i]}else if(c(this.arrowCounter,this.list)){e=this.list[this.arrowCounter]}if(e){this.govSelect.emit({component:m.root,value:this.value,selected:e,originalEvent:t});this.list=[];if(c(this.nameKey,e)&&typeof e[this.nameKey]==="string"){this.value=e[this.nameKey]}}}onKeyUpHandler(t){const i=t.detail.originalEvent;t.stopPropagation();i.stopPropagation();if(i.keyCode===38)this.onArrowUp();else if(i.keyCode===40)this.onArrowDown();else if(i.keyCode===13){t.preventDefault();i.preventDefault();this.onSelectHandler(t)}}onKeyDownHandler(t){const i=t.detail.originalEvent;t.stopPropagation();i.stopPropagation();if(i.keyCode===13){t.preventDefault();i.preventDefault()}}async setFocus(t){return this.inputRef.focus(t)}async setOptions(t){this.list=Array.isArray(t)?t:[];this.arrowCounter=-1}async clearValue(){this.value="";this.inputRef.value="";await this.inputRef.clearValue()}async setProcessing(t){this.processing=t}async setSearchCallback(t){this.searchCallback=t}async setTemplateResolver(t){this.templateResolver=t}get host(){return o(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize"]}}};u.style=g;export{u as gov_form_autocomplete};
|
|
2
|
+
//# sourceMappingURL=p-a7719b55.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govFormAutocompleteCss","GovFormAutocomplete","constructor","hostRef","this","templateResolver","item","nameKey","listBoxId","createID","validateVariant","newValue","validateProp","FormAutocompleteVariants","FormAutocompleteClass","root","validateSize","FormAutocompleteSizes","onArrowUp","arrowCounter","moveToView","finally","onArrowDown","list","length","delay","heightOfList","listRef","offsetHeight","selected","querySelector","offsetTop","scrollTo","top","behavior","doSearch","Number","isInteger","minlength","isValueAccepted","processing","searchCallback","value","then","response","catch","componentWillLoad","variant","size","render","h","Host","class","placeholder","name","disabled","readonly","autocomplete","required","invalid","success","role","maxlength","throttle","onInputHandler","bind","onKeyUpHandler","onKeyDownHandler","onFocusHandler","onBlurHandler","wcagAutocomplete","wcagDescribedBy","wcagLabelledBy","wcagOwns","join","wcagExpanded","focused","ref","el","inputRef","slot","id","messageEmpty","empty","loading","messageLoading","map","index","isSelected","innerHTML","tabindex","onClick","e","onSelectHandler","toBoolAttr","stopPropagation","govFocus","emit","originalEvent","component","setTimeout","govBlur","target","govInput","has","govSelect","event","detail","keyCode","preventDefault","setFocus","options","focus","setOptions","Array","isArray","clearValue","setProcessing","status","setSearchCallback","callback","setTemplateResolver"],"sources":["../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.scss?tag=gov-form-autocomplete","../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"sourcesContent":["$class: \".gov-form-autocomplete\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@include typography($font-size-s);\n\t\t@extend %reset-ul;\n\t\tposition: absolute;\n\t\ttop: 100%;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tz-index: 5;\n\t\tmax-height: rem-calc(225);\n\t\tmargin-top: rem-calc(8);\n\t\tborder: $form-autocomplete-border;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $form-autocomplete-bg;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\toverscroll-behavior: none;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tpadding: rem-calc(12 8);\n\t\tcursor: pointer;\n\t}\n\t&__item {\n\t\t&--empty,\n\t\t&--loading {\n\t\t\tpadding: rem-calc(12 8);\n\t\t\tcolor: $form-autocomplete-item-disable-color;\n\t\t\t& .gov-icon {\n\t\t\t\theight: 12px;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&__list:empty {\n\t\tdisplay: none;\n\t}\n\n\t// HOVERS\n\t&__item {\n\t\t@include parameter(\"aria-selected\") {\n\t\t\tbackground: $form-autocomplete-item-select-bg;\n\t\t}\n\t\t@include hover() {\n\t\t\tbackground: $form-autocomplete-item-hover-bg;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core'\nimport { toBoolAttr } from '../../../helpers/Dom/template'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { Nullable } from '../../../types/interfaces'\nimport { createID } from '../../../utils/string.utils'\nimport { delay, has, throttle } from '../../../utils/utils'\nimport { FormInputEvent } from '../input/gov-form-input.types'\nimport { FormAutocompleteClass, FormAutocompleteSizes, FormAutocompleteVariants, SizesType, VariantType } from './constants'\nimport { FormAutocompleteEvent, GovFormAutocompleteItem } from './gov-form-autocomplete.types'\n\n@Component({\n\ttag: 'gov-form-autocomplete',\n\tstyleUrl: 'gov-form-autocomplete.scss',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value = ''\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: VariantType\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop() readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\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 input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({ attribute: 'message-empty' }) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Custom message for when data is loaded\n\t */\n\t@Prop({ attribute: 'message-loading' }) readonly messageLoading: string = 'Načítám...'\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 * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-owns\n\t */\n\t@Prop({ attribute: 'wcag-owns' }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-input' }) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-select' }) govSelect: EventEmitter<FormAutocompleteEvent>\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteVariants, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({ top: offsetTop, behavior: 'smooth' })\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\tthis.list = []\n\t\t\tthis.arrowCounter = -1\n\t\t\tthis.processing = false\n\t\t\treturn\n\t\t}\n\t\tif (this.searchCallback) {\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={throttle(this.onInputHandler.bind(this), 200)}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\twcagAutocomplete={'list'}\n\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\twcagOwns={[this.listBoxId, this.wcagOwns].join(' ')}\n\t\t\t\t\twcagExpanded={this.list.length && this.focused}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot slot=\"right-icon\" name=\"right-icon\" />\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list} role={'listbox'} id={this.listBoxId} ref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>\n\t\t\t\t\t\t\t {this.messageLoading}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonClick={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif ((this.value || this.minlength === 0) && this.searchCallback) {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tsetTimeout(() => (this.list = []), 200)\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLGovFormInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.list = []\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"],"mappings":"mVAAA,MAAMA,EAAyB,y8D,MCclBC,EAAmB,MAO/B,WAAAC,CAAAC,G,0JAFQC,KAAAC,iBAAiFC,GAAQA,EAAKF,KAAKG,S,WAU3D,G,kFAgBZ,I,aAID,O,kCASE,M,cAKA,M,yFAgBA,E,2CAQiC,iC,oBAII,a,4HA+BpD,M,mBACG,E,UACkB,GAtG1CH,KAAKI,UAAYC,EAAS,a,CAyG3B,eAAAC,CAAgBC,GACfC,EAAaC,EAA0BF,EAAUG,EAAsBC,K,CAIxE,YAAAC,CAAaL,GACZC,EAAaK,EAAuBN,EAAUG,EAAsBC,K,CAG7D,SAAAG,GACP,GAAId,KAAKe,aAAe,EAAG,CAC1Bf,KAAKe,aAAef,KAAKe,aAAe,EACxCf,KAAKgB,aAAaC,S,EAIZ,WAAAC,GACP,GAAIlB,KAAKe,aAAef,KAAKmB,KAAKC,OAAS,EAAG,CAC7CpB,KAAKe,aAAef,KAAKe,aAAe,EACxCf,KAAKgB,aAAaC,S,EAIZ,gBAAMD,SACPK,EAAM,KACZ,MAAMC,EAAetB,KAAKuB,QAAQC,aAClC,MAAMC,EAAWzB,KAAKuB,QAAQG,cAAc,4BAC5C,GAAID,GAAYH,EAAc,CAC7B,MAAMK,EAAYF,EAASE,UAC3B3B,KAAKuB,QAAQK,SAAS,CAAEC,IAAKF,EAAWG,SAAU,U,EAI5C,QAAAC,GACP,GAAIC,OAAOC,UAAUjC,KAAKkC,YAAclC,KAAKmC,kBAAoB,OAASnC,KAAKkC,UAAW,CACzFlC,KAAKmB,KAAO,GACZnB,KAAKe,cAAgB,EACrBf,KAAKoC,WAAa,MAClB,M,CAED,GAAIpC,KAAKqC,e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EAAMG,gB,EAQR,cAAMC,CAASC,GACd,OAAO3G,KAAK2E,SAASiC,MAAMD,E,CAO5B,gBAAME,CAAWF,GAChB3G,KAAKmB,KAAO2F,MAAMC,QAAQJ,GAAWA,EAAU,GAC/C3G,KAAKe,cAAgB,C,CAOtB,gBAAMiG,GACLhH,KAAKsC,MAAQ,GACbtC,KAAK2E,SAASrC,MAAQ,SAEhBtC,KAAK2E,SAASqC,Y,CAOrB,mBAAMC,CAAcC,GACnBlH,KAAKoC,WAAa8E,C,CAOnB,uBAAMC,CAAkBC,GACvBpH,KAAKqC,eAAiB+E,C,CAQvB,yBAAMC,CAAoBD,GACzBpH,KAAKC,iBAAmBmH,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,c as r,h as e,H as i,g as a}from"./p-10cbc3fe.js";import{c as t}from"./p-24636c53.js";import{v as s}from"./p-26acf964.js";import{g as c,f as n,h as v}from"./p-34ed07f6.js";import{g as d,a as m,t as l}from"./p-3f37ddb6.js";import{a as g,b as f}from"./p-570ef4e5.js";import{c as h}from"./p-cac3881f.js";import{d as p}from"./p-03990da5.js";import{F as b}from"./p-1c1d0bbe.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 x='.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-radio{cursor:pointer}.gov-form-radio input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-radio input+span{position:relative;display:block;cursor:pointer}.gov-form-radio input+span::before{content:"";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-radio .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-radio input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=""].gov-form-radio .gov-form-label__label,[invalid=true i].gov-form-radio .gov-form-label__label,[invalid="1"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-radio input+span::before,[invalid=true i].gov-form-radio input+span::before,[invalid="1"].gov-form-radio input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=""].gov-form-radio,[disabled=true i].gov-form-radio,[disabled="1"].gov-form-radio{pointer-events:none}[disabled=""].gov-form-radio .gov-form-label__label,[disabled=true i].gov-form-radio .gov-form-label__label,[disabled="1"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-radio input+span::before,[disabled=true i].gov-form-radio input+span::before,[disabled="1"].gov-form-radio input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-radio{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-radio{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);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-radio{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);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-radio{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);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-radio input+span::before{border-radius:50%}.gov-form-radio input+span::after{content:"";position:absolute;display:block;border-radius:50%;background:var(--gov-form-radio-indicator-bg, var(--gov-color-primary));opacity:0;transition:150ms linear opacity}.gov-form-radio input:checked+span::after{opacity:1}.gov-form-radio[invalid=""] input+span::after,.gov-form-radio[invalid=true i] input+span::after,.gov-form-radio[invalid="1"] input+span::after{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-radio[disabled=""] input:checked+span::after,.gov-form-radio[disabled=true i] input:checked+span::after,.gov-form-radio[disabled="1"] input:checked+span::after{background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-radio[size=xs] input+span::after{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);width:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem);height:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)}.gov-form-radio[size=s] input+span::after{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);width:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem);height:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)}.gov-form-radio[size=m] input+span::after{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-m-dot-size, 0.75rem);height:var(--gov-form-checkbox-core-m-dot-size, 0.75rem)}.gov-form-radio[size=l] input+span::after{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);width:var(--gov-form-checkbox-core-l-dot-size, 1rem);height:var(--gov-form-checkbox-core-l-dot-size, 1rem)}';const u=class{constructor(e){o(this,e);this.govFocus=r(this,"gov-focus",7);this.govBlur=r(this,"gov-blur",7);this.govChange=r(this,"gov-change",7);this.value=undefined;this.noLabel=false;this.checked=false;this.required=false;this.disabled=undefined;this.name=undefined;this.size="m";this.identifier=undefined;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.radioId=t("GovRadio");this.h=d(this.host);this.f=c(this.h)}validateSize(o){s(v,o,n.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",m(this.disabled));this.f.passAttrToControl("invalid",m(this.invalid));this.f.passAttrToControl("type","radio")}componentWillLoad(){this.passControlAttrs()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.radioId);this.f.passAttrToLabel("required",String(this.required));if(h()){await p(500);await this.validateWcag()}}render(){const o=o=>{if(this.noLabel){return e("label",null,o)}return o};return e(i,{class:n.root,checked:this.checked,size:this.size,invalid:l(this.invalid)},e("div",{class:n.holder},o(e(b,null,e("input",{class:n.input,id:this.identifier||this.radioId,type:"radio",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),ref:o=>this.inputRef=o,required:this.required,"aria-checked":this.checked,"aria-required":l(this.required),"aria-invalid":l(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":l(this.disabled)}),e("span",null,e("slot",{name:"label"}))))))}onClickHandler(o){o.stopPropagation()}onFocusHandler(o){o.stopPropagation();this.govFocus.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.govBlur.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}onChangeHandler(o){this.checked=o.target.checked;o.stopPropagation();this.govChange.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}async getRef(){return this.inputRef}async validateWcag(){g(this.wcagDescribedBy,"wcag-described-by",n.root);g(this.wcagLabelledBy,"wcag-labelled-by",n.root);f(this.identifier||this.radioId,this.wcagLabelledBy,n.root)}get host(){return a(this)}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}};u.style=x;export{u as gov_form_radio};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as o,c as r,h as e,H as i,g as a}from"./p-10cbc3fe.js";import{c as t}from"./p-24636c53.js";import{v as s}from"./p-26acf964.js";import{g as c,f as n,h as v}from"./p-34ed07f6.js";import{g as d,a as m,t as l}from"./p-3f37ddb6.js";import{a as g,b as f}from"./p-570ef4e5.js";import{c as h}from"./p-cac3881f.js";import{d as p}from"./p-03990da5.js";import{F as b}from"./p-1c1d0bbe.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 x='.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-radio{cursor:pointer}.gov-form-radio input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-radio input+span{position:relative;display:block;cursor:pointer}.gov-form-radio input+span::before{content:"";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-radio .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-radio input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=""].gov-form-radio .gov-form-label__label,[invalid=true i].gov-form-radio .gov-form-label__label,[invalid="1"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-radio input+span::before,[invalid=true i].gov-form-radio input+span::before,[invalid="1"].gov-form-radio input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=""].gov-form-radio,[disabled=true i].gov-form-radio,[disabled="1"].gov-form-radio{pointer-events:none}[disabled=""].gov-form-radio .gov-form-label__label,[disabled=true i].gov-form-radio .gov-form-label__label,[disabled="1"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-radio input+span::before,[disabled=true i].gov-form-radio input+span::before,[disabled="1"].gov-form-radio input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-radio{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-radio{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);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-radio{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);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-radio{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);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-radio input+span::before{border-radius:50%}.gov-form-radio input+span::after{content:"";position:absolute;display:block;border-radius:50%;background:var(--gov-form-radio-indicator-bg, var(--gov-color-primary));opacity:0;transition:150ms linear opacity}.gov-form-radio input:checked+span::after{opacity:1}.gov-form-radio[invalid=""] input+span::after,.gov-form-radio[invalid=true i] input+span::after,.gov-form-radio[invalid="1"] input+span::after{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-radio[disabled=""] input:checked+span::after,.gov-form-radio[disabled=true i] input:checked+span::after,.gov-form-radio[disabled="1"] input:checked+span::after{background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-radio[size=xs] input+span::after{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);width:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem);height:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)}.gov-form-radio[size=s] input+span::after{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);width:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem);height:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)}.gov-form-radio[size=m] input+span::after{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-m-dot-size, 0.75rem);height:var(--gov-form-checkbox-core-m-dot-size, 0.75rem)}.gov-form-radio[size=l] input+span::after{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);width:var(--gov-form-checkbox-core-l-dot-size, 1rem);height:var(--gov-form-checkbox-core-l-dot-size, 1rem)}';const u=class{constructor(e){o(this,e);this.govFocus=r(this,"gov-focus",7);this.govBlur=r(this,"gov-blur",7);this.govChange=r(this,"gov-change",7);this.value=undefined;this.noLabel=false;this.checked=false;this.required=false;this.disabled=false;this.name=undefined;this.size="m";this.identifier=undefined;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.radioId=t("GovRadio");this.h=d(this.host);this.f=c(this.h)}validateSize(o){s(v,o,n.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",m(this.disabled));this.f.passAttrToControl("invalid",m(this.invalid));this.f.passAttrToControl("type","radio")}componentWillLoad(){this.passControlAttrs()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.radioId);this.f.passAttrToLabel("required",String(this.required));if(h()){await p(500);await this.validateWcag()}}render(){const o=o=>{if(this.noLabel){return e("label",null,o)}return o};return e(i,{class:n.root,checked:this.checked,size:this.size,invalid:l(this.invalid)},e("div",{class:n.holder},o(e(b,null,e("input",{class:n.input,id:this.identifier||this.radioId,type:"radio",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),ref:o=>this.inputRef=o,required:this.required,"aria-checked":this.checked,"aria-required":l(this.required),"aria-invalid":l(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":l(this.disabled)}),e("span",null,e("slot",{name:"label"}))))))}onClickHandler(o){o.stopPropagation()}onFocusHandler(o){o.stopPropagation();this.govFocus.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.govBlur.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}onChangeHandler(o){this.checked=o.target.checked;o.stopPropagation();this.govChange.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}async getRef(){return this.inputRef}async validateWcag(){g(this.wcagDescribedBy,"wcag-described-by",n.root);g(this.wcagLabelledBy,"wcag-labelled-by",n.root);f(this.identifier||this.radioId,this.wcagLabelledBy,n.root)}get host(){return a(this)}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}};u.style=x;export{u as gov_form_radio};
|
|
2
|
+
//# sourceMappingURL=p-acd6a9f4.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govFormRadioCss","GovFormRadio","constructor","hostRef","this","radioId","createID","h","govHost","host","f","govForm","validateSize","newValue","validateProp","FormRadioSizes","FormRadioClass","root","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","disabled","invalid","componentWillLoad","componentDidRender","passAttrToLabel","identifier","String","required","canValidateWcagOnRender","delay","validateWcag","render","wrapCheckbox","children","noLabel","Host","class","checked","toBoolAttrIfDefined","holder","Fragment","input","id","type","value","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","ref","el","inputRef","wcagDescribedBy","wcagLabelledBy","e","stopPropagation","govFocus","emit","component","originalEvent","govBlur","target","govChange","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/radio/gov-form-radio.scss?tag=gov-form-radio","../../../packages/core/src/components/gov-form/radio/gov-form-radio.tsx"],"sourcesContent":["/*\n * Radio\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n$class: \".gov-form-radio\";\n\n#{$class} {\n\t@extend %form-checkbox-core;\n\tinput + span {\n\t\t&::before {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t&::after {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: $form-radio-indicator-bg;\n\t\t\topacity: 0;\n\t\t\ttransition: $t linear opacity;\n\t\t}\n\t}\n\n\t// STATES\n\tinput:checked + span::after {\n\t\topacity: 1;\n\t}\n\t@include parameter(\"invalid\") {\n\t\tinput + span::after {\n\t\t\tbackground: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\tinput:checked + span::after {\n\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\tinput + span::after {\n\t\t\t\ttop: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\twidth: get(\"dot-size\", $definitions);\n\t\t\t\theight: get(\"dot-size\", $definitions);\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 { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormRadioClass, FormRadioSizes, FormRadioSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\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 Fragment from \"../../../helpers/Fragment\"\nimport { FormRadioEvent } from \"./gov-form-radio.types\"\n\n@Component({\n\ttag: \"gov-form-radio\",\n\tstyleUrl: \"gov-form-radio.scss\",\n})\nexport class GovFormRadio {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly radioId: string\n\n\tconstructor() {\n\t\tthis.radioId = createID(\"GovRadio\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormRadioElement\n\t/**\n\t * Value of radio\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Radio default state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = 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 radio component disabled.\n\t * This prevents users from being able to interact with the radio, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the radio.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Radio's size.\n\t */\n\t@Prop() readonly size?: FormRadioSizesType = \"m\"\n\t/**\n\t * Custom radio 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 * 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 * Emitted when the radio has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormRadioEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRadioSizes, newValue, FormRadioClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"radio\")\n\t}\n\n\n\tcomponentWillLoad() {\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.radioId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\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\tconst wrapCheckbox = children => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn <label>{children}</label>\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormRadioClass.root} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormRadioClass.holder}>\n\t\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormRadioClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.radioId}\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\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: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\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 * 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\", FormRadioClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormRadioClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.radioId, this.wcagLabelledBy, FormRadioClass.root)\n\t}\n}\n"],"mappings":"mhBAAA,MAAMA,EAAkB,yhP,MCkBXC,EAAY,MAOxB,WAAAC,CAAAC,G,wJAe6D,M,aAIX,M,cAKb,M,cAKA,M,8BAQQ,I,8GApC5CC,KAAKC,QAAUC,EAAS,YAExBF,KAAKG,EAAIC,EAAQJ,KAAKK,MACtBL,KAAKM,EAAIC,EAAQP,KAAKG,E,CAgEvB,YAAAK,CAAaC,GACZC,EAAaC,EAAgBF,EAAUG,EAAeC,K,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,EAAoBrC,KAAK0B,UAAS,eACnCW,EAAoBrC,KAAKoB,SAAQ,mBAC7BpB,KAAKyD,gBAAe,kBACrBzD,KAAK0D,eAAc,gBACrBrB,EAAoBrC,KAAKmB,YAEzChB,EAAA,YACCA,EAAA,QAAMyC,KAAK,c,CASV,cAAAE,CAAea,GACtBA,EAAEC,iB,CAGK,cAAAT,CAAeQ,GACtBA,EAAEC,kBACF5D,KAAK6D,SAASC,KAAK,CAClBC,UAAWnD,EAAeC,KAC1B8B,MAAO3C,KAAK2C,MACZP,QAASpC,KAAKoC,QACd4B,cAAeL,G,CAIT,aAAAN,CAAcM,GACrBA,EAAEC,kBACF5D,KAAKiE,QAAQH,KAAK,CACjBC,UAAWnD,EAAeC,KAC1B8B,MAAO3C,KAAK2C,MACZP,QAASpC,KAAKoC,QACd4B,cAAeL,G,CAIT,eAAAV,CAAgBU,GACvB3D,KAAKoC,QAAWuB,EAAEO,OAA4B9B,QAC9CuB,EAAEC,kBACF5D,KAAKmE,UAAUL,KAAK,CACnBC,UAAWnD,EAAeC,KAC1B8B,MAAO3C,KAAK2C,MACZP,QAASpC,KAAKoC,QACd4B,cAAeL,G,CAQjB,YAAMS,GACL,OAAOpE,KAAKwD,Q,CAOb,kBAAM3B,GACLwC,EAAgBrE,KAAKyD,gBAAiB,oBAAqB7C,EAAeC,MAC1EwD,EAAgBrE,KAAK0D,eAAgB,mBAAoB9C,EAAeC,MACxEyD,EAAqBtE,KAAKwB,YAAcxB,KAAKC,QAASD,KAAK0D,eAAgB9C,EAAeC,K"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as t,r as s,h as i,H as n,g as e}from"./p-10cbc3fe.js";import{i as o,a}from"./p-cac3881f.js";import{g as r}from"./p-3f37ddb6.js";import"./p-03990da5.js";var c;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(c||(c={}));const h={root:"gov-icon",holder:"gov-icon__holder"};const l="0.0.61";const f=()=>l;const p={};const d={};const u=t=>t.startsWith("http://")||t.startsWith("https://");const g=(s,i,n)=>{if(u(s)){return`${s}/${n}/${i}.svg?v=${f()}`}return t(`${s}/${n}/${i}.svg`)+`?v=${f()}`};async function m({name:t,type:s}){const i=s+"-"+t;if(p[i]){return p[i]}if(!d[i]){d[i]=fetch(g(o(),t,s)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const n=await d[i];p[i]=n;return n}const y=".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{display:inline-flex;width:100%;height:100%}.gov-icon svg{display:inline-flex;width:100%;height:100%;max-width:100%;max-height:100%}";const v=class{constructor(t){s(this,t);this.name=null;this.type="basic";this.iconData=undefined;this.visible=false;this.error=false;this.h=r(this.host)}async loadIconPathData(){const{name:t,visible:s,type:i}=this;if(!t||!s){return}try{this.iconData=await m({name:t,type:i})}catch(t){this.error=true}}connectedCallback(){if(a()){this.visible=true;this.loadIconPathData().finally()}else{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){if(this.intersectionObserver){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(h.root)},i("span",{class:h.holder,innerHTML:this.iconData}))}static get assetsDirs(){return["assets"]}get host(){return e(this)}static get watchers(){return{name:["loadIconPathData"]}}};v.style=y;export{v as gov_icon};
|
|
2
|
+
//# sourceMappingURL=p-bc6f1479.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Types","IconClass","root","holder","dsVersion","version","iconCache","requestCache","isExternalUrl","path","startsWith","iconUrl","name","type","getAssetPath","async","fetchIcon","cacheKey","fetch","iconsPath","then","resp","status","text","Error","govIconCss","GovIcon","constructor","hostRef","this","h","govHost","host","loadIconPathData","visible","iconData","e","error","connectedCallback","iconsLazyLoad","finally","waitUntilVisible","disconnectedCallback","intersectionObserver","disconnect","componentWillLoad","callback","window","IntersectionObserver","entries","forEach","entry","isIntersecting","rootMargin","observe","render","Host","class","classes","innerHTML"],"sources":["../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/components/gov-icon/gov-icon.scss?tag=gov-icon","../../../packages/core/src/components/gov-icon/gov-icon.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tif (!requestCache[cacheKey]) {\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","/*\n * Icon\n */\n\n$class: \".gov-icon\";\n\n#{$class} {\n\tdisplay: inline-flex;\n\t&__holder {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\tsvg {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmax-width: 100%;\n\t\tmax-height: 100%;\n\t}\n}\n","import { Build, Component, Element, h, Host, Prop, State, Watch } from \"@stencil/core\"\nimport { IconClass, Type } from \"./constants\"\nimport { fetchIcon } from \"../../utils/icon.utils\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { iconsLazyLoad } from \"../../helpers/Dom/win\"\n\n@Component({\n\tassetsDirs: [\"assets\"],\n\tstyleUrl: \"gov-icon.scss\",\n\ttag: \"gov-icon\",\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Name of icon\n\t */\n\t@Prop() name: string = null\n\t/**\n\t * Type of icon\n\t */\n\t@Prop() type: Type = \"basic\"\n\t@State() private iconData: string\n\t@State() private visible = false\n\t@State() private error = false\n\tprivate intersectionObserver: IntersectionObserver\n\n\t@Watch(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst { name, visible, type } = this\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tthis.iconData = await fetchIcon({ name, type })\n\t\t} catch (e) {\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\tconnectedCallback(): void {\n\t\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif (this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{ rootMargin: \"50px\" },\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)}>\n\t\t\t\t<span class={IconClass.holder} innerHTML={this.iconData}></span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"kKAEA,IAAKA,GAAL,SAAKA,GACJA,EAAA,iBACAA,EAAA,qBACAA,EA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AAU,WACTL,KAAKI,kBAAkB,G,EAKhC,oBAAAS,GACC,GAAIb,KAAKc,qBAAsB,CAC9Bd,KAAKc,qBAAqBC,aAC1Bf,KAAKc,qBAAuB,I,EAI9B,uBAAME,SACChB,KAAKI,kB,CAGJ,gBAAAQ,CAAiBK,GACxB,UAA+BC,SAAW,cAAiBA,OAAeC,qBAAsB,CAC/FF,IACA,M,CAEDjB,KAAKc,qBAAuB,IAAIK,sBAC/BC,IACCA,EAAQC,SAAQC,IACf,GAAIA,EAAMC,eAAgB,CACzB,GAAIvB,KAAKc,qBAAsB,CAC9Bd,KAAKc,qBAAqBC,aAC1Bf,KAAKc,qBAAuB,I,CAE7BG,G,IAEA,GAEH,CAAEO,WAAY,SAEfxB,KAAKc,qBAAqBW,QAAQzB,KAAKG,K,CAGxC,MAAAuB,GACC,GAAI1B,KAAKQ,MAAO,CACf,OAAO,I,CAER,OACCP,EAAC0B,EAAI,CAACC,MAAO5B,KAAKC,EAAE4B,QAAQzD,EAAUC,OACrC4B,EAAA,QAAM2B,MAAOxD,EAAUE,OAAQwD,UAAW9B,KAAKM,W"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as i,c as e,h as r,H as a,g as o}from"./p-10cbc3fe.js";import{a as t}from"./p-561fa17b.js";import{v}from"./p-26acf964.js";import{W as n,c as d}from"./p-6834d779.js";import{c as s}from"./p-24636c53.js";import{g,b as l,t as m}from"./p-3f37ddb6.js";import{F as c}from"./p-1c1d0bbe.js";import"./p-ff7365ae.js";import"./p-55500e5a.js";import"./p-03990da5.js";const z='.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-wizard-item{position:relative;display:block;width:100%;margin-bottom:1rem;background:var(--gov-wizard-bg-color, var(--gov-color-neutral-white))}.gov-wizard-item__header{position:relative;width:100%}.gov-wizard-item__arrow{flex:0 0 auto;width:0.75rem;height:0.75rem}.gov-wizard-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-wizard-item__prefix{display:flex;flex:0 0 auto;justify-content:center;align-items:center;border-radius:50%;text-align:center}.gov-wizard-item__prefix .gov-icon{width:45%;height:45%}.gov-wizard-item__prefix span[slot=prefix]{display:flex;justify-content:center;align-items:center;width:100%;height:100%}.gov-wizard-item__name{display:flex;flex-direction:column}.gov-wizard-item__label{display:flex;gap:0.5rem;align-items:center;font-weight:var(--gov-wizard-title-font-weight, 700)}.gov-wizard-item__annot{color:var(--gov-color-secondary)}.gov-wizard-item__content>*:last-child{margin-bottom:0}.gov-wizard-item[variant=primary] .gov-wizard-item__header{color:var(--gov-wizard-primary-color, var(--gov-color-primary-800))}.gov-wizard-item[variant=primary] .gov-wizard-item__prefix{background:var(--gov-wizard-primary-indicator-bg, var(--gov-color-primary-300));color:var(--gov-wizard-primary-indicator-color, var(--gov-color-primary-800))}.gov-wizard-item[variant=secondary] .gov-wizard-item__header{color:var(--gov-wizard-secondary-color, var(--gov-color-secondary-700))}.gov-wizard-item[variant=secondary] .gov-wizard-item__prefix{background:var(--gov-wizard-secondary-indicator-bg, var(--gov-color-secondary-400));color:var(--gov-wizard-secondary-indicator-color, var(--gov-color-secondary-700))}.gov-wizard-item[variant=success] .gov-wizard-item__header{color:var(--gov-wizard-success-color, var(--gov-color-success-500))}.gov-wizard-item[variant=success] .gov-wizard-item__prefix{background:var(--gov-wizard-success-indicator-bg, var(--gov-color-success));color:var(--gov-wizard-success-indicator-color, var(--gov-color-neutral-white))}.gov-wizard-item[variant=error] .gov-wizard-item__header{color:var(--gov-wizard-error-color, var(--gov-color-error-500))}.gov-wizard-item[variant=error] .gov-wizard-item__prefix{background:var(--gov-wizard-error-indicator-bg, var(--gov-color-error));color:var(--gov-wizard-error-indicator-color, var(--gov-color-neutral-white))}.gov-wizard-item[variant=warning] .gov-wizard-item__header{color:var(--gov-wizard-warning-color, var(--gov-color-warning-500))}.gov-wizard-item[variant=warning] .gov-wizard-item__prefix{background:var(--gov-wizard-warning-indicator-bg, var(--gov-color-warning));color:var(--gov-wizard-warning-indicator-color, var(--gov-color-neutral-white))}.gov-wizard-item__header{gap:1rem;padding:1rem;border-radius:0;text-align:left;transition:150ms linear color}.gov-wizard-item__header:focus{outline:none}.gov-wizard-item__header:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-wizard-item__prefix{position:absolute;left:1rem}.gov-wizard-item__header[aria-expanded=true] .gov-wizard-item__label .gov-icon{transform:scale(-1)}.gov-wizard-item[size=xs] .gov-wizard-item__title,.gov-wizard-item[size=s] .gov-wizard-item__title,.gov-wizard-item[size=m] .gov-wizard-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-wizard-item[size=xs] .gov-wizard-item__annot,.gov-wizard-item[size=s] .gov-wizard-item__annot,.gov-wizard-item[size=m] .gov-wizard-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-wizard-item[size=xs] .gov-wizard-item__prefix,.gov-wizard-item[size=s] .gov-wizard-item__prefix,.gov-wizard-item[size=m] .gov-wizard-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-wizard-xs-indicator-size, 1.5rem);height:var(--gov-wizard-xs-indicator-size, 1.5rem);top:var(--gov-wizard-xs-top, 1rem)}.gov-wizard-item[size=xs] .gov-wizard-item__prefix+.gov-wizard-item__header,.gov-wizard-item[size=s] .gov-wizard-item__prefix+.gov-wizard-item__header,.gov-wizard-item[size=m] .gov-wizard-item__prefix+.gov-wizard-item__header{padding:var(--gov-wizard-xs-header-padding, 1rem 1rem 1rem 3.5rem)}.gov-wizard-item[size=xs] .gov-wizard-item__content,.gov-wizard-item[size=s] .gov-wizard-item__content,.gov-wizard-item[size=m] .gov-wizard-item__content{padding:var(--gov-wizard-content-padding, 0rem 1rem 1rem 1rem)}@media not all and (pointer: coarse){.gov-wizard-item[variant=primary][collapsible=""] .gov-wizard-item__header:hover,.gov-wizard-item[variant=primary][collapsible=true i] .gov-wizard-item__header:hover,.gov-wizard-item[variant=primary][collapsible="1"] .gov-wizard-item__header:hover{color:var(--gov-wizard-primary-hover-color, var(--gov-color-primary-900))}}@media not all and (pointer: coarse){.gov-wizard-item[variant=secondary][collapsible=""] .gov-wizard-item__header:hover,.gov-wizard-item[variant=secondary][collapsible=true i] .gov-wizard-item__header:hover,.gov-wizard-item[variant=secondary][collapsible="1"] .gov-wizard-item__header:hover{color:var(--gov-wizard-secondary-hover-color, var(--gov-color-secondary-800))}}@media not all and (pointer: coarse){.gov-wizard-item[variant=success][collapsible=""] .gov-wizard-item__header:hover,.gov-wizard-item[variant=success][collapsible=true i] .gov-wizard-item__header:hover,.gov-wizard-item[variant=success][collapsible="1"] .gov-wizard-item__header:hover{color:var(--gov-wizard-success-hover-color, var(--gov-color-success-600))}}@media not all and (pointer: coarse){.gov-wizard-item[variant=error][collapsible=""] .gov-wizard-item__header:hover,.gov-wizard-item[variant=error][collapsible=true i] .gov-wizard-item__header:hover,.gov-wizard-item[variant=error][collapsible="1"] .gov-wizard-item__header:hover{color:var(--gov-wizard-error-hover-color, var(--gov-color-error-600))}}@media not all and (pointer: coarse){.gov-wizard-item[variant=warning][collapsible=""] .gov-wizard-item__header:hover,.gov-wizard-item[variant=warning][collapsible=true i] .gov-wizard-item__header:hover,.gov-wizard-item[variant=warning][collapsible="1"] .gov-wizard-item__header:hover{color:var(--gov-wizard-warning-hover-color, var(--gov-color-warning-600))}}button.gov-wizard-item__header{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;justify-content:flex-start;text-align:left}button.gov-wizard-item__header:focus{outline:none}@media (min-width: 30em){.gov-wizard-item[size=s] .gov-wizard-item__title,.gov-wizard-item[size=m] .gov-wizard-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-wizard-item[size=s] .gov-wizard-item__prefix,.gov-wizard-item[size=m] .gov-wizard-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-wizard-s-indicator-size, 2rem);height:var(--gov-wizard-s-indicator-size, 2rem);top:var(--gov-wizard-s-top, 0.8125rem)}.gov-wizard-item[size=s] .gov-wizard-item__prefix+.gov-wizard-item__header,.gov-wizard-item[size=m] .gov-wizard-item__prefix+.gov-wizard-item__header{padding:var(--gov-wizard-s-header-padding, 1rem 1rem 1rem 4rem)}}@media (min-width: 48em){.gov-wizard-item[size=m] .gov-wizard-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-wizard-item[size=m] .gov-wizard-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-wizard-m-indicator-size, 2.5rem);height:var(--gov-wizard-m-indicator-size, 2.5rem);top:var(--gov-wizard-m-top, 0.5625rem)}.gov-wizard-item[size=m] .gov-wizard-item__prefix+.gov-wizard-item__header{padding:var(--gov-wizard-m-header-padding, 1rem 1rem 1rem 4.5rem)}.gov-wizard-item[size=xs] .gov-wizard-item__content{padding:var(--gov-wizard-xs-content-padding, 0rem 1rem 1rem 3.5rem)}.gov-wizard-item[size=s] .gov-wizard-item__content{padding:var(--gov-wizard-s-content-padding, 0rem 1rem 1rem 4rem)}.gov-wizard-item[size=m] .gov-wizard-item__content{padding:var(--gov-wizard-m-content-padding, 0rem 1rem 1rem 4.5rem)}}';var w;(function(i){i["DIV"]="div";i["BUTTON"]="button"})(w||(w={}));const h=class{constructor(r){i(this,r);this.govChange=e(this,"gov-change",7);this.variant="primary";this.size="m";this.identifier=undefined;this.collapsible=false;this.annotation=undefined;this.label=undefined;this.disabled=false;this.isExpanded=false;this.labelTag="h3";this.h=g(this.host);this.triggerId=s("GovWizardItem");this.contentId=s("GovWizardContent")}validateLabel(i){if(!i){t(`[${n.root}]: Parameter label is required.`)}}validateTriggerTag(i){const e=["h1","h2","h3","h4","h5","h6","span"];if(i){if(!e.includes(i)){t(`[${n.root}]: Tag ${i} is not allowed.`)}}}validateVariant(i){v(d,i,n.root)}emmitChange(){this.govChange.emit({expanded:this.isExpanded,component:n.root})}componentWillLoad(){this.validateLabel(this.label);this.validateVariant(this.variant);this.validateTriggerTag(this.labelTag)}render(){const i=this.identifier||this.triggerId;const e=this.labelTag;const o=this.collapsible?w.BUTTON:w.DIV;const t=this.h.hasSlot("prefix")&&r("span",{class:n.prefix},r("slot",{name:"prefix"}));const v=r(e,{class:n.title},r("span",{class:n.name},r("span",{class:n.label},r("span",null,this.label),this.collapsible&&r("gov-icon",{class:n.arrow,name:"chevron-down"})),this.annotation&&r("span",{class:n.annot},this.annotation)));return r(a,{class:this.h.classes(n.root),"is-expanded":this.isExpanded,variant:this.variant,size:this.size,role:"listitem",collapsible:this.collapsible},this.collapsible?r(c,null,t,r(o,{id:i,class:n.header,"aria-expanded":l(this.isExpanded),"aria-controls":this.contentId,disabled:this.disabled,"aria-disabled":m(this.disabled),onClick:i=>{i.preventDefault();i.stopPropagation();this.collapsible?this.toggle():false}},v)):r(c,null,t,r("div",{class:n.header},v)),this.collapsible?r("div",{class:n.content,id:this.contentId,"aria-hidden":l(!this.isExpanded),hidden:!this.isExpanded,"aria-labelledby":i},r("slot",null)):r("div",{class:n.content,"aria-hidden":l(!this.isExpanded),hidden:!this.isExpanded},r("slot",null)))}async open(){this.isExpanded=true;this.emmitChange()}async close(){this.isExpanded=false;this.emmitChange()}async toggle(){this.isExpanded=!this.isExpanded;this.emmitChange()}async currentState(){return this.isExpanded}get host(){return o(this)}static get watchers(){return{label:["validateLabel"],labelTag:["validateTriggerTag"],variant:["validateVariant"]}}};h.style=z;export{h as gov_wizard_item};
|
|
2
|
+
//# sourceMappingURL=p-c5d3efc2.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["govWizardItemCss","Tags","GovWizardItem","constructor","hostRef","this","h","govHost","host","triggerId","createID","contentId","validateLabel","newValue","govErrorLog","WizardItemClass","root","validateTriggerTag","validTags","includes","validateVariant","validateProp","WizardVariants","emmitChange","govChange","emit","expanded","isExpanded","component","componentWillLoad","label","variant","labelTag","render","identifier","LabelTag","Tag","collapsible","BUTTON","DIV","prefixSlot","hasSlot","class","prefix","name","title","arrow","annotation","annot","Host","classes","size","role","Fragment","id","header","booleanString","disabled","toBoolAttrIfDefined","onClick","e","preventDefault","stopPropagation","toggle","content","hidden","open","close","currentState"],"sources":["../../../packages/core/src/components/gov-wizard/gov-wizard-item.scss?tag=gov-wizard-item","../../../packages/core/src/components/gov-wizard/gov-wizard-item.tsx"],"sourcesContent":["/*\n * Wizard - Item\n */\n\n@import \"../gov-wizard/gov-wizard-item-core.scss\";\n$class: \".gov-wizard-item\";\n\n#{$class} {\n\t@include wizard-item-core;\n\tmargin-bottom: rem-calc(16);\n\tbackground: $wizard-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\t&__label {\n\t\tfont-weight: $wizard-title-font-weight;\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($wizard-sizes, $size-xs, \"font-size\"));\n\t\t\t}\n\t\t\t&__annot {\n\t\t\t\t@include typography(deep-map-get($wizard-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($wizard-sizes, $size-xs, \"font-size-indicator\"));\n\t\t\t\twidth: deep-map-get($wizard-sizes, $size-xs, \"indicator-size\");\n\t\t\t\theight: deep-map-get($wizard-sizes, $size-xs, \"indicator-size\");\n\t\t\t\ttop: deep-map-get($wizard-sizes, $size-xs, \"top\");\n\t\t\t\t+ #{$class}__header {\n\t\t\t\t\tpadding: deep-map-get($wizard-sizes, $size-xs, \"header-padding\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__content {\n\t\t\t\tpadding: $wizard-content-padding;\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $definitions in $wizard-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($wizard-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($wizard-sizes, $size-s, \"font-size-indicator\"));\n\t\t\t\t\twidth: deep-map-get($wizard-sizes, $size-s, \"indicator-size\");\n\t\t\t\t\theight: deep-map-get($wizard-sizes, $size-s, \"indicator-size\");\n\t\t\t\t\ttop: deep-map-get($wizard-sizes, $size-s, \"top\");\n\t\t\t\t\t+ #{$class}__header {\n\t\t\t\t\t\tpadding: deep-map-get($wizard-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($wizard-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($wizard-sizes, $size-m, \"font-size-indicator\"));\n\t\t\t\t\twidth: deep-map-get($wizard-sizes, $size-m, \"indicator-size\");\n\t\t\t\t\theight: deep-map-get($wizard-sizes, $size-m, \"indicator-size\");\n\t\t\t\t\ttop: deep-map-get($wizard-sizes, $size-m, \"top\");\n\t\t\t\t\t+ #{$class}__header {\n\t\t\t\t\t\tpadding: deep-map-get($wizard-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 $wizard-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, WizardItemClass } from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { booleanString, govHost, toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { WizardItemEvent } from \"./gov-wizard-item.types\"\nimport Fragment from \"../../helpers/Fragment\"\n\nenum Tags {\n\tDIV = \"div\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-wizard-item\",\n\tstyleUrl: \"gov-wizard-item.scss\",\n})\nexport class GovWizardItem {\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(\"GovWizardItem\")\n\t\tthis.contentId = createID(\"GovWizardContent\")\n\t}\n\n\t@Element() readonly host: HTMLGovWizardItemElement\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant?: WizardVariantsType = \"primary\"\n\t/**\n\t * Size of wizard\n\t */\n\t@Prop() readonly size?: WizardSizesType = \"m\"\n\t/**\n\t * Custom wizard item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Defines weather the wizard item can be collapsible\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Item annotation of the wizard\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Item label of the wizard\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Makes the wizard 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<WizardItemEvent>\n\n\t@Watch(\"label\")\n\tprivate validateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${WizardItemClass.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(`[${WizardItemClass.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, WizardItemClass.root)\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govChange.emit({ expanded: this.isExpanded, component: WizardItemClass.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={WizardItemClass.prefix}><slot name=\"prefix\" /></span>)\n\n\t\tconst label = (\n\t\t\t<LabelTag class={WizardItemClass.title}>\n\t\t\t\t<span class={WizardItemClass.name}>\n\t\t\t\t\t<span class={WizardItemClass.label}>\n\t\t\t\t\t\t<span>{this.label}</span>\n\t\t\t\t\t\t{this.collapsible && <gov-icon class={WizardItemClass.arrow} name=\"chevron-down\"></gov-icon>}\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{this.annotation && <span class={WizardItemClass.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(WizardItemClass.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={WizardItemClass.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={WizardItemClass.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={WizardItemClass.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={WizardItemClass.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 Wizard\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 Wizard\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 * Wizard 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"],"mappings":"2WAAA,MAAMA,EAAmB,2rSCUzB,IAAKC,GAAL,SAAKA,GACJA,EAAA,aACAA,EAAA,kBACA,EAHD,CAAKA,MAAI,K,MASIC,EAAa,MAKzB,WAAAC,CAAAC,G,6DAUgD,U,UAIN,I,2CAQF,M,6DAYH,M,gBAI2B,M,cAIF,KAzC7DC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,UAAYC,EAAS,iBAC1BL,KAAKM,UAAYD,EAAS,mB,CA8CnB,aAAAE,CAAcC,GACrB,IAAKA,EAAU,CACdC,EAAY,IAAIC,EAAgBC,sC,EAK1B,kBAAAC,CAAmBJ,GAC1B,MAAMK,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,QACvD,GAAIL,EAAU,CACb,IAAKK,EAAUC,SAASN,GAAW,CAClCC,EAAY,IAAIC,EAAgBC,cAAcH,oB,GAMzC,eAAAO,CAAgBP,GACvBQ,EAAaC,EAAgBT,EAAUE,EAAgBC,K,CAGhD,WAAAO,GACPlB,KAAKmB,UAAUC,KAAK,CAAE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W,KAAK,GAGxCjC,IAIHxB,EAAC+C,EAAQ,KACPb,EACDlC,EAAA,OAAKoC,MAAO3B,EAAgBwC,QAASzB,IAGtCzB,KAAKgC,YACL/B,EAAA,OACCoC,MAAO3B,EAAgBiD,QACvBV,GAAIjD,KAAKM,UAAS,cACL6C,GAAenD,KAAKsB,YACjCsC,QAAS5D,KAAKsB,WAAU,kBACPlB,GAEjBH,EAAA,cAGDA,EAAA,OAAKoC,MAAO3B,EAAgBiD,QAAO,cAAeR,GAAenD,KAAKsB,YAAasC,QAAS5D,KAAKsB,YAChGrB,EAAA,c,CAWL,UAAM4D,GACL7D,KAAKsB,WAAa,KAClBtB,KAAKkB,a,CAOC,WAAM4C,GACZ9D,KAAKsB,WAAa,MAClBtB,KAAKkB,a,CAOC,YAAMwC,GACZ1D,KAAKsB,YAActB,KAAKsB,WACxBtB,KAAKkB,a,CAOC,kBAAM6C,GACZ,OAAO/D,KAAKsB,U"}
|
|
1
|
+
{"version":3,"names":["govWizardItemCss","Tags","GovWizardItem","constructor","hostRef","this","h","govHost","host","triggerId","createID","contentId","validateLabel","newValue","govErrorLog","WizardItemClass","root","validateTriggerTag","validTags","includes","validateVariant","validateProp","WizardVariants","emmitChange","govChange","emit","expanded","isExpanded","component","componentWillLoad","label","variant","labelTag","render","identifier","LabelTag","Tag","collapsible","BUTTON","DIV","prefixSlot","hasSlot","class","prefix","name","title","arrow","annotation","annot","Host","classes","size","role","Fragment","id","header","booleanString","disabled","toBoolAttrIfDefined","onClick","e","preventDefault","stopPropagation","toggle","content","hidden","open","close","currentState"],"sources":["../../../packages/core/src/components/gov-wizard/gov-wizard-item.scss?tag=gov-wizard-item","../../../packages/core/src/components/gov-wizard/gov-wizard-item.tsx"],"sourcesContent":["/*\n * Wizard - Item\n */\n\n@import \"../gov-wizard/gov-wizard-item-core.scss\";\n$class: \".gov-wizard-item\";\n\n#{$class} {\n\t@include wizard-item-core;\n\tmargin-bottom: rem-calc(16);\n\tbackground: $wizard-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($wizard-sizes, $size-xs, \"font-size\"));\n\t\t\t}\n\t\t\t&__annot {\n\t\t\t\t@include typography(deep-map-get($wizard-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($wizard-sizes, $size-xs, \"font-size-indicator\"));\n\t\t\t\twidth: deep-map-get($wizard-sizes, $size-xs, \"indicator-size\");\n\t\t\t\theight: deep-map-get($wizard-sizes, $size-xs, \"indicator-size\");\n\t\t\t\ttop: deep-map-get($wizard-sizes, $size-xs, \"top\");\n\t\t\t\t+ #{$class}__header {\n\t\t\t\t\tpadding: deep-map-get($wizard-sizes, $size-xs, \"header-padding\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__content {\n\t\t\t\tpadding: $wizard-content-padding;\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $definitions in $wizard-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($wizard-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($wizard-sizes, $size-s, \"font-size-indicator\"));\n\t\t\t\t\twidth: deep-map-get($wizard-sizes, $size-s, \"indicator-size\");\n\t\t\t\t\theight: deep-map-get($wizard-sizes, $size-s, \"indicator-size\");\n\t\t\t\t\ttop: deep-map-get($wizard-sizes, $size-s, \"top\");\n\t\t\t\t\t+ #{$class}__header {\n\t\t\t\t\t\tpadding: deep-map-get($wizard-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($wizard-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($wizard-sizes, $size-m, \"font-size-indicator\"));\n\t\t\t\t\twidth: deep-map-get($wizard-sizes, $size-m, \"indicator-size\");\n\t\t\t\t\theight: deep-map-get($wizard-sizes, $size-m, \"indicator-size\");\n\t\t\t\t\ttop: deep-map-get($wizard-sizes, $size-m, \"top\");\n\t\t\t\t\t+ #{$class}__header {\n\t\t\t\t\t\tpadding: deep-map-get($wizard-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 $wizard-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, WizardItemClass } from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { booleanString, govHost, toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { WizardItemEvent } from \"./gov-wizard-item.types\"\nimport Fragment from \"../../helpers/Fragment\"\n\nenum Tags {\n\tDIV = \"div\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-wizard-item\",\n\tstyleUrl: \"gov-wizard-item.scss\",\n})\nexport class GovWizardItem {\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(\"GovWizardItem\")\n\t\tthis.contentId = createID(\"GovWizardContent\")\n\t}\n\n\t@Element() readonly host: HTMLGovWizardItemElement\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant?: WizardVariantsType = \"primary\"\n\t/**\n\t * Size of wizard\n\t */\n\t@Prop() readonly size?: WizardSizesType = \"m\"\n\t/**\n\t * Custom wizard item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Defines weather the wizard item can be collapsible\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Item annotation of the wizard\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Item label of the wizard\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Makes the wizard 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<WizardItemEvent>\n\n\t@Watch(\"label\")\n\tprivate validateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${WizardItemClass.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(`[${WizardItemClass.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, WizardItemClass.root)\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govChange.emit({ expanded: this.isExpanded, component: WizardItemClass.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={WizardItemClass.prefix}><slot name=\"prefix\" /></span>)\n\n\t\tconst label = (\n\t\t\t<LabelTag class={WizardItemClass.title}>\n\t\t\t\t<span class={WizardItemClass.name}>\n\t\t\t\t\t<span class={WizardItemClass.label}>\n\t\t\t\t\t\t<span>{this.label}</span>\n\t\t\t\t\t\t{this.collapsible && <gov-icon class={WizardItemClass.arrow} name=\"chevron-down\"></gov-icon>}\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{this.annotation && <span class={WizardItemClass.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(WizardItemClass.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={WizardItemClass.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={WizardItemClass.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={WizardItemClass.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={WizardItemClass.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 Wizard\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 Wizard\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 * Wizard 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"],"mappings":"2WAAA,MAAMA,EAAmB,mqSCUzB,IAAKC,GAAL,SAAKA,GACJA,EAAA,aACAA,EAAA,kBACA,EAHD,CAAKA,MAAI,K,MASIC,EAAa,MAKzB,WAAAC,CAAAC,G,6DAUgD,U,UAIN,I,2CAQF,M,6DAYH,M,gBAI2B,M,cAIF,KAzC7DC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,UAAYC,EAAS,iBAC1BL,KAAKM,UAAYD,EAAS,mB,CA8CnB,aAAAE,CAAcC,GACrB,IAAKA,EAAU,CACdC,EAAY,IAAIC,EAAgBC,sC,EAK1B,kBAAAC,CAAmBJ,GAC1B,MAAMK,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,QACvD,GAAIL,EAAU,CACb,IAAKK,EAAUC,SAASN,GAAW,CAClCC,EAAY,IAAIC,EAAgBC,cAAcH,oB,GAMzC,eAAAO,CAAgBP,GACvBQ,EAAaC,EAAgBT,EAAUE,EAAgBC,K,CAGh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