@codeandfunction/callaloo 4.9.1 → 4.9.3
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/callaloo.global.js +1 -1
- package/dist/chunks/CLCalendar.vue_vue_type_style_index_0_lang-Bz1JdT1A.js +163 -0
- package/dist/components/Containers/CLCarousel/CLCarousel.js +148 -144
- package/dist/components/Form/CLCalendar/CLCalendar.css +1 -1
- package/dist/components/Form/CLCalendar/CLCalendar.js +3 -3
- package/dist/components/Form/CLCalendar/CLCalendar.vue.d.ts +3 -0
- package/dist/components/Form/CLInput/CLInput.js +1 -0
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.css +1 -1
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.js +60 -61
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.vue.d.ts +2 -0
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.css +1 -1
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.js +53 -54
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.vue.d.ts +2 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/CLCalendar-XcUGsiWk.js +0 -159
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/test-setup.d.ts +0 -1
- /package/dist/components/Form/{CLInputDatePicker → CLInput}/CLInput.css +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import '../components/Form/CLCalendar/CLCalendar.css';
|
|
2
|
+
import { defineComponent as Y, mergeModels as w, useCssVars as Z, useModel as ee, ref as S, toRef as ae, watch as te, onMounted as le, createElementBlock as s, openBlock as r, normalizeClass as u, createElementVNode as M, createVNode as f, unref as e, withCtx as h, createTextVNode as v, toDisplayString as C, Fragment as V, renderList as $, createBlock as ie, createCommentVNode as re } from "vue";
|
|
3
|
+
import { _ as b } from "./CLButton.vue_vue_type_style_index_0_lang-MvhnNzVW.js";
|
|
4
|
+
import { _ as B } from "./CLText.vue_vue_type_style_index_0_lang-B-L8ECJL.js";
|
|
5
|
+
import { CLColorVariants as c, CLSizes as k, CLIconSizes as N, CLIconNames as P, CLBorderRadius as _, CLTextTypes as R, CLColors as g, CLAlign as ne } from "../index.js";
|
|
6
|
+
import { useDatePicker as oe } from "../composables/useDatePicker.js";
|
|
7
|
+
const de = ["data-testid"], ve = /* @__PURE__ */ Y({
|
|
8
|
+
name: "CLCalendar",
|
|
9
|
+
__name: "CLCalendar",
|
|
10
|
+
props: /* @__PURE__ */ w({
|
|
11
|
+
color: { default: g.Primary },
|
|
12
|
+
disabled: { type: Boolean, default: !1 },
|
|
13
|
+
busy: { type: Boolean, default: !1 },
|
|
14
|
+
isRange: { type: Boolean, default: !0 },
|
|
15
|
+
fluid: { type: Boolean, default: !1 },
|
|
16
|
+
testId: { default: "clll-calendar" },
|
|
17
|
+
width: { default: "280px" }
|
|
18
|
+
}, {
|
|
19
|
+
modelValue: {},
|
|
20
|
+
modelModifiers: {}
|
|
21
|
+
}),
|
|
22
|
+
emits: /* @__PURE__ */ w(["date-select"], ["update:modelValue"]),
|
|
23
|
+
setup(l, { expose: T, emit: E }) {
|
|
24
|
+
Z((t) => ({
|
|
25
|
+
v63768322: t.width
|
|
26
|
+
}));
|
|
27
|
+
const m = l, I = E, i = "clll-calendar", n = ee(l, "modelValue"), o = S(n.value?.end ?? null), d = S(n.value?.start ?? null), {
|
|
28
|
+
calendarGrid: F,
|
|
29
|
+
cancelDraft: G,
|
|
30
|
+
clearDraft: A,
|
|
31
|
+
currentMonthLabel: O,
|
|
32
|
+
draftEnd: D,
|
|
33
|
+
draftStart: x,
|
|
34
|
+
getDayAriaLabel: j,
|
|
35
|
+
handleNextMonth: q,
|
|
36
|
+
handlePrevMonth: H,
|
|
37
|
+
initializeDraft: p,
|
|
38
|
+
isDraftEnd: z,
|
|
39
|
+
isDraftStart: L,
|
|
40
|
+
isInDraftRange: J,
|
|
41
|
+
onDayClick: K,
|
|
42
|
+
weekDays: Q
|
|
43
|
+
} = oe({
|
|
44
|
+
appliedEnd: o,
|
|
45
|
+
appliedStart: d,
|
|
46
|
+
isRange: ae(m, "isRange")
|
|
47
|
+
});
|
|
48
|
+
te(n, (t) => {
|
|
49
|
+
d.value = t?.start ?? null, o.value = t?.end ?? null, p();
|
|
50
|
+
}, { deep: !0 }), le(() => {
|
|
51
|
+
p();
|
|
52
|
+
});
|
|
53
|
+
const U = (t, y) => {
|
|
54
|
+
y?.preventDefault(), y?.stopPropagation(), !(m.disabled || m.busy || !t) && (K(t), I("date-select", t));
|
|
55
|
+
};
|
|
56
|
+
return T({
|
|
57
|
+
apply: () => {
|
|
58
|
+
d.value = x.value, o.value = D.value, n.value = {
|
|
59
|
+
end: o.value,
|
|
60
|
+
start: d.value
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
cancel: () => {
|
|
64
|
+
G();
|
|
65
|
+
},
|
|
66
|
+
draftEnd: D,
|
|
67
|
+
draftStart: x,
|
|
68
|
+
initializeDraft: p,
|
|
69
|
+
reset: () => {
|
|
70
|
+
A(), d.value = null, o.value = null, n.value = null;
|
|
71
|
+
}
|
|
72
|
+
}), (t, y) => (r(), s("div", {
|
|
73
|
+
class: u([i, l.fluid ? `${i}__fluid` : ""]),
|
|
74
|
+
"data-testid": l.testId
|
|
75
|
+
}, [
|
|
76
|
+
M("div", {
|
|
77
|
+
class: u(`${i}__header`)
|
|
78
|
+
}, [
|
|
79
|
+
f(e(b), {
|
|
80
|
+
"aria-label": "Previous month",
|
|
81
|
+
"border-radius": e(_).Full,
|
|
82
|
+
"icon-before": e(P).ChevronLeft,
|
|
83
|
+
"icon-size": e(N).Tiny,
|
|
84
|
+
"on-click": e(H),
|
|
85
|
+
size: e(k).Tiny,
|
|
86
|
+
variant: e(c).Ghost,
|
|
87
|
+
height: "32px",
|
|
88
|
+
width: "32px",
|
|
89
|
+
wrap: ""
|
|
90
|
+
}, null, 8, ["border-radius", "icon-before", "icon-size", "on-click", "size", "variant"]),
|
|
91
|
+
f(e(B), {
|
|
92
|
+
type: e(R).Medium,
|
|
93
|
+
medium: ""
|
|
94
|
+
}, {
|
|
95
|
+
default: h(() => [
|
|
96
|
+
v(C(e(O)), 1)
|
|
97
|
+
]),
|
|
98
|
+
_: 1
|
|
99
|
+
}, 8, ["type"]),
|
|
100
|
+
f(e(b), {
|
|
101
|
+
"aria-label": "Next month",
|
|
102
|
+
"border-radius": e(_).Full,
|
|
103
|
+
"icon-before": e(P).ChevronRight,
|
|
104
|
+
"icon-size": e(N).Tiny,
|
|
105
|
+
"on-click": e(q),
|
|
106
|
+
size: e(k).Tiny,
|
|
107
|
+
variant: e(c).Ghost,
|
|
108
|
+
height: "32px",
|
|
109
|
+
width: "32px",
|
|
110
|
+
wrap: ""
|
|
111
|
+
}, null, 8, ["border-radius", "icon-before", "icon-size", "on-click", "size", "variant"])
|
|
112
|
+
], 2),
|
|
113
|
+
M("div", {
|
|
114
|
+
class: u(`${i}__grid`)
|
|
115
|
+
}, [
|
|
116
|
+
(r(!0), s(V, null, $(e(Q), (a) => (r(), s("div", {
|
|
117
|
+
key: a,
|
|
118
|
+
class: u(`${i}__weekday`)
|
|
119
|
+
}, [
|
|
120
|
+
f(e(B), {
|
|
121
|
+
align: e(ne).Center,
|
|
122
|
+
color: e(g).Neutral,
|
|
123
|
+
type: e(R).Small
|
|
124
|
+
}, {
|
|
125
|
+
default: h(() => [
|
|
126
|
+
v(C(a), 1)
|
|
127
|
+
]),
|
|
128
|
+
_: 2
|
|
129
|
+
}, 1032, ["align", "color", "type"])
|
|
130
|
+
], 2))), 128)),
|
|
131
|
+
(r(!0), s(V, null, $(e(F), (a, W) => (r(), s("div", {
|
|
132
|
+
key: a.date ?? `pad-${W}`,
|
|
133
|
+
class: u([
|
|
134
|
+
`${i}__cell`,
|
|
135
|
+
a.isOutsideMonth ? `${i}__cell--outside` : ""
|
|
136
|
+
])
|
|
137
|
+
}, [
|
|
138
|
+
a.day && a.date ? (r(), ie(e(b), {
|
|
139
|
+
key: 0,
|
|
140
|
+
"aria-label": e(j)(a.date),
|
|
141
|
+
"border-radius": e(_).Full,
|
|
142
|
+
color: e(L)(a.date) || e(z)(a.date) ? l.color : e(g).Secondary,
|
|
143
|
+
disabled: l.disabled || l.busy,
|
|
144
|
+
size: e(k).Small,
|
|
145
|
+
height: "100%",
|
|
146
|
+
width: "100%",
|
|
147
|
+
"on-click": (X) => U(a.date, X),
|
|
148
|
+
variant: e(L)(a.date) || e(z)(a.date) ? e(c).Solid : e(J)(a.date) ? e(c).Soft : e(c).Ghost,
|
|
149
|
+
wrap: ""
|
|
150
|
+
}, {
|
|
151
|
+
default: h(() => [
|
|
152
|
+
v(C(a.day), 1)
|
|
153
|
+
]),
|
|
154
|
+
_: 2
|
|
155
|
+
}, 1032, ["aria-label", "border-radius", "color", "disabled", "size", "on-click", "variant"])) : re("", !0)
|
|
156
|
+
], 2))), 128))
|
|
157
|
+
], 2)
|
|
158
|
+
], 10, de));
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
export {
|
|
162
|
+
ve as _
|
|
163
|
+
};
|