@geckou/ui-vue 0.10.0 → 0.13.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,8 +1,9 @@
1
- import { defineComponent as V, ref as k, computed as E, watch as m, openBlock as i, createElementBlock as y, normalizeClass as q, Fragment as M, renderList as x, createBlock as B, createVNode as D } from "vue";
2
- import { COLOR as v, MESSAGES as _ } from "@geckou/ui-core";
3
- import A from "./LabeledCheckbox.vue.js";
4
- import L from "./ErrorMessage.vue.js";
5
- const F = /* @__PURE__ */ V({
1
+ import { defineComponent as B, ref as p, computed as k, watch as m, openBlock as v, createElementBlock as g, normalizeClass as E, unref as S, Fragment as q, renderList as x, createBlock as M, createVNode as D } from "vue";
2
+ import { COLOR as b, MESSAGES as A } from "@geckou/ui-core";
3
+ import I from "./LabeledCheckbox.vue.js";
4
+ import R from "./ErrorMessage.vue.js";
5
+ import { nextUniqueId as U } from "../scripts/unique-id.js";
6
+ const z = ["aria-label", "aria-labelledby", "aria-describedby"], $ = /* @__PURE__ */ B({
6
7
  __name: "CheckBoxes",
7
8
  props: {
8
9
  name: {},
@@ -10,12 +11,14 @@ const F = /* @__PURE__ */ V({
10
11
  modelValue: { default: void 0 },
11
12
  isDisabled: { type: Boolean },
12
13
  isRequired: { type: Boolean },
13
- cssStyle: { default: void 0 }
14
+ cssStyle: { default: void 0 },
15
+ ariaLabel: { default: void 0 },
16
+ ariaLabelledBy: { default: void 0 }
14
17
  },
15
18
  emits: ["update:modelValue"],
16
- setup(p, { emit: g }) {
17
- var b, f;
18
- const S = g, a = p, s = k(
19
+ setup(s, { emit: C }) {
20
+ var y;
21
+ const V = C, a = s, f = U("check_boxes_error"), u = p(
19
22
  a.options.map((e) => {
20
23
  var r;
21
24
  return {
@@ -24,22 +27,22 @@ const F = /* @__PURE__ */ V({
24
27
  checked: ((r = a.modelValue) == null ? void 0 : r.includes(e.value)) || !1
25
28
  };
26
29
  })
27
- ), c = E(
28
- () => s.value.filter((e) => e.checked).map((e) => e.value)
29
- ), n = k(""), C = () => n.value = a.isRequired && c.value.length === 0 ? _.required : "";
30
+ ), n = k(
31
+ () => u.value.filter((e) => e.checked).map((e) => e.value)
32
+ ), o = p(""), L = () => o.value = a.isRequired && n.value.length === 0 ? A.required : "";
30
33
  m(
31
- c,
34
+ n,
32
35
  (e, r) => {
33
- r && ((l, u) => l.length === u.length && l.every((o, d) => o === u[d]))(e, r) || (C(), S("update:modelValue", e));
36
+ r && ((l, d) => l.length === d.length && l.every((i, c) => i === d[c]))(e, r) || (L(), V("update:modelValue", e));
34
37
  },
35
38
  {
36
39
  deep: !0,
37
- immediate: !!((b = a.modelValue) != null && b.length)
40
+ immediate: !!((y = a.modelValue) != null && y.length)
38
41
  }
39
42
  ), m(
40
43
  () => a.modelValue,
41
44
  (e) => {
42
- e && s.value.forEach(
45
+ e && u.value.forEach(
43
46
  (r) => r.checked = e.includes(r.value)
44
47
  );
45
48
  },
@@ -50,15 +53,15 @@ const F = /* @__PURE__ */ V({
50
53
  ), m(
51
54
  () => a.options,
52
55
  (e) => {
53
- if (e.length === s.value.length && e.every(
54
- (l, u) => {
55
- var o, d;
56
- return l.value === ((o = s.value[u]) == null ? void 0 : o.value) && l.label === ((d = s.value[u]) == null ? void 0 : d.label);
56
+ if (e.length === u.value.length && e.every(
57
+ (l, d) => {
58
+ var i, c;
59
+ return l.value === ((i = u.value[d]) == null ? void 0 : i.value) && l.label === ((c = u.value[d]) == null ? void 0 : c.label);
57
60
  }
58
61
  ))
59
62
  return;
60
- const t = new Set(c.value);
61
- s.value = e.map((l) => ({
63
+ const t = new Set(n.value);
64
+ u.value = e.map((l) => ({
62
65
  value: l.value,
63
66
  label: l.label,
64
67
  checked: a.modelValue ? a.modelValue.includes(l.value) : t.has(l.value)
@@ -66,39 +69,47 @@ const F = /* @__PURE__ */ V({
66
69
  },
67
70
  { deep: !0 }
68
71
  );
69
- const h = {
70
- ...((f = a.cssStyle) == null ? void 0 : f.error) ?? {},
71
- textColor: v.white,
72
- backgroundColor: v.red,
73
- border: {
74
- color: v.red,
75
- size: "1px",
76
- radius: ".25rem"
77
- }
78
- };
79
- return (e, r) => (i(), y("div", {
80
- class: q(e.$style.check_boxes)
72
+ const h = k(() => {
73
+ var e;
74
+ return {
75
+ ...((e = a.cssStyle) == null ? void 0 : e.error) ?? {},
76
+ textColor: b.white,
77
+ backgroundColor: b.red,
78
+ border: {
79
+ color: b.red,
80
+ size: "1px",
81
+ radius: ".25rem"
82
+ }
83
+ };
84
+ });
85
+ return (e, r) => (v(), g("div", {
86
+ class: E(e.$style.check_boxes),
87
+ role: "group",
88
+ "aria-label": s.ariaLabelledBy ? void 0 : s.ariaLabel,
89
+ "aria-labelledby": s.ariaLabelledBy,
90
+ "aria-describedby": o.value ? S(f) : void 0
81
91
  }, [
82
- (i(!0), y(M, null, x(s.value, (t, l) => (i(), B(A, {
92
+ (v(!0), g(q, null, x(u.value, (t, l) => (v(), M(I, {
83
93
  key: t.value,
84
- modelValue: s.value[l].checked,
85
- "onUpdate:modelValue": (u) => s.value[l].checked = u,
86
- name: p.name,
94
+ modelValue: u.value[l].checked,
95
+ "onUpdate:modelValue": (d) => u.value[l].checked = d,
96
+ name: s.name,
87
97
  value: t.value,
88
98
  label: t.label,
89
99
  isDisabled: a.isDisabled,
90
100
  cssStyle: a.cssStyle
91
101
  }, null, 8, ["modelValue", "onUpdate:modelValue", "name", "value", "label", "isDisabled", "cssStyle"]))), 128)),
92
- D(L, {
93
- errorMessages: n.value ? [n.value] : [],
102
+ D(R, {
103
+ id: S(f),
104
+ errorMessages: o.value ? [o.value] : [],
94
105
  cssStyle: {
95
- textColor: h.textColor,
96
- backgroundColor: h.backgroundColor
106
+ textColor: h.value.textColor,
107
+ backgroundColor: h.value.backgroundColor
97
108
  }
98
- }, null, 8, ["errorMessages", "cssStyle"])
99
- ], 2));
109
+ }, null, 8, ["id", "errorMessages", "cssStyle"])
110
+ ], 10, z));
100
111
  }
101
112
  });
102
113
  export {
103
- F as default
114
+ $ as default
104
115
  };
@@ -5,6 +5,13 @@ type __VLS_Props = {
5
5
  isDisabled?: boolean;
6
6
  cssStyle?: CheckBoxStyleForEachStatus;
7
7
  isDisableAnimation?: boolean;
8
+ /**
9
+ * アクセシブル名。可視ラベルがあるなら ariaLabelledBy でその要素を指すこと。
10
+ * 文言を持たない label で包むだけだったため、
11
+ * スクリーンリーダーでは「チェックボックス」としか読まれなかった
12
+ */
13
+ ariaLabel?: string;
14
+ ariaLabelledBy?: string;
8
15
  };
9
16
  declare function __VLS_template(): {
10
17
  attrs: Partial<{}>;
@@ -21,6 +28,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
21
28
  "onUpdate:modelValue"?: ((newValue: boolean) => any) | undefined;
22
29
  }>, {
23
30
  cssStyle: CheckBoxStyleForEachStatus;
31
+ ariaLabel: string;
32
+ ariaLabelledBy: string;
24
33
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLabelElement>;
25
34
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
26
35
  export default _default;
@@ -1,54 +1,58 @@
1
- import { defineComponent as C, ref as V, computed as B, watch as b, openBlock as k, createElementBlock as D, normalizeClass as f, normalizeStyle as S, withDirectives as z, createElementVNode as p, vModelCheckbox as $, renderSlot as g, createBlock as w, createCommentVNode as x } from "vue";
2
- import A from "./Icon/CheckIcon.vue.js";
3
- const E = ["name", "disabled"], M = /* @__PURE__ */ C({
1
+ import { defineComponent as C, ref as V, computed as p, watch as b, openBlock as f, createElementBlock as D, normalizeClass as y, normalizeStyle as S, withDirectives as z, createElementVNode as k, vModelCheckbox as L, renderSlot as $, createBlock as g, createCommentVNode as w } from "vue";
2
+ import x from "./Icon/CheckIcon.vue.js";
3
+ const A = ["name", "aria-label", "aria-labelledby", "disabled"], I = /* @__PURE__ */ C({
4
4
  __name: "CheckButton",
5
5
  props: {
6
6
  name: {},
7
7
  modelValue: { type: Boolean },
8
8
  isDisabled: { type: Boolean },
9
9
  cssStyle: { default: () => ({ default: {} }) },
10
- isDisableAnimation: { type: Boolean }
10
+ isDisableAnimation: { type: Boolean },
11
+ ariaLabel: { default: void 0 },
12
+ ariaLabelledBy: { default: void 0 }
11
13
  },
12
14
  emits: ["update:modelValue"],
13
- setup(o, { emit: y }) {
14
- const h = y, l = o, t = V(l.modelValue ?? !1), a = B(() => l.isDisabled ? l.cssStyle.disabled : l.cssStyle.default);
15
+ setup(e, { emit: h }) {
16
+ const v = h, l = e, t = V(l.modelValue ?? !1), o = p(() => l.isDisabled ? l.cssStyle.disabled : l.cssStyle.default);
15
17
  return b(
16
18
  () => t.value,
17
- (e) => h("update:modelValue", e)
19
+ (a) => v("update:modelValue", a)
18
20
  ), b(
19
21
  () => l.modelValue,
20
- (e) => t.value = e,
22
+ (a) => t.value = a,
21
23
  { immediate: !0 }
22
- ), (e, s) => {
23
- var r, n, i, d, c, u, m;
24
- return k(), D("label", {
25
- class: f(e.$style.check_box),
24
+ ), (a, d) => {
25
+ var i, r, n, s, u, c, m;
26
+ return f(), D("label", {
27
+ class: y(a.$style.check_box),
26
28
  style: S({
27
- "--border-color": ((n = (r = a.value) == null ? void 0 : r.border) == null ? void 0 : n.color) || "blue",
28
- "--border-size": ((d = (i = a.value) == null ? void 0 : i.border) == null ? void 0 : d.size) || "1px",
29
- "--radius-size": ((u = (c = a.value) == null ? void 0 : c.border) == null ? void 0 : u.radius) || "0.25rem",
30
- "--background-color": ((m = a.value) == null ? void 0 : m.backgroundColor) || "#fff",
31
- "--duration": o.isDisableAnimation ? "0s" : ".3s"
29
+ "--border-color": ((r = (i = o.value) == null ? void 0 : i.border) == null ? void 0 : r.color) || "blue",
30
+ "--border-size": ((s = (n = o.value) == null ? void 0 : n.border) == null ? void 0 : s.size) || "1px",
31
+ "--radius-size": ((c = (u = o.value) == null ? void 0 : u.border) == null ? void 0 : c.radius) || "0.25rem",
32
+ "--background-color": ((m = o.value) == null ? void 0 : m.backgroundColor) || "#fff",
33
+ "--duration": e.isDisableAnimation ? "0s" : ".3s"
32
34
  })
33
35
  }, [
34
- z(p("input", {
35
- "onUpdate:modelValue": s[0] || (s[0] = (v) => t.value = v),
36
+ z(k("input", {
37
+ "onUpdate:modelValue": d[0] || (d[0] = (B) => t.value = B),
36
38
  type: "checkbox",
37
- name: o.name,
38
- disabled: o.isDisabled
39
- }, null, 8, E), [
40
- [$, t.value]
39
+ name: e.name,
40
+ "aria-label": e.ariaLabelledBy ? void 0 : e.ariaLabel ?? e.name,
41
+ "aria-labelledby": e.ariaLabelledBy,
42
+ disabled: e.isDisabled
43
+ }, null, 8, A), [
44
+ [L, t.value]
41
45
  ]),
42
- p("div", {
43
- class: f(e.$style.check_container)
46
+ k("div", {
47
+ class: y(a.$style.check_container)
44
48
  }, [
45
- g(e.$slots, "check"),
46
- e.$slots.check ? x("", !0) : (k(), w(A, { key: 0 }))
49
+ $(a.$slots, "check"),
50
+ a.$slots.check ? w("", !0) : (f(), g(x, { key: 0 }))
47
51
  ], 2)
48
52
  ], 6);
49
53
  };
50
54
  }
51
55
  });
52
56
  export {
53
- M as default
57
+ I as default
54
58
  };
@@ -1,10 +1,10 @@
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({
1
+ import { defineComponent as F, ref as x, computed as y, watch as I, watchEffect as A, onBeforeUnmount as O, openBlock as d, createBlock as T, normalizeClass as u, withCtx as _, createElementVNode as o, createElementBlock as s, Fragment as h, renderList as g, toDisplayString as $, createVNode as c, createCommentVNode as M, unref as B } from "vue";
2
+ import { daysInMonth as j, splitDate as U } from "@geckou/ui-core";
3
+ import z from "./InputBox.vue.js";
4
+ import q from "./Icon/KeyboardArrowDownIcon.vue.js";
5
+ import H from "./TextButton.vue.js";
6
+ import { nextUniqueId as P } from "../scripts/unique-id.js";
7
+ const G = ["value", "name", "aria-label", "aria-labelledby", "required"], J = ["value"], K = ["value", "name", "aria-label", "aria-labelledby", "required"], Q = ["value"], W = ["value", "name", "aria-label", "aria-labelledby", "required"], X = ["value"], Z = ["id"], w = ["id"], ee = ["id"], de = /* @__PURE__ */ F({
8
8
  __name: "DateSelector",
9
9
  props: {
10
10
  name: {},
@@ -18,67 +18,64 @@ const K = ["value", "name", "aria-label", "aria-labelledby", "required"], Q = ["
18
18
  ariaLabelledBy: { default: void 0 }
19
19
  },
20
20
  emits: ["update:modelValue"],
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({
21
+ setup(i, { emit: Y }) {
22
+ const S = Y, l = i, m = P("date_selector_unit"), v = (e) => l.ariaLabelledBy ? void 0 : `${l.ariaLabel ?? l.name}の${e}`, b = (e) => l.ariaLabelledBy ? `${l.ariaLabelledBy} ${m}_${e}` : void 0, n = x({
23
23
  year: "",
24
24
  month: "",
25
25
  day: ""
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) => {
30
- const t = (a + 1).toString();
26
+ }), D = y(() => {
27
+ const e = (/* @__PURE__ */ new Date()).getFullYear(), t = l.minYear ?? e - 100, a = l.maxYear ?? e - 14, r = Math.max(a - t + 1, 0);
28
+ return Array.from({ length: r }, (p, V) => (t + V).toString()).map((p) => ({ label: p, value: p }));
29
+ }), E = y(() => Array.from({ length: 12 }, (e, t) => {
30
+ const a = (t + 1).toString();
31
31
  return {
32
- label: t,
33
- value: t.padStart(2, "0")
32
+ label: a,
33
+ value: a.padStart(2, "0")
34
34
  };
35
- })), S = y(() => {
36
- var t, r;
37
- const e = Number((t = n.value) == null ? void 0 : t.month);
35
+ })), L = y(() => {
36
+ var a, r;
37
+ const e = Number((a = n.value) == null ? void 0 : a.month);
38
38
  if (!e)
39
39
  return 31;
40
- const a = Number((r = n.value) == null ? void 0 : r.year) || 2e3;
41
- return z(a, e);
42
- }), R = y(() => {
43
- const e = [], a = S.value;
44
- for (let t = 1; t <= a; t++) {
45
- const r = t.toString();
40
+ const t = Number((r = n.value) == null ? void 0 : r.year) || 2e3;
41
+ return j(t, e);
42
+ }), N = y(() => {
43
+ const e = [], t = L.value;
44
+ for (let a = 1; a <= t; a++) {
45
+ const r = a.toString();
46
46
  e.push(r);
47
47
  }
48
- return e.map((t) => ({
49
- label: t,
50
- value: String(t).padStart(2, "0")
48
+ return e.map((a) => ({
49
+ label: a,
50
+ value: String(a).padStart(2, "0")
51
51
  }));
52
- }), b = (e) => {
53
- const t = e.currentTarget.firstElementChild;
54
- t && t.click();
55
- }, p = (e, a) => {
56
- const t = e.target, { value: r } = t;
57
- n.value = { ...n.value, [a]: r };
52
+ }), f = (e, t) => {
53
+ const a = e.target, { value: r } = a;
54
+ n.value = { ...n.value, [t]: r };
58
55
  };
59
- M(S, (e) => {
60
- const a = Number(n.value.day);
61
- a && a > e && (n.value = { ...n.value, day: String(e).padStart(2, "0") });
56
+ I(L, (e) => {
57
+ const t = Number(n.value.day);
58
+ t && t > e && (n.value = { ...n.value, day: String(e).padStart(2, "0") });
62
59
  });
63
- const V = { year: "", month: "", day: "" };
60
+ const R = { year: "", month: "", day: "" };
64
61
  A(() => {
65
- n.value = l.modelValue ? H(l.modelValue) : { ...V };
62
+ n.value = l.modelValue ? U(l.modelValue) : { ...R };
66
63
  });
67
- const L = (e) => {
64
+ const k = (e) => {
68
65
  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;
66
+ }, C = (e) => {
67
+ const t = !!(e.year && e.month && (l.type === "month" || e.day)), a = !e.year && !e.month && !e.day;
68
+ return l.isRequired ? t : t || a;
72
69
  };
73
- return L(I(n.value)), M(
70
+ return k(C(n.value)), I(
74
71
  () => n.value,
75
72
  (e) => {
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", "");
79
- else if (a) {
73
+ const t = !!(e.year && e.month && (l.type === "month" || e.day)), a = !e.year && !e.month && !e.day;
74
+ if (k(C(e)), a)
75
+ S("update:modelValue", "");
76
+ else if (t) {
80
77
  const r = l.type === "month" ? [e.year, e.month] : [e.year, e.month, e.day];
81
- q("update:modelValue", r.filter(Boolean).join("-"));
78
+ S("update:modelValue", r.filter(Boolean).join("-"));
82
79
  } else
83
80
  return;
84
81
  },
@@ -86,103 +83,100 @@ const K = ["value", "name", "aria-label", "aria-labelledby", "required"], Q = ["
86
83
  ), O(() => {
87
84
  var e;
88
85
  return (e = l.formValidationManager) == null ? void 0 : e.remove(l.name);
89
- }), (e, a) => (s(), j(P, {
86
+ }), (e, t) => (d(), T(z, {
90
87
  class: u(e.$style.date_selector)
91
88
  }, {
92
- default: U(() => [
89
+ default: _(() => [
93
90
  o("div", {
94
- class: u([e.$style.selector_wrapper]),
95
- onClick: a[1] || (a[1] = (t) => b(t))
91
+ class: u([e.$style.selector_wrapper])
96
92
  }, [
97
93
  o("select", {
98
94
  value: n.value.year,
99
95
  name: `${i.name}-year`,
100
- "aria-label": f("年"),
101
- "aria-labelledby": v("年"),
96
+ "aria-label": v("年"),
97
+ "aria-labelledby": b("年"),
102
98
  required: i.isRequired,
103
99
  class: u(e.$style.year),
104
- onChange: a[0] || (a[0] = (t) => p(t, "year"))
100
+ onChange: t[0] || (t[0] = (a) => f(a, "year"))
105
101
  }, [
106
- a[7] || (a[7] = o("option", {
102
+ t[4] || (t[4] = o("option", {
107
103
  disabled: "",
108
104
  selected: "",
109
105
  value: ""
110
106
  }, "年", -1)),
111
- (s(!0), d(h, null, $(E.value, (t) => (s(), d("option", {
112
- key: t.value,
113
- value: t.value
114
- }, B(t.label), 9, Q))), 128))
115
- ], 42, K),
116
- c(C)
107
+ (d(!0), s(h, null, g(D.value, (a) => (d(), s("option", {
108
+ key: a.value,
109
+ value: a.value
110
+ }, $(a.label), 9, J))), 128))
111
+ ], 42, G),
112
+ c(q)
117
113
  ], 2),
118
114
  o("div", {
119
- class: u([e.$style.selector_wrapper]),
120
- onClick: a[3] || (a[3] = (t) => b(t))
115
+ class: u([e.$style.selector_wrapper])
121
116
  }, [
122
117
  o("select", {
123
118
  value: n.value.month,
124
119
  name: `${i.name}-month`,
125
- "aria-label": f("月"),
126
- "aria-labelledby": v("月"),
120
+ "aria-label": v("月"),
121
+ "aria-labelledby": b("月"),
127
122
  required: i.isRequired,
128
- onChange: a[2] || (a[2] = (t) => p(t, "month"))
123
+ onChange: t[1] || (t[1] = (a) => f(a, "month"))
129
124
  }, [
130
- a[8] || (a[8] = o("option", {
125
+ t[5] || (t[5] = o("option", {
131
126
  disabled: "",
132
127
  selected: "",
133
128
  value: ""
134
129
  }, "月", -1)),
135
- (s(!0), d(h, null, $(N.value, (t) => (s(), d("option", {
136
- key: t.value,
137
- value: t.value
138
- }, B(t.label), 9, X))), 128))
139
- ], 40, W),
140
- c(C)
130
+ (d(!0), s(h, null, g(E.value, (a) => (d(), s("option", {
131
+ key: a.value,
132
+ value: a.value
133
+ }, $(a.label), 9, Q))), 128))
134
+ ], 40, K),
135
+ c(q)
141
136
  ], 2),
142
- i.type === "date" ? (s(), d("div", {
137
+ i.type === "date" ? (d(), s("div", {
143
138
  key: 0,
144
- class: u([e.$style.selector_wrapper]),
145
- onClick: a[5] || (a[5] = (t) => b(t))
139
+ class: u([e.$style.selector_wrapper])
146
140
  }, [
147
141
  o("select", {
148
142
  value: n.value.day,
149
143
  name: `${i.name}-day`,
150
- "aria-label": f("日"),
151
- "aria-labelledby": v("日"),
144
+ "aria-label": v("日"),
145
+ "aria-labelledby": b("日"),
152
146
  required: i.isRequired,
153
- onChange: a[4] || (a[4] = (t) => p(t, "day"))
147
+ onChange: t[2] || (t[2] = (a) => f(a, "day"))
154
148
  }, [
155
- a[9] || (a[9] = o("option", {
149
+ t[6] || (t[6] = o("option", {
156
150
  disabled: "",
157
151
  selected: "",
158
152
  value: ""
159
153
  }, "日", -1)),
160
- (s(!0), d(h, null, $(R.value, (t) => (s(), d("option", {
161
- key: t.value,
162
- value: t.value
163
- }, B(t.label), 9, w))), 128))
164
- ], 40, Z),
165
- c(C)
166
- ], 2)) : Y("", !0),
167
- i.ariaLabelledBy ? (s(), d("span", {
154
+ (d(!0), s(h, null, g(N.value, (a) => (d(), s("option", {
155
+ key: a.value,
156
+ value: a.value
157
+ }, $(a.label), 9, X))), 128))
158
+ ], 40, W),
159
+ c(q)
160
+ ], 2)) : M("", !0),
161
+ i.ariaLabelledBy ? (d(), s("span", {
168
162
  key: 1,
169
163
  class: u(e.$style.unit_labels)
170
164
  }, [
171
165
  o("span", {
172
- id: `${k(m)}_年`
173
- }, "の年", 8, _),
166
+ id: `${B(m)}_年`
167
+ }, "の年", 8, Z),
174
168
  o("span", {
175
- id: `${k(m)}_月`
176
- }, "の月", 8, ee),
169
+ id: `${B(m)}_月`
170
+ }, "の月", 8, w),
177
171
  o("span", {
178
- id: `${k(m)}_日`
179
- }, "の日", 8, te)
180
- ], 2)) : Y("", !0),
181
- c(G, {
172
+ id: `${B(m)}_日`
173
+ }, "の日", 8, ee)
174
+ ], 2)) : M("", !0),
175
+ c(H, {
182
176
  text: "削除",
183
177
  variant: "caution",
184
178
  class: u(e.$style.delete_button),
185
- onClick: a[6] || (a[6] = (t) => n.value = { year: "", month: "", day: "" })
179
+ onClick: t[3] || (t[3] = (a) => n.value = { year: "", month: "", day: "" })
186
180
  }, null, 8, ["class"])
187
181
  ]),
188
182
  _: 1
@@ -1,4 +1,6 @@
1
1
  type __VLS_Props = {
2
+ /** aria-describedby から参照させたいときに渡す */
3
+ id?: string;
2
4
  cssStyle?: {
3
5
  textColor: string | undefined;
4
6
  backgroundColor: string | undefined;
@@ -1,30 +1,32 @@
1
- import { defineComponent as c, withDirectives as i, openBlock as r, createElementBlock as o, normalizeClass as m, normalizeStyle as u, unref as g, Fragment as f, renderList as y, toDisplayString as d, vShow as C } from "vue";
2
- import { COLOR as S } from "@geckou/ui-core";
3
- const v = /* @__PURE__ */ c({
1
+ import { defineComponent as i, withDirectives as d, openBlock as r, createElementBlock as o, normalizeClass as m, normalizeStyle as g, unref as u, Fragment as f, renderList as y, toDisplayString as C, vShow as S } from "vue";
2
+ import { COLOR as h } from "@geckou/ui-core";
3
+ const k = ["id"], b = /* @__PURE__ */ i({
4
4
  __name: "ErrorMessage",
5
5
  props: {
6
+ id: {},
6
7
  cssStyle: {},
7
8
  errorMessages: {}
8
9
  },
9
10
  setup(e) {
10
- const { red: n } = S;
11
- return (a, k) => {
11
+ const { red: l } = h;
12
+ return (n, M) => {
12
13
  var s, t;
13
- return i((r(), o("div", {
14
+ return d((r(), o("div", {
15
+ id: e.id,
14
16
  role: "alert",
15
- class: m(a.$style.error_messages),
16
- style: u({
17
+ class: m(n.$style.error_messages),
18
+ style: g({
17
19
  "--error-text-color": ((s = e.cssStyle) == null ? void 0 : s.textColor) || "#fff",
18
- "--error-background-color": ((t = e.cssStyle) == null ? void 0 : t.backgroundColor) || g(n)
20
+ "--error-background-color": ((t = e.cssStyle) == null ? void 0 : t.backgroundColor) || u(l)
19
21
  })
20
22
  }, [
21
- (r(!0), o(f, null, y(e.errorMessages, (l) => (r(), o("span", { key: l }, d(l), 1))), 128))
22
- ], 6)), [
23
- [C, e.errorMessages && e.errorMessages.length]
23
+ (r(!0), o(f, null, y(e.errorMessages, (a, c) => (r(), o("span", { key: c }, C(a), 1))), 128))
24
+ ], 14, k)), [
25
+ [S, e.errorMessages && e.errorMessages.length]
24
26
  ]);
25
27
  };
26
28
  }
27
29
  });
28
30
  export {
29
- v as default
31
+ b as default
30
32
  };
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -1,11 +1,13 @@
1
- import { openBlock as r, createElementBlock as e, createStaticVNode as t } from "vue";
1
+ import { openBlock as e, createElementBlock as r, createStaticVNode as t } from "vue";
2
2
  import i from "../_virtual/_plugin-vue_export-helper.js";
3
3
  const o = {}, a = {
4
4
  viewBox: "0 0 24 24",
5
- xmlns: "http://www.w3.org/2000/svg"
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ "aria-hidden": "true",
7
+ focusable: "false"
6
8
  };
7
9
  function n(l, c) {
8
- return r(), e("svg", a, [...c[0] || (c[0] = [
10
+ return e(), r("svg", a, [...c[0] || (c[0] = [
9
11
  t('<g><circle cx="12" cy="2.5" r="1.5" opacity=".14"></circle><circle cx="16.75" cy="3.77" r="1.5" opacity=".29"></circle><circle cx="20.23" cy="7.25" r="1.5" opacity=".43"></circle><circle cx="21.50" cy="12.00" r="1.5" opacity=".57"></circle><circle cx="20.23" cy="16.75" r="1.5" opacity=".71"></circle><circle cx="16.75" cy="20.23" r="1.5" opacity=".86"></circle><circle cx="12" cy="21.5" r="1.5"></circle><animateTransform attributeName="transform" type="rotate" calcMode="discrete" dur="0.75s" values="0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12" repeatCount="indefinite"></animateTransform></g>', 1)
10
12
  ])]);
11
13
  }