@oslokommune/punkt-vue
Advanced tools
Comparing version
@@ -8,2 +8,20 @@ # Changelog | ||
## [11.13.4](https://github.com/oslokommune/punkt/compare/11.13.3...11.13.4) (2024-05-30) | ||
### ⚠ BREAKING CHANGES | ||
Ingen | ||
### Features | ||
Ingen | ||
### Bug Fixes | ||
* Bruker v-model oppdatering av checkbox verdi (#1721). | ||
### Chores | ||
Ingen | ||
--- | ||
## [11.13.3](https://github.com/oslokommune/punkt/compare/11.13.2...11.13.3) (2024-05-29) | ||
@@ -10,0 +28,0 @@ |
@@ -1,5 +0,5 @@ | ||
import { openBlock as l, createElementBlock as a, createElementVNode as o, normalizeClass as n, createTextVNode as s, toDisplayString as i, createCommentVNode as c, mergeProps as k } from "vue"; | ||
import { _ as r } from "./_plugin-vue_export-helper-hUChTQA_.js"; | ||
import { u as _, a as f } from "./plugins-UPM181Xt.js"; | ||
const b = { | ||
import { openBlock as l, createElementBlock as i, createElementVNode as s, normalizeClass as d, createTextVNode as u, toDisplayString as a, createCommentVNode as c, withDirectives as k, mergeProps as r, vModelCheckbox as _ } from "vue"; | ||
import { _ as f } from "./_plugin-vue_export-helper-hUChTQA_.js"; | ||
import { u as b, a as p } from "./plugins-UPM181Xt.js"; | ||
const m = { | ||
name: "PktCheckbox", | ||
@@ -16,3 +16,3 @@ props: { | ||
modelValue: { | ||
type: Boolean, | ||
type: [Boolean, Array], | ||
default: !1 | ||
@@ -58,3 +58,3 @@ }, | ||
get() { | ||
return this.modelValue; | ||
return this.modelValue || this.defaultChecked; | ||
}, | ||
@@ -65,19 +65,14 @@ set(t) { | ||
} | ||
}, | ||
methods: { | ||
handleChange(t) { | ||
this.computedChecked = t.target.checked; | ||
} | ||
} | ||
}, m = { class: "pkt-input-check" }, p = ["for"], y = { | ||
}, y = { class: "pkt-input-check" }, x = ["for"], C = { | ||
key: 0, | ||
class: "pkt-input-check__input-helptext" | ||
}, g = ["role", "id", "checked", "disabled"], x = ["for"], C = { | ||
}, g = ["role", "id", "disabled"], B = ["for"], P = { | ||
key: 0, | ||
class: "pkt-input-check__input-helptext" | ||
}; | ||
function B(t, h, e, V, H, d) { | ||
return l(), a("div", m, [ | ||
o("div", { | ||
class: n([ | ||
function S(t, n, e, H, E, o) { | ||
return l(), i("div", y, [ | ||
s("div", { | ||
class: d([ | ||
"pkt-input-check__input", | ||
@@ -88,11 +83,11 @@ { "pkt-input-check__input--tile": e.hasTile }, | ||
}, [ | ||
e.label && e.labelPosition === "left" ? (l(), a("label", { | ||
e.label && e.labelPosition === "left" ? (l(), i("label", { | ||
key: 0, | ||
class: n(["pkt-input-check__input-label", { "pkt-sr-only": e.hideLabel }]), | ||
class: d(["pkt-input-check__input-label", { "pkt-sr-only": e.hideLabel }]), | ||
for: e.id | ||
}, [ | ||
s(i(e.label) + " ", 1), | ||
e.checkHelptext ? (l(), a("div", y, i(e.checkHelptext), 1)) : c("", !0) | ||
], 10, p)) : c("", !0), | ||
o("input", k(t.$attrs, { | ||
u(a(e.label) + " ", 1), | ||
e.checkHelptext ? (l(), i("div", C, a(e.checkHelptext), 1)) : c("", !0) | ||
], 10, x)) : c("", !0), | ||
k(s("input", r(t.$attrs, { | ||
class: ["pkt-input-check__input-checkbox", { "pkt-input-check__input-checkbox--error": e.hasError }], | ||
@@ -102,26 +97,27 @@ type: "checkbox", | ||
id: e.id, | ||
checked: d.computedChecked || e.defaultChecked, | ||
onChange: h[0] || (h[0] = (...u) => d.handleChange && d.handleChange(...u)), | ||
"onUpdate:modelValue": n[0] || (n[0] = (h) => o.computedChecked = h), | ||
disabled: e.disabled | ||
}), null, 16, g), | ||
e.label && e.labelPosition === "right" ? (l(), a("label", { | ||
}), null, 16, g), [ | ||
[_, o.computedChecked] | ||
]), | ||
e.label && e.labelPosition === "right" ? (l(), i("label", { | ||
key: 1, | ||
class: n(["pkt-input-check__input-label", { "pkt-sr-only": e.hideLabel }]), | ||
class: d(["pkt-input-check__input-label", { "pkt-sr-only": e.hideLabel }]), | ||
for: e.id | ||
}, [ | ||
s(i(e.label) + " ", 1), | ||
e.checkHelptext ? (l(), a("div", C, i(e.checkHelptext), 1)) : c("", !0) | ||
], 10, x)) : c("", !0) | ||
u(a(e.label) + " ", 1), | ||
e.checkHelptext ? (l(), i("div", P, a(e.checkHelptext), 1)) : c("", !0) | ||
], 10, B)) : c("", !0) | ||
], 2) | ||
]); | ||
} | ||
const P = /* @__PURE__ */ r(b, [["render", B]]), S = { | ||
const V = /* @__PURE__ */ f(m, [["render", S]]), v = { | ||
install(t) { | ||
f(t, P); | ||
p(t, V); | ||
} | ||
}; | ||
_(S); | ||
b(v); | ||
export { | ||
P as PktCheckbox, | ||
S as default | ||
V as PktCheckbox, | ||
v as default | ||
}; |
{ | ||
"name": "@oslokommune/punkt-vue", | ||
"version": "11.13.3", | ||
"version": "11.13.4", | ||
"description": "Vue komponentbibliotek til Punkt, et designsystem laget av Oslo Origo", | ||
@@ -68,3 +68,3 @@ "homepage": "https://punkt.oslo.kommune.no", | ||
"license": "MIT", | ||
"gitHead": "344b120d07c6db09133e94caa559da4919afc23e" | ||
"gitHead": "1a00241fb69e0b141a971e2dfd97091a851c3505" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
290234
0.01%3519
-0.14%