@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.
- package/README.md +29 -0
- package/dist/components/BasicButton.vue2.js +51 -43
- package/dist/components/BasicButton.vue3.js +5 -5
- package/dist/components/CheckBoxes.vue.d.ts +8 -0
- package/dist/components/CheckBoxes.vue2.js +56 -45
- package/dist/components/CheckButton.vue.d.ts +9 -0
- package/dist/components/CheckButton.vue2.js +32 -28
- package/dist/components/DropdownUi.vue.d.ts +2 -0
- package/dist/components/DropdownUi.vue2.js +46 -30
- package/dist/components/ErrorMessage.vue.d.ts +2 -0
- package/dist/components/ErrorMessage.vue2.js +15 -13
- package/dist/components/LoadingSpinner.vue.d.ts +1 -1
- package/dist/components/LoadingSpinner.vue.js +5 -3
- package/dist/components/ModalBox.vue2.js +51 -41
- package/dist/components/PopupBox.vue2.js +17 -17
- package/dist/components/RadioButtons.vue.d.ts +8 -0
- package/dist/components/RadioButtons.vue2.js +55 -44
- package/dist/components/SlideDownUi.vue2.js +45 -36
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { COLOR as
|
|
3
|
-
const
|
|
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:
|
|
11
|
-
return (
|
|
11
|
+
const { red: l } = h;
|
|
12
|
+
return (n, M) => {
|
|
12
13
|
var s, t;
|
|
13
|
-
return
|
|
14
|
+
return d((r(), o("div", {
|
|
15
|
+
id: e.id,
|
|
14
16
|
role: "alert",
|
|
15
|
-
class: m(
|
|
16
|
-
style:
|
|
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) ||
|
|
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, (
|
|
22
|
-
],
|
|
23
|
-
[
|
|
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
|
-
|
|
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, {},
|
|
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
|
|
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
|
|
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
|
|
2
|
-
import { createScrollLock as
|
|
3
|
-
import
|
|
4
|
-
import { nextUniqueId as
|
|
5
|
-
const
|
|
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:
|
|
14
|
-
const o = n,
|
|
15
|
-
|
|
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
|
-
|
|
18
|
+
k(e), p(e);
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
|
-
let
|
|
22
|
-
|
|
21
|
+
let a = null;
|
|
22
|
+
$(
|
|
23
23
|
() => o.isShown,
|
|
24
24
|
async (e) => {
|
|
25
|
-
var
|
|
25
|
+
var d;
|
|
26
26
|
if (!e) {
|
|
27
|
-
|
|
27
|
+
a == null || a.focus(), a = null;
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
|
|
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
|
-
|
|
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
|
-
|
|
48
|
+
K(l.value, e, document.activeElement);
|
|
40
49
|
}
|
|
41
50
|
};
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
}), (e,
|
|
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:
|
|
50
|
-
|
|
58
|
+
inert: B.value,
|
|
59
|
+
onPointerdown: L,
|
|
60
|
+
onClick: D(C, ["self"])
|
|
51
61
|
}, [
|
|
52
|
-
|
|
62
|
+
m("div", {
|
|
53
63
|
ref_key: "dialog",
|
|
54
|
-
ref:
|
|
64
|
+
ref: l,
|
|
55
65
|
role: "dialog",
|
|
56
66
|
"aria-modal": "true",
|
|
57
|
-
"aria-labelledby": e.$slots.header ?
|
|
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 ? (
|
|
72
|
+
e.$slots.header ? (c(), u("header", {
|
|
63
73
|
key: 0,
|
|
64
|
-
id:
|
|
74
|
+
id: b(h),
|
|
65
75
|
class: t(e.$style.header)
|
|
66
76
|
}, [
|
|
67
|
-
|
|
68
|
-
], 10,
|
|
69
|
-
|
|
77
|
+
f(e.$slots, "header")
|
|
78
|
+
], 10, G)) : v("", !0),
|
|
79
|
+
m("div", {
|
|
70
80
|
class: t(e.$style.contents)
|
|
71
81
|
}, [
|
|
72
|
-
|
|
82
|
+
f(e.$slots, "default")
|
|
73
83
|
], 2),
|
|
74
|
-
e.$slots.footer ? (
|
|
84
|
+
e.$slots.footer ? (c(), u("footer", {
|
|
75
85
|
key: 1,
|
|
76
86
|
class: t(e.$style.footer)
|
|
77
87
|
}, [
|
|
78
|
-
|
|
79
|
-
], 2)) :
|
|
80
|
-
|
|
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(
|
|
96
|
+
N(U)
|
|
87
97
|
], 2)
|
|
88
|
-
], 10,
|
|
89
|
-
],
|
|
98
|
+
], 10, A)
|
|
99
|
+
], 42, j));
|
|
90
100
|
}
|
|
91
101
|
});
|
|
92
102
|
export {
|
|
93
|
-
|
|
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
|
|
2
|
-
const
|
|
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(
|
|
8
|
-
const
|
|
7
|
+
setup(l, { expose: n }) {
|
|
8
|
+
const t = r(!1);
|
|
9
9
|
let e = null;
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
}),
|
|
18
|
-
showPopup:
|
|
19
|
-
}), (o,
|
|
20
|
-
|
|
17
|
+
}), n({
|
|
18
|
+
showPopup: s
|
|
19
|
+
}), (o, $) => (i(), p(d, { to: "body" }, [
|
|
20
|
+
f("div", {
|
|
21
21
|
role: "status",
|
|
22
|
-
class:
|
|
22
|
+
class: m([
|
|
23
23
|
o.$style.popup,
|
|
24
|
-
o.$style[`x-${
|
|
25
|
-
o.$style[`y-${
|
|
26
|
-
{ [o.$style.show]:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import { COLOR as
|
|
3
|
-
import { nextUniqueId as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
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(
|
|
18
|
-
const
|
|
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: (
|
|
21
|
-
}),
|
|
22
|
-
var
|
|
23
|
-
const
|
|
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 ?
|
|
26
|
-
backgroundColor: e.isDisabled ?
|
|
27
|
+
textColor: e.isDisabled ? i.darkGray : i.black,
|
|
28
|
+
backgroundColor: e.isDisabled ? i.lightGray : i.white,
|
|
27
29
|
border: {
|
|
28
|
-
color: e.isDisabled ?
|
|
30
|
+
color: e.isDisabled ? i.darkGray : i.blue,
|
|
29
31
|
size: "1px"
|
|
30
32
|
},
|
|
31
|
-
...
|
|
33
|
+
...r ?? {}
|
|
32
34
|
};
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
+
}), L = () => {
|
|
36
|
+
t.value = [], D(d.value) && e.isRequired && t.value.push(U.required);
|
|
35
37
|
};
|
|
36
|
-
return
|
|
37
|
-
() =>
|
|
38
|
-
() =>
|
|
39
|
-
{ immediate: !
|
|
40
|
-
), (
|
|
41
|
-
class:
|
|
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(
|
|
44
|
-
var
|
|
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:
|
|
48
|
-
style:
|
|
49
|
-
"--
|
|
50
|
-
"--border-
|
|
51
|
-
"--
|
|
52
|
-
"--
|
|
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
|
-
|
|
56
|
-
"onUpdate:modelValue":
|
|
63
|
+
A(q("input", {
|
|
64
|
+
"onUpdate:modelValue": o[0] || (o[0] = (R) => d.value = R),
|
|
57
65
|
type: "radio",
|
|
58
|
-
name:
|
|
66
|
+
name: c(C),
|
|
59
67
|
value: l.value,
|
|
60
|
-
disabled:
|
|
61
|
-
required:
|
|
62
|
-
checked: l.value ===
|
|
63
|
-
}, null, 8,
|
|
64
|
-
[
|
|
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
|
-
|
|
74
|
+
q("span", null, I(l.label), 1)
|
|
67
75
|
], 6);
|
|
68
76
|
}), 128)),
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
85
|
+
Q as default
|
|
75
86
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useClickOutside as
|
|
4
|
-
|
|
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(
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
},
|
|
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 && (
|
|
19
|
+
e && (c.value = e.clientHeight);
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
-
|
|
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" && (
|
|
30
|
+
typeof e == "boolean" && (n.value = e);
|
|
24
31
|
}
|
|
25
|
-
),
|
|
32
|
+
), g({ isOpenedContents: n, close: p }), (e, _) => (v(), O("div", {
|
|
26
33
|
ref_key: "root",
|
|
27
|
-
ref:
|
|
28
|
-
class:
|
|
29
|
-
style:
|
|
34
|
+
ref: d,
|
|
35
|
+
class: t({ [e.$style.opened]: n.value }),
|
|
36
|
+
style: y({ "--accordion-toggle-duration": `${s.duration}s` })
|
|
30
37
|
}, [
|
|
31
|
-
|
|
32
|
-
class:
|
|
33
|
-
disabled:
|
|
34
|
-
"aria-expanded":
|
|
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:
|
|
44
|
+
onClick: w(b, ["prevent"])
|
|
37
45
|
}, [
|
|
38
|
-
|
|
39
|
-
class:
|
|
46
|
+
i("div", {
|
|
47
|
+
class: t(e.$style.trigger_content)
|
|
40
48
|
}, [
|
|
41
|
-
|
|
49
|
+
m(e.$slots, "trigger")
|
|
42
50
|
], 2),
|
|
43
|
-
|
|
51
|
+
a.isHiddenArrow ? H("", !0) : (v(), D(z, {
|
|
44
52
|
key: 0,
|
|
45
|
-
class:
|
|
53
|
+
class: t(e.$style.icon)
|
|
46
54
|
}, null, 8, ["class"]))
|
|
47
|
-
], 10,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
62
|
+
i("div", {
|
|
54
63
|
ref_key: "contents",
|
|
55
64
|
ref: r,
|
|
56
|
-
class:
|
|
65
|
+
class: t(e.$style.container)
|
|
57
66
|
}, [
|
|
58
|
-
|
|
67
|
+
m(e.$slots, "default")
|
|
59
68
|
], 2)
|
|
60
|
-
], 14,
|
|
69
|
+
], 14, V)
|
|
61
70
|
], 6));
|
|
62
71
|
}
|
|
63
72
|
});
|
|
64
73
|
export {
|
|
65
|
-
|
|
74
|
+
R as default
|
|
66
75
|
};
|