@wikicasa-dev/components 2.2.9-alpha.38 → 2.2.9-alpha.4
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/AccessibleSelect.d.ts +4 -4
- package/dist/UIKit/AccessibleSelect.js +2 -3
- package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +3 -9
- package/dist/UIKit/BaseAutocomplete.d.ts +2 -2
- package/dist/UIKit/BaseButton.d.ts +8 -14
- package/dist/UIKit/BaseDropDown.d.ts +11 -17
- package/dist/UIKit/BaseInput.d.ts +2 -2
- package/dist/UIKit/BaseInput.js +2 -2
- package/dist/UIKit/BaseTextarea.d.ts +2 -2
- package/dist/assets/BaseDropDown.css +1 -1
- package/dist/assets/BaseInput.css +1 -1
- package/dist/assets/tailwind.css +1 -1
- package/dist/index.js +83 -84
- package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +157 -150
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +100 -116
- package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +5 -5
- package/dist/packages/components/lib/UIKit/BaseButton.vue.js +24 -28
- package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +105 -102
- package/dist/packages/components/lib/UIKit/BaseModal.vue.js +36 -42
- package/dist/packages/components/lib/UIKit/BaseSelect/SelectItem.vue.js +17 -18
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +26 -24
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js +14 -14
- package/package.json +5 -6
- package/dist/assets/AccessibleSelect.css +0 -1
- package/dist/composables/mock.d.ts +0 -25
- package/dist/composables/mock.js +0 -49
- /package/dist/assets/{swiper-thumbs.css → swiper-controller.css} +0 -0
|
@@ -1,187 +1,171 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as L, mergeModels as M, useModel as V, useTemplateRef as m, shallowRef as p, onBeforeMount as W, watch as b, nextTick as I, createBlock as F, openBlock as C, withCtx as y, createElementBlock as N, Fragment as A, renderList as H, renderSlot as f, createElementVNode as u, normalizeClass as v, withDirectives as $, vModelText as G, toDisplayString as P, withModifiers as X, normalizeStyle as j, createTextVNode as q, vShow as J } from "vue";
|
|
2
|
+
import Q from "../BaseDropDown.vue.js";
|
|
3
3
|
import '../../../../../assets/BaseDropDown.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import { debounce as
|
|
6
|
-
const
|
|
4
|
+
import Y from "../BaseSelect/SelectItem.vue.js";
|
|
5
|
+
import { debounce as Z } from "@wikicasa-dev/utilities";
|
|
6
|
+
const _ = ["readonly", "placeholder"], ee = ["innerHTML"], ue = /* @__PURE__ */ L({
|
|
7
7
|
__name: "ClearableAutocomplete",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ M({
|
|
9
9
|
dataCy: {},
|
|
10
10
|
placeholder: {},
|
|
11
11
|
enableKeyboardController: { type: Boolean, default: !0 },
|
|
12
12
|
triggerWrapperClasses: {},
|
|
13
13
|
inputWrapperClasses: {},
|
|
14
14
|
inputClasses: {},
|
|
15
|
-
hiddenTextClasses: {},
|
|
16
15
|
dropdownClasses: {},
|
|
17
16
|
clearButton: {},
|
|
18
17
|
keepState: {},
|
|
19
|
-
disableCb: { type: Boolean, default: !1 },
|
|
20
18
|
onInputChangeCb: { type: Function },
|
|
21
19
|
onOptionSelectedCb: { type: [Function, null] }
|
|
22
20
|
}, {
|
|
23
21
|
open: { type: Boolean, default: !1 },
|
|
24
22
|
openModifiers: {},
|
|
25
23
|
modelValue: { default: null },
|
|
26
|
-
modelModifiers: {}
|
|
27
|
-
inputValue: {
|
|
28
|
-
default: ""
|
|
29
|
-
},
|
|
30
|
-
inputValueModifiers: {}
|
|
24
|
+
modelModifiers: {}
|
|
31
25
|
}),
|
|
32
|
-
emits: /* @__PURE__ */
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!l) {
|
|
40
|
-
a.value = [], r.value = !1;
|
|
26
|
+
emits: /* @__PURE__ */ M(["click", "inputClick", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
|
|
27
|
+
setup(o, { expose: E, emit: O }) {
|
|
28
|
+
const s = V(o, "open"), a = V(o, "modelValue"), r = O, w = m("inputRef"), n = p(a.value?.label || ""), c = p(0), k = p(!1), g = p(null), i = p([]), h = m("dropdownRef"), S = m("hiddenSpan"), R = () => {
|
|
29
|
+
n.value = "", a.value = null, r("update:inputValue", "");
|
|
30
|
+
}, U = async (t) => {
|
|
31
|
+
if (r("update:inputValue", t), !t) {
|
|
32
|
+
i.value = [], s.value = !1;
|
|
41
33
|
return;
|
|
42
34
|
}
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
const e =
|
|
46
|
-
!e || e.id ===
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
35
|
+
i.value = await g.value?.(t) || [], k.value = !0, s.value = !!i.value.length;
|
|
36
|
+
}, T = (t = -1) => {
|
|
37
|
+
const e = i.value[t];
|
|
38
|
+
!e || e.id === a.value?.id || (o.onOptionSelectedCb?.(e), n.value = e.label, s.value = !1, a.value = e, i.value = []);
|
|
39
|
+
}, x = () => {
|
|
40
|
+
w.value?.select();
|
|
41
|
+
}, z = () => {
|
|
42
|
+
w.value?.focus();
|
|
51
43
|
};
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
}),
|
|
55
|
-
[
|
|
56
|
-
([,
|
|
57
|
-
|
|
58
|
-
if (!
|
|
59
|
-
const
|
|
60
|
-
|
|
44
|
+
return W(() => {
|
|
45
|
+
g.value = Z({ delay: 300 }, o.onInputChangeCb);
|
|
46
|
+
}), b(
|
|
47
|
+
[n, () => S.value],
|
|
48
|
+
([t, e]) => {
|
|
49
|
+
e && I(() => {
|
|
50
|
+
if (!e) return;
|
|
51
|
+
const l = e.offsetWidth;
|
|
52
|
+
l !== c.value && (console.log("DEBUG:updating icon positioning", {
|
|
53
|
+
curInputValue: t
|
|
54
|
+
}), c.value = l);
|
|
61
55
|
});
|
|
62
56
|
},
|
|
63
57
|
{ immediate: !0 }
|
|
64
|
-
),
|
|
65
|
-
() =>
|
|
66
|
-
(
|
|
67
|
-
const e =
|
|
68
|
-
e !== -1 &&
|
|
58
|
+
), b(
|
|
59
|
+
() => h.value?.selectedIdx,
|
|
60
|
+
(t) => {
|
|
61
|
+
const e = t ?? -1;
|
|
62
|
+
e !== -1 && T(e);
|
|
69
63
|
}
|
|
70
|
-
),
|
|
71
|
-
|
|
72
|
-
(
|
|
73
|
-
|
|
64
|
+
), b(
|
|
65
|
+
a,
|
|
66
|
+
(t, e) => {
|
|
67
|
+
t === e || t?.label === n.value || (n.value = t?.label || "");
|
|
74
68
|
},
|
|
75
69
|
{ immediate: !0 }
|
|
76
|
-
),
|
|
77
|
-
getRootElement: () =>
|
|
78
|
-
select:
|
|
79
|
-
focus:
|
|
80
|
-
}), (
|
|
70
|
+
), E({
|
|
71
|
+
getRootElement: () => h.value?.getRootElement(),
|
|
72
|
+
select: x,
|
|
73
|
+
focus: z
|
|
74
|
+
}), (t, e) => (C(), F(Q, {
|
|
81
75
|
ref: "dropdownRef",
|
|
82
76
|
class: "uikit-clearable-autocomplete",
|
|
83
|
-
"data-cy":
|
|
77
|
+
"data-cy": o.dataCy,
|
|
84
78
|
"dropdown-element": "ul",
|
|
85
|
-
"dropdown-classes": ["uikit-z-30",
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
"onUpdate:
|
|
79
|
+
"dropdown-classes": ["uikit-z-30", o.dropdownClasses],
|
|
80
|
+
"open-dropdown": s.value,
|
|
81
|
+
"keep-state": !i.value.length || o.keepState === "closed" ? "closed" : "opened",
|
|
82
|
+
"activate-keyboard-controller": o.enableKeyboardController,
|
|
83
|
+
"reset-keyboard-controller": k.value,
|
|
84
|
+
"onUpdate:resetKeyboardController": e[4] || (e[4] = (l) => k.value = l),
|
|
85
|
+
"onUpdate:dropdownState": e[5] || (e[5] = (l) => s.value = l)
|
|
92
86
|
}, {
|
|
93
|
-
btn_slot:
|
|
94
|
-
|
|
95
|
-
class:
|
|
96
|
-
onClick: e[
|
|
87
|
+
btn_slot: y(() => [
|
|
88
|
+
u("div", {
|
|
89
|
+
class: v(["uikit-text-16", o.triggerWrapperClasses]),
|
|
90
|
+
onClick: e[3] || (e[3] = (l) => r("click", l))
|
|
97
91
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
class: f(["uikit-relative", t.inputWrapperClasses])
|
|
92
|
+
f(t.$slots, "left-icon"),
|
|
93
|
+
u("div", {
|
|
94
|
+
class: v(["uikit-relative", o.inputWrapperClasses])
|
|
102
95
|
}, [
|
|
103
|
-
|
|
96
|
+
$(u("input", {
|
|
104
97
|
ref: "inputRef",
|
|
105
98
|
"onUpdate:modelValue": [
|
|
106
|
-
e[0] || (e[0] = (
|
|
107
|
-
|
|
99
|
+
e[0] || (e[0] = (l) => n.value = l),
|
|
100
|
+
U
|
|
108
101
|
],
|
|
109
|
-
|
|
110
|
-
"data-cy": t.dataCy ? `ac_input_${t.dataCy}` : "",
|
|
102
|
+
readonly: !!a.value?.label,
|
|
111
103
|
type: "text",
|
|
112
104
|
autocomplete: "off",
|
|
113
|
-
class:
|
|
105
|
+
class: v(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", o.inputClasses]),
|
|
114
106
|
style: {
|
|
115
107
|
font: "inherit",
|
|
116
108
|
fontSize: "inherit"
|
|
117
109
|
},
|
|
118
|
-
placeholder:
|
|
119
|
-
onKeydown: e[1] || (e[1] = (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
onClick: e[3] || (e[3] = (n) => {
|
|
124
|
-
p("inputClick", n), b.value?.select();
|
|
125
|
-
})
|
|
126
|
-
}, null, 42, ue), [
|
|
127
|
-
[Z, o.value]
|
|
110
|
+
placeholder: o.placeholder,
|
|
111
|
+
onKeydown: e[1] || (e[1] = (l) => r("keydown", l)),
|
|
112
|
+
onClick: e[2] || (e[2] = (l) => r("inputClick", l))
|
|
113
|
+
}, null, 42, _), [
|
|
114
|
+
[G, n.value]
|
|
128
115
|
]),
|
|
129
|
-
|
|
116
|
+
u("span", {
|
|
130
117
|
ref_key: "hiddenSpan",
|
|
131
|
-
ref:
|
|
132
|
-
class:
|
|
118
|
+
ref: S,
|
|
119
|
+
class: "uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre",
|
|
133
120
|
style: {
|
|
134
121
|
font: "inherit",
|
|
135
122
|
fontSize: "inherit"
|
|
136
123
|
}
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
ref: "clearButtonRef",
|
|
124
|
+
}, P(n.value), 513),
|
|
125
|
+
$(u("button", {
|
|
140
126
|
type: "button",
|
|
141
|
-
class:
|
|
127
|
+
class: v(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", o.clearButton?.classes]),
|
|
142
128
|
"aria-label": "Clear input",
|
|
143
|
-
style:
|
|
144
|
-
left: `${
|
|
145
|
-
width: t.clearButton?.width ? `${t.clearButton.width}px` : "auto",
|
|
146
|
-
height: t.clearButton?.height ? `${t.clearButton.height}px` : "auto"
|
|
129
|
+
style: j({
|
|
130
|
+
left: `${c.value + (o.clearButton?.offset || 10)}px`
|
|
147
131
|
}),
|
|
148
|
-
onClick:
|
|
132
|
+
onClick: X(R, ["stop"])
|
|
149
133
|
}, [
|
|
150
|
-
|
|
151
|
-
e[
|
|
134
|
+
f(t.$slots, "clear-icon", {}, () => [
|
|
135
|
+
e[6] || (e[6] = q("X", -1))
|
|
152
136
|
])
|
|
153
137
|
], 6), [
|
|
154
|
-
[
|
|
138
|
+
[J, a.value?.label && c.value]
|
|
155
139
|
])
|
|
156
140
|
], 2),
|
|
157
|
-
|
|
141
|
+
f(t.$slots, "right-icon")
|
|
158
142
|
], 2)
|
|
159
143
|
]),
|
|
160
|
-
default:
|
|
161
|
-
(
|
|
162
|
-
key:
|
|
163
|
-
active:
|
|
144
|
+
default: y(({ activeIdx: l, setActiveIdx: D }) => [
|
|
145
|
+
(C(!0), N(A, null, H(i.value, (B, d) => (C(), F(Y, {
|
|
146
|
+
key: d,
|
|
147
|
+
active: l === d,
|
|
164
148
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
165
|
-
onClick: (
|
|
166
|
-
onMouseover: (
|
|
149
|
+
onClick: (K) => T(d),
|
|
150
|
+
onMouseover: (K) => D(d)
|
|
167
151
|
}, {
|
|
168
|
-
default:
|
|
169
|
-
|
|
170
|
-
option:
|
|
171
|
-
idx:
|
|
152
|
+
default: y(() => [
|
|
153
|
+
f(t.$slots, "option-content", {
|
|
154
|
+
option: B,
|
|
155
|
+
idx: d
|
|
172
156
|
}, () => [
|
|
173
|
-
|
|
174
|
-
innerHTML:
|
|
175
|
-
}, null, 8,
|
|
157
|
+
u("span", {
|
|
158
|
+
innerHTML: B.label
|
|
159
|
+
}, null, 8, ee)
|
|
176
160
|
])
|
|
177
161
|
]),
|
|
178
162
|
_: 2
|
|
179
163
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
|
180
164
|
]),
|
|
181
165
|
_: 3
|
|
182
|
-
}, 8, ["data-cy", "dropdown-classes", "keep-state", "activate-keyboard-controller", "reset-keyboard-controller"
|
|
166
|
+
}, 8, ["data-cy", "dropdown-classes", "open-dropdown", "keep-state", "activate-keyboard-controller", "reset-keyboard-controller"]));
|
|
183
167
|
}
|
|
184
168
|
});
|
|
185
169
|
export {
|
|
186
|
-
|
|
170
|
+
ue as default
|
|
187
171
|
};
|
|
@@ -30,13 +30,13 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
30
30
|
modelModifiers: {}
|
|
31
31
|
}),
|
|
32
32
|
emits: /* @__PURE__ */ $(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
33
|
-
setup(t, { expose:
|
|
34
|
-
const u = F(t, "modelValue"), r =
|
|
33
|
+
setup(t, { expose: S, emit: V }) {
|
|
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);
|
|
35
35
|
L(() => {
|
|
36
36
|
v.value = q({ delay: 300 }, t.onInputChangeCb);
|
|
37
37
|
});
|
|
38
38
|
const { activeIdx: m, selectedIdx: h } = J({
|
|
39
|
-
optionsLength:
|
|
39
|
+
optionsLength: B,
|
|
40
40
|
isDropdownOpen: n,
|
|
41
41
|
disableSpaceHandler: !0
|
|
42
42
|
}), O = k(() => {
|
|
@@ -103,7 +103,7 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
103
103
|
}
|
|
104
104
|
), f(n, (e) => {
|
|
105
105
|
r("update:dropdownState", e);
|
|
106
|
-
}),
|
|
106
|
+
}), S({
|
|
107
107
|
select: () => {
|
|
108
108
|
C.value?.select();
|
|
109
109
|
}
|
|
@@ -126,7 +126,7 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
126
126
|
"keep-state": !a.value.length || t.keepState === "closed" ? "closed" : "opened",
|
|
127
127
|
"close-when-clicked-outside": t.closeDropdownOnBodyPressed,
|
|
128
128
|
"activate-keyboard-controller": !1,
|
|
129
|
-
"onUpdate:
|
|
129
|
+
"onUpdate:dropdownState": l[3] || (l[3] = (o) => n.value = o),
|
|
130
130
|
onClick: l[4] || (l[4] = (o) => {
|
|
131
131
|
r("click"), E();
|
|
132
132
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as c, ref as b, computed as l, createElementBlock as f, openBlock as v, withModifiers as s, normalizeStyle as B, normalizeClass as C, renderSlot as u, createVNode as M } from "vue";
|
|
2
|
+
import z from "../../../../UIKit/StaticSpinner.js";
|
|
3
|
+
const L = ["id", "data-cy", "type", "data-active", "disabled", "aria-label", "title"], $ = /* @__PURE__ */ c({
|
|
4
4
|
__name: "BaseButton",
|
|
5
5
|
props: {
|
|
6
6
|
btnClass: { default: "uikit-btn-w-primary" },
|
|
@@ -15,21 +15,18 @@ const S = ["id", "data-cy", "type", "data-active", "disabled", "aria-label", "ti
|
|
|
15
15
|
dataCy: {},
|
|
16
16
|
type: {}
|
|
17
17
|
},
|
|
18
|
-
emits: ["mouseover", "mouseout", "click"
|
|
19
|
-
setup(e, {
|
|
20
|
-
const o =
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
18
|
+
emits: ["mouseover", "mouseout", "click"],
|
|
19
|
+
setup(e, { emit: d }) {
|
|
20
|
+
const o = d, n = b(!1), r = l(() => e.size ? `uikit-btn-${e.size}` : ""), m = l(() => e.outlined ? "uikit-btn-outline" : ""), k = () => {
|
|
21
|
+
n.value = !0;
|
|
22
|
+
}, y = () => {
|
|
23
|
+
n.value = !1;
|
|
24
24
|
};
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
}), (n, t) => (w(), C("button", {
|
|
28
|
-
ref: "buttonEl",
|
|
29
|
-
id: n.$attrs.id,
|
|
25
|
+
return (a, t) => (v(), f("button", {
|
|
26
|
+
id: a.$attrs.id,
|
|
30
27
|
"data-cy": e.dataCy,
|
|
31
28
|
type: e.type,
|
|
32
|
-
class:
|
|
29
|
+
class: C([
|
|
33
30
|
"uikit-btn",
|
|
34
31
|
{
|
|
35
32
|
"uikit-btn-empty": !e.withMinWidth,
|
|
@@ -37,34 +34,33 @@ const S = ["id", "data-cy", "type", "data-active", "disabled", "aria-label", "ti
|
|
|
37
34
|
"uikit-flex uikit-items-center uikit-justify-center": e.isLoading
|
|
38
35
|
},
|
|
39
36
|
e.btnClass,
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
r.value,
|
|
38
|
+
m.value
|
|
42
39
|
]),
|
|
43
|
-
style:
|
|
40
|
+
style: B(a.$attrs.style),
|
|
44
41
|
"data-active": e.keepActive,
|
|
45
42
|
disabled: e.isLoading || e.disabled,
|
|
46
43
|
"aria-label": e.ariaLabel,
|
|
47
44
|
title: e.title,
|
|
48
45
|
onMouseover: t[0] || (t[0] = s((i) => {
|
|
49
|
-
|
|
46
|
+
k(), o("mouseover", i);
|
|
50
47
|
}, ["stop"])),
|
|
51
48
|
onMouseout: t[1] || (t[1] = s((i) => {
|
|
52
|
-
|
|
49
|
+
y(), o("mouseout", i);
|
|
53
50
|
}, ["stop"])),
|
|
54
|
-
onClick: t[2] || (t[2] = (i) => o("click", i))
|
|
55
|
-
onKeydown: t[3] || (t[3] = (i) => o("keydown", i))
|
|
51
|
+
onClick: t[2] || (t[2] = (i) => o("click", i))
|
|
56
52
|
}, [
|
|
57
|
-
e.isLoading ? u(
|
|
58
|
-
|
|
53
|
+
e.isLoading ? u(a.$slots, "spinner", { key: 1 }, () => [
|
|
54
|
+
M(z, {
|
|
59
55
|
"stroke-color": e.outlined ? "#ACB4C3" : "#fff"
|
|
60
56
|
}, null, 8, ["stroke-color"])
|
|
61
|
-
]) : u(
|
|
57
|
+
]) : u(a.$slots, "default", {
|
|
62
58
|
key: 0,
|
|
63
|
-
hover:
|
|
59
|
+
hover: n.value
|
|
64
60
|
})
|
|
65
|
-
], 46,
|
|
61
|
+
], 46, L));
|
|
66
62
|
}
|
|
67
63
|
});
|
|
68
64
|
export {
|
|
69
|
-
|
|
65
|
+
$ as default
|
|
70
66
|
};
|