@geckou/ui-vue 0.6.0 → 0.7.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.
@@ -1,9 +1,10 @@
1
- import { defineComponent as N, ref as R, computed as m, watch as q, watchEffect as V, onBeforeUnmount as F, openBlock as s, createBlock as T, normalizeClass as u, withCtx as x, createElementVNode as i, createElementBlock as d, Fragment as p, renderList as g, toDisplayString as h, createVNode as y, createCommentVNode as A } from "vue";
2
- import { daysInMonth as O, splitDate as j } from "@geckou/ui-core";
3
- import z from "./InputBox.vue.js";
4
- import b from "./Icon/KeyboardArrowDownIcon.vue.js";
5
- import H from "./TextButton.vue.js";
6
- const L = ["value", "name", "aria-label", "required"], P = ["value"], U = ["value", "name", "aria-label", "required"], G = ["value"], J = ["value", "name", "aria-label", "required"], K = ["value"], ee = /* @__PURE__ */ N({
1
+ import { defineComponent as T, ref as x, computed as y, watch as M, watchEffect as A, onBeforeUnmount as O, openBlock as s, createBlock as j, normalizeClass as u, withCtx as U, createElementVNode as o, createElementBlock as d, Fragment as h, renderList as $, toDisplayString as B, createVNode as c, createCommentVNode as Y, unref as k } from "vue";
2
+ import { daysInMonth as z, splitDate as H } from "@geckou/ui-core";
3
+ import P from "./InputBox.vue.js";
4
+ import C from "./Icon/KeyboardArrowDownIcon.vue.js";
5
+ import G from "./TextButton.vue.js";
6
+ import { nextUniqueId as J } from "../scripts/unique-id.js";
7
+ const K = ["value", "name", "aria-label", "aria-labelledby", "required"], Q = ["value"], W = ["value", "name", "aria-label", "aria-labelledby", "required"], X = ["value"], Z = ["value", "name", "aria-label", "aria-labelledby", "required"], w = ["value"], _ = ["id"], ee = ["id"], te = ["id"], de = /* @__PURE__ */ T({
7
8
  __name: "DateSelector",
8
9
  props: {
9
10
  name: {},
@@ -12,32 +13,34 @@ const L = ["value", "name", "aria-label", "required"], P = ["value"], U = ["valu
12
13
  formValidationManager: { default: null },
13
14
  type: { default: "date" },
14
15
  minYear: { default: void 0 },
15
- maxYear: { default: void 0 }
16
+ maxYear: { default: void 0 },
17
+ ariaLabel: { default: void 0 },
18
+ ariaLabelledBy: { default: void 0 }
16
19
  },
17
20
  emits: ["update:modelValue"],
18
- setup(l, { emit: B }) {
19
- const C = B, o = l, n = R({
21
+ setup(i, { emit: D }) {
22
+ const q = D, l = i, m = J("date_selector_unit"), f = (e) => l.ariaLabelledBy ? void 0 : `${l.ariaLabel ?? l.name}の${e}`, v = (e) => l.ariaLabelledBy ? `${l.ariaLabelledBy} ${m}_${e}` : void 0, n = x({
20
23
  year: "",
21
24
  month: "",
22
25
  day: ""
23
- }), M = m(() => {
24
- const e = (/* @__PURE__ */ new Date()).getFullYear(), a = o.minYear ?? e - 100, t = o.maxYear ?? e - 14, r = Math.max(t - a + 1, 0);
25
- return Array.from({ length: r }, (f, I) => (a + I).toString()).map((f) => ({ label: f, value: f }));
26
- }), Y = m(() => Array.from({ length: 12 }, (e, a) => {
26
+ }), E = y(() => {
27
+ const e = (/* @__PURE__ */ new Date()).getFullYear(), a = l.minYear ?? e - 100, t = l.maxYear ?? e - 14, r = Math.max(t - a + 1, 0);
28
+ return Array.from({ length: r }, (g, F) => (a + F).toString()).map((g) => ({ label: g, value: g }));
29
+ }), N = y(() => Array.from({ length: 12 }, (e, a) => {
27
30
  const t = (a + 1).toString();
28
31
  return {
29
32
  label: t,
30
33
  value: t.padStart(2, "0")
31
34
  };
32
- })), $ = m(() => {
35
+ })), S = y(() => {
33
36
  var t, r;
34
37
  const e = Number((t = n.value) == null ? void 0 : t.month);
35
38
  if (!e)
36
39
  return 31;
37
40
  const a = Number((r = n.value) == null ? void 0 : r.year) || 2e3;
38
- return O(a, e);
39
- }), D = m(() => {
40
- const e = [], a = $.value;
41
+ return z(a, e);
42
+ }), R = y(() => {
43
+ const e = [], a = S.value;
41
44
  for (let t = 1; t <= a; t++) {
42
45
  const r = t.toString();
43
46
  e.push(r);
@@ -46,119 +49,136 @@ const L = ["value", "name", "aria-label", "required"], P = ["value"], U = ["valu
46
49
  label: t,
47
50
  value: String(t).padStart(2, "0")
48
51
  }));
49
- }), v = (e) => {
52
+ }), b = (e) => {
50
53
  const t = e.currentTarget.firstElementChild;
51
54
  t && t.click();
52
- }, c = (e, a) => {
55
+ }, p = (e, a) => {
53
56
  const t = e.target, { value: r } = t;
54
57
  n.value = { ...n.value, [a]: r };
55
58
  };
56
- q($, (e) => {
59
+ M(S, (e) => {
57
60
  const a = Number(n.value.day);
58
61
  a && a > e && (n.value = { ...n.value, day: String(e).padStart(2, "0") });
59
62
  });
60
- const E = { year: "", month: "", day: "" };
61
- V(() => {
62
- n.value = o.modelValue ? j(o.modelValue) : { ...E };
63
+ const V = { year: "", month: "", day: "" };
64
+ A(() => {
65
+ n.value = l.modelValue ? H(l.modelValue) : { ...V };
63
66
  });
64
- const k = (e) => {
65
- o.formValidationManager && o.formValidationManager.setValid(o.name, e);
66
- }, S = (e) => {
67
- const a = !!(e.year && e.month && (o.type === "month" || e.day)), t = !e.year && !e.month && !e.day;
68
- return o.isRequired ? a : a || t;
67
+ const L = (e) => {
68
+ l.formValidationManager && l.formValidationManager.setValid(l.name, e);
69
+ }, I = (e) => {
70
+ const a = !!(e.year && e.month && (l.type === "month" || e.day)), t = !e.year && !e.month && !e.day;
71
+ return l.isRequired ? a : a || t;
69
72
  };
70
- return k(S(n.value)), q(
73
+ return L(I(n.value)), M(
71
74
  () => n.value,
72
75
  (e) => {
73
- const a = !!(e.year && e.month && (o.type === "month" || e.day)), t = !e.year && !e.month && !e.day;
74
- if (k(S(e)), t)
75
- C("update:modelValue", "");
76
+ const a = !!(e.year && e.month && (l.type === "month" || e.day)), t = !e.year && !e.month && !e.day;
77
+ if (L(I(e)), t)
78
+ q("update:modelValue", "");
76
79
  else if (a) {
77
- const r = o.type === "month" ? [e.year, e.month] : [e.year, e.month, e.day];
78
- C("update:modelValue", r.filter(Boolean).join("-"));
80
+ const r = l.type === "month" ? [e.year, e.month] : [e.year, e.month, e.day];
81
+ q("update:modelValue", r.filter(Boolean).join("-"));
79
82
  } else
80
83
  return;
81
84
  },
82
85
  { deep: !0 }
83
- ), F(() => {
86
+ ), O(() => {
84
87
  var e;
85
- return (e = o.formValidationManager) == null ? void 0 : e.remove(o.name);
86
- }), (e, a) => (s(), T(z, {
88
+ return (e = l.formValidationManager) == null ? void 0 : e.remove(l.name);
89
+ }), (e, a) => (s(), j(P, {
87
90
  class: u(e.$style.date_selector)
88
91
  }, {
89
- default: x(() => [
90
- i("div", {
92
+ default: U(() => [
93
+ o("div", {
91
94
  class: u([e.$style.selector_wrapper]),
92
- onClick: a[1] || (a[1] = (t) => v(t))
95
+ onClick: a[1] || (a[1] = (t) => b(t))
93
96
  }, [
94
- i("select", {
97
+ o("select", {
95
98
  value: n.value.year,
96
- name: `${l.name}-year`,
97
- "aria-label": `${l.name}の年`,
98
- required: l.isRequired,
99
+ name: `${i.name}-year`,
100
+ "aria-label": f("年"),
101
+ "aria-labelledby": v("年"),
102
+ required: i.isRequired,
99
103
  class: u(e.$style.year),
100
- onChange: a[0] || (a[0] = (t) => c(t, "year"))
104
+ onChange: a[0] || (a[0] = (t) => p(t, "year"))
101
105
  }, [
102
- a[7] || (a[7] = i("option", {
106
+ a[7] || (a[7] = o("option", {
103
107
  disabled: "",
104
108
  selected: "",
105
109
  value: ""
106
110
  }, "年", -1)),
107
- (s(!0), d(p, null, g(M.value, (t) => (s(), d("option", {
111
+ (s(!0), d(h, null, $(E.value, (t) => (s(), d("option", {
108
112
  key: t.value,
109
113
  value: t.value
110
- }, h(t.label), 9, P))), 128))
111
- ], 42, L),
112
- y(b)
114
+ }, B(t.label), 9, Q))), 128))
115
+ ], 42, K),
116
+ c(C)
113
117
  ], 2),
114
- i("div", {
118
+ o("div", {
115
119
  class: u([e.$style.selector_wrapper]),
116
- onClick: a[3] || (a[3] = (t) => v(t))
120
+ onClick: a[3] || (a[3] = (t) => b(t))
117
121
  }, [
118
- i("select", {
122
+ o("select", {
119
123
  value: n.value.month,
120
- name: `${l.name}-month`,
121
- "aria-label": `${l.name}の月`,
122
- required: l.isRequired,
123
- onChange: a[2] || (a[2] = (t) => c(t, "month"))
124
+ name: `${i.name}-month`,
125
+ "aria-label": f("月"),
126
+ "aria-labelledby": v("月"),
127
+ required: i.isRequired,
128
+ onChange: a[2] || (a[2] = (t) => p(t, "month"))
124
129
  }, [
125
- a[8] || (a[8] = i("option", {
130
+ a[8] || (a[8] = o("option", {
126
131
  disabled: "",
127
132
  selected: "",
128
133
  value: ""
129
134
  }, "月", -1)),
130
- (s(!0), d(p, null, g(Y.value, (t) => (s(), d("option", {
135
+ (s(!0), d(h, null, $(N.value, (t) => (s(), d("option", {
131
136
  key: t.value,
132
137
  value: t.value
133
- }, h(t.label), 9, G))), 128))
134
- ], 40, U),
135
- y(b)
138
+ }, B(t.label), 9, X))), 128))
139
+ ], 40, W),
140
+ c(C)
136
141
  ], 2),
137
- l.type === "date" ? (s(), d("div", {
142
+ i.type === "date" ? (s(), d("div", {
138
143
  key: 0,
139
144
  class: u([e.$style.selector_wrapper]),
140
- onClick: a[5] || (a[5] = (t) => v(t))
145
+ onClick: a[5] || (a[5] = (t) => b(t))
141
146
  }, [
142
- i("select", {
147
+ o("select", {
143
148
  value: n.value.day,
144
- name: `${l.name}-day`,
145
- "aria-label": `${l.name}の日`,
146
- required: l.isRequired,
147
- onChange: a[4] || (a[4] = (t) => c(t, "day"))
149
+ name: `${i.name}-day`,
150
+ "aria-label": f("日"),
151
+ "aria-labelledby": v("日"),
152
+ required: i.isRequired,
153
+ onChange: a[4] || (a[4] = (t) => p(t, "day"))
148
154
  }, [
149
- a[9] || (a[9] = i("option", {
155
+ a[9] || (a[9] = o("option", {
150
156
  disabled: "",
151
157
  selected: "",
152
158
  value: ""
153
159
  }, "日", -1)),
154
- (s(!0), d(p, null, g(D.value, (t) => (s(), d("option", {
160
+ (s(!0), d(h, null, $(R.value, (t) => (s(), d("option", {
155
161
  key: t.value,
156
162
  value: t.value
157
- }, h(t.label), 9, K))), 128))
158
- ], 40, J),
159
- y(b)
160
- ], 2)) : A("", !0),
161
- y(H, {
163
+ }, B(t.label), 9, w))), 128))
164
+ ], 40, Z),
165
+ c(C)
166
+ ], 2)) : Y("", !0),
167
+ i.ariaLabelledBy ? (s(), d("span", {
168
+ key: 1,
169
+ class: u(e.$style.unit_labels)
170
+ }, [
171
+ o("span", {
172
+ id: `${k(m)}_年`
173
+ }, "の年", 8, _),
174
+ o("span", {
175
+ id: `${k(m)}_月`
176
+ }, "の月", 8, ee),
177
+ o("span", {
178
+ id: `${k(m)}_日`
179
+ }, "の日", 8, te)
180
+ ], 2)) : Y("", !0),
181
+ c(G, {
162
182
  text: "削除",
163
183
  variant: "caution",
164
184
  class: u(e.$style.delete_button),
@@ -170,5 +190,5 @@ const L = ["value", "name", "aria-label", "required"], P = ["value"], U = ["valu
170
190
  }
171
191
  });
172
192
  export {
173
- ee as default
193
+ de as default
174
194
  };
@@ -1,13 +1,15 @@
1
- const e = "_date_selector_kckhg_1", t = "_selector_wrapper_kckhg_11", _ = "_year_kckhg_37", r = "_delete_button_kckhg_41", c = {
2
- date_selector: e,
3
- selector_wrapper: t,
4
- year: _,
5
- delete_button: r
1
+ const e = "_unit_labels_pa04y_1", t = "_date_selector_pa04y_13", _ = "_selector_wrapper_pa04y_23", a = "_year_pa04y_49", l = "_delete_button_pa04y_53", s = {
2
+ unit_labels: e,
3
+ date_selector: t,
4
+ selector_wrapper: _,
5
+ year: a,
6
+ delete_button: l
6
7
  };
7
8
  export {
8
- e as date_selector,
9
- c as default,
10
- r as delete_button,
11
- t as selector_wrapper,
12
- _ as year
9
+ t as date_selector,
10
+ s as default,
11
+ l as delete_button,
12
+ _ as selector_wrapper,
13
+ e as unit_labels,
14
+ a as year
13
15
  };
@@ -1,4 +1,4 @@
1
- const e = "_labeled_check_box_ck3yh_1", l = "_label_ck3yh_1", _ = {
1
+ const e = "_labeled_check_box_1y15f_1", l = "_label_1y15f_1", _ = {
2
2
  labeled_check_box: e,
3
3
  label: l
4
4
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as v, ref as g, watch as $, nextTick as C, computed as L, onMounted as E, onBeforeUnmount as B, openBlock as i, createElementBlock as r, normalizeClass as o, withModifiers as I, createElementVNode as d, unref as k, renderSlot as c, createCommentVNode as w, createVNode as z } from "vue";
2
- import { createScrollLock as M } from "@geckou/ui-core";
3
- import N from "./Icon/CloseIcon.vue.js";
4
- import { nextUniqueId as V } from "../scripts/unique-id.js";
5
- const q = ["aria-hidden", "inert"], U = ["aria-labelledby", "aria-label"], D = ["id"], G = /* @__PURE__ */ v({
1
+ import { defineComponent as p, ref as g, watch as $, nextTick as C, computed as E, onMounted as L, onBeforeUnmount as B, openBlock as i, createElementBlock as d, normalizeClass as o, withModifiers as I, createElementVNode as c, unref as k, renderSlot as u, createCommentVNode as w, createVNode as z } from "vue";
2
+ import { createScrollLock as M, handleTabKey as N } from "@geckou/ui-core";
3
+ import V from "./Icon/CloseIcon.vue.js";
4
+ import { nextUniqueId as q } from "../scripts/unique-id.js";
5
+ const K = ["aria-hidden", "inert"], T = ["aria-labelledby", "aria-label"], U = ["id"], H = /* @__PURE__ */ p({
6
6
  __name: "ModalBox",
7
7
  props: {
8
8
  isShown: { type: Boolean },
@@ -11,7 +11,7 @@ const q = ["aria-hidden", "inert"], U = ["aria-labelledby", "aria-label"], D = [
11
11
  },
12
12
  emits: ["close"],
13
13
  setup(n, { emit: b }) {
14
- const t = n, u = V("modal_header"), m = g(null), S = b, f = M(), h = (e) => f.toggle(e), s = () => S("close");
14
+ const t = n, m = q("modal_header"), s = g(null), v = b, f = M(), h = (e) => f.toggle(e), a = () => v("close");
15
15
  $(
16
16
  () => t.isShown,
17
17
  (e) => h(e)
@@ -20,66 +20,72 @@ const q = ["aria-hidden", "inert"], U = ["aria-labelledby", "aria-label"], D = [
20
20
  $(
21
21
  () => t.isShown,
22
22
  async (e) => {
23
- var a;
23
+ var r;
24
24
  if (!e) {
25
25
  l == null || l.focus(), l = null;
26
26
  return;
27
27
  }
28
- l = typeof document > "u" ? null : document.activeElement, await C(), (a = m.value) == null || a.focus();
28
+ l = typeof document > "u" ? null : document.activeElement, await C(), (r = s.value) == null || r.focus();
29
29
  }
30
30
  );
31
- const p = L(() => !t.isShown || void 0), y = (e) => {
32
- t.isShown && e.key === "Escape" && s();
31
+ const S = E(() => !t.isShown || void 0), y = (e) => {
32
+ if (t.isShown) {
33
+ if (e.key === "Escape") {
34
+ a();
35
+ return;
36
+ }
37
+ N(s.value, e, document.activeElement);
38
+ }
33
39
  };
34
- return E(() => {
40
+ return L(() => {
35
41
  h(t.isShown), document.addEventListener("keydown", y);
36
42
  }), B(() => {
37
43
  f.release(), document.removeEventListener("keydown", y);
38
- }), (e, a) => (i(), r("div", {
44
+ }), (e, r) => (i(), d("div", {
39
45
  class: o([e.$style.overlay, { [e.$style.display]: n.isShown }]),
40
46
  "aria-hidden": !n.isShown,
41
- inert: p.value,
42
- onClick: I(s, ["self"])
47
+ inert: S.value,
48
+ onClick: I(a, ["self"])
43
49
  }, [
44
- d("div", {
50
+ c("div", {
45
51
  ref_key: "dialog",
46
- ref: m,
52
+ ref: s,
47
53
  role: "dialog",
48
54
  "aria-modal": "true",
49
- "aria-labelledby": e.$slots.header ? k(u) : void 0,
55
+ "aria-labelledby": e.$slots.header ? k(m) : void 0,
50
56
  "aria-label": e.$slots.header ? void 0 : n.ariaLabel ?? "ダイアログ",
51
57
  tabindex: -1,
52
58
  class: o([e.$style.container, e.$style[n.size ?? "medium"]])
53
59
  }, [
54
- e.$slots.header ? (i(), r("header", {
60
+ e.$slots.header ? (i(), d("header", {
55
61
  key: 0,
56
- id: k(u),
62
+ id: k(m),
57
63
  class: o(e.$style.header)
58
64
  }, [
59
- c(e.$slots, "header")
60
- ], 10, D)) : w("", !0),
61
- d("div", {
65
+ u(e.$slots, "header")
66
+ ], 10, U)) : w("", !0),
67
+ c("div", {
62
68
  class: o(e.$style.contents)
63
69
  }, [
64
- c(e.$slots, "default")
70
+ u(e.$slots, "default")
65
71
  ], 2),
66
- e.$slots.footer ? (i(), r("footer", {
72
+ e.$slots.footer ? (i(), d("footer", {
67
73
  key: 1,
68
74
  class: o(e.$style.footer)
69
75
  }, [
70
- c(e.$slots, "footer")
76
+ u(e.$slots, "footer")
71
77
  ], 2)) : w("", !0),
72
- d("button", {
78
+ c("button", {
73
79
  type: "button",
74
80
  class: o(e.$style.close_button),
75
- onClick: s
81
+ onClick: a
76
82
  }, [
77
- z(N)
83
+ z(V)
78
84
  ], 2)
79
- ], 10, U)
80
- ], 10, q));
85
+ ], 10, T)
86
+ ], 10, K));
81
87
  }
82
88
  });
83
89
  export {
84
- G as default
90
+ H as default
85
91
  };
@@ -22,5 +22,5 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
22
22
  label: Record<"on" | "off", string>;
23
23
  ariaLabel: string;
24
24
  ariaLabelledBy: string;
25
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
26
26
  export default _default;
@@ -1,6 +1,7 @@
1
- import { defineComponent as w, computed as r, openBlock as L, createElementBlock as z, normalizeClass as s, normalizeStyle as B, withModifiers as V, withDirectives as $, createElementVNode as b, vModelCheckbox as S } from "vue";
1
+ import { defineComponent as w, computed as r, openBlock as v, createElementBlock as k, Fragment as B, createElementVNode as s, mergeProps as z, withModifiers as $, normalizeClass as C, createCommentVNode as V } from "vue";
2
2
  import { COLOR as l } from "@geckou/ui-core";
3
- const G = ["disabled", "aria-checked", "aria-labelledby", "aria-label"], O = ["name", "disabled"], p = ["data-on", "data-off"], M = /* @__PURE__ */ w({
3
+ const G = ["disabled", "data-checked", "aria-checked", "aria-labelledby", "aria-label"], O = ["data-on", "data-off"], S = ["name", "disabled"], E = /* @__PURE__ */ w({
4
+ inheritAttrs: !1,
4
5
  __name: "ToggleButton",
5
6
  props: {
6
7
  name: {},
@@ -12,11 +13,11 @@ const G = ["disabled", "aria-checked", "aria-labelledby", "aria-label"], O = ["n
12
13
  ariaLabelledBy: { default: void 0 }
13
14
  },
14
15
  emits: ["update:modelValue"],
15
- setup(o, { emit: x }) {
16
- const C = x, a = o, d = r({
16
+ setup(o, { emit: D }) {
17
+ const x = D, a = o, d = r({
17
18
  get: () => a.modelValue ?? !1,
18
- set: (e) => C("update:modelValue", e)
19
- }), D = r(() => {
19
+ set: (e) => x("update:modelValue", e)
20
+ }), L = r(() => {
20
21
  const e = a.label.on.length, t = a.label.off.length;
21
22
  return e > t ? e : t;
22
23
  }), i = r(() => {
@@ -48,47 +49,48 @@ const G = ["disabled", "aria-checked", "aria-labelledby", "aria-label"], O = ["n
48
49
  }[d.value ? "on" : "off"];
49
50
  });
50
51
  return (e, t) => {
51
- var n, u, c, f, m, y, h, g, v;
52
- return L(), z("button", {
53
- class: s(e.$style.toggle_button),
54
- style: B({
55
- "--text-color": (n = i.value) == null ? void 0 : n.textColor,
56
- "--border-color": (c = (u = i.value) == null ? void 0 : u.border) == null ? void 0 : c.color,
57
- "--border-size": (m = (f = i.value) == null ? void 0 : f.border) == null ? void 0 : m.size,
58
- "--radius-size": (h = (y = i.value) == null ? void 0 : y.border) == null ? void 0 : h.radius,
59
- "--background-color": (g = i.value) == null ? void 0 : g.backgroundColor,
60
- "--box-shadow": (v = i.value) == null ? void 0 : v.boxShadow,
61
- "--inline-size": `${D.value * 2}ch`
62
- }),
63
- type: "button",
64
- disabled: o.isDisabled,
65
- role: "switch",
66
- "aria-checked": d.value,
67
- "aria-labelledby": o.ariaLabelledBy,
68
- "aria-label": o.ariaLabelledBy ? void 0 : o.ariaLabel ?? o.name,
69
- onClick: t[1] || (t[1] = V((k) => o.isDisabled ? null : d.value = !d.value, ["stop"]))
70
- }, [
71
- $(b("input", {
72
- "onUpdate:modelValue": t[0] || (t[0] = (k) => d.value = k),
73
- type: "checkbox",
74
- tabindex: "-1",
52
+ var n, u, b, c, f, m, h, g, y;
53
+ return v(), k(B, null, [
54
+ s("button", z(e.$attrs, {
55
+ class: e.$style.toggle_button,
56
+ style: {
57
+ "--text-color": (n = i.value) == null ? void 0 : n.textColor,
58
+ "--border-color": (b = (u = i.value) == null ? void 0 : u.border) == null ? void 0 : b.color,
59
+ "--border-size": (f = (c = i.value) == null ? void 0 : c.border) == null ? void 0 : f.size,
60
+ "--radius-size": (h = (m = i.value) == null ? void 0 : m.border) == null ? void 0 : h.radius,
61
+ "--background-color": (g = i.value) == null ? void 0 : g.backgroundColor,
62
+ "--box-shadow": (y = i.value) == null ? void 0 : y.boxShadow,
63
+ "--inline-size": `${L.value * 2}ch`
64
+ },
65
+ type: "button",
66
+ disabled: o.isDisabled,
67
+ role: "switch",
68
+ "data-checked": d.value,
69
+ "aria-checked": d.value,
70
+ "aria-labelledby": o.ariaLabelledBy,
71
+ "aria-label": o.ariaLabelledBy ? void 0 : o.ariaLabel ?? o.name,
72
+ onClick: t[0] || (t[0] = $((F) => o.isDisabled ? null : d.value = !d.value, ["stop"]))
73
+ }), [
74
+ s("div", {
75
+ class: C([e.$style.text, { [e.$style.on]: d.value }]),
76
+ "data-on": o.label.on,
77
+ "data-off": o.label.off
78
+ }, null, 10, O),
79
+ s("div", {
80
+ class: C(e.$style.handle)
81
+ }, null, 2)
82
+ ], 16, G),
83
+ d.value ? (v(), k("input", {
84
+ key: 0,
85
+ type: "hidden",
75
86
  name: o.name,
87
+ value: "on",
76
88
  disabled: o.isDisabled
77
- }, null, 8, O), [
78
- [S, d.value]
79
- ]),
80
- b("div", {
81
- class: s([e.$style.text, { [e.$style.on]: d.value }]),
82
- "data-on": o.label.on,
83
- "data-off": o.label.off
84
- }, null, 10, p),
85
- b("div", {
86
- class: s(e.$style.handle)
87
- }, null, 2)
88
- ], 14, G);
89
+ }, null, 8, S)) : V("", !0)
90
+ ], 64);
89
91
  };
90
92
  }
91
93
  });
92
94
  export {
93
- M as default
95
+ E as default
94
96
  };
@@ -1,4 +1,4 @@
1
- const t = "_toggle_button_1phgw_1", o = "_text_1phgw_27", _ = "_on_1phgw_56", n = "_handle_1phgw_62", e = {
1
+ const t = "_toggle_button_tkkkr_1", o = "_text_tkkkr_16", _ = "_on_tkkkr_45", n = "_handle_tkkkr_51", e = {
2
2
  toggle_button: t,
3
3
  text: o,
4
4
  on: _,