@geckou/ui-vue 0.12.0 → 0.14.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,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
  }
@@ -1,8 +1,8 @@
1
- import { defineComponent as g, ref as C, watch as k, nextTick as E, computed as B, onMounted as M, onBeforeUnmount as I, openBlock as d, createElementBlock as c, normalizeClass as t, withModifiers as z, createElementVNode as u, unref as w, renderSlot as m, createCommentVNode as p, createVNode as N } from "vue";
2
- import { createScrollLock as T, createModalLayer as q, handleTabKey as D } from "@geckou/ui-core";
3
- import K from "./Icon/CloseIcon.vue.js";
4
- import { nextUniqueId as U } from "../scripts/unique-id.js";
5
- const V = ["aria-hidden", "inert"], P = ["aria-labelledby", "aria-label"], j = ["id"], O = /* @__PURE__ */ g({
1
+ import { defineComponent as E, ref as M, watch as $, nextTick as I, computed as O, onMounted as T, onBeforeUnmount as z, openBlock as c, createElementBlock as u, normalizeClass as t, withModifiers as D, createElementVNode as m, unref as b, renderSlot as f, createCommentVNode as v, createVNode as N } from "vue";
2
+ import { createScrollLock as P, createModalLayer as q, handleTabKey as K } from "@geckou/ui-core";
3
+ import U from "./Icon/CloseIcon.vue.js";
4
+ import { nextUniqueId as V } from "../scripts/unique-id.js";
5
+ const j = ["aria-hidden", "inert"], A = ["aria-labelledby", "aria-label"], G = ["id"], W = /* @__PURE__ */ E({
6
6
  __name: "ModalBox",
7
7
  props: {
8
8
  isShown: { type: Boolean },
@@ -10,85 +10,95 @@ const V = ["aria-hidden", "inert"], P = ["aria-labelledby", "aria-label"], j = [
10
10
  ariaLabel: {}
11
11
  },
12
12
  emits: ["close"],
13
- setup(n, { emit: v }) {
14
- const o = n, f = U("modal_header"), a = C(null), S = v, h = T(), y = (e) => h.toggle(e), s = () => S("close"), r = q(), $ = (e) => r.toggle(e, a.value);
15
- k(
13
+ setup(n, { emit: S }) {
14
+ const o = n, h = V("modal_header"), l = M(null), g = S, y = P(), k = (e) => y.toggle(e), s = () => g("close"), r = q(), p = (e) => r.toggle(e, l.value);
15
+ $(
16
16
  () => o.isShown,
17
17
  (e) => {
18
- y(e), $(e);
18
+ k(e), p(e);
19
19
  }
20
20
  );
21
- let l = null;
22
- k(
21
+ let a = null;
22
+ $(
23
23
  () => o.isShown,
24
24
  async (e) => {
25
- var i;
25
+ var d;
26
26
  if (!e) {
27
- l == null || l.focus(), l = null;
27
+ a == null || a.focus(), a = null;
28
28
  return;
29
29
  }
30
- l = typeof document > "u" ? null : document.activeElement, await E(), (i = a.value) == null || i.focus();
31
- }
30
+ a = typeof document > "u" ? null : document.activeElement, await I(), (d = l.value) == null || d.focus();
31
+ },
32
+ // マウント時点で isShown が true のときも実行する。immediate が無かったため、
33
+ // 最初から開いた状態で描画するとフォーカスが body に残っていた(React 版と乖離)
34
+ { immediate: !0 }
32
35
  );
33
- const L = B(() => !o.isShown || void 0), b = (e) => {
36
+ let i = !1;
37
+ const L = (e) => {
38
+ i = e.target === e.currentTarget;
39
+ }, C = () => {
40
+ const e = i;
41
+ i = !1, e && s();
42
+ }, B = O(() => !o.isShown || void 0), w = (e) => {
34
43
  if (o.isShown && r.isTopmost() && !e.defaultPrevented) {
35
44
  if (e.key === "Escape") {
36
45
  e.preventDefault(), s();
37
46
  return;
38
47
  }
39
- D(a.value, e, document.activeElement);
48
+ K(l.value, e, document.activeElement);
40
49
  }
41
50
  };
42
- return M(() => {
43
- y(o.isShown), $(o.isShown), document.addEventListener("keydown", b);
44
- }), I(() => {
45
- h.release(), r.release(), document.removeEventListener("keydown", b);
46
- }), (e, i) => (d(), c("div", {
51
+ return T(() => {
52
+ k(o.isShown), p(o.isShown), document.addEventListener("keydown", w);
53
+ }), z(() => {
54
+ y.release(), r.release(), document.removeEventListener("keydown", w);
55
+ }), (e, d) => (c(), u("div", {
47
56
  class: t([e.$style.overlay, { [e.$style.display]: n.isShown }]),
48
57
  "aria-hidden": !n.isShown,
49
- inert: L.value,
50
- onClick: z(s, ["self"])
58
+ inert: B.value,
59
+ onPointerdown: L,
60
+ onClick: D(C, ["self"])
51
61
  }, [
52
- u("div", {
62
+ m("div", {
53
63
  ref_key: "dialog",
54
- ref: a,
64
+ ref: l,
55
65
  role: "dialog",
56
66
  "aria-modal": "true",
57
- "aria-labelledby": e.$slots.header ? w(f) : void 0,
67
+ "aria-labelledby": e.$slots.header ? b(h) : void 0,
58
68
  "aria-label": e.$slots.header ? void 0 : n.ariaLabel ?? "ダイアログ",
59
69
  tabindex: -1,
60
70
  class: t([e.$style.container, e.$style[n.size ?? "medium"]])
61
71
  }, [
62
- e.$slots.header ? (d(), c("header", {
72
+ e.$slots.header ? (c(), u("header", {
63
73
  key: 0,
64
- id: w(f),
74
+ id: b(h),
65
75
  class: t(e.$style.header)
66
76
  }, [
67
- m(e.$slots, "header")
68
- ], 10, j)) : p("", !0),
69
- u("div", {
77
+ f(e.$slots, "header")
78
+ ], 10, G)) : v("", !0),
79
+ m("div", {
70
80
  class: t(e.$style.contents)
71
81
  }, [
72
- m(e.$slots, "default")
82
+ f(e.$slots, "default")
73
83
  ], 2),
74
- e.$slots.footer ? (d(), c("footer", {
84
+ e.$slots.footer ? (c(), u("footer", {
75
85
  key: 1,
76
86
  class: t(e.$style.footer)
77
87
  }, [
78
- m(e.$slots, "footer")
79
- ], 2)) : p("", !0),
80
- u("button", {
88
+ f(e.$slots, "footer")
89
+ ], 2)) : v("", !0),
90
+ m("button", {
81
91
  type: "button",
82
92
  "aria-label": "閉じる",
83
93
  class: t(e.$style.close_button),
84
94
  onClick: s
85
95
  }, [
86
- N(K)
96
+ N(U)
87
97
  ], 2)
88
- ], 10, P)
89
- ], 10, V));
98
+ ], 10, A)
99
+ ], 42, j));
90
100
  }
91
101
  });
92
102
  export {
93
- O as default
103
+ W as default
94
104
  };
@@ -1,36 +1,36 @@
1
- import { defineComponent as u, ref as r, onBeforeUnmount as a, openBlock as i, createBlock as p, Teleport as f, createElementVNode as m, normalizeClass as c, renderSlot as d } from "vue";
2
- const h = /* @__PURE__ */ u({
1
+ import { defineComponent as u, ref as r, onBeforeUnmount as a, openBlock as i, createBlock as p, Teleport as d, createElementVNode as f, normalizeClass as m, renderSlot as c, createCommentVNode as y } from "vue";
2
+ const v = /* @__PURE__ */ u({
3
3
  __name: "PopupBox",
4
4
  props: {
5
5
  position: { default: () => ({ x: "right", y: "top" }) }
6
6
  },
7
- setup(t, { expose: s }) {
8
- const l = r(!1);
7
+ setup(l, { expose: n }) {
8
+ const t = r(!1);
9
9
  let e = null;
10
- const n = () => {
11
- l.value = !0, e !== null && clearTimeout(e), e = setTimeout(() => {
12
- l.value = !1, e = null;
10
+ const s = () => {
11
+ t.value = !0, e !== null && clearTimeout(e), e = setTimeout(() => {
12
+ t.value = !1, e = null;
13
13
  }, 3e3);
14
14
  };
15
15
  return a(() => {
16
16
  e !== null && clearTimeout(e);
17
- }), s({
18
- showPopup: n
19
- }), (o, y) => (i(), p(f, { to: "body" }, [
20
- m("div", {
17
+ }), n({
18
+ showPopup: s
19
+ }), (o, $) => (i(), p(d, { to: "body" }, [
20
+ f("div", {
21
21
  role: "status",
22
- class: c([
22
+ class: m([
23
23
  o.$style.popup,
24
- o.$style[`x-${t.position.x}`],
25
- o.$style[`y-${t.position.y}`],
26
- { [o.$style.show]: l.value }
24
+ o.$style[`x-${l.position.x}`],
25
+ o.$style[`y-${l.position.y}`],
26
+ { [o.$style.show]: t.value }
27
27
  ])
28
28
  }, [
29
- d(o.$slots, "default")
29
+ t.value ? c(o.$slots, "default", {}, void 0, void 0, 0) : y("", !0)
30
30
  ], 2)
31
31
  ]));
32
32
  }
33
33
  });
34
34
  export {
35
- h as default
35
+ v as default
36
36
  };
@@ -8,6 +8,12 @@ type __VLS_Props = {
8
8
  isRequired?: boolean;
9
9
  cssStyle?: RadioButtonStyleForEachStatus;
10
10
  isDisableAnimation?: boolean;
11
+ /**
12
+ * ラジオグループ自体のアクセシブル名。
13
+ * 可視ラベル(見出し等)があるなら ariaLabelledBy でその要素を指すこと
14
+ */
15
+ ariaLabel?: string;
16
+ ariaLabelledBy?: string;
11
17
  };
12
18
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
13
19
  "update:modelValue": (newValue: SelectValue) => any;
@@ -16,5 +22,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
16
22
  }>, {
17
23
  cssStyle: RadioButtonStyleForEachStatus;
18
24
  name: string;
25
+ ariaLabel: string;
26
+ ariaLabelledBy: string;
19
27
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
20
28
  export default _default;
@@ -1,8 +1,8 @@
1
- import { defineComponent as C, ref as B, computed as y, watch as E, openBlock as u, createElementBlock as n, normalizeClass as f, Fragment as M, renderList as R, normalizeStyle as z, withDirectives as G, createElementVNode as g, unref as w, vModelRadio as x, toDisplayString as A, createVNode as N } from "vue";
2
- import { COLOR as r, isEmptyValue as k, MESSAGES as L } from "@geckou/ui-core";
3
- import { nextUniqueId as O } from "../scripts/unique-id.js";
4
- import U from "./ErrorMessage.vue.js";
5
- const $ = ["name", "value", "disabled", "required", "checked"], J = /* @__PURE__ */ C({
1
+ import { defineComponent as E, ref as M, computed as k, watch as x, openBlock as u, createElementBlock as n, normalizeClass as V, unref as c, Fragment as z, renderList as G, normalizeStyle as w, withDirectives as A, createElementVNode as q, vModelRadio as N, toDisplayString as I, createVNode as O } from "vue";
2
+ import { COLOR as i, isEmptyValue as D, MESSAGES as U } from "@geckou/ui-core";
3
+ import { nextUniqueId as S } from "../scripts/unique-id.js";
4
+ import $ from "./ErrorMessage.vue.js";
5
+ const F = ["aria-label", "aria-labelledby", "aria-required", "aria-describedby"], j = ["name", "value", "disabled", "required", "checked"], Q = /* @__PURE__ */ E({
6
6
  __name: "RadioButtons",
7
7
  props: {
8
8
  modelValue: {},
@@ -11,65 +11,76 @@ const $ = ["name", "value", "disabled", "required", "checked"], J = /* @__PURE__
11
11
  isDisabled: { type: Boolean },
12
12
  isRequired: { type: Boolean },
13
13
  cssStyle: { default: void 0 },
14
- isDisableAnimation: { type: Boolean }
14
+ isDisableAnimation: { type: Boolean },
15
+ ariaLabel: { default: void 0 },
16
+ ariaLabelledBy: { default: void 0 }
15
17
  },
16
18
  emits: ["update:modelValue"],
17
- setup(s, { emit: V }) {
18
- const D = V, e = s, S = e.name ?? O("radio_group"), i = B([]), o = y({
19
+ setup(a, { emit: h }) {
20
+ const B = h, e = a, C = e.name ?? S("radio_group"), b = S("radio_group_error"), t = M([]), d = k({
19
21
  get: () => e.modelValue ?? "",
20
- set: (a) => D("update:modelValue", a)
21
- }), d = y(() => {
22
- var t, l;
23
- const a = e.isDisabled ? (t = e.cssStyle) == null ? void 0 : t.disabled : (l = e.cssStyle) == null ? void 0 : l.default;
22
+ set: (r) => B("update:modelValue", r)
23
+ }), s = k(() => {
24
+ var o, l;
25
+ const r = e.isDisabled ? (o = e.cssStyle) == null ? void 0 : o.disabled : (l = e.cssStyle) == null ? void 0 : l.default;
24
26
  return {
25
- textColor: e.isDisabled ? r.darkGray : r.black,
26
- backgroundColor: e.isDisabled ? r.lightGray : r.white,
27
+ textColor: e.isDisabled ? i.darkGray : i.black,
28
+ backgroundColor: e.isDisabled ? i.lightGray : i.white,
27
29
  border: {
28
- color: e.isDisabled ? r.darkGray : r.blue,
30
+ color: e.isDisabled ? i.darkGray : i.blue,
29
31
  size: "1px"
30
32
  },
31
- ...a ?? {}
33
+ ...r ?? {}
32
34
  };
33
- }), h = () => {
34
- i.value = [], k(o.value) && e.isRequired && i.value.push(L.required);
35
+ }), L = () => {
36
+ t.value = [], D(d.value) && e.isRequired && t.value.push(U.required);
35
37
  };
36
- return E(
37
- () => o.value,
38
- () => h(),
39
- { immediate: !k(e.modelValue) }
40
- ), (a, t) => (u(), n("div", {
41
- class: f(a.$style.radios)
38
+ return x(
39
+ () => d.value,
40
+ () => L(),
41
+ { immediate: !D(e.modelValue) }
42
+ ), (r, o) => (u(), n("div", {
43
+ class: V(r.$style.radios),
44
+ role: "radiogroup",
45
+ "aria-label": a.ariaLabelledBy ? void 0 : a.ariaLabel,
46
+ "aria-labelledby": a.ariaLabelledBy,
47
+ "aria-required": a.isRequired || void 0,
48
+ "aria-describedby": t.value.length ? c(b) : void 0
42
49
  }, [
43
- (u(!0), n(M, null, R(s.options, (l) => {
44
- var c, m, b, v, p;
50
+ (u(!0), n(z, null, G(a.options, (l) => {
51
+ var m, y, f, v, g, p;
45
52
  return u(), n("label", {
46
53
  key: l.value,
47
- class: f(a.$style.radio),
48
- style: z({
49
- "--border-color": (m = (c = d.value) == null ? void 0 : c.border) == null ? void 0 : m.color,
50
- "--border-size": (v = (b = d.value) == null ? void 0 : b.border) == null ? void 0 : v.size,
51
- "--background-color": (p = d.value) == null ? void 0 : p.backgroundColor,
52
- "--duration": s.isDisableAnimation ? "0s" : ".3s"
54
+ class: V(r.$style.radio),
55
+ style: w({
56
+ "--text-color": (m = s.value) == null ? void 0 : m.textColor,
57
+ "--border-color": (f = (y = s.value) == null ? void 0 : y.border) == null ? void 0 : f.color,
58
+ "--border-size": (g = (v = s.value) == null ? void 0 : v.border) == null ? void 0 : g.size,
59
+ "--background-color": (p = s.value) == null ? void 0 : p.backgroundColor,
60
+ "--duration": a.isDisableAnimation ? "0s" : ".3s"
53
61
  })
54
62
  }, [
55
- G(g("input", {
56
- "onUpdate:modelValue": t[0] || (t[0] = (q) => o.value = q),
63
+ A(q("input", {
64
+ "onUpdate:modelValue": o[0] || (o[0] = (R) => d.value = R),
57
65
  type: "radio",
58
- name: w(S),
66
+ name: c(C),
59
67
  value: l.value,
60
- disabled: s.isDisabled,
61
- required: s.isRequired,
62
- checked: l.value === o.value
63
- }, null, 8, $), [
64
- [x, o.value]
68
+ disabled: a.isDisabled,
69
+ required: a.isRequired,
70
+ checked: l.value === d.value
71
+ }, null, 8, j), [
72
+ [N, d.value]
65
73
  ]),
66
- g("span", null, A(l.label), 1)
74
+ q("span", null, I(l.label), 1)
67
75
  ], 6);
68
76
  }), 128)),
69
- N(U, { errorMessages: i.value }, null, 8, ["errorMessages"])
70
- ], 2));
77
+ O($, {
78
+ id: c(b),
79
+ errorMessages: t.value
80
+ }, null, 8, ["id", "errorMessages"])
81
+ ], 10, F));
71
82
  }
72
83
  });
73
84
  export {
74
- J as default
85
+ Q as default
75
86
  };
@@ -1,7 +1,8 @@
1
- import { defineComponent as h, ref as s, onMounted as k, onUpdated as C, watch as $, openBlock as p, createElementBlock as b, normalizeClass as o, normalizeStyle as f, createElementVNode as l, withModifiers as B, renderSlot as y, createBlock as D, createCommentVNode as O } from "vue";
2
- import w from "./Icon/KeyboardArrowDownIcon.vue.js";
3
- import { useClickOutside as H } from "../scripts/use-click-outside.js";
4
- const S = ["disabled", "aria-expanded"], z = ["inert"], U = /* @__PURE__ */ h({
1
+ import { defineComponent as k, ref as l, onMounted as C, onBeforeUnmount as $, watch as B, openBlock as v, createElementBlock as O, normalizeClass as t, normalizeStyle as y, createElementVNode as i, withModifiers as w, renderSlot as m, createBlock as D, createCommentVNode as H } from "vue";
2
+ import z from "./Icon/KeyboardArrowDownIcon.vue.js";
3
+ import { useClickOutside as I } from "../scripts/use-click-outside.js";
4
+ import { nextUniqueId as S } from "../scripts/unique-id.js";
5
+ const U = ["disabled", "aria-expanded"], V = ["inert"], R = /* @__PURE__ */ k({
5
6
  __name: "SlideDownUi",
6
7
  props: {
7
8
  isOpened: { type: [Boolean, null], default: null },
@@ -10,57 +11,65 @@ const S = ["disabled", "aria-expanded"], z = ["inert"], U = /* @__PURE__ */ h({
10
11
  isDisableClickOutside: { type: Boolean },
11
12
  duration: { default: 0.3 }
12
13
  },
13
- setup(i, { expose: v }) {
14
- const n = i, t = s(n.isOpened || !1), a = s(null), r = s(null), d = s(0), m = () => t.value = !t.value, c = () => t.value = !1, g = () => {
15
- n.isDisableClickOutside || c();
16
- }, u = () => {
14
+ setup(a, { expose: g }) {
15
+ const s = a, n = l(s.isOpened || !1), d = l(null), r = l(null), c = l(0), u = S("slide_down") + "_panel", b = () => n.value = !n.value, p = () => n.value = !1, h = () => {
16
+ s.isDisableClickOutside || p();
17
+ }, f = () => {
17
18
  const e = r.value;
18
- e && (d.value = e.clientHeight);
19
+ e && (c.value = e.clientHeight);
19
20
  };
20
- return H(a, () => g()), k(() => u()), C(() => u()), $(
21
- () => n.isOpened,
21
+ I(d, () => h());
22
+ let o = null;
23
+ return C(() => {
24
+ f();
25
+ const e = r.value;
26
+ !e || typeof ResizeObserver > "u" || (o = new ResizeObserver(f), o.observe(e));
27
+ }), $(() => o == null ? void 0 : o.disconnect()), B(
28
+ () => s.isOpened,
22
29
  (e) => {
23
- typeof e == "boolean" && (t.value = e);
30
+ typeof e == "boolean" && (n.value = e);
24
31
  }
25
- ), v({ isOpenedContents: t, close: c }), (e, A) => (p(), b("div", {
32
+ ), g({ isOpenedContents: n, close: p }), (e, _) => (v(), O("div", {
26
33
  ref_key: "root",
27
- ref: a,
28
- class: o({ [e.$style.opened]: t.value }),
29
- style: f({ "--accordion-toggle-duration": `${n.duration}s` })
34
+ ref: d,
35
+ class: t({ [e.$style.opened]: n.value }),
36
+ style: y({ "--accordion-toggle-duration": `${s.duration}s` })
30
37
  }, [
31
- l("button", {
32
- class: o(e.$style.trigger),
33
- disabled: i.isDisabled,
34
- "aria-expanded": t.value,
38
+ i("button", {
39
+ class: t(e.$style.trigger),
40
+ disabled: a.isDisabled,
41
+ "aria-expanded": n.value,
42
+ "aria-controls": u,
35
43
  type: "button",
36
- onClick: B(m, ["prevent"])
44
+ onClick: w(b, ["prevent"])
37
45
  }, [
38
- l("div", {
39
- class: o(e.$style.trigger_content)
46
+ i("div", {
47
+ class: t(e.$style.trigger_content)
40
48
  }, [
41
- y(e.$slots, "trigger")
49
+ m(e.$slots, "trigger")
42
50
  ], 2),
43
- i.isHiddenArrow ? O("", !0) : (p(), D(w, {
51
+ a.isHiddenArrow ? H("", !0) : (v(), D(z, {
44
52
  key: 0,
45
- class: o(e.$style.icon)
53
+ class: t(e.$style.icon)
46
54
  }, null, 8, ["class"]))
47
- ], 10, S),
48
- l("div", {
49
- style: f({ height: t.value ? `${d.value}px` : 0 }),
50
- class: o(e.$style.contents),
51
- inert: !t.value || void 0
55
+ ], 10, U),
56
+ i("div", {
57
+ id: u,
58
+ style: y({ height: n.value ? `${c.value}px` : 0 }),
59
+ class: t(e.$style.contents),
60
+ inert: !n.value || void 0
52
61
  }, [
53
- l("div", {
62
+ i("div", {
54
63
  ref_key: "contents",
55
64
  ref: r,
56
- class: o(e.$style.container)
65
+ class: t(e.$style.container)
57
66
  }, [
58
- y(e.$slots, "default")
67
+ m(e.$slots, "default")
59
68
  ], 2)
60
- ], 14, z)
69
+ ], 14, V)
61
70
  ], 6));
62
71
  }
63
72
  });
64
73
  export {
65
- U as default
74
+ R as default
66
75
  };