@wikicasa-dev/components 1.2.30 → 1.2.32
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/AccessibleSelect.js +4 -1
- package/dist/BaseAccordion.js +4 -1
- package/dist/BaseAccordionBtn.js +4 -1
- package/dist/BaseAccordionContent.js +4 -1
- package/dist/BaseAccordionItem.js +4 -1
- package/dist/BaseAlert.js +4 -1
- package/dist/BaseAutocomplete.js +4 -1
- package/dist/BaseBadge.js +4 -1
- package/dist/BaseBtModal.js +188 -1
- package/dist/BaseButton.js +4 -1
- package/dist/BaseCard.js +34 -1
- package/dist/BaseComplexToggle.js +140 -1
- package/dist/BaseDropDown.js +4 -1
- package/dist/BaseFloatingLabel.js +49 -1
- package/dist/BaseIcon.js +41 -1
- package/dist/BaseInput.js +278 -1
- package/dist/BaseNavItem.js +59 -1
- package/dist/BasePagination.js +164 -1
- package/dist/BasePaper.js +15 -1
- package/dist/BaseSlider.js +261 -7
- package/dist/BaseSnackbar.js +80 -1
- package/dist/BaseTab.js +78 -1
- package/dist/BaseTextarea.js +143 -1
- package/dist/BaseToggle.js +45 -1
- package/dist/BaseTooltip.js +54 -1
- package/dist/BaseUploadFile.js +70 -1
- package/dist/CheckboxBtn.js +75 -1
- package/dist/CheckboxGroup.js +4 -1
- package/dist/IntersectionObservable.js +4 -1
- package/dist/IntersectionObserver.js +4 -1
- package/dist/RadioButton.js +59 -1
- package/dist/RadioGroup.js +66 -1
- package/dist/SelectItem.js +4 -1
- package/dist/StaticSpinner.js +32 -1
- package/dist/SwiperCarousel.js +4 -1
- package/dist/index.js +67 -1
- package/dist/useBreakpoints.js +21 -1
- package/dist/useFloatingLabel.js +33 -1
- package/dist/useKeyboardController.js +41 -1
- package/package.json +3 -10
- package/dist/chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.BsiqDUGT.js +0 -1
- package/dist/chunks/ArrowIcon.BkjChBnb.js +0 -1
- package/dist/chunks/BaseAccordion.vue_vue_type_script_setup_true_lang.f0Al20X4.js +0 -1
- package/dist/chunks/BaseAccordionBtn.vue_vue_type_script_setup_true_lang.C_HkVDZJ.js +0 -1
- package/dist/chunks/BaseAccordionContent.vue_vue_type_script_setup_true_lang.U3YQw0dV.js +0 -1
- package/dist/chunks/BaseAccordionItem.vue_vue_type_script_setup_true_lang.BiU7T1M1.js +0 -1
- package/dist/chunks/BaseAlert.vue_vue_type_script_setup_true_lang.CjFsLhwr.js +0 -1
- package/dist/chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.D8WvGQMa.js +0 -1
- package/dist/chunks/BaseBadge.vue_vue_type_style_index_0_lang.DjrBMyt7.js +0 -1
- package/dist/chunks/BaseButton.vue_vue_type_script_setup_true_lang.Ns4H_IBk.js +0 -1
- package/dist/chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.fEH9G16N.js +0 -1
- package/dist/chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.JeL27AzP.js +0 -1
- package/dist/chunks/CloseIcon.ClSHNHpF.js +0 -1
- package/dist/chunks/DefaultValues.S0CTWW-b.js +0 -1
- package/dist/chunks/IntersectionObservable.vue_vue_type_script_setup_true_lang.BPatqpa3.js +0 -1
- package/dist/chunks/IntersectionObserver.vue_vue_type_script_setup_true_lang.DYKR3Sel.js +0 -1
- package/dist/chunks/ObjectUtils.C5gq8MtL.js +0 -1
- package/dist/chunks/SelectItem.vue_vue_type_script_setup_true_lang.3ie26G8n.js +0 -1
- package/dist/chunks/SwiperCarousel.vue_vue_type_style_index_0_lang.CPn3IY_R.js +0 -5
- package/dist/chunks/_plugin-vue_export-helper.BHFhmbuH.js +0 -1
- package/dist/chunks/autoplay.Dyvby5gX.js +0 -1
- package/dist/chunks/controller.Dyvby5gX.js +0 -1
- package/dist/chunks/index.-WuGFU0l.js +0 -1
- package/dist/chunks/js.cookie.BMVAK0Pe.js +0 -1
- package/dist/chunks/thumbs.Dyvby5gX.js +0 -1
package/dist/BaseSlider.js
CHANGED
|
@@ -1,8 +1,262 @@
|
|
|
1
|
-
|
|
1
|
+
import './assets/BaseSlider.css';
|
|
2
|
+
import f from "./BaseInput.js";
|
|
3
|
+
import { defineComponent as c, resolveComponent as S, openBlock as V, createElementBlock as g, createElementVNode as a, withModifiers as h, createVNode as d } from "vue";
|
|
4
|
+
import { _ as x } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
|
+
function p(t, i) {
|
|
6
|
+
const e = parseInt(t.value, 10), l = parseInt(i.value, 10);
|
|
7
|
+
return [e, l];
|
|
8
|
+
}
|
|
9
|
+
const v = (t) => t.minPos + (Math.log(t.value) - t.minlval) / t.scale, $ = (t) => Math.exp(
|
|
10
|
+
(t.position - t.minPos) * t.scale + t.minlval
|
|
11
|
+
);
|
|
12
|
+
function m(t, i, e, l, s) {
|
|
13
|
+
const r = i.max - i.min, o = t - i.min, n = i.value - i.min;
|
|
14
|
+
s.style.background = `linear-gradient(
|
|
2
15
|
to right,
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${l} ${o/
|
|
6
|
-
${l} ${
|
|
7
|
-
${
|
|
8
|
-
${
|
|
16
|
+
${e} 0%,
|
|
17
|
+
${e} ${o / r * 100}%,
|
|
18
|
+
${l} ${o / r * 100}%,
|
|
19
|
+
${l} ${n / r * 100}%,
|
|
20
|
+
${e} ${n / r * 100}%,
|
|
21
|
+
${e} 100%)`;
|
|
22
|
+
}
|
|
23
|
+
function u(t, i) {
|
|
24
|
+
t <= 0 ? i.style.zIndex = "2" : i.style.zIndex = "0";
|
|
25
|
+
}
|
|
26
|
+
const I = c({
|
|
27
|
+
name: "BaseSlider",
|
|
28
|
+
components: { BaseInput: f },
|
|
29
|
+
props: {
|
|
30
|
+
type: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "linear"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ["minChanged", "maxChanged"],
|
|
36
|
+
data() {
|
|
37
|
+
return {
|
|
38
|
+
leftSliderLimit: 0,
|
|
39
|
+
rightSliderLimit: 100,
|
|
40
|
+
minValue: 0,
|
|
41
|
+
maxValue: 0,
|
|
42
|
+
sliderMinValue: 10,
|
|
43
|
+
sliderMaxValue: 40,
|
|
44
|
+
/* Logaritmic values */
|
|
45
|
+
minlval: 0,
|
|
46
|
+
maxlval: 0,
|
|
47
|
+
scale: 0
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
fromSlider() {
|
|
52
|
+
return this.$refs.fromSlider;
|
|
53
|
+
},
|
|
54
|
+
toSlider() {
|
|
55
|
+
return this.$refs.toSlider;
|
|
56
|
+
},
|
|
57
|
+
fromInput() {
|
|
58
|
+
return this.$refs.fromInput;
|
|
59
|
+
},
|
|
60
|
+
toInput() {
|
|
61
|
+
return this.$refs.toInput;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
watch: {
|
|
65
|
+
minValue(t) {
|
|
66
|
+
this.$emit("minChanged", t);
|
|
67
|
+
},
|
|
68
|
+
maxValue(t) {
|
|
69
|
+
this.$emit("maxChanged", t);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
created() {
|
|
73
|
+
this.leftSliderLimit = parseInt(`${this.$attrs.min || 0}`, 10), this.rightSliderLimit = parseInt(`${this.$attrs.max || 100}`, 10), this.sliderMinValue = this.leftSliderLimit, this.sliderMaxValue = this.rightSliderLimit, this.minValue = parseInt(
|
|
74
|
+
`${this.$attrs.minValue || this.leftSliderLimit}`,
|
|
75
|
+
10
|
|
76
|
+
), this.maxValue = parseInt(
|
|
77
|
+
`${this.$attrs.maxValue || this.rightSliderLimit}`,
|
|
78
|
+
10
|
|
79
|
+
), this.minlval = Math.log(this.minValue || 1), this.maxlval = Math.log(this.maxValue), this.scale = (this.maxlval - this.minlval) / (this.rightSliderLimit - this.leftSliderLimit);
|
|
80
|
+
},
|
|
81
|
+
mounted() {
|
|
82
|
+
!this.fromSlider || !this.toSlider || (m(
|
|
83
|
+
this.sliderMinValue,
|
|
84
|
+
{
|
|
85
|
+
min: this.leftSliderLimit,
|
|
86
|
+
max: this.rightSliderLimit,
|
|
87
|
+
value: this.sliderMaxValue
|
|
88
|
+
},
|
|
89
|
+
"#B4C2F0",
|
|
90
|
+
"#2B5DFF",
|
|
91
|
+
this.toSlider
|
|
92
|
+
), u(this.sliderMaxValue, this.toSlider));
|
|
93
|
+
},
|
|
94
|
+
methods: {
|
|
95
|
+
handleInputChange(t, i) {
|
|
96
|
+
if (!this.fromSlider || !this.toSlider)
|
|
97
|
+
return;
|
|
98
|
+
i || (i = "0");
|
|
99
|
+
const e = parseInt(i, 10);
|
|
100
|
+
if (t == "min-input") {
|
|
101
|
+
if (e >= this.maxValue)
|
|
102
|
+
return;
|
|
103
|
+
this.minValue = e, this.controlFromInput(this.toSlider);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
e < this.minValue || (this.maxValue = e, this.controlToInput(this.toSlider, this.toSlider));
|
|
107
|
+
},
|
|
108
|
+
getCurrentPosition(t) {
|
|
109
|
+
if (this.type === "logarithmic")
|
|
110
|
+
return t = t || 1, parseInt(
|
|
111
|
+
v({
|
|
112
|
+
value: t,
|
|
113
|
+
minPos: this.leftSliderLimit,
|
|
114
|
+
minlval: this.minlval,
|
|
115
|
+
scale: this.scale
|
|
116
|
+
}).toFixed(0),
|
|
117
|
+
10
|
|
118
|
+
);
|
|
119
|
+
if (this.type === "linear")
|
|
120
|
+
return t;
|
|
121
|
+
throw new Error("The slider type has not been implemented");
|
|
122
|
+
},
|
|
123
|
+
getCurrentValue(t) {
|
|
124
|
+
if (this.type === "logarithmic")
|
|
125
|
+
return t = t || 1, parseInt(
|
|
126
|
+
$({
|
|
127
|
+
position: t,
|
|
128
|
+
scale: this.scale,
|
|
129
|
+
minlval: this.minlval,
|
|
130
|
+
minPos: this.leftSliderLimit
|
|
131
|
+
}).toFixed(0),
|
|
132
|
+
10
|
|
133
|
+
);
|
|
134
|
+
if (this.type === "linear")
|
|
135
|
+
return t;
|
|
136
|
+
throw new Error("The slider type has not been implemented");
|
|
137
|
+
},
|
|
138
|
+
controlFromInput(t) {
|
|
139
|
+
const i = this.getCurrentPosition(this.minValue), e = this.getCurrentPosition(this.maxValue);
|
|
140
|
+
m(
|
|
141
|
+
i,
|
|
142
|
+
{
|
|
143
|
+
min: this.leftSliderLimit,
|
|
144
|
+
max: this.rightSliderLimit,
|
|
145
|
+
value: e
|
|
146
|
+
},
|
|
147
|
+
"#B4C2F0",
|
|
148
|
+
"#2B5DFF",
|
|
149
|
+
t
|
|
150
|
+
);
|
|
151
|
+
const l = i, s = this.maxValue;
|
|
152
|
+
l > s ? this.sliderMinValue = s : this.sliderMinValue = l;
|
|
153
|
+
},
|
|
154
|
+
controlToInput(t, i) {
|
|
155
|
+
const e = this.getCurrentPosition(this.minValue), l = this.getCurrentPosition(this.maxValue);
|
|
156
|
+
m(
|
|
157
|
+
e,
|
|
158
|
+
{
|
|
159
|
+
min: this.leftSliderLimit,
|
|
160
|
+
max: this.rightSliderLimit,
|
|
161
|
+
value: l
|
|
162
|
+
},
|
|
163
|
+
"#B4C2F0",
|
|
164
|
+
"#2B5DFF",
|
|
165
|
+
i
|
|
166
|
+
);
|
|
167
|
+
const s = this.minValue, r = l;
|
|
168
|
+
u(this.maxValue, t), s <= r ? this.sliderMaxValue = r : this.sliderMaxValue = s;
|
|
169
|
+
},
|
|
170
|
+
controlFromSlider(t, i) {
|
|
171
|
+
if (!this.toSlider)
|
|
172
|
+
return;
|
|
173
|
+
const [e, l] = p(t, i), s = this.getCurrentValue(e);
|
|
174
|
+
m(
|
|
175
|
+
e,
|
|
176
|
+
{
|
|
177
|
+
min: this.leftSliderLimit,
|
|
178
|
+
max: this.rightSliderLimit,
|
|
179
|
+
value: l
|
|
180
|
+
},
|
|
181
|
+
"#B4C2F0",
|
|
182
|
+
"#2B5DFF",
|
|
183
|
+
i
|
|
184
|
+
), e > l ? (t.value = `${l}`, this.sliderMinValue = l, this.minValue = l) : (this.sliderMinValue = e, this.minValue = s);
|
|
185
|
+
},
|
|
186
|
+
controlToSlider(t, i) {
|
|
187
|
+
if (!this.toSlider)
|
|
188
|
+
return;
|
|
189
|
+
const [e, l] = p(t, i), s = this.getCurrentValue(l);
|
|
190
|
+
m(
|
|
191
|
+
this.sliderMinValue,
|
|
192
|
+
{
|
|
193
|
+
min: this.leftSliderLimit,
|
|
194
|
+
max: this.rightSliderLimit,
|
|
195
|
+
value: l
|
|
196
|
+
},
|
|
197
|
+
"#B4C2F0",
|
|
198
|
+
"#2B5DFF",
|
|
199
|
+
i
|
|
200
|
+
), u(parseInt(this.toSlider.value, 10), i), e <= l ? (this.sliderMaxValue = l, this.maxValue = s) : (i.value = `${e}`, this.sliderMaxValue = e, this.maxValue = e);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}), L = { class: "range_container" }, M = { class: "sliders_control" }, F = ["value", "min", "max", "step"], C = ["value", "min", "max", "step"], P = { class: "form_control row" }, y = { class: "pb-15 pb-sm-0 col-sm-6 col-xl-4" }, B = { class: "col-sm-6 col-xl-4" };
|
|
204
|
+
function b(t, i, e, l, s, r) {
|
|
205
|
+
const o = S("base-input");
|
|
206
|
+
return V(), g("div", L, [
|
|
207
|
+
a("div", M, [
|
|
208
|
+
a("input", {
|
|
209
|
+
ref: "fromSlider",
|
|
210
|
+
class: "fromSlider",
|
|
211
|
+
type: "range",
|
|
212
|
+
value: t.sliderMinValue,
|
|
213
|
+
min: t.leftSliderLimit,
|
|
214
|
+
max: t.rightSliderLimit,
|
|
215
|
+
step: t.$attrs.step,
|
|
216
|
+
onInput: i[0] || (i[0] = h((n) => t.controlFromSlider(
|
|
217
|
+
t.fromSlider,
|
|
218
|
+
t.toSlider
|
|
219
|
+
), ["stop"]))
|
|
220
|
+
}, null, 40, F),
|
|
221
|
+
a("input", {
|
|
222
|
+
ref: "toSlider",
|
|
223
|
+
class: "toSlider",
|
|
224
|
+
type: "range",
|
|
225
|
+
value: t.sliderMaxValue,
|
|
226
|
+
min: t.leftSliderLimit,
|
|
227
|
+
max: t.rightSliderLimit,
|
|
228
|
+
step: t.$attrs.step,
|
|
229
|
+
onInput: i[1] || (i[1] = h((n) => t.controlToSlider(
|
|
230
|
+
t.fromSlider,
|
|
231
|
+
t.toSlider
|
|
232
|
+
), ["stop"]))
|
|
233
|
+
}, null, 40, C)
|
|
234
|
+
]),
|
|
235
|
+
a("div", P, [
|
|
236
|
+
a("div", y, [
|
|
237
|
+
d(o, {
|
|
238
|
+
"label-text": "Min",
|
|
239
|
+
type: "text",
|
|
240
|
+
pattern: "[0-9]*",
|
|
241
|
+
inputmode: "numeric",
|
|
242
|
+
"model-value": t.minValue,
|
|
243
|
+
"onUpdate:modelValue": i[2] || (i[2] = (n) => t.handleInputChange("min-input", n))
|
|
244
|
+
}, null, 8, ["model-value"])
|
|
245
|
+
]),
|
|
246
|
+
a("div", B, [
|
|
247
|
+
d(o, {
|
|
248
|
+
"label-text": "Max",
|
|
249
|
+
type: "text",
|
|
250
|
+
pattern: "[0-9]*",
|
|
251
|
+
inputmode: "numeric",
|
|
252
|
+
"model-value": t.maxValue,
|
|
253
|
+
"onUpdate:modelValue": i[3] || (i[3] = (n) => t.handleInputChange("max-input", n))
|
|
254
|
+
}, null, 8, ["model-value"])
|
|
255
|
+
])
|
|
256
|
+
])
|
|
257
|
+
]);
|
|
258
|
+
}
|
|
259
|
+
const _ = /* @__PURE__ */ x(I, [["render", b], ["__scopeId", "data-v-0fa5a933"]]);
|
|
260
|
+
export {
|
|
261
|
+
_ as default
|
|
262
|
+
};
|
package/dist/BaseSnackbar.js
CHANGED
|
@@ -1 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
import './assets/BaseSnackbar.css';
|
|
2
|
+
import { defineComponent as b, ref as u, onBeforeMount as f, openBlock as i, createElementBlock as e, createElementVNode as o, normalizeClass as h, withModifiers as l, createCommentVNode as a, createVNode as y, unref as x } from "vue";
|
|
3
|
+
import { C as _ } from "./chunks/CloseIcon.BiYjxFIs.js";
|
|
4
|
+
import { _ as v } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
|
+
const C = { class: "snackbar-container uikit-fixed uikit-bottom-10px uikit-left-10px uikit-z-[2000] max-sm:uikit-left-0 max-sm:uikit-w-full" }, g = ["data-cy"], w = ["src", "alt"], L = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "snackbar-type-icon uikit-bg-contain uikit-bg-no-repeat"
|
|
8
|
+
}, M = { class: "snackbar-text uikit-px-4 uikit-py-0 uikit-text uikit-font-regular max-sm:uikit-max-w-[80%] max-sm:uikit-pr-0 sm:uikit-text-16" }, T = ["innerHTML"], B = ["innerHTML"], S = /* @__PURE__ */ b({
|
|
9
|
+
inheritAttrs: !1,
|
|
10
|
+
__name: "BaseSnackbar",
|
|
11
|
+
props: {
|
|
12
|
+
type: { default: "" },
|
|
13
|
+
title: {},
|
|
14
|
+
body: {},
|
|
15
|
+
icon: {},
|
|
16
|
+
timeout: { default: 55e3 },
|
|
17
|
+
cb: { default: null }
|
|
18
|
+
},
|
|
19
|
+
emits: ["snackbar-hidden"],
|
|
20
|
+
setup(k, { emit: m }) {
|
|
21
|
+
const s = k, d = m, n = u(null), c = u(null), p = () => {
|
|
22
|
+
n.value && n.value();
|
|
23
|
+
}, r = () => {
|
|
24
|
+
const t = c.value;
|
|
25
|
+
t && (t.classList.remove("snackbar-active"), t.classList.add("snackbar-hidden"), setTimeout(() => {
|
|
26
|
+
d("snackbar-hidden");
|
|
27
|
+
}, 300));
|
|
28
|
+
};
|
|
29
|
+
return f(() => {
|
|
30
|
+
s.cb && (n.value = s.cb), setTimeout(() => {
|
|
31
|
+
r();
|
|
32
|
+
}, s.timeout);
|
|
33
|
+
}), (t, H) => (i(), e("div", C, [
|
|
34
|
+
o("div", {
|
|
35
|
+
ref_key: "snackbar",
|
|
36
|
+
ref: c,
|
|
37
|
+
"data-cy": t.$attrs["data-cy"],
|
|
38
|
+
class: h(["snackbar snackbar-active uikit-flex uikit-items-center uikit-rounded-[5px] uikit-px-4 uikit-py-10px uikit-font-medium uikit-shadow hover:uikit-cursor-pointer max-sm:uikit-relative max-sm:uikit-mx-10px max-sm:uikit-my-0", t.type]),
|
|
39
|
+
onClick: l(p, ["stop"])
|
|
40
|
+
}, [
|
|
41
|
+
t.icon ? (i(), e("img", {
|
|
42
|
+
key: 0,
|
|
43
|
+
src: t.icon.src,
|
|
44
|
+
alt: `${t.icon.alt}`,
|
|
45
|
+
width: "20",
|
|
46
|
+
height: "20"
|
|
47
|
+
}, null, 8, w)) : a("", !0),
|
|
48
|
+
t.type && !t.icon ? (i(), e("span", L)) : a("", !0),
|
|
49
|
+
o("div", M, [
|
|
50
|
+
t.title ? (i(), e("p", {
|
|
51
|
+
key: 0,
|
|
52
|
+
class: "uikit-m-0",
|
|
53
|
+
innerHTML: t.title
|
|
54
|
+
}, null, 8, T)) : a("", !0),
|
|
55
|
+
t.body ? (i(), e("p", {
|
|
56
|
+
key: 1,
|
|
57
|
+
class: "uikit-m-0",
|
|
58
|
+
innerHTML: t.body
|
|
59
|
+
}, null, 8, B)) : a("", !0)
|
|
60
|
+
]),
|
|
61
|
+
o("button", {
|
|
62
|
+
type: "button",
|
|
63
|
+
"data-cy": "base-snackbar-close-btn",
|
|
64
|
+
class: "uikit-bg-transparent max-sm:uikit-absolute max-sm:uikit-right-5",
|
|
65
|
+
onClick: l(r, ["stop"])
|
|
66
|
+
}, [
|
|
67
|
+
y(x(_), {
|
|
68
|
+
class: "snackbar-close-icon",
|
|
69
|
+
width: 20,
|
|
70
|
+
height: 20,
|
|
71
|
+
"stroke-color": "#000"
|
|
72
|
+
})
|
|
73
|
+
])
|
|
74
|
+
], 10, g)
|
|
75
|
+
]));
|
|
76
|
+
}
|
|
77
|
+
}), z = /* @__PURE__ */ v(S, [["__scopeId", "data-v-2ec55ec6"]]);
|
|
78
|
+
export {
|
|
79
|
+
z as default
|
|
80
|
+
};
|
package/dist/BaseTab.js
CHANGED
|
@@ -1 +1,78 @@
|
|
|
1
|
-
|
|
1
|
+
import r from "./BaseNavItem.js";
|
|
2
|
+
import { defineComponent as c, resolveComponent as m, openBlock as s, createElementBlock as o, normalizeClass as d, renderSlot as p, createVNode as l, Fragment as k, renderList as b, createBlock as u } from "vue";
|
|
3
|
+
import { _ as f } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
4
|
+
const v = c({
|
|
5
|
+
name: "BaseTab",
|
|
6
|
+
components: { BaseNavItem: r },
|
|
7
|
+
props: {
|
|
8
|
+
navTabsCustomClass: {
|
|
9
|
+
type: String
|
|
10
|
+
},
|
|
11
|
+
firstLabel: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "Tab1"
|
|
14
|
+
},
|
|
15
|
+
firstIconName: {
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
secondLabel: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "Tab2"
|
|
21
|
+
},
|
|
22
|
+
secondIconName: {
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
tabs: {
|
|
26
|
+
type: Array
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["clickedTab"],
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
selectedId: ""
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
handleClick(e) {
|
|
37
|
+
this.clickTab(e), this.$emit("clickedTab", e);
|
|
38
|
+
},
|
|
39
|
+
clickTab(e) {
|
|
40
|
+
this.selectedId = e;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
function C(e, i, y, I, T, $) {
|
|
45
|
+
const a = m("base-nav-item");
|
|
46
|
+
return s(), o("ul", {
|
|
47
|
+
class: d(["uikit-m-0 uikit-inline-flex uikit-list-none uikit-flex-wrap uikit-gap-5 uikit-p-0", [e.navTabsCustomClass]])
|
|
48
|
+
}, [
|
|
49
|
+
e.tabs ? (s(!0), o(k, { key: 1 }, b(e.tabs, (t, n) => (s(), u(a, {
|
|
50
|
+
id: t.id + "_" + n,
|
|
51
|
+
key: n,
|
|
52
|
+
text: t.label,
|
|
53
|
+
"is-active": e.selectedId === t.id + "_" + n,
|
|
54
|
+
"icon-name": t.iconName,
|
|
55
|
+
onClick: (g) => e.handleClick(`${t.id + "_" + n}`)
|
|
56
|
+
}, null, 8, ["id", "text", "is-active", "icon-name", "onClick"]))), 128)) : p(e.$slots, "custom", { key: 0 }, () => [
|
|
57
|
+
l(a, {
|
|
58
|
+
id: "tab1",
|
|
59
|
+
"is-active": e.selectedId === "tab1",
|
|
60
|
+
"icon-name": e.firstIconName,
|
|
61
|
+
text: e.firstLabel,
|
|
62
|
+
onClick: i[0] || (i[0] = (t) => e.handleClick("tab1"))
|
|
63
|
+
}, null, 8, ["is-active", "icon-name", "text"]),
|
|
64
|
+
l(a, {
|
|
65
|
+
id: "tab2",
|
|
66
|
+
ref: "tab2",
|
|
67
|
+
"is-active": e.selectedId === "tab2",
|
|
68
|
+
"icon-name": e.secondIconName,
|
|
69
|
+
text: e.secondLabel,
|
|
70
|
+
onClick: i[1] || (i[1] = (t) => e.handleClick("tab2"))
|
|
71
|
+
}, null, 8, ["is-active", "icon-name", "text"])
|
|
72
|
+
])
|
|
73
|
+
], 2);
|
|
74
|
+
}
|
|
75
|
+
const h = /* @__PURE__ */ f(v, [["render", C]]);
|
|
76
|
+
export {
|
|
77
|
+
h as default
|
|
78
|
+
};
|
package/dist/BaseTextarea.js
CHANGED
|
@@ -1 +1,143 @@
|
|
|
1
|
-
|
|
1
|
+
import './assets/BaseTextarea.css';
|
|
2
|
+
import f from "./BaseFloatingLabel.js";
|
|
3
|
+
import { useFloatingLabel as m } from "./useFloatingLabel.js";
|
|
4
|
+
import { defineComponent as h, resolveComponent as v, openBlock as l, createElementBlock as s, normalizeClass as t, createElementVNode as a, withModifiers as r, createCommentVNode as b, createVNode as g } from "vue";
|
|
5
|
+
import { _ as w } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
|
+
const y = h({
|
|
7
|
+
name: "BaseTextarea",
|
|
8
|
+
components: { BaseFloatingLabel: f },
|
|
9
|
+
inheritAttrs: !1,
|
|
10
|
+
props: {
|
|
11
|
+
labelText: { type: String, default: "" },
|
|
12
|
+
modelValue: { type: [String, Number] },
|
|
13
|
+
feedback: { type: Object },
|
|
14
|
+
isValid: { type: Boolean, default: null },
|
|
15
|
+
textAreaStyle: { type: String, default: "" },
|
|
16
|
+
isDisabled: { type: Boolean, default: !1 },
|
|
17
|
+
resize: { type: Boolean, default: !1 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue", "focusin", "focusout"],
|
|
20
|
+
setup(e, i) {
|
|
21
|
+
const { labelState: o, setInitialLabelState: u, handleFocusIn: n, handleFocusOut: d } = m(i.emit);
|
|
22
|
+
return {
|
|
23
|
+
labelState: o,
|
|
24
|
+
setInitialLabelState: u,
|
|
25
|
+
handleFocusIn: n,
|
|
26
|
+
handleFocusOut: d
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
//This inner value is useful in case the inner value of the textarea do not match with the modelValue
|
|
32
|
+
value: ""
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
textareaElem() {
|
|
37
|
+
return this.$refs.textarea;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
watch: {
|
|
41
|
+
modelValue(e) {
|
|
42
|
+
`${e}`.length > 0 && this.labelState !== "floating-label" && (this.labelState = "floating-label");
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
created() {
|
|
46
|
+
this.setInitialLabelState(this.modelValue);
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
handleOnChange({ target: e }) {
|
|
50
|
+
this.value = e.value, this.$emit("update:modelValue", e.value);
|
|
51
|
+
},
|
|
52
|
+
handleFloatingLabelClick() {
|
|
53
|
+
this.$refs.textarea.focus();
|
|
54
|
+
},
|
|
55
|
+
/* Favorite scenario: multiple baseTextarea */
|
|
56
|
+
disableTextarea() {
|
|
57
|
+
this.textareaElem.setAttribute("readonly", "readonly"), this.textareaElem.classList.add("disabled");
|
|
58
|
+
},
|
|
59
|
+
clearTextareaElem() {
|
|
60
|
+
this.textareaElem.value = "", console.log(this.textareaElem.value);
|
|
61
|
+
},
|
|
62
|
+
disableAndFocusTextarea() {
|
|
63
|
+
this.textareaElem.removeAttribute("readonly"), this.textareaElem.classList.remove("disabled"), this.$nextTick(() => {
|
|
64
|
+
this.textareaElem.focus();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}), V = ["id", "data-cy", "rows", "disabled", "aria-labelledby", "innerHTML"], c = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "uikit-visible uikit-float-none uikit-ml-2 uikit-block uikit-h-3 uikit-w-auto uikit-max-w-full uikit-overflow-hidden uikit-whitespace-nowrap uikit-p-0 uikit-text uikit-duration-[50s] uikit-ease-out"
|
|
71
|
+
}, $ = ["innerHTML"], T = ["innerHTML"];
|
|
72
|
+
function L(e, i, o, u, n, d) {
|
|
73
|
+
const p = v("base-floating-label");
|
|
74
|
+
return l(), s("div", {
|
|
75
|
+
class: t(e.$attrs["wrapper-classes"])
|
|
76
|
+
}, [
|
|
77
|
+
a("div", {
|
|
78
|
+
class: t(["input-wrapper uikit-relative uikit-mt-15px uikit-rounded-xs uikit-px-0", [
|
|
79
|
+
e.labelState === "floating-label" ? "floating-state" : "inline-state"
|
|
80
|
+
]])
|
|
81
|
+
}, [
|
|
82
|
+
a("textarea", {
|
|
83
|
+
id: e.$attrs.id,
|
|
84
|
+
ref: "textarea",
|
|
85
|
+
"data-cy": e.$attrs["data-cy"],
|
|
86
|
+
class: t(["textarea-scrollbar uikit-peer/fieldset uikit-w-full uikit-overflow-y-auto uikit-whitespace-pre-wrap uikit-rounded-xs uikit-border-0 uikit-bg-white uikit-bg-no-repeat uikit-px-15px uikit-pb-[8px] uikit-pt-15px uikit-outline-none", [
|
|
87
|
+
{ "uikit-bg-w-cultured": e.$attrs.disabled || e.isDisabled },
|
|
88
|
+
{ "is-invalid invalid-bg !uikit-pr-10": e.isValid === !1 },
|
|
89
|
+
{ "is-valid valid-bg !uikit-pr-10": e.isValid },
|
|
90
|
+
{ "uikit-resize-none": !e.resize }
|
|
91
|
+
]]),
|
|
92
|
+
rows: e.$attrs.rows,
|
|
93
|
+
disabled: e.$attrs.disabled,
|
|
94
|
+
"aria-labelledby": e.$attrs.id,
|
|
95
|
+
onFocusin: i[0] || (i[0] = r(() => e.handleFocusIn(), ["stop"])),
|
|
96
|
+
onFocusout: i[1] || (i[1] = r((k) => e.handleFocusOut(`${e.modelValue}`.trim() || e.value), ["stop"])),
|
|
97
|
+
onInput: i[2] || (i[2] = r((...k) => e.handleOnChange && e.handleOnChange(...k), ["stop"])),
|
|
98
|
+
innerHTML: e.modelValue
|
|
99
|
+
}, null, 42, V),
|
|
100
|
+
a("fieldset", {
|
|
101
|
+
class: t(["uikit-pointer-events-none uikit-absolute -uikit-top-5px uikit-bottom-5px uikit-left-0 uikit-right-0 uikit-m-0 uikit-min-w-0 uikit-overflow-hidden uikit-rounded-xs uikit-border uikit-border-solid uikit-px-2 uikit-text-start uikit-transition-[border] uikit-duration-100 uikit-ease-out peer-focus/fieldset:uikit-border-2 peer-focus/fieldset:uikit-border-w-primary", [
|
|
102
|
+
{ "is-invalid": e.isValid === !1, "is-valid": e.isValid },
|
|
103
|
+
{ "uikit-border-w-danger": e.isValid === !1 },
|
|
104
|
+
{ "uikit-border-w-primary": e.isValid },
|
|
105
|
+
{ "uikit-border-w-secondary": e.isValid === null }
|
|
106
|
+
]])
|
|
107
|
+
}, [
|
|
108
|
+
e.labelText ? (l(), s("legend", c, [
|
|
109
|
+
a("span", {
|
|
110
|
+
class: t(["uikit-px-5px uikit-opacity-0", [
|
|
111
|
+
{
|
|
112
|
+
"uikit-visible uikit-inline-block": e.labelState === "floating-label"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"uikit-invisible uikit-hidden": e.labelState === "inline-label"
|
|
116
|
+
}
|
|
117
|
+
]]),
|
|
118
|
+
innerHTML: e.labelText
|
|
119
|
+
}, null, 10, $)
|
|
120
|
+
])) : b("", !0)
|
|
121
|
+
], 2),
|
|
122
|
+
g(p, {
|
|
123
|
+
for: e.$attrs.id,
|
|
124
|
+
"label-text": e.labelText,
|
|
125
|
+
"label-state": e.labelState,
|
|
126
|
+
required: e.$attrs.required,
|
|
127
|
+
"is-valid": e.isValid,
|
|
128
|
+
onClick: e.handleFloatingLabelClick
|
|
129
|
+
}, null, 8, ["for", "label-text", "label-state", "required", "is-valid", "onClick"])
|
|
130
|
+
], 2),
|
|
131
|
+
(e.isValid || e.isValid === !1) && e.feedback ? (l(), s("div", {
|
|
132
|
+
key: 0,
|
|
133
|
+
class: t(
|
|
134
|
+
e.isValid === !1 ? "uikit-mt-1 uikit-text-12 uikit-text-w-danger" : "uikit-mt-1 uikit-text-12 uikit-text-w-primary"
|
|
135
|
+
),
|
|
136
|
+
innerHTML: e.isValid === !1 ? e.feedback.invalid : e.feedback.valid
|
|
137
|
+
}, null, 10, T)) : b("", !0)
|
|
138
|
+
], 2);
|
|
139
|
+
}
|
|
140
|
+
const x = /* @__PURE__ */ w(y, [["render", L], ["__scopeId", "data-v-244ae276"]]);
|
|
141
|
+
export {
|
|
142
|
+
x as default
|
|
143
|
+
};
|
package/dist/BaseToggle.js
CHANGED
|
@@ -1 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
import './assets/BaseToggle.css';
|
|
2
|
+
import { defineComponent as l, openBlock as a, createElementBlock as s, normalizeClass as u, renderSlot as o, createElementVNode as t, withModifiers as n, createCommentVNode as d, pushScopeId as k, popScopeId as c } from "vue";
|
|
3
|
+
import { _ as p } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
4
|
+
const b = l({
|
|
5
|
+
name: "BaseToggle",
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
props: {
|
|
8
|
+
withRightLabel: { type: Boolean, default: !0 },
|
|
9
|
+
label: { type: String, default: "" },
|
|
10
|
+
modelValue: { type: Boolean, default: !1 }
|
|
11
|
+
},
|
|
12
|
+
emits: ["update:modelValue"],
|
|
13
|
+
methods: {
|
|
14
|
+
handleToggle({ target: e }) {
|
|
15
|
+
this.$emit("update:modelValue", e.checked);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}), f = (e) => (k("data-v-b0a3ed96"), e = e(), c(), e), h = { class: "switch uikit-relative uikit-inline-block uikit-min-w-[40px] uikit-text-sm" }, m = ["data-cy", "checked"], g = /* @__PURE__ */ f(() => /* @__PURE__ */ t("span", { class: "slider round uikit-absolute uikit-bottom-0 uikit-left-0 uikit-right-0 uikit-top-0 uikit-cursor-pointer uikit-bg-w-lavender uikit-duration-300 before:uikit-absolute before:uikit-bottom-0 before:uikit-left-0 before:uikit-h-[22px] before:uikit-w-[22px] before:uikit-rounded-circle before:uikit-border before:uikit-border-solid before:uikit-border-w-secondary before:uikit-bg-white before:uikit-shadow-sm before:uikit-duration-300 before:uikit-content-[''] peer-checked/toggle:uikit-bg-w-primary" }, null, -1)), w = ["innerHTML"];
|
|
19
|
+
function y(e, i, _, $, v, B) {
|
|
20
|
+
return a(), s("div", {
|
|
21
|
+
class: u(["switch-container uikit-inline-block uikit-items-center", e.$attrs.class])
|
|
22
|
+
}, [
|
|
23
|
+
o(e.$slots, "leftLabel", {}, void 0, !0),
|
|
24
|
+
t("label", h, [
|
|
25
|
+
t("input", {
|
|
26
|
+
"data-cy": e.$attrs["data-cy"] ?? "",
|
|
27
|
+
class: "uikit-peer/toggle uikit-h-0 uikit-w-0 uikit-opacity-0",
|
|
28
|
+
type: "checkbox",
|
|
29
|
+
checked: e.modelValue,
|
|
30
|
+
onInput: i[0] || (i[0] = n((r) => e.handleToggle(r), ["stop"]))
|
|
31
|
+
}, null, 40, m),
|
|
32
|
+
g
|
|
33
|
+
]),
|
|
34
|
+
e.withRightLabel ? o(e.$slots, "rightLabel", { key: 0 }, () => [
|
|
35
|
+
t("span", {
|
|
36
|
+
class: "uikit-ml-10px",
|
|
37
|
+
innerHTML: e.label
|
|
38
|
+
}, null, 8, w)
|
|
39
|
+
], !0) : d("", !0)
|
|
40
|
+
], 2);
|
|
41
|
+
}
|
|
42
|
+
const V = /* @__PURE__ */ p(b, [["render", y], ["__scopeId", "data-v-b0a3ed96"]]);
|
|
43
|
+
export {
|
|
44
|
+
V as default
|
|
45
|
+
};
|