@kystverket/styrbord 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +43 -24
- package/dist/main.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -701,21 +701,30 @@ const e2 = ({
|
|
|
701
701
|
/* @__PURE__ */ h.jsx(X0.Legend, { children: /* @__PURE__ */ h.jsx(i0, { text: r.label, required: r.required, optional: r.optional }) }),
|
|
702
702
|
r.description && /* @__PURE__ */ h.jsx(X0.Description, { children: r.description }),
|
|
703
703
|
/* @__PURE__ */ h.jsx("div", { className: H2.toggleGroup, "data-color": e ? "danger" : "neutral", children: r.values.map((a) => /* @__PURE__ */ h.jsx(
|
|
704
|
-
|
|
704
|
+
"div",
|
|
705
705
|
{
|
|
706
706
|
className: a.value ? H2["is-on"] : H2["is-off"],
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
disabled: r.disabled,
|
|
710
|
-
checked: a.value,
|
|
711
|
-
label: a.label,
|
|
712
|
-
onChange: (s) => {
|
|
713
|
-
t(a.key ?? a.label, s.target.checked);
|
|
707
|
+
onClick: (s) => {
|
|
708
|
+
s.target === s.currentTarget && !r.disabled && !r.readonly && t(a.key ?? a.label, !a.value);
|
|
714
709
|
},
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
710
|
+
style: { cursor: r.disabled || r.readonly ? "default" : "pointer" },
|
|
711
|
+
children: /* @__PURE__ */ h.jsx(
|
|
712
|
+
S8,
|
|
713
|
+
{
|
|
714
|
+
"data-color": e ? "danger" : "primary",
|
|
715
|
+
readOnly: r.readonly,
|
|
716
|
+
disabled: r.disabled,
|
|
717
|
+
checked: a.value,
|
|
718
|
+
label: a.label,
|
|
719
|
+
onChange: (s) => {
|
|
720
|
+
t(a.key ?? a.label, s.target.checked);
|
|
721
|
+
},
|
|
722
|
+
onBlur: () => {
|
|
723
|
+
var s;
|
|
724
|
+
(s = r.onBlur) == null || s.call(r);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
)
|
|
719
728
|
},
|
|
720
729
|
a.key ?? a.label
|
|
721
730
|
)) }),
|
|
@@ -734,22 +743,32 @@ const e2 = ({
|
|
|
734
743
|
/* @__PURE__ */ h.jsx(X0.Legend, { children: /* @__PURE__ */ h.jsx(i0, { text: r.label, required: r.required, optional: r.optional }) }),
|
|
735
744
|
r.description && /* @__PURE__ */ h.jsx(X0.Description, { children: r.description }),
|
|
736
745
|
/* @__PURE__ */ h.jsx("div", { className: H2.toggleGroup, "data-color": e ? "danger" : "neutral", children: r.options.map((t) => /* @__PURE__ */ h.jsx(
|
|
737
|
-
|
|
746
|
+
"div",
|
|
738
747
|
{
|
|
739
748
|
className: t.value === r.value ? H2["is-on"] : H2["is-off"],
|
|
740
|
-
|
|
741
|
-
readOnly: r.readonly,
|
|
742
|
-
disabled: r.disabled,
|
|
743
|
-
checked: t.value === r.value,
|
|
744
|
-
label: t.label,
|
|
745
|
-
onChange: () => {
|
|
749
|
+
onClick: () => {
|
|
746
750
|
var a;
|
|
747
|
-
(a = r.onChange) == null || a.call(r, t.value);
|
|
751
|
+
!r.disabled && !r.readonly && ((a = r.onChange) == null || a.call(r, t.value));
|
|
748
752
|
},
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
+
style: { cursor: r.disabled || r.readonly ? "default" : "pointer" },
|
|
754
|
+
children: /* @__PURE__ */ h.jsx(
|
|
755
|
+
P8,
|
|
756
|
+
{
|
|
757
|
+
"data-color": e ? "danger" : "primary",
|
|
758
|
+
readOnly: r.readonly,
|
|
759
|
+
disabled: r.disabled,
|
|
760
|
+
checked: t.value === r.value,
|
|
761
|
+
label: t.label,
|
|
762
|
+
onChange: () => {
|
|
763
|
+
var a;
|
|
764
|
+
(a = r.onChange) == null || a.call(r, t.value);
|
|
765
|
+
},
|
|
766
|
+
onBlur: () => {
|
|
767
|
+
var a;
|
|
768
|
+
(a = r.onBlur) == null || a.call(r);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
)
|
|
753
772
|
},
|
|
754
773
|
t.label
|
|
755
774
|
)) }),
|