@geckou/ui-vue 0.6.0 → 0.8.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.
package/README.md CHANGED
@@ -64,6 +64,16 @@ import { TextBox, StandardList } from '@geckou/ui-vue'
64
64
 
65
65
  `DatePicker` / `DateRangePicker` / `DateSelector`
66
66
 
67
+ `DatePicker` / `DateSelector` の年月日欄の読み上げ名は、既定では `name` から作られます
68
+ (`name="startedOn"` なら「startedOnの年」)。`CheckBox` と同じ `ariaLabel` / `ariaLabelledBy`
69
+ を渡すと、そちらを土台に「の年」「の月」「の日」を繋げます。可視ラベルがあるなら
70
+ `ariaLabelledBy` でその要素を指してください(WCAG 2.5.3 Label in Name)。
71
+
72
+ ```vue
73
+ <DatePicker v-model="startedOn" name="startedOn" ariaLabel="開始日" />
74
+ <DatePicker v-model="startedOn" name="startedOn" :ariaLabelledBy="labelId" />
75
+ ```
76
+
67
77
  `FormValidationManager` を渡すと、フォーム内の各入力の検証結果をまとめて追跡できます。
68
78
 
69
79
  ```vue
@@ -229,10 +239,10 @@ const articles = ref<any[]>([])
229
239
 
230
240
  ### `Category`
231
241
 
232
- | Prop Name | Type | Required | Description |
233
- |-----------|----------|----------|--------------------------------|
234
- | `id` | `string` | ✅ | WordPress のカテゴリ ID |
235
- | `name` | `string` | ✅ | 表示するカテゴリ名 |
242
+ | Prop Name | Type | Required | Description |
243
+ |-----------|--------------------|----------|------------------------------------------------------|
244
+ | `id` | `string \| number` | ✅ | WordPress のカテゴリ ID(REST の数値 ID もそのまま可)|
245
+ | `name` | `string` | ✅ | 表示するカテゴリ名 |
236
246
 
237
247
  ### `PostConfig`
238
248
 
@@ -291,6 +301,20 @@ const articles = ref<any[]>([])
291
301
 
292
302
  定義例はデモの `demo/styles/base.scss` を参照。
293
303
 
304
+ ## 0.7.0 の変更
305
+
306
+ - `DatePicker` / `DateSelector` が `ariaLabel` / `ariaLabelledBy` を受ける
307
+ (未指定なら従来どおり `name` から読み上げ名を作る)
308
+ - `CheckBox` / `ToggleButton` が `<button>` の中に `<input>` を置かなくなった。
309
+ 状態は `<button>` の `data-checked` / `disabled` で表し、送信用の入力は
310
+ チェック時だけ `<input type="hidden">` として `<button>` の外に描かれる。
311
+ `:has(input:checked)` などで見た目を上書きしていた場合は追従が要る
312
+ - `CheckBox` が `isDisabled` のとき `<button disabled>` を出す(Tab で止まらなくなる)
313
+ - `ArticleList` の `CardHeading` が `heading` を HTML として描画する
314
+ (WordPress の `title.rendered` のエンティティがそのまま出ていた)。
315
+ WP 以外から渡す場合は埋め込む前にサニタイズすること
316
+ - `ModalBox` が開いている間、Tab / Shift+Tab をダイアログ内で循環させる(フォーカストラップ)
317
+
294
318
  ## 0.6.0 の破壊的変更
295
319
 
296
320
  - `ModalBox` のイベント名が `closeModal` → `close`(React の `onClose` と揃えた)。
@@ -1,4 +1,9 @@
1
1
  type __VLS_Props = {
2
+ /**
3
+ * 見出し。**HTML 文字列として描画する**(WordPress の `title.rendered` は
4
+ * `&amp;` などにエンコード済みなので、テキストのまま出すとエンティティが見えてしまう)。
5
+ * WP 以外から渡す場合は、埋め込む前にサニタイズすること
6
+ */
2
7
  heading: string;
3
8
  color?: string;
4
9
  fontSize?: string;
@@ -8,5 +13,5 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
8
13
  color: string;
9
14
  fontSize: string;
10
15
  fontWeight: string;
11
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
16
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
17
  export default _default;
@@ -1,5 +1,5 @@
1
- import { defineComponent as n, openBlock as a, createElementBlock as o, normalizeClass as l, normalizeStyle as i, createElementVNode as r, toDisplayString as d } from "vue";
2
- const g = /* @__PURE__ */ n({
1
+ import { defineComponent as t, openBlock as o, createElementBlock as a, normalizeClass as i, normalizeStyle as l, createElementVNode as r } from "vue";
2
+ const d = ["innerHTML"], h = /* @__PURE__ */ t({
3
3
  __name: "CardHeading",
4
4
  props: {
5
5
  heading: {},
@@ -8,18 +8,18 @@ const g = /* @__PURE__ */ n({
8
8
  fontWeight: { default: "bold" }
9
9
  },
10
10
  setup(e) {
11
- return (t, c) => (a(), o("div", {
12
- class: l(t.$style.heading),
13
- style: i({
11
+ return (n, c) => (o(), a("div", {
12
+ class: i(n.$style.heading),
13
+ style: l({
14
14
  "--heading-color": e.color,
15
15
  "--heading-font-size": e.fontSize,
16
16
  "--heading-font-weight": e.fontWeight
17
17
  })
18
18
  }, [
19
- r("h2", null, d(e.heading), 1)
19
+ r("h2", { innerHTML: e.heading }, null, 8, d)
20
20
  ], 6));
21
21
  }
22
22
  });
23
23
  export {
24
- g as default
24
+ h as default
25
25
  };
@@ -1,6 +1,6 @@
1
1
  import { Category } from '../../../types';
2
2
  type __VLS_Props = {
3
- categoryIds: string[];
3
+ categoryIds: (string | number)[];
4
4
  categoryData: Category[];
5
5
  icon?: {
6
6
  color?: string;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, computed as d, openBlock as s, createBlock as u } from "vue";
2
- import f from "./MetadataList.vue.js";
2
+ import g from "./MetadataList.vue.js";
3
3
  const b = /* @__PURE__ */ m({
4
4
  __name: "CategoryList",
5
5
  props: {
@@ -10,22 +10,22 @@ const b = /* @__PURE__ */ m({
10
10
  delimiter: {}
11
11
  },
12
12
  setup(e) {
13
- const c = e, i = (t, n) => {
13
+ const n = e, l = (t, c) => {
14
14
  var a;
15
- return t.length ? ((a = t.find((o) => o.id === n)) == null ? void 0 : a.name) ?? "" : "";
15
+ return t.length ? ((a = t.find((o) => String(o.id) === String(c))) == null ? void 0 : a.name) ?? "" : "";
16
16
  }, r = d(
17
- () => c.categoryIds.map(
18
- (t) => i(c.categoryData, t)
17
+ () => n.categoryIds.map(
18
+ (t) => l(n.categoryData, t)
19
19
  )
20
20
  );
21
- return (t, n) => {
22
- var a, o, l;
23
- return s(), u(f, {
21
+ return (t, c) => {
22
+ var a, o, i;
23
+ return s(), u(g, {
24
24
  metadata: r.value,
25
25
  icon: {
26
26
  name: (a = e.icon) != null && a.color ? "FolderIcon" : null,
27
27
  color: (o = e.icon) == null ? void 0 : o.color,
28
- size: (l = e.icon) == null ? void 0 : l.size
28
+ size: (i = e.icon) == null ? void 0 : i.size
29
29
  },
30
30
  label: e.label,
31
31
  delimiter: e.delimiter
@@ -20,7 +20,7 @@ declare function __VLS_template(): {
20
20
  check?(_: {}): any;
21
21
  };
22
22
  refs: {};
23
- rootEl: HTMLButtonElement;
23
+ rootEl: any;
24
24
  };
25
25
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
26
26
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -32,7 +32,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
32
32
  value: string | number;
33
33
  ariaLabel: string;
34
34
  ariaLabelledBy: string;
35
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
35
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
36
36
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
37
37
  export default _default;
38
38
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,7 +1,8 @@
1
- import { defineComponent as x, computed as f, openBlock as v, createElementBlock as S, normalizeClass as h, normalizeStyle as V, withModifiers as z, withDirectives as L, createElementVNode as C, vModelCheckbox as g, renderSlot as p, createBlock as $, createCommentVNode as w } from "vue";
2
- import G from "./Icon/CheckIcon.vue.js";
1
+ import { defineComponent as g, computed as f, openBlock as r, createElementBlock as h, Fragment as L, createElementVNode as v, mergeProps as S, withModifiers as V, normalizeClass as $, renderSlot as z, createBlock as x, createCommentVNode as C } from "vue";
2
+ import p from "./Icon/CheckIcon.vue.js";
3
3
  import { COLOR as t } from "@geckou/ui-core";
4
- const A = ["aria-checked", "aria-labelledby", "aria-label"], E = ["name", "value", "disabled"], I = /* @__PURE__ */ x({
4
+ const A = ["disabled", "data-checked", "aria-checked", "aria-labelledby", "aria-label"], G = ["name", "value", "disabled"], F = /* @__PURE__ */ g({
5
+ inheritAttrs: !1,
5
6
  __name: "CheckBox",
6
7
  props: {
7
8
  name: {},
@@ -15,12 +16,12 @@ const A = ["aria-checked", "aria-labelledby", "aria-label"], E = ["name", "value
15
16
  },
16
17
  emits: ["update:modelValue"],
17
18
  setup(e, { emit: B }) {
18
- const D = B, l = e, i = f({
19
+ const D = B, l = e, d = f({
19
20
  get: () => l.modelValue ?? !1,
20
21
  set: (a) => D("update:modelValue", a)
21
- }), d = f(() => {
22
- var o, r;
23
- const a = l.isDisabled ? (o = l.cssStyle) == null ? void 0 : o.disabled : (r = l.cssStyle) == null ? void 0 : r.default;
22
+ }), i = f(() => {
23
+ var o, s;
24
+ const a = l.isDisabled ? (o = l.cssStyle) == null ? void 0 : o.disabled : (s = l.cssStyle) == null ? void 0 : s.default;
24
25
  return {
25
26
  textColor: l.isDisabled ? t.darkGray : t.blue,
26
27
  backgroundColor: l.isDisabled ? t.lightGray : t.white,
@@ -33,44 +34,45 @@ const A = ["aria-checked", "aria-labelledby", "aria-label"], E = ["name", "value
33
34
  };
34
35
  });
35
36
  return (a, o) => {
36
- var r, s, n, u, c, b, m, y;
37
- return v(), S("button", {
38
- class: h(a.$style.check_box),
39
- style: V({
40
- "--text-color": (r = d.value) == null ? void 0 : r.textColor,
41
- "--border-color": (n = (s = d.value) == null ? void 0 : s.border) == null ? void 0 : n.color,
42
- "--border-size": (c = (u = d.value) == null ? void 0 : u.border) == null ? void 0 : c.size,
43
- "--radius-size": (m = (b = d.value) == null ? void 0 : b.border) == null ? void 0 : m.radius,
44
- "--background-color": (y = d.value) == null ? void 0 : y.backgroundColor,
45
- "--duration": e.isDisableAnimation ? "0s" : ".3s"
46
- }),
47
- type: "button",
48
- role: "checkbox",
49
- "aria-checked": i.value,
50
- "aria-labelledby": e.ariaLabelledBy,
51
- "aria-label": e.ariaLabelledBy ? void 0 : e.ariaLabel ?? e.name,
52
- onClick: o[1] || (o[1] = z((k) => e.isDisabled ? null : i.value = !i.value, ["stop"]))
53
- }, [
54
- L(C("input", {
55
- "onUpdate:modelValue": o[0] || (o[0] = (k) => i.value = k),
56
- type: "checkbox",
57
- tabindex: "-1",
37
+ var s, n, u, c, b, m, k, y;
38
+ return r(), h(L, null, [
39
+ v("button", S(a.$attrs, {
40
+ class: a.$style.check_box,
41
+ style: {
42
+ "--text-color": (s = i.value) == null ? void 0 : s.textColor,
43
+ "--border-color": (u = (n = i.value) == null ? void 0 : n.border) == null ? void 0 : u.color,
44
+ "--border-size": (b = (c = i.value) == null ? void 0 : c.border) == null ? void 0 : b.size,
45
+ "--radius-size": (k = (m = i.value) == null ? void 0 : m.border) == null ? void 0 : k.radius,
46
+ "--background-color": (y = i.value) == null ? void 0 : y.backgroundColor,
47
+ "--duration": e.isDisableAnimation ? "0s" : ".3s"
48
+ },
49
+ type: "button",
50
+ role: "checkbox",
51
+ disabled: e.isDisabled,
52
+ "data-checked": d.value,
53
+ "aria-checked": d.value,
54
+ "aria-labelledby": e.ariaLabelledBy,
55
+ "aria-label": e.ariaLabelledBy ? void 0 : e.ariaLabel ?? e.name,
56
+ onClick: o[0] || (o[0] = V((w) => e.isDisabled ? null : d.value = !d.value, ["stop"]))
57
+ }), [
58
+ v("div", {
59
+ class: $(a.$style.check_container)
60
+ }, [
61
+ z(a.$slots, "check"),
62
+ a.$slots.check ? C("", !0) : (r(), x(p, { key: 0 }))
63
+ ], 2)
64
+ ], 16, A),
65
+ d.value ? (r(), h("input", {
66
+ key: 0,
67
+ type: "hidden",
58
68
  name: e.name,
59
- value: e.value,
69
+ value: e.value ?? "on",
60
70
  disabled: e.isDisabled
61
- }, null, 8, E), [
62
- [g, i.value]
63
- ]),
64
- C("div", {
65
- class: h(a.$style.check_container)
66
- }, [
67
- p(a.$slots, "check"),
68
- a.$slots.check ? w("", !0) : (v(), $(G, { key: 0 }))
69
- ], 2)
70
- ], 14, A);
71
+ }, null, 8, G)) : C("", !0)
72
+ ], 64);
71
73
  };
72
74
  }
73
75
  });
74
76
  export {
75
- I as default
77
+ F as default
76
78
  };
@@ -1,4 +1,4 @@
1
- const c = "_check_box_1956i_15", _ = "_pop_1956i_1", o = "_check_container_1956i_53", e = {
1
+ const c = "_check_box_1flnz_15", _ = "_pop_1flnz_1", o = "_check_container_1flnz_42", n = {
2
2
  check_box: c,
3
3
  pop: _,
4
4
  check_container: o
@@ -6,6 +6,6 @@ const c = "_check_box_1956i_15", _ = "_pop_1956i_1", o = "_check_container_1956i
6
6
  export {
7
7
  c as check_box,
8
8
  o as check_container,
9
- e as default,
9
+ n as default,
10
10
  _ as pop
11
11
  };
@@ -9,6 +9,13 @@ type __VLS_Props = {
9
9
  maxDate?: string;
10
10
  size?: 'small' | 'medium';
11
11
  type?: 'date' | 'month';
12
+ /**
13
+ * 年月日それぞれの読み上げ名の土台。「の年」「の月」「の日」を後ろに繋げる。
14
+ * 可視ラベルがあるなら ariaLabelledBy でその要素を指すこと。
15
+ * どちらも無いときだけ name を使う(機械名でも無いよりはマシ)
16
+ */
17
+ ariaLabel?: string;
18
+ ariaLabelledBy?: string;
12
19
  };
13
20
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
14
21
  "update:modelValue": (newValue: string | null) => any;
@@ -17,6 +24,8 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
17
24
  }>, {
18
25
  isDisabled: boolean;
19
26
  type: "date" | "month";
27
+ ariaLabel: string;
28
+ ariaLabelledBy: string;
20
29
  size: "small" | "medium";
21
30
  formValidationManager: FormValidationManager | null;
22
31
  minDate: string;
@@ -1,9 +1,10 @@
1
- import { defineComponent as E, ref as f, reactive as C, watch as V, onBeforeUnmount as R, openBlock as b, createBlock as U, normalizeClass as r, withCtx as N, createElementVNode as m, createVNode as p, withDirectives as u, vModelDynamic as O, vModelText as v, createTextVNode as z, createElementBlock as g, createCommentVNode as h } from "vue";
2
- import { MESSAGES as I, validateDateObject as P, splitDate as S, composeDateValue as j, formatDateValue as T } from "@geckou/ui-core";
3
- import w from "./InputBox.vue.js";
4
- import A from "./Icon/CalendarIcon.vue.js";
5
- import G from "./ErrorMessage.vue.js";
6
- const F = ["type", "name", "max", "min", "required", "disabled"], H = ["aria-label", "disabled"], J = ["aria-label", "disabled"], K = { key: 0 }, L = ["aria-label", "disabled"], _ = /* @__PURE__ */ E({
1
+ import { defineComponent as I, ref as v, reactive as R, watch as D, onBeforeUnmount as N, openBlock as y, createBlock as O, normalizeClass as o, withCtx as z, createElementVNode as n, createVNode as M, withDirectives as b, vModelDynamic as P, vModelText as h, createTextVNode as S, createElementBlock as $, createCommentVNode as g, unref as B } from "vue";
2
+ import { MESSAGES as j, validateDateObject as T, splitDate as w, composeDateValue as A, formatDateValue as G } from "@geckou/ui-core";
3
+ import F from "./InputBox.vue.js";
4
+ import H from "./Icon/CalendarIcon.vue.js";
5
+ import J from "./ErrorMessage.vue.js";
6
+ import { nextUniqueId as K } from "../scripts/unique-id.js";
7
+ const Q = ["type", "name", "max", "min", "required", "disabled"], W = ["aria-label", "aria-labelledby", "disabled"], X = ["aria-label", "aria-labelledby", "disabled"], Y = { key: 0 }, Z = ["aria-label", "aria-labelledby", "disabled"], _ = ["id"], ee = ["id"], ae = ["id"], re = /* @__PURE__ */ I({
7
8
  __name: "DatePicker",
8
9
  props: {
9
10
  name: {},
@@ -14,71 +15,73 @@ const F = ["type", "name", "max", "min", "required", "disabled"], H = ["aria-lab
14
15
  minDate: { default: "" },
15
16
  maxDate: { default: "" },
16
17
  size: { default: "medium" },
17
- type: { default: "date" }
18
+ type: { default: "date" },
19
+ ariaLabel: { default: void 0 },
20
+ ariaLabelledBy: { default: void 0 }
18
21
  },
19
22
  emits: ["update:modelValue"],
20
- setup(t, { emit: M }) {
21
- const k = M, x = f(null), l = t, d = C({
23
+ setup(t, { emit: x }) {
24
+ const L = x, q = v(null), l = t, u = K("date_picker_unit"), f = (e) => l.ariaLabelledBy ? void 0 : `${l.ariaLabel ?? l.name}の${e}`, c = (e) => l.ariaLabelledBy ? `${l.ariaLabelledBy} ${u}_${e}` : void 0, d = R({
22
25
  year: "",
23
26
  month: "",
24
27
  day: ""
25
- }), s = f(""), n = f(""), o = (e) => {
28
+ }), s = v(""), r = v(""), m = (e) => {
26
29
  l.formValidationManager && l.formValidationManager.setValid(l.name, e);
27
- }, y = (e) => !e && l.isRequired ? { isValid: !1, message: I.required } : { isValid: !0, message: "" }, $ = (e) => P(
30
+ }, p = (e) => !e && l.isRequired ? { isValid: !1, message: j.required } : { isValid: !0, message: "" }, E = (e) => T(
28
31
  { year: e.year, month: e.month, day: e.day ?? "" },
29
32
  { type: l.type, isRequired: l.isRequired }
30
- ), c = (e) => {
31
- const { year: a, month: i, day: B } = S(e);
32
- d.year = a, d.month = i, d.day = l.type === "month" ? "" : B;
33
- }, q = () => j({ ...d }, l.type);
34
- V(
33
+ ), V = (e) => {
34
+ const { year: a, month: i, day: C } = w(e);
35
+ d.year = a, d.month = i, d.day = l.type === "month" ? "" : C;
36
+ }, U = () => A({ ...d }, l.type);
37
+ D(
35
38
  () => s.value,
36
39
  (e) => {
37
- c(e);
38
- const { isValid: a, message: i } = y(e);
39
- n.value = i, k("update:modelValue", e), o(a);
40
+ V(e);
41
+ const { isValid: a, message: i } = p(e);
42
+ r.value = i, L("update:modelValue", e), m(a);
40
43
  }
41
- ), V(
44
+ ), D(
42
45
  () => d,
43
46
  (e) => {
44
- const { isValid: a, message: i } = $(e);
45
- n.value = i, o(a), a && (s.value = q());
47
+ const { isValid: a, message: i } = E(e);
48
+ r.value = i, m(a), a && (s.value = U());
46
49
  },
47
50
  { deep: !0 }
48
51
  );
49
- const D = (e) => {
52
+ const k = (e) => {
50
53
  if (!e) {
51
- s.value = "", c(""), n.value = "", o(y("").isValid);
54
+ s.value = "", V(""), r.value = "", m(p("").isValid);
52
55
  return;
53
56
  }
54
- const a = T(e, l.type);
55
- !a || a === s.value || (s.value = a, c(a));
57
+ const a = G(e, l.type);
58
+ !a || a === s.value || (s.value = a, V(a));
56
59
  };
57
- return V(
60
+ return D(
58
61
  () => l.modelValue,
59
- (e) => D(e)
60
- ), D(l.modelValue), o(y(s.value).isValid), R(() => {
62
+ (e) => k(e)
63
+ ), k(l.modelValue), m(p(s.value).isValid), N(() => {
61
64
  var e;
62
65
  return (e = l.formValidationManager) == null ? void 0 : e.remove(l.name);
63
- }), (e, a) => (b(), U(w, {
66
+ }), (e, a) => (y(), O(F, {
64
67
  isDisabled: t.isDisabled,
65
- class: r([
68
+ class: o([
66
69
  e.$style.date_picker,
67
70
  e.$style[t.size],
68
71
  { [e.$style.is_disabled]: t.isDisabled }
69
72
  ]),
70
- isErrored: !!n.value
73
+ isErrored: !!r.value
71
74
  }, {
72
- default: N(() => [
73
- m("div", {
74
- class: r(e.$style.date_input)
75
+ default: z(() => [
76
+ n("div", {
77
+ class: o(e.$style.date_input)
75
78
  }, [
76
- p(A, {
77
- class: r(e.$style.icon)
79
+ M(H, {
80
+ class: o(e.$style.icon)
78
81
  }, null, 8, ["class"]),
79
- u(m("input", {
82
+ b(n("input", {
80
83
  ref_key: "datePicker",
81
- ref: x,
84
+ ref: q,
82
85
  "onUpdate:modelValue": a[0] || (a[0] = (i) => s.value = i),
83
86
  type: t.type,
84
87
  name: t.name,
@@ -86,46 +89,63 @@ const F = ["type", "name", "max", "min", "required", "disabled"], H = ["aria-lab
86
89
  min: t.minDate,
87
90
  required: t.isRequired,
88
91
  disabled: t.isDisabled
89
- }, null, 8, F), [
90
- [O, s.value]
92
+ }, null, 8, Q), [
93
+ [P, s.value]
91
94
  ])
92
95
  ], 2),
93
- u(m("input", {
96
+ b(n("input", {
94
97
  "onUpdate:modelValue": a[1] || (a[1] = (i) => d.year = i),
95
98
  placeholder: "年",
96
- "aria-label": `${t.name}の年`,
99
+ "aria-label": f("年"),
100
+ "aria-labelledby": c("年"),
97
101
  maxlength: "4",
98
102
  type: "text",
99
103
  disabled: t.isDisabled,
100
- class: r(e.$style.year)
101
- }, null, 10, H), [
102
- [v, d.year]
104
+ class: o(e.$style.year)
105
+ }, null, 10, W), [
106
+ [h, d.year]
103
107
  ]),
104
- a[4] || (a[4] = z("/ ", -1)),
105
- u(m("input", {
108
+ a[4] || (a[4] = S("/ ", -1)),
109
+ b(n("input", {
106
110
  "onUpdate:modelValue": a[2] || (a[2] = (i) => d.month = i),
107
111
  placeholder: "月",
108
- "aria-label": `${t.name}の月`,
112
+ "aria-label": f("月"),
113
+ "aria-labelledby": c("月"),
109
114
  maxlength: "2",
110
115
  type: "text",
111
116
  disabled: t.isDisabled
112
- }, null, 8, J), [
113
- [v, d.month]
117
+ }, null, 8, X), [
118
+ [h, d.month]
114
119
  ]),
115
- t.type === "date" ? (b(), g("span", K, "/")) : h("", !0),
116
- t.type === "date" ? u((b(), g("input", {
120
+ t.type === "date" ? (y(), $("span", Y, "/")) : g("", !0),
121
+ t.type === "date" ? b((y(), $("input", {
117
122
  key: 1,
118
123
  "onUpdate:modelValue": a[3] || (a[3] = (i) => d.day = i),
119
124
  placeholder: "日",
120
- "aria-label": `${t.name}の日`,
125
+ "aria-label": f("日"),
126
+ "aria-labelledby": c("日"),
121
127
  maxlength: "2",
122
128
  type: "text",
123
129
  disabled: t.isDisabled
124
- }, null, 8, L)), [
125
- [v, d.day]
126
- ]) : h("", !0),
127
- p(G, {
128
- errorMessages: n.value ? [n.value] : []
130
+ }, null, 8, Z)), [
131
+ [h, d.day]
132
+ ]) : g("", !0),
133
+ t.ariaLabelledBy ? (y(), $("span", {
134
+ key: 2,
135
+ class: o(e.$style.unit_labels)
136
+ }, [
137
+ n("span", {
138
+ id: `${B(u)}_年`
139
+ }, "の年", 8, _),
140
+ n("span", {
141
+ id: `${B(u)}_月`
142
+ }, "の月", 8, ee),
143
+ n("span", {
144
+ id: `${B(u)}_日`
145
+ }, "の日", 8, ae)
146
+ ], 2)) : g("", !0),
147
+ M(J, {
148
+ errorMessages: r.value ? [r.value] : []
129
149
  }, null, 8, ["errorMessages"])
130
150
  ]),
131
151
  _: 1
@@ -133,5 +153,5 @@ const F = ["type", "name", "max", "min", "required", "disabled"], H = ["aria-lab
133
153
  }
134
154
  });
135
155
  export {
136
- _ as default
156
+ re as default
137
157
  };
@@ -1,15 +1,17 @@
1
- const _ = "_icon_13vkb_1", t = "_date_input_13vkb_14", e = "_date_picker_13vkb_34", a = "_year_13vkb_45", c = "_small_13vkb_51", n = {
2
- icon: _,
3
- date_input: t,
4
- date_picker: e,
5
- year: a,
6
- small: c
1
+ const _ = "_unit_labels_1r4fv_1", t = "_icon_1r4fv_13", e = "_date_input_1r4fv_26", a = "_date_picker_1r4fv_46", n = "_year_1r4fv_57", s = "_small_1r4fv_63", l = {
2
+ unit_labels: _,
3
+ icon: t,
4
+ date_input: e,
5
+ date_picker: a,
6
+ year: n,
7
+ small: s
7
8
  };
8
9
  export {
9
- t as date_input,
10
- e as date_picker,
11
- n as default,
12
- _ as icon,
13
- c as small,
14
- a as year
10
+ e as date_input,
11
+ a as date_picker,
12
+ l as default,
13
+ t as icon,
14
+ s as small,
15
+ _ as unit_labels,
16
+ n as year
15
17
  };
@@ -8,6 +8,13 @@ type __VLS_Props = {
8
8
  /** 選べる年の下限・上限。既定は「今年 -100 〜 今年 -14」(生年月日向け) */
9
9
  minYear?: number;
10
10
  maxYear?: number;
11
+ /**
12
+ * 年月日それぞれの読み上げ名の土台。「の年」「の月」「の日」を後ろに繋げる。
13
+ * 可視ラベルがあるなら ariaLabelledBy でその要素を指すこと。
14
+ * どちらも無いときだけ name を使う(機械名でも無いよりはマシ)
15
+ */
16
+ ariaLabel?: string;
17
+ ariaLabelledBy?: string;
11
18
  };
12
19
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
13
20
  "update:modelValue": (newValue: string) => any;
@@ -15,6 +22,8 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
15
22
  "onUpdate:modelValue"?: ((newValue: string) => any) | undefined;
16
23
  }>, {
17
24
  type: "date" | "month";
25
+ ariaLabel: string;
26
+ ariaLabelledBy: string;
18
27
  formValidationManager: FormValidationManager | null;
19
28
  minYear: number;
20
29
  maxYear: number;