asheeui 0.6.10 → 0.6.13
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/components/accordion/Accordion.js +7 -7
- package/dist/components/autocomplete/Autocomplete.d.ts +5 -5
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +42 -41
- package/dist/components/carousel/Carousel.js +43 -43
- package/dist/components/chip/Chip.js +8 -8
- package/dist/components/date-picker/Calendar.d.ts +6 -1
- package/dist/components/date-picker/Calendar.d.ts.map +1 -1
- package/dist/components/date-picker/Calendar.js +30 -30
- package/dist/components/date-picker/DatePicker.d.ts +7 -6
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +166 -155
- package/dist/components/date-picker/date-picker-config.d.ts +12 -1
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.js +22 -22
- package/dist/components/multi-select/MultiSelect.d.ts +5 -5
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +45 -44
- package/dist/components/select/Select.d.ts +5 -5
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +117 -114
- package/dist/components/select-menu/SelectMenu.d.ts +20 -11
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +146 -109
- package/dist/components/select-menu/select-menu-config.d.ts +8 -4
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
- package/dist/components/select-menu/select-menu-config.js +1 -1
- package/dist/components/select-menu/use-select-floating.d.ts +46 -17
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
- package/dist/components/select-menu/use-select-floating.js +36 -22
- package/dist/components/toast/ToastItem.js +30 -30
- package/dist/components/toast/ToastProvider.d.ts +5 -5
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +66 -66
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +14 -16
- package/package.json +3 -20
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import { useState as f, useMemo as
|
|
4
|
-
import { ChevronLeftIcon as
|
|
5
|
-
import { ChevronRightIcon as
|
|
6
|
-
import { buildDayCells as
|
|
7
|
-
import { CALENDAR_COLOR_CLASSES as L, DATE_PICKER_CELL_SIZE_CLASS as
|
|
3
|
+
import { memo as q, useState as f, useMemo as B } from "react";
|
|
4
|
+
import { ChevronLeftIcon as J } from "../../icons/ChevronLeftIcon.js";
|
|
5
|
+
import { ChevronRightIcon as Q } from "../../icons/ChevronRightIcon.js";
|
|
6
|
+
import { buildDayCells as U, MONTHS as X, DAYS_OF_WEEK as tt } from "./date-picker.helpers.js";
|
|
7
|
+
import { CALENDAR_COLOR_CLASSES as L, DATE_PICKER_CELL_SIZE_CLASS as nt } from "./date-picker-styles.js";
|
|
8
8
|
import { TimeSpinner as y } from "./TimeSpinner.js";
|
|
9
9
|
import { cn as u } from "../../utils/cn.js";
|
|
10
|
-
|
|
10
|
+
const mt = q(function({
|
|
11
11
|
selected: n,
|
|
12
12
|
mode: s,
|
|
13
13
|
isClearable: C,
|
|
14
14
|
resolvedSizeKey: j,
|
|
15
15
|
resolvedColor: h,
|
|
16
|
-
radiusClass:
|
|
16
|
+
radiusClass: i,
|
|
17
17
|
onSelect: v,
|
|
18
18
|
onClose: w,
|
|
19
19
|
disableFuture: Y = !1
|
|
20
20
|
}) {
|
|
21
21
|
const r = /* @__PURE__ */ new Date(), [l, k] = f(
|
|
22
22
|
(n == null ? void 0 : n.getFullYear()) ?? r.getFullYear()
|
|
23
|
-
), [
|
|
23
|
+
), [a, g] = f(
|
|
24
24
|
(n == null ? void 0 : n.getMonth()) ?? r.getMonth()
|
|
25
25
|
), [b, A] = f((n == null ? void 0 : n.getHours()) ?? 0), [p, H] = f((n == null ? void 0 : n.getMinutes()) ?? 0), [x, T] = f((n == null ? void 0 : n.getSeconds()) ?? 0), m = L[h] ?? L.primary;
|
|
26
26
|
function M(t, e, Z) {
|
|
@@ -39,19 +39,19 @@ function ut({
|
|
|
39
39
|
T(t), M(b, p, t);
|
|
40
40
|
}
|
|
41
41
|
function K(t) {
|
|
42
|
-
v(new Date(l,
|
|
42
|
+
v(new Date(l, a, t, b, p, x, 0)), s === "date" && w();
|
|
43
43
|
}
|
|
44
44
|
function P() {
|
|
45
|
-
|
|
45
|
+
a === 0 ? (g(11), k((t) => t - 1)) : g((t) => t - 1);
|
|
46
46
|
}
|
|
47
47
|
function V() {
|
|
48
|
-
|
|
48
|
+
a === 11 ? (g(0), k((t) => t + 1)) : g((t) => t + 1);
|
|
49
49
|
}
|
|
50
50
|
function d(t) {
|
|
51
|
-
return !!n && n.getFullYear() === l && n.getMonth() ===
|
|
51
|
+
return !!n && n.getFullYear() === l && n.getMonth() === a && n.getDate() === t;
|
|
52
52
|
}
|
|
53
53
|
function N(t) {
|
|
54
|
-
return r.getFullYear() === l && r.getMonth() ===
|
|
54
|
+
return r.getFullYear() === l && r.getMonth() === a && r.getDate() === t;
|
|
55
55
|
}
|
|
56
56
|
const $ = new Date(
|
|
57
57
|
r.getFullYear(),
|
|
@@ -59,9 +59,9 @@ function ut({
|
|
|
59
59
|
r.getDate()
|
|
60
60
|
);
|
|
61
61
|
function D(t) {
|
|
62
|
-
return Y ? new Date(l,
|
|
62
|
+
return Y ? new Date(l, a, t) > $ : !1;
|
|
63
63
|
}
|
|
64
|
-
const F = !Y || l < r.getFullYear() || l === r.getFullYear() &&
|
|
64
|
+
const F = !Y || l < r.getFullYear() || l === r.getFullYear() && a < r.getMonth(), E = s === "date" || s === "datetime", z = s === "time" || s === "datetime", G = s !== "date" || C && !!n, _ = U(l, a), W = B(() => _.map((t, e) => ({
|
|
65
65
|
key: t !== null ? `day-${t}` : `empty-slot-${e}`,
|
|
66
66
|
day: t
|
|
67
67
|
})), [_]);
|
|
@@ -70,7 +70,7 @@ function ut({
|
|
|
70
70
|
{
|
|
71
71
|
className: u(
|
|
72
72
|
"bg-background border border-border/70 shadow-xl select-none p-4 w-max",
|
|
73
|
-
|
|
73
|
+
i
|
|
74
74
|
),
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ c("div", { className: "flex flex-row", children: [
|
|
@@ -85,13 +85,13 @@ function ut({
|
|
|
85
85
|
className: u(
|
|
86
86
|
"p-1.5 text-foreground/70 transition-all active:scale-95",
|
|
87
87
|
"hover:text-foreground hover:bg-secondary",
|
|
88
|
-
|
|
88
|
+
i
|
|
89
89
|
),
|
|
90
|
-
children: /* @__PURE__ */ o(
|
|
90
|
+
children: /* @__PURE__ */ o(J, {})
|
|
91
91
|
}
|
|
92
92
|
),
|
|
93
93
|
/* @__PURE__ */ c("span", { className: "font-semibold text-sm text-foreground tracking-wide", children: [
|
|
94
|
-
|
|
94
|
+
X[a],
|
|
95
95
|
" ",
|
|
96
96
|
l
|
|
97
97
|
] }),
|
|
@@ -105,14 +105,14 @@ function ut({
|
|
|
105
105
|
className: u(
|
|
106
106
|
"p-1.5 text-foreground/70 transition-all",
|
|
107
107
|
F ? "hover:text-foreground hover:bg-secondary active:scale-95" : "opacity-30 cursor-not-allowed",
|
|
108
|
-
|
|
108
|
+
i
|
|
109
109
|
),
|
|
110
|
-
children: /* @__PURE__ */ o(
|
|
110
|
+
children: /* @__PURE__ */ o(Q, {})
|
|
111
111
|
}
|
|
112
112
|
)
|
|
113
113
|
] }),
|
|
114
114
|
/* @__PURE__ */ c("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
|
|
115
|
-
|
|
115
|
+
tt.map((t) => /* @__PURE__ */ o(
|
|
116
116
|
"div",
|
|
117
117
|
{
|
|
118
118
|
className: "text-[11px] font-bold tracking-wider text-foreground/50 uppercase py-1 mb-1",
|
|
@@ -129,8 +129,8 @@ function ut({
|
|
|
129
129
|
disabled: D(e),
|
|
130
130
|
className: u(
|
|
131
131
|
"w-full flex items-center justify-center font-medium transition-all duration-200",
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
nt[j],
|
|
133
|
+
i,
|
|
134
134
|
D(e) ? "opacity-30 cursor-not-allowed text-foreground/50" : "active:scale-90",
|
|
135
135
|
!D(e) && !d(e) && !N(e) && m.hover,
|
|
136
136
|
d(e) && u(m.bg, "font-semibold shadow-sm"),
|
|
@@ -160,7 +160,7 @@ function ut({
|
|
|
160
160
|
label: "HH",
|
|
161
161
|
onChange: I,
|
|
162
162
|
resolvedColor: h,
|
|
163
|
-
radiusClass:
|
|
163
|
+
radiusClass: i
|
|
164
164
|
}
|
|
165
165
|
),
|
|
166
166
|
/* @__PURE__ */ o(
|
|
@@ -171,7 +171,7 @@ function ut({
|
|
|
171
171
|
label: "MM",
|
|
172
172
|
onChange: O,
|
|
173
173
|
resolvedColor: h,
|
|
174
|
-
radiusClass:
|
|
174
|
+
radiusClass: i
|
|
175
175
|
}
|
|
176
176
|
),
|
|
177
177
|
/* @__PURE__ */ o(
|
|
@@ -182,7 +182,7 @@ function ut({
|
|
|
182
182
|
label: "SS",
|
|
183
183
|
onChange: R,
|
|
184
184
|
resolvedColor: h,
|
|
185
|
-
radiusClass:
|
|
185
|
+
radiusClass: i
|
|
186
186
|
}
|
|
187
187
|
)
|
|
188
188
|
]
|
|
@@ -208,7 +208,7 @@ function ut({
|
|
|
208
208
|
onClick: w,
|
|
209
209
|
className: u(
|
|
210
210
|
"ml-auto text-xs font-semibold px-4 py-2 transition-all hover:opacity-90 active:scale-95 shadow-sm",
|
|
211
|
-
|
|
211
|
+
i,
|
|
212
212
|
m.bg
|
|
213
213
|
),
|
|
214
214
|
children: "Done"
|
|
@@ -218,7 +218,7 @@ function ut({
|
|
|
218
218
|
]
|
|
219
219
|
}
|
|
220
220
|
);
|
|
221
|
-
}
|
|
221
|
+
});
|
|
222
222
|
export {
|
|
223
|
-
|
|
223
|
+
mt as Calendar
|
|
224
224
|
};
|
|
@@ -60,11 +60,12 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
60
60
|
* with Floating UI for popover positioning and follows the standard AsheeUI
|
|
61
61
|
* cascade system for visual tokens.
|
|
62
62
|
*
|
|
63
|
-
* By default, the calendar popover uses
|
|
64
|
-
* document body level. This ensures the popover escapes CSS
|
|
65
|
-
* overflow clipping, and stacking context issues. The portal
|
|
66
|
-
* via the `picker.portal` prop or
|
|
67
|
-
* the config if the popover needs
|
|
63
|
+
* By default, the calendar popover uses Floating UI's FloatingPortal to
|
|
64
|
+
* render at the document body level. This ensures the popover escapes CSS
|
|
65
|
+
* containment, overflow clipping, and stacking context issues. The portal
|
|
66
|
+
* can be disabled via the `picker.portal` prop or
|
|
67
|
+
* `components.datePicker.picker.portal` in the config if the popover needs
|
|
68
|
+
* to stay within a specific parent container.
|
|
68
69
|
*
|
|
69
70
|
* @param props - DatePicker configuration options.
|
|
70
71
|
* @param props.selected - Currently selected date or null.
|
|
@@ -77,7 +78,7 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
77
78
|
* @param props.radius - Corner rounding. Defaults to "md".
|
|
78
79
|
* @param props.color - Theme accent color. Defaults to "primary".
|
|
79
80
|
* @param props.disabled - Whether the input is disabled. Defaults to false.
|
|
80
|
-
* @param props.picker - Picker configuration overrides including className, portal, and
|
|
81
|
+
* @param props.picker - Picker configuration overrides including className, portal, portalTarget, and lockScroll.
|
|
81
82
|
* @param props.label - Field label text.
|
|
82
83
|
* @param props.description - Description text.
|
|
83
84
|
* @param props.message - Validation message.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AASxD,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAChE,IAAI,CACF,UAAU,EACV,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,CACtE,CAAC;AAEJ;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,eAAO,MAAM,UAAU,8GA8VtB,CAAC"}
|
|
@@ -1,210 +1,221 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
const ge = Ie(
|
|
2
|
+
import { jsx as r, jsxs as B, Fragment as fo } from "react/jsx-runtime";
|
|
3
|
+
import { FloatingFocusManager as yo, FloatingPortal as po } from "@floating-ui/react";
|
|
4
|
+
import { forwardRef as vo, useId as bo, useState as G, useRef as So, useEffect as U, useCallback as f } from "react";
|
|
5
|
+
import { CalendarIcon as wo } from "../../icons/CalendarIcon.js";
|
|
6
|
+
import { ClearIcon as Io } from "../../icons/ClearIcon.js";
|
|
7
|
+
import { ClockIcon as Po } from "../../icons/ClockIcon.js";
|
|
8
|
+
import { useAsheeConfig as Ro } from "../../libs/context.js";
|
|
9
|
+
import { resolveCascade as c, resolveRadiusKey as Fo, resolveClassKey as xo } from "../../utils/resolve-token.js";
|
|
10
|
+
import { Input as go } from "../input/Input.js";
|
|
11
|
+
import { Calendar as No } from "./Calendar.js";
|
|
12
|
+
import { formatDisplay as b, parseDateString as ho, getNewCursorPosition as Ao, getDefaultPlaceholder as Do } from "./date-picker.helpers.js";
|
|
13
|
+
import { FALLBACK_DATE_PICKER_CONFIG as y } from "./date-picker-config.js";
|
|
14
|
+
import { RADIUS_CLASS as Lo } from "../../shared/radius.js";
|
|
15
|
+
import { useSelectFloating as To } from "../select-menu/use-select-floating.js";
|
|
16
|
+
import { cn as Ko } from "../../utils/cn.js";
|
|
17
|
+
import { FALLBACK_SELECT_MENU_CONFIG as _o } from "../select-menu/select-menu-config.js";
|
|
18
|
+
const Eo = vo(
|
|
20
19
|
({
|
|
21
|
-
selected:
|
|
22
|
-
onChange:
|
|
23
|
-
mode:
|
|
24
|
-
isClearable:
|
|
25
|
-
disableFuture:
|
|
26
|
-
placeholder:
|
|
27
|
-
size:
|
|
28
|
-
radius:
|
|
29
|
-
color:
|
|
30
|
-
disabled:
|
|
20
|
+
selected: n,
|
|
21
|
+
onChange: e,
|
|
22
|
+
mode: W,
|
|
23
|
+
isClearable: N = !1,
|
|
24
|
+
disableFuture: Y = !1,
|
|
25
|
+
placeholder: q,
|
|
26
|
+
size: h,
|
|
27
|
+
radius: S,
|
|
28
|
+
color: A,
|
|
29
|
+
disabled: w,
|
|
31
30
|
picker: l,
|
|
32
|
-
...
|
|
33
|
-
},
|
|
34
|
-
var
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
...D
|
|
32
|
+
}, u) => {
|
|
33
|
+
var E, O, z, M;
|
|
34
|
+
const I = Ro(), o = (E = I.components) == null ? void 0 : E.datePicker, $ = bo(), H = D.id ?? $, [i, p] = G(!1), [P, a] = G(""), L = So(null), s = c(
|
|
35
|
+
W,
|
|
36
|
+
o == null ? void 0 : o.mode,
|
|
38
37
|
void 0,
|
|
39
|
-
|
|
40
|
-
),
|
|
38
|
+
y.mode
|
|
39
|
+
), J = c(
|
|
41
40
|
l == null ? void 0 : l.portal,
|
|
42
|
-
(
|
|
41
|
+
(O = o == null ? void 0 : o.picker) == null ? void 0 : O.portal,
|
|
43
42
|
void 0,
|
|
44
|
-
|
|
45
|
-
),
|
|
43
|
+
_o.portal
|
|
44
|
+
), Q = c(
|
|
46
45
|
l == null ? void 0 : l.portalTarget,
|
|
47
|
-
(
|
|
46
|
+
(z = o == null ? void 0 : o.picker) == null ? void 0 : z.portalTarget,
|
|
48
47
|
void 0,
|
|
49
48
|
null
|
|
50
|
-
),
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
), T = c(
|
|
50
|
+
l == null ? void 0 : l.lockScroll,
|
|
51
|
+
(M = o == null ? void 0 : o.picker) == null ? void 0 : M.lockScroll,
|
|
52
|
+
void 0,
|
|
53
|
+
!0
|
|
54
|
+
), X = c(
|
|
55
|
+
h,
|
|
56
|
+
o == null ? void 0 : o.size,
|
|
53
57
|
void 0,
|
|
54
|
-
|
|
55
|
-
),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
),
|
|
61
|
-
typeof
|
|
62
|
-
typeof (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
), {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
y.size
|
|
59
|
+
), Z = c(
|
|
60
|
+
A,
|
|
61
|
+
o == null ? void 0 : o.color,
|
|
62
|
+
I.defaultColor,
|
|
63
|
+
y.color
|
|
64
|
+
), K = Fo(
|
|
65
|
+
typeof S == "string" ? S : void 0,
|
|
66
|
+
typeof (o == null ? void 0 : o.radius) == "string" ? o.radius : void 0,
|
|
67
|
+
I.defaultRadius,
|
|
68
|
+
y.radius
|
|
69
|
+
), C = xo(
|
|
70
|
+
K === "full" ? "xl" : K,
|
|
71
|
+
Lo,
|
|
72
|
+
y.radius
|
|
73
|
+
), {
|
|
74
|
+
refs: R,
|
|
75
|
+
context: k,
|
|
76
|
+
floatingStyles: oo,
|
|
77
|
+
isPositioned: to,
|
|
78
|
+
getReferenceProps: eo,
|
|
79
|
+
getFloatingProps: lo
|
|
80
|
+
} = To({
|
|
81
|
+
isOpen: i,
|
|
82
|
+
onOpenChange: p,
|
|
83
|
+
disabled: w,
|
|
84
|
+
matchReferenceWidth: !1,
|
|
74
85
|
// Allow calendar to size naturally side-by-side
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
(o) => {
|
|
90
|
-
t == null || t(o), a(o ? I(o, s) : ""), (s === "date" || o === null) && v(!1);
|
|
86
|
+
role: "dialog"
|
|
87
|
+
});
|
|
88
|
+
U(() => {
|
|
89
|
+
if (!i || !T) return;
|
|
90
|
+
const t = window.scrollY, d = document.body.style.position, F = document.body.style.top, x = document.body.style.left, g = document.body.style.right, v = document.body.style.width, m = document.body.style.overflow;
|
|
91
|
+
return document.body.style.position = "fixed", document.body.style.top = `-${t}px`, document.body.style.left = "0", document.body.style.right = "0", document.body.style.width = "100%", document.body.style.overflow = "hidden", () => {
|
|
92
|
+
document.body.style.position = d, document.body.style.top = F, document.body.style.left = x, document.body.style.right = g, document.body.style.width = v, document.body.style.overflow = m, window.scrollTo(0, t);
|
|
93
|
+
};
|
|
94
|
+
}, [i, T]), U(() => {
|
|
95
|
+
a(n ? b(n, s) : "");
|
|
96
|
+
}, [n, s]);
|
|
97
|
+
const so = f(
|
|
98
|
+
(t) => {
|
|
99
|
+
e == null || e(t), a(t ? b(t, s) : ""), (s === "date" || t === null) && p(!1);
|
|
91
100
|
},
|
|
92
|
-
[
|
|
93
|
-
),
|
|
94
|
-
(
|
|
95
|
-
var
|
|
96
|
-
|
|
101
|
+
[e, s]
|
|
102
|
+
), ro = f(() => p(!1), []), no = f(
|
|
103
|
+
(t) => {
|
|
104
|
+
var d;
|
|
105
|
+
t.stopPropagation(), e == null || e(null), a(""), p(!1), (d = L.current) == null || d.focus();
|
|
97
106
|
},
|
|
98
|
-
[
|
|
99
|
-
),
|
|
100
|
-
(
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
a(""),
|
|
107
|
+
[e]
|
|
108
|
+
), ao = f(
|
|
109
|
+
(t) => {
|
|
110
|
+
const d = t.target, F = d.value, x = P, g = d.selectionStart ?? 0, v = F.replace(/\D/g, "");
|
|
111
|
+
if (v.length === 0) {
|
|
112
|
+
a(""), e == null || e(null);
|
|
104
113
|
return;
|
|
105
114
|
}
|
|
106
|
-
const
|
|
107
|
-
|
|
115
|
+
const m = ho(
|
|
116
|
+
v,
|
|
108
117
|
s,
|
|
109
|
-
|
|
118
|
+
n ?? void 0
|
|
110
119
|
);
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
a(
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
if (m) {
|
|
121
|
+
e == null || e(m);
|
|
122
|
+
const V = b(m, s);
|
|
123
|
+
a(V);
|
|
124
|
+
const j = Ao(
|
|
125
|
+
x,
|
|
126
|
+
V,
|
|
127
|
+
g
|
|
119
128
|
);
|
|
120
129
|
requestAnimationFrame(() => {
|
|
121
|
-
|
|
130
|
+
d.setSelectionRange(j, j);
|
|
122
131
|
});
|
|
123
132
|
} else
|
|
124
|
-
a(
|
|
133
|
+
a(n ? b(n, s) : "");
|
|
125
134
|
},
|
|
126
|
-
[s,
|
|
127
|
-
),
|
|
128
|
-
|
|
135
|
+
[s, n, e, P]
|
|
136
|
+
), io = q ?? Do(s), co = /* @__PURE__ */ B(fo, { children: [
|
|
137
|
+
N && n && !w && /* @__PURE__ */ r(
|
|
129
138
|
"button",
|
|
130
139
|
{
|
|
131
140
|
type: "button",
|
|
132
|
-
onClick:
|
|
141
|
+
onClick: no,
|
|
133
142
|
"aria-label": "Clear selection",
|
|
134
143
|
className: "p-0.5 rounded text-foreground/70 hover:text-foreground transition-colors",
|
|
135
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ r(Io, { className: "size-3.5" })
|
|
136
145
|
}
|
|
137
146
|
),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
] }), _ =
|
|
140
|
-
|
|
147
|
+
/* @__PURE__ */ r("span", { className: "text-foreground/70 pointer-events-none", children: s === "time" ? /* @__PURE__ */ r(Po, {}) : /* @__PURE__ */ r(wo, {}) })
|
|
148
|
+
] }), _ = i ? /* @__PURE__ */ r(
|
|
149
|
+
yo,
|
|
141
150
|
{
|
|
142
|
-
context:
|
|
151
|
+
context: k,
|
|
143
152
|
modal: !1,
|
|
144
153
|
initialFocus: -1,
|
|
145
154
|
returnFocus: !1,
|
|
146
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ r(
|
|
147
156
|
"div",
|
|
148
157
|
{
|
|
149
|
-
ref:
|
|
150
|
-
style: {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
ref: R.setFloating,
|
|
159
|
+
style: { ...oo },
|
|
160
|
+
className: Ko(
|
|
161
|
+
"z-100 outline-none w-max",
|
|
162
|
+
// Disable transitions on the floating node. Floating UI applies
|
|
163
|
+
// position via `transform` on every scroll tick, and any inherited
|
|
164
|
+
// transform transition would ease toward each new position instead
|
|
165
|
+
// of snapping, producing a spring/bounce effect.
|
|
166
|
+
"transition-none",
|
|
167
|
+
to ? "animate-in fade-in-0 zoom-in-95 duration-150 ease-out" : "invisible opacity-0 pointer-events-none",
|
|
157
168
|
l == null ? void 0 : l.className
|
|
158
169
|
),
|
|
159
|
-
...
|
|
160
|
-
children: /* @__PURE__ */
|
|
161
|
-
|
|
170
|
+
...lo(),
|
|
171
|
+
children: /* @__PURE__ */ r(
|
|
172
|
+
No,
|
|
162
173
|
{
|
|
163
|
-
selected:
|
|
174
|
+
selected: n,
|
|
164
175
|
mode: s,
|
|
165
|
-
isClearable:
|
|
166
|
-
resolvedSizeKey:
|
|
167
|
-
onSelect:
|
|
168
|
-
onClose:
|
|
169
|
-
disableFuture:
|
|
170
|
-
resolvedColor:
|
|
171
|
-
radiusClass:
|
|
176
|
+
isClearable: N,
|
|
177
|
+
resolvedSizeKey: X,
|
|
178
|
+
onSelect: so,
|
|
179
|
+
onClose: ro,
|
|
180
|
+
disableFuture: Y,
|
|
181
|
+
resolvedColor: Z,
|
|
182
|
+
radiusClass: C
|
|
172
183
|
}
|
|
173
184
|
)
|
|
174
185
|
}
|
|
175
186
|
)
|
|
176
187
|
}
|
|
177
|
-
) : null,
|
|
178
|
-
(
|
|
179
|
-
|
|
188
|
+
) : null, uo = Q ?? (typeof document < "u" ? document.body : null), mo = f(
|
|
189
|
+
(t) => {
|
|
190
|
+
t && (R.setReference(t), L.current = t, typeof u == "function" ? u(t) : u && (u.current = t));
|
|
180
191
|
},
|
|
181
|
-
[
|
|
192
|
+
[R, u]
|
|
182
193
|
);
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
|
|
194
|
+
return /* @__PURE__ */ B("div", { className: "w-full relative inline-block", children: [
|
|
195
|
+
/* @__PURE__ */ r(
|
|
196
|
+
go,
|
|
186
197
|
{
|
|
187
|
-
...
|
|
188
|
-
ref:
|
|
189
|
-
id:
|
|
190
|
-
size:
|
|
191
|
-
radius:
|
|
192
|
-
color:
|
|
193
|
-
placeholder:
|
|
194
|
-
value:
|
|
195
|
-
onChange:
|
|
196
|
-
endContent:
|
|
197
|
-
disabled:
|
|
198
|
-
"aria-expanded":
|
|
198
|
+
...D,
|
|
199
|
+
ref: mo,
|
|
200
|
+
id: H,
|
|
201
|
+
size: h,
|
|
202
|
+
radius: S,
|
|
203
|
+
color: A,
|
|
204
|
+
placeholder: io,
|
|
205
|
+
value: P,
|
|
206
|
+
onChange: ao,
|
|
207
|
+
endContent: co,
|
|
208
|
+
disabled: w,
|
|
209
|
+
"aria-expanded": i,
|
|
199
210
|
"aria-haspopup": "dialog",
|
|
200
|
-
...
|
|
211
|
+
...eo()
|
|
201
212
|
}
|
|
202
213
|
),
|
|
203
|
-
|
|
214
|
+
i && (J ? /* @__PURE__ */ r(po, { root: uo, children: _ }) : _)
|
|
204
215
|
] });
|
|
205
216
|
}
|
|
206
217
|
);
|
|
207
|
-
|
|
218
|
+
Eo.displayName = "DatePicker";
|
|
208
219
|
export {
|
|
209
|
-
|
|
220
|
+
Eo as DatePicker
|
|
210
221
|
};
|
|
@@ -38,13 +38,15 @@ export interface DatePickerConfig extends InputConfig {
|
|
|
38
38
|
*/
|
|
39
39
|
export interface PickerConfig {
|
|
40
40
|
/**
|
|
41
|
-
* Whether to render the calendar popover
|
|
41
|
+
* Whether to render the calendar popover through Floating UI's
|
|
42
|
+
* `FloatingPortal`.
|
|
42
43
|
* When true, the popover is rendered at the document body level,
|
|
43
44
|
* escaping any parent DOM hierarchy. This prevents CSS containment
|
|
44
45
|
* and stacking context issues. Defaults to true because popovers
|
|
45
46
|
* should always appear above other content.
|
|
46
47
|
*
|
|
47
48
|
* @default true
|
|
49
|
+
* @see FloatingPortal - https://floating-ui.com/docs/FloatingPortal
|
|
48
50
|
*/
|
|
49
51
|
portal?: boolean;
|
|
50
52
|
/**
|
|
@@ -53,6 +55,15 @@ export interface PickerConfig {
|
|
|
53
55
|
* Defaults to document.body.
|
|
54
56
|
*/
|
|
55
57
|
portalTarget?: HTMLElement | null;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to lock page scroll while the calendar popover is open.
|
|
60
|
+
* When true, the page behind the popover cannot scroll. Uses
|
|
61
|
+
* scroll-position-compensated `position: fixed` on `<body>` so locking
|
|
62
|
+
* does not jump the page back to the top.
|
|
63
|
+
*
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
lockScroll?: boolean;
|
|
56
67
|
}
|
|
57
68
|
/**
|
|
58
69
|
* Default config values registered for the DatePicker component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-config.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B
|
|
1
|
+
{"version":3,"file":"date-picker-config.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAElC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAGrC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;CAG9B,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,UAAU,EAAE,gBAAgB,CAAC;KAC9B;CACF"}
|