@gov-design-system-ce/components 4.2.3 → 4.2.5
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-button.cjs.entry.js +4 -3
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-empty.cjs.entry.js +7 -1
- package/dist/cjs/gov-empty.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-flex_3.cjs.entry.js +3 -3
- package/dist/cjs/gov-flex_3.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-input_2.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-input_2.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-infobar.cjs.entry.js +6 -2
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-button/button/gov-button.js +22 -3
- package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
- package/dist/collection/components/gov-empty/constants.js +5 -0
- package/dist/collection/components/gov-empty/constants.js.map +1 -1
- package/dist/collection/components/gov-empty/gov-empty.js +26 -1
- package/dist/collection/components/gov-empty/gov-empty.js.map +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.js +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.js.map +1 -1
- package/dist/collection/components/gov-infobar/gov-infobar.js +6 -2
- package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +6 -6
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js.map +1 -1
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js +5 -5
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js.map +1 -1
- package/dist/collection/pages/Banner.js +10 -0
- package/dist/collection/pages/Banner.js.map +1 -1
- package/dist/collection/pages/Button.js +18 -0
- package/dist/collection/pages/Button.js.map +1 -1
- package/dist/collection/pages/Empty.js +26 -0
- package/dist/collection/pages/Empty.js.map +1 -1
- package/dist/collection/pages/Forms.js +31 -31
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Home.js +8 -2
- package/dist/collection/pages/Home.js.map +1 -1
- package/dist/collection/pages/Loading.js +5 -1
- package/dist/collection/pages/Loading.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-blockquote.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-dialog.js +1 -1
- package/dist/components/gov-empty.js +1 -1
- package/dist/components/gov-empty.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-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-label.js +1 -1
- package/dist/components/gov-form-label.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-range.js +1 -1
- package/dist/components/gov-form-range.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-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-link.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-skeleton.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-theme-switch.js +1 -1
- package/dist/components/gov-theme-switch.js.map +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-11fa70ff.js → p-106a27de.js} +2 -2
- package/dist/components/{p-1572effa.js → p-246216b9.js} +2 -2
- package/dist/components/{p-8e888b01.js → p-2d1d727d.js} +2 -2
- package/dist/components/{p-93f4a242.js → p-5c247bc2.js} +2 -2
- package/dist/components/p-80c889e2.js +2 -0
- package/dist/components/p-80c889e2.js.map +1 -0
- package/dist/components/{p-5b0a3c98.js → p-d1a59544.js} +2 -2
- package/dist/components/{p-c150610c.js → p-f7ca5e39.js} +2 -2
- package/dist/components/{p-313b4611.js → p-fcc6dd1d.js} +2 -2
- package/dist/components/p-fcc6dd1d.js.map +1 -0
- package/dist/core/core.css +132 -57
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-2fd53723.entry.js +2 -0
- package/dist/core/{p-b9f1c2ef.entry.js.map → p-2fd53723.entry.js.map} +1 -1
- package/dist/core/p-39d6e51d.entry.js +2 -0
- package/dist/core/p-39d6e51d.entry.js.map +1 -0
- package/dist/core/p-ac800db4.entry.js +2 -0
- package/dist/core/p-ac800db4.entry.js.map +1 -0
- package/dist/core/{p-83e14b47.entry.js → p-d3014dc5.entry.js} +2 -2
- package/dist/core/{p-83e14b47.entry.js.map → p-d3014dc5.entry.js.map} +1 -1
- package/dist/core/p-d45bcd43.entry.js +2 -0
- package/dist/core/p-d45bcd43.entry.js.map +1 -0
- package/dist/core/p-e7e00fe3.entry.js +2 -0
- package/dist/core/{p-774ea182.entry.js.map → p-e7e00fe3.entry.js.map} +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-button.entry.js +4 -3
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-empty.entry.js +7 -1
- package/dist/esm/gov-empty.entry.js.map +1 -1
- package/dist/esm/gov-flex_3.entry.js +3 -3
- package/dist/esm/gov-flex_3.entry.js.map +1 -1
- package/dist/esm/gov-form-input_2.entry.js +1 -1
- package/dist/esm/gov-form-input_2.entry.js.map +1 -1
- package/dist/esm/gov-form-label.entry.js +1 -1
- package/dist/esm/gov-form-label.entry.js.map +1 -1
- package/dist/esm/gov-infobar.entry.js +6 -2
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +30 -17
- package/dist/hydrate/index.mjs +30 -17
- package/dist/types/components/gov-button/button/gov-button.d.ts +4 -0
- package/dist/types/components/gov-empty/constants.d.ts +5 -0
- package/dist/types/components/gov-empty/gov-empty.d.ts +5 -1
- package/dist/types/components/gov-infobar/gov-infobar.d.ts +2 -0
- package/dist/types/components/gov-loading/skeleton/gov-skeleton.d.ts +2 -2
- package/dist/types/components/gov-theme-switch/gov-theme-switch.d.ts +1 -1
- package/dist/types/components.d.ts +22 -6
- package/package.json +1 -1
- package/dist/components/p-313b4611.js.map +0 -1
- package/dist/components/p-62d01259.js +0 -2
- package/dist/components/p-62d01259.js.map +0 -1
- package/dist/core/p-774ea182.entry.js +0 -2
- package/dist/core/p-a1c825f3.entry.js +0 -2
- package/dist/core/p-a1c825f3.entry.js.map +0 -1
- package/dist/core/p-b9f1c2ef.entry.js +0 -2
- package/dist/core/p-c1584cfe.entry.js +0 -2
- package/dist/core/p-c1584cfe.entry.js.map +0 -1
- package/dist/core/p-c5a49469.entry.js +0 -2
- package/dist/core/p-c5a49469.entry.js.map +0 -1
- /package/dist/components/{p-11fa70ff.js.map → p-106a27de.js.map} +0 -0
- /package/dist/components/{p-1572effa.js.map → p-246216b9.js.map} +0 -0
- /package/dist/components/{p-8e888b01.js.map → p-2d1d727d.js.map} +0 -0
- /package/dist/components/{p-93f4a242.js.map → p-5c247bc2.js.map} +0 -0
- /package/dist/components/{p-5b0a3c98.js.map → p-d1a59544.js.map} +0 -0
- /package/dist/components/{p-c150610c.js.map → p-f7ca5e39.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmptySizesType } from './constants';
|
|
1
|
+
import { EmptyDirectionType, EmptySizesType } from './constants';
|
|
2
2
|
export declare class GovEmpty {
|
|
3
3
|
private h;
|
|
4
4
|
constructor();
|
|
@@ -7,6 +7,10 @@ export declare class GovEmpty {
|
|
|
7
7
|
* Element size.
|
|
8
8
|
*/
|
|
9
9
|
readonly size?: EmptySizesType;
|
|
10
|
+
/**
|
|
11
|
+
* Element direction
|
|
12
|
+
*/
|
|
13
|
+
readonly direction: EmptyDirectionType;
|
|
10
14
|
validateSize(newValue: string): void;
|
|
11
15
|
componentWillLoad(): void;
|
|
12
16
|
render(): any;
|
|
@@ -6,6 +6,7 @@ import { Attributes } from "../../helpers/Dom/attribute";
|
|
|
6
6
|
export declare class GovInfobar {
|
|
7
7
|
private h;
|
|
8
8
|
private attributeObserver;
|
|
9
|
+
private hydrated;
|
|
9
10
|
constructor();
|
|
10
11
|
host: HTMLGovInfobarElement;
|
|
11
12
|
/**
|
|
@@ -43,6 +44,7 @@ export declare class GovInfobar {
|
|
|
43
44
|
componentWillLoad(): void;
|
|
44
45
|
disconnectedCallback(): void;
|
|
45
46
|
onAriaAttributeChange(attributeName: string, newValue: string): void;
|
|
47
|
+
connectedCallback(): void;
|
|
46
48
|
render(): any;
|
|
47
49
|
onCloseHandler(e: CustomEvent<ButtonEvent>): void;
|
|
48
50
|
get isBold(): boolean;
|
|
@@ -22,11 +22,11 @@ export declare class GovSkeleton {
|
|
|
22
22
|
/**
|
|
23
23
|
* Width of the skeleton ex. 100px, 100%, auto etc.
|
|
24
24
|
*/
|
|
25
|
-
width
|
|
25
|
+
width?: string;
|
|
26
26
|
/**
|
|
27
27
|
* Height of the skeleton ex. 100px, 100%, auto etc.
|
|
28
28
|
*/
|
|
29
|
-
height
|
|
29
|
+
height?: string;
|
|
30
30
|
/**
|
|
31
31
|
* Animation type
|
|
32
32
|
*/
|
|
@@ -19,7 +19,7 @@ import { ControlGroupColorType } from "./components/gov-control-group/constants"
|
|
|
19
19
|
import { Nullable } from "./types/interfaces";
|
|
20
20
|
import { PositionType } from "./components/gov-button/dropdown/constants";
|
|
21
21
|
import { DropdownEvent } from "./components/gov-button/dropdown/gov-dropdown.types";
|
|
22
|
-
import { EmptySizesType } from "./components/gov-empty/constants";
|
|
22
|
+
import { EmptyDirectionType, EmptySizesType } from "./components/gov-empty/constants";
|
|
23
23
|
import { FlexSizesType } from "./components/gov-flex/constants";
|
|
24
24
|
import { FormAutocompleteEvent, GovFormAutocompleteItem } from "./components/gov-form/autocomplete/gov-form-autocomplete.types";
|
|
25
25
|
import { SizesType } from "./components/gov-form/autocomplete/constants";
|
|
@@ -81,7 +81,7 @@ export { ControlGroupColorType } from "./components/gov-control-group/constants"
|
|
|
81
81
|
export { Nullable } from "./types/interfaces";
|
|
82
82
|
export { PositionType } from "./components/gov-button/dropdown/constants";
|
|
83
83
|
export { DropdownEvent } from "./components/gov-button/dropdown/gov-dropdown.types";
|
|
84
|
-
export { EmptySizesType } from "./components/gov-empty/constants";
|
|
84
|
+
export { EmptyDirectionType, EmptySizesType } from "./components/gov-empty/constants";
|
|
85
85
|
export { FlexSizesType } from "./components/gov-flex/constants";
|
|
86
86
|
export { FormAutocompleteEvent, GovFormAutocompleteItem } from "./components/gov-form/autocomplete/gov-form-autocomplete.types";
|
|
87
87
|
export { SizesType } from "./components/gov-form/autocomplete/constants";
|
|
@@ -288,6 +288,10 @@ export namespace Components {
|
|
|
288
288
|
* Expands the button to fill 100% of the container width
|
|
289
289
|
*/
|
|
290
290
|
"expanded": boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Expands the button to fill 100% of the container width only on mobile
|
|
293
|
+
*/
|
|
294
|
+
"expandedMobile": boolean;
|
|
291
295
|
/**
|
|
292
296
|
* Same as original parameter
|
|
293
297
|
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable
|
|
@@ -534,6 +538,10 @@ export namespace Components {
|
|
|
534
538
|
"toggle": () => Promise<void>;
|
|
535
539
|
}
|
|
536
540
|
interface GovEmpty {
|
|
541
|
+
/**
|
|
542
|
+
* Element direction
|
|
543
|
+
*/
|
|
544
|
+
"direction": EmptyDirectionType;
|
|
537
545
|
/**
|
|
538
546
|
* Element size.
|
|
539
547
|
*/
|
|
@@ -1538,7 +1546,7 @@ export namespace Components {
|
|
|
1538
1546
|
/**
|
|
1539
1547
|
* Height of the skeleton ex. 100px, 100%, auto etc.
|
|
1540
1548
|
*/
|
|
1541
|
-
"height"
|
|
1549
|
+
"height"?: string;
|
|
1542
1550
|
/**
|
|
1543
1551
|
* Shape of the skeleton
|
|
1544
1552
|
*/
|
|
@@ -1550,7 +1558,7 @@ export namespace Components {
|
|
|
1550
1558
|
/**
|
|
1551
1559
|
* Width of the skeleton ex. 100px, 100%, auto etc.
|
|
1552
1560
|
*/
|
|
1553
|
-
"width"
|
|
1561
|
+
"width"?: string;
|
|
1554
1562
|
}
|
|
1555
1563
|
interface GovSpacer {
|
|
1556
1564
|
/**
|
|
@@ -1700,7 +1708,7 @@ export namespace Components {
|
|
|
1700
1708
|
/**
|
|
1701
1709
|
* Label in light mode
|
|
1702
1710
|
*/
|
|
1703
|
-
"ariaLabelLight"?: "
|
|
1711
|
+
"ariaLabelLight"?: "Přepnout na tmavý mód";
|
|
1704
1712
|
/**
|
|
1705
1713
|
* Display switch label
|
|
1706
1714
|
*/
|
|
@@ -2975,6 +2983,10 @@ declare namespace LocalJSX {
|
|
|
2975
2983
|
* Expands the button to fill 100% of the container width
|
|
2976
2984
|
*/
|
|
2977
2985
|
"expanded"?: boolean;
|
|
2986
|
+
/**
|
|
2987
|
+
* Expands the button to fill 100% of the container width only on mobile
|
|
2988
|
+
*/
|
|
2989
|
+
"expandedMobile"?: boolean;
|
|
2978
2990
|
/**
|
|
2979
2991
|
* Same as original parameter
|
|
2980
2992
|
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable
|
|
@@ -3209,6 +3221,10 @@ declare namespace LocalJSX {
|
|
|
3209
3221
|
"position"?: PositionType;
|
|
3210
3222
|
}
|
|
3211
3223
|
interface GovEmpty {
|
|
3224
|
+
/**
|
|
3225
|
+
* Element direction
|
|
3226
|
+
*/
|
|
3227
|
+
"direction"?: EmptyDirectionType;
|
|
3212
3228
|
/**
|
|
3213
3229
|
* Element size.
|
|
3214
3230
|
*/
|
|
@@ -4406,7 +4422,7 @@ declare namespace LocalJSX {
|
|
|
4406
4422
|
/**
|
|
4407
4423
|
* Label in light mode
|
|
4408
4424
|
*/
|
|
4409
|
-
"ariaLabelLight"?: "
|
|
4425
|
+
"ariaLabelLight"?: "Přepnout na tmavý mód";
|
|
4410
4426
|
/**
|
|
4411
4427
|
* Display switch label
|
|
4412
4428
|
*/
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@gov-design-system-ce/components",
|
|
3
3
|
"description": "This package includes Gov Design System Web Components and related utilities.",
|
|
4
4
|
"author": "Zdeněk Vítek",
|
|
5
|
-
"version": "4.2.
|
|
5
|
+
"version": "4.2.5",
|
|
6
6
|
"license": "EUPL v1.2 Licensed",
|
|
7
7
|
"main": "./dist/index.cjs.js",
|
|
8
8
|
"unpkg": "./dist/core/core.esm.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SkeletonSizes","pick","Sizes","Colors","SkeletonShapes","SkeletonAnimation","SkeletonClass","root","GovSkeleton","proxyCustomElement","H","constructor","this","items","h","govHost","host","validateSize","newValue","validateProp","validateShape","validateAnimation","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","size","shape","animation","init","inheritedAttributes","inheritAriaAttributes","componentWillUpdate","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","fill","style","dimenssionsStyles","width","height","render","Host","key","color","class","circle","line","progress","pulse","role","tabindex"],"sources":["../../../packages/core/src/components/gov-loading/skeleton/constants.ts","../../../packages/core/src/components/gov-loading/skeleton/gov-skeleton.tsx"],"sourcesContent":["import { pick } from \"../../../utils/utils\"\nimport { ValueOf } from \"../../../types/interfaces\"\nimport {Sizes} from \"../../../core/constants/sizes\";\nimport {Colors} from \"../../../core/constants/colors\";\n\nexport const SkeletonSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type SkeletonSizesType = `${ValueOf<typeof SkeletonSizes>}`\n\nexport const SkeletonColors = pick(Colors, [\"PRIMARY\", \"NEUTRAL\"])\nexport type SkeletonColorType = `${ValueOf<typeof SkeletonColors>}`\n\nexport enum SkeletonShapes {\n\tCIRCLE = 'circle',\n\tLINE = 'line'\n}\nexport type SkeletonShapesType = `${ValueOf<typeof SkeletonShapes>}`\n\nexport enum SkeletonAnimation {\n\tPULSE = 'pulse',\n\tPROGRESS = 'progress',\n\tFALSE = 'false'\n}\nexport type SkeletonAnimationType = `${ValueOf<typeof SkeletonAnimation>}`\n\nexport const SkeletonClass = {\n\troot: 'gov-skeleton',\n}\n","import {Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {\n\tSkeletonAnimation,\n\tSkeletonAnimationType,\n\tSkeletonClass,\n\tSkeletonColorType,\n\tSkeletonShapes,\n\tSkeletonShapesType,\n\tSkeletonSizes,\n} from \"./constants\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govHost} from \"../../../helpers/Dom/template\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormInputSizesType} from \"../../gov-form/input/constants\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: \"gov-skeleton\",\n})\nexport class GovSkeleton {\n\th: GovHost\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovSkeletonElement\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = \"m\"\n\t/**\n\t * Style variation of the skeleton.\n\t */\n\t@Prop() readonly color?: SkeletonColorType = \"neutral\"\n\t/**\n\t * Shape of the skeleton\n\t */\n\t@Prop() shape?: SkeletonShapesType = \"line\"\n\t/**\n\t * Width of the skeleton ex. 100px, 100%, auto etc.\n\t */\n\t@Prop() width: string = null\n\t/**\n\t * Height of the skeleton ex. 100px, 100%, auto etc.\n\t */\n\t@Prop() height: string = null\n\t/**\n\t * Animation type\n\t */\n\t@Prop() animation?: SkeletonAnimationType = \"progress\"\n\n\titems: number[] = []\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(SkeletonSizes, newValue, SkeletonClass.root)\n\t}\n\n\t@Watch('shape')\n\tvalidateShape(newValue: string): void {\n\t\tvalidateProp(SkeletonShapes, newValue, SkeletonClass.root)\n\t}\n\n\t@Watch('animation')\n\tvalidateAnimation(newValue: string): void {\n\t\tvalidateProp(SkeletonAnimation, newValue, SkeletonClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.validateShape(this.shape)\n\t\tthis.validateAnimation(this.animation)\n\t\tthis.init()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tcomponentWillUpdate() {\n\t\tthis.init()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tinit() {\n\t\tthis.items.fill(1)\n\t}\n\n\tget style() {\n\t\tconst dimenssionsStyles: {\n\t\t\twidth?: string,\n\t\t\theight?: string,\n\t\t} = {\n\t\t\twidth: null,\n\t\t\theight: null,\n\t\t}\n\t\tif (this.width) {\n\t\t\tdimenssionsStyles.width = this.width\n\t\t}\n\n\t\tif (this.height) {\n\t\t\tdimenssionsStyles.height = this.height\n\t\t}\n\n\t\treturn {...dimenssionsStyles}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host size={this.size}\n\t\t\t\t color={this.color}\n\t\t\t\t class={{\n\t\t\t\t\t [SkeletonClass.root]: true,\n\t\t\t\t\t circle: this.shape === \"circle\",\n\t\t\t\t\t line: this.shape === \"line\",\n\t\t\t\t\t progress: this.animation === \"progress\",\n\t\t\t\t\t pulse: this.animation === \"pulse\",\n\t\t\t\t }}\n\t\t\t\t {...this.inheritedAttributes}\n\t\t\t\t aria-busy=\"true\"\n\t\t\t\t aria-valuemin=\"0\"\n\t\t\t\t aria-valuemax=\"100\"\n\t\t\t\t role=\"progressbar\"\n\t\t\t\t tabindex=\"0\"\n\t\t\t\t style={this.style}>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"+RAKO,MAAMA,EAAgBC,EAAKC,EAAO,CAAC,MAAO,KAAM,KAAM,KAAM,QAGrCD,EAAKE,EAAQ,CAAC,UAAW,YAGvD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,mBACAA,EAAA,cACA,EAHD,CAAYA,MAAc,KAM1B,IAAYC,GAAZ,SAAYA,GACXA,EAAA,iBACAA,EAAA,uBACAA,EAAA,gBACA,EAJD,CAAYA,MAAiB,KAOtB,MAAMC,EAAgB,CAC5BC,KAAM,gB,MCJMC,EAAWC,EAAA,MAAAD,UAAAE,EAIvB,WAAAC,G,8BA8BAC,KAAAC,MAAkB,G,UAtB2B,I,WAIA,U,WAIR,O,WAIb,K,YAIC,K,eAImB,W,yBAmBD,GA9C1CD,KAAKE,EAAIC,EAAQH,KAAKI,K,CAgCvB,YAAAC,CAAaC,GACZC,EAAanB,EAAekB,EAAUZ,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B,SAAU3C,KAAKoB,YAAc,WAC7BwB,MAAO5C,KAAKoB,YAAc,UAEvBpB,KAAKsB,oBAAmB,aAClB,OAAM,gBACF,IAAG,gBACH,MACduB,KAAK,cACLC,SAAS,IACTd,MAAOhC,KAAKgC,Q","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as e,H as t,c as i,h as s,d as a}from"./p-42200001.js";import{v as n}from"./p-0b3574c2.js";import{B as o,a as d,b as h,N as r}from"./p-44a8a668.js";import{g as c,t as l}from"./p-ea7fdd2e.js";import{S as f}from"./p-92f420cb.js";import{a as p}from"./p-10cad7f1.js";import{c as u}from"./p-e8ec030e.js";import{d as b}from"./p-e0e2e9c1.js";import{A as m,a as v,i as y}from"./p-33d5d1ed.js";import{d as g}from"./p-5b0a3c98.js";function k(e){if(typeof e==="string"){return["true","True","TRUE","1"].indexOf(e)!==-1}else if(typeof e==="number"){return e>0}else if(typeof e==="boolean"){return e}else{return e?true:false}}var j;(function(e){e["A"]="a";e["BUTTON"]="button"})(j||(j={}));const T=e(class e extends t{constructor(){super();this.__registerHost();this.govClick=i(this,"gov-click",7);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.hydrated=false;this.color=undefined;this.size="m";this.type=undefined;this.expanded=false;this.name=undefined;this.disabled=false;this.nativeType="button";this.href=undefined;this.target=undefined;this.download=undefined;this.hreflang=undefined;this.referrerpolicy=undefined;this.rel=undefined;this.loading=undefined;this.focusable=true;this.identifier=undefined;this.inheritedAttributes={};this.h=c(this.host)}validateColor(e){n(d,e,o.root)}validateType(e){n(h,e,o.root)}validateSize(e){n(f,e,o.root)}validateNativeType(e){n(r,e,o.root)}componentDidLoad(){this.attributeObserver=new m(this.host,((e,t)=>{this.onAriaAttributeChange(e,t)}));this.attributeObserver.startObserving(v)}onAriaAttributeChange(e,t){this.host.removeAttribute(e);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[e]:t})}disconnectedCallback(){var e;(e=this.attributeObserver)===null||e===void 0?void 0:e.stopObserving()}componentWillLoad(){this.validateColor(this.color);this.validateType(this.type);this.validateSize(this.size);this.validateNativeType(this.nativeType);this.inheritedAttributes=y(this.host)}async componentDidRender(){if(u()){await b(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const e=this.href?j.A:j.BUTTON;const t=e===j.A?undefined:this.nativeType;return s(a,{key:"cd3d644c54ac882be5adf1645391a873d426e549",size:this.size,hydrated:this.hydrated,color:this.color,class:this.h.classes(o.root),type:this.type},s(e,Object.assign({key:"39c76efc161144865f6bde8cf50e2808d0566415",class:"element",ref:e=>this.triggerRef=e,onClick:this.onClickHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),disabled:this.disabled,id:this.identifier,href:this.href,target:this.target,download:this.download,hreflang:this.hreflang,rel:this.rel,name:this.name,type:t,tabindex:this.disabled?"-1":"0"},this.inheritedAttributes,{"aria-disabled":l(this.disabled)}),k(this.loading)&&!this.h.hasSlot("icon-end")&&s("gov-icon",{key:"b75ed857aacc2b914810fbdbb3c0d39ede423639",name:"loader",class:"gov-spin-animation",type:"components"}),this.h.hasSlot("icon-start")&&s("slot",{key:"838152233ab4f51b36217ae0b4077a3f3efc3ecf",name:"icon-start"}),s("slot",{key:"0dbfd16b6de4ea9c0bb92a97297262f10b9a335c"}),this.h.hasSlot("icon-end")&&s("slot",{key:"8854b0bced36cabfe85988e22d10d49f9761a910",name:"icon-end"}),k(this.loading)&&this.h.hasSlot("icon-end")&&s("gov-icon",{key:"607c848e0a9e4abf1c4232658a38922ade4accf9",name:"loader",class:"gov-spin-animation",type:"components"})))}onClickHandler(e){e.stopPropagation();if(this.disabled===false){this.govClick.emit({component:o.root,originalEvent:e,ref:this.host})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:o.root,originalEvent:e,ref:this.host})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:o.root,originalEvent:e,ref:this.host})}async setFocus(){this.triggerRef.focus()}async getRef(){return this.triggerRef}async validateAccessibility(){if(this.focusable){p(this.triggerRef.getAttribute("aria-label"),this.triggerRef.getAttribute("aria-labelledby"),o.root,this.host)}}get host(){return this}static get watchers(){return{color:["validateColor"],type:["validateType"],size:["validateSize"],nativeType:["validateNativeType"]}}},[4,"gov-button",{color:[513],size:[513],type:[513],expanded:[516],name:[1],disabled:[516],nativeType:[1,"native-type"],href:[1],target:[1],download:[4],hreflang:[1],referrerpolicy:[1],rel:[1],loading:[1],focusable:[4],identifier:[1],inheritedAttributes:[32],setFocus:[64],getRef:[64],validateAccessibility:[64]},undefined,{color:["validateColor"],type:["validateType"],size:["validateSize"],nativeType:["validateNativeType"]}]);function C(){if(typeof customElements==="undefined"){return}const e=["gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-button":if(!customElements.get(e)){customElements.define(e,T)}break;case"gov-icon":if(!customElements.get(e)){g()}break}}))}C();export{T as G,C as d};
|
|
2
|
-
//# sourceMappingURL=p-62d01259.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["toBool","value","indexOf","Tags","GovButton","proxyCustomElement","H","constructor","this","hydrated","h","govHost","host","validateColor","newValue","validateProp","ButtonColors","ButtonClass","root","validateType","ButtonType","validateSize","Sizes","validateNativeType","NativeType","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","removeAttribute","inheritedAttributes","Object","assign","disconnectedCallback","_a","stopObserving","componentWillLoad","color","type","size","nativeType","inheritAriaAttributes","componentDidRender","canValidateWcagOnRender","delay","validateAccessibility","connectedCallback","render","Tag","href","A","BUTTON","undefined","Host","key","class","classes","ref","el","triggerRef","onClick","onClickHandler","bind","onFocus","onFocusHandler","onBlur","onBlurHandler","disabled","id","identifier","target","download","hreflang","rel","name","tabindex","toBoolAttrIfDefined","loading","hasSlot","e","stopPropagation","govClick","emit","component","originalEvent","govFocus","govBlur","setFocus","focus","getRef","focusable","validateAccessibleLabel","getAttribute"],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {\n\tButtonClass,\n\tButtonColors,\n\tButtonColorType,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonType,\n\tButtonTypesType,\n\tNativeType,\n\tNativeTypesType,\n} from \"./constants\"\nimport {govHost, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {toBool} from \"../../../utils/bool.utils\"\nimport {Sizes} from \"../../../core/constants/sizes\"\nimport {validateAccessibleLabel} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\tprivate attributeObserver: AttributeObserver\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({reflect: true}) readonly type: ButtonTypesType\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(ButtonType, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host size={this.size}\n\t\t\t\t hydrated={this.hydrated}\n\t\t\t\t color={this.color}\n\t\t\t\t class={this.h.classes(ButtonClass.root)}\n\t\t\t\t type={this.type}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.disabled ? \"-1\" : \"0\"}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"icon-start\") && <slot name=\"icon-start\"></slot>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{this.h.hasSlot(\"icon-end\") && <slot name=\"icon-end\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Validate the Accessibility attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tif (this.focusable) {\n\t\t\tvalidateAccessibleLabel(this.triggerRef.getAttribute('aria-label'), this.triggerRef.getAttribute('aria-labelledby'), ButtonClass.root, this.host)\n\t\t}\n\t}\n}\n"],"mappings":"ubAAgBA,EAAOC,GACtB,UAAWA,IAAU,SAAU,CAC9B,MAAO,CAAC,OAAQ,OAAQ,OAAQ,KAAKC,QAAQD,MAAY,C,MACnD,UAAWA,IAAU,SAAU,CACrC,OAAOA,EAAQ,C,MACT,UAAWA,IAAU,UAAW,CACtC,OAAOA,C,KACD,CACN,OAAOA,EAAQ,KAAO,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,MAAM,qBAAqBjB,KAAK,gB,CAMrD,cAAAuB,CAAekB,GACtBA,EAAEC,kBACF,GAAI3E,KAAK8D,WAAa,MAAO,CAC5B9D,KAAK4E,SAASC,KAAK,CAClBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,EAKL,cAAAuD,CAAee,GACtBA,EAAEC,kBACF3E,KAAKgF,SAASH,KAAK,CAClBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,CAIJ,aAAAyD,CAAca,GACrBA,EAAEC,kBACF3E,KAAKiF,QAAQJ,KAAK,CACjBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,CAQZ,cAAM8E,GACLlF,KAAKsD,WAAW6B,O,CAOjB,YAAMC,GACL,OAAOpF,KAAKsD,U,CAOb,2BAAMd,GACL,GAAIxC,KAAKqF,UAAW,CACnBC,EAAwBtF,KAAKsD,WAAWiC,aAAa,cAAevF,KAAKsD,WAAWiC,aAAa,mBAAoB9E,EAAYC,KAAMV,KAAKI,K","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as s,c as e,h as a,a as t}from"./p-9dea2efa.js";import{F as o}from"./p-7ba4daf4.js";import"./p-e0e2e9c1.js";import"./p-92f420cb.js";const i=class{constructor(a){s(this,a);this.govClick=e(this,"gov-click",7);this.identifier=undefined;this.size="m";this.required=false;this.legend=false}render(){const s=this.legend?"legend":"label";return a(t,{key:"5227d00ebe3e8923687d4e8d0f3a74bad0da82b3",class:o.root,size:this.size},a(s,{key:"981d363fdf7435a0b242b9610a7dd68e11d4f05e",class:o.label,htmlFor:this.identifier,onClick:()=>this.govClick.emit()},a("slot",{key:"bdf282178e200fa69d9f871354786ecbd024fa90"}),this.required?a("span",{class:"gov-color--error-500"}," *"):null))}};export{i as gov_form_label};
|
|
2
|
-
//# sourceMappingURL=p-774ea182.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,a as i,g as o}from"./p-9dea2efa.js";import{g as a,c as n}from"./p-ea7fdd2e.js";import{F as c}from"./p-1c1d0bbe.js";import{v as r}from"./p-0b3574c2.js";import{C as h}from"./p-5aad3497.js";import{p as l}from"./p-e0e2e9c1.js";import{A as d,a as b}from"./p-9ac55bd1.js";import{i as f}from"./p-d9a299a4.js";import"./p-e8ec030e.js";const p=l(h,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var m;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(m||(m={}));const v={root:"gov-infobar",section:"gov-infobar__section",content:"gov-infobar__content",headline:"gov-infobar__headline",close:"gov-infobar__close"};const g=class{constructor(e){t(this,e);this.govClose=s(this,"gov-close",7);this.color="primary";this.type="bold";this.role=undefined;this.accessibleCloseLabel="Zavřít informační lištu";this.accessibleToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.inheritedAttributes={};this.h=a(this.host)}validateColor(t){r(p,t,v.root)}componentDidLoad(){this.attributeObserver=new d(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateColor(this.color);this.inheritedAttributes=f(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){const t=e("gov-button",{key:"bf4dbf4e33374f5827d51c7fab56ce1de0e86103",size:"s","aria-label":this.accessibleCloseLabel,type:"base",color:this.isBold?this.color:"neutral","on-gov-click":this.onCloseHandler.bind(this),class:v.close},e("gov-icon",{key:"c85cebe33a0b06adc79c0adb97d9cabe3d648651",name:"x-lg",type:"components"}));return e(i,{key:"82fe497b7f6d4f3aba3bcad0295bb626587952c1",class:this.h.classes(v.root),color:this.color,type:this.type},e("section",Object.assign({key:"d2b1a013623206d9662c252f189a5b9edeff009d",class:v.section},this.inheritedAttributes,{role:this.role}),this.h.hasSlot("icon")&&e("span",{key:"18efd7eecd6eeb683ba2982f9abb2cfc09e90dab"},e("slot",{key:"cc093214b7fd417c1baec6918e5613f843a7bb55",name:"icon"})),e("div",{key:"07d2db35c654390b08318273dbd76456b75ae5e4",class:v.content},this.h.hasSlot("headline")?e(c,null,e("div",{class:v.headline},e("slot",{name:"headline"}),e("gov-button",{size:"s",type:"base",color:this.isBold?this.color:"neutral","aria-label":this.accessibleToggleLabel,"on-gov-click":()=>this.toggleContent=!this.toggleContent},e("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down",type:"components"}))),e("div",{hidden:!this.toggleContent,"aria-hidden":n(this.toggleContent)},e("slot",null))):e("slot",null)),this.closable&&t))}onCloseHandler(t){this.govClose.emit({component:v.root,ref:this.host,originalEvent:t})}get isBold(){return this.type==="bold"}get host(){return o(this)}static get watchers(){return{color:["validateColor"]}}};export{g as gov_infobar};
|
|
2
|
-
//# sourceMappingURL=p-a1c825f3.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["InfobarColors","pick","Colors","InfobarType","InfobarClass","root","section","content","headline","close","GovInfobar","constructor","hostRef","undefined","this","h","govHost","host","validateColor","newValue","validateProp","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","color","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","closeButton","key","size","accessibleCloseLabel","type","isBold","onCloseHandler","bind","class","name","Host","classes","role","hasSlot","Fragment","accessibleToggleLabel","toggleContent","hidden","toBoolAttr","closable","e","govClose","emit","component","ref","originalEvent"],"sources":["../../../packages/core/src/components/gov-infobar/constants.ts","../../../packages/core/src/components/gov-infobar/gov-infobar.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const InfobarColors = pick(Colors, ['PRIMARY', 'SECONDARY', 'NEUTRAL', 'ERROR', 'SUCCESS', 'WARNING'])\nexport type ColorType = `${ValueOf<typeof InfobarColors>}`\n\nexport enum InfobarType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type InfobarTypesType = `${ValueOf<typeof InfobarType>}`\n\nexport const InfobarClass = {\n\troot: 'gov-infobar',\n\tsection: 'gov-infobar__section',\n\tcontent: 'gov-infobar__content',\n\theadline: 'gov-infobar__headline',\n\tclose: 'gov-infobar__close',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from '@stencil/core'\nimport {govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport Fragment from '../../helpers/Fragment'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonEvent} from '../gov-button/button/gov-button.types'\nimport {ColorType, InfobarClass, InfobarColors, InfobarTypesType} from './constants'\nimport {InfobarEvent} from './gov-infobar.types'\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-infobar',\n})\nexport class GovInfobar {\n\tprivate h: GovHost\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovInfobarElement\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly color: ColorType = 'primary'\n\t/**\n\t * Infobar appearance\n\t */\n\t@Prop() readonly type?: InfobarTypesType = \"bold\"\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly role: HTMLElement['role'] = undefined\n\t/**\n\t * Aria label for the closing button. It is mandatory if the infobar is closable\n\t */\n\t@Prop({attribute: 'accessible-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít informační lištu'\n\t/**\n\t * Aria label for the toggle button. It is mandatory if the infobar has headline\n\t */\n\t@Prop({attribute: 'accessible-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit více informací'\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<InfobarEvent>\n\t/**\n\t * Displays the option to close the infobar\n\t */\n\t@Prop() readonly closable?: boolean = false\n\n\t@State() toggleContent = false\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(InfobarColors, newValue, InfobarClass.root)\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\tconst closeButton = (\n\t\t\t<gov-button size=\"s\"\n\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tcolor={this.isBold ? this.color : \"neutral\"}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\tclass={InfobarClass.close}>\n\t\t\t\t<gov-icon name=\"x-lg\" type=\"components\"></gov-icon>\n\t\t\t</gov-button>\n\t\t)\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(InfobarClass.root)} color={this.color} type={this.type}>\n\t\t\t\t<section class={InfobarClass.section} {...this.inheritedAttributes} role={this.role}>\n\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t\t<div class={InfobarClass.content}>\n\t\t\t\t\t\t{this.h.hasSlot('headline') ? (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<div class={InfobarClass.headline}>\n\t\t\t\t\t\t\t\t\t<slot name={\"headline\"}/>\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tcolor={this.isBold ? this.color : \"neutral\"}\n\t\t\t\t\t\t\t\t\t\taria-label={this.accessibleToggleLabel}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => (this.toggleContent = !this.toggleContent)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name={this.toggleContent ? 'chevron-up' : 'chevron-down'} type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div hidden={!this.toggleContent} aria-hidden={toBoolAttr(this.toggleContent)}>\n\t\t\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.closable && closeButton}\n\t\t\t\t</section>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tonCloseHandler(e: CustomEvent<ButtonEvent>) {\n\t\tthis.govClose.emit({\n\t\t\tcomponent: InfobarClass.root,\n\t\t\tref: this.host,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tget isBold(): boolean {\n\t\treturn this.type === \"bold\"\n\t}\n}\n"],"mappings":"kWA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EAACkC,EAAI,CAAAT,IAAA,2CAACO,MAAOjC,KAAKC,EAAEmC,QAAQ9C,EAAaC,MAAOwB,MAAOf,KAAKe,MAAOc,KAAM7B,KAAK6B,MAC7E5B,EAAA,UAAAqB,OAAAC,OAAA,CAAAG,IAAA,2CAASO,MAAO3C,EAAaE,SAAaQ,KAAKgB,oBAAmB,CAAEqB,KAAMrC,KAAKqC,OAC7ErC,KAAKC,EAAEqC,QAAQ,SACfrC,EAAA,QAAAyB,IAAA,4CACCzB,EAAA,QAAAyB,IAAA,2CAAMQ,KAAK,UAGbjC,EAAA,OAAAyB,IAAA,2CAAKO,MAAO3C,EAAaG,SACvBO,KAAKC,EAAEqC,QAAQ,YACfrC,EAACsC,EAAQ,KACRtC,EAAA,OAAKgC,MAAO3C,EAAaI,UACxBO,EAAA,QAAMiC,KAAM,aACZjC,EAAA,cACC0B,KAAK,IACLE,KAAK,OACLd,MAAOf,KAAK8B,OAAS9B,KAAKe,MAAQ,UAAS,aAC/Bf,KAAKwC,sBAAqB,eACxB,IAAOxC,KAAKyC,eAAiBzC,KAAKyC,eAEhDxC,EAAA,YAAUiC,KAAMlC,KAAKyC,cAAgB,aAAe,eAAgBZ,KAAK,iBAG3E5B,EAAA,OAAKyC,QAAS1C,KAAKyC,cAAa,cAAeE,EAAW3C,KAAKyC,gBAC9DxC,EAAA,eAIFA,EAAA,cAGDD,KAAK4C,UAAYnB,G,CAMtB,cAAAM,CAAec,GACd7C,KAAK8C,SAASC,KAAK,CAClBC,UAAW1D,EAAaC,KACxB0D,IAAKjD,KAAKG,KACV+C,cAAeL,G,CAIjB,UAAIf,GACH,OAAO9B,KAAK6B,OAAS,M","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,a as e,g as a}from"./p-9dea2efa.js";import{g as h,l as n,m as o}from"./p-da1db6fd.js";import{g as r,c,t as d,d as l}from"./p-ea7fdd2e.js";import{v as u}from"./p-0b3574c2.js";import{c as f}from"./p-cd6c2938.js";import{A as p,a as m}from"./p-9ac55bd1.js";import{i as b}from"./p-d9a299a4.js";import{p as v}from"./p-e0e2e9c1.js";import{S as g}from"./p-92f420cb.js";import{C as y}from"./p-5aad3497.js";import"./p-7f3becc5.js";import"./p-56efd4a2.js";import"./p-7ba4daf4.js";import"./p-e8ec030e.js";var k;(function(t){t["INPUT"]="input";t["TEXTAREA"]="textarea"})(k||(k={}));const j=class{constructor(s){t(this,s);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govKeyUp=i(this,"gov-keyup",7);this.govHydrated=i(this,"gov-hydrated",7);this.govKeyDown=i(this,"gov-keydown",7);this.value=undefined;this.identifier=undefined;this.success=undefined;this.size="m";this.name=undefined;this.multiline=undefined;this.rows=undefined;this.cols=undefined;this.required=false;this.disabled=false;this.placeholder=undefined;this.readonly=undefined;this.minlength=undefined;this.maxlength=undefined;this.min=undefined;this.max=undefined;this.autocomplete=undefined;this.autocorrect=undefined;this.spellcheck=undefined;this.inputLang=undefined;this.type=undefined;this.inputType="text";this.role=undefined;this.invalid=undefined;this.accessibleShowPasswordLabel="Zobrazit heslo";this.accessibleHidePasswordLabel="Skrýt heslo";this.focused=undefined;this.showPassword=false;this.inheritedAttributes={};this.h=r(this.host);this.inputId=f("GovInput");this.f=h(this.h)}validateSize(t){u(o,t,n.root)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("success",c(this.success));this.f.passAttrToControl("disabled",c(this.disabled));this.f.passAttrToControl("invalid",c(this.invalid));this.f.passAttrToControl("type",this.multiline?k.TEXTAREA:k.INPUT)}componentDidLoad(){this.attributeObserver=new p(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(m);this.govHydrated.emit()}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=b(this.host)}componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required))}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}render(){const t=this.multiline?k.TEXTAREA:k.INPUT;return s(e,{key:"f2b0e3a105b6a3904d59821bc68e13bfa01acea9",class:n.root,size:this.size,type:this.type},this.h.hasSlot("prefix")&&s("slot",{key:"13ff8da008e08322cd0eb241600751f8e896416b",name:"prefix"}),s("span",{key:"22c1467190afaf1a2c8e98d0cd4500f123494885",class:"element"},this.h.hasSlot("icon-start")&&!this.multiline&&s("div",{key:"1ab85a6556b44fd92959c0311b57028a8e3b8d74",class:n.icons,onClick:()=>this.inputRef.focus()},s("slot",{key:"dcc9f5a1da1245bd4eccc0a919b08b73a556efe7",name:"icon-start"})),s(t,Object.assign({key:"f05f59a1ad7d28acfd005942fdd22e7ba04e2d73",type:this.inputType==="password"&&this.showPassword?"text":this.inputType,disabled:this.disabled,id:this.identifier||this.inputId,name:this.name,onFocus:this.onFocusHandler.bind(this),onInput:this.onInputHandler.bind(this),onBlur:this.onBlurHandler.bind(this),onKeyUp:this.onKeyUpHandler.bind(this),onKeyDown:this.onKeyDownHandler.bind(this),ref:t=>this.inputRef=t,placeholder:this.placeholder,spellcheck:d(this.spellcheck),lang:this.inputLang,readonly:d(this.readonly),autocomplete:l(this.autocomplete),autocorrect:l(this.autocorrect),minlength:this.minlength,maxlength:this.maxlength,min:this.min,max:this.max,required:this.required,rows:this.rows,cols:this.cols,role:this.role,value:this.value},this.inheritedAttributes,{"aria-required":d(this.required),"aria-invalid":d(this.invalid),"aria-disabled":d(this.disabled)})),(this.success||this.invalid||this.h.hasSlot("icon-end")||this.inputType==="password")&&!this.multiline&&s("div",{key:"ab940283ca797a54590c73881aabe6e4032d4a77",class:n.icons,onClick:()=>this.inputRef.focus()},this.success&&!this.multiline&&s("gov-icon",{key:"af0b7c6e3c815eb74318052f490db2241f246707",class:"validation-icon",name:"check-lg",type:"components"}),this.invalid&&!this.multiline&&s("gov-icon",{key:"4feef0479c061b9b073dea6c04e2bc428464a9de",class:"validation-icon",name:"exclamation-lg",type:"components"}),this.h.hasSlot("icon-end")&&this.inputType!=="password"&&s("slot",{key:"fa3f4ac957a08d066706c273b008edef401f0a2b",name:"icon-end"}),this.inputType==="password"?s("gov-button",{color:"primary",type:"base",size:this.size,"aria-label":this.showPassword?this.accessibleHidePasswordLabel:this.accessibleShowPasswordLabel,"on-gov-click":()=>this.showPassword=!this.showPassword},s("gov-icon",{slot:"icon-start",name:"eye",type:"components"})):null)),this.h.hasSlot("sufix")&&s("slot",{key:"ce4b50ff45632098c4457339538bac4a5a685df8",name:"sufix"}))}onFocusHandler(t){t.stopPropagation();this.focused=true;this.govFocus.emit({component:n.root,value:this.value,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.focused=false;this.govBlur.emit({component:n.root,value:this.value,originalEvent:t})}onKeyUpHandler(t){t.stopPropagation();this.govKeyUp.emit({component:n.root,value:this.value,originalEvent:t})}onKeyDownHandler(t){t.stopPropagation();this.govKeyDown.emit({component:n.root,value:this.value,originalEvent:t})}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({component:n.root,value:this.value,originalEvent:t})}async setFocus(t){return this.inputRef.focus(t)}async setValue(t){this.value=t}async clearValue(){this.value="";this.inputRef.value=""}async getRef(){return this.inputRef}get host(){return a(this)}static get watchers(){return{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}}};const w=v(g,["_XS","_S","_M","_L","_XL"]);v(y,["PRIMARY","NEUTRAL"]);var A;(function(t){t["CIRCLE"]="circle";t["LINE"]="line"})(A||(A={}));var x;(function(t){t["PULSE"]="pulse";t["PROGRESS"]="progress";t["FALSE"]="false"})(x||(x={}));const C={root:"gov-skeleton"};const z=class{constructor(i){t(this,i);this.items=[];this.size="m";this.color="neutral";this.shape="line";this.width=null;this.height=null;this.animation="progress";this.inheritedAttributes={};this.h=r(this.host)}validateSize(t){u(w,t,C.root)}validateShape(t){u(A,t,C.root)}validateAnimation(t){u(x,t,C.root)}componentDidLoad(){this.attributeObserver=new p(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(m)}componentWillLoad(){this.validateSize(this.size);this.validateShape(this.shape);this.validateAnimation(this.animation);this.init();this.inheritedAttributes=b(this.host)}componentWillUpdate(){this.init()}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}init(){this.items.fill(1)}get style(){const t={width:null,height:null};if(this.width){t.width=this.width}if(this.height){t.height=this.height}return Object.assign({},t)}render(){return s(e,Object.assign({key:"fa43a5bc92210a51bb681449542c6f5c2863e3ad",size:this.size,color:this.color,class:{[C.root]:true,circle:this.shape==="circle",line:this.shape==="line",progress:this.animation==="progress",pulse:this.animation==="pulse"}},this.inheritedAttributes,{"aria-busy":"true","aria-valuemin":"0","aria-valuemax":"100",role:"progressbar",tabindex:"0",style:this.style}))}get host(){return a(this)}static get watchers(){return{size:["validateSize"],shape:["validateShape"],animation:["validateAnimation"]}}};export{j as gov_form_input,z as gov_skeleton};
|
|
2
|
-
//# sourceMappingURL=p-b9f1c2ef.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,a as s,g as a}from"./p-9dea2efa.js";import{v as n}from"./p-0b3574c2.js";import{B as o,a as h,c as d,N as r}from"./p-3bbb77a0.js";import{g as c,t as f}from"./p-ea7fdd2e.js";import{S as l}from"./p-92f420cb.js";import{v as p}from"./p-6d54ce5f.js";import{c as b}from"./p-e8ec030e.js";import{d as m}from"./p-e0e2e9c1.js";import{i as u}from"./p-d9a299a4.js";import{A as v,a as y}from"./p-9ac55bd1.js";import"./p-5aad3497.js";import"./p-cd6c2938.js";import"./p-2fe7d728.js";function g(t){if(typeof t==="string"){return["true","True","TRUE","1"].indexOf(t)!==-1}else if(typeof t==="number"){return t>0}else if(typeof t==="boolean"){return t}else{return t?true:false}}var j;(function(t){t["A"]="a";t["BUTTON"]="button"})(j||(j={}));const k=class{constructor(e){t(this,e);this.govClick=i(this,"gov-click",7);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.hydrated=false;this.color=undefined;this.size="m";this.type=undefined;this.expanded=false;this.name=undefined;this.disabled=false;this.nativeType="button";this.href=undefined;this.target=undefined;this.download=undefined;this.hreflang=undefined;this.referrerpolicy=undefined;this.rel=undefined;this.loading=undefined;this.focusable=true;this.identifier=undefined;this.inheritedAttributes={};this.h=c(this.host)}validateColor(t){n(h,t,o.root)}validateType(t){n(d,t,o.root)}validateSize(t){n(l,t,o.root)}validateNativeType(t){n(r,t,o.root)}componentDidLoad(){this.attributeObserver=new v(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(y)}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}componentWillLoad(){this.validateColor(this.color);this.validateType(this.type);this.validateSize(this.size);this.validateNativeType(this.nativeType);this.inheritedAttributes=u(this.host)}async componentDidRender(){if(b()){await m(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const t=this.href?j.A:j.BUTTON;const i=t===j.A?undefined:this.nativeType;return e(s,{key:"cd3d644c54ac882be5adf1645391a873d426e549",size:this.size,hydrated:this.hydrated,color:this.color,class:this.h.classes(o.root),type:this.type},e(t,Object.assign({key:"39c76efc161144865f6bde8cf50e2808d0566415",class:"element",ref:t=>this.triggerRef=t,onClick:this.onClickHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),disabled:this.disabled,id:this.identifier,href:this.href,target:this.target,download:this.download,hreflang:this.hreflang,rel:this.rel,name:this.name,type:i,tabindex:this.disabled?"-1":"0"},this.inheritedAttributes,{"aria-disabled":f(this.disabled)}),g(this.loading)&&!this.h.hasSlot("icon-end")&&e("gov-icon",{key:"b75ed857aacc2b914810fbdbb3c0d39ede423639",name:"loader",class:"gov-spin-animation",type:"components"}),this.h.hasSlot("icon-start")&&e("slot",{key:"838152233ab4f51b36217ae0b4077a3f3efc3ecf",name:"icon-start"}),e("slot",{key:"0dbfd16b6de4ea9c0bb92a97297262f10b9a335c"}),this.h.hasSlot("icon-end")&&e("slot",{key:"8854b0bced36cabfe85988e22d10d49f9761a910",name:"icon-end"}),g(this.loading)&&this.h.hasSlot("icon-end")&&e("gov-icon",{key:"607c848e0a9e4abf1c4232658a38922ade4accf9",name:"loader",class:"gov-spin-animation",type:"components"})))}onClickHandler(t){t.stopPropagation();if(this.disabled===false){this.govClick.emit({component:o.root,originalEvent:t,ref:this.host})}}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:o.root,originalEvent:t,ref:this.host})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:o.root,originalEvent:t,ref:this.host})}async setFocus(){this.triggerRef.focus()}async getRef(){return this.triggerRef}async validateAccessibility(){if(this.focusable){p(this.triggerRef.getAttribute("aria-label"),this.triggerRef.getAttribute("aria-labelledby"),o.root,this.host)}}get host(){return a(this)}static get watchers(){return{color:["validateColor"],type:["validateType"],size:["validateSize"],nativeType:["validateNativeType"]}}};export{k as gov_button};
|
|
2
|
-
//# sourceMappingURL=p-c1584cfe.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["toBool","value","indexOf","Tags","GovButton","constructor","hostRef","this","hydrated","h","govHost","host","validateColor","newValue","validateProp","ButtonColors","ButtonClass","root","validateType","ButtonType","validateSize","Sizes","validateNativeType","NativeType","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","removeAttribute","inheritedAttributes","Object","assign","disconnectedCallback","_a","stopObserving","componentWillLoad","color","type","size","nativeType","inheritAriaAttributes","componentDidRender","canValidateWcagOnRender","delay","validateAccessibility","connectedCallback","render","Tag","href","A","BUTTON","undefined","Host","key","class","classes","ref","el","triggerRef","onClick","onClickHandler","bind","onFocus","onFocusHandler","onBlur","onBlurHandler","disabled","id","identifier","target","download","hreflang","rel","name","tabindex","toBoolAttrIfDefined","loading","hasSlot","e","stopPropagation","govClick","emit","component","originalEvent","govFocus","govBlur","setFocus","focus","getRef","focusable","validateAccessibleLabel","getAttribute"],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {\n\tButtonClass,\n\tButtonColors,\n\tButtonColorType,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonType,\n\tButtonTypesType,\n\tNativeType,\n\tNativeTypesType,\n} from \"./constants\"\nimport {govHost, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {toBool} from \"../../../utils/bool.utils\"\nimport {Sizes} from \"../../../core/constants/sizes\"\nimport {validateAccessibleLabel} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\tprivate attributeObserver: AttributeObserver\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({reflect: true}) readonly type: ButtonTypesType\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(ButtonType, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host size={this.size}\n\t\t\t\t hydrated={this.hydrated}\n\t\t\t\t color={this.color}\n\t\t\t\t class={this.h.classes(ButtonClass.root)}\n\t\t\t\t type={this.type}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.disabled ? \"-1\" : \"0\"}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"icon-start\") && <slot name=\"icon-start\"></slot>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{this.h.hasSlot(\"icon-end\") && <slot name=\"icon-end\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Validate the Accessibility attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tif (this.focusable) {\n\t\t\tvalidateAccessibleLabel(this.triggerRef.getAttribute('aria-label'), this.triggerRef.getAttribute('aria-labelledby'), ButtonClass.root, this.host)\n\t\t}\n\t}\n}\n"],"mappings":"wfAAgBA,EAAOC,GACtB,UAAWA,IAAU,SAAU,CAC9B,MAAO,CAAC,OAAQ,OAAQ,OAAQ,KAAKC,QAAQD,MAAY,C,MACnD,UAAWA,IAAU,SAAU,CACrC,OAAOA,EAAQ,C,MACT,UAAWA,IAAU,UAAW,CACtC,OAAOA,C,KACD,CACN,OAAOA,EAAQ,KAAO,K,CAExB,CCeA,IAAKE,GAAL,SAAKA,GACJA,EAAA,SACAA,EAAA,kBACA,EAHD,CAAKA,MAAI,K,MAQIC,EAAS,MAMrB,WAAAC,CAAAC,G,oHAFQC,KAAAC,SAAW,M,+BAesC,I,kCAQL,M,kCASA,M,gBAKJ,S,iLAuCV,K,mDAsCK,GA/G1CD,KAAKE,EAAIC,EAAQH,KAAKI,K,CA4FvB,aAAAC,CAAcC,GACbC,EAAaC,EAAcF,EAAUG,EAAYC,K,CAIlD,YAAAC,CAAaL,GACZC,EAAaK,EAAYN,EAAUG,EAAYC,K,CAIhD,YAAAG,CAAaP,GACZC,EAAaO,EAAOR,EAAUG,EAAYC,K,CAI3C,kBAAAK,CAAmBT,GAClBC,EAAaS,EAAYV,EAAUG,EAAYC,K,CAKhD,gBAAAO,GACCjB,KAAKkB,kBAAoB,IAAIC,EAAkBnB,KAAKI,MAAM,CAACgB,EAAed,KACzEN,KAAKqB,sBAAsBD,EAAed,EAAS,IAGpDN,KAAKkB,kBAAkBI,eAAeC,E,CAGvC,qBAAAF,CAAsBD,EAAuBd,GAC5CN,KAAKI,KAAKoB,gBAAgBJ,GAC1BpB,KAAKyB,oBAAmBC,OAAAC,OAAAD,OAAAC,OAAA,GAAO3B,KAAKyB,qBAAmB,CAAEL,CAACA,GAAgBd,G,CAG3E,oBAAAsB,G,OACCC,EAAA7B,KAAKkB,qBAAiB,MAAAW,SA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C,IAAA,2CAAUoB,KAAK,SAASnB,MAAM,qBAAqBjB,KAAK,eACxDjC,KAAKE,EAAEuE,QAAQ,eAAiBvE,EAAA,QAAA+C,IAAA,2CAAMoB,KAAK,eAC5CnE,EAAA,QAAA+C,IAAA,6CACCjD,KAAKE,EAAEuE,QAAQ,aAAevE,EAAA,QAAA+C,IAAA,2CAAMoB,KAAK,aACzC5E,EAAOO,KAAKwE,UAAYxE,KAAKE,EAAEuE,QAAQ,aACvCvE,EAAA,YAAA+C,IAAA,2CAAUoB,KAAK,SAASnB,MAAM,qBAAqBjB,KAAK,gB,CAMrD,cAAAuB,CAAekB,GACtBA,EAAEC,kBACF,GAAI3E,KAAK8D,WAAa,MAAO,CAC5B9D,KAAK4E,SAASC,KAAK,CAClBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,EAKL,cAAAuD,CAAee,GACtBA,EAAEC,kBACF3E,KAAKgF,SAASH,KAAK,CAClBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,CAIJ,aAAAyD,CAAca,GACrBA,EAAEC,kBACF3E,KAAKiF,QAAQJ,KAAK,CACjBC,UAAWrE,EAAYC,KACvBqE,cAAeL,EACftB,IAAKpD,KAAKI,M,CAQZ,cAAM8E,GACLlF,KAAKsD,WAAW6B,O,CAOjB,YAAMC,GACL,OAAOpF,KAAKsD,U,CAOb,2BAAMd,GACL,GAAIxC,KAAKqF,UAAW,CACnBC,EAAwBtF,KAAKsD,WAAWiC,aAAa,cAAevF,KAAKsD,WAAWiC,aAAa,mBAAoB9E,EAAYC,KAAMV,KAAKI,K","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,a as s,g as a}from"./p-9dea2efa.js";import{p as o}from"./p-e0e2e9c1.js";import{S as c}from"./p-92f420cb.js";import{g as i}from"./p-ea7fdd2e.js";import{v as r}from"./p-0b3574c2.js";import{a as d,b as f}from"./p-5f1000da.js";import"./p-e8ec030e.js";o(c,["_S","_M","_L"]);const m={root:"gov-empty",content:"gov-empty__content"};const p=class{constructor(t){e(this,t);this.size="m";this.h=i(this.host)}validateSize(e){r(f,e,d.root)}componentWillLoad(){this.validateSize(this.size)}render(){return t(s,{key:"93155f92af0574538fd919e52f312b0f02d07e21",class:this.h.classes(m.root),size:this.size},this.h.hasSlot("icon")&&t("slot",{key:"e9504c9396c9743ea7e454bb2df5d0f2a046aabe",name:"icon"}),t("div",{key:"78f2d30f570c6123a58d2ac93db58b4e471796b3",class:m.content},t("slot",{key:"7b5e1121dbfccf6d647e168e80c60cad4a1ca136",name:"headline"}),t("slot",{key:"d435390c88c0304f9ee129b268c454b2147fddb0"})))}get host(){return a(this)}static get watchers(){return{size:["validateSize"]}}};export{p as gov_empty};
|
|
2
|
-
//# sourceMappingURL=p-c5a49469.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pick","Sizes","EmptyClass","root","content","GovEmpty","constructor","hostRef","this","h","govHost","host","validateSize","newValue","validateProp","AccordionSizes","AccordionClass","componentWillLoad","size","render","Host","key","class","classes","hasSlot","name"],"sources":["../../../packages/core/src/components/gov-empty/constants.ts","../../../packages/core/src/components/gov-empty/gov-empty.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const EmptySizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type EmptySizesType = `${ValueOf<typeof EmptySizes>}`\n\nexport const EmptyClass = {\n\troot: 'gov-empty',\n\tcontent: 'gov-empty__content',\n}\n","import {Component, Element, Host, h, Prop, Watch} from '@stencil/core'\nimport {EmptyClass, EmptySizesType} from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {AccordionClass, AccordionSizes} from \"../gov-accordion/constants\";\n\n@Component({\n\ttag: 'gov-empty',\n})\nexport class GovEmpty {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovEmptyElement\n\t/**\n\t * Element size.\n\t */\n\t@Prop() readonly size?: EmptySizesType = 'm'\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(EmptyClass.root)} size={this.size}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t)}\n\t\t\t\t<div class={EmptyClass.content}>\n\t\t\t\t\t<slot name=\"headline\" />\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"4QAI0BA,EAAKC,EAAO,CAAC,KAAM,KAAM,OAG5C,MAAMC,EAAa,CACzBC,KAAM,YACNC,QAAS,sB,MCCGC,EAAQ,MAGpB,WAAAC,CAAAC,G,oBAQyC,IAPxCC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAUvB,YAAAC,CAAaC,GACZC,EAAaC,EAAgBF,EAAUG,EAAeb,K,CAGvD,iBAAAc,GACCT,KAAKI,aAAaJ,KAAKU,K,CAGxB,MAAAC,GACC,OACCV,EAACW,EAAI,CAAAC,IAAA,2CAACC,MAAOd,KAAKC,EAAEc,QAAQrB,EAAWC,MAAOe,KAAMV,KAAKU,MACvDV,KAAKC,EAAEe,QAAQ,SACff,EAAA,QAAAY,IAAA,2CAAMI,KAAK,SAEZhB,EAAA,OAAAY,IAAA,2CAAKC,MAAOpB,EAAWE,SACtBK,EAAA,QAAAY,IAAA,2CAAMI,KAAK,aACXhB,EAAA,QAAAY,IAAA,8C","ignoreList":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|