@oslokommune/punkt-react 12.30.2 → 12.30.3
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 +18 -0
- package/dist/punkt-react.es.js +49 -37
- package/dist/punkt-react.umd.js +6 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.30.3](https://github.com/oslokommune/punkt/compare/12.30.2...12.30.3) (2025-03-27)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
* Radio og Check rapporterer ikke riktig valgt verdi i FormData (#2368).
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [12.29.3](https://github.com/oslokommune/punkt/compare/12.29.2...12.29.3) (2025-03-21)
|
|
9
27
|
|
|
10
28
|
### ⚠ BREAKING CHANGES
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -25499,16 +25499,20 @@ let gn = class extends ti {
|
|
|
25499
25499
|
// Trigger this when you want to set the value of the *radio or checkbox* input out to the form
|
|
25500
25500
|
// Do not use valueChanged or onChange for radios and checkboxes!
|
|
25501
25501
|
valueChecked(r) {
|
|
25502
|
-
|
|
25503
|
-
|
|
25504
|
-
|
|
25505
|
-
|
|
25502
|
+
if (!this.touched) return;
|
|
25503
|
+
const o = this.internals.form || this.closest("form");
|
|
25504
|
+
o && o.querySelectorAll(
|
|
25505
|
+
`pkt-radiobutton[name=${this.name}], input[type=radio][name=${this.name}]`
|
|
25506
|
+
).forEach((u) => {
|
|
25507
|
+
const f = u;
|
|
25508
|
+
f.name === this.name && f.value !== this.value && f.checked && (f.checked = !1);
|
|
25509
|
+
}), typeof r == "string" ? (this.checked = r === "true", this.internals.ariaChecked = r === "true") : typeof r == "boolean" && (this.checked = r, this.internals.ariaChecked = r), this.checked ? (this.internals.setFormValue(this.value || "on", this.value || "on"), this.internals.states.add("--checked")) : (this.internals.setFormValue("", ""), this.internals.states.delete("--checked")), this.dispatchEvent(new Event("change")), this.dispatchEvent(
|
|
25506
25510
|
new CustomEvent("value-change", {
|
|
25507
25511
|
detail: this.checked,
|
|
25508
25512
|
bubbles: !0,
|
|
25509
25513
|
composed: !0
|
|
25510
25514
|
})
|
|
25511
|
-
), this.internals.reportValidity()
|
|
25515
|
+
), this.internals.reportValidity();
|
|
25512
25516
|
}
|
|
25513
25517
|
valueChanged(r, o) {
|
|
25514
25518
|
(o !== this.value || o !== this._value) && (typeof r == "string" ? ((this.multiple || this.range) && r.includes(",") && (r = r.split(",")), this.value = r, this._value = Array.isArray(r) ? r : [r]) : Array.isArray(r) ? (this.value = r, this._value = r) : (this.value = "", this._value = []), (!this.value || this.value.length === 0) && o && o.length !== 0 ? this.clearInputValue() : this.value && this.value.toString() !== (o == null ? void 0 : o.toString()) && this.onChange(this.value), this.updateComplete.then(() => this.requestUpdate()));
|
|
@@ -25554,7 +25558,15 @@ let gn = class extends ti {
|
|
|
25554
25558
|
super.updated(r), r.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")));
|
|
25555
25559
|
}
|
|
25556
25560
|
firstUpdated(r) {
|
|
25557
|
-
super.firstUpdated(r), this.value && this.defaultValue !== null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null), this.defaultChecked && (this.internals.ariaChecked = !0, this.checked = !0), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.ariaDisabled = !0), this.id && !this.name && (this.name = this.id), this.
|
|
25561
|
+
if (super.firstUpdated(r), this.value && this.defaultValue !== null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null), this.defaultChecked && (this.internals.ariaChecked = !0, this.checked = !0), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.ariaDisabled = !0), this.id && !this.name && (this.name = this.id), this.checked !== void 0) {
|
|
25562
|
+
const o = this.checked === "" || this.checked === "true" || this.checked === !0;
|
|
25563
|
+
this.internals.ariaChecked = o, this.internals.setFormValue(
|
|
25564
|
+
o ? this.value || "on" : "",
|
|
25565
|
+
o ? this.value || "on" : ""
|
|
25566
|
+
);
|
|
25567
|
+
} else
|
|
25568
|
+
this.internals.setFormValue(this.value);
|
|
25569
|
+
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));
|
|
25558
25570
|
}
|
|
25559
25571
|
};
|
|
25560
25572
|
jn([
|
|
@@ -25660,7 +25672,7 @@ var gj = Object.defineProperty, vj = Object.getOwnPropertyDescriptor, _u = (n, r
|
|
|
25660
25672
|
};
|
|
25661
25673
|
let js = class extends gn {
|
|
25662
25674
|
constructor() {
|
|
25663
|
-
super(...arguments), this.inputRef = Hn(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.isSwitch = !1, this.labelPosition = "right", this.hideLabel = !1, this.checked =
|
|
25675
|
+
super(...arguments), this.inputRef = Hn(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.isSwitch = !1, this.labelPosition = "right", this.hideLabel = !1, this.checked = null, this.type = "checkbox";
|
|
25664
25676
|
}
|
|
25665
25677
|
connectedCallback() {
|
|
25666
25678
|
super.connectedCallback();
|
|
@@ -26781,19 +26793,19 @@ let Cu = class extends ti {
|
|
|
26781
26793
|
connectedCallback() {
|
|
26782
26794
|
super.connectedCallback(), this._shouldDisplayLoader = this.delay === 0, this.delay > 0 && this.setupLoader();
|
|
26783
26795
|
}
|
|
26784
|
-
updated(
|
|
26785
|
-
|
|
26796
|
+
updated(n) {
|
|
26797
|
+
n.has("delay") && this.setupLoader();
|
|
26786
26798
|
}
|
|
26787
26799
|
render() {
|
|
26788
|
-
const
|
|
26800
|
+
const n = mn({
|
|
26789
26801
|
"pkt-loader": !0,
|
|
26790
26802
|
[`pkt-loader--${this.inline ? "inline" : "box"}`]: !0,
|
|
26791
26803
|
[`pkt-loader--${this.size}`]: !0
|
|
26792
|
-
}),
|
|
26804
|
+
}), r = mn({
|
|
26793
26805
|
"pkt-contents": !0,
|
|
26794
26806
|
"pkt-hide": this.isLoading
|
|
26795
26807
|
});
|
|
26796
|
-
return He`<div role="status" aria-live="polite" .aria-busy=${this.isLoading} class=${
|
|
26808
|
+
return He`<div role="status" aria-live="polite" .aria-busy=${this.isLoading} class=${n}>
|
|
26797
26809
|
${this.isLoading && this._shouldDisplayLoader ? He`<div class="pkt-loader__spinner">
|
|
26798
26810
|
<pkt-icon
|
|
26799
26811
|
name=${this.getVariant(this.variant)}
|
|
@@ -26802,11 +26814,11 @@ let Cu = class extends ti {
|
|
|
26802
26814
|
></pkt-icon>
|
|
26803
26815
|
${this.message && He`<p>${this.message}</p>`}
|
|
26804
26816
|
</div>` : kt}
|
|
26805
|
-
<div class=${
|
|
26817
|
+
<div class=${r} ${Pn(this.defaultSlot)}></div>
|
|
26806
26818
|
</div>`;
|
|
26807
26819
|
}
|
|
26808
|
-
getVariant(
|
|
26809
|
-
switch (
|
|
26820
|
+
getVariant(n) {
|
|
26821
|
+
switch (n) {
|
|
26810
26822
|
case "blue":
|
|
26811
26823
|
return "spinner-blue";
|
|
26812
26824
|
case "rainbow":
|
|
@@ -27287,7 +27299,7 @@ var rI = Object.defineProperty, aI = Object.getOwnPropertyDescriptor, pp = (n, r
|
|
|
27287
27299
|
};
|
|
27288
27300
|
let Eu = class extends gn {
|
|
27289
27301
|
constructor() {
|
|
27290
|
-
super(...arguments), this.inputRef = Hn(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked =
|
|
27302
|
+
super(...arguments), this.inputRef = Hn(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked = null, this.type = "radio", this._checked = !1;
|
|
27291
27303
|
}
|
|
27292
27304
|
connectedCallback() {
|
|
27293
27305
|
super.connectedCallback();
|
|
@@ -27296,7 +27308,7 @@ let Eu = class extends gn {
|
|
|
27296
27308
|
n === "defaultChecked" && (this._checked = this.defaultChecked), n === "checked" && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(n, r, o);
|
|
27297
27309
|
}
|
|
27298
27310
|
updated(n) {
|
|
27299
|
-
super.updated(n);
|
|
27311
|
+
n.has("checked") && this.checked !== null && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0, (n.get("checked") === "" || n.get("checked") === "true" || n.get("checked") === !0) !== this._checked && this.toggleChecked()), super.updated(n);
|
|
27300
27312
|
}
|
|
27301
27313
|
render() {
|
|
27302
27314
|
const n = mn({
|
|
@@ -27332,8 +27344,8 @@ let Eu = class extends gn {
|
|
|
27332
27344
|
</div>
|
|
27333
27345
|
`;
|
|
27334
27346
|
}
|
|
27335
|
-
toggleChecked(n) {
|
|
27336
|
-
n.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
|
|
27347
|
+
toggleChecked(n = null) {
|
|
27348
|
+
n && n.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
|
|
27337
27349
|
}
|
|
27338
27350
|
};
|
|
27339
27351
|
pp([
|
|
@@ -27877,7 +27889,7 @@ var rA = { exports: {} };
|
|
|
27877
27889
|
})();
|
|
27878
27890
|
})(rA);
|
|
27879
27891
|
var mI = rA.exports;
|
|
27880
|
-
const Ms = /* @__PURE__ */ Z0(mI),
|
|
27892
|
+
const Ms = /* @__PURE__ */ Z0(mI), wH = Pr(
|
|
27881
27893
|
({ title: n, className: r, children: o, toggleProps: u, defaultOpen: f = !1, id: g }, v) => {
|
|
27882
27894
|
const [C, E] = Fc(f), _ = u ? u.isOpen : C, $ = (B) => B ?? void 0, P = (B, M) => {
|
|
27883
27895
|
B.preventDefault(), u !== void 0 && u.onToggleClick(B, M), E(!_);
|
|
@@ -27938,7 +27950,7 @@ const yI = Pr(
|
|
|
27938
27950
|
}
|
|
27939
27951
|
);
|
|
27940
27952
|
yI.displayName = "PktBackLink";
|
|
27941
|
-
const
|
|
27953
|
+
const DH = Pr(
|
|
27942
27954
|
({ breadcrumbs: n, navigationType: r, className: o, ...u }, f) => {
|
|
27943
27955
|
const g = n.slice(0, 4), v = g[g.length - 2], C = [o, "pkt-breadcrumbs"].filter(Boolean).join(" ");
|
|
27944
27956
|
return /* @__PURE__ */ O.jsxs("nav", { ref: f, "aria-label": "brødsmulemeny", className: C, children: [
|
|
@@ -28022,7 +28034,7 @@ const aA = Pa({
|
|
|
28022
28034
|
({ helptext: n, ...r }, o) => /* @__PURE__ */ O.jsx(DI, { ref: o, ...r, children: /* @__PURE__ */ O.jsx("div", { className: "pkt-contents", slot: "helptext", children: n }) })
|
|
28023
28035
|
);
|
|
28024
28036
|
iA.displayName = "PktDatepicker";
|
|
28025
|
-
const
|
|
28037
|
+
const SH = ({
|
|
28026
28038
|
columnOne: n,
|
|
28027
28039
|
columnTwo: r,
|
|
28028
28040
|
socialLinks: o,
|
|
@@ -28129,7 +28141,7 @@ const CH = ({
|
|
|
28129
28141
|
) }, `sociallinks-${P}`)) })
|
|
28130
28142
|
] })
|
|
28131
28143
|
] }) });
|
|
28132
|
-
},
|
|
28144
|
+
}, CH = ({
|
|
28133
28145
|
links: n = [],
|
|
28134
28146
|
openLinksInNewTab: r = !1,
|
|
28135
28147
|
personvernOgInfoLink: o = "https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",
|
|
@@ -28178,7 +28190,7 @@ const CH = ({
|
|
|
28178
28190
|
}
|
|
28179
28191
|
) })
|
|
28180
28192
|
] }) }) });
|
|
28181
|
-
},
|
|
28193
|
+
}, xH = Pr(
|
|
28182
28194
|
({
|
|
28183
28195
|
className: n,
|
|
28184
28196
|
logoLink: r = "https://www.oslo.kommune.no/",
|
|
@@ -38182,7 +38194,7 @@ const zU = Pa({
|
|
|
38182
38194
|
({ children: n, ...r }, o) => /* @__PURE__ */ O.jsx(zU, { ref: o, ...r, children: /* @__PURE__ */ O.jsx("div", { className: "pkt-contents", children: n }) })
|
|
38183
38195
|
);
|
|
38184
38196
|
UU.displayName = "PktProgressbar";
|
|
38185
|
-
const
|
|
38197
|
+
const _H = Pa({
|
|
38186
38198
|
tagName: "pkt-radiobutton",
|
|
38187
38199
|
elementClass: Eu,
|
|
38188
38200
|
react: nn,
|
|
@@ -38194,7 +38206,7 @@ const TH = Pa({
|
|
|
38194
38206
|
onFocus: "focus",
|
|
38195
38207
|
onValueChange: "valueChange"
|
|
38196
38208
|
}
|
|
38197
|
-
}),
|
|
38209
|
+
}), TH = Pr(
|
|
38198
38210
|
({
|
|
38199
38211
|
appearance: n = "local",
|
|
38200
38212
|
disabled: r = !1,
|
|
@@ -38279,7 +38291,7 @@ const TH = Pa({
|
|
|
38279
38291
|
] })
|
|
38280
38292
|
);
|
|
38281
38293
|
}
|
|
38282
|
-
),
|
|
38294
|
+
), AH = Pr(
|
|
38283
38295
|
({
|
|
38284
38296
|
activeStep: n,
|
|
38285
38297
|
className: r,
|
|
@@ -38307,7 +38319,7 @@ const TH = Pa({
|
|
|
38307
38319
|
] }), WU = /* @__PURE__ */ O.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", children: [
|
|
38308
38320
|
/* @__PURE__ */ O.jsx("path", { fill: "#2A2859", d: "M3 3h18v18H3z" }),
|
|
38309
38321
|
/* @__PURE__ */ O.jsx("path", { d: "m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z", fill: "#F1FDFF" })
|
|
38310
|
-
] }),
|
|
38322
|
+
] }), FH = ({ children: n, className: r, status: o = "incomplete", title: u }) => /* @__PURE__ */ O.jsxs("li", { className: Ms("pkt-step", r, `pkt-step--${o}`), "data-testid": "pkt-step", children: [
|
|
38311
38323
|
/* @__PURE__ */ O.jsx("span", { className: "pkt-step__line pkt-step__line--1", "aria-hidden": !0 }),
|
|
38312
38324
|
/* @__PURE__ */ O.jsx("span", { className: "pkt-step__line pkt-step__line--2", "aria-hidden": !0 }),
|
|
38313
38325
|
/* @__PURE__ */ O.jsx("span", { className: Ms("pkt-step__indicator"), children: o === "current" ? qU : o === "completed" ? WU : HU }),
|
|
@@ -38335,17 +38347,17 @@ const TH = Pa({
|
|
|
38335
38347
|
YU.displayName = "PktTextarea";
|
|
38336
38348
|
export {
|
|
38337
38349
|
XU as PktAccordion,
|
|
38338
|
-
|
|
38350
|
+
wH as PktAccordionItem,
|
|
38339
38351
|
vI as PktAlert,
|
|
38340
38352
|
yI as PktBackLink,
|
|
38341
|
-
|
|
38353
|
+
DH as PktBreadcrumbs,
|
|
38342
38354
|
Hf as PktButton,
|
|
38343
38355
|
wI as PktCard,
|
|
38344
38356
|
aA as PktCheckbox,
|
|
38345
38357
|
iA as PktDatepicker,
|
|
38346
|
-
|
|
38347
|
-
|
|
38348
|
-
|
|
38358
|
+
SH as PktFooter,
|
|
38359
|
+
CH as PktFooterSimple,
|
|
38360
|
+
xH as PktHeader,
|
|
38349
38361
|
CI as PktHelptext,
|
|
38350
38362
|
vr as PktIcon,
|
|
38351
38363
|
xI as PktInput,
|
|
@@ -38357,11 +38369,11 @@ export {
|
|
|
38357
38369
|
BI as PktModal,
|
|
38358
38370
|
MU as PktPreview,
|
|
38359
38371
|
UU as PktProgressbar,
|
|
38360
|
-
|
|
38361
|
-
|
|
38372
|
+
_H as PktRadioButton,
|
|
38373
|
+
TH as PktSearchInput,
|
|
38362
38374
|
dD as PktSelect,
|
|
38363
|
-
|
|
38364
|
-
|
|
38375
|
+
FH as PktStep,
|
|
38376
|
+
AH as PktStepper,
|
|
38365
38377
|
jw as PktTable,
|
|
38366
38378
|
Mw as PktTableBody,
|
|
38367
38379
|
Bs as PktTableDataCell,
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -526,7 +526,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
526
526
|
${this.defaultSlot&&qe`<div class="pkt-card__content" ${Fn(this.defaultSlot)}></div>`}
|
|
527
527
|
</div>
|
|
528
528
|
</div>
|
|
529
|
-
`}};Ep([Z({type:String,reflect:!0})],Ou.prototype,"skin",2),Ep([Z({type:String,reflect:!0})],Ou.prototype,"direction",2),Ep([Z({type:Object,reflect:!0})],Ou.prototype,"image",2),Ep([Z({type:String,reflect:!0})],Ou.prototype,"heading",2),Ep([Z({type:String,reflect:!0})],Ou.prototype,"subheading",2),Ep([Z({type:Array,reflect:!0})],Ou.prototype,"tags",2),Ou=Ep([Kr("pkt-card")],Ou);const mC=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),ih=()=>{const n=mC(),r=mC();return n.slice(0,8)+"-"+n.slice(8,12)+"-4"+n.slice(13)+"-a"+r.slice(1,4)+"-"+r.slice(4)},RN="pkt-inputwrapper",ON={toggleHelpText:{description:"Event for å vise eller skjule hjelpetekst i dropdown"}},LN={forId:{name:"For ID",description:"Id-en til skjemaelementet som dette wrapper rundt",type:"string",required:!0},label:{name:"Merkelapp",description:"Merkelapp for skjemaelementet",type:"string",required:!0},helptext:{name:"Hjelpetekst",description:"Hjelpetekst for skjemaelementet",type:"string"},helptextDropdown:{name:"Hjelpetekst i dropdown",description:"Hjelpetekst som vises i ekspanderende felt",type:"string"},helptextDropdownButton:{name:"Tekst i hjelpetekst-knapp",description:"Tekst som vises i knappen for å vise hjelpetekst i dropdown",default:"Les mer <span class='pkt-sr-only'>om feltet</span>",type:"string"},ariaDescribedby:{name:"aria-describedby",description:"Id-en til elementet som beskriver skjemaelementet",type:"string"},counter:{name:"Teller",description:"Teller for antall tegn i skjemaelementet",type:"boolean",default:!1},counterCurrent:{name:"Tellerverdi",description:"Tellerens nåværende verdi",type:"number"},counterMaxLength:{name:"Maks tegn i teller",description:"Maks antall tegn som kan skrives i skjemaelementet",type:"number"},optionalTag:{name:"Vise valgfritt-merking",description:"Viser en merking som indikerer at feltet er valgfritt",type:"boolean",default:!1},optionalText:{name:"Valgfritt-tekst",description:"Tekst som vises i valgfritt-merkingen",type:"string",default:"Valgfritt"},requiredTag:{name:"Vise påkrevd-merking",description:"Viser en merking som indikerer at feltet er påkrevd",type:"boolean",default:!1},requiredText:{name:"Påkrevd-tekst",description:"Tekst som vises i påkrevd-merkingen",type:"string",default:"Må fylles ut"},hasError:{name:"Feil",description:"Indikerer at skjemaelementet har en feil",type:"boolean",default:!1},errorMessage:{name:"Feilmelding",description:"Feilmelding som vises i tilknytning til skjemaelementet",type:"string"},disabled:{name:"Deaktivert",description:"Indikerer at skjemaelementet er deaktivert",type:"boolean",default:!1},inline:{name:"Inline",description:"Indikerer at skjemaelementet skal flyte sammen med sidens innhold",type:"boolean",default:!1},hasFieldset:{name:"Har fieldset",description:"Indikerer at skjemaelementet er en del av et fieldset",type:"boolean",default:!1},useWrapper:{name:"Bruk wrapper",description:"Indikerer om skjemaelementet skal bruke en wrapper",type:"boolean",displayAsFalse:!0,default:!0}},zo={name:RN,"css-class":"pkt-inputwrapper",isElement:!0,events:ON,props:LN};var BN=Object.defineProperty,On=(n,r,o,u)=>{for(var f=void 0,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=v(r,o,f)||f);return f&&BN(r,o,f),f};let hn=class extends Oa{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.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=ih(),this.counter=!1,this.hasError=!1,this.inline=!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=zo.props.helptextDropdownButton.default,this.label=null,this.optionalText=Ws.forms.labels.optional,this.requiredText=Ws.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(r){var o,u,f,g,v,C,E,_;r&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Ws.forms.messages.required,r):(o=r.validity)!=null&&o.typeMismatch||(u=r.validity)!=null&&u.badInput?this.internals.setValidity({typeMismatch:!0},Ws.forms.messages.invalid,r):(f=r.validity)!=null&&f.patternMismatch?this.internals.setValidity({patternMismatch:!0},Ws.forms.messages.invalidPattern,r):(g=r.validity)!=null&&g.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},Ws.forms.messages.tooShort,r):(v=r.validity)!=null&&v.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},Ws.forms.messages.tooLong,r):(C=r.validity)!=null&&C.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},Ws.forms.messages.rangeUnderflow,r):(E=r.validity)!=null&&E.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},Ws.forms.messages.rangeOverflow,r):(_=r.validity)!=null&&_.customError?this.internals.setValidity({customError:!0},r.validationMessage,r):this.internals.setValidity({}))}setFormValue(r){if(this.internals)if(Array.isArray(r)){const o=new FormData;r.forEach(u=>{o.append(this.name,u)}),this.internals.setFormValue(o)}else this.internals.setFormValue(r)}valueChecked(r){this.touched&&(typeof r=="string"?(this.checked=r==="true",this.internals.ariaChecked=r==="true"):typeof r=="boolean"&&(this.checked=r,this.internals.ariaChecked=r),this.checked?this.internals.states.add("--checked"):this.internals.states.delete("--checked"),this.internals.setFormValue(this.checked?this.value:null,this.checked?"checked":"unchecked"),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity())}valueChanged(r,o){(o!==this.value||o!==this._value)&&(typeof r=="string"?((this.multiple||this.range)&&r.includes(",")&&(r=r.split(",")),this.value=r,this._value=Array.isArray(r)?r:[r]):Array.isArray(r)?(this.value=r,this._value=r):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&o&&o.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(o==null?void 0:o.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const r=this.multiple||this.range?[]:"";this.value=r,this.internals.setFormValue(r),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:r,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(r){if(!this.touched){this.touched=!0,r&&this.setFormValue(r);return}typeof r!="string"&&!Array.isArray(r)||((this.range||this.multiple)&&!Array.isArray(r)&&r.includes(",")&&(r=r.split(",")),!this.multiple&&!this.range&&Array.isArray(r)&&(r=r[0]),this.setFormValue(r),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:r,bubbles:!0,composed:!0})),this.internals.reportValidity())}updated(r){super.updated(r),r.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(r){super.firstUpdated(r),this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),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))}};On([Z()],hn.prototype,"defaultValue"),On([Z({type:Boolean,reflect:!0})],hn.prototype,"disabled"),On([Z({type:Boolean,reflect:!0})],hn.prototype,"readonly"),On([Z({type:Boolean,reflect:!0})],hn.prototype,"required"),On([Z({type:Number,reflect:!0})],hn.prototype,"max"),On([Z({type:Number,reflect:!0})],hn.prototype,"maxlength"),On([Z({type:Number,reflect:!0})],hn.prototype,"min"),On([Z({type:Number,reflect:!0})],hn.prototype,"minlength"),On([Z({type:String})],hn.prototype,"ariaDescribedBy"),On([Z({type:String})],hn.prototype,"ariaLabelledby"),On([Z({type:String,reflect:!0})],hn.prototype,"name"),On([Z({type:String,reflect:!0})],hn.prototype,"pattern"),On([Z({type:String,reflect:!0})],hn.prototype,"placeholder"),On([Z({type:String,reflect:!0})],hn.prototype,"id"),On([Z({type:Boolean})],hn.prototype,"counter"),On([Z({type:Boolean})],hn.prototype,"hasError"),On([Z({type:Boolean})],hn.prototype,"inline"),On([Z({type:Boolean})],hn.prototype,"optionalTag"),On([Z({type:Boolean})],hn.prototype,"requiredTag"),On([Z({type:Boolean})],hn.prototype,"skipForwardTestid"),On([Z({type:Boolean})],hn.prototype,"useWrapper"),On([Z({type:Boolean,reflect:!0})],hn.prototype,"fullwidth"),On([Z({type:Number})],hn.prototype,"counterMaxLength"),On([Z({type:String})],hn.prototype,"errorMessage"),On([Z({type:String})],hn.prototype,"helptext"),On([Z({type:String})],hn.prototype,"helptextDropdown"),On([Z({type:String})],hn.prototype,"helptextDropdownButton"),On([Z({type:String})],hn.prototype,"label"),On([Z({type:String})],hn.prototype,"optionalText"),On([Z({type:String})],hn.prototype,"requiredText"),On([Z({type:String,attribute:"data-testid"})],hn.prototype,"dataTestid"),On([Rr()],hn.prototype,"touched");var jN=Object.defineProperty,IN=Object.getOwnPropertyDescriptor,Al=(n,r,o,u)=>{for(var f=u>1?void 0:u?IN(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&jN(r,o,f),f};let ls=class extends hn{constructor(){super(...arguments),this.inputRef=Mn(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=!1,this.type="checkbox"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(r,o,u){r==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),r==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(r,o,u)}firstUpdated(r){r.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(r)}render(){const r=fn({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),o=fn({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),u=fn({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),f=()=>qe`
|
|
529
|
+
`}};Ep([Z({type:String,reflect:!0})],Ou.prototype,"skin",2),Ep([Z({type:String,reflect:!0})],Ou.prototype,"direction",2),Ep([Z({type:Object,reflect:!0})],Ou.prototype,"image",2),Ep([Z({type:String,reflect:!0})],Ou.prototype,"heading",2),Ep([Z({type:String,reflect:!0})],Ou.prototype,"subheading",2),Ep([Z({type:Array,reflect:!0})],Ou.prototype,"tags",2),Ou=Ep([Kr("pkt-card")],Ou);const mC=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),ih=()=>{const n=mC(),r=mC();return n.slice(0,8)+"-"+n.slice(8,12)+"-4"+n.slice(13)+"-a"+r.slice(1,4)+"-"+r.slice(4)},RN="pkt-inputwrapper",ON={toggleHelpText:{description:"Event for å vise eller skjule hjelpetekst i dropdown"}},LN={forId:{name:"For ID",description:"Id-en til skjemaelementet som dette wrapper rundt",type:"string",required:!0},label:{name:"Merkelapp",description:"Merkelapp for skjemaelementet",type:"string",required:!0},helptext:{name:"Hjelpetekst",description:"Hjelpetekst for skjemaelementet",type:"string"},helptextDropdown:{name:"Hjelpetekst i dropdown",description:"Hjelpetekst som vises i ekspanderende felt",type:"string"},helptextDropdownButton:{name:"Tekst i hjelpetekst-knapp",description:"Tekst som vises i knappen for å vise hjelpetekst i dropdown",default:"Les mer <span class='pkt-sr-only'>om feltet</span>",type:"string"},ariaDescribedby:{name:"aria-describedby",description:"Id-en til elementet som beskriver skjemaelementet",type:"string"},counter:{name:"Teller",description:"Teller for antall tegn i skjemaelementet",type:"boolean",default:!1},counterCurrent:{name:"Tellerverdi",description:"Tellerens nåværende verdi",type:"number"},counterMaxLength:{name:"Maks tegn i teller",description:"Maks antall tegn som kan skrives i skjemaelementet",type:"number"},optionalTag:{name:"Vise valgfritt-merking",description:"Viser en merking som indikerer at feltet er valgfritt",type:"boolean",default:!1},optionalText:{name:"Valgfritt-tekst",description:"Tekst som vises i valgfritt-merkingen",type:"string",default:"Valgfritt"},requiredTag:{name:"Vise påkrevd-merking",description:"Viser en merking som indikerer at feltet er påkrevd",type:"boolean",default:!1},requiredText:{name:"Påkrevd-tekst",description:"Tekst som vises i påkrevd-merkingen",type:"string",default:"Må fylles ut"},hasError:{name:"Feil",description:"Indikerer at skjemaelementet har en feil",type:"boolean",default:!1},errorMessage:{name:"Feilmelding",description:"Feilmelding som vises i tilknytning til skjemaelementet",type:"string"},disabled:{name:"Deaktivert",description:"Indikerer at skjemaelementet er deaktivert",type:"boolean",default:!1},inline:{name:"Inline",description:"Indikerer at skjemaelementet skal flyte sammen med sidens innhold",type:"boolean",default:!1},hasFieldset:{name:"Har fieldset",description:"Indikerer at skjemaelementet er en del av et fieldset",type:"boolean",default:!1},useWrapper:{name:"Bruk wrapper",description:"Indikerer om skjemaelementet skal bruke en wrapper",type:"boolean",displayAsFalse:!0,default:!0}},zo={name:RN,"css-class":"pkt-inputwrapper",isElement:!0,events:ON,props:LN};var BN=Object.defineProperty,On=(n,r,o,u)=>{for(var f=void 0,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=v(r,o,f)||f);return f&&BN(r,o,f),f};let hn=class extends Oa{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.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=ih(),this.counter=!1,this.hasError=!1,this.inline=!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=zo.props.helptextDropdownButton.default,this.label=null,this.optionalText=Ws.forms.labels.optional,this.requiredText=Ws.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(r){var o,u,f,g,v,C,E,_;r&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Ws.forms.messages.required,r):(o=r.validity)!=null&&o.typeMismatch||(u=r.validity)!=null&&u.badInput?this.internals.setValidity({typeMismatch:!0},Ws.forms.messages.invalid,r):(f=r.validity)!=null&&f.patternMismatch?this.internals.setValidity({patternMismatch:!0},Ws.forms.messages.invalidPattern,r):(g=r.validity)!=null&&g.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},Ws.forms.messages.tooShort,r):(v=r.validity)!=null&&v.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},Ws.forms.messages.tooLong,r):(C=r.validity)!=null&&C.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},Ws.forms.messages.rangeUnderflow,r):(E=r.validity)!=null&&E.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},Ws.forms.messages.rangeOverflow,r):(_=r.validity)!=null&&_.customError?this.internals.setValidity({customError:!0},r.validationMessage,r):this.internals.setValidity({}))}setFormValue(r){if(this.internals)if(Array.isArray(r)){const o=new FormData;r.forEach(u=>{o.append(this.name,u)}),this.internals.setFormValue(o)}else this.internals.setFormValue(r)}valueChecked(r){if(!this.touched)return;const o=this.internals.form||this.closest("form");o&&o.querySelectorAll(`pkt-radiobutton[name=${this.name}], input[type=radio][name=${this.name}]`).forEach(u=>{const f=u;f.name===this.name&&f.value!==this.value&&f.checked&&(f.checked=!1)}),typeof r=="string"?(this.checked=r==="true",this.internals.ariaChecked=r==="true"):typeof r=="boolean"&&(this.checked=r,this.internals.ariaChecked=r),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue("",""),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(r,o){(o!==this.value||o!==this._value)&&(typeof r=="string"?((this.multiple||this.range)&&r.includes(",")&&(r=r.split(",")),this.value=r,this._value=Array.isArray(r)?r:[r]):Array.isArray(r)?(this.value=r,this._value=r):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&o&&o.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(o==null?void 0:o.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const r=this.multiple||this.range?[]:"";this.value=r,this.internals.setFormValue(r),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:r,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(r){if(!this.touched){this.touched=!0,r&&this.setFormValue(r);return}typeof r!="string"&&!Array.isArray(r)||((this.range||this.multiple)&&!Array.isArray(r)&&r.includes(",")&&(r=r.split(",")),!this.multiple&&!this.range&&Array.isArray(r)&&(r=r[0]),this.setFormValue(r),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:r,bubbles:!0,composed:!0})),this.internals.reportValidity())}updated(r){super.updated(r),r.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(r){if(super.firstUpdated(r),this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const o=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=o,this.internals.setFormValue(o?this.value||"on":"",o?this.value||"on":"")}else this.internals.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))}};On([Z()],hn.prototype,"defaultValue"),On([Z({type:Boolean,reflect:!0})],hn.prototype,"disabled"),On([Z({type:Boolean,reflect:!0})],hn.prototype,"readonly"),On([Z({type:Boolean,reflect:!0})],hn.prototype,"required"),On([Z({type:Number,reflect:!0})],hn.prototype,"max"),On([Z({type:Number,reflect:!0})],hn.prototype,"maxlength"),On([Z({type:Number,reflect:!0})],hn.prototype,"min"),On([Z({type:Number,reflect:!0})],hn.prototype,"minlength"),On([Z({type:String})],hn.prototype,"ariaDescribedBy"),On([Z({type:String})],hn.prototype,"ariaLabelledby"),On([Z({type:String,reflect:!0})],hn.prototype,"name"),On([Z({type:String,reflect:!0})],hn.prototype,"pattern"),On([Z({type:String,reflect:!0})],hn.prototype,"placeholder"),On([Z({type:String,reflect:!0})],hn.prototype,"id"),On([Z({type:Boolean})],hn.prototype,"counter"),On([Z({type:Boolean})],hn.prototype,"hasError"),On([Z({type:Boolean})],hn.prototype,"inline"),On([Z({type:Boolean})],hn.prototype,"optionalTag"),On([Z({type:Boolean})],hn.prototype,"requiredTag"),On([Z({type:Boolean})],hn.prototype,"skipForwardTestid"),On([Z({type:Boolean})],hn.prototype,"useWrapper"),On([Z({type:Boolean,reflect:!0})],hn.prototype,"fullwidth"),On([Z({type:Number})],hn.prototype,"counterMaxLength"),On([Z({type:String})],hn.prototype,"errorMessage"),On([Z({type:String})],hn.prototype,"helptext"),On([Z({type:String})],hn.prototype,"helptextDropdown"),On([Z({type:String})],hn.prototype,"helptextDropdownButton"),On([Z({type:String})],hn.prototype,"label"),On([Z({type:String})],hn.prototype,"optionalText"),On([Z({type:String})],hn.prototype,"requiredText"),On([Z({type:String,attribute:"data-testid"})],hn.prototype,"dataTestid"),On([Rr()],hn.prototype,"touched");var jN=Object.defineProperty,IN=Object.getOwnPropertyDescriptor,Al=(n,r,o,u)=>{for(var f=u>1?void 0:u?IN(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&jN(r,o,f),f};let ls=class extends hn{constructor(){super(...arguments),this.inputRef=Mn(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.type="checkbox"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(r,o,u){r==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),r==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(r,o,u)}firstUpdated(r){r.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(r)}render(){const r=fn({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),o=fn({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),u=fn({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),f=()=>qe`
|
|
530
530
|
<label class=${u} for=${this.id+"-internal"}>
|
|
531
531
|
${this.label}
|
|
532
532
|
${this.checkHelptext?qe`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:gt}
|
|
@@ -796,7 +796,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
796
796
|
|
|
797
797
|
<div class="pkt-linkcard__text" ${Fn(this.defaultSlot)}></div>
|
|
798
798
|
</a>
|
|
799
|
-
`}};Tp([Z({type:String,reflect:!0})],Lu.prototype,"title",2),Tp([Z({type:String,reflect:!0})],Lu.prototype,"href",2),Tp([Z({type:String,reflect:!0})],Lu.prototype,"iconName",2),Tp([Z({type:Boolean,reflect:!0})],Lu.prototype,"external",2),Tp([Z({type:Boolean,reflect:!0})],Lu.prototype,"openInNewTab",2),Tp([Z({type:String,reflect:!0})],Lu.prototype,"skin",2),Lu=Tp([Kr("pkt-linkcard")],Lu);var i3=Object.defineProperty,o3=Object.getOwnPropertyDescriptor,Qc=(n,r,o,u)=>{for(var f=u>1?void 0:u?o3(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&i3(r,o,f),f};let Fl=class extends Oa{constructor(){super(),this.defaultSlot=Mn(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this._shouldDisplayLoader=!1,this.slotController=new Si(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(
|
|
799
|
+
`}};Tp([Z({type:String,reflect:!0})],Lu.prototype,"title",2),Tp([Z({type:String,reflect:!0})],Lu.prototype,"href",2),Tp([Z({type:String,reflect:!0})],Lu.prototype,"iconName",2),Tp([Z({type:Boolean,reflect:!0})],Lu.prototype,"external",2),Tp([Z({type:Boolean,reflect:!0})],Lu.prototype,"openInNewTab",2),Tp([Z({type:String,reflect:!0})],Lu.prototype,"skin",2),Lu=Tp([Kr("pkt-linkcard")],Lu);var i3=Object.defineProperty,o3=Object.getOwnPropertyDescriptor,Qc=(n,r,o,u)=>{for(var f=u>1?void 0:u?o3(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&i3(r,o,f),f};let Fl=class extends Oa{constructor(){super(),this.defaultSlot=Mn(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this._shouldDisplayLoader=!1,this.slotController=new Si(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(n){n.has("delay")&&this.setupLoader()}render(){const n=fn({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),r=fn({"pkt-contents":!0,"pkt-hide":this.isLoading});return qe`<div role="status" aria-live="polite" .aria-busy=${this.isLoading} class=${n}>
|
|
800
800
|
${this.isLoading&&this._shouldDisplayLoader?qe`<div class="pkt-loader__spinner">
|
|
801
801
|
<pkt-icon
|
|
802
802
|
name=${this.getVariant(this.variant)}
|
|
@@ -805,8 +805,8 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
805
805
|
></pkt-icon>
|
|
806
806
|
${this.message&&qe`<p>${this.message}</p>`}
|
|
807
807
|
</div>`:gt}
|
|
808
|
-
<div class=${
|
|
809
|
-
</div>`}getVariant(
|
|
808
|
+
<div class=${r} ${Fn(this.defaultSlot)}></div>
|
|
809
|
+
</div>`}getVariant(n){switch(n){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};Qc([Z({type:Number})],Fl.prototype,"delay",2),Qc([Z({type:Boolean})],Fl.prototype,"inline",2),Qc([Z({type:Boolean})],Fl.prototype,"isLoading",2),Qc([Z({type:String})],Fl.prototype,"message",2),Qc([Z({type:String})],Fl.prototype,"size",2),Qc([Z({type:String})],Fl.prototype,"variant",2),Qc([Rr()],Fl.prototype,"_shouldDisplayLoader",2),Fl=Qc([Kr("pkt-loader")],Fl);const s3="pkt-messagebox",l3=!0,u3={onClose:{description:"React: Event som trigges når meldingsboksen lukkes"},"on-close":{description:"Vue: Event som trigges når meldingsboksen lukkes"}},c3={title:{name:"Tittel",description:"Tittelen på meldingsboksen",type:"string"},skin:{name:"Utseende",description:"Velg farge på meldingsboksen",type:["beige","blue","red","green"],default:"beige"},compact:{name:"Kompakt",description:"Gjør meldingsboksen mindre",type:"boolean",default:!1},closable:{name:"Kan lukkes",description:"Viser lukkeknapp",type:"boolean",default:!1}},d3={default:{description:"Innholdet i meldingsboksen"}},Lk={name:s3,"css-class":"pkt-messagebox",isElement:l3,events:u3,props:c3,slots:d3};var p3=Object.defineProperty,f3=Object.getOwnPropertyDescriptor,lh=(n,r,o,u)=>{for(var f=u>1?void 0:u?f3(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&p3(r,o,f),f};let Kc=class extends Oa{constructor(){super(),this.defaultSlot=Mn(),this.closable=Lk.props.closable.default,this.compact=Lk.props.compact.default,this.title="",this.skin=Lk.props.skin.default,this._isClosed=!1,this.close=r=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:r},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:r},bubbles:!0}))},this.slotController=new Si(this,this.defaultSlot),this._isClosed=!1}updated(r){super.updated(r),r.has("_isClosed")&&YS(this,"pkt-hide",this._isClosed)}render(){const r={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return qe`<div class=${fn(r)}>
|
|
810
810
|
${this.closable?qe`<div class="pkt-messagebox__close">
|
|
811
811
|
<button
|
|
812
812
|
@click=${this.close}
|
|
@@ -869,7 +869,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
869
869
|
${this.statusType==="percentage"?`${u}%`:f}
|
|
870
870
|
</span>
|
|
871
871
|
</div>`:gt}
|
|
872
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||ih(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(n,r){r==null||r===""?this.removeAttribute(n):this.setAttribute(n,String(r))}};va([Z({type:String})],Zr.prototype,"ariaLabel",2),va([Z({type:String,reflect:!0})],Zr.prototype,"ariaLabelledby",2),va([Z({type:String,reflect:!0})],Zr.prototype,"ariaValueText",2),va([Z({type:String})],Zr.prototype,"ariaLive",2),va([Z({type:String,reflect:!0})],Zr.prototype,"id",2),va([Z({type:String})],Zr.prototype,"role",2),va([Z({type:String})],Zr.prototype,"skin",2),va([Z({type:String})],Zr.prototype,"statusPlacement",2),va([Z({type:String})],Zr.prototype,"statusType",2),va([Z({type:String,reflect:!0})],Zr.prototype,"title",2),va([Z({type:String})],Zr.prototype,"titlePosition",2),va([Z({type:Number,reflect:!0})],Zr.prototype,"valueCurrent",2),va([Z({type:Number})],Zr.prototype,"valueMax",2),va([Z({type:Number})],Zr.prototype,"valueMin",2),va([Rr()],Zr.prototype,"labelWidth",2),va([Rr()],Zr.prototype,"progressbarId",2),va([Rr()],Zr.prototype,"computedAriaLabelledby",2),va([Rr()],Zr.prototype,"computedAriaValueText",2),Zr=va([Kr("pkt-progressbar")],Zr);var x3=Object.defineProperty,E3=Object.getOwnPropertyDescriptor,Xc=(n,r,o,u)=>{for(var f=u>1?void 0:u?E3(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&x3(r,o,f),f};let Pl=class extends hn{constructor(){super(...arguments),this.inputRef=Mn(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked
|
|
872
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||ih(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(n,r){r==null||r===""?this.removeAttribute(n):this.setAttribute(n,String(r))}};va([Z({type:String})],Zr.prototype,"ariaLabel",2),va([Z({type:String,reflect:!0})],Zr.prototype,"ariaLabelledby",2),va([Z({type:String,reflect:!0})],Zr.prototype,"ariaValueText",2),va([Z({type:String})],Zr.prototype,"ariaLive",2),va([Z({type:String,reflect:!0})],Zr.prototype,"id",2),va([Z({type:String})],Zr.prototype,"role",2),va([Z({type:String})],Zr.prototype,"skin",2),va([Z({type:String})],Zr.prototype,"statusPlacement",2),va([Z({type:String})],Zr.prototype,"statusType",2),va([Z({type:String,reflect:!0})],Zr.prototype,"title",2),va([Z({type:String})],Zr.prototype,"titlePosition",2),va([Z({type:Number,reflect:!0})],Zr.prototype,"valueCurrent",2),va([Z({type:Number})],Zr.prototype,"valueMax",2),va([Z({type:Number})],Zr.prototype,"valueMin",2),va([Rr()],Zr.prototype,"labelWidth",2),va([Rr()],Zr.prototype,"progressbarId",2),va([Rr()],Zr.prototype,"computedAriaLabelledby",2),va([Rr()],Zr.prototype,"computedAriaValueText",2),Zr=va([Kr("pkt-progressbar")],Zr);var x3=Object.defineProperty,E3=Object.getOwnPropertyDescriptor,Xc=(n,r,o,u)=>{for(var f=u>1?void 0:u?E3(r,o):r,g=n.length-1,v;g>=0;g--)(v=n[g])&&(f=(u?v(r,o,f):v(f))||f);return u&&f&&x3(r,o,f),f};let Pl=class extends hn{constructor(){super(...arguments),this.inputRef=Mn(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(n,r,o){n==="defaultChecked"&&(this._checked=this.defaultChecked),n==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(n,r,o)}updated(n){n.has("checked")&&this.checked!==null&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0,(n.get("checked")===""||n.get("checked")==="true"||n.get("checked")===!0)!==this._checked&&this.toggleChecked()),super.updated(n)}render(){const n=fn({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),r=fn({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError});return qe`
|
|
873
873
|
<div class="pkt-input-check">
|
|
874
874
|
<div class=${n}>
|
|
875
875
|
<input
|
|
@@ -892,7 +892,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
892
892
|
</label>
|
|
893
893
|
</div>
|
|
894
894
|
</div>
|
|
895
|
-
`}toggleChecked(n){n.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};Xc([Z({type:String,reflect:!0})],Pl.prototype,"value",2),Xc([Z({type:String})],Pl.prototype,"checkHelptext",2),Xc([Z({type:Boolean})],Pl.prototype,"defaultChecked",2),Xc([Z({type:Boolean})],Pl.prototype,"hasTile",2),Xc([Z({type:Boolean,reflect:!0})],Pl.prototype,"checked",2),Xc([Z({type:String,reflect:!0})],Pl.prototype,"type",2),Xc([Rr()],Pl.prototype,"_checked",2),Pl=Xc([Kr("pkt-radiobutton")],Pl);/**
|
|
895
|
+
`}toggleChecked(n=null){n&&n.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};Xc([Z({type:String,reflect:!0})],Pl.prototype,"value",2),Xc([Z({type:String})],Pl.prototype,"checkHelptext",2),Xc([Z({type:Boolean})],Pl.prototype,"defaultChecked",2),Xc([Z({type:Boolean})],Pl.prototype,"hasTile",2),Xc([Z({type:Boolean,reflect:!0})],Pl.prototype,"checked",2),Xc([Z({type:String,reflect:!0})],Pl.prototype,"type",2),Xc([Rr()],Pl.prototype,"_checked",2),Pl=Xc([Kr("pkt-radiobutton")],Pl);/**
|
|
896
896
|
* @license
|
|
897
897
|
* Copyright 2020 Google LLC
|
|
898
898
|
* SPDX-License-Identifier: BSD-3-Clause
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.30.
|
|
3
|
+
"version": "12.30.3",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@lit-labs/ssr-dom-shim": "^1.2.1",
|
|
40
40
|
"@lit/react": "^1.0.5",
|
|
41
|
-
"@oslokommune/punkt-elements": "^12.30.
|
|
41
|
+
"@oslokommune/punkt-elements": "^12.30.3",
|
|
42
42
|
"angular-html-parser": "^6.0.2",
|
|
43
43
|
"html-format": "^1.1.7",
|
|
44
44
|
"prettier": "^3.3.3",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
112
112
|
},
|
|
113
113
|
"license": "MIT",
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "f73b87b0bd2a69042d4ed65309b2a5b9542f0b54"
|
|
115
115
|
}
|