@codeandfunction/callaloo 4.7.5 → 4.8.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/callaloo.global.js +1 -1
- package/dist/chunks/CLModal.vue_vue_type_style_index_0_lang-BDyONfaQ.js +176 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/components/CLTable/CLTable.js +14 -14
- package/dist/components/Containers/CLCarousel/CLCarousel.js +144 -148
- package/dist/components/Modals/CLModal/CLModal.js +3 -174
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.css +1 -0
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.js +267 -0
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.vue.d.ts +77 -0
- package/dist/components/Modals/CLModalDatePicker/index.d.ts +4 -0
- package/dist/components/Modals/index.d.ts +2 -1
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.js +438 -425
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.vue.d.ts +9 -2
- package/dist/composables/useDatePicker.d.ts +39 -0
- package/dist/composables/useDatePicker.js +136 -0
- package/dist/composables/useDatePicker.spec.js +232 -0
- package/dist/composables/useDropdown.d.ts +1 -1
- package/dist/composables/useDropdown.js +16 -16
- package/package.json +5 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import '../components/Modals/CLModal/CLModal.css';
|
|
2
|
+
import { defineComponent as W, useTemplateRef as F, useSlots as U, ref as Z, computed as m, watch as j, onMounted as q, onBeforeUnmount as A, createElementBlock as p, createCommentVNode as v, openBlock as w, normalizeStyle as y, normalizeClass as l, unref as n, createElementVNode as d, createBlock as B, renderSlot as $, withCtx as G, createTextVNode as J, toDisplayString as K } from "vue";
|
|
3
|
+
import { _ as P } from "./CLButton.vue_vue_type_style_index_0_lang-MvhnNzVW.js";
|
|
4
|
+
import { _ as Q } from "./CLHeading.vue_vue_type_style_index_0_lang-DH5oJc1C.js";
|
|
5
|
+
import { CLMode as k, CLColors as T, CLColorVariants as N, CLBorderRadius as X, CLIconSizes as Y, CLIconNames as ee, CLHeadingTypes as oe } from "../index.js";
|
|
6
|
+
import { g as te } from "./utils-D00IXMTR.js";
|
|
7
|
+
import { useTheme as ne } from "../composables/useTheme.js";
|
|
8
|
+
import { useEsc as le } from "../composables/useEsc.js";
|
|
9
|
+
import { c as S, i as a } from "./helper-qUkciePY.js";
|
|
10
|
+
const se = () => {
|
|
11
|
+
const { colors: t, darkMode: _ } = ne(), f = _.value ? k.Dark : k.Light, r = te({
|
|
12
|
+
color: T.Neutral,
|
|
13
|
+
colors: t.value,
|
|
14
|
+
mode: f,
|
|
15
|
+
variant: N.Solid
|
|
16
|
+
}), c = _.value ? "black" : "white";
|
|
17
|
+
return {
|
|
18
|
+
"--clll-modal-overlay-bg": r?.bg ?? "transparent",
|
|
19
|
+
"--clll-modal-content-bg": c,
|
|
20
|
+
"--clll-modal-theme-radius": "var(--clll-default-radius)"
|
|
21
|
+
};
|
|
22
|
+
}, ae = ["id", "data-testid"], re = ["aria-labelledby"], we = /* @__PURE__ */ W({
|
|
23
|
+
name: "CLModal",
|
|
24
|
+
__name: "CLModal",
|
|
25
|
+
props: {
|
|
26
|
+
borderRadius: { default: void 0 },
|
|
27
|
+
close: { type: Boolean, default: !0 },
|
|
28
|
+
closeBorderRadius: { default: X.Full },
|
|
29
|
+
dismissible: { type: Boolean, default: !0 },
|
|
30
|
+
fullscreen: { type: Boolean, default: !1 },
|
|
31
|
+
isOpen: { type: Boolean, default: !1 },
|
|
32
|
+
maxWidth: { default: "640px" },
|
|
33
|
+
modalId: {},
|
|
34
|
+
onClose: { type: Function, default: void 0 },
|
|
35
|
+
overlay: { type: Boolean, default: !0 },
|
|
36
|
+
testId: { default: "clll-modal" },
|
|
37
|
+
title: { default: void 0 },
|
|
38
|
+
zIndex: { default: 100 }
|
|
39
|
+
},
|
|
40
|
+
emits: ["modal-open", "modal-close"],
|
|
41
|
+
setup(t, { emit: _ }) {
|
|
42
|
+
const f = _, r = F("modal-window"), c = U(), o = t, e = "clll-modal", x = "clll-prevent-scroll", u = Z(), I = () => {
|
|
43
|
+
a && window?.document.body.classList.add(x);
|
|
44
|
+
}, C = () => {
|
|
45
|
+
a && window?.document.body.classList.remove(x);
|
|
46
|
+
}, R = m(() => [
|
|
47
|
+
e
|
|
48
|
+
]), E = m(() => [
|
|
49
|
+
`${e}__window`,
|
|
50
|
+
o.fullscreen ? `${e}__window--fullscreen` : ""
|
|
51
|
+
]), M = m(() => [
|
|
52
|
+
`${e}__content`,
|
|
53
|
+
o.borderRadius ? `${e}__content--${o.borderRadius}` : "",
|
|
54
|
+
o.close ? `${e}__content--has-close-button` : `${e}__content--has-no-close-button`,
|
|
55
|
+
c.body ? `${e}__content--has-body` : `${e}__content--has-no-body`,
|
|
56
|
+
c.footer ? `${e}__content--has-footer` : `${e}__content--has-no-footer`,
|
|
57
|
+
c.header || o.title ? `${e}__content--has-header` : `${e}__content--has-no-header`,
|
|
58
|
+
o.title ? `${e}__content--has-title` : `${e}__content--has-no-title`
|
|
59
|
+
]), O = m(() => o.zIndex === "auto" || S(o.zIndex) ? o.zIndex : o.zIndex.toString()), V = m(() => o.zIndex === "auto" ? o.zIndex : ((S(o.zIndex) ? parseInt(o.zIndex, 10) : o.zIndex) + 100).toString()), H = (s) => {
|
|
60
|
+
try {
|
|
61
|
+
const i = s?.target, g = r.value;
|
|
62
|
+
return a && g && !g.contains(i) ? !0 : void 0;
|
|
63
|
+
} catch (i) {
|
|
64
|
+
console.error(i);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
}, b = (s) => {
|
|
68
|
+
try {
|
|
69
|
+
H(s) && (a && window.removeEventListener("mousedown", b), L());
|
|
70
|
+
} catch (i) {
|
|
71
|
+
console.error(i);
|
|
72
|
+
}
|
|
73
|
+
}, h = () => {
|
|
74
|
+
a && window.removeEventListener("mousedown", b);
|
|
75
|
+
}, z = () => {
|
|
76
|
+
a && (u.value && a && window.clearTimeout(u.value), h(), C());
|
|
77
|
+
}, L = () => {
|
|
78
|
+
o.isOpen && (o.onClose?.(), z());
|
|
79
|
+
};
|
|
80
|
+
j(o, (s) => {
|
|
81
|
+
s.isOpen ? (f("modal-open"), I(), r.value && r.value.focus(), a && s.dismissible && (h(), u.value = window.setTimeout(() => {
|
|
82
|
+
window.addEventListener("mousedown", b);
|
|
83
|
+
}, 100))) : (r.value && r.value.blur(), C(), h(), u.value && a && window.clearTimeout(u.value), f("modal-close"));
|
|
84
|
+
}), q(() => {
|
|
85
|
+
o.isOpen && a && (I(), r.value && r.value.focus());
|
|
86
|
+
});
|
|
87
|
+
const { clearEventListeners: D } = le({ escHandler: o.dismissible ? L : void 0 });
|
|
88
|
+
return A(() => {
|
|
89
|
+
z(), D();
|
|
90
|
+
}), (s, i) => t.isOpen ? (w(), p("div", {
|
|
91
|
+
key: 0,
|
|
92
|
+
id: t.modalId,
|
|
93
|
+
class: l(n(R)),
|
|
94
|
+
"data-testid": t.testId,
|
|
95
|
+
style: y({ ...n(se)(), zIndex: n(O) })
|
|
96
|
+
}, [
|
|
97
|
+
d("div", {
|
|
98
|
+
class: l(n(E)),
|
|
99
|
+
style: y({ zIndex: n(V) })
|
|
100
|
+
}, [
|
|
101
|
+
d("div", {
|
|
102
|
+
ref: "modal-window",
|
|
103
|
+
"aria-modal": "true",
|
|
104
|
+
"aria-labelledby": `${e}__content__header__title`,
|
|
105
|
+
class: l(n(M)),
|
|
106
|
+
role: "dialog",
|
|
107
|
+
tabindex: -1,
|
|
108
|
+
style: y({ "--clll-modal-max-width": t.maxWidth })
|
|
109
|
+
}, [
|
|
110
|
+
d("div", {
|
|
111
|
+
class: l(`${e}__close-button`)
|
|
112
|
+
}, [
|
|
113
|
+
t.onClose && t.close ? (w(), B(n(P), {
|
|
114
|
+
key: 0,
|
|
115
|
+
"aria-label": "Close modal",
|
|
116
|
+
"border-radius": t.closeBorderRadius,
|
|
117
|
+
color: n(T).Neutral,
|
|
118
|
+
"icon-before": n(ee).Delete,
|
|
119
|
+
"icon-size": n(Y).Tiny,
|
|
120
|
+
"on-click": t.onClose,
|
|
121
|
+
"test-id": `${e}__close-button`,
|
|
122
|
+
variant: n(N).Text
|
|
123
|
+
}, null, 8, ["border-radius", "color", "icon-before", "icon-size", "on-click", "test-id", "variant"])) : v("", !0)
|
|
124
|
+
], 2),
|
|
125
|
+
d("div", {
|
|
126
|
+
class: l(`${e}__content__header`)
|
|
127
|
+
}, [
|
|
128
|
+
d("div", {
|
|
129
|
+
class: l(`${e}__content__title`)
|
|
130
|
+
}, [
|
|
131
|
+
d("div", {
|
|
132
|
+
class: l(`${e}__content__header__container`)
|
|
133
|
+
}, [
|
|
134
|
+
t.title ? (w(), B(n(Q), {
|
|
135
|
+
key: 0,
|
|
136
|
+
id: `${e}__content__header__title`,
|
|
137
|
+
class: l(`${e}__content__header__title`),
|
|
138
|
+
type: n(oe).Section
|
|
139
|
+
}, {
|
|
140
|
+
default: G(() => [
|
|
141
|
+
J(K(t.title), 1)
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
144
|
+
}, 8, ["id", "class", "type"])) : v("", !0),
|
|
145
|
+
$(s.$slots, "header")
|
|
146
|
+
], 2)
|
|
147
|
+
], 2)
|
|
148
|
+
], 2),
|
|
149
|
+
d("div", {
|
|
150
|
+
class: l(`${e}__content__scroller`)
|
|
151
|
+
}, [
|
|
152
|
+
d("div", {
|
|
153
|
+
class: l(`${e}__content__body`)
|
|
154
|
+
}, [
|
|
155
|
+
$(s.$slots, "body")
|
|
156
|
+
], 2)
|
|
157
|
+
], 2),
|
|
158
|
+
d("div", {
|
|
159
|
+
class: l(`${e}__content__footer`)
|
|
160
|
+
}, [
|
|
161
|
+
$(s.$slots, "footer")
|
|
162
|
+
], 2)
|
|
163
|
+
], 14, re)
|
|
164
|
+
], 6),
|
|
165
|
+
t.overlay ? (w(), p("div", {
|
|
166
|
+
key: 0,
|
|
167
|
+
ref: "overlay-ref",
|
|
168
|
+
class: l(`${e}__overlay`),
|
|
169
|
+
style: y({ zIndex: t.zIndex })
|
|
170
|
+
}, null, 6)) : v("", !0)
|
|
171
|
+
], 14, ae)) : v("", !0);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export {
|
|
175
|
+
we as _
|
|
176
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../assets/core.css';
|
|
2
2
|
import './CLTable.css';
|
|
3
|
-
import { defineComponent as i, computed as b, createElementBlock as
|
|
3
|
+
import { defineComponent as i, computed as b, createElementBlock as a, openBlock as o, normalizeStyle as p, normalizeClass as s, unref as d, createElementVNode as h, createCommentVNode as y, renderSlot as r, Fragment as k, renderList as L, createVNode as T, withCtx as v } from "vue";
|
|
4
4
|
import { CLMode as C, CLColorVariants as B, CLColors as w, CLTableTypes as g, CLTextTypes as H } from "../../index.js";
|
|
5
5
|
import { g as N } from "../../chunks/utils-D00IXMTR.js";
|
|
6
6
|
import { useTheme as x } from "../../composables/useTheme.js";
|
|
@@ -25,7 +25,7 @@ const A = () => {
|
|
|
25
25
|
borderRadius: {},
|
|
26
26
|
colWidths: {},
|
|
27
27
|
id: { default: "main" },
|
|
28
|
-
rounded: { type: Boolean, default: !
|
|
28
|
+
rounded: { type: Boolean, default: !1 },
|
|
29
29
|
rowHeight: { default: "auto" },
|
|
30
30
|
striped: { type: Boolean },
|
|
31
31
|
testId: { default: "clll-table" },
|
|
@@ -45,7 +45,7 @@ const A = () => {
|
|
|
45
45
|
t.withVerticalLines ? `${e}--vertical-lines` : void 0,
|
|
46
46
|
t.bordered ? `${e}--bordered` : void 0
|
|
47
47
|
]);
|
|
48
|
-
return (c, m) => (
|
|
48
|
+
return (c, m) => (o(), a("div", {
|
|
49
49
|
class: s(d(n)),
|
|
50
50
|
"data-testid": l.testId,
|
|
51
51
|
style: p(d(A)())
|
|
@@ -55,8 +55,8 @@ const A = () => {
|
|
|
55
55
|
class: s(d(u)),
|
|
56
56
|
style: p({ "--clll-table-row-height": l.rowHeight })
|
|
57
57
|
}, [
|
|
58
|
-
l.colWidths?.length ? (
|
|
59
|
-
(
|
|
58
|
+
l.colWidths?.length ? (o(), a("colgroup", F, [
|
|
59
|
+
(o(!0), a(k, null, L(l.colWidths, (_, $) => (o(), a("col", {
|
|
60
60
|
key: `table-${l.id}-col-${$}`,
|
|
61
61
|
style: p({ width: _ })
|
|
62
62
|
}, null, 4))), 128))
|
|
@@ -69,7 +69,7 @@ const A = () => {
|
|
|
69
69
|
name: "CLTableBody",
|
|
70
70
|
__name: "CLTableBody",
|
|
71
71
|
setup(l) {
|
|
72
|
-
return (t, e) => (
|
|
72
|
+
return (t, e) => (o(), a("tbody", {
|
|
73
73
|
class: s([z])
|
|
74
74
|
}, [
|
|
75
75
|
r(t.$slots, "default")
|
|
@@ -95,25 +95,25 @@ const A = () => {
|
|
|
95
95
|
t.isActive ? `${e}--active` : "",
|
|
96
96
|
t.onClick ? `${e}--clickable` : ""
|
|
97
97
|
]), u = () => t?.onClick?.();
|
|
98
|
-
return (c, m) => l.isHeader ? (
|
|
98
|
+
return (c, m) => l.isHeader ? (o(), a("th", {
|
|
99
99
|
key: 0,
|
|
100
100
|
class: s(d(n)),
|
|
101
101
|
colspan: l.colSpan,
|
|
102
102
|
onClick: u
|
|
103
103
|
}, [
|
|
104
|
-
l.isAction ? (
|
|
104
|
+
l.isAction ? (o(), a("div", {
|
|
105
105
|
key: 1,
|
|
106
106
|
class: s(`${e}__actions`)
|
|
107
107
|
}, [
|
|
108
108
|
r(c.$slots, "default")
|
|
109
109
|
], 2)) : r(c.$slots, "default", { key: 0 })
|
|
110
|
-
], 10, E)) : (
|
|
110
|
+
], 10, E)) : (o(), a("td", {
|
|
111
111
|
key: 1,
|
|
112
112
|
class: s(d(n)),
|
|
113
113
|
colspan: l.colSpan,
|
|
114
114
|
onClick: u
|
|
115
115
|
}, [
|
|
116
|
-
l.isAction ? (
|
|
116
|
+
l.isAction ? (o(), a("div", {
|
|
117
117
|
key: 1,
|
|
118
118
|
class: s(`${e}__actions`)
|
|
119
119
|
}, [
|
|
@@ -125,7 +125,7 @@ const A = () => {
|
|
|
125
125
|
name: "CLTableFooter",
|
|
126
126
|
__name: "CLTableFooter",
|
|
127
127
|
setup(l) {
|
|
128
|
-
return (t, e) => (
|
|
128
|
+
return (t, e) => (o(), a("tfoot", {
|
|
129
129
|
class: s([O])
|
|
130
130
|
}, [
|
|
131
131
|
r(t.$slots, "default")
|
|
@@ -135,7 +135,7 @@ const A = () => {
|
|
|
135
135
|
name: "CLTableHeader",
|
|
136
136
|
__name: "CLTableHeader",
|
|
137
137
|
setup(l) {
|
|
138
|
-
return (t, e) => (
|
|
138
|
+
return (t, e) => (o(), a("thead", {
|
|
139
139
|
class: s([q])
|
|
140
140
|
}, [
|
|
141
141
|
r(t.$slots, "default")
|
|
@@ -149,7 +149,7 @@ const A = () => {
|
|
|
149
149
|
},
|
|
150
150
|
setup(l) {
|
|
151
151
|
const t = "clll-table__nested-cell";
|
|
152
|
-
return (e, n) => (
|
|
152
|
+
return (e, n) => (o(), a("div", {
|
|
153
153
|
class: s(t)
|
|
154
154
|
}, [
|
|
155
155
|
T(d(V), {
|
|
@@ -174,7 +174,7 @@ const A = () => {
|
|
|
174
174
|
e,
|
|
175
175
|
t.onClick ? `${e}--clickable` : ""
|
|
176
176
|
]), u = () => t?.onClick?.();
|
|
177
|
-
return (c, m) => (
|
|
177
|
+
return (c, m) => (o(), a("tr", {
|
|
178
178
|
class: s(d(n)),
|
|
179
179
|
onClick: u
|
|
180
180
|
}, [
|