@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
|
@@ -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-89d19d2d]{position:relative;display:inline-flex;flex-direction:column;flex-wrap:wrap;box-sizing:border-box}.clll-date-picker-modal--fluid[data-v-89d19d2d]{width:100%}.clll-date-picker-modal__container[data-v-89d19d2d]{display:inline-flex;flex-direction:column;flex-wrap:wrap}.clll-date-picker-modal__calendar-header[data-v-89d19d2d]{display:flex;justify-content:space-between;align-items:center;margin:var(--clll-unit-0_5) 0 var(--clll-unit-4) 0}.clll-date-picker-modal__days-grid[data-v-89d19d2d]{display:grid;grid-template-columns:repeat(7,1fr);gap:.25rem;padding-bottom:var(--clll-unit-0_5)}.clll-date-picker-modal__weekday-label[data-v-89d19d2d]{text-align:center;padding-bottom:.25rem}.clll-date-picker-modal__day-cell[data-v-89d19d2d]{aspect-ratio:1;display:flex;justify-content:center;align-items:center}.clll-date-picker-modal__day-cell--outside[data-v-89d19d2d]{opacity:.55}.clll-date-picker-modal__footer-actions[data-v-89d19d2d]{display:flex;justify-content:space-between;align-items:center}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import '../../../assets/core.css';
|
|
2
|
+
import './CLModalDatePicker.css';
|
|
3
|
+
import { defineComponent as de, mergeModels as ne, ref as p, computed as X, useModel as re, onBeforeUnmount as se, createElementBlock as v, openBlock as f, normalizeClass as m, unref as e, createVNode as n, withCtx as r, createTextVNode as u, toDisplayString as z, createElementVNode as x, Fragment as P, renderList as R, createBlock as ue, createCommentVNode as ce } from "vue";
|
|
4
|
+
import { _ as c } from "../../../chunks/CLButton.vue_vue_type_style_index_0_lang-MvhnNzVW.js";
|
|
5
|
+
import { _ as be } from "../../../chunks/CLModal.vue_vue_type_style_index_0_lang-BDyONfaQ.js";
|
|
6
|
+
import { _ as T } from "../../../chunks/CLText.vue_vue_type_style_index_0_lang-B-L8ECJL.js";
|
|
7
|
+
import { CLSizes as i, CLIconSizes as d, CLIconNames as B, CLBorderRadius as y, CLColorVariants as s, CLColors as C, CLTextTypes as I, CLAlign as fe } from "../../../index.js";
|
|
8
|
+
import { useDatePicker as me } from "../../../composables/useDatePicker.js";
|
|
9
|
+
import { i as G } from "../../../chunks/helper-qUkciePY.js";
|
|
10
|
+
import { _ as ve } from "../../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
+
const ye = ["data-testid"], Ce = /* @__PURE__ */ de({
|
|
12
|
+
name: "CLModalDatePicker",
|
|
13
|
+
__name: "CLModalDatePicker",
|
|
14
|
+
props: /* @__PURE__ */ ne({
|
|
15
|
+
buttonAriaLabel: { default: void 0 },
|
|
16
|
+
buttonBorderRadius: { default: void 0 },
|
|
17
|
+
buttonColor: { default: C.Primary },
|
|
18
|
+
buttonLabel: { default: "Select dates" },
|
|
19
|
+
buttonSize: { default: i.Small },
|
|
20
|
+
buttonVariant: { default: s.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
|
+
onBlur: { type: Function, default: void 0 },
|
|
27
|
+
onChange: { type: Function, default: void 0 },
|
|
28
|
+
onFocus: { type: Function, default: void 0 },
|
|
29
|
+
rounded: { type: Boolean, default: !1 },
|
|
30
|
+
testId: { default: "clll-date-picker-modal" },
|
|
31
|
+
title: { default: "Select dates" }
|
|
32
|
+
}, {
|
|
33
|
+
modelValue: {
|
|
34
|
+
default: () => ({ end: null, start: null })
|
|
35
|
+
},
|
|
36
|
+
modelModifiers: {}
|
|
37
|
+
}),
|
|
38
|
+
emits: ["update:modelValue"],
|
|
39
|
+
setup(t) {
|
|
40
|
+
const o = t, a = "clll-date-picker-modal", w = p(!1), A = X(() => `date-picker-modal-${o.id}`), S = re(t, "modelValue"), L = p(S.value?.end ?? null), h = p(S.value?.start ?? null), {
|
|
41
|
+
calendarGrid: O,
|
|
42
|
+
cancelDraft: W,
|
|
43
|
+
clearDraft: U,
|
|
44
|
+
currentMonthLabel: j,
|
|
45
|
+
draftEnd: D,
|
|
46
|
+
draftStart: g,
|
|
47
|
+
getDayAriaLabel: q,
|
|
48
|
+
handleNextMonth: H,
|
|
49
|
+
handlePrevMonth: J,
|
|
50
|
+
initializeDraft: K,
|
|
51
|
+
isDraftEnd: F,
|
|
52
|
+
isDraftStart: E,
|
|
53
|
+
isInDraftRange: Q,
|
|
54
|
+
onDayClick: Y,
|
|
55
|
+
rangeLabel: Z,
|
|
56
|
+
weekDays: _
|
|
57
|
+
} = me({
|
|
58
|
+
appliedEnd: L,
|
|
59
|
+
appliedStart: h
|
|
60
|
+
}), N = p(!1), k = () => {
|
|
61
|
+
G && (N.value = window.innerWidth < 640);
|
|
62
|
+
}, ee = () => {
|
|
63
|
+
if (o.disabled || o.busy) return;
|
|
64
|
+
k(), K(), w.value = !0;
|
|
65
|
+
const $ = new FocusEvent("focus", { bubbles: !0, cancelable: !0 });
|
|
66
|
+
o.onFocus?.($);
|
|
67
|
+
}, M = () => {
|
|
68
|
+
w.value = !1, W();
|
|
69
|
+
const $ = new FocusEvent("blur", { bubbles: !0, cancelable: !0 });
|
|
70
|
+
o.onBlur?.($);
|
|
71
|
+
}, te = () => {
|
|
72
|
+
h.value = g.value, L.value = D.value, S.value = {
|
|
73
|
+
end: L.value,
|
|
74
|
+
start: h.value
|
|
75
|
+
}, M(), o.onChange?.();
|
|
76
|
+
}, ae = () => {
|
|
77
|
+
U(), h.value = null, L.value = null, o.onChange?.();
|
|
78
|
+
}, V = X(() => N.value);
|
|
79
|
+
G && (k(), window.addEventListener("resize", k), se(() => {
|
|
80
|
+
window.removeEventListener("resize", k);
|
|
81
|
+
}));
|
|
82
|
+
const oe = {
|
|
83
|
+
[i.Tiny]: d.Tiny,
|
|
84
|
+
[i.Small]: d.Small,
|
|
85
|
+
[i.Medium]: d.Medium,
|
|
86
|
+
[i.Large]: d.Large,
|
|
87
|
+
[i.XL]: d.XL,
|
|
88
|
+
[i.XXL]: d.XXL,
|
|
89
|
+
[i.XXXL]: d.XXXL,
|
|
90
|
+
[i.XXXXL]: d.XXXXL
|
|
91
|
+
}, le = X(() => [
|
|
92
|
+
a,
|
|
93
|
+
`${a}__container`,
|
|
94
|
+
o.buttonBorderRadius ? `${a}--${o.buttonBorderRadius}` : "",
|
|
95
|
+
o.busy ? `${a}--busy` : `${a}--ready`,
|
|
96
|
+
`${a}--${o.buttonColor}`,
|
|
97
|
+
`${a}--${o.buttonSize}`,
|
|
98
|
+
`${a}--${o.buttonVariant}`,
|
|
99
|
+
o.disabled || o.busy ? `${a}--disabled` : `${a}--active`,
|
|
100
|
+
o.fluid ? `${a}--fluid` : `${a}--fixed`,
|
|
101
|
+
o.rounded ? `${a}--rounded` : `${a}--box`
|
|
102
|
+
]);
|
|
103
|
+
return ($, b) => (f(), v("div", {
|
|
104
|
+
class: m(e(le)),
|
|
105
|
+
"data-testid": t.testId
|
|
106
|
+
}, [
|
|
107
|
+
n(e(c), {
|
|
108
|
+
"aria-label": t.buttonAriaLabel || "Open date picker",
|
|
109
|
+
"border-radius": t.buttonBorderRadius,
|
|
110
|
+
busy: t.busy,
|
|
111
|
+
color: t.buttonColor,
|
|
112
|
+
disabled: t.disabled || t.busy,
|
|
113
|
+
"icon-before": e(B).Calendar,
|
|
114
|
+
"icon-size": oe[t.buttonSize],
|
|
115
|
+
"on-click": ee,
|
|
116
|
+
rounded: t.rounded,
|
|
117
|
+
"test-id": `${t.testId}__trigger`,
|
|
118
|
+
size: t.buttonSize,
|
|
119
|
+
variant: t.buttonVariant,
|
|
120
|
+
width: "100%",
|
|
121
|
+
wrap: t.buttonWrapped
|
|
122
|
+
}, {
|
|
123
|
+
default: r(() => [
|
|
124
|
+
u(z(e(Z) || t.buttonLabel), 1)
|
|
125
|
+
]),
|
|
126
|
+
_: 1
|
|
127
|
+
}, 8, ["aria-label", "border-radius", "busy", "color", "disabled", "icon-before", "icon-size", "rounded", "test-id", "size", "variant", "wrap"]),
|
|
128
|
+
n(e(be), {
|
|
129
|
+
"border-radius": e(V) ? e(y).None : e(y).Medium,
|
|
130
|
+
fullscreen: e(V),
|
|
131
|
+
"is-open": e(w),
|
|
132
|
+
"max-width": "320px",
|
|
133
|
+
"modal-id": e(A),
|
|
134
|
+
"on-close": M,
|
|
135
|
+
title: t.title
|
|
136
|
+
}, {
|
|
137
|
+
body: r(() => [
|
|
138
|
+
x("div", {
|
|
139
|
+
class: m(`${a}__calendar-header`)
|
|
140
|
+
}, [
|
|
141
|
+
n(e(c), {
|
|
142
|
+
"aria-label": "Previous month",
|
|
143
|
+
"border-radius": e(y).Full,
|
|
144
|
+
"icon-before": e(B).ChevronLeft,
|
|
145
|
+
"icon-size": e(d).Tiny,
|
|
146
|
+
"on-click": e(J),
|
|
147
|
+
size: e(i).Tiny,
|
|
148
|
+
variant: e(s).Ghost,
|
|
149
|
+
height: "32px",
|
|
150
|
+
width: "32px",
|
|
151
|
+
wrap: ""
|
|
152
|
+
}, null, 8, ["border-radius", "icon-before", "icon-size", "on-click", "size", "variant"]),
|
|
153
|
+
n(e(T), {
|
|
154
|
+
type: e(I).Medium,
|
|
155
|
+
medium: ""
|
|
156
|
+
}, {
|
|
157
|
+
default: r(() => [
|
|
158
|
+
u(z(e(j)), 1)
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
}, 8, ["type"]),
|
|
162
|
+
n(e(c), {
|
|
163
|
+
"aria-label": "Next month",
|
|
164
|
+
"border-radius": e(y).Full,
|
|
165
|
+
"icon-before": e(B).ChevronRight,
|
|
166
|
+
"icon-size": e(d).Tiny,
|
|
167
|
+
"on-click": e(H),
|
|
168
|
+
size: e(i).Tiny,
|
|
169
|
+
variant: e(s).Ghost,
|
|
170
|
+
height: "32px",
|
|
171
|
+
width: "32px",
|
|
172
|
+
wrap: ""
|
|
173
|
+
}, null, 8, ["border-radius", "icon-before", "icon-size", "on-click", "size", "variant"])
|
|
174
|
+
], 2),
|
|
175
|
+
x("div", {
|
|
176
|
+
class: m(`${a}__days-grid`)
|
|
177
|
+
}, [
|
|
178
|
+
(f(!0), v(P, null, R(e(_), (l) => (f(), v("div", {
|
|
179
|
+
key: l,
|
|
180
|
+
class: m(`${a}__weekday-label`)
|
|
181
|
+
}, [
|
|
182
|
+
n(e(T), {
|
|
183
|
+
align: e(fe).Center,
|
|
184
|
+
color: e(C).Neutral,
|
|
185
|
+
type: e(I).Small
|
|
186
|
+
}, {
|
|
187
|
+
default: r(() => [
|
|
188
|
+
u(z(l), 1)
|
|
189
|
+
]),
|
|
190
|
+
_: 2
|
|
191
|
+
}, 1032, ["align", "color", "type"])
|
|
192
|
+
], 2))), 128)),
|
|
193
|
+
(f(!0), v(P, null, R(e(O), (l, ie) => (f(), v("div", {
|
|
194
|
+
key: l.date ?? `pad-${ie}`,
|
|
195
|
+
class: m([
|
|
196
|
+
`${a}__day-cell`,
|
|
197
|
+
l.isOutsideMonth ? `${a}__day-cell--outside` : ""
|
|
198
|
+
])
|
|
199
|
+
}, [
|
|
200
|
+
l.day && l.date ? (f(), ue(e(c), {
|
|
201
|
+
key: 0,
|
|
202
|
+
"aria-label": e(q)(l.date),
|
|
203
|
+
"border-radius": e(y).Full,
|
|
204
|
+
color: e(E)(l.date) || e(F)(l.date) ? t.buttonColor : e(C).Secondary,
|
|
205
|
+
disabled: t.disabled || t.busy,
|
|
206
|
+
rounded: !0,
|
|
207
|
+
size: e(i).Small,
|
|
208
|
+
variant: e(E)(l.date) || e(F)(l.date) ? e(s).Solid : e(Q)(l.date) ? e(s).Soft : e(s).Ghost,
|
|
209
|
+
height: "100%",
|
|
210
|
+
width: "100%",
|
|
211
|
+
"on-click": () => e(Y)(l.date),
|
|
212
|
+
wrap: ""
|
|
213
|
+
}, {
|
|
214
|
+
default: r(() => [
|
|
215
|
+
u(z(l.day), 1)
|
|
216
|
+
]),
|
|
217
|
+
_: 2
|
|
218
|
+
}, 1032, ["aria-label", "border-radius", "color", "disabled", "size", "variant", "on-click"])) : ce("", !0)
|
|
219
|
+
], 2))), 128))
|
|
220
|
+
], 2)
|
|
221
|
+
]),
|
|
222
|
+
footer: r(() => [
|
|
223
|
+
x("div", {
|
|
224
|
+
class: m(`${a}__footer-actions`)
|
|
225
|
+
}, [
|
|
226
|
+
n(e(c), {
|
|
227
|
+
color: e(C).Neutral,
|
|
228
|
+
"on-click": M,
|
|
229
|
+
variant: e(s).Ghost
|
|
230
|
+
}, {
|
|
231
|
+
default: r(() => [...b[0] || (b[0] = [
|
|
232
|
+
u("Cancel", -1)
|
|
233
|
+
])]),
|
|
234
|
+
_: 1
|
|
235
|
+
}, 8, ["color", "variant"]),
|
|
236
|
+
n(e(c), {
|
|
237
|
+
color: e(C).Neutral,
|
|
238
|
+
disabled: !e(g) && !e(D),
|
|
239
|
+
"on-click": ae,
|
|
240
|
+
variant: e(s).Ghost
|
|
241
|
+
}, {
|
|
242
|
+
default: r(() => [...b[1] || (b[1] = [
|
|
243
|
+
u("Reset", -1)
|
|
244
|
+
])]),
|
|
245
|
+
_: 1
|
|
246
|
+
}, 8, ["color", "disabled", "variant"]),
|
|
247
|
+
n(e(c), {
|
|
248
|
+
color: t.buttonColor,
|
|
249
|
+
disabled: !e(g),
|
|
250
|
+
"on-click": te
|
|
251
|
+
}, {
|
|
252
|
+
default: r(() => [...b[2] || (b[2] = [
|
|
253
|
+
u("Apply", -1)
|
|
254
|
+
])]),
|
|
255
|
+
_: 1
|
|
256
|
+
}, 8, ["color", "disabled"])
|
|
257
|
+
], 2)
|
|
258
|
+
]),
|
|
259
|
+
_: 1
|
|
260
|
+
}, 8, ["border-radius", "fullscreen", "is-open", "modal-id", "title"])
|
|
261
|
+
], 10, ye));
|
|
262
|
+
}
|
|
263
|
+
}), ge = /* @__PURE__ */ ve(Ce, [["__scopeId", "data-v-89d19d2d"]]);
|
|
264
|
+
export {
|
|
265
|
+
ge as CLModalDatePicker,
|
|
266
|
+
ge as default
|
|
267
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CLBorderRadius, CLColors, CLColorVariants, CLGenericFocusFunction, CLGenericFunction, CLSizes } from '../../../index.ts';
|
|
2
|
+
import { ISODate } from '../../../composables/useDatePicker';
|
|
3
|
+
export interface CLModalDatePickerProps {
|
|
4
|
+
/** Sets the aria-label on the trigger button. It should be used when there is no label present. */
|
|
5
|
+
buttonAriaLabel?: string;
|
|
6
|
+
/** The border radius size. The property can be one of `CLBorderRadius`, e.g. `CLBorderRadius.Medium`. */
|
|
7
|
+
buttonBorderRadius?: CLBorderRadius;
|
|
8
|
+
/** Sets the color of the trigger button, selected dates, and apply button. The property can be one of `CLColors`, e.g. `CLColors.Primary`. */
|
|
9
|
+
buttonColor?: CLColors;
|
|
10
|
+
/** The label text to be displayed which is associated to the date picker. */
|
|
11
|
+
buttonLabel?: string;
|
|
12
|
+
/** Sets the date picker size. The property can be one of `CLSizes`, e.g. `CLSizes.Medium`. */
|
|
13
|
+
buttonSize?: CLSizes;
|
|
14
|
+
/** Sets the color variant. The property can be one of `CLColorVariants`, e.g `CLColorVariants.Outline`. */
|
|
15
|
+
buttonVariant?: CLColorVariants;
|
|
16
|
+
/** When set to `true`, it will remove any horizontal and vertical padding from the button. */
|
|
17
|
+
buttonWrapped?: boolean;
|
|
18
|
+
/** A `boolean` value which dictates the busy state of the date picker. */
|
|
19
|
+
busy?: boolean;
|
|
20
|
+
/** Set the disabled state. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** When set to true, sets the width of the date picker to 100% of it's parent. */
|
|
23
|
+
fluid?: boolean;
|
|
24
|
+
/** A unique identifier, this is required. */
|
|
25
|
+
id: string;
|
|
26
|
+
/** A callback function which handles when the date picker loses focus. */
|
|
27
|
+
onBlur?: CLGenericFocusFunction;
|
|
28
|
+
/** A callback function which handles when the date picker value changes. */
|
|
29
|
+
onChange?: CLGenericFunction;
|
|
30
|
+
/** A callback function which handles when the date picker gains focus. */
|
|
31
|
+
onFocus?: CLGenericFocusFunction;
|
|
32
|
+
/** When set to `false` it will not render with rounded corners. */
|
|
33
|
+
rounded?: boolean;
|
|
34
|
+
/** Sets a custom ID used for unit tests. */
|
|
35
|
+
testId?: string;
|
|
36
|
+
/** The title content of the Modal. */
|
|
37
|
+
title?: string;
|
|
38
|
+
}
|
|
39
|
+
declare const _default: import('vue').DefineComponent<{
|
|
40
|
+
modelValue?: {
|
|
41
|
+
end: ISODate | null;
|
|
42
|
+
start: ISODate | null;
|
|
43
|
+
} | null;
|
|
44
|
+
} & CLModalDatePickerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
45
|
+
"update:modelValue": (value: {
|
|
46
|
+
end: ISODate | null;
|
|
47
|
+
start: ISODate | null;
|
|
48
|
+
} | null) => any;
|
|
49
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
50
|
+
modelValue?: {
|
|
51
|
+
end: ISODate | null;
|
|
52
|
+
start: ISODate | null;
|
|
53
|
+
} | null;
|
|
54
|
+
} & CLModalDatePickerProps> & Readonly<{
|
|
55
|
+
"onUpdate:modelValue"?: ((value: {
|
|
56
|
+
end: ISODate | null;
|
|
57
|
+
start: ISODate | null;
|
|
58
|
+
} | null) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
title: string;
|
|
61
|
+
fluid: boolean;
|
|
62
|
+
rounded: boolean;
|
|
63
|
+
testId: string;
|
|
64
|
+
onFocus: CLGenericFocusFunction;
|
|
65
|
+
onBlur: CLGenericFocusFunction;
|
|
66
|
+
onChange: CLGenericFunction;
|
|
67
|
+
busy: boolean;
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
buttonAriaLabel: string;
|
|
70
|
+
buttonBorderRadius: CLBorderRadius;
|
|
71
|
+
buttonColor: CLColors;
|
|
72
|
+
buttonLabel: string;
|
|
73
|
+
buttonSize: CLSizes;
|
|
74
|
+
buttonVariant: CLColorVariants;
|
|
75
|
+
buttonWrapped: boolean;
|
|
76
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
77
|
+
export default _default;
|