@oslokommune/punkt-elements 16.0.5 → 16.2.0
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/CHANGELOG.md +17 -0
- package/dist/{accordionitem-CHXGzgLv.js → accordionitem-Cj74XruR.js} +31 -31
- package/dist/accordionitem-D7sWqDM_.cjs +34 -0
- package/dist/alert-C95U_RZ0.cjs +33 -0
- package/dist/{alert-BHSd2Vpj.js → alert-ca_hFi-u.js} +19 -20
- package/dist/async-directive-B158h3ba.cjs +5 -0
- package/dist/async-directive-CKx6pubI.js +65 -0
- package/dist/{button-CHUuxLQV.js → button-BRovt5nm.js} +10 -11
- package/dist/button-BXN_JPaH.cjs +27 -0
- package/dist/{card-Db9QSEqh.cjs → card-DfHo45CG.cjs} +11 -13
- package/dist/{card-CmfUyl_s.js → card-DvgCTN4B.js} +47 -51
- package/dist/{checkbox-D6nltMuc.js → checkbox-CbIUMIYt.js} +2 -2
- package/dist/{checkbox-Cpyay9_l.cjs → checkbox-mmn3v9ry.cjs} +1 -1
- package/dist/{combobox-TKTemUxN.js → combobox-CwW0md6G.js} +31 -31
- package/dist/combobox-TKL44xnV.cjs +135 -0
- package/dist/{consent-BQLkfN3d.cjs → consent-CIhFwuFO.cjs} +1 -1
- package/dist/{consent-knPF4PS_.js → consent-CgS1L1xF.js} +1 -1
- package/dist/{datepicker-CPNcXd-o.cjs → datepicker-oN9L0Wnm.cjs} +14 -14
- package/dist/{datepicker-MuQYeXhL.js → datepicker-qRWWzmbo.js} +51 -51
- package/dist/element-with-slot-1djk8KXi.js +240 -0
- package/dist/element-with-slot-yT8k1Z37.cjs +1 -0
- package/dist/helptext-B366oeR9.cjs +24 -0
- package/dist/{helptext-TFpeGJ1P.js → helptext-DepcDYFV.js} +32 -39
- package/dist/index.d.ts +39 -90
- package/dist/input-element-Xe9FTi2a.cjs +1 -0
- package/dist/{input-element-BGNbdzy2.js → input-element-n5U38pZ1.js} +8 -7
- package/dist/{input-wrapper-CaUY90qz.js → input-wrapper-B__6jW4U.js} +25 -28
- package/dist/{input-wrapper-JU4D2TGu.cjs → input-wrapper-BdFdJU-k.cjs} +7 -9
- package/dist/link-DLjXMpvi.cjs +7 -0
- package/dist/link-oGYvBLYL.js +53 -0
- package/dist/linkcard-BhVIc18n.js +54 -0
- package/dist/linkcard-C20WC6Nw.cjs +13 -0
- package/dist/{loader-BF9K1VCZ.js → loader-BHt9i5Xp.js} +12 -13
- package/dist/{loader-C1LI8Q4z.cjs → loader-DxAGCcNF.cjs} +2 -2
- package/dist/messagebox-B8LW0PSQ.cjs +13 -0
- package/dist/messagebox-DkspcMQg.js +69 -0
- package/dist/modal-Bfk_ncLQ.cjs +36 -0
- package/dist/{modal-CGHWsjk8.js → modal-p1rvuP8e.js} +26 -27
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-header.cjs +16 -17
- package/dist/pkt-header.js +62 -69
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +22 -22
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-options-controller-DIeKSpWv.cjs +1 -0
- package/dist/{pkt-options-controller-Z-bPox7n.js → pkt-options-controller-W4ITGQy9.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -2
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{progressbar-Bxh335uT.cjs → progressbar-CC9Qr82_.cjs} +1 -1
- package/dist/{progressbar-GSA4Md1u.js → progressbar-CcX-xiPI.js} +1 -1
- package/dist/{radiobutton-CNHCpKn0.cjs → radiobutton-BUDQYAH-.cjs} +1 -1
- package/dist/{radiobutton-DgC27mb0.js → radiobutton-RW3h0tJj.js} +2 -2
- package/dist/ref-DBGHvw2G.js +42 -0
- package/dist/ref-DahIePMT.cjs +5 -0
- package/dist/select-PuEeK4jQ.cjs +49 -0
- package/dist/{select-7VuYtPZv.js → select-iXKeM3yz.js} +37 -37
- package/dist/{tabitem-DQRzgAT4.js → tabitem-DZSzwag2.js} +30 -30
- package/dist/{tabitem-BKv4eN0a.cjs → tabitem-Jenus4Qd.cjs} +13 -13
- package/dist/{tag-DZPqFiem.js → tag-CIWBLpjv.js} +17 -18
- package/dist/tag-DeE1OpmF.cjs +27 -0
- package/dist/{textarea-VpCEjVFx.js → textarea-DR9lVDN-.js} +13 -13
- package/dist/{textarea-CO7Ikug5.cjs → textarea-DtiYQWjy.cjs} +7 -7
- package/dist/{textinput-C2AZ9ss2.js → textinput-0Bttvt9V.js} +22 -22
- package/dist/{textinput-DRFZU3dA.cjs → textinput-cKrjvbJW.cjs} +9 -9
- package/package.json +3 -3
- package/src/components/accordion/accordionitem.ts +4 -6
- package/src/components/alert/alert.ts +4 -8
- package/src/components/button/button.ts +4 -12
- package/src/components/card/card.ts +4 -19
- package/src/components/combobox/combobox-base.ts +0 -5
- package/src/components/combobox/combobox-utils.ts +1 -1
- package/src/components/combobox/combobox.ts +2 -1
- package/src/components/datepicker/datepicker.ts +2 -8
- package/src/components/header/header-service.ts +5 -19
- package/src/components/header/header.ts +4 -13
- package/src/components/helptext/helptext.test.ts +2 -12
- package/src/components/helptext/helptext.ts +5 -19
- package/src/components/input-wrapper/input-wrapper.test.ts +3 -3
- package/src/components/input-wrapper/input-wrapper.ts +5 -16
- package/src/components/link/link.ts +4 -12
- package/src/components/linkcard/linkcard.test.ts +2 -2
- package/src/components/linkcard/linkcard.ts +4 -13
- package/src/components/loader/loader.ts +4 -12
- package/src/components/messagebox/messagebox.ts +4 -9
- package/src/components/modal/modal.ts +4 -7
- package/src/components/select/select.ts +2 -5
- package/src/components/tabs/tabitem.ts +4 -7
- package/src/components/tabs/tabs.ts +4 -13
- package/src/components/tag/tag.ts +6 -12
- package/src/components/textarea/textarea.ts +2 -8
- package/src/components/textinput/textinput.ts +2 -8
- package/dist/accordionitem-To95GT6b.cjs +0 -34
- package/dist/alert-BDXWFRcf.cjs +0 -33
- package/dist/button-VWxZW89G.cjs +0 -27
- package/dist/combobox-DX2BLzIm.cjs +0 -135
- package/dist/helptext-BjW1WdOn.cjs +0 -24
- package/dist/input-element-CSDVA3Y6.cjs +0 -1
- package/dist/link-Bscfb6s9.js +0 -54
- package/dist/link-CDuv1jxx.cjs +0 -7
- package/dist/linkcard-3WUL0CpY.cjs +0 -13
- package/dist/linkcard-wNgRxJ-S.js +0 -55
- package/dist/messagebox-Dmot5szX.cjs +0 -13
- package/dist/messagebox-LBEzcr6B.js +0 -70
- package/dist/modal-S9MOKOaz.cjs +0 -37
- package/dist/pkt-options-controller-BogGk-6J.cjs +0 -1
- package/dist/pkt-slot-controller-D4nKlom5.cjs +0 -1
- package/dist/pkt-slot-controller-D7CrjM52.js +0 -95
- package/dist/ref-CxLwrCxt.cjs +0 -9
- package/dist/ref-Dma3n3i8.js +0 -102
- package/dist/select-PWPy5gTB.cjs +0 -49
- package/dist/tag-DmbgBCKu.cjs +0 -27
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ import { UserMenuItem } from '../../../../../shared-types';
|
|
|
36
36
|
* Declares all reactive properties, state, refs, and simple helpers.
|
|
37
37
|
*/
|
|
38
38
|
declare class ComboboxBase extends PktInputElement {
|
|
39
|
-
protected readonly helptextSlot: Ref<HTMLElement>;
|
|
40
39
|
constructor();
|
|
41
40
|
value: string | string[];
|
|
42
41
|
options: IPktComboboxOption[];
|
|
@@ -491,7 +490,7 @@ export declare class PktAccordion extends LitElement implements IPktAccordion {
|
|
|
491
490
|
render(): TemplateResult<1>;
|
|
492
491
|
}
|
|
493
492
|
|
|
494
|
-
export declare class PktAccordionItem extends
|
|
493
|
+
export declare class PktAccordionItem extends PktElementWithSlot implements IPktAccordionItem {
|
|
495
494
|
defaultOpen: boolean;
|
|
496
495
|
title: string;
|
|
497
496
|
skin: TPktAccordionSkin | undefined;
|
|
@@ -499,14 +498,12 @@ export declare class PktAccordionItem extends PktElement implements IPktAccordio
|
|
|
499
498
|
isOpen: boolean;
|
|
500
499
|
name: string | undefined;
|
|
501
500
|
accordionItemRef: Ref<HTMLDivElement>;
|
|
502
|
-
defaultSlot: Ref<HTMLElement>;
|
|
503
501
|
constructor();
|
|
504
502
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
505
503
|
render(): TemplateResult<1>;
|
|
506
504
|
}
|
|
507
505
|
|
|
508
|
-
export declare class PktAlert extends
|
|
509
|
-
defaultSlot: Ref<HTMLElement>;
|
|
506
|
+
export declare class PktAlert extends PktElementWithSlot implements IPktAlert {
|
|
510
507
|
constructor();
|
|
511
508
|
compact: boolean;
|
|
512
509
|
title: string;
|
|
@@ -532,10 +529,7 @@ export declare class PktBackLink extends PktElement<IPktBackLink> implements IPk
|
|
|
532
529
|
render(): TemplateResult<1>;
|
|
533
530
|
}
|
|
534
531
|
|
|
535
|
-
export declare class PktButton extends
|
|
536
|
-
slotController: PktSlotController;
|
|
537
|
-
defaultSlot: Ref<HTMLElement>;
|
|
538
|
-
constructor();
|
|
532
|
+
export declare class PktButton extends PktElementWithSlot<IPktButton> implements IPktButton {
|
|
539
533
|
iconName: string;
|
|
540
534
|
secondIconName: string;
|
|
541
535
|
iconPath: string | undefined;
|
|
@@ -655,9 +649,7 @@ export declare class PktCalendar extends PktElement {
|
|
|
655
649
|
close(): void;
|
|
656
650
|
}
|
|
657
651
|
|
|
658
|
-
export declare class PktCard extends
|
|
659
|
-
defaultSlot: Ref<HTMLElement>;
|
|
660
|
-
constructor();
|
|
652
|
+
export declare class PktCard extends PktElementWithSlot implements IPktCard {
|
|
661
653
|
ariaLabel: string;
|
|
662
654
|
metaLead: string | null;
|
|
663
655
|
borderOnHover: boolean;
|
|
@@ -795,7 +787,6 @@ export declare class PktDatepicker extends PktInputElement<Props_4> {
|
|
|
795
787
|
/**
|
|
796
788
|
* Housekeeping / lifecycle methods
|
|
797
789
|
*/
|
|
798
|
-
constructor();
|
|
799
790
|
connectedCallback(): void;
|
|
800
791
|
disconnectedCallback(): void;
|
|
801
792
|
onInput(): void;
|
|
@@ -809,7 +800,6 @@ export declare class PktDatepicker extends PktInputElement<Props_4> {
|
|
|
809
800
|
get inputRefTo(): Ref<HTMLInputElement>;
|
|
810
801
|
calRef: Ref<PktCalendar>;
|
|
811
802
|
popupRef: Ref<HTMLDivElement>;
|
|
812
|
-
helptextSlot: Ref<HTMLElement>;
|
|
813
803
|
singleInputRef: Ref<PktDatepickerSingle>;
|
|
814
804
|
rangeInputRef: Ref<PktDatepickerRange>;
|
|
815
805
|
multipleInputRef: Ref<PktDatepickerMultiple>;
|
|
@@ -957,6 +947,27 @@ declare class PktElement<T = {}> extends PktShadowElement<T> {
|
|
|
957
947
|
createRenderRoot(): this;
|
|
958
948
|
}
|
|
959
949
|
|
|
950
|
+
/**
|
|
951
|
+
* Base class for Punkt light DOM elements that use the slotContent directive.
|
|
952
|
+
* Extends PktElement with slot content collection and distribution.
|
|
953
|
+
*
|
|
954
|
+
* Use this instead of PktElement when the component's template uses slotContent().
|
|
955
|
+
* @extends PktElement
|
|
956
|
+
*/
|
|
957
|
+
declare class PktElementWithSlot<T = {}> extends PktElement<T> {
|
|
958
|
+
/**
|
|
959
|
+
* Pre-collect children before Lit's first render clears them.
|
|
960
|
+
* This ensures slotContent() has access to the original children.
|
|
961
|
+
*/
|
|
962
|
+
connectedCallback(): void;
|
|
963
|
+
/**
|
|
964
|
+
* Checks if a slot has content distributed to it via the slotContent directive.
|
|
965
|
+
*
|
|
966
|
+
* @param slotName - Name of the slot. Omit for the default slot.
|
|
967
|
+
*/
|
|
968
|
+
hasSlotContent(slotName?: string): boolean;
|
|
969
|
+
}
|
|
970
|
+
|
|
960
971
|
/**
|
|
961
972
|
* PktHeader - Main header component for Oslo kommune services
|
|
962
973
|
*
|
|
@@ -969,9 +980,7 @@ declare class PktElement<T = {}> extends PktShadowElement<T> {
|
|
|
969
980
|
*
|
|
970
981
|
* TODO: Add `type` prop to switch between `service` and `global` header types
|
|
971
982
|
*/
|
|
972
|
-
export declare class PktHeader extends
|
|
973
|
-
defaultSlot: Ref<HTMLElement>;
|
|
974
|
-
slotController: PktSlotController;
|
|
983
|
+
export declare class PktHeader extends PktElementWithSlot<IPktHeader> implements IPktHeader {
|
|
975
984
|
serviceName?: string;
|
|
976
985
|
serviceLink?: string;
|
|
977
986
|
logoLink?: string;
|
|
@@ -995,7 +1004,6 @@ export declare class PktHeader extends PktElement<IPktHeader> implements IPktHea
|
|
|
995
1004
|
representing?: IPktHeaderRepresenting;
|
|
996
1005
|
userMenuFooter?: IPktHeaderUserMenuItem[];
|
|
997
1006
|
userOptions?: IPktHeaderUserMenuItem[];
|
|
998
|
-
constructor();
|
|
999
1007
|
firstUpdated(changedProperties: PropertyValues): void;
|
|
1000
1008
|
private emitDeprecationWarnings;
|
|
1001
1009
|
/**
|
|
@@ -1005,7 +1013,7 @@ export declare class PktHeader extends PktElement<IPktHeader> implements IPktHea
|
|
|
1005
1013
|
render(): TemplateResult<1>;
|
|
1006
1014
|
}
|
|
1007
1015
|
|
|
1008
|
-
export declare class PktHeaderService extends
|
|
1016
|
+
export declare class PktHeaderService extends PktElementWithSlot<IPktHeader> implements IPktHeader {
|
|
1009
1017
|
serviceName?: string;
|
|
1010
1018
|
serviceLink?: string;
|
|
1011
1019
|
logoLink?: string;
|
|
@@ -1032,11 +1040,8 @@ export declare class PktHeaderService extends PktElement<IPktHeader> implements
|
|
|
1032
1040
|
private openMenu;
|
|
1033
1041
|
private isHidden;
|
|
1034
1042
|
private componentWidth;
|
|
1035
|
-
private hasSlotContent;
|
|
1036
1043
|
private alignSlotRight;
|
|
1037
1044
|
private alignSearchRight;
|
|
1038
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1039
|
-
slotController: PktSlotController;
|
|
1040
1045
|
private headerRef;
|
|
1041
1046
|
private userContainerRef;
|
|
1042
1047
|
private slotContainerRef;
|
|
@@ -1048,8 +1053,6 @@ export declare class PktHeaderService extends PktElement<IPktHeader> implements
|
|
|
1048
1053
|
private savedScrollY;
|
|
1049
1054
|
private lastFocusedElement;
|
|
1050
1055
|
private shouldRestoreFocus;
|
|
1051
|
-
constructor();
|
|
1052
|
-
updateSlots(filledSlots: Set<string | null | undefined>): void;
|
|
1053
1056
|
connectedCallback(): void;
|
|
1054
1057
|
disconnectedCallback(): void;
|
|
1055
1058
|
firstUpdated(): void;
|
|
@@ -1120,16 +1123,12 @@ export declare class PktHeading extends PktShadowElement<IPktHeading> implements
|
|
|
1120
1123
|
render(): TemplateResult<1>;
|
|
1121
1124
|
}
|
|
1122
1125
|
|
|
1123
|
-
export declare class PktHelptext extends
|
|
1124
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1125
|
-
constructor();
|
|
1126
|
+
export declare class PktHelptext extends PktElementWithSlot {
|
|
1126
1127
|
forId: string;
|
|
1127
1128
|
helptext: string;
|
|
1128
1129
|
helptextDropdown: string;
|
|
1129
1130
|
helptextDropdownButton: string;
|
|
1130
1131
|
isHelpTextOpen: boolean;
|
|
1131
|
-
filledSlots: Set<string | null | undefined>;
|
|
1132
|
-
updateSlots(filledSlots: Set<string | null | undefined>): void;
|
|
1133
1132
|
render(): TemplateResult<1>;
|
|
1134
1133
|
}
|
|
1135
1134
|
|
|
@@ -1147,9 +1146,9 @@ export declare class PktIcon extends PktElement<Props_5> {
|
|
|
1147
1146
|
|
|
1148
1147
|
/**
|
|
1149
1148
|
* Base class for all Punkt input elements
|
|
1150
|
-
* @extends
|
|
1149
|
+
* @extends PktElementWithSlot
|
|
1151
1150
|
*/
|
|
1152
|
-
declare class PktInputElement<T = {}, TOption extends PktInputOption = PktInputOption> extends
|
|
1151
|
+
declare class PktInputElement<T = {}, TOption extends PktInputOption = PktInputOption> extends PktElementWithSlot<Props_2 & T> {
|
|
1153
1152
|
static get formAssociated(): boolean;
|
|
1154
1153
|
internals: any;
|
|
1155
1154
|
form: HTMLFormElement | null;
|
|
@@ -1158,7 +1157,6 @@ declare class PktInputElement<T = {}, TOption extends PktInputOption = PktInputO
|
|
|
1158
1157
|
multiple?: boolean;
|
|
1159
1158
|
range?: boolean;
|
|
1160
1159
|
type?: string;
|
|
1161
|
-
slotController?: PktSlotController;
|
|
1162
1160
|
optionsController?: PktOptionsSlotController;
|
|
1163
1161
|
_options?: TOption[];
|
|
1164
1162
|
defaultValue: string | string[] | null;
|
|
@@ -1314,10 +1312,7 @@ declare interface PktInputOption {
|
|
|
1314
1312
|
hidden?: boolean;
|
|
1315
1313
|
}
|
|
1316
1314
|
|
|
1317
|
-
export declare class PktInputWrapper extends
|
|
1318
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1319
|
-
helptextSlot: Ref<HTMLElement>;
|
|
1320
|
-
constructor();
|
|
1315
|
+
export declare class PktInputWrapper extends PktElementWithSlot<Props_6> {
|
|
1321
1316
|
/**
|
|
1322
1317
|
* Element attributes
|
|
1323
1318
|
*/
|
|
@@ -1350,9 +1345,7 @@ export declare class PktInputWrapper extends PktElement<Props_6> {
|
|
|
1350
1345
|
private handleLabelClick;
|
|
1351
1346
|
}
|
|
1352
1347
|
|
|
1353
|
-
export declare class PktLink extends
|
|
1354
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1355
|
-
constructor();
|
|
1348
|
+
export declare class PktLink extends PktElementWithSlot {
|
|
1356
1349
|
/**
|
|
1357
1350
|
* Element attributes
|
|
1358
1351
|
*/
|
|
@@ -1364,15 +1357,13 @@ export declare class PktLink extends PktElement {
|
|
|
1364
1357
|
render(): TemplateResult<1>;
|
|
1365
1358
|
}
|
|
1366
1359
|
|
|
1367
|
-
export declare class PktLinkCard extends
|
|
1368
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1360
|
+
export declare class PktLinkCard extends PktElementWithSlot implements IPktLinkCard {
|
|
1369
1361
|
title: string;
|
|
1370
1362
|
href: string;
|
|
1371
1363
|
iconName: string;
|
|
1372
1364
|
external: boolean;
|
|
1373
1365
|
openInNewTab: boolean;
|
|
1374
1366
|
skin: TLinkCardSkin;
|
|
1375
|
-
constructor();
|
|
1376
1367
|
render(): TemplateResult<1>;
|
|
1377
1368
|
}
|
|
1378
1369
|
|
|
@@ -1419,9 +1410,7 @@ declare class PktListbox extends PktElement implements IPktListbox {
|
|
|
1419
1410
|
private handleTypeAhead;
|
|
1420
1411
|
}
|
|
1421
1412
|
|
|
1422
|
-
export declare class PktLoader extends
|
|
1423
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1424
|
-
constructor();
|
|
1413
|
+
export declare class PktLoader extends PktElementWithSlot implements IPktLoader {
|
|
1425
1414
|
delay: number;
|
|
1426
1415
|
inline: boolean;
|
|
1427
1416
|
isLoading: boolean;
|
|
@@ -1437,8 +1426,7 @@ export declare class PktLoader extends PktElement implements IPktLoader {
|
|
|
1437
1426
|
private setupLoader;
|
|
1438
1427
|
}
|
|
1439
1428
|
|
|
1440
|
-
export declare class PktMessagebox extends
|
|
1441
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1429
|
+
export declare class PktMessagebox extends PktElementWithSlot implements IPktMessagebox {
|
|
1442
1430
|
constructor();
|
|
1443
1431
|
closable: boolean;
|
|
1444
1432
|
compact: boolean;
|
|
@@ -1450,7 +1438,7 @@ export declare class PktMessagebox extends PktElement implements IPktMessagebox
|
|
|
1450
1438
|
private close;
|
|
1451
1439
|
}
|
|
1452
1440
|
|
|
1453
|
-
export declare class PktModal extends
|
|
1441
|
+
export declare class PktModal extends PktElementWithSlot implements IPktModal {
|
|
1454
1442
|
headingText?: string;
|
|
1455
1443
|
removePadding?: boolean;
|
|
1456
1444
|
hideCloseButton?: boolean;
|
|
@@ -1460,7 +1448,6 @@ export declare class PktModal extends PktElement implements IPktModal {
|
|
|
1460
1448
|
variant?: 'dialog' | 'drawer';
|
|
1461
1449
|
drawerPosition?: 'left' | 'right';
|
|
1462
1450
|
transparentBackdrop?: boolean;
|
|
1463
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1464
1451
|
dialogRef: Ref<HTMLDialogElement>;
|
|
1465
1452
|
_isOpen: boolean;
|
|
1466
1453
|
constructor();
|
|
@@ -1612,7 +1599,6 @@ export { PktRadioButton as PktRadiobutton }
|
|
|
1612
1599
|
|
|
1613
1600
|
export declare class PktSelect extends PktOptionsInputElement<{}, TSelectOption> implements IPktSelect {
|
|
1614
1601
|
inputRef: Ref<HTMLSelectElement>;
|
|
1615
|
-
private helptextSlot;
|
|
1616
1602
|
value: string;
|
|
1617
1603
|
selectedIndex: number | null;
|
|
1618
1604
|
selectedOptions: HTMLCollectionOf<HTMLOptionElement> | undefined;
|
|
@@ -1648,33 +1634,7 @@ declare class PktShadowElement<T = {}> extends LitElement {
|
|
|
1648
1634
|
hotReplacedCallback(): void;
|
|
1649
1635
|
}
|
|
1650
1636
|
|
|
1651
|
-
|
|
1652
|
-
* Controls the distribution of nodes into slots WITHOUT using Shadow DOM.
|
|
1653
|
-
* This controller provides a lightweight alternative to Shadow DOM slot distribution,
|
|
1654
|
-
* allowing content to be distributed into specific elements while maintaining
|
|
1655
|
-
* style penetration and global CSS access.
|
|
1656
|
-
*
|
|
1657
|
-
* */
|
|
1658
|
-
declare class PktSlotController implements ReactiveController {
|
|
1659
|
-
host: LitElement & ReactiveControllerHost;
|
|
1660
|
-
nodes: Element[];
|
|
1661
|
-
slots: Ref<HTMLElement>[];
|
|
1662
|
-
observer: MutationObserver;
|
|
1663
|
-
filledSlots: Set<string | null | undefined>;
|
|
1664
|
-
skipOptions: boolean;
|
|
1665
|
-
private updatingSlots;
|
|
1666
|
-
private needsSlotUpdate;
|
|
1667
|
-
constructor(host: LitElement & ReactiveControllerHost, ...slots: Ref<HTMLElement>[]);
|
|
1668
|
-
hostConnected(): void;
|
|
1669
|
-
hostDisconnected(): void;
|
|
1670
|
-
hostUpdated(): void;
|
|
1671
|
-
private updateNodes;
|
|
1672
|
-
private updateSlots;
|
|
1673
|
-
private handleMutations;
|
|
1674
|
-
private handleSlotMutations;
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
export declare class PktTabItem extends PktElement<IPktTabItem> implements IPktTabItem {
|
|
1637
|
+
export declare class PktTabItem extends PktElementWithSlot<IPktTabItem> implements IPktTabItem {
|
|
1678
1638
|
active: boolean;
|
|
1679
1639
|
href: string;
|
|
1680
1640
|
icon: string;
|
|
@@ -1684,8 +1644,6 @@ export declare class PktTabItem extends PktElement<IPktTabItem> implements IPktT
|
|
|
1684
1644
|
index: number;
|
|
1685
1645
|
context?: TabsContext;
|
|
1686
1646
|
elementRef: Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
1687
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1688
|
-
slotController: PktSlotController;
|
|
1689
1647
|
constructor();
|
|
1690
1648
|
connectedCallback(): void;
|
|
1691
1649
|
private handleClick;
|
|
@@ -1693,15 +1651,12 @@ export declare class PktTabItem extends PktElement<IPktTabItem> implements IPktT
|
|
|
1693
1651
|
render(): TemplateResult<1>;
|
|
1694
1652
|
}
|
|
1695
1653
|
|
|
1696
|
-
export declare class PktTabs extends
|
|
1654
|
+
export declare class PktTabs extends PktElementWithSlot<IPktTabs> implements IPktTabs {
|
|
1697
1655
|
arrowNav: boolean;
|
|
1698
1656
|
disableArrowNav: boolean;
|
|
1699
1657
|
private tabRefs;
|
|
1700
1658
|
private tabCount;
|
|
1701
1659
|
private get useArrowNav();
|
|
1702
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1703
|
-
slotController: PktSlotController;
|
|
1704
|
-
constructor();
|
|
1705
1660
|
private context;
|
|
1706
1661
|
updated(changedProperties: PropertyValues): void;
|
|
1707
1662
|
private registerTab;
|
|
@@ -1710,9 +1665,7 @@ export declare class PktTabs extends PktElement<IPktTabs> implements IPktTabs {
|
|
|
1710
1665
|
render(): TemplateResult<1>;
|
|
1711
1666
|
}
|
|
1712
1667
|
|
|
1713
|
-
export declare class PktTag extends
|
|
1714
|
-
slotController: PktSlotController;
|
|
1715
|
-
defaultSlot: Ref<HTMLElement>;
|
|
1668
|
+
export declare class PktTag extends PktElementWithSlot<IPktTag> implements IPktTag {
|
|
1716
1669
|
constructor();
|
|
1717
1670
|
/**
|
|
1718
1671
|
* Element attributes
|
|
@@ -1743,12 +1696,10 @@ export declare class PktTag extends PktElement<IPktTag> implements IPktTag {
|
|
|
1743
1696
|
|
|
1744
1697
|
export declare class PktTextarea extends PktInputElement<Props_8> {
|
|
1745
1698
|
inputRef: Ref<HTMLTextAreaElement>;
|
|
1746
|
-
private helptextSlot;
|
|
1747
1699
|
value: string;
|
|
1748
1700
|
autocomplete: string;
|
|
1749
1701
|
rows: number | null;
|
|
1750
1702
|
counterCurrent: number;
|
|
1751
|
-
constructor();
|
|
1752
1703
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
1753
1704
|
updated(changedProperties: PropertyValues): void;
|
|
1754
1705
|
render(): TemplateResult<1>;
|
|
@@ -1756,7 +1707,6 @@ export declare class PktTextarea extends PktInputElement<Props_8> {
|
|
|
1756
1707
|
|
|
1757
1708
|
export declare class PktTextinput extends PktInputElement<Props_9> {
|
|
1758
1709
|
inputRef: Ref<HTMLTextAreaElement>;
|
|
1759
|
-
private helptextSlot;
|
|
1760
1710
|
value: string;
|
|
1761
1711
|
type: string;
|
|
1762
1712
|
size: number | null;
|
|
@@ -1766,7 +1716,6 @@ export declare class PktTextinput extends PktInputElement<Props_9> {
|
|
|
1766
1716
|
suffix: string | null;
|
|
1767
1717
|
omitSearchIcon: boolean;
|
|
1768
1718
|
counterCurrent: number;
|
|
1769
|
-
constructor();
|
|
1770
1719
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
1771
1720
|
updated(changedProperties: PropertyValues): void;
|
|
1772
1721
|
render(): TemplateResult<1>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("./element-CMTfByxQ.cjs"),Ct=require("./utils-byXsEz1u.cjs"),Ft=require("./booleanish-BKVonob4.cjs"),Tt=require("./input-wrapper-EoSAbU-U.cjs"),xt=require("./element-with-slot-yT8k1Z37.cjs");var lt={},ct;function It(){return ct||(ct=1,(function(){(function(p){const a=new WeakMap,n=new WeakMap,f=new WeakMap,u=new WeakMap,b=new WeakMap,k=new WeakMap,S=new WeakMap,g=new WeakMap,A=new WeakMap,V=new WeakMap,C=new WeakMap,F=new WeakMap,z=new WeakMap,K=new WeakMap,x=new WeakMap,I={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},ht=(e,t)=>{for(let i in I){t[i]=null;let s=null;const o=I[i];Object.defineProperty(t,i,{get(){return s},set(d){s=d,e.isConnected?M(e,o,d):V.set(e,t)}})}};function j(e){const t=u.get(e),{form:i}=t;Z(e,i,t),Y(e,t.labels)}const G=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(d){return u.has(d)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=i.nextNode();const o=!t||e.disabled;for(;s;)s.formDisabledCallback&&o&&B(s,e.disabled),s=i.nextNode()},J={attributes:!0,attributeFilter:["disabled","name"]},R=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?B(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&G(i)),t.attributeName==="name"&&i.constructor.formAssociated){const s=u.get(i),o=A.get(i);s.setFormValue(o)}}}):{};function P(e){e.forEach(t=>{const{addedNodes:i,removedNodes:s}=t,o=Array.from(i),d=Array.from(s);o.forEach(h=>{var y;if(u.has(h)&&h.constructor.formAssociated&&j(h),V.has(h)){const m=V.get(h);Object.keys(I).filter(v=>m[v]!==null).forEach(v=>{M(h,I[v],m[v])}),V.delete(h)}if(x.has(h)){const m=x.get(h);M(h,"internals-valid",m.validity.valid.toString()),M(h,"internals-invalid",(!m.validity.valid).toString()),M(h,"aria-invalid",(!m.validity.valid).toString()),x.delete(h)}if(h.localName==="form"){const m=g.get(h),E=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT,{acceptNode($){return u.has($)&&$.constructor.formAssociated&&!(m&&m.has($))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let v=E.nextNode();for(;v;)j(v),v=E.nextNode()}h.localName==="fieldset"&&((y=R.observe)===null||y===void 0||y.call(R,h,J),G(h,!0))}),d.forEach(h=>{const y=u.get(h);y&&f.get(y)&&Q(y),S.has(h)&&S.get(h).disconnect()})})}function ut(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(s=>{const o=z.get(t.target);u.has(s)&&et(s),o.disconnect()})})}const ft=e=>{var t,i;const s=new MutationObserver(ut);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=s.observe)===null||i===void 0||i.call(s,e,{childList:!0}),z.set(e,s)};O()&&new MutationObserver(P);const W={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},B=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},Q=e=>{f.get(e).forEach(i=>{i.remove()}),f.set(e,[])},X=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),f.get(t).push(i),i},pt=(e,t)=>{var i;f.set(t,[]),(i=R.observe)===null||i===void 0||i.call(R,e,J)},Y=(e,t)=>{if(t.length){Array.from(t).forEach(s=>s.addEventListener("click",e.click.bind(e)));let i=t[0].id;t[0].id||(i=`${t[0].htmlFor}_Label`,t[0].id=i),M(e,"aria-labelledby",i)}},L=e=>{const t=Array.from(e.elements).filter(d=>!d.tagName.includes("-")&&d.validity).map(d=>d.validity.valid),i=g.get(e)||[],s=Array.from(i).filter(d=>d.isConnected).map(d=>u.get(d).validity.valid),o=[...t,...s].includes(!1);e.toggleAttribute("internals-invalid",o),e.toggleAttribute("internals-valid",!o)},mt=e=>{L(N(e.target))},yt=e=>{L(N(e.target))},gt=e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map(i=>`${i}:not([disabled])`).map(i=>`${i}:not([form])${e.id?`,${i}[form='${e.id}']`:""}`).join(",");e.addEventListener("click",i=>{if(i.target.closest(t)){const o=g.get(e);if(e.noValidate)return;o.size&&Array.from(o).reverse().map(y=>u.get(y).reportValidity()).includes(!1)&&i.preventDefault()}})},vt=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},Z=(e,t,i)=>{if(t){const s=g.get(t);if(s)s.add(e);else{const o=new Set;o.add(e),g.set(t,o),gt(t),t.addEventListener("reset",vt),t.addEventListener("input",mt),t.addEventListener("change",yt)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),L(t)}},N=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=N(t)),t},w=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},tt=(e,t,i)=>{const s=g.get(e);return s&&s.size&&s.forEach(o=>{u.get(o)[i]()||(t=!1)}),t},et=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:s}=t;Y(e,i),Z(e,s,t)}};function O(){return typeof MutationObserver<"u"}class bt{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const wt=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),Et=(e,t,i)=>(e.valid=Mt(t),Object.keys(t).forEach(s=>e[s]=t[s]),i&&L(i),e),Mt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},_=new WeakMap;function it(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class H extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");_.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);const i=super.add(t),s=_.get(this),o=`state${t}`;return s.isConnected?it(s,o):setTimeout(()=>{it(s,o)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),s=_.get(this);return s.isConnected?(s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)):setTimeout(()=>{s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)}),i}}function at(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(e):s?s.value:t.get(e)}function kt(e,t,i,s,o){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var T;class Vt{constructor(t){T.set(this,void 0),kt(this,T,t);for(let i=0;i<t.length;i++){let s=t[i];this[i]=s,s.hasAttribute("name")&&(this[s.getAttribute("name")]=s)}Object.freeze(this)}get length(){return at(this,T,"f").length}[(T=new WeakMap,Symbol.iterator)](){return at(this,T,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function St(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=s;function i(...d){let h=e.apply(this,d);return tt(this,h,"checkValidity")}function s(...d){let h=t.apply(this,d);return tt(this,h,"reportValidity")}const{get:o}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...d){const h=o.call(this,...d),y=Array.from(g.get(this)||[]);if(y.length===0)return h;const m=Array.from(h).concat(y).sort((E,v)=>E.compareDocumentPosition?E.compareDocumentPosition(v)&2?1:-1:0);return new Vt(m)}})}class st{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),s=new bt;this.states=new H(t),a.set(this,t),n.set(this,s),u.set(t,this),ht(t,this),pt(t,this),Object.seal(this),i instanceof DocumentFragment&&ft(i)}checkValidity(){const t=a.get(this);if(w(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=n.get(this);if(!i.valid){const s=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(s)}return i.valid}get form(){const t=a.get(this);w(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let i;return t.constructor.formAssociated===!0&&(i=N(t)),i}get labels(){const t=a.get(this);w(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),s=t.getRootNode();return s&&i?s.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=a.get(this);if(w(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=this.checkValidity(),s=F.get(this);if(s&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&s&&(t.focus(),s.focus()),i}setFormValue(t){const i=a.get(this);if(w(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Q(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const s=X(i,this);s.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([s,o])=>{if(typeof o=="string"){const d=X(i,this);d.name=s,d.value=o}});A.set(i,t)}setValidity(t,i,s){const o=a.get(this);if(w(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");F.set(this,s);const d=n.get(this),h={};for(const E in t)h[E]=t[E];Object.keys(h).length===0&&wt(d);const y=Object.assign(Object.assign({},d),h);delete y.valid;const{valid:m}=Et(d,y,this.form);if(!m&&!i)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");b.set(this,m?"":i),o.isConnected?(o.toggleAttribute("internals-invalid",!m),o.toggleAttribute("internals-valid",m),M(o,"aria-invalid",`${!m}`)):x.set(o,this)}get shadowRoot(){const t=a.get(this),i=C.get(t);return i||null}get validationMessage(){const t=a.get(this);return w(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),b.get(this)}get validity(){const t=a.get(this);return w(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get willValidate(){const t=a.get(this);return w(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function At(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const i=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(s=>s in i.internals)}let rt=!1,nt=!1;function q(e){nt||(nt=!0,window.CustomStateSet=H,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new H(this),i}))}function ot(e=!0){if(!rt){if(rt=!0,typeof window<"u"&&(window.ElementInternals=st),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,s,o){if(s.formAssociated){const d=s.prototype.connectedCallback;s.prototype.connectedCallback=function(){K.has(this)||(K.set(this,!0),this.hasAttribute("disabled")&&B(this,!0)),d!=null&&d.apply(this),et(this)}}t.call(this,i,s,o)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new st(this)}),typeof Element<"u"){let t=function(...s){const o=i.apply(this,s);if(C.set(this,o),O()){const d=new MutationObserver(P);window.ShadyDOM?d.observe(this,W):d.observe(o,W),S.set(this,d)}return o};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(P).observe(document.documentElement,W),typeof HTMLFormElement<"u"&&St(),(e||typeof window<"u"&&!window.CustomStateSet)&&q()}}return!!customElements.polyfillWrapFlushCallback||(At()?typeof window<"u"&&!window.CustomStateSet&&q(HTMLElement.prototype.attachInternals):ot(!1)),p.forceCustomStateSetPolyfill=q,p.forceElementInternalsPolyfill=ot,Object.defineProperty(p,"__esModule",{value:!0}),p})({})})()),lt}It();var Rt=Object.defineProperty,c=(p,a,n,f)=>{for(var u=void 0,b=p.length-1,k;b>=0;b--)(k=p[b])&&(u=k(a,n,u)||u);return u&&Rt(a,n,u),u};const dt="on",U="--checked",D=",";class l extends xt.PktElementWithSlot{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=Ct.uuidish(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Tt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.strings.forms.labels.optional,this.requiredText=r.strings.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(a){var n,f,u,b,k,S,g,A,V,C,F;if(!a){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.strings.forms.messages.required,a):(n=a.validity)!=null&&n.typeMismatch||(f=a.validity)!=null&&f.badInput?this.internals.setValidity({typeMismatch:!0},r.strings.forms.messages.invalid,a):(u=a.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.strings.forms.messages.invalidPattern,a):(b=a.validity)!=null&&b.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.strings.forms.messages.tooShort,a):(k=a.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.strings.forms.messages.tooLong,a):(S=a.validity)!=null&&S.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.strings.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.strings.forms.messages.rangeUnderflow,a):(A=a.validity)!=null&&A.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.strings.forms.messages.invalid,a):(V=a.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.strings.forms.messages.rangeOverflowMax.replace("{max}",(C=this.max)==null?void 0:C.toString()):r.strings.forms.messages.rangeOverflow,a):(F=a.validity)!=null&&F.customError?this.internals.setValidity({customError:!0},a.validationMessage,a):this.internals.setValidity({})}setFormValue(a){if(this.internals)if(Array.isArray(a)){const n=new FormData;a.forEach(f=>{n.append(this.name,f)}),this.internals.setFormValue(n)}else this.internals.setFormValue(a)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const a=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(a).forEach(n=>{var f;if(n!==this&&n.getAttribute("name")===this.name&&n.getAttribute("value")!==this.value){const u=n;u.checked&&(u.checked=!1,u.internals&&(u.internals.setFormValue(null),(f=u.internals.states)==null||f.delete(U)))}})}valueChecked(a){if(!this.touched)return;const n=this.internals.form||this.closest("form"),f=n?new FormData(n):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof a=="string"?(this.checked=a==="true",this.internals.ariaChecked=String(a==="true")):typeof a=="boolean"&&(this.checked=a,this.internals.ariaChecked=String(a)),this.checked){const u=(typeof this.value=="string"?this.value:"")||dt;this.internals.setFormValue(u),f&&f.append(this.name,u),this.internals.states.add(U)}else this.internals.setFormValue(null),f&&f.delete(this.name),this.internals.states.delete(U);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(a,n){(n!==this.value||n!==this._value)&&(typeof a=="string"?((this.multiple||this.range)&&a.includes(D)&&(a=a.split(D)),this.value=a,this._value=Array.isArray(a)?a:[a]):Array.isArray(a)?(this.value=this.multiple||this.range?a:a[0],this._value=a):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.toString())&&this.onChange(this.value))}dispatchChangeEvents(a){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:a,bubbles:!0,composed:!0}))}clearInputValue(){const a=this.multiple||this.range?[]:"";this.value=a,this.setFormValue(a),this.dispatchChangeEvents(a)}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}normalizeValue(a){return(this.range||this.multiple)&&typeof a=="string"&&a.includes(D)?a.split(D):!this.multiple&&!this.range&&Array.isArray(a)?a[0]||"":a}validate(){var a,n;(a=this.inputRef)!=null&&a.value&&this.manageValidity(this.inputRef.value),(n=this.inputRefTo)!=null&&n.value&&this.manageValidity(this.inputRefTo.value)}onChange(a){if(!this.touched){this.touched=!0,a&&this.setFormValue(a);return}if(typeof a!="string"&&!Array.isArray(a))return;const n=this.normalizeValue(a);this.setFormValue(n),this.validate(),this.dispatchChangeEvents(n)}formResetCallback(){var a;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(n=>{"selected"in n&&(n.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(a=this.inputRef)!=null&&a.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const n=this.defaultValue||(this.multiple||this.range?[]:"");this.value=n,this._value=Array.isArray(n)?n:[n],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(a){super.updated(a),a.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(a){if(super.firstUpdated(a),!this.form){const n=this.internals.form||this.closest("form");this.form=n}if(this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const n=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(n);const f=n?(typeof this.value=="string"?this.value:"")||dt:null;this.internals.setFormValue(f)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}}c([r.n({type:Boolean,reflect:!0})],l.prototype,"checked");c([r.n({type:Boolean})],l.prototype,"defaultChecked");c([r.n({type:Boolean})],l.prototype,"multiple");c([r.n({type:Boolean})],l.prototype,"range");c([r.n({type:String,reflect:!0})],l.prototype,"type");c([r.n()],l.prototype,"defaultValue");c([r.n({type:Boolean,reflect:!0})],l.prototype,"disabled");c([r.n({type:Boolean,reflect:!0})],l.prototype,"readonly");c([r.n({type:Boolean,reflect:!0})],l.prototype,"required");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"max");c([r.n({type:Number,reflect:!0})],l.prototype,"maxlength");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"min");c([r.n({type:Number,reflect:!0})],l.prototype,"minlength");c([r.n({type:Number,reflect:!0})],l.prototype,"step");c([r.n({type:String})],l.prototype,"ariaDescribedBy");c([r.n({type:String})],l.prototype,"ariaLabelledby");c([r.n({type:String,reflect:!0})],l.prototype,"name");c([r.n({type:String,reflect:!0})],l.prototype,"pattern");c([r.n({type:String,reflect:!0})],l.prototype,"placeholder");c([r.n({type:String,reflect:!0})],l.prototype,"id");c([r.n({type:Boolean})],l.prototype,"counter");c([r.n({type:Boolean})],l.prototype,"hasError");c([r.n({type:Boolean})],l.prototype,"inline");c([r.n({type:Boolean})],l.prototype,"hasFieldset");c([r.n({type:Boolean})],l.prototype,"optionalTag");c([r.n({type:Boolean})],l.prototype,"requiredTag");c([r.n({type:Boolean})],l.prototype,"skipForwardTestid");c([r.n({type:Boolean,reflect:!0,converter:Ft.booleanishConverter})],l.prototype,"useWrapper");c([r.n({type:Boolean,reflect:!0})],l.prototype,"fullwidth");c([r.n({type:Number})],l.prototype,"counterMaxLength");c([r.n({type:String})],l.prototype,"errorMessage");c([r.n({type:String})],l.prototype,"helptext");c([r.n({type:String})],l.prototype,"helptextDropdown");c([r.n({type:String,reflect:!1})],l.prototype,"helptextDropdownButton");c([r.n({type:String})],l.prototype,"label");c([r.n({type:String,reflect:!1})],l.prototype,"optionalText");c([r.n({type:String,reflect:!1})],l.prototype,"requiredText");c([r.n({type:String,reflect:!1})],l.prototype,"tagText");c([r.n({type:String,attribute:"data-testid"})],l.prototype,"dataTestid");exports.PktInputElement=l;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as
|
|
3
|
-
import { b as
|
|
4
|
-
import { s as
|
|
1
|
+
import { s as g, n as o } from "./element-CV9utnHJ.js";
|
|
2
|
+
import { u as Ft } from "./utils-DznhwRXm.js";
|
|
3
|
+
import { b as Tt } from "./booleanish-C9R0tdXH.js";
|
|
4
|
+
import { s as xt } from "./input-wrapper-CDgenrYA.js";
|
|
5
|
+
import { P as It } from "./element-with-slot-1djk8KXi.js";
|
|
5
6
|
var ct = {}, dt;
|
|
6
7
|
function Rt() {
|
|
7
8
|
return dt || (dt = 1, (function() {
|
|
@@ -483,9 +484,9 @@ var Lt = Object.defineProperty, l = (p, a, r, f) => {
|
|
|
483
484
|
return u && Lt(a, r, u), u;
|
|
484
485
|
};
|
|
485
486
|
const ht = "on", z = "--checked", P = ",";
|
|
486
|
-
class c extends
|
|
487
|
+
class c extends It {
|
|
487
488
|
constructor() {
|
|
488
|
-
super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id =
|
|
489
|
+
super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = Ft(), this.counter = !1, this.hasError = !1, this.inline = !1, this.hasFieldset = !1, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = xt.props.helptextDropdownButton.default, this.label = null, this.optionalText = g.forms.labels.optional, this.requiredText = g.forms.labels.required, this.tagText = null, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
|
|
489
490
|
}
|
|
490
491
|
static get formAssociated() {
|
|
491
492
|
return !0;
|
|
@@ -796,7 +797,7 @@ l([
|
|
|
796
797
|
o({ type: Boolean })
|
|
797
798
|
], c.prototype, "skipForwardTestid");
|
|
798
799
|
l([
|
|
799
|
-
o({ type: Boolean, reflect: !0, converter:
|
|
800
|
+
o({ type: Boolean, reflect: !0, converter: Tt })
|
|
800
801
|
], c.prototype, "useWrapper");
|
|
801
802
|
l([
|
|
802
803
|
o({ type: Boolean, reflect: !0 })
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { o as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { b as S } from "./booleanish-C9R0tdXH.js";
|
|
1
|
+
import { P as $, s as g } from "./element-with-slot-1djk8KXi.js";
|
|
2
|
+
import { o as x } from "./if-defined-rXcLNTzN.js";
|
|
3
|
+
import { A as s, b as o, n as r, t as m } from "./element-CV9utnHJ.js";
|
|
4
|
+
import { o as k } from "./icon-D0IQAVwS.js";
|
|
5
|
+
import { e as v } from "./class-map-3ADKve8g.js";
|
|
6
|
+
import { u as w } from "./utils-DznhwRXm.js";
|
|
7
|
+
import { b as T } from "./booleanish-C9R0tdXH.js";
|
|
9
8
|
import { s as p } from "./input-wrapper-CDgenrYA.js";
|
|
10
|
-
import "./helptext-
|
|
11
|
-
import "./alert-
|
|
12
|
-
var
|
|
13
|
-
for (var i = h > 1 ? void 0 : h ?
|
|
9
|
+
import "./helptext-DepcDYFV.js";
|
|
10
|
+
import "./alert-ca_hFi-u.js";
|
|
11
|
+
var E = Object.defineProperty, D = Object.getOwnPropertyDescriptor, e = (l, a, n, h) => {
|
|
12
|
+
for (var i = h > 1 ? void 0 : h ? D(a, n) : a, d = l.length - 1, u; d >= 0; d--)
|
|
14
13
|
(u = l[d]) && (i = (h ? u(a, n, i) : u(i)) || i);
|
|
15
|
-
return h && i &&
|
|
14
|
+
return h && i && E(a, n, i), i;
|
|
16
15
|
};
|
|
17
|
-
let t = class extends
|
|
16
|
+
let t = class extends $ {
|
|
18
17
|
constructor() {
|
|
19
|
-
super(), this.
|
|
18
|
+
super(...arguments), this.forId = w(), this.label = "", this.helptext = null, this.helptextDropdown = null, this.helptextDropdownButton = null, this.counter = p.props.counter.default, this.counterCurrent = 0, this.counterMaxLength = 0, this.counterError = null, this.counterPosition = "bottom", this.optionalTag = p.props.optionalTag.default, this.optionalText = p.props.optionalText.default, this.requiredTag = p.props.requiredTag.default, this.requiredText = p.props.requiredText.default, this.tagText = null, this.hasError = p.props.hasError.default, this.errorMessage = "", this.disabled = p.props.disabled.default, this.inline = p.props.inline.default, this.ariaDescribedby = void 0, this.hasFieldset = p.props.hasFieldset.default, this.role = "group", this.useWrapper = p.props.useWrapper.default;
|
|
20
19
|
}
|
|
21
20
|
updated(l) {
|
|
22
21
|
super.updated(l);
|
|
@@ -53,39 +52,37 @@ let t = class extends x {
|
|
|
53
52
|
${this.label}
|
|
54
53
|
</label>`, d = () => o`
|
|
55
54
|
<pkt-helptext
|
|
56
|
-
class="${
|
|
55
|
+
class="${x(this.useWrapper ? void 0 : "pkt-hide")}"
|
|
57
56
|
.forId=${this.forId}
|
|
58
57
|
.helptext=${this.helptext}
|
|
59
58
|
.helptextDropdown=${this.helptextDropdown}
|
|
60
59
|
.helptextDropdownButton=${this.helptextDropdownButton || p.props.helptextDropdownButton.default}
|
|
61
|
-
@toggleHelpText=${(
|
|
62
|
-
this.toggleDropdown(
|
|
60
|
+
@toggleHelpText=${(f) => {
|
|
61
|
+
this.toggleDropdown(f);
|
|
63
62
|
}}
|
|
64
|
-
|
|
65
|
-
name="helptext"
|
|
66
|
-
></pkt-helptext>
|
|
63
|
+
>${g(this, "helptext")}</pkt-helptext>
|
|
67
64
|
`, u = () => this.counter ? o`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
68
65
|
${this.counterError ? this.counterError : s} ${this.counterCurrent || 0}
|
|
69
66
|
${this.counterMaxLength ? `/${this.counterMaxLength}` : s}
|
|
70
|
-
</div>` : s,
|
|
67
|
+
</div>` : s, b = () => this.hasError && this.errorMessage ? o`<pkt-alert
|
|
71
68
|
skin="error"
|
|
72
69
|
compact
|
|
73
70
|
id=${`${this.forId}-error`}
|
|
74
71
|
aria-live="assertive"
|
|
75
72
|
aria-atomic="true"
|
|
76
73
|
>
|
|
77
|
-
${
|
|
74
|
+
${k(this.errorMessage)}
|
|
78
75
|
</pkt-alert>` : s, c = () => o`
|
|
79
76
|
${i()}
|
|
80
77
|
${d()}
|
|
81
78
|
${this.counterPosition === "top" ? u() : s}
|
|
82
|
-
<div class="pkt-contents"
|
|
79
|
+
<div class="pkt-contents">${g(this)}</div>
|
|
83
80
|
${this.counterPosition === "bottom" ? u() : s}
|
|
84
|
-
${
|
|
85
|
-
`,
|
|
81
|
+
${b()}
|
|
82
|
+
`, y = () => this.hasFieldset ? o`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${n}">
|
|
86
83
|
${c()}
|
|
87
84
|
</fieldset>` : o`<div class="pkt-inputwrapper__fieldset">${c()}</div>`;
|
|
88
|
-
return o`<div class=${
|
|
85
|
+
return o`<div class=${v(l)}>${y()}</div> `;
|
|
89
86
|
}
|
|
90
87
|
toggleDropdown(l) {
|
|
91
88
|
this.dispatchEvent(
|
|
@@ -172,7 +169,7 @@ e([
|
|
|
172
169
|
r({ type: String, reflect: !0 })
|
|
173
170
|
], t.prototype, "role", 2);
|
|
174
171
|
e([
|
|
175
|
-
r({ type: Boolean, reflect: !0, converter:
|
|
172
|
+
r({ type: Boolean, reflect: !0, converter: T })
|
|
176
173
|
], t.prototype, "useWrapper", 2);
|
|
177
174
|
t = e([
|
|
178
175
|
m("pkt-input-wrapper")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const u=require("./element-with-slot-yT8k1Z37.cjs"),y=require("./if-defined-hKKmbsI8.cjs"),t=require("./element-CMTfByxQ.cjs"),k=require("./icon-Dj0oZZSa.cjs"),$=require("./class-map-Bokp1SoS.cjs"),f=require("./utils-byXsEz1u.cjs"),x=require("./booleanish-BKVonob4.cjs"),r=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-B366oeR9.cjs");require("./alert-C95U_RZ0.cjs");var I=Object.defineProperty,P=Object.getOwnPropertyDescriptor,e=(l,p,n,o)=>{for(var s=o>1?void 0:o?P(p,n):p,i=l.length-1,a;i>=0;i--)(a=l[i])&&(s=(o?a(p,n,s):a(s))||s);return o&&s&&I(p,n,s),s};exports.PktInputWrapper=class extends u.PktElementWithSlot{constructor(){super(...arguments),this.forId=f.uuidish(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=r.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=r.specs.props.optionalTag.default,this.optionalText=r.specs.props.optionalText.default,this.requiredTag=r.specs.props.requiredTag.default,this.requiredText=r.specs.props.requiredText.default,this.tagText=null,this.hasError=r.specs.props.hasError.default,this.errorMessage="",this.disabled=r.specs.props.disabled.default,this.inline=r.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=r.specs.props.hasFieldset.default,this.role="group",this.useWrapper=r.specs.props.useWrapper.default}updated(p){super.updated(p)}render(){const p={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},n="pkt-tag pkt-tag--small pkt-tag--thin-text",o=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:t.A,s=()=>t.b`
|
|
2
2
|
${this.tagText?t.b`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:t.A}
|
|
3
3
|
${this.optionalTag?t.b`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.A}
|
|
4
4
|
${this.requiredTag?t.b`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:t.A}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
id="${this.forId}-label"
|
|
23
23
|
>
|
|
24
24
|
${this.label}
|
|
25
|
-
</label>`,
|
|
25
|
+
</label>`,a=()=>t.b`
|
|
26
26
|
<pkt-helptext
|
|
27
27
|
class="${y.o(this.useWrapper?void 0:"pkt-hide")}"
|
|
28
28
|
.forId=${this.forId}
|
|
@@ -30,9 +30,7 @@
|
|
|
30
30
|
.helptextDropdown=${this.helptextDropdown}
|
|
31
31
|
.helptextDropdownButton=${this.helptextDropdownButton||r.specs.props.helptextDropdownButton.default}
|
|
32
32
|
@toggleHelpText=${g=>{this.toggleDropdown(g)}}
|
|
33
|
-
|
|
34
|
-
name="helptext"
|
|
35
|
-
></pkt-helptext>
|
|
33
|
+
>${u.slotContent(this,"helptext")}</pkt-helptext>
|
|
36
34
|
`,h=()=>this.counter?t.b`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
37
35
|
${this.counterError?this.counterError:t.A} ${this.counterCurrent||0}
|
|
38
36
|
${this.counterMaxLength?`/${this.counterMaxLength}`:t.A}
|
|
@@ -43,14 +41,14 @@
|
|
|
43
41
|
aria-live="assertive"
|
|
44
42
|
aria-atomic="true"
|
|
45
43
|
>
|
|
46
|
-
${
|
|
44
|
+
${k.o(this.errorMessage)}
|
|
47
45
|
</pkt-alert>`:t.A,d=()=>t.b`
|
|
48
46
|
${i()}
|
|
49
|
-
${
|
|
47
|
+
${a()}
|
|
50
48
|
${this.counterPosition==="top"?h():t.A}
|
|
51
|
-
<div class="pkt-contents"
|
|
49
|
+
<div class="pkt-contents">${u.slotContent(this)}</div>
|
|
52
50
|
${this.counterPosition==="bottom"?h():t.A}
|
|
53
51
|
${c()}
|
|
54
52
|
`,b=()=>this.hasFieldset?t.b`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${o}">
|
|
55
53
|
${d()}
|
|
56
|
-
</fieldset>`:t.b`<div class="pkt-inputwrapper__fieldset">${d()}</div>`;return t.b`<div class=${
|
|
54
|
+
</fieldset>`:t.b`<div class="pkt-inputwrapper__fieldset">${d()}</div>`;return t.b`<div class=${$.e(p)}>${b()}</div> `}toggleDropdown(p){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:p.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};e([t.n({type:String})],exports.PktInputWrapper.prototype,"forId",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"label",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"helptext",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"helptextDropdown",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"helptextDropdownButton",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"counter",2);e([t.n({type:Number})],exports.PktInputWrapper.prototype,"counterCurrent",2);e([t.n({type:Number})],exports.PktInputWrapper.prototype,"counterMaxLength",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"counterError",2);e([t.n({type:String,reflect:!1})],exports.PktInputWrapper.prototype,"counterPosition",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"optionalTag",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"optionalText",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"requiredTag",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"requiredText",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"tagText",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"hasError",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"errorMessage",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"disabled",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"inline",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"ariaDescribedby",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"hasFieldset",2);e([t.n({type:String,reflect:!0})],exports.PktInputWrapper.prototype,"role",2);e([t.n({type:Boolean,reflect:!0,converter:x.booleanishConverter})],exports.PktInputWrapper.prototype,"useWrapper",2);exports.PktInputWrapper=e([t.t("pkt-input-wrapper")],exports.PktInputWrapper);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";const c=require("./element-with-slot-yT8k1Z37.cjs"),t=require("./element-CMTfByxQ.cjs"),h=require("./class-map-Bokp1SoS.cjs");require("./icon-Dj0oZZSa.cjs");const k={href:{default:"#"},target:{default:"_self"}},a={props:k};var f=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(o,n,s,r)=>{for(var e=r>1?void 0:r?u(n,s):n,l=o.length-1,p;l>=0;l--)(p=o[l])&&(e=(r?p(n,s,e):p(e))||e);return r&&e&&f(n,s,e),e};exports.PktLink=class extends c.PktElementWithSlot{constructor(){super(...arguments),this.href=a.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=a.props.target.default}render(){const n={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return t.b`<a
|
|
2
|
+
class=${h.e(n)}
|
|
3
|
+
href=${this.href}
|
|
4
|
+
.target=${this.target}
|
|
5
|
+
.rel=${this.external?"noopener noreferrer":t.A}
|
|
6
|
+
>${this.iconName?t.b`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span>${c.slotContent(this)}</span></a
|
|
7
|
+
>`}};i([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"href",2);i([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconName",2);i([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconPosition",2);i([t.n({type:Boolean,reflect:!0})],exports.PktLink.prototype,"external",2);i([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"target",2);exports.PktLink=i([t.t("pkt-link")],exports.PktLink);
|