@3df-spa/ui 1.3.1 → 1.3.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/calendar.js +21 -21
- package/dist/carousel.js +38 -38
- package/dist/index.d.ts +303 -276
- package/dist/index.js +1724 -1654
- package/dist/ui.css +1 -1
- package/package.json +1 -1
package/dist/calendar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as j, useAttrs as E, computed as w, ref as A, watch as H, openBlock as f, createElementBlock as h, mergeProps as B, unref as
|
|
1
|
+
import { defineComponent as j, useAttrs as E, computed as w, ref as A, watch as H, openBlock as f, createElementBlock as h, mergeProps as B, unref as b, createElementVNode as a, normalizeClass as U, Fragment as P, renderList as R, createCommentVNode as $, toDisplayString as S, createBlock as _, withCtx as y, createVNode as k } from "vue";
|
|
2
2
|
import { startOfWeek as T, format as x, addDays as W, addMonths as F, startOfMonth as J, eachDayOfInterval as I, endOfMonth as K, endOfWeek as Q, isToday as X, isSameMonth as Y, isSameDay as V, subMonths as Z } from "date-fns";
|
|
3
3
|
import { c as C } from "./utils-C9QoOYNG.js";
|
|
4
4
|
import { _ as N, a as z, b as L } from "./UiPopoverTrigger.vue_vue_type_script_setup_true_lang-Ci8kd-fi.js";
|
|
@@ -33,7 +33,7 @@ function re(t, n, e) {
|
|
|
33
33
|
const r = e;
|
|
34
34
|
return r.to ? t > r.from && t < r.to : !1;
|
|
35
35
|
}
|
|
36
|
-
function le(t, n, e, r, s, g, c,
|
|
36
|
+
function le(t, n, e, r, s, g, c, p) {
|
|
37
37
|
const i = [];
|
|
38
38
|
for (let l = 0; l < n; l++) {
|
|
39
39
|
const v = F(t, l), M = J(v), D = T(M, { weekStartsOn: e });
|
|
@@ -56,7 +56,7 @@ function le(t, n, e, r, s, g, c, b) {
|
|
|
56
56
|
}));
|
|
57
57
|
i.push({
|
|
58
58
|
month: v,
|
|
59
|
-
label: x(v, "MMMM yyyy", { locale:
|
|
59
|
+
label: x(v, "MMMM yyyy", { locale: p }),
|
|
60
60
|
days: m
|
|
61
61
|
});
|
|
62
62
|
}
|
|
@@ -104,7 +104,7 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
104
104
|
u && (c.value = new Date(u));
|
|
105
105
|
}
|
|
106
106
|
);
|
|
107
|
-
function
|
|
107
|
+
function p() {
|
|
108
108
|
c.value = Z(c.value, 1);
|
|
109
109
|
}
|
|
110
110
|
function i() {
|
|
@@ -134,10 +134,10 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
return (u, m) => (f(), h("div", B(g.value, {
|
|
137
|
-
class:
|
|
137
|
+
class: b(C)("p-3", b(s).class)
|
|
138
138
|
}), [
|
|
139
139
|
a("div", {
|
|
140
|
-
class: U(
|
|
140
|
+
class: U(b(C)("flex", t.numberOfMonths > 1 && "gap-4"))
|
|
141
141
|
}, [
|
|
142
142
|
(f(!0), h(P, null, R(v.value, (d, O) => (f(), h("div", {
|
|
143
143
|
key: d.label,
|
|
@@ -149,7 +149,7 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
149
149
|
type: "button",
|
|
150
150
|
"aria-label": "Mes anterior",
|
|
151
151
|
class: "text-muted-foreground hover:bg-accent hover:text-accent-foreground absolute left-0 inline-flex h-7 w-7 items-center justify-center rounded-md bg-transparent text-sm font-medium transition-colors",
|
|
152
|
-
onClick:
|
|
152
|
+
onClick: p
|
|
153
153
|
}, [...m[0] || (m[0] = [
|
|
154
154
|
a("svg", {
|
|
155
155
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -208,11 +208,11 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
208
208
|
disabled: o.isDisabled,
|
|
209
209
|
"aria-selected": o.isSelected || void 0,
|
|
210
210
|
"aria-current": o.isToday ? "date" : void 0,
|
|
211
|
-
"aria-label":
|
|
211
|
+
"aria-label": b(x)(o.date, "PPPP", { locale: t.locale }),
|
|
212
212
|
"data-today": o.isToday || void 0,
|
|
213
213
|
"data-outside": !o.isCurrentMonth || void 0,
|
|
214
214
|
class: U(
|
|
215
|
-
|
|
215
|
+
b(C)(
|
|
216
216
|
"inline-flex h-9 w-9 items-center justify-center rounded-md p-0 text-sm font-normal",
|
|
217
217
|
"transition-colors duration-100",
|
|
218
218
|
"hover:bg-accent hover:text-accent-foreground",
|
|
@@ -234,7 +234,7 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
234
234
|
], 2)
|
|
235
235
|
], 16));
|
|
236
236
|
}
|
|
237
|
-
}),
|
|
237
|
+
}), pe = /* @__PURE__ */ j({
|
|
238
238
|
name: "UiDatePicker",
|
|
239
239
|
inheritAttrs: !1,
|
|
240
240
|
__name: "UiDatePicker",
|
|
@@ -252,7 +252,7 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
252
252
|
const { class: i, ...l } = s;
|
|
253
253
|
return l;
|
|
254
254
|
}), c = w(() => e.modelValue ? x(e.modelValue, e.formatStr, { locale: e.locale }) : null);
|
|
255
|
-
function
|
|
255
|
+
function p(i) {
|
|
256
256
|
r("update:modelValue", i);
|
|
257
257
|
}
|
|
258
258
|
return (i, l) => (f(), _(N, null, {
|
|
@@ -261,12 +261,12 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
261
261
|
default: y(() => [
|
|
262
262
|
a("button", B(g.value, {
|
|
263
263
|
type: "button",
|
|
264
|
-
class:
|
|
265
|
-
"inline-flex h-10 w-full
|
|
264
|
+
class: b(C)(
|
|
265
|
+
"inline-flex h-10 w-full items-center justify-start gap-2 rounded-md border-ui border-input bg-foreground/5 px-3 py-2 text-left text-sm ring-offset-background transition-colors",
|
|
266
266
|
"hover:bg-accent/50",
|
|
267
267
|
"focus-visible:outline-2 focus-visible:outline-ring",
|
|
268
268
|
!t.modelValue && "text-muted-foreground",
|
|
269
|
-
|
|
269
|
+
b(s).class
|
|
270
270
|
)
|
|
271
271
|
}), [
|
|
272
272
|
l[0] || (l[0] = a("svg", {
|
|
@@ -308,7 +308,7 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
308
308
|
disabled: t.disabled,
|
|
309
309
|
locale: t.locale,
|
|
310
310
|
"week-starts-on": t.weekStartsOn,
|
|
311
|
-
"onUpdate:modelValue":
|
|
311
|
+
"onUpdate:modelValue": p
|
|
312
312
|
}, null, 8, ["model-value", "disabled", "locale", "week-starts-on"])
|
|
313
313
|
]),
|
|
314
314
|
_: 1
|
|
@@ -342,7 +342,7 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
342
342
|
const v = x(e.modelValue.to, e.formatStr, i);
|
|
343
343
|
return `${l} – ${v}`;
|
|
344
344
|
});
|
|
345
|
-
function
|
|
345
|
+
function p(i) {
|
|
346
346
|
r("update:modelValue", i);
|
|
347
347
|
}
|
|
348
348
|
return (i, l) => (f(), _(N, null, {
|
|
@@ -351,12 +351,12 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
351
351
|
default: y(() => [
|
|
352
352
|
a("button", B(g.value, {
|
|
353
353
|
type: "button",
|
|
354
|
-
class:
|
|
355
|
-
"inline-flex h-10 w-full
|
|
354
|
+
class: b(C)(
|
|
355
|
+
"inline-flex h-10 w-full items-center justify-start gap-2 rounded-md border-ui border-input bg-foreground/5 px-3 py-2 text-left text-sm ring-offset-background transition-colors",
|
|
356
356
|
"hover:bg-accent/50",
|
|
357
357
|
"focus-visible:outline-2 focus-visible:outline-ring",
|
|
358
358
|
!t.modelValue && "text-muted-foreground",
|
|
359
|
-
|
|
359
|
+
b(s).class
|
|
360
360
|
)
|
|
361
361
|
}), [
|
|
362
362
|
l[0] || (l[0] = a("svg", {
|
|
@@ -399,7 +399,7 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
399
399
|
disabled: t.disabled,
|
|
400
400
|
locale: t.locale,
|
|
401
401
|
"week-starts-on": t.weekStartsOn,
|
|
402
|
-
"onUpdate:modelValue":
|
|
402
|
+
"onUpdate:modelValue": p
|
|
403
403
|
}, null, 8, ["model-value", "number-of-months", "disabled", "locale", "week-starts-on"])
|
|
404
404
|
]),
|
|
405
405
|
_: 1
|
|
@@ -411,6 +411,6 @@ const se = { class: "relative flex items-center justify-center pt-1 pb-4" }, ie
|
|
|
411
411
|
});
|
|
412
412
|
export {
|
|
413
413
|
q as Calendar,
|
|
414
|
-
|
|
414
|
+
pe as DatePicker,
|
|
415
415
|
we as DateRangePicker
|
|
416
416
|
};
|
package/dist/carousel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as p, useAttrs as v, computed as u, ref as
|
|
1
|
+
import { defineComponent as p, useAttrs as v, computed as u, ref as g, onMounted as R, nextTick as z, watch as B, onBeforeUnmount as D, provide as I, openBlock as m, createElementBlock as h, mergeProps as _, unref as o, renderSlot as S, inject as C, createElementVNode as c } from "vue";
|
|
2
2
|
import K from "embla-carousel";
|
|
3
3
|
import { c as w } from "./utils-C9QoOYNG.js";
|
|
4
4
|
const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
@@ -12,10 +12,10 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
12
12
|
},
|
|
13
13
|
emits: ["set-api"],
|
|
14
14
|
setup(d, { emit: s }) {
|
|
15
|
-
const
|
|
15
|
+
const e = d, l = s, n = v(), t = u(() => {
|
|
16
16
|
const { class: r, ...x } = n;
|
|
17
17
|
return x;
|
|
18
|
-
}), a =
|
|
18
|
+
}), a = g(), i = g(), U = g(!1), N = g(!1), E = u(() => e.orientation);
|
|
19
19
|
function y() {
|
|
20
20
|
i.value?.scrollPrev();
|
|
21
21
|
}
|
|
@@ -33,9 +33,9 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
33
33
|
if (!r) return;
|
|
34
34
|
P();
|
|
35
35
|
const x = {
|
|
36
|
-
...
|
|
37
|
-
axis:
|
|
38
|
-
}, f = K(r, x,
|
|
36
|
+
...e.opts,
|
|
37
|
+
axis: e.orientation === "vertical" ? "y" : "x"
|
|
38
|
+
}, f = K(r, x, e.plugins ?? []);
|
|
39
39
|
i.value = f, l("set-api", f), A(f), f.on("select", A), f.on("reInit", A);
|
|
40
40
|
}
|
|
41
41
|
R(() => {
|
|
@@ -43,7 +43,7 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
43
43
|
a.value && $();
|
|
44
44
|
});
|
|
45
45
|
}), B(
|
|
46
|
-
() => [
|
|
46
|
+
() => [e.opts, e.orientation],
|
|
47
47
|
() => {
|
|
48
48
|
z(() => $());
|
|
49
49
|
},
|
|
@@ -52,7 +52,7 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
52
52
|
P();
|
|
53
53
|
});
|
|
54
54
|
function j(r) {
|
|
55
|
-
r.key === "ArrowLeft" &&
|
|
55
|
+
r.key === "ArrowLeft" && e.orientation === "horizontal" ? (r.preventDefault(), y()) : r.key === "ArrowRight" && e.orientation === "horizontal" ? (r.preventDefault(), k()) : r.key === "ArrowUp" && e.orientation === "vertical" ? (r.preventDefault(), y()) : r.key === "ArrowDown" && e.orientation === "vertical" && (r.preventDefault(), k());
|
|
56
56
|
}
|
|
57
57
|
return I(b, {
|
|
58
58
|
orientation: E,
|
|
@@ -62,11 +62,11 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
62
62
|
canScrollNext: N,
|
|
63
63
|
scrollPrev: y,
|
|
64
64
|
scrollNext: k
|
|
65
|
-
}), (r, x) => (m(), h("div", _(
|
|
65
|
+
}), (r, x) => (m(), h("div", _(t.value, {
|
|
66
66
|
role: "region",
|
|
67
67
|
"aria-roledescription": "carousel",
|
|
68
68
|
tabindex: "0",
|
|
69
|
-
class: o(w)("relative", o(n).class),
|
|
69
|
+
class: o(w)("relative w-full", o(n).class),
|
|
70
70
|
onKeydown: j
|
|
71
71
|
}), [
|
|
72
72
|
S(r.$slots, "default")
|
|
@@ -77,23 +77,23 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
77
77
|
inheritAttrs: !1,
|
|
78
78
|
__name: "UiCarouselContent",
|
|
79
79
|
setup(d) {
|
|
80
|
-
const s =
|
|
81
|
-
const { class:
|
|
80
|
+
const s = C(b), e = v(), l = u(() => {
|
|
81
|
+
const { class: t, ...a } = e;
|
|
82
82
|
return a;
|
|
83
83
|
});
|
|
84
|
-
function n(
|
|
85
|
-
s.viewportRef.value =
|
|
84
|
+
function n(t) {
|
|
85
|
+
s.viewportRef.value = t;
|
|
86
86
|
}
|
|
87
87
|
return R(() => {
|
|
88
88
|
s.viewportRef.value;
|
|
89
|
-
}), (
|
|
89
|
+
}), (t, a) => (m(), h("div", {
|
|
90
90
|
ref: n,
|
|
91
91
|
class: "overflow-hidden"
|
|
92
92
|
}, [
|
|
93
93
|
c("div", _(l.value, {
|
|
94
|
-
class: o(w)("flex", o(s).orientation.value === "horizontal" ? "-ml-4" : "-mt-4 flex-col", o(
|
|
94
|
+
class: o(w)("flex", o(s).orientation.value === "horizontal" ? "-ml-4" : "-mt-4 flex-col", o(e).class)
|
|
95
95
|
}), [
|
|
96
|
-
S(
|
|
96
|
+
S(t.$slots, "default")
|
|
97
97
|
], 16)
|
|
98
98
|
]));
|
|
99
99
|
}
|
|
@@ -102,17 +102,17 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
102
102
|
inheritAttrs: !1,
|
|
103
103
|
__name: "UiCarouselItem",
|
|
104
104
|
setup(d) {
|
|
105
|
-
const s =
|
|
106
|
-
const { class: n, ...
|
|
107
|
-
return
|
|
105
|
+
const s = C(b), e = v(), l = u(() => {
|
|
106
|
+
const { class: n, ...t } = e;
|
|
107
|
+
return t;
|
|
108
108
|
});
|
|
109
|
-
return (n,
|
|
109
|
+
return (n, t) => (m(), h("div", _(l.value, {
|
|
110
110
|
role: "group",
|
|
111
111
|
"aria-roledescription": "slide",
|
|
112
112
|
class: o(w)(
|
|
113
113
|
"min-w-0 shrink-0 grow-0 basis-full",
|
|
114
114
|
o(s).orientation.value === "horizontal" ? "pl-4" : "pt-4",
|
|
115
|
-
o(
|
|
115
|
+
o(e).class
|
|
116
116
|
)
|
|
117
117
|
}), [
|
|
118
118
|
S(n.$slots, "default")
|
|
@@ -123,11 +123,11 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
123
123
|
inheritAttrs: !1,
|
|
124
124
|
__name: "UiCarouselPrevious",
|
|
125
125
|
setup(d) {
|
|
126
|
-
const s =
|
|
127
|
-
const { class: n, ...
|
|
128
|
-
return
|
|
126
|
+
const s = C(b), e = v(), l = u(() => {
|
|
127
|
+
const { class: n, ...t } = e;
|
|
128
|
+
return t;
|
|
129
129
|
});
|
|
130
|
-
return (n,
|
|
130
|
+
return (n, t) => (m(), h("button", _(l.value, {
|
|
131
131
|
type: "button",
|
|
132
132
|
disabled: !o(s).canScrollPrev.value,
|
|
133
133
|
"aria-label": "Slide anterior",
|
|
@@ -135,11 +135,11 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
135
135
|
"border-ui border-border bg-card absolute z-10 flex h-8 w-8 items-center justify-center rounded-full shadow-md transition-colors",
|
|
136
136
|
"hover:bg-accent hover:text-accent-foreground",
|
|
137
137
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
138
|
-
o(s).orientation.value === "horizontal" ? "top-1/2 -left-
|
|
139
|
-
o(
|
|
138
|
+
o(s).orientation.value === "horizontal" ? "top-1/2 -left-3 -translate-y-1/2 sm:-left-12" : "-top-3 left-1/2 -translate-x-1/2 rotate-90 sm:-top-12",
|
|
139
|
+
o(e).class
|
|
140
140
|
),
|
|
141
|
-
onClick:
|
|
142
|
-
}), [...
|
|
141
|
+
onClick: t[0] || (t[0] = (a) => o(s).scrollPrev())
|
|
142
|
+
}), [...t[1] || (t[1] = [
|
|
143
143
|
c("svg", {
|
|
144
144
|
xmlns: "http://www.w3.org/2000/svg",
|
|
145
145
|
width: "16",
|
|
@@ -162,11 +162,11 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
162
162
|
inheritAttrs: !1,
|
|
163
163
|
__name: "UiCarouselNext",
|
|
164
164
|
setup(d) {
|
|
165
|
-
const s =
|
|
166
|
-
const { class: n, ...
|
|
167
|
-
return
|
|
165
|
+
const s = C(b), e = v(), l = u(() => {
|
|
166
|
+
const { class: n, ...t } = e;
|
|
167
|
+
return t;
|
|
168
168
|
});
|
|
169
|
-
return (n,
|
|
169
|
+
return (n, t) => (m(), h("button", _(l.value, {
|
|
170
170
|
type: "button",
|
|
171
171
|
disabled: !o(s).canScrollNext.value,
|
|
172
172
|
"aria-label": "Siguiente slide",
|
|
@@ -174,11 +174,11 @@ const b = /* @__PURE__ */ Symbol("carousel"), Y = /* @__PURE__ */ p({
|
|
|
174
174
|
"border-ui border-border bg-card absolute z-10 flex h-8 w-8 items-center justify-center rounded-full shadow-md transition-colors",
|
|
175
175
|
"hover:bg-accent hover:text-accent-foreground",
|
|
176
176
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
177
|
-
o(s).orientation.value === "horizontal" ? "top-1/2 -right-
|
|
178
|
-
o(
|
|
177
|
+
o(s).orientation.value === "horizontal" ? "top-1/2 -right-3 -translate-y-1/2 sm:-right-12" : "-bottom-3 left-1/2 -translate-x-1/2 rotate-90 sm:-bottom-12",
|
|
178
|
+
o(e).class
|
|
179
179
|
),
|
|
180
|
-
onClick:
|
|
181
|
-
}), [...
|
|
180
|
+
onClick: t[0] || (t[0] = (a) => o(s).scrollNext())
|
|
181
|
+
}), [...t[1] || (t[1] = [
|
|
182
182
|
c("svg", {
|
|
183
183
|
xmlns: "http://www.w3.org/2000/svg",
|
|
184
184
|
width: "16",
|