vue-composable-ui 1.0.7 → 1.1.1
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/dist/{combobox.vue_vue_type_script_setup_true_lang-8JadictW.js → combobox.vue_vue_type_script_setup_true_lang-ChCbDl0x.js} +4 -4
- package/dist/{comboboxInput.vue_vue_type_script_setup_true_lang-Cjl65Eoo.js → comboboxInput.vue_vue_type_script_setup_true_lang-D3KIXNRO.js} +1 -1
- package/dist/{comboboxOption.vue_vue_type_script_setup_true_lang-DPEArk3M.js → comboboxOption.vue_vue_type_script_setup_true_lang-C9FIG5ye.js} +2 -2
- package/dist/{comboboxOptions.vue_vue_type_script_setup_true_lang-Doy6MfEQ.js → comboboxOptions.vue_vue_type_script_setup_true_lang-DLv4KjF8.js} +1 -1
- package/dist/composable-ui.js +45 -43
- package/dist/composable-ui10.js +1 -1
- package/dist/composable-ui11.js +1 -1
- package/dist/composable-ui12.js +1 -1
- package/dist/composable-ui13.js +1 -1
- package/dist/composable-ui14.js +1 -1
- package/dist/composable-ui15.js +1 -1
- package/dist/composable-ui16.js +1 -1
- package/dist/composable-ui17.js +2 -29
- package/dist/composable-ui18.js +29 -2
- package/dist/composable-ui19.js +1 -1
- package/dist/composable-ui2.js +24 -49
- package/dist/composable-ui20.js +1 -1
- package/dist/composable-ui21.js +2 -101
- package/dist/composable-ui22.js +91 -132
- package/dist/composable-ui23.js +141 -4
- package/dist/composable-ui24.js +5 -5
- package/dist/composable-ui25.js +7 -0
- package/dist/composable-ui3.js +53 -2
- package/dist/composable-ui4.js +1 -1
- package/dist/composable-ui5.js +1 -1
- package/dist/composable-ui6.js +1 -1
- package/dist/composable-ui7.js +1 -1
- package/dist/composable-ui8.js +1 -1
- package/dist/composable-ui9.js +1 -1
- package/dist/{listbox.vue_vue_type_script_setup_true_lang-CP8lV3wp.js → listbox.vue_vue_type_script_setup_true_lang-BJS1g6K9.js} +1 -1
- package/dist/{listboxOption.vue_vue_type_script_setup_true_lang-C1-Q-dSr.js → listboxOption.vue_vue_type_script_setup_true_lang-DMkQ_ZA_.js} +1 -1
- package/dist/{menu.vue_vue_type_script_setup_true_lang-Ci7q2rOg.js → menu.vue_vue_type_script_setup_true_lang-BTGGj0FY.js} +3 -3
- package/dist/{menuItem.vue_vue_type_script_setup_true_lang-ezPw3j-i.js → menuItem.vue_vue_type_script_setup_true_lang-CSWsvc1p.js} +2 -2
- package/dist/{menuItems.vue_vue_type_script_setup_true_lang-p9vftREy.js → menuItems.vue_vue_type_script_setup_true_lang-DZL1uyoq.js} +1 -1
- package/dist/{popover.vue_vue_type_script_setup_true_lang-DhKF7_nY.js → popover.vue_vue_type_script_setup_true_lang-C13ARHho.js} +2 -2
- package/dist/{popoverDialog.vue_vue_type_script_setup_true_lang-CDXUO7wZ.js → popoverDialog.vue_vue_type_script_setup_true_lang-C2z6To-6.js} +1 -1
- package/dist/{tab.vue_vue_type_script_setup_true_lang-Y5OFGqMB.js → tab.vue_vue_type_script_setup_true_lang-BSckMUwj.js} +1 -1
- package/dist/{tabContainer.vue_vue_type_script_setup_true_lang-fPpLno2Z.js → tabContainer.vue_vue_type_script_setup_true_lang-YfrBXoWm.js} +2 -2
- package/dist/{tabList.vue_vue_type_script_setup_true_lang-CZyqGCuj.js → tabList.vue_vue_type_script_setup_true_lang-DLoNOwJ7.js} +1 -1
- package/dist/{tabPanel.vue_vue_type_script_setup_true_lang-CGhP6SHR.js → tabPanel.vue_vue_type_script_setup_true_lang-DZfMk_Sn.js} +2 -2
- package/dist/{tooltip.vue_vue_type_script_setup_true_lang-D4uAZmQb.js → tooltip.vue_vue_type_script_setup_true_lang-CXxwHtxF.js} +1 -1
- package/dist/types/main.d.ts +1 -0
- package/dist/types/utils/validation.d.ts +25 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as B, mergeModels as H, computed as p, useModel as T, useId as j, watch as K, provide as N, createElementBlock as v, openBlock as r, Fragment as b, createCommentVNode as P, renderSlot as U, createBlock as A, unref as k, renderList as _, nextTick as h } from "vue";
|
|
2
|
-
import { useHTMLElement as q } from "./composable-
|
|
3
|
-
import { usePopover as z } from "./composable-
|
|
4
|
-
import { useList as G } from "./composable-
|
|
2
|
+
import { useHTMLElement as q } from "./composable-ui24.js";
|
|
3
|
+
import { usePopover as z } from "./composable-ui22.js";
|
|
4
|
+
import { useList as G } from "./composable-ui23.js";
|
|
5
5
|
import { _ as $ } from "./comboboxHiddenInput.vue_vue_type_script_setup_true_lang-Ba-UPd-M.js";
|
|
6
|
-
import { injectCombobox as J } from "./composable-
|
|
6
|
+
import { injectCombobox as J } from "./composable-ui25.js";
|
|
7
7
|
const ae = /* @__PURE__ */ B({
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "combobox",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as r, inject as a, useModel as m, watch as p, withDirectives as d, createElementBlock as s, openBlock as f, mergeProps as v, unref as n, vModelDynamic as c } from "vue";
|
|
2
|
-
import { injectCombobox as b } from "./composable-
|
|
2
|
+
import { injectCombobox as b } from "./composable-ui25.js";
|
|
3
3
|
const y = /* @__PURE__ */ r({
|
|
4
4
|
__name: "comboboxInput",
|
|
5
5
|
props: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as f, useId as b, useTemplateRef as p, inject as v, createElementBlock as x, openBlock as E, unref as e, renderSlot as _ } from "vue";
|
|
2
|
-
import { useListOption as k } from "./composable-
|
|
3
|
-
import { injectCombobox as C } from "./composable-
|
|
2
|
+
import { useListOption as k } from "./composable-ui18.js";
|
|
3
|
+
import { injectCombobox as C } from "./composable-ui25.js";
|
|
4
4
|
const j = ["id", "data-active", "aria-selected", "aria-disabled"], A = /* @__PURE__ */ f({
|
|
5
5
|
__name: "comboboxOption",
|
|
6
6
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as n, inject as r, createElementBlock as i, createCommentVNode as c, unref as e, openBlock as m, renderSlot as s } from "vue";
|
|
2
|
-
import { injectCombobox as p } from "./composable-
|
|
2
|
+
import { injectCombobox as p } from "./composable-ui25.js";
|
|
3
3
|
const d = ["id"], f = /* @__PURE__ */ n({
|
|
4
4
|
__name: "comboboxOptions",
|
|
5
5
|
setup(b) {
|
package/dist/composable-ui.js
CHANGED
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
import { usePopover as e } from "./composable-
|
|
2
|
-
import { useList as p } from "./composable-
|
|
3
|
-
import { useListOption as s } from "./composable-
|
|
4
|
-
import { useFormControl as a } from "./composable-
|
|
5
|
-
import { useHTMLElement as n } from "./composable-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { _ as M } from "./
|
|
9
|
-
import { _ as c } from "./
|
|
10
|
-
import { _ as v } from "./
|
|
11
|
-
import { _ as I } from "./
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { _ as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { _ as
|
|
17
|
-
import { _ as
|
|
18
|
-
import { _ as
|
|
19
|
-
import { _ as
|
|
20
|
-
import { _ as
|
|
21
|
-
import { _ as
|
|
22
|
-
import { _ as
|
|
1
|
+
import { usePopover as e } from "./composable-ui22.js";
|
|
2
|
+
import { useList as p } from "./composable-ui23.js";
|
|
3
|
+
import { useListOption as s } from "./composable-ui18.js";
|
|
4
|
+
import { useFormControl as a } from "./composable-ui3.js";
|
|
5
|
+
import { useHTMLElement as n } from "./composable-ui24.js";
|
|
6
|
+
import { useValidation as b } from "./composable-ui2.js";
|
|
7
|
+
import { injectCombobox as u, injectMenu as C, injectPopover as T, injectTabs as l } from "./composable-ui25.js";
|
|
8
|
+
import { _ as M } from "./listbox.vue_vue_type_script_setup_true_lang-BJS1g6K9.js";
|
|
9
|
+
import { _ as c } from "./listboxOption.vue_vue_type_script_setup_true_lang-DMkQ_ZA_.js";
|
|
10
|
+
import { _ as v } from "./tabContainer.vue_vue_type_script_setup_true_lang-YfrBXoWm.js";
|
|
11
|
+
import { _ as I } from "./tabList.vue_vue_type_script_setup_true_lang-DLoNOwJ7.js";
|
|
12
|
+
import { _ as g } from "./tab.vue_vue_type_script_setup_true_lang-BSckMUwj.js";
|
|
13
|
+
import { _ as E } from "./tabPanel.vue_vue_type_script_setup_true_lang-DZfMk_Sn.js";
|
|
14
|
+
import { _ as H } from "./popover.vue_vue_type_script_setup_true_lang-C13ARHho.js";
|
|
15
|
+
import { _ as h } from "./popoverDialog.vue_vue_type_script_setup_true_lang-C2z6To-6.js";
|
|
16
|
+
import { _ as q } from "./tooltip.vue_vue_type_script_setup_true_lang-CXxwHtxF.js";
|
|
17
|
+
import { _ as y } from "./menu.vue_vue_type_script_setup_true_lang-BTGGj0FY.js";
|
|
18
|
+
import { _ as A } from "./menuItems.vue_vue_type_script_setup_true_lang-DZL1uyoq.js";
|
|
19
|
+
import { _ as G } from "./menuItem.vue_vue_type_script_setup_true_lang-CSWsvc1p.js";
|
|
20
|
+
import { _ as K } from "./combobox.vue_vue_type_script_setup_true_lang-ChCbDl0x.js";
|
|
21
|
+
import { _ as Q } from "./comboboxInput.vue_vue_type_script_setup_true_lang-D3KIXNRO.js";
|
|
22
|
+
import { _ as S } from "./comboboxOptions.vue_vue_type_script_setup_true_lang-DLv4KjF8.js";
|
|
23
|
+
import { _ as W } from "./comboboxOption.vue_vue_type_script_setup_true_lang-C9FIG5ye.js";
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
K as Combobox,
|
|
26
|
+
Q as ComboboxInput,
|
|
27
|
+
W as ComboboxOption,
|
|
28
|
+
S as ComboboxOptions,
|
|
29
|
+
M as Listbox,
|
|
30
|
+
c as ListboxOption,
|
|
31
|
+
y as Menu,
|
|
32
|
+
G as MenuItem,
|
|
33
|
+
A as MenuItems,
|
|
34
|
+
H as Popover,
|
|
35
|
+
h as PopoverDialog,
|
|
36
|
+
g as Tab,
|
|
37
|
+
v as TabContainer,
|
|
38
|
+
I as TabList,
|
|
39
|
+
E as TabPanel,
|
|
40
|
+
q as Tooltip,
|
|
41
|
+
u as injectCombobox,
|
|
42
|
+
C as injectMenu,
|
|
43
|
+
T as injectPopover,
|
|
44
|
+
l as injectTabs,
|
|
44
45
|
a as useFormControl,
|
|
45
46
|
n as useHTMLElement,
|
|
46
47
|
p as useList,
|
|
47
48
|
s as useListOption,
|
|
48
|
-
e as usePopover
|
|
49
|
+
e as usePopover,
|
|
50
|
+
b as useValidation
|
|
49
51
|
};
|
package/dist/composable-ui10.js
CHANGED
package/dist/composable-ui11.js
CHANGED
package/dist/composable-ui12.js
CHANGED
package/dist/composable-ui13.js
CHANGED
package/dist/composable-ui14.js
CHANGED
package/dist/composable-ui15.js
CHANGED
package/dist/composable-ui16.js
CHANGED
package/dist/composable-ui17.js
CHANGED
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { injectList as j } from "./composable-ui22.js";
|
|
3
|
-
function S(c, o, i) {
|
|
4
|
-
const e = l(j);
|
|
5
|
-
if (!e)
|
|
6
|
-
throw new Error("List injectable context is not provided");
|
|
7
|
-
const t = d(-1), r = n(() => e.isSelected(t.value)), u = n(() => e.isActive(t.value));
|
|
8
|
-
function s() {
|
|
9
|
-
e.selectItem(t.value);
|
|
10
|
-
}
|
|
11
|
-
function a({ focus: m = !0 } = {}) {
|
|
12
|
-
I(i) || e.activateItem(t.value, { focus: m });
|
|
13
|
-
}
|
|
14
|
-
function v() {
|
|
15
|
-
e.deactivateItem();
|
|
16
|
-
}
|
|
17
|
-
return f(() => {
|
|
18
|
-
t.value = e.addItem(c, o, i);
|
|
19
|
-
}), p(() => {
|
|
20
|
-
e.removeItem(t.value);
|
|
21
|
-
}), {
|
|
22
|
-
isSelected: r,
|
|
23
|
-
isActive: u,
|
|
24
|
-
select: s,
|
|
25
|
-
activate: a,
|
|
26
|
-
deactivate: v
|
|
27
|
-
};
|
|
28
|
-
}
|
|
1
|
+
import { _ as f } from "./comboboxOption.vue_vue_type_script_setup_true_lang-C9FIG5ye.js";
|
|
29
2
|
export {
|
|
30
|
-
|
|
3
|
+
f as default
|
|
31
4
|
};
|
package/dist/composable-ui18.js
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject as l, ref as d, computed as n, onMounted as f, onUnmounted as p, unref as I } from "vue";
|
|
2
|
+
import { injectList as j } from "./composable-ui23.js";
|
|
3
|
+
function S(c, o, i) {
|
|
4
|
+
const e = l(j);
|
|
5
|
+
if (!e)
|
|
6
|
+
throw new Error("List injectable context is not provided");
|
|
7
|
+
const t = d(-1), r = n(() => e.isSelected(t.value)), u = n(() => e.isActive(t.value));
|
|
8
|
+
function s() {
|
|
9
|
+
e.selectItem(t.value);
|
|
10
|
+
}
|
|
11
|
+
function a({ focus: m = !0 } = {}) {
|
|
12
|
+
I(i) || e.activateItem(t.value, { focus: m });
|
|
13
|
+
}
|
|
14
|
+
function v() {
|
|
15
|
+
e.deactivateItem();
|
|
16
|
+
}
|
|
17
|
+
return f(() => {
|
|
18
|
+
t.value = e.addItem(c, o, i);
|
|
19
|
+
}), p(() => {
|
|
20
|
+
e.removeItem(t.value);
|
|
21
|
+
}), {
|
|
22
|
+
isSelected: r,
|
|
23
|
+
isActive: u,
|
|
24
|
+
select: s,
|
|
25
|
+
activate: a,
|
|
26
|
+
deactivate: v
|
|
27
|
+
};
|
|
28
|
+
}
|
|
2
29
|
export {
|
|
3
|
-
|
|
30
|
+
S as useListOption
|
|
4
31
|
};
|
package/dist/composable-ui19.js
CHANGED
package/dist/composable-ui2.js
CHANGED
|
@@ -1,55 +1,30 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
n.value = e.validity.valid, l.value = e.validity, r.value = e.validationMessage;
|
|
11
|
-
}
|
|
12
|
-
function f() {
|
|
13
|
-
if (!e) throw new Error("Form element is undefined");
|
|
14
|
-
const o = e.value;
|
|
15
|
-
for (const p of g(h)) {
|
|
16
|
-
const c = p(o);
|
|
17
|
-
if (c !== !0) {
|
|
18
|
-
e.setCustomValidity(c);
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
1
|
+
import { ref as l, watch as V, toValue as u, readonly as n } from "vue";
|
|
2
|
+
function h(s, f = [], c = !1) {
|
|
3
|
+
const e = l(!0), r = l([]);
|
|
4
|
+
function d(t, a, o) {
|
|
5
|
+
r.value = [], e.value = !0;
|
|
6
|
+
for (const v of a) {
|
|
7
|
+
const i = v(t);
|
|
8
|
+
if (i !== !0 && (r.value.push(i), e.value = !1, o))
|
|
9
|
+
return !1;
|
|
21
10
|
}
|
|
11
|
+
return e.value;
|
|
22
12
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
f(), u = e.value, e.addEventListener("change", E, {
|
|
37
|
-
signal: i.signal,
|
|
38
|
-
passive: !0
|
|
39
|
-
}), e.addEventListener("invalid", C, {
|
|
40
|
-
signal: i.signal
|
|
41
|
-
}), e?.autofocus && s();
|
|
42
|
-
}), M(() => {
|
|
43
|
-
i.abort();
|
|
44
|
-
}), {
|
|
45
|
-
focus: s,
|
|
46
|
-
validate: v,
|
|
47
|
-
isValid: n,
|
|
48
|
-
validity: m(l),
|
|
49
|
-
validationMessage: m(r),
|
|
50
|
-
isChanged: a
|
|
13
|
+
return V(
|
|
14
|
+
[
|
|
15
|
+
() => u(s),
|
|
16
|
+
() => u(f),
|
|
17
|
+
() => u(c)
|
|
18
|
+
],
|
|
19
|
+
([t, a, o]) => {
|
|
20
|
+
d(t, a, o);
|
|
21
|
+
},
|
|
22
|
+
{ immediate: !0 }
|
|
23
|
+
), {
|
|
24
|
+
isValid: n(e),
|
|
25
|
+
errors: n(r)
|
|
51
26
|
};
|
|
52
27
|
}
|
|
53
28
|
export {
|
|
54
|
-
|
|
29
|
+
h as useValidation
|
|
55
30
|
};
|
package/dist/composable-ui20.js
CHANGED
package/dist/composable-ui21.js
CHANGED
|
@@ -1,103 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useHTMLElement as k } from "./composable-ui23.js";
|
|
3
|
-
function G(y, z, {
|
|
4
|
-
direction: c = "down",
|
|
5
|
-
align: u = "left",
|
|
6
|
-
position: L = "fixed",
|
|
7
|
-
closeOnOutsideClick: A = !0,
|
|
8
|
-
closeOnInsideClick: M = !1
|
|
9
|
-
} = {}) {
|
|
10
|
-
const s = T(!1);
|
|
11
|
-
function v() {
|
|
12
|
-
const e = k(y);
|
|
13
|
-
if (!e.value) throw new Error("Activator element is undefined");
|
|
14
|
-
return e.value;
|
|
15
|
-
}
|
|
16
|
-
function $() {
|
|
17
|
-
const e = k(z);
|
|
18
|
-
if (!e.value) throw new Error("Popover element is undefined");
|
|
19
|
-
return e.value;
|
|
20
|
-
}
|
|
21
|
-
function B({ focus: e = !0 } = {}) {
|
|
22
|
-
s.value = !0, e && P(() => {
|
|
23
|
-
$().focus();
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function E({ focus: e = !0 } = {}) {
|
|
27
|
-
s.value = !1, e && v().focus();
|
|
28
|
-
}
|
|
29
|
-
function O(e) {
|
|
30
|
-
s.value ? E(e) : B(e);
|
|
31
|
-
}
|
|
32
|
-
function h() {
|
|
33
|
-
if (!s.value) return;
|
|
34
|
-
const e = v(), r = $();
|
|
35
|
-
r.style.position = L;
|
|
36
|
-
const {
|
|
37
|
-
top: f,
|
|
38
|
-
right: l,
|
|
39
|
-
bottom: w,
|
|
40
|
-
left: p,
|
|
41
|
-
width: m,
|
|
42
|
-
height: W
|
|
43
|
-
} = e.getBoundingClientRect(), a = r.offsetHeight, d = r.offsetWidth, x = document.documentElement.clientHeight, b = document.documentElement.clientWidth;
|
|
44
|
-
let i = c;
|
|
45
|
-
c == "up" ? f - a < 0 && (i = "down") : c == "down" ? w + a > x && (i = "up") : c == "right" ? l + d > b && (i = "left") : c == "left" && p - d < 0 && (i = "right");
|
|
46
|
-
let o = u;
|
|
47
|
-
u == "left" ? p + d > b && (o = "right") : u == "right" ? l - d < 0 && (o = "left") : u == "top" ? f + a > x && (o = "bottom") : u == "bottom" && w - a < 0 && (o = "top");
|
|
48
|
-
const t = {
|
|
49
|
-
top: "auto",
|
|
50
|
-
bottom: "auto",
|
|
51
|
-
left: "auto",
|
|
52
|
-
right: "auto",
|
|
53
|
-
width: "auto"
|
|
54
|
-
}, n = L === "fixed";
|
|
55
|
-
i == "up" ? t.bottom = `${W + (n ? x - w : 0)}px` : i == "down" ? t.top = `${W + (n ? f : 0)}px` : i == "right" ? t.left = `${m + (n ? p : 0)}px` : i == "left" && (t.right = `${m + (n ? b - l : 0)}px`), ["up", "down"].includes(i) ? o == "right" ? t.right = `${n ? b - l : 0}px` : o == "left" || o == "stretch" ? t.left = `${n ? p : 0}px` : o == "center" && (t.left = `${(n ? p : 0) - (d - m) / 2}px`) : o == "bottom" ? t.bottom = `${n ? x - w : 0}px` : o == "top" ? t.top = `${n ? f : 0}px` : o == "center" && (t.top = `${(n ? f : 0) - (a - W) / 2}px`), ["up", "down"].includes(i) && o === "stretch" && (t.width = m + "px");
|
|
56
|
-
for (const C in t)
|
|
57
|
-
r.style[C] = t[C];
|
|
58
|
-
}
|
|
59
|
-
_(
|
|
60
|
-
s,
|
|
61
|
-
(e) => {
|
|
62
|
-
e && P(() => {
|
|
63
|
-
h();
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
{ flush: "pre" }
|
|
67
|
-
);
|
|
68
|
-
function R(e) {
|
|
69
|
-
const r = e.target;
|
|
70
|
-
if (!v().contains(r))
|
|
71
|
-
try {
|
|
72
|
-
$().contains(r) ? M && E() : A && (s.value = !1);
|
|
73
|
-
} catch {
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
let H;
|
|
77
|
-
const g = new AbortController();
|
|
78
|
-
return F(() => {
|
|
79
|
-
H = new ResizeObserver(h);
|
|
80
|
-
}), U(() => {
|
|
81
|
-
window.addEventListener("resize", h, {
|
|
82
|
-
passive: !0,
|
|
83
|
-
signal: g.signal
|
|
84
|
-
}), window.addEventListener("scroll", h, {
|
|
85
|
-
passive: !0,
|
|
86
|
-
//capture: true,
|
|
87
|
-
signal: g.signal
|
|
88
|
-
}), window.addEventListener("click", R, {
|
|
89
|
-
passive: !0,
|
|
90
|
-
signal: g.signal
|
|
91
|
-
}), H.observe(v());
|
|
92
|
-
}), j(() => {
|
|
93
|
-
g.abort(), H.disconnect();
|
|
94
|
-
}), {
|
|
95
|
-
isOpen: s,
|
|
96
|
-
open: B,
|
|
97
|
-
close: E,
|
|
98
|
-
toggle: O
|
|
99
|
-
};
|
|
100
|
-
}
|
|
1
|
+
import { _ as f } from "./combobox.vue_vue_type_script_setup_true_lang-ChCbDl0x.js";
|
|
101
2
|
export {
|
|
102
|
-
|
|
3
|
+
f as default
|
|
103
4
|
};
|
package/dist/composable-ui22.js
CHANGED
|
@@ -1,144 +1,103 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useHTMLElement as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
return
|
|
15
|
-
}
|
|
16
|
-
function b(e) {
|
|
17
|
-
const t = s(e.element);
|
|
18
|
-
if (t)
|
|
19
|
-
return t.focus(), t;
|
|
20
|
-
}
|
|
21
|
-
function f(e, { focus: t = !1 } = {}) {
|
|
22
|
-
l.value = e?.id ?? void 0, e !== void 0 && t && b(e);
|
|
23
|
-
}
|
|
24
|
-
function O(e, { focus: t = !1 } = {}) {
|
|
25
|
-
const i = o(e);
|
|
26
|
-
return f(i, { focus: t });
|
|
27
|
-
}
|
|
28
|
-
function m(e) {
|
|
29
|
-
return l.value === e;
|
|
30
|
-
}
|
|
31
|
-
function w(e, t, i = !1) {
|
|
32
|
-
const a = _(e), u = c++;
|
|
33
|
-
return n.value.push({
|
|
34
|
-
id: u,
|
|
35
|
-
value: t,
|
|
36
|
-
element: a,
|
|
37
|
-
disabled: i
|
|
38
|
-
}), S(n), u;
|
|
1
|
+
import { ref as T, watch as _, nextTick as P, onBeforeMount as F, onMounted as U, onBeforeUnmount as j } from "vue";
|
|
2
|
+
import { useHTMLElement as k } from "./composable-ui24.js";
|
|
3
|
+
function G(y, z, {
|
|
4
|
+
direction: c = "down",
|
|
5
|
+
align: u = "left",
|
|
6
|
+
position: L = "fixed",
|
|
7
|
+
closeOnOutsideClick: A = !0,
|
|
8
|
+
closeOnInsideClick: M = !1
|
|
9
|
+
} = {}) {
|
|
10
|
+
const s = T(!1);
|
|
11
|
+
function v() {
|
|
12
|
+
const e = k(y);
|
|
13
|
+
if (!e.value) throw new Error("Activator element is undefined");
|
|
14
|
+
return e.value;
|
|
39
15
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
16
|
+
function $() {
|
|
17
|
+
const e = k(z);
|
|
18
|
+
if (!e.value) throw new Error("Popover element is undefined");
|
|
19
|
+
return e.value;
|
|
44
20
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (i !== void 0) {
|
|
50
|
-
if (s(v)) {
|
|
51
|
-
const a = r.value.findIndex(
|
|
52
|
-
(u) => d(i, u)
|
|
53
|
-
);
|
|
54
|
-
a > -1 ? r.value.splice(a, 1) : r.value = [...r.value, i];
|
|
55
|
-
} else
|
|
56
|
-
r.value = i;
|
|
57
|
-
f(t);
|
|
58
|
-
}
|
|
21
|
+
function B({ focus: e = !0 } = {}) {
|
|
22
|
+
s.value = !0, e && P(() => {
|
|
23
|
+
$().focus();
|
|
24
|
+
});
|
|
59
25
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
(t) => d(e.value, t)
|
|
63
|
-
) : d(r, e.value);
|
|
26
|
+
function E({ focus: e = !0 } = {}) {
|
|
27
|
+
s.value = !1, e && v().focus();
|
|
64
28
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
const t = o(e);
|
|
68
|
-
return y(t);
|
|
69
|
-
} catch {
|
|
70
|
-
return !1;
|
|
71
|
-
}
|
|
29
|
+
function O(e) {
|
|
30
|
+
s.value ? E(e) : B(e);
|
|
72
31
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
32
|
+
function h() {
|
|
33
|
+
if (!s.value) return;
|
|
34
|
+
const e = v(), r = $();
|
|
35
|
+
r.style.position = L;
|
|
36
|
+
const {
|
|
37
|
+
top: f,
|
|
38
|
+
right: l,
|
|
39
|
+
bottom: w,
|
|
40
|
+
left: p,
|
|
41
|
+
width: m,
|
|
42
|
+
height: W
|
|
43
|
+
} = e.getBoundingClientRect(), a = r.offsetHeight, d = r.offsetWidth, x = document.documentElement.clientHeight, b = document.documentElement.clientWidth;
|
|
44
|
+
let i = c;
|
|
45
|
+
c == "up" ? f - a < 0 && (i = "down") : c == "down" ? w + a > x && (i = "up") : c == "right" ? l + d > b && (i = "left") : c == "left" && p - d < 0 && (i = "right");
|
|
46
|
+
let o = u;
|
|
47
|
+
u == "left" ? p + d > b && (o = "right") : u == "right" ? l - d < 0 && (o = "left") : u == "top" ? f + a > x && (o = "bottom") : u == "bottom" && w - a < 0 && (o = "top");
|
|
48
|
+
const t = {
|
|
49
|
+
top: "auto",
|
|
50
|
+
bottom: "auto",
|
|
51
|
+
left: "auto",
|
|
52
|
+
right: "auto",
|
|
53
|
+
width: "auto"
|
|
54
|
+
}, n = L === "fixed";
|
|
55
|
+
i == "up" ? t.bottom = `${W + (n ? x - w : 0)}px` : i == "down" ? t.top = `${W + (n ? f : 0)}px` : i == "right" ? t.left = `${m + (n ? p : 0)}px` : i == "left" && (t.right = `${m + (n ? b - l : 0)}px`), ["up", "down"].includes(i) ? o == "right" ? t.right = `${n ? b - l : 0}px` : o == "left" || o == "stretch" ? t.left = `${n ? p : 0}px` : o == "center" && (t.left = `${(n ? p : 0) - (d - m) / 2}px`) : o == "bottom" ? t.bottom = `${n ? x - w : 0}px` : o == "top" ? t.top = `${n ? f : 0}px` : o == "center" && (t.top = `${(n ? f : 0) - (a - W) / 2}px`), ["up", "down"].includes(i) && o === "stretch" && (t.width = m + "px");
|
|
56
|
+
for (const C in t)
|
|
57
|
+
r.style[C] = t[C];
|
|
77
58
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
u = n.value[a + 1];
|
|
95
|
-
else if (t)
|
|
96
|
-
u = n.value[0];
|
|
97
|
-
else
|
|
98
|
-
return;
|
|
99
|
-
return f(u, { focus: e });
|
|
100
|
-
}
|
|
101
|
-
function M({
|
|
102
|
-
focus: e = !1,
|
|
103
|
-
loop: t = !1
|
|
104
|
-
} = {}) {
|
|
105
|
-
if (l.value === void 0) return x({ focus: e });
|
|
106
|
-
const i = o(l.value), a = n.value.indexOf(i);
|
|
107
|
-
let u;
|
|
108
|
-
if (a - 1 > -1)
|
|
109
|
-
u = n.value[a - 1];
|
|
110
|
-
else if (t)
|
|
111
|
-
u = n.value[n.value.length - 1];
|
|
112
|
-
else
|
|
113
|
-
return;
|
|
114
|
-
return f(u, { focus: e });
|
|
59
|
+
_(
|
|
60
|
+
s,
|
|
61
|
+
(e) => {
|
|
62
|
+
e && P(() => {
|
|
63
|
+
h();
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
{ flush: "pre" }
|
|
67
|
+
);
|
|
68
|
+
function R(e) {
|
|
69
|
+
const r = e.target;
|
|
70
|
+
if (!v().contains(r))
|
|
71
|
+
try {
|
|
72
|
+
$().contains(r) ? M && E() : A && (s.value = !1);
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
115
75
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
76
|
+
let H;
|
|
77
|
+
const g = new AbortController();
|
|
78
|
+
return F(() => {
|
|
79
|
+
H = new ResizeObserver(h);
|
|
80
|
+
}), U(() => {
|
|
81
|
+
window.addEventListener("resize", h, {
|
|
82
|
+
passive: !0,
|
|
83
|
+
signal: g.signal
|
|
84
|
+
}), window.addEventListener("scroll", h, {
|
|
85
|
+
passive: !0,
|
|
86
|
+
//capture: true,
|
|
87
|
+
signal: g.signal
|
|
88
|
+
}), window.addEventListener("click", R, {
|
|
89
|
+
passive: !0,
|
|
90
|
+
signal: g.signal
|
|
91
|
+
}), H.observe(v());
|
|
92
|
+
}), j(() => {
|
|
93
|
+
g.abort(), H.disconnect();
|
|
125
94
|
}), {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
),
|
|
131
|
-
selectActiveItem: () => {
|
|
132
|
-
l.value !== void 0 && I(l.value);
|
|
133
|
-
},
|
|
134
|
-
activateSelectedItem: j,
|
|
135
|
-
activateFirstItem: p,
|
|
136
|
-
activateLastItem: x,
|
|
137
|
-
activateNextItem: E,
|
|
138
|
-
activatePrevItem: M
|
|
95
|
+
isOpen: s,
|
|
96
|
+
open: B,
|
|
97
|
+
close: E,
|
|
98
|
+
toggle: O
|
|
139
99
|
};
|
|
140
100
|
}
|
|
141
101
|
export {
|
|
142
|
-
|
|
143
|
-
P as useList
|
|
102
|
+
G as usePopover
|
|
144
103
|
};
|
package/dist/composable-ui23.js
CHANGED
|
@@ -1,7 +1,144 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { shallowRef as N, ref as R, computed as g, provide as B, readonly as h, shallowReadonly as J, triggerRef as S, unref as s } from "vue";
|
|
2
|
+
import { useHTMLElement as _ } from "./composable-ui24.js";
|
|
3
|
+
const q = Symbol();
|
|
4
|
+
function d(r, c) {
|
|
5
|
+
const [n, l] = [s(r), s(c)];
|
|
6
|
+
return typeof n == "object" ? typeof l == "object" ? JSON.stringify(n) === JSON.stringify(l) : !1 : n === l;
|
|
7
|
+
}
|
|
8
|
+
function P(r) {
|
|
9
|
+
let c = 0;
|
|
10
|
+
const n = N([]), l = R(), v = g(() => Array.isArray(r.value));
|
|
11
|
+
function o(e) {
|
|
12
|
+
const t = n.value.find((i) => i.id === e);
|
|
13
|
+
if (!t) throw new Error(`Item not found: (${e})`);
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
function b(e) {
|
|
17
|
+
const t = s(e.element);
|
|
18
|
+
if (t)
|
|
19
|
+
return t.focus(), t;
|
|
20
|
+
}
|
|
21
|
+
function f(e, { focus: t = !1 } = {}) {
|
|
22
|
+
l.value = e?.id ?? void 0, e !== void 0 && t && b(e);
|
|
23
|
+
}
|
|
24
|
+
function O(e, { focus: t = !1 } = {}) {
|
|
25
|
+
const i = o(e);
|
|
26
|
+
return f(i, { focus: t });
|
|
27
|
+
}
|
|
28
|
+
function m(e) {
|
|
29
|
+
return l.value === e;
|
|
30
|
+
}
|
|
31
|
+
function w(e, t, i = !1) {
|
|
32
|
+
const a = _(e), u = c++;
|
|
33
|
+
return n.value.push({
|
|
34
|
+
id: u,
|
|
35
|
+
value: t,
|
|
36
|
+
element: a,
|
|
37
|
+
disabled: i
|
|
38
|
+
}), S(n), u;
|
|
39
|
+
}
|
|
40
|
+
function A(e) {
|
|
41
|
+
m(e) && f();
|
|
42
|
+
const t = o(e), i = n.value.indexOf(t);
|
|
43
|
+
n.value.splice(i, 1), S(n);
|
|
44
|
+
}
|
|
45
|
+
function I(e) {
|
|
46
|
+
const t = o(e);
|
|
47
|
+
if (s(t.disabled)) return;
|
|
48
|
+
const i = s(t.value);
|
|
49
|
+
if (i !== void 0) {
|
|
50
|
+
if (s(v)) {
|
|
51
|
+
const a = r.value.findIndex(
|
|
52
|
+
(u) => d(i, u)
|
|
53
|
+
);
|
|
54
|
+
a > -1 ? r.value.splice(a, 1) : r.value = [...r.value, i];
|
|
55
|
+
} else
|
|
56
|
+
r.value = i;
|
|
57
|
+
f(t);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function y(e) {
|
|
61
|
+
return s(v) ? !!r.value.find(
|
|
62
|
+
(t) => d(e.value, t)
|
|
63
|
+
) : d(r, e.value);
|
|
64
|
+
}
|
|
65
|
+
function L(e) {
|
|
66
|
+
try {
|
|
67
|
+
const t = o(e);
|
|
68
|
+
return y(t);
|
|
69
|
+
} catch {
|
|
70
|
+
return !1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function j({ focus: e = !1 } = {}) {
|
|
74
|
+
for (let t of n.value)
|
|
75
|
+
if (y(t))
|
|
76
|
+
return f(t, { focus: e });
|
|
77
|
+
}
|
|
78
|
+
function p({ focus: e = !1 } = {}) {
|
|
79
|
+
if (n.value.length)
|
|
80
|
+
return f(n.value[0], { focus: e });
|
|
81
|
+
}
|
|
82
|
+
function x({ focus: e = !1 } = {}) {
|
|
83
|
+
if (n.value.length)
|
|
84
|
+
return f(n.value[n.value.length - 1], { focus: e });
|
|
85
|
+
}
|
|
86
|
+
function E({
|
|
87
|
+
focus: e = !1,
|
|
88
|
+
loop: t = !1
|
|
89
|
+
} = {}) {
|
|
90
|
+
if (l.value === void 0) return p({ focus: e });
|
|
91
|
+
const i = o(l.value), a = n.value.indexOf(i);
|
|
92
|
+
let u;
|
|
93
|
+
if (a + 1 < n.value.length)
|
|
94
|
+
u = n.value[a + 1];
|
|
95
|
+
else if (t)
|
|
96
|
+
u = n.value[0];
|
|
97
|
+
else
|
|
98
|
+
return;
|
|
99
|
+
return f(u, { focus: e });
|
|
100
|
+
}
|
|
101
|
+
function M({
|
|
102
|
+
focus: e = !1,
|
|
103
|
+
loop: t = !1
|
|
104
|
+
} = {}) {
|
|
105
|
+
if (l.value === void 0) return x({ focus: e });
|
|
106
|
+
const i = o(l.value), a = n.value.indexOf(i);
|
|
107
|
+
let u;
|
|
108
|
+
if (a - 1 > -1)
|
|
109
|
+
u = n.value[a - 1];
|
|
110
|
+
else if (t)
|
|
111
|
+
u = n.value[n.value.length - 1];
|
|
112
|
+
else
|
|
113
|
+
return;
|
|
114
|
+
return f(u, { focus: e });
|
|
115
|
+
}
|
|
116
|
+
return B(q, {
|
|
117
|
+
value: h(r),
|
|
118
|
+
selectItem: I,
|
|
119
|
+
activateItem: O,
|
|
120
|
+
deactivateItem: () => f(),
|
|
121
|
+
isSelected: L,
|
|
122
|
+
isActive: m,
|
|
123
|
+
addItem: w,
|
|
124
|
+
removeItem: A
|
|
125
|
+
}), {
|
|
126
|
+
items: J(n),
|
|
127
|
+
isMultiselectable: h(v),
|
|
128
|
+
activeItem: g(
|
|
129
|
+
() => l.value !== void 0 ? o(l.value) : void 0
|
|
130
|
+
),
|
|
131
|
+
selectActiveItem: () => {
|
|
132
|
+
l.value !== void 0 && I(l.value);
|
|
133
|
+
},
|
|
134
|
+
activateSelectedItem: j,
|
|
135
|
+
activateFirstItem: p,
|
|
136
|
+
activateLastItem: x,
|
|
137
|
+
activateNextItem: E,
|
|
138
|
+
activatePrevItem: M
|
|
139
|
+
};
|
|
4
140
|
}
|
|
5
141
|
export {
|
|
6
|
-
|
|
142
|
+
q as injectList,
|
|
143
|
+
P as useList
|
|
7
144
|
};
|
package/dist/composable-ui24.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { ref as r } from "vue";
|
|
2
|
+
function n(e) {
|
|
3
|
+
return typeof e == "string" ? r(document.querySelector(e)) : e instanceof HTMLElement ? r(e) : e;
|
|
4
|
+
}
|
|
2
5
|
export {
|
|
3
|
-
|
|
4
|
-
t as injectMenu,
|
|
5
|
-
n as injectPopover,
|
|
6
|
-
o as injectTabs
|
|
6
|
+
n as useHTMLElement
|
|
7
7
|
};
|
package/dist/composable-ui3.js
CHANGED
|
@@ -1,4 +1,55 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ref as t, onMounted as V, onBeforeUnmount as M, readonly as m, unref as g } from "vue";
|
|
2
|
+
import { useHTMLElement as b } from "./composable-ui24.js";
|
|
3
|
+
function k(y, h = [], w = !0) {
|
|
4
|
+
const a = t(!1), n = t(!0), l = t(), r = t("");
|
|
5
|
+
let e, u;
|
|
6
|
+
function s() {
|
|
7
|
+
e?.focus();
|
|
8
|
+
}
|
|
9
|
+
function d() {
|
|
10
|
+
n.value = e.validity.valid, l.value = e.validity, r.value = e.validationMessage;
|
|
11
|
+
}
|
|
12
|
+
function f() {
|
|
13
|
+
if (!e) throw new Error("Form element is undefined");
|
|
14
|
+
const o = e.value;
|
|
15
|
+
for (const p of g(h)) {
|
|
16
|
+
const c = p(o);
|
|
17
|
+
if (c !== !0) {
|
|
18
|
+
e.setCustomValidity(c);
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function v() {
|
|
24
|
+
if (!e) throw new Error("Form element is undefined");
|
|
25
|
+
return e.setCustomValidity(""), e.validity.valid && f(), d(), n.value;
|
|
26
|
+
}
|
|
27
|
+
function C(o) {
|
|
28
|
+
d(), g(w) || o.preventDefault();
|
|
29
|
+
}
|
|
30
|
+
function E() {
|
|
31
|
+
v(), a.value = u !== e.value;
|
|
32
|
+
}
|
|
33
|
+
let i = new AbortController();
|
|
34
|
+
return V(() => {
|
|
35
|
+
if (e = b(y).value, !e) throw new Error("Form element is undefined");
|
|
36
|
+
f(), u = e.value, e.addEventListener("change", E, {
|
|
37
|
+
signal: i.signal,
|
|
38
|
+
passive: !0
|
|
39
|
+
}), e.addEventListener("invalid", C, {
|
|
40
|
+
signal: i.signal
|
|
41
|
+
}), e?.autofocus && s();
|
|
42
|
+
}), M(() => {
|
|
43
|
+
i.abort();
|
|
44
|
+
}), {
|
|
45
|
+
focus: s,
|
|
46
|
+
validate: v,
|
|
47
|
+
isValid: n,
|
|
48
|
+
validity: m(l),
|
|
49
|
+
validationMessage: m(r),
|
|
50
|
+
isChanged: a
|
|
51
|
+
};
|
|
52
|
+
}
|
|
2
53
|
export {
|
|
3
|
-
|
|
54
|
+
k as useFormControl
|
|
4
55
|
};
|
package/dist/composable-ui4.js
CHANGED
package/dist/composable-ui5.js
CHANGED
package/dist/composable-ui6.js
CHANGED
package/dist/composable-ui7.js
CHANGED
package/dist/composable-ui8.js
CHANGED
package/dist/composable-ui9.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as m, mergeModels as p, useModel as v, computed as b, createElementBlock as k, openBlock as w, unref as I, renderSlot as h } from "vue";
|
|
2
|
-
import { useList as x } from "./composable-
|
|
2
|
+
import { useList as x } from "./composable-ui23.js";
|
|
3
3
|
const A = ["aria-activedescendant", "aria-orientation", "aria-multiselectable"], B = /* @__PURE__ */ m({
|
|
4
4
|
__name: "listbox",
|
|
5
5
|
props: /* @__PURE__ */ p({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as m, useId as p, useTemplateRef as u, createElementBlock as f, openBlock as b, unref as e, renderSlot as v } from "vue";
|
|
2
|
-
import { useListOption as _ } from "./composable-
|
|
2
|
+
import { useListOption as _ } from "./composable-ui18.js";
|
|
3
3
|
const k = ["id", "aria-disabled", "aria-selected", "data-active"], B = /* @__PURE__ */ m({
|
|
4
4
|
__name: "listboxOption",
|
|
5
5
|
props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as b, mergeModels as M, useId as u, useModel as O, computed as m, provide as A, renderSlot as _, unref as h, nextTick as r } from "vue";
|
|
2
|
-
import { usePopover as C } from "./composable-
|
|
3
|
-
import { useList as D } from "./composable-
|
|
4
|
-
import { injectMenu as V } from "./composable-
|
|
2
|
+
import { usePopover as C } from "./composable-ui22.js";
|
|
3
|
+
import { useList as D } from "./composable-ui23.js";
|
|
4
|
+
import { injectMenu as V } from "./composable-ui25.js";
|
|
5
5
|
const j = /* @__PURE__ */ b({
|
|
6
6
|
__name: "menu",
|
|
7
7
|
props: /* @__PURE__ */ M({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as w, useId as x, useTemplateRef as y, inject as S, computed as h, createElementBlock as j, openBlock as A, unref as t, renderSlot as B } from "vue";
|
|
2
|
-
import { useListOption as I } from "./composable-
|
|
3
|
-
import { injectMenu as $ } from "./composable-
|
|
2
|
+
import { useListOption as I } from "./composable-ui18.js";
|
|
3
|
+
import { injectMenu as $ } from "./composable-ui25.js";
|
|
4
4
|
const C = ["id", "data-active", "role", "aria-checked", "aria-disabled"], O = /* @__PURE__ */ w({
|
|
5
5
|
__name: "menuItem",
|
|
6
6
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as n, inject as o, createElementBlock as c, createCommentVNode as s, unref as a, openBlock as i, renderSlot as u } from "vue";
|
|
2
|
-
import { injectMenu as l } from "./composable-
|
|
2
|
+
import { injectMenu as l } from "./composable-ui25.js";
|
|
3
3
|
const d = ["id", "aria-activedescendant", "aria-labelledby"], b = /* @__PURE__ */ n({
|
|
4
4
|
__name: "menuItems",
|
|
5
5
|
setup(m) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as u, useId as r, computed as f, provide as v, renderSlot as O, unref as t } from "vue";
|
|
2
|
-
import { usePopover as m } from "./composable-
|
|
3
|
-
import { injectPopover as g } from "./composable-
|
|
2
|
+
import { usePopover as m } from "./composable-ui22.js";
|
|
3
|
+
import { injectPopover as g } from "./composable-ui25.js";
|
|
4
4
|
const x = /* @__PURE__ */ u({
|
|
5
5
|
__name: "popover",
|
|
6
6
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as n, inject as a, createElementBlock as i, createCommentVNode as c, unref as r, openBlock as l, renderSlot as p } from "vue";
|
|
2
|
-
import { injectPopover as d } from "./composable-
|
|
2
|
+
import { injectPopover as d } from "./composable-ui25.js";
|
|
3
3
|
const s = ["id", "role", "aria-labelledby"], v = /* @__PURE__ */ n({
|
|
4
4
|
__name: "popoverDialog",
|
|
5
5
|
setup(u) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as u, useTemplateRef as b, useId as s, createElementBlock as f, openBlock as m, unref as e, renderSlot as _ } from "vue";
|
|
2
|
-
import { useListOption as k } from "./composable-
|
|
2
|
+
import { useListOption as k } from "./composable-ui18.js";
|
|
3
3
|
const C = ["id", "aria-selected", "aria-controls", "tabindex"], v = /* @__PURE__ */ u({
|
|
4
4
|
__name: "tab",
|
|
5
5
|
props: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as c, useModel as u, provide as v, computed as p, createElementBlock as f, openBlock as I, renderSlot as _ } from "vue";
|
|
2
|
-
import { useList as b } from "./composable-
|
|
3
|
-
import { injectTabs as g } from "./composable-
|
|
2
|
+
import { useList as b } from "./composable-ui23.js";
|
|
3
|
+
import { injectTabs as g } from "./composable-ui25.js";
|
|
4
4
|
const x = /* @__PURE__ */ c({
|
|
5
5
|
__name: "tabContainer",
|
|
6
6
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as i, inject as n, createElementBlock as c, openBlock as s, renderSlot as u } from "vue";
|
|
2
|
-
import { injectTabs as l } from "./composable-
|
|
2
|
+
import { injectTabs as l } from "./composable-ui25.js";
|
|
3
3
|
const f = ["aria-orientation"], b = /* @__PURE__ */ i({
|
|
4
4
|
__name: "tabList",
|
|
5
5
|
props: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as c, inject as i, computed as d, withDirectives as p, createElementBlock as b, openBlock as u, unref as r, renderSlot as m, vShow as v } from "vue";
|
|
2
|
-
import { injectList as f } from "./composable-
|
|
3
|
-
import { injectTabs as _ } from "./composable-
|
|
2
|
+
import { injectList as f } from "./composable-ui23.js";
|
|
3
|
+
import { injectTabs as _ } from "./composable-ui25.js";
|
|
4
4
|
const h = ["id", "aria-labelledby"], I = /* @__PURE__ */ c({
|
|
5
5
|
__name: "tabPanel",
|
|
6
6
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as g, useSlots as b, ref as E, useId as k, onMounted as w, onBeforeUnmount as $, createElementBlock as p, openBlock as a, Fragment as L, renderSlot as f, createBlock as T, Teleport as _, createCommentVNode as h, unref as m, mergeProps as B, createTextVNode as S, toDisplayString as A } from "vue";
|
|
2
|
-
import { usePopover as C } from "./composable-
|
|
2
|
+
import { usePopover as C } from "./composable-ui22.js";
|
|
3
3
|
const I = ["id"], P = /* @__PURE__ */ g({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "tooltip",
|
package/dist/types/main.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { useList } from "./composables/list";
|
|
|
3
3
|
export { useListOption } from "./composables/listOption";
|
|
4
4
|
export { useFormControl } from "./composables/formControl";
|
|
5
5
|
export { useHTMLElement } from "./utils/element";
|
|
6
|
+
export { useValidation, type Validator } from "./utils/validation";
|
|
6
7
|
export * from "./components/injectionKeys";
|
|
7
8
|
export { default as Listbox } from "./components/listbox/listbox.vue";
|
|
8
9
|
export { default as ListboxOption } from "./components/listbox/listboxOption.vue";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter, Ref } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* A validating function must return `true` or a string describing the error
|
|
4
|
+
*/
|
|
5
|
+
export type Validator = (value: string) => true | string;
|
|
6
|
+
export interface useValidationReturn {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the value is valid.
|
|
9
|
+
*/
|
|
10
|
+
isValid: Readonly<Ref<boolean>>;
|
|
11
|
+
/**
|
|
12
|
+
* An array of strings representing messages that describe the validation constraints that the value does not satisfy (if any)
|
|
13
|
+
*/
|
|
14
|
+
errors: Readonly<Ref<readonly string[]>>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Utilizes Constraint Validation API to enable custom validation constrains for a form control
|
|
18
|
+
*
|
|
19
|
+
* @param el A template ref or a CSS selector
|
|
20
|
+
* @param validators An array of validating functions
|
|
21
|
+
* @param stopOnFirstError Whether to stop running validators on the first error (false by default)
|
|
22
|
+
*
|
|
23
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation}
|
|
24
|
+
*/
|
|
25
|
+
export declare function useValidation(value: MaybeRefOrGetter<any>, validators?: MaybeRefOrGetter<Validator[]>, stopOnFirstError?: MaybeRefOrGetter<boolean>): useValidationReturn;
|