@codeandfunction/callaloo 4.7.6 → 4.9.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/CLCalendar-XcUGsiWk.js +159 -0
- 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/chunks/floating-ui.vue-Fx4CxKut.js +1057 -0
- package/dist/components/Containers/CLCarousel/CLCarousel.js +144 -148
- package/dist/components/Form/CLCalendar/CLCalendar.css +1 -0
- package/dist/components/Form/CLCalendar/CLCalendar.js +7 -0
- package/dist/components/Form/CLCalendar/CLCalendar.vue.d.ts +54 -0
- package/dist/components/Form/CLCalendar/index.d.ts +4 -0
- package/dist/components/Form/CLInput/CLInput.js +0 -1
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.css +1 -0
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.js +181 -0
- package/dist/components/Form/CLInputDatePicker/CLInputDatePicker.vue.d.ts +265 -0
- package/dist/components/Form/CLInputDatePicker/index.d.ts +4 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Modals/CLModal/CLModal.css +1 -1
- 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 +185 -0
- package/dist/components/Modals/CLModalDatePicker/CLModalDatePicker.vue.d.ts +144 -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 +109 -1144
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.vue.d.ts +10 -3
- package/dist/composables/useDateInputMask.d.ts +8 -0
- package/dist/composables/useDateInputMask.js +39 -0
- package/dist/composables/useDatePicker.d.ts +40 -0
- package/dist/composables/useDatePicker.js +141 -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/dist/index.cdn.d.ts +4 -1
- package/dist/styles.css +1 -1
- package/package.json +13 -1
- /package/dist/components/Form/{CLInput → CLInputDatePicker}/CLInput.css +0 -0
|
@@ -1,178 +1,7 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLModal.css';
|
|
3
|
-
import {
|
|
4
|
-
import { _ as P } from "../../../chunks/CLButton.vue_vue_type_style_index_0_lang-MvhnNzVW.js";
|
|
5
|
-
import { _ as Q } from "../../../chunks/CLHeading.vue_vue_type_style_index_0_lang-DH5oJc1C.js";
|
|
6
|
-
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";
|
|
7
|
-
import { g as te } from "../../../chunks/utils-D00IXMTR.js";
|
|
8
|
-
import { useTheme as ne } from "../../../composables/useTheme.js";
|
|
9
|
-
import { useEsc as le } from "../../../composables/useEsc.js";
|
|
10
|
-
import { c as S, i as a } from "../../../chunks/helper-qUkciePY.js";
|
|
11
|
-
const se = () => {
|
|
12
|
-
const { colors: t, darkMode: f } = ne(), _ = f.value ? k.Dark : k.Light, r = te({
|
|
13
|
-
color: T.Neutral,
|
|
14
|
-
colors: t.value,
|
|
15
|
-
mode: _,
|
|
16
|
-
variant: N.Solid
|
|
17
|
-
}), c = f.value ? "black" : "white";
|
|
18
|
-
return {
|
|
19
|
-
"--clll-modal-overlay-bg": r?.bg ?? "transparent",
|
|
20
|
-
"--clll-modal-content-bg": c,
|
|
21
|
-
"--clll-modal-theme-radius": "var(--clll-default-radius)"
|
|
22
|
-
};
|
|
23
|
-
}, ae = ["id", "data-testid"], re = ["aria-labelledby"], we = /* @__PURE__ */ W({
|
|
24
|
-
name: "CLModal",
|
|
25
|
-
__name: "CLModal",
|
|
26
|
-
props: {
|
|
27
|
-
borderRadius: { default: void 0 },
|
|
28
|
-
close: { type: Boolean, default: !0 },
|
|
29
|
-
closeBorderRadius: { default: X.Full },
|
|
30
|
-
dismissible: { type: Boolean, default: !0 },
|
|
31
|
-
fullscreen: { type: Boolean, default: !1 },
|
|
32
|
-
isOpen: { type: Boolean, default: !1 },
|
|
33
|
-
maxWidth: { default: "640px" },
|
|
34
|
-
modalId: {},
|
|
35
|
-
onClose: { type: Function, default: void 0 },
|
|
36
|
-
overlay: { type: Boolean, default: !0 },
|
|
37
|
-
testId: { default: "clll-modal" },
|
|
38
|
-
title: { default: void 0 },
|
|
39
|
-
zIndex: { default: 100 }
|
|
40
|
-
},
|
|
41
|
-
emits: ["modal-open", "modal-close"],
|
|
42
|
-
setup(t, { emit: f }) {
|
|
43
|
-
const _ = f, r = F("modal-window"), c = U(), o = t, e = "clll-modal", x = "clll-prevent-scroll", u = Z(), C = () => {
|
|
44
|
-
a && window?.document.body.classList.add(x);
|
|
45
|
-
}, I = () => {
|
|
46
|
-
a && window?.document.body.classList.remove(x);
|
|
47
|
-
}, R = m(() => [
|
|
48
|
-
e
|
|
49
|
-
]), E = m(() => [
|
|
50
|
-
`${e}__window`,
|
|
51
|
-
o.fullscreen ? `${e}__window--fullscreen` : ""
|
|
52
|
-
]), M = m(() => [
|
|
53
|
-
`${e}__content`,
|
|
54
|
-
o.borderRadius ? `${e}__content--${o.borderRadius}` : "",
|
|
55
|
-
o.close ? `${e}__content--has-close-button` : `${e}__content--has-no-close-button`,
|
|
56
|
-
c.body ? `${e}__content--has-body` : `${e}__content--has-no-body`,
|
|
57
|
-
c.footer ? `${e}__content--has-footer` : `${e}__content--has-no-footer`,
|
|
58
|
-
c.header || o.title ? `${e}__content--has-header` : `${e}__content--has-no-header`,
|
|
59
|
-
o.title ? `${e}__content--has-title` : `${e}__content--has-no-title`
|
|
60
|
-
]), 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) => {
|
|
61
|
-
try {
|
|
62
|
-
const i = s?.target, g = r.value;
|
|
63
|
-
return a && g && !g.contains(i) ? !0 : void 0;
|
|
64
|
-
} catch (i) {
|
|
65
|
-
console.error(i);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
}, b = (s) => {
|
|
69
|
-
try {
|
|
70
|
-
H(s) && (a && window.removeEventListener("mousedown", b), L());
|
|
71
|
-
} catch (i) {
|
|
72
|
-
console.error(i);
|
|
73
|
-
}
|
|
74
|
-
}, h = () => {
|
|
75
|
-
a && window.removeEventListener("mousedown", b);
|
|
76
|
-
}, z = () => {
|
|
77
|
-
a && (u.value && a && window.clearTimeout(u.value), h(), I());
|
|
78
|
-
}, L = () => {
|
|
79
|
-
o.isOpen && (o.onClose?.(), z());
|
|
80
|
-
};
|
|
81
|
-
j(o, (s) => {
|
|
82
|
-
s.isOpen ? (_("modal-open"), C(), r.value && r.value.focus(), a && s.dismissible && (h(), u.value = window.setTimeout(() => {
|
|
83
|
-
window.addEventListener("mousedown", b);
|
|
84
|
-
}, 100))) : (r.value && r.value.blur(), I(), h(), u.value && a && window.clearTimeout(u.value), _("modal-close"));
|
|
85
|
-
}), q(() => {
|
|
86
|
-
o.isOpen && a && (C(), r.value && r.value.focus());
|
|
87
|
-
});
|
|
88
|
-
const { clearEventListeners: D } = le({ escHandler: o.dismissible ? L : void 0 });
|
|
89
|
-
return A(() => {
|
|
90
|
-
z(), D();
|
|
91
|
-
}), (s, i) => t.isOpen ? (w(), p("div", {
|
|
92
|
-
key: 0,
|
|
93
|
-
id: t.modalId,
|
|
94
|
-
class: l(n(R)),
|
|
95
|
-
"data-testid": t.testId,
|
|
96
|
-
style: y({ ...n(se)(), zIndex: n(O) })
|
|
97
|
-
}, [
|
|
98
|
-
d("div", {
|
|
99
|
-
class: l(n(E)),
|
|
100
|
-
style: y({ zIndex: n(V) })
|
|
101
|
-
}, [
|
|
102
|
-
d("div", {
|
|
103
|
-
ref: "modal-window",
|
|
104
|
-
"aria-modal": "true",
|
|
105
|
-
"aria-labelledby": `${e}__content__header__title`,
|
|
106
|
-
class: l(n(M)),
|
|
107
|
-
role: "dialog",
|
|
108
|
-
tabindex: -1,
|
|
109
|
-
style: y({ "--clll-modal-max-width": t.maxWidth })
|
|
110
|
-
}, [
|
|
111
|
-
d("div", {
|
|
112
|
-
class: l(`${e}__close-button`)
|
|
113
|
-
}, [
|
|
114
|
-
t.onClose && t.close ? (w(), B(n(P), {
|
|
115
|
-
key: 0,
|
|
116
|
-
"aria-label": "Close modal",
|
|
117
|
-
"border-radius": t.closeBorderRadius,
|
|
118
|
-
color: n(T).Neutral,
|
|
119
|
-
"icon-before": n(ee).Delete,
|
|
120
|
-
"icon-size": n(Y).Tiny,
|
|
121
|
-
"on-click": t.onClose,
|
|
122
|
-
"test-id": `${e}__close-button`,
|
|
123
|
-
variant: n(N).Text
|
|
124
|
-
}, null, 8, ["border-radius", "color", "icon-before", "icon-size", "on-click", "test-id", "variant"])) : v("", !0)
|
|
125
|
-
], 2),
|
|
126
|
-
d("div", {
|
|
127
|
-
class: l(`${e}__content__header`)
|
|
128
|
-
}, [
|
|
129
|
-
d("div", {
|
|
130
|
-
class: l(`${e}__content__title`)
|
|
131
|
-
}, [
|
|
132
|
-
d("div", {
|
|
133
|
-
class: l(`${e}__content__header__container`)
|
|
134
|
-
}, [
|
|
135
|
-
t.title ? (w(), B(n(Q), {
|
|
136
|
-
key: 0,
|
|
137
|
-
id: `${e}__content__header__title`,
|
|
138
|
-
class: l(`${e}__content__header__title`),
|
|
139
|
-
type: n(oe).Section
|
|
140
|
-
}, {
|
|
141
|
-
default: G(() => [
|
|
142
|
-
J(K(t.title), 1)
|
|
143
|
-
]),
|
|
144
|
-
_: 1
|
|
145
|
-
}, 8, ["id", "class", "type"])) : v("", !0),
|
|
146
|
-
$(s.$slots, "header")
|
|
147
|
-
], 2)
|
|
148
|
-
], 2)
|
|
149
|
-
], 2),
|
|
150
|
-
d("div", {
|
|
151
|
-
class: l(`${e}__content__scroller`)
|
|
152
|
-
}, [
|
|
153
|
-
d("div", {
|
|
154
|
-
class: l(`${e}__content__body`)
|
|
155
|
-
}, [
|
|
156
|
-
$(s.$slots, "body")
|
|
157
|
-
], 2)
|
|
158
|
-
], 2),
|
|
159
|
-
d("div", {
|
|
160
|
-
class: l(`${e}__content__footer`)
|
|
161
|
-
}, [
|
|
162
|
-
$(s.$slots, "footer")
|
|
163
|
-
], 2)
|
|
164
|
-
], 14, re)
|
|
165
|
-
], 6),
|
|
166
|
-
t.overlay ? (w(), p("div", {
|
|
167
|
-
key: 0,
|
|
168
|
-
ref: "overlay-ref",
|
|
169
|
-
class: l(`${e}__overlay`),
|
|
170
|
-
style: y({ zIndex: t.zIndex })
|
|
171
|
-
}, null, 6)) : v("", !0)
|
|
172
|
-
], 14, ae)) : v("", !0);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
3
|
+
import { _ as o } from "../../../chunks/CLModal.vue_vue_type_style_index_0_lang-BDyONfaQ.js";
|
|
175
4
|
export {
|
|
176
|
-
|
|
177
|
-
|
|
5
|
+
o as CLModal,
|
|
6
|
+
o as default
|
|
178
7
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.clll-date-picker-modal[data-v-14031572]{position:relative;display:inline-flex;flex-direction:column;flex-wrap:wrap;box-sizing:border-box}.clll-date-picker-modal--fluid[data-v-14031572]{width:100%}.clll-date-picker-modal__container[data-v-14031572]{display:inline-flex;flex-direction:column;flex-wrap:wrap}.clll-date-picker-modal__footer-actions[data-v-14031572]{display:flex;justify-content:space-between;align-items:center;width:100%}.clll-date-picker-modal__footer-right[data-v-14031572]{display:flex;gap:var(--clll-unit-2)}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import '../../../assets/core.css';
|
|
2
|
+
import './CLModalDatePicker.css';
|
|
3
|
+
import { defineComponent as I, mergeModels as N, ref as p, computed as u, useModel as h, onBeforeUnmount as A, createElementBlock as T, openBlock as W, normalizeClass as $, unref as e, createVNode as s, withCtx as c, createTextVNode as v, toDisplayString as G, createElementVNode as S, nextTick as O } from "vue";
|
|
4
|
+
import { _ as y } from "../../../chunks/CLButton.vue_vue_type_style_index_0_lang-MvhnNzVW.js";
|
|
5
|
+
import { _ as U } from "../../../chunks/CLModal.vue_vue_type_style_index_0_lang-BDyONfaQ.js";
|
|
6
|
+
import { C as j } from "../../../chunks/CLCalendar-XcUGsiWk.js";
|
|
7
|
+
import { CLSizes as n, CLIconSizes as i, CLIconNames as q, CLBorderRadius as B, CLColorVariants as X, CLColors as C } from "../../../index.js";
|
|
8
|
+
import { i as z } from "../../../chunks/helper-qUkciePY.js";
|
|
9
|
+
import { useDatePicker as H } from "../../../composables/useDatePicker.js";
|
|
10
|
+
import { _ as J } from "../../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
+
const K = ["data-testid"], Q = /* @__PURE__ */ I({
|
|
12
|
+
name: "CLModalDatePicker",
|
|
13
|
+
__name: "CLModalDatePicker",
|
|
14
|
+
props: /* @__PURE__ */ N({
|
|
15
|
+
buttonAriaLabel: { default: void 0 },
|
|
16
|
+
buttonBorderRadius: { default: void 0 },
|
|
17
|
+
buttonColor: { default: C.Primary },
|
|
18
|
+
buttonLabel: { default: "Select dates" },
|
|
19
|
+
buttonSize: { default: n.Small },
|
|
20
|
+
buttonVariant: { default: X.Soft },
|
|
21
|
+
buttonWrapped: { type: Boolean, default: !1 },
|
|
22
|
+
busy: { type: Boolean, default: !1 },
|
|
23
|
+
disabled: { type: Boolean, default: !1 },
|
|
24
|
+
fluid: { type: Boolean, default: !1 },
|
|
25
|
+
id: {},
|
|
26
|
+
isRange: { type: Boolean, default: !0 },
|
|
27
|
+
onBlur: { type: Function, default: void 0 },
|
|
28
|
+
onChange: { type: Function, default: void 0 },
|
|
29
|
+
onFocus: { type: Function, default: void 0 },
|
|
30
|
+
rounded: { type: Boolean, default: !1 },
|
|
31
|
+
testId: { default: "clll-date-picker-modal" },
|
|
32
|
+
title: { default: "Select dates" }
|
|
33
|
+
}, {
|
|
34
|
+
modelValue: {
|
|
35
|
+
default: () => ({ end: null, start: null })
|
|
36
|
+
},
|
|
37
|
+
modelModifiers: {}
|
|
38
|
+
}),
|
|
39
|
+
emits: ["update:modelValue"],
|
|
40
|
+
setup(t) {
|
|
41
|
+
const a = t, o = "clll-date-picker-modal", f = p(!1), M = u(() => `date-picker-modal-${a.id}`), d = p(), b = h(t, "modelValue"), { rangeLabel: w } = H({
|
|
42
|
+
appliedStart: u(() => b.value?.start ?? null),
|
|
43
|
+
appliedEnd: u(() => b.value?.end ?? null),
|
|
44
|
+
isRange: a.isRange
|
|
45
|
+
}), g = p(!1), m = () => {
|
|
46
|
+
z && (g.value = window.innerWidth < 480);
|
|
47
|
+
}, R = () => {
|
|
48
|
+
if (a.disabled || a.busy) return;
|
|
49
|
+
m(), f.value = !0, O(() => {
|
|
50
|
+
d.value?.initializeDraft();
|
|
51
|
+
});
|
|
52
|
+
const r = new FocusEvent("focus", { bubbles: !0, cancelable: !0 });
|
|
53
|
+
a.onFocus?.(r);
|
|
54
|
+
}, k = () => {
|
|
55
|
+
f.value = !1, d.value?.cancel();
|
|
56
|
+
const r = new FocusEvent("blur", { bubbles: !0, cancelable: !0 });
|
|
57
|
+
a.onBlur?.(r);
|
|
58
|
+
}, V = () => {
|
|
59
|
+
d.value?.apply(), f.value = !1, a.onChange?.();
|
|
60
|
+
}, E = () => {
|
|
61
|
+
d.value?.reset(), a.onChange?.();
|
|
62
|
+
}, L = u(() => g.value);
|
|
63
|
+
z && (m(), window.addEventListener("resize", m), A(() => {
|
|
64
|
+
window.removeEventListener("resize", m);
|
|
65
|
+
}));
|
|
66
|
+
const x = {
|
|
67
|
+
[n.Tiny]: i.Tiny,
|
|
68
|
+
[n.Small]: i.Small,
|
|
69
|
+
[n.Medium]: i.Medium,
|
|
70
|
+
[n.Large]: i.Large,
|
|
71
|
+
[n.XL]: i.XL,
|
|
72
|
+
[n.XXL]: i.XXL,
|
|
73
|
+
[n.XXXL]: i.XXXL,
|
|
74
|
+
[n.XXXXL]: i.XXXXL
|
|
75
|
+
}, D = u(() => [
|
|
76
|
+
o,
|
|
77
|
+
`${o}__container`,
|
|
78
|
+
a.buttonBorderRadius ? `${o}--${a.buttonBorderRadius}` : "",
|
|
79
|
+
a.busy ? `${o}--busy` : `${o}--ready`,
|
|
80
|
+
`${o}--${a.buttonColor}`,
|
|
81
|
+
`${o}--${a.buttonSize}`,
|
|
82
|
+
`${o}--${a.buttonVariant}`,
|
|
83
|
+
a.disabled || a.busy ? `${o}--disabled` : `${o}--active`,
|
|
84
|
+
a.fluid ? `${o}--fluid` : `${o}--fixed`,
|
|
85
|
+
a.rounded ? `${o}--rounded` : `${o}--box`
|
|
86
|
+
]), F = u(() => {
|
|
87
|
+
const r = d.value?.draftStart, l = d.value?.draftEnd;
|
|
88
|
+
return a.isRange ? !!r && !!l : !!r;
|
|
89
|
+
});
|
|
90
|
+
return (r, l) => (W(), T("div", {
|
|
91
|
+
class: $(e(D)),
|
|
92
|
+
"data-testid": t.testId
|
|
93
|
+
}, [
|
|
94
|
+
s(e(y), {
|
|
95
|
+
"aria-label": t.buttonAriaLabel || "Open date picker",
|
|
96
|
+
"border-radius": t.buttonBorderRadius,
|
|
97
|
+
busy: t.busy,
|
|
98
|
+
color: t.buttonColor,
|
|
99
|
+
disabled: t.disabled || t.busy,
|
|
100
|
+
"icon-before": e(q).Calendar,
|
|
101
|
+
"icon-size": x[t.buttonSize],
|
|
102
|
+
"on-click": R,
|
|
103
|
+
rounded: t.rounded,
|
|
104
|
+
"test-id": `${t.testId}__trigger`,
|
|
105
|
+
size: t.buttonSize,
|
|
106
|
+
variant: t.buttonVariant,
|
|
107
|
+
width: "100%",
|
|
108
|
+
wrap: t.buttonWrapped
|
|
109
|
+
}, {
|
|
110
|
+
default: c(() => [
|
|
111
|
+
v(G(e(w) || t.buttonLabel), 1)
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
}, 8, ["aria-label", "border-radius", "busy", "color", "disabled", "icon-before", "icon-size", "rounded", "test-id", "size", "variant", "wrap"]),
|
|
115
|
+
s(e(U), {
|
|
116
|
+
"border-radius": e(L) ? e(B).None : e(B).Medium,
|
|
117
|
+
fullscreen: e(L),
|
|
118
|
+
"is-open": e(f),
|
|
119
|
+
"max-width": "336px",
|
|
120
|
+
"modal-id": e(M),
|
|
121
|
+
"on-close": k,
|
|
122
|
+
title: t.title
|
|
123
|
+
}, {
|
|
124
|
+
body: c(() => [
|
|
125
|
+
s(e(j), {
|
|
126
|
+
ref_key: "calendarRef",
|
|
127
|
+
ref: d,
|
|
128
|
+
modelValue: b.value,
|
|
129
|
+
"onUpdate:modelValue": l[0] || (l[0] = (P) => b.value = P),
|
|
130
|
+
busy: t.busy,
|
|
131
|
+
disabled: t.disabled,
|
|
132
|
+
fluid: e(L),
|
|
133
|
+
"is-range": t.isRange
|
|
134
|
+
}, null, 8, ["modelValue", "busy", "disabled", "fluid", "is-range"])
|
|
135
|
+
]),
|
|
136
|
+
footer: c(() => [
|
|
137
|
+
S("div", {
|
|
138
|
+
class: $(`${o}__footer-actions`)
|
|
139
|
+
}, [
|
|
140
|
+
s(e(y), {
|
|
141
|
+
color: e(C).Neutral,
|
|
142
|
+
"on-click": k,
|
|
143
|
+
variant: e(X).Ghost
|
|
144
|
+
}, {
|
|
145
|
+
default: c(() => [...l[1] || (l[1] = [
|
|
146
|
+
v(" Cancel ", -1)
|
|
147
|
+
])]),
|
|
148
|
+
_: 1
|
|
149
|
+
}, 8, ["color", "variant"]),
|
|
150
|
+
S("div", {
|
|
151
|
+
class: $(`${o}__footer-right`)
|
|
152
|
+
}, [
|
|
153
|
+
s(e(y), {
|
|
154
|
+
color: e(C).Neutral,
|
|
155
|
+
disabled: !e(d)?.draftStart && !e(d)?.draftEnd,
|
|
156
|
+
"on-click": E,
|
|
157
|
+
variant: e(X).Ghost
|
|
158
|
+
}, {
|
|
159
|
+
default: c(() => [...l[2] || (l[2] = [
|
|
160
|
+
v(" Reset ", -1)
|
|
161
|
+
])]),
|
|
162
|
+
_: 1
|
|
163
|
+
}, 8, ["color", "disabled", "variant"]),
|
|
164
|
+
s(e(y), {
|
|
165
|
+
color: e(C).Primary,
|
|
166
|
+
disabled: !e(F),
|
|
167
|
+
"on-click": V
|
|
168
|
+
}, {
|
|
169
|
+
default: c(() => [...l[3] || (l[3] = [
|
|
170
|
+
v(" Apply ", -1)
|
|
171
|
+
])]),
|
|
172
|
+
_: 1
|
|
173
|
+
}, 8, ["color", "disabled"])
|
|
174
|
+
], 2)
|
|
175
|
+
], 2)
|
|
176
|
+
]),
|
|
177
|
+
_: 1
|
|
178
|
+
}, 8, ["border-radius", "fullscreen", "is-open", "modal-id", "title"])
|
|
179
|
+
], 10, K));
|
|
180
|
+
}
|
|
181
|
+
}), de = /* @__PURE__ */ J(Q, [["__scopeId", "data-v-14031572"]]);
|
|
182
|
+
export {
|
|
183
|
+
de as CLModalDatePicker,
|
|
184
|
+
de as default
|
|
185
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { CLBorderRadius, CLColors, CLColorVariants, CLGenericFocusFunction, CLGenericFunction, CLSizes } from '../../../index.ts';
|
|
2
|
+
export interface CLModalDatePickerProps {
|
|
3
|
+
/** Sets the aria-label on the trigger button. It should be used when there is no label present. */
|
|
4
|
+
buttonAriaLabel?: string;
|
|
5
|
+
/** The border radius size. The property can be one of `CLBorderRadius`, e.g. `CLBorderRadius.Medium`. */
|
|
6
|
+
buttonBorderRadius?: CLBorderRadius;
|
|
7
|
+
/** Sets the color of the trigger button, selected dates, and apply button. The property can be one of `CLColors`, e.g. `CLColors.Primary`. */
|
|
8
|
+
buttonColor?: CLColors;
|
|
9
|
+
/** The label text to be displayed which is associated to the date picker. */
|
|
10
|
+
buttonLabel?: string;
|
|
11
|
+
/** Sets the date picker size. The property can be one of `CLSizes`, e.g. `CLSizes.Medium`. */
|
|
12
|
+
buttonSize?: CLSizes;
|
|
13
|
+
/** Sets the color variant. The property can be one of `CLColorVariants`, e.g `CLColorVariants.Outline`. */
|
|
14
|
+
buttonVariant?: CLColorVariants;
|
|
15
|
+
/** When set to `true`, it will remove any horizontal and vertical padding from the button. */
|
|
16
|
+
buttonWrapped?: boolean;
|
|
17
|
+
/** A `boolean` value which dictates the busy state of the date picker. */
|
|
18
|
+
busy?: boolean;
|
|
19
|
+
/** Set the disabled state. */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** When set to true, sets the width of the date picker to 100% of it's parent. */
|
|
22
|
+
fluid?: boolean;
|
|
23
|
+
/** A unique identifier, this is required. */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Whether to allow range selection or single date selection. */
|
|
26
|
+
isRange?: boolean;
|
|
27
|
+
/** A callback function which handles when the date picker loses focus. */
|
|
28
|
+
onBlur?: CLGenericFocusFunction;
|
|
29
|
+
/** A callback function which handles when the date picker value changes. */
|
|
30
|
+
onChange?: CLGenericFunction;
|
|
31
|
+
/** A callback function which handles when the date picker gains focus. */
|
|
32
|
+
onFocus?: CLGenericFocusFunction;
|
|
33
|
+
/** When set to `false` it will not render with rounded corners. */
|
|
34
|
+
rounded?: boolean;
|
|
35
|
+
/** Sets a custom ID used for unit tests. */
|
|
36
|
+
testId?: string;
|
|
37
|
+
/** The title content of the Modal. */
|
|
38
|
+
title?: string;
|
|
39
|
+
}
|
|
40
|
+
declare const _default: import('vue').DefineComponent<{
|
|
41
|
+
modelValue?: {
|
|
42
|
+
end: string | null;
|
|
43
|
+
start: string | null;
|
|
44
|
+
} | null;
|
|
45
|
+
} & CLModalDatePickerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
46
|
+
"update:modelValue": (value: {
|
|
47
|
+
end: string | null;
|
|
48
|
+
start: string | null;
|
|
49
|
+
} | null) => any;
|
|
50
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
51
|
+
modelValue?: {
|
|
52
|
+
end: string | null;
|
|
53
|
+
start: string | null;
|
|
54
|
+
} | null;
|
|
55
|
+
} & CLModalDatePickerProps> & Readonly<{
|
|
56
|
+
"onUpdate:modelValue"?: ((value: {
|
|
57
|
+
end: string | null;
|
|
58
|
+
start: string | null;
|
|
59
|
+
} | null) => any) | undefined;
|
|
60
|
+
}>, {
|
|
61
|
+
title: string;
|
|
62
|
+
fluid: boolean;
|
|
63
|
+
rounded: boolean;
|
|
64
|
+
testId: string;
|
|
65
|
+
onFocus: CLGenericFocusFunction;
|
|
66
|
+
onBlur: CLGenericFocusFunction;
|
|
67
|
+
onChange: CLGenericFunction;
|
|
68
|
+
busy: boolean;
|
|
69
|
+
disabled: boolean;
|
|
70
|
+
isRange: boolean;
|
|
71
|
+
buttonAriaLabel: string;
|
|
72
|
+
buttonBorderRadius: CLBorderRadius;
|
|
73
|
+
buttonColor: CLColors;
|
|
74
|
+
buttonLabel: string;
|
|
75
|
+
buttonSize: CLSizes;
|
|
76
|
+
buttonVariant: CLColorVariants;
|
|
77
|
+
buttonWrapped: boolean;
|
|
78
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
79
|
+
calendarRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
80
|
+
modelValue?: {
|
|
81
|
+
end: import('../../../composables/useDatePicker').ISODate | null;
|
|
82
|
+
start: import('../../../composables/useDatePicker').ISODate | null;
|
|
83
|
+
} | null;
|
|
84
|
+
} & import('../../Form/CLCalendar/CLCalendar.vue').CLCalendarProps> & Readonly<{
|
|
85
|
+
"onUpdate:modelValue"?: ((value: {
|
|
86
|
+
end: import('../../../composables/useDatePicker').ISODate | null;
|
|
87
|
+
start: import('../../../composables/useDatePicker').ISODate | null;
|
|
88
|
+
} | null) => any) | undefined;
|
|
89
|
+
"onDate-select"?: ((date: string) => any) | undefined;
|
|
90
|
+
}>, {
|
|
91
|
+
apply: () => void;
|
|
92
|
+
cancel: () => void;
|
|
93
|
+
draftEnd: globalThis.Ref<string | null, string | null>;
|
|
94
|
+
draftStart: globalThis.Ref<string | null, string | null>;
|
|
95
|
+
initializeDraft: () => void;
|
|
96
|
+
reset: () => void;
|
|
97
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
98
|
+
"update:modelValue": (value: {
|
|
99
|
+
end: import('../../../composables/useDatePicker').ISODate | null;
|
|
100
|
+
start: import('../../../composables/useDatePicker').ISODate | null;
|
|
101
|
+
} | null) => any;
|
|
102
|
+
"date-select": (date: string) => any;
|
|
103
|
+
}, import('vue').PublicProps, {
|
|
104
|
+
color: CLColors;
|
|
105
|
+
fluid: boolean;
|
|
106
|
+
testId: string;
|
|
107
|
+
busy: boolean;
|
|
108
|
+
disabled: boolean;
|
|
109
|
+
isRange: boolean;
|
|
110
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
111
|
+
P: {};
|
|
112
|
+
B: {};
|
|
113
|
+
D: {};
|
|
114
|
+
C: {};
|
|
115
|
+
M: {};
|
|
116
|
+
Defaults: {};
|
|
117
|
+
}, Readonly<{
|
|
118
|
+
modelValue?: {
|
|
119
|
+
end: import('../../../composables/useDatePicker').ISODate | null;
|
|
120
|
+
start: import('../../../composables/useDatePicker').ISODate | null;
|
|
121
|
+
} | null;
|
|
122
|
+
} & import('../../Form/CLCalendar/CLCalendar.vue').CLCalendarProps> & Readonly<{
|
|
123
|
+
"onUpdate:modelValue"?: ((value: {
|
|
124
|
+
end: import('../../../composables/useDatePicker').ISODate | null;
|
|
125
|
+
start: import('../../../composables/useDatePicker').ISODate | null;
|
|
126
|
+
} | null) => any) | undefined;
|
|
127
|
+
"onDate-select"?: ((date: string) => any) | undefined;
|
|
128
|
+
}>, {
|
|
129
|
+
apply: () => void;
|
|
130
|
+
cancel: () => void;
|
|
131
|
+
draftEnd: globalThis.Ref<string | null, string | null>;
|
|
132
|
+
draftStart: globalThis.Ref<string | null, string | null>;
|
|
133
|
+
initializeDraft: () => void;
|
|
134
|
+
reset: () => void;
|
|
135
|
+
}, {}, {}, {}, {
|
|
136
|
+
color: CLColors;
|
|
137
|
+
fluid: boolean;
|
|
138
|
+
testId: string;
|
|
139
|
+
busy: boolean;
|
|
140
|
+
disabled: boolean;
|
|
141
|
+
isRange: boolean;
|
|
142
|
+
}> | null;
|
|
143
|
+
}, HTMLDivElement>;
|
|
144
|
+
export default _default;
|