@wikicasa-dev/components 2.2.8-alpha.7 → 2.2.9-alpha.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/dist/Swiper/autoplay.js +1 -1
- package/dist/Swiper/controller.js +1 -1
- package/dist/Swiper/keyboard.js +1 -1
- package/dist/Swiper/thumbs.js +1 -1
- package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +26 -13
- package/dist/UIKit/BaseAutocomplete.d.ts +7 -7
- package/dist/UIKit/BaseDropDown.d.ts +3 -0
- package/dist/UIKit/BaseFloatingLabel.js +4 -4
- package/dist/UIKit/BaseModal.d.ts +4 -0
- package/dist/UIKit/Checkbox/CheckboxBtn.d.ts +34 -38
- package/dist/UIKit/Checkbox/CheckboxBtn.js +3 -2
- package/dist/UIKit/Checkbox/CheckboxGroup.d.ts +6 -9
- package/dist/assets/BaseFloatingLabel.css +1 -1
- package/dist/assets/CheckboxBtn.css +1 -0
- package/dist/assets/tailwind.css +1 -1
- package/dist/components/carousel/SwiperCarousel.d.ts +8 -8
- package/dist/index.js +84 -83
- package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +30 -31
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +98 -76
- package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +1 -4
- package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +101 -96
- package/dist/packages/components/lib/UIKit/BaseFloatingLabel.vue.js +8 -8
- package/dist/packages/components/lib/UIKit/BaseModal.vue.js +11 -10
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +3 -3
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js +42 -39
- package/package.json +3 -3
- /package/dist/assets/{swiper-controller.css → swiper-thumbs.css} +0 -0
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as K, mergeModels as B, useModel as M, useTemplateRef as m, shallowRef as p, onBeforeMount as L, watch as b, nextTick as W, createBlock as V, openBlock as C, withCtx as y, createElementBlock as I, Fragment as N, renderList as A, renderSlot as c, createElementVNode as u, normalizeClass as f, withDirectives as F, vModelText as H, toDisplayString as G, withModifiers as P, normalizeStyle as X, createTextVNode as j, vShow as q } from "vue";
|
|
2
|
+
import J from "../BaseDropDown.vue.js";
|
|
3
3
|
import '../../../../../assets/BaseDropDown.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import { debounce as
|
|
6
|
-
const
|
|
4
|
+
import Q from "../BaseSelect/SelectItem.vue.js";
|
|
5
|
+
import { debounce as Y } from "@wikicasa-dev/utilities";
|
|
6
|
+
const Z = ["readonly", "placeholder"], _ = ["innerHTML"], ie = /* @__PURE__ */ K({
|
|
7
7
|
__name: "ClearableAutocomplete",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ B({
|
|
9
9
|
dataCy: {},
|
|
10
|
+
placeholder: {},
|
|
11
|
+
enableKeyboardController: { type: Boolean, default: !0 },
|
|
10
12
|
triggerWrapperClasses: {},
|
|
11
13
|
inputWrapperClasses: {},
|
|
14
|
+
inputClasses: {},
|
|
12
15
|
dropdownClasses: {},
|
|
13
|
-
|
|
16
|
+
clearButton: {},
|
|
14
17
|
keepState: {},
|
|
15
18
|
onInputChangeCb: { type: Function },
|
|
16
19
|
onOptionSelectedCb: { type: [Function, null] }
|
|
@@ -20,125 +23,144 @@ const G = ["readonly"], J = ["innerHTML"], te = /* @__PURE__ */ F({
|
|
|
20
23
|
modelValue: { default: null },
|
|
21
24
|
modelModifiers: {}
|
|
22
25
|
}),
|
|
23
|
-
emits: /* @__PURE__ */
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
if (!t) {
|
|
29
|
-
|
|
26
|
+
emits: /* @__PURE__ */ B(["click", "inputClick", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
|
|
27
|
+
setup(n, { expose: $, emit: E }) {
|
|
28
|
+
const r = M(n, "open"), a = M(n, "modelValue"), s = E, O = m("inputRef"), o = p(a.value?.label || ""), v = p(0), k = p(!1), w = p(null), i = p([]), g = m("dropdownRef"), h = m("hiddenSpan"), R = () => {
|
|
29
|
+
o.value = "", a.value = null, s("update:inputValue", "");
|
|
30
|
+
}, U = async (t) => {
|
|
31
|
+
if (s("update:inputValue", t), !t) {
|
|
32
|
+
i.value = [], r.value = !1;
|
|
30
33
|
return;
|
|
31
34
|
}
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
const e =
|
|
35
|
-
!e || e.id ===
|
|
35
|
+
i.value = await w.value?.(t) || [], k.value = !0, r.value = !!i.value.length;
|
|
36
|
+
}, S = (t = -1) => {
|
|
37
|
+
const e = i.value[t];
|
|
38
|
+
!e || e.id === a.value?.id || (n.onOptionSelectedCb?.(e), o.value = e.label, r.value = !1, a.value = e, i.value = []);
|
|
39
|
+
}, x = () => {
|
|
40
|
+
O.value?.select();
|
|
36
41
|
};
|
|
37
42
|
return L(() => {
|
|
38
|
-
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
w.value = Y({ delay: 300 }, n.onInputChangeCb);
|
|
44
|
+
}), b(
|
|
45
|
+
[o, () => h.value],
|
|
46
|
+
([t, e]) => {
|
|
47
|
+
e && W(() => {
|
|
48
|
+
if (!e) return;
|
|
49
|
+
const l = e.offsetWidth;
|
|
50
|
+
l !== v.value && (console.log("DEBUG:updating icon positioning", {
|
|
51
|
+
curInputValue: t
|
|
52
|
+
}), v.value = l);
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
{ immediate: !0 }
|
|
56
|
+
), b(
|
|
57
|
+
() => g.value?.selectedIdx,
|
|
45
58
|
(t) => {
|
|
46
59
|
const e = t ?? -1;
|
|
47
|
-
e !== -1 &&
|
|
60
|
+
e !== -1 && S(e);
|
|
48
61
|
}
|
|
49
|
-
),
|
|
50
|
-
|
|
62
|
+
), b(
|
|
63
|
+
a,
|
|
51
64
|
(t, e) => {
|
|
52
|
-
t === e || t?.label ===
|
|
65
|
+
t === e || t?.label === o.value || (o.value = t?.label || "");
|
|
53
66
|
},
|
|
54
67
|
{ immediate: !0 }
|
|
55
|
-
),
|
|
68
|
+
), $({
|
|
69
|
+
select: x,
|
|
70
|
+
getRootElement: () => g.value?.getRootElement()
|
|
71
|
+
}), (t, e) => (C(), V(J, {
|
|
56
72
|
ref: "dropdownRef",
|
|
57
73
|
class: "uikit-clearable-autocomplete",
|
|
58
|
-
"data-cy":
|
|
74
|
+
"data-cy": n.dataCy,
|
|
59
75
|
"dropdown-element": "ul",
|
|
60
|
-
"dropdown-classes": ["uikit-z-30",
|
|
61
|
-
"open-dropdown":
|
|
62
|
-
"keep-state": !
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"onUpdate:
|
|
66
|
-
|
|
76
|
+
"dropdown-classes": ["uikit-z-30", n.dropdownClasses],
|
|
77
|
+
"open-dropdown": r.value,
|
|
78
|
+
"keep-state": !i.value.length || n.keepState === "closed" ? "closed" : "opened",
|
|
79
|
+
"activate-keyboard-controller": n.enableKeyboardController,
|
|
80
|
+
"reset-keyboard-controller": k.value,
|
|
81
|
+
"onUpdate:resetKeyboardController": e[4] || (e[4] = (l) => k.value = l),
|
|
82
|
+
"onUpdate:dropdownState": e[5] || (e[5] = (l) => r.value = l)
|
|
67
83
|
}, {
|
|
68
|
-
btn_slot:
|
|
69
|
-
|
|
70
|
-
class:
|
|
84
|
+
btn_slot: y(() => [
|
|
85
|
+
u("div", {
|
|
86
|
+
class: f(["uikit-text-16", n.triggerWrapperClasses]),
|
|
87
|
+
onClick: e[3] || (e[3] = (l) => s("click", l))
|
|
71
88
|
}, [
|
|
72
89
|
c(t.$slots, "left-icon"),
|
|
73
|
-
|
|
74
|
-
class:
|
|
90
|
+
u("div", {
|
|
91
|
+
class: f(["uikit-relative", n.inputWrapperClasses])
|
|
75
92
|
}, [
|
|
76
|
-
|
|
93
|
+
F(u("input", {
|
|
94
|
+
ref: "inputRef",
|
|
77
95
|
"onUpdate:modelValue": [
|
|
78
|
-
e[0] || (e[0] = (
|
|
79
|
-
|
|
96
|
+
e[0] || (e[0] = (l) => o.value = l),
|
|
97
|
+
U
|
|
80
98
|
],
|
|
81
|
-
readonly: !!
|
|
82
|
-
class: "uikit-w-full uikit-border-none focus-visible:uikit-outline-none",
|
|
99
|
+
readonly: !!a.value?.label,
|
|
100
|
+
class: f(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", n.inputClasses]),
|
|
83
101
|
style: {
|
|
84
102
|
font: "inherit",
|
|
85
103
|
fontSize: "inherit"
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
[
|
|
104
|
+
},
|
|
105
|
+
placeholder: n.placeholder,
|
|
106
|
+
onKeydown: e[1] || (e[1] = (l) => s("keydown", l)),
|
|
107
|
+
onClick: e[2] || (e[2] = (l) => s("inputClick", l))
|
|
108
|
+
}, null, 42, Z), [
|
|
109
|
+
[H, o.value]
|
|
89
110
|
]),
|
|
90
|
-
|
|
111
|
+
u("span", {
|
|
91
112
|
ref_key: "hiddenSpan",
|
|
92
|
-
ref:
|
|
113
|
+
ref: h,
|
|
93
114
|
class: "uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre",
|
|
94
115
|
style: {
|
|
95
116
|
font: "inherit",
|
|
96
117
|
fontSize: "inherit"
|
|
97
118
|
}
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
key: 0,
|
|
119
|
+
}, G(o.value), 513),
|
|
120
|
+
F(u("button", {
|
|
101
121
|
type: "button",
|
|
102
|
-
class:
|
|
122
|
+
class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", n.clearButton?.classes]),
|
|
103
123
|
"aria-label": "Clear input",
|
|
104
|
-
style:
|
|
105
|
-
left: `${
|
|
124
|
+
style: X({
|
|
125
|
+
left: `${v.value + (n.clearButton?.offset || 10)}px`
|
|
106
126
|
}),
|
|
107
|
-
onClick:
|
|
127
|
+
onClick: P(R, ["stop"])
|
|
108
128
|
}, [
|
|
109
129
|
c(t.$slots, "clear-icon", {}, () => [
|
|
110
|
-
e[
|
|
130
|
+
e[6] || (e[6] = j("X", -1))
|
|
111
131
|
])
|
|
112
|
-
], 6)
|
|
132
|
+
], 6), [
|
|
133
|
+
[q, a.value?.label]
|
|
134
|
+
])
|
|
113
135
|
], 2),
|
|
114
136
|
c(t.$slots, "right-icon")
|
|
115
137
|
], 2)
|
|
116
138
|
]),
|
|
117
|
-
default:
|
|
118
|
-
(
|
|
119
|
-
key:
|
|
120
|
-
active:
|
|
139
|
+
default: y(({ activeIdx: l, setActiveIdx: z }) => [
|
|
140
|
+
(C(!0), I(N, null, A(i.value, (T, d) => (C(), V(Q, {
|
|
141
|
+
key: d,
|
|
142
|
+
active: l === d,
|
|
121
143
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
122
|
-
onClick: (
|
|
123
|
-
onMouseover: (
|
|
144
|
+
onClick: (D) => S(d),
|
|
145
|
+
onMouseover: (D) => z(d)
|
|
124
146
|
}, {
|
|
125
|
-
default:
|
|
147
|
+
default: y(() => [
|
|
126
148
|
c(t.$slots, "option-content", {
|
|
127
|
-
option:
|
|
128
|
-
idx:
|
|
149
|
+
option: T,
|
|
150
|
+
idx: d
|
|
129
151
|
}, () => [
|
|
130
|
-
|
|
131
|
-
innerHTML:
|
|
132
|
-
}, null, 8,
|
|
152
|
+
u("span", {
|
|
153
|
+
innerHTML: T.label
|
|
154
|
+
}, null, 8, _)
|
|
133
155
|
])
|
|
134
156
|
]),
|
|
135
157
|
_: 2
|
|
136
158
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
|
137
159
|
]),
|
|
138
160
|
_: 3
|
|
139
|
-
}, 8, ["data-cy", "dropdown-classes", "open-dropdown", "keep-state", "reset-keyboard-controller"]));
|
|
161
|
+
}, 8, ["data-cy", "dropdown-classes", "open-dropdown", "keep-state", "activate-keyboard-controller", "reset-keyboard-controller"]));
|
|
140
162
|
}
|
|
141
163
|
});
|
|
142
164
|
export {
|
|
143
|
-
|
|
165
|
+
ie as default
|
|
144
166
|
};
|
|
@@ -31,10 +31,7 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
31
31
|
}),
|
|
32
32
|
emits: /* @__PURE__ */ $(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
33
33
|
setup(t, { expose: S, emit: V }) {
|
|
34
|
-
const u = F(
|
|
35
|
-
t,
|
|
36
|
-
"modelValue"
|
|
37
|
-
), r = V, i = d(""), a = d([]), v = d(null), b = d(!1), n = d(!1), C = d(null), B = k(() => a.value.length);
|
|
34
|
+
const u = F(t, "modelValue"), r = V, i = d(""), a = d([]), v = d(null), b = d(!1), n = d(!1), C = d(null), B = k(() => a.value.length);
|
|
38
35
|
L(() => {
|
|
39
36
|
v.value = q({ delay: 300 }, t.onInputChangeCb);
|
|
40
37
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { ArrowIcon as
|
|
4
|
-
import { useKeyboardController as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as N, mergeModels as D, useId as R, useModel as E, shallowRef as x, computed as V, useTemplateRef as I, onMounted as z, onUnmounted as q, watch as l, nextTick as U, createElementBlock as j, openBlock as f, normalizeClass as i, renderSlot as K, createBlock as B, createVNode as F, unref as r, withCtx as L, createElementVNode as G, createCommentVNode as J, resolveDynamicComponent as P } from "vue";
|
|
2
|
+
import Q from "./BaseButton.vue.js";
|
|
3
|
+
import { ArrowIcon as X } from "@wikicasa-dev/svg-icons";
|
|
4
|
+
import { useKeyboardController as Y } from "@wikicasa-dev/vue-composables";
|
|
5
|
+
const Z = ["innerHTML"], le = /* @__PURE__ */ N({
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "BaseDropDown",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ D({
|
|
9
9
|
dropdownClasses: { default: "" },
|
|
10
10
|
btnClasses: { default: "" },
|
|
11
11
|
withArrowIcon: { type: Boolean, default: !1 },
|
|
@@ -27,124 +27,129 @@ const Q = ["innerHTML"], te = /* @__PURE__ */ L({
|
|
|
27
27
|
resetKeyboardController: { type: Boolean, default: !1 },
|
|
28
28
|
resetKeyboardControllerModifiers: {}
|
|
29
29
|
}),
|
|
30
|
-
emits: /* @__PURE__ */
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
|
|
30
|
+
emits: /* @__PURE__ */ D(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
|
|
31
|
+
setup(o, { expose: S, emit: A }) {
|
|
32
|
+
const n = o, k = R(), v = A, w = E(o, "toggleDropdown"), m = E(
|
|
33
|
+
o,
|
|
34
34
|
"resetKeyboardController"
|
|
35
|
-
)
|
|
35
|
+
);
|
|
36
|
+
let p = !1;
|
|
37
|
+
const t = x(!1), u = x([]), M = V(() => u.value.length), s = I("container"), y = I("dropdown"), { activeIdx: d, selectedIdx: a, onKeyDownHandler: O } = Y({
|
|
36
38
|
optionsLength: M,
|
|
37
|
-
isDropdownOpen:
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
isDropdownOpen: t,
|
|
40
|
+
global: !1
|
|
41
|
+
}), W = () => {
|
|
42
|
+
t.value = !1;
|
|
43
|
+
}, b = ({ target: e }) => {
|
|
44
|
+
s.value?.contains(e) || W();
|
|
45
|
+
}, h = (e) => {
|
|
46
|
+
t.value && s.value?.contains(document.activeElement) && e.key === "Tab" && (t.value = !1);
|
|
47
|
+
}, $ = (e) => {
|
|
48
|
+
n.activateKeyboardController && O(e);
|
|
49
|
+
}, c = () => {
|
|
50
|
+
n.keepState === "closed" && !t.value || n.keepState === "opened" && t.value || (t.value = !t.value);
|
|
51
|
+
}, T = (e) => {
|
|
52
|
+
e != null && (d.value = e);
|
|
53
|
+
}, H = (e) => {
|
|
54
|
+
e != null && (a.value = e);
|
|
55
|
+
}, C = () => {
|
|
56
|
+
y.value && (u.value = Array.from(y.value.children));
|
|
57
|
+
};
|
|
58
|
+
return z(() => {
|
|
59
|
+
C();
|
|
60
|
+
}), q(() => {
|
|
61
|
+
n.closeWhenClickedOutside && (document.removeEventListener("click", b), document.removeEventListener("keydown", h));
|
|
62
|
+
}), l(m, (e) => {
|
|
63
|
+
e && (d.value = -1, a.value = -1, U(() => {
|
|
64
|
+
C(), m.value = !1;
|
|
65
|
+
}));
|
|
66
|
+
}), l(
|
|
67
|
+
() => n.openDropdown,
|
|
42
68
|
(e) => {
|
|
43
|
-
|
|
69
|
+
t.value = e;
|
|
44
70
|
},
|
|
45
71
|
{
|
|
46
72
|
immediate: !0
|
|
47
73
|
}
|
|
48
|
-
),
|
|
49
|
-
|
|
50
|
-
}),
|
|
51
|
-
e
|
|
52
|
-
}),
|
|
53
|
-
e
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
H(() => {
|
|
65
|
-
l.closeWhenClickedOutside && document.body.addEventListener("click", b);
|
|
66
|
-
});
|
|
67
|
-
const y = () => {
|
|
68
|
-
p.value && (s.value = Array.from(p.value.children));
|
|
69
|
-
};
|
|
70
|
-
return N(() => {
|
|
71
|
-
y();
|
|
72
|
-
}), V(() => {
|
|
73
|
-
l.closeWhenClickedOutside && document.body.removeEventListener("click", b);
|
|
74
|
-
}), a(m, (e) => {
|
|
75
|
-
e && (r.value = -1, i.value = -1, R(() => {
|
|
76
|
-
y(), m.value = !1;
|
|
77
|
-
}));
|
|
78
|
-
}), I({
|
|
79
|
-
activeIdx: r,
|
|
80
|
-
selectedIdx: i
|
|
81
|
-
}), (e, u) => (f(), q("div", {
|
|
82
|
-
class: n(["uikit-relative uikit-block", e.$attrs.class]),
|
|
83
|
-
onClick: u[1] || (u[1] = g((X) => {
|
|
84
|
-
w("click"), c();
|
|
85
|
-
}, ["stop"]))
|
|
74
|
+
), l(t, (e) => {
|
|
75
|
+
v("update:dropdownState", e);
|
|
76
|
+
}), l(t, (e) => {
|
|
77
|
+
!e || p || !n.closeWhenClickedOutside || (document.addEventListener("click", b), document.addEventListener("keydown", h), p = !0);
|
|
78
|
+
}), l(w, (e) => {
|
|
79
|
+
e && (t.value = !t.value, w.value = !1);
|
|
80
|
+
}), l(a, (e) => {
|
|
81
|
+
e !== -1 && u.value[e].querySelector("a")?.click();
|
|
82
|
+
}), S({
|
|
83
|
+
activeIdx: d,
|
|
84
|
+
selectedIdx: a,
|
|
85
|
+
getRootElement: () => s.value
|
|
86
|
+
}), (e, g) => (f(), j("div", {
|
|
87
|
+
ref: "container",
|
|
88
|
+
class: i(["uikit-relative uikit-block", e.$attrs.class]),
|
|
89
|
+
onKeydown: $
|
|
86
90
|
}, [
|
|
87
|
-
|
|
91
|
+
K(e.$slots, "btn_slot", {
|
|
88
92
|
toggleDropdown: c,
|
|
89
|
-
isOpen:
|
|
93
|
+
isOpen: t.value
|
|
90
94
|
}, () => [
|
|
91
|
-
|
|
92
|
-
id:
|
|
95
|
+
F(Q, {
|
|
96
|
+
id: r(k),
|
|
93
97
|
type: "button",
|
|
94
|
-
"data-cy":
|
|
95
|
-
class:
|
|
98
|
+
"data-cy": o.dataCy,
|
|
99
|
+
class: i([
|
|
96
100
|
"!uikit-flex uikit-w-full uikit-items-center uikit-truncate",
|
|
97
|
-
|
|
101
|
+
o.btnClasses
|
|
98
102
|
]),
|
|
99
|
-
"aria-expanded":
|
|
100
|
-
"btn-class": "uikit-btn-single-selection"
|
|
103
|
+
"aria-expanded": t.value,
|
|
104
|
+
"btn-class": "uikit-btn-single-selection",
|
|
105
|
+
onClick: g[0] || (g[0] = (_) => {
|
|
106
|
+
v("click"), c();
|
|
107
|
+
})
|
|
101
108
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
|
|
104
|
-
class:
|
|
105
|
-
innerHTML:
|
|
106
|
-
}, null, 10,
|
|
107
|
-
|
|
109
|
+
default: L(() => [
|
|
110
|
+
G("span", {
|
|
111
|
+
class: i(["uikit-mr-5px", o.labelClasses]),
|
|
112
|
+
innerHTML: o.btnLabel
|
|
113
|
+
}, null, 10, Z),
|
|
114
|
+
o.withArrowIcon ? (f(), B(r(X), {
|
|
108
115
|
key: 0,
|
|
109
|
-
class:
|
|
110
|
-
width:
|
|
111
|
-
height:
|
|
112
|
-
"stroke-color":
|
|
113
|
-
}, null, 8, ["class", "width", "height", "stroke-color"])) :
|
|
116
|
+
class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
|
|
117
|
+
width: o.arrowWidth,
|
|
118
|
+
height: o.arrowWidth,
|
|
119
|
+
"stroke-color": o.arrowStrokeColor
|
|
120
|
+
}, null, 8, ["class", "width", "height", "stroke-color"])) : J("", !0)
|
|
114
121
|
]),
|
|
115
122
|
_: 1
|
|
116
123
|
}, 8, ["id", "data-cy", "class", "aria-expanded"])
|
|
117
124
|
]),
|
|
118
|
-
(f(),
|
|
119
|
-
id: "dropdown_" +
|
|
125
|
+
(f(), B(P(o.dropdownElement), {
|
|
126
|
+
id: "dropdown_" + r(k),
|
|
120
127
|
ref: "dropdown",
|
|
121
|
-
"data-cy":
|
|
122
|
-
class:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
{ "uikit-bottom-[55px] uikit-rounded-xs":
|
|
126
|
-
{ "uikit-rounded-b uikit-border-t-0":
|
|
127
|
-
{ "uikit-absolute":
|
|
128
|
+
"data-cy": o.dataCy && `${o.dataCy}_dropdown`,
|
|
129
|
+
class: i(["uikit-dropdown-content uikit-w-full uikit-flex-col uikit-overflow-y-auto uikit-border uikit-border-solid uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
|
|
130
|
+
o.dropdownClasses,
|
|
131
|
+
t.value ? "uikit-flex" : "uikit-hidden",
|
|
132
|
+
{ "uikit-bottom-[55px] uikit-rounded-xs": o.direction === "up" },
|
|
133
|
+
{ "uikit-rounded-b uikit-border-t-0": o.direction === "down" },
|
|
134
|
+
{ "uikit-absolute": o.isAbsolute }
|
|
128
135
|
]]),
|
|
129
|
-
"aria-hidden": !
|
|
130
|
-
onClick: u[0] || (u[0] = g(() => {
|
|
131
|
-
}, ["stop"]))
|
|
136
|
+
"aria-hidden": !t.value
|
|
132
137
|
}, {
|
|
133
|
-
default:
|
|
134
|
-
|
|
135
|
-
isOpen:
|
|
138
|
+
default: L(() => [
|
|
139
|
+
K(e.$slots, "default", {
|
|
140
|
+
isOpen: t.value,
|
|
136
141
|
toggleDropdown: c,
|
|
137
|
-
activeIdx: d
|
|
138
|
-
selectedIdx:
|
|
139
|
-
setActiveIdx:
|
|
140
|
-
setSelectedIdx:
|
|
142
|
+
activeIdx: r(d),
|
|
143
|
+
selectedIdx: r(a),
|
|
144
|
+
setActiveIdx: T,
|
|
145
|
+
setSelectedIdx: H
|
|
141
146
|
})
|
|
142
147
|
]),
|
|
143
148
|
_: 3
|
|
144
149
|
}, 8, ["id", "data-cy", "class", "aria-hidden"]))
|
|
145
|
-
],
|
|
150
|
+
], 34));
|
|
146
151
|
}
|
|
147
152
|
});
|
|
148
153
|
export {
|
|
149
|
-
|
|
154
|
+
le as default
|
|
150
155
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as d, createElementBlock as a, openBlock as s, withModifiers as
|
|
1
|
+
import { defineComponent as d, createElementBlock as a, openBlock as s, withModifiers as u, normalizeClass as t, createElementVNode as r, createCommentVNode as k } from "vue";
|
|
2
2
|
const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
|
|
3
3
|
__name: "BaseFloatingLabel",
|
|
4
4
|
props: {
|
|
@@ -11,14 +11,14 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["click"],
|
|
13
13
|
setup(e, { emit: n }) {
|
|
14
|
-
const
|
|
14
|
+
const o = n;
|
|
15
15
|
return (i, l) => (s(), a("label", {
|
|
16
16
|
for: i.$attrs.for,
|
|
17
|
-
class: t(["uikit-pointer-events-none uikit-absolute uikit-left-15px uikit-h-5
|
|
18
|
-
onClick: l[0] || (l[0] =
|
|
17
|
+
class: t(["uikit-pointer-events-none uikit-absolute uikit-left-15px uikit-h-5", [e.labelState, { "uikit-text-w-secondary": e.disabled }, e.labelClasses]]),
|
|
18
|
+
onClick: l[0] || (l[0] = u((f) => o("click"), ["stop"]))
|
|
19
19
|
}, [
|
|
20
|
-
|
|
21
|
-
class: t(["uikit-
|
|
20
|
+
r("span", {
|
|
21
|
+
class: t(["uikit-font-medium [font-size:inherit]", [
|
|
22
22
|
e.disabled ? "uikit-text-w-secondary" : "uikit-text-w-black",
|
|
23
23
|
e.labelTextClasses
|
|
24
24
|
]]),
|
|
@@ -26,12 +26,12 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
|
|
|
26
26
|
}, null, 10, c),
|
|
27
27
|
i.$attrs.required ? (s(), a("sup", {
|
|
28
28
|
key: 0,
|
|
29
|
-
class: t(["uikit-absolute -uikit-top-[0.3rem]
|
|
29
|
+
class: t(["uikit-absolute -uikit-top-[0.3rem] [font-size:inherit]", [
|
|
30
30
|
{ "uikit-text-w-secondary": e.disabled },
|
|
31
31
|
{ "uikit-text-w-danger": e.isValid === !1 },
|
|
32
32
|
{ "uikit-text-w-primary": (e.isValid || e.isValid === null) && !e.disabled }
|
|
33
33
|
]])
|
|
34
|
-
}, " *", 2)) :
|
|
34
|
+
}, " *", 2)) : k("", !0)
|
|
35
35
|
], 10, b));
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as I, ref as n, useTemplateRef as T, onUnmounted as z, watch as H, createBlock as O, openBlock as r, Teleport as $, createElementVNode as l, normalizeClass as s, withModifiers as y, createElementBlock as h, createCommentVNode as w, renderSlot as d, createVNode as D, unref as K, nextTick as N } from "vue";
|
|
2
2
|
import { isWindows as C, awaitableSetTimeout as S } from "@wikicasa-dev/utilities";
|
|
3
3
|
import { CloseIcon as V } from "@wikicasa-dev/svg-icons";
|
|
4
|
-
const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */
|
|
4
|
+
const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ I({
|
|
5
5
|
__name: "BaseModal",
|
|
6
6
|
props: {
|
|
7
7
|
id: { default: "base-bt-modal" },
|
|
@@ -11,6 +11,7 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
|
|
|
11
11
|
customModalHeaderClasses: {},
|
|
12
12
|
customModalBodyClasses: {},
|
|
13
13
|
customModalFooterClasses: {},
|
|
14
|
+
closeIcon: {},
|
|
14
15
|
withCloseIcon: { type: Boolean, default: !0 },
|
|
15
16
|
showModal: { type: Boolean, default: !0 },
|
|
16
17
|
headerTitle: { default: "" },
|
|
@@ -24,7 +25,7 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
|
|
|
24
25
|
},
|
|
25
26
|
emits: ["closed", "opened", "dialogClick"],
|
|
26
27
|
setup(e, { emit: g }) {
|
|
27
|
-
const c = g, i = n(!1), m = n(null), a =
|
|
28
|
+
const c = g, i = n(!1), m = n(null), a = T("modalDialog"), k = n(!1), u = n(!1), f = ({ key: t }) => {
|
|
28
29
|
t === "Escape" && o();
|
|
29
30
|
}, x = () => {
|
|
30
31
|
document?.body.addEventListener("keydown", f);
|
|
@@ -53,9 +54,9 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
|
|
|
53
54
|
m.value?.classList.add("uikit-hidden"), c("closed");
|
|
54
55
|
}, 250);
|
|
55
56
|
};
|
|
56
|
-
return
|
|
57
|
+
return z(() => {
|
|
57
58
|
b(), document?.documentElement.classList.remove("uikit-no-scrolling"), C() ? document?.body.classList.remove("uikit-no-scrolling", "sm:uikit-pr-15px") : document?.body.classList.remove("uikit-no-scrolling");
|
|
58
|
-
}),
|
|
59
|
+
}), H(
|
|
59
60
|
() => e.showModal,
|
|
60
61
|
async (t) => {
|
|
61
62
|
!t && !i.value ? k.value = !0 : k.value = !1, t && !i.value && await p(), !t && i.value && await o(), i.value = t;
|
|
@@ -102,16 +103,16 @@ const F = ["id", "data-cy"], U = ["innerHTML"], R = /* @__PURE__ */ T({
|
|
|
102
103
|
key: 0,
|
|
103
104
|
id: "close-icon-btn",
|
|
104
105
|
"data-cy": "bbt-default-close-icon-btn",
|
|
105
|
-
class: s(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent", e.closeIconBtnClasses]),
|
|
106
|
+
class: s(["uikit-absolute uikit-right-15px uikit-top-15px uikit-z-10 uikit-bg-transparent uikit-p-5px", e.closeIconBtnClasses]),
|
|
106
107
|
type: "button",
|
|
107
108
|
"aria-label": "Close",
|
|
108
109
|
onClick: y(o, ["prevent", "stop"])
|
|
109
110
|
}, [
|
|
110
111
|
D(K(V), {
|
|
111
|
-
class: "bbt-close-icon uikit-box-border
|
|
112
|
-
width: 30,
|
|
113
|
-
height: 30
|
|
114
|
-
})
|
|
112
|
+
class: s(["bbt-close-icon uikit-box-border", e.closeIcon?.classes]),
|
|
113
|
+
width: e.closeIcon?.size || 30,
|
|
114
|
+
height: e.closeIcon?.size || 30
|
|
115
|
+
}, null, 8, ["class", "width", "height"])
|
|
115
116
|
], 2)) : w("", !0),
|
|
116
117
|
d(t.$slots, "header", { closeModal: o }, () => [
|
|
117
118
|
l("span", {
|
|
@@ -14,7 +14,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
|
|
|
14
14
|
label: { default: "" },
|
|
15
15
|
modelValue: { type: Boolean, default: !1 }
|
|
16
16
|
},
|
|
17
|
-
emits: ["click", "
|
|
17
|
+
emits: ["click", "update:modelValue", "change"],
|
|
18
18
|
setup(e, { emit: r }) {
|
|
19
19
|
const l = f(), d = h(() => `${e.id ?? l}`), a = r;
|
|
20
20
|
b(
|
|
@@ -31,7 +31,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
|
|
|
31
31
|
}), a("update:modelValue", t));
|
|
32
32
|
};
|
|
33
33
|
return (t, o) => (u(), C("label", {
|
|
34
|
-
class: "uikit-flex uikit-items-center uikit-gap-[12px]
|
|
34
|
+
class: "uikit-checkbox-btn uikit-flex uikit-items-center uikit-gap-[12px]",
|
|
35
35
|
for: d.value,
|
|
36
36
|
onClick: o[0] || (o[0] = (s) => a("click", s))
|
|
37
37
|
}, [
|
|
@@ -40,7 +40,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
|
|
|
40
40
|
"model-value": e.modelValue,
|
|
41
41
|
"data-cy": e.dataCy,
|
|
42
42
|
disabled: e.disabled,
|
|
43
|
-
class: y(["
|
|
43
|
+
class: y(["uikit-inline-flex uikit-size-[20px] uikit-items-center uikit-justify-center uikit-rounded-[4px] uikit-p-0 data-[state='unchecked']:uikit-border data-[state='unchecked']:uikit-border-solid data-[state='unchecked']:uikit-border-w-lightgray", [
|
|
44
44
|
{
|
|
45
45
|
"uikit-bg-white": !e.modelValue,
|
|
46
46
|
"uikit-bg-w-primary": e.modelValue
|