asheeui 0.6.3 → 0.6.6
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 +10 -10
- package/dist/components/autocomplete/Autocomplete.d.ts +8 -0
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +120 -118
- package/dist/components/autocomplete/autocomplete-config.d.ts +29 -3
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +14 -6
- package/dist/components/date-picker/DatePicker.d.ts +20 -0
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +230 -229
- package/dist/components/date-picker/date-picker-config.d.ts +16 -0
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +14 -10
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +16 -6
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +96 -90
- package/dist/components/keyboard/index.js +1 -0
- package/dist/components/keyboard/keyboard-config.d.ts +27 -1
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-config.js +12 -8
- package/dist/components/keyboard/keyboard-context.d.ts +4 -7
- package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-context.js +61 -58
- package/dist/components/keyboard/keyboard-styles.d.ts +13 -0
- package/dist/components/keyboard/keyboard-styles.d.ts.map +1 -0
- package/dist/components/keyboard/keyboard-styles.js +14 -0
- package/dist/components/multi-select/MultiSelect.d.ts +8 -0
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +186 -184
- package/dist/components/multi-select/multi-select-config.d.ts +18 -0
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +14 -10
- package/dist/components/resizable-screen/ResizableScreen.d.ts +23 -11
- package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.js +69 -60
- package/dist/components/select/Select.d.ts +8 -6
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +135 -135
- package/dist/components/select/select-config.d.ts +27 -1
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +14 -6
- package/dist/components/select-menu/SelectMenu.d.ts +23 -1
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +72 -67
- package/dist/components/select-menu/index.d.ts +1 -0
- package/dist/components/select-menu/index.d.ts.map +1 -1
- package/dist/components/select-menu/index.js +1 -0
- package/dist/components/select-menu/select-menu-config.d.ts +1 -1
- package/dist/components/select-menu/select-menu-config.js +3 -3
- package/dist/components/select-menu/use-select-floating.d.ts +95 -0
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -0
- package/dist/components/select-menu/use-select-floating.js +36 -0
- package/dist/components/toast/toast-config.d.ts +11 -0
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/components/toast/toast-config.js +4 -2
- package/dist/components/toast/toast-context.d.ts +21 -1
- package/dist/components/toast/toast-context.d.ts.map +1 -1
- package/dist/components/toast/toast-context.js +134 -114
- package/dist/components/tooltip/Tooltip.d.ts +19 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +129 -121
- package/dist/components/tooltip/tooltip-config.d.ts +7 -3
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-config.js +5 -4
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/utils/merge-object.d.ts +7 -1
- package/dist/utils/merge-object.d.ts.map +1 -1
- package/dist/utils/types.d.ts +16 -4
- package/dist/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ const le = Y(
|
|
|
29
29
|
...k
|
|
30
30
|
}, B) => {
|
|
31
31
|
var S;
|
|
32
|
-
const f = te(), s = (S = f.components) == null ? void 0 : S.accordion, G = ee(), m = Z ?? G,
|
|
32
|
+
const f = te(), s = (S = f.components) == null ? void 0 : S.accordion, G = ee(), m = Z ?? G, h = v(
|
|
33
33
|
K,
|
|
34
34
|
s == null ? void 0 : s.size,
|
|
35
35
|
void 0,
|
|
@@ -39,7 +39,7 @@ const le = Y(
|
|
|
39
39
|
s == null ? void 0 : s.variant,
|
|
40
40
|
f.defaultVariant,
|
|
41
41
|
o.variant
|
|
42
|
-
),
|
|
42
|
+
), w = v(
|
|
43
43
|
E,
|
|
44
44
|
s == null ? void 0 : s.allowMultiple,
|
|
45
45
|
void 0,
|
|
@@ -50,14 +50,14 @@ const le = Y(
|
|
|
50
50
|
f.defaultRadius,
|
|
51
51
|
o.radius
|
|
52
52
|
), U = R[i] ?? R.separated, q = _[i] ?? _.separated, J = A(
|
|
53
|
-
|
|
53
|
+
h,
|
|
54
54
|
ie,
|
|
55
55
|
o.size
|
|
56
56
|
), P = A(
|
|
57
|
-
|
|
57
|
+
h,
|
|
58
58
|
ne,
|
|
59
59
|
o.size
|
|
60
|
-
),
|
|
60
|
+
), I = A(
|
|
61
61
|
H,
|
|
62
62
|
ae,
|
|
63
63
|
o.radius
|
|
@@ -70,9 +70,9 @@ const le = Y(
|
|
|
70
70
|
(e, N) => {
|
|
71
71
|
if (N) return;
|
|
72
72
|
let r;
|
|
73
|
-
a.includes(e) ? r = a.filter((c) => c !== e) : r =
|
|
73
|
+
a.includes(e) ? r = a.filter((c) => c !== e) : r = w ? [...a, e] : [e], p || W(r), d == null || d(r);
|
|
74
74
|
},
|
|
75
|
-
[a, p, d,
|
|
75
|
+
[a, p, d, w]
|
|
76
76
|
);
|
|
77
77
|
return /* @__PURE__ */ t(
|
|
78
78
|
"div",
|
|
@@ -82,7 +82,7 @@ const le = Y(
|
|
|
82
82
|
className: n(
|
|
83
83
|
"w-full",
|
|
84
84
|
U,
|
|
85
|
-
i !== "ghost" && i !== "flush" &&
|
|
85
|
+
i !== "ghost" && i !== "flush" && I,
|
|
86
86
|
V
|
|
87
87
|
),
|
|
88
88
|
style: F,
|
|
@@ -95,7 +95,7 @@ const le = Y(
|
|
|
95
95
|
className: n(
|
|
96
96
|
"w-full transition-colors box-border",
|
|
97
97
|
q,
|
|
98
|
-
(i === "separated" || i === "ghost") &&
|
|
98
|
+
(i === "separated" || i === "ghost") && I,
|
|
99
99
|
$
|
|
100
100
|
),
|
|
101
101
|
children: [
|
|
@@ -146,7 +146,7 @@ const le = Y(
|
|
|
146
146
|
x ? "transition-none" : "",
|
|
147
147
|
l ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"
|
|
148
148
|
),
|
|
149
|
-
children: /* @__PURE__ */ t("div", { className: "overflow-
|
|
149
|
+
children: /* @__PURE__ */ t("div", { className: "overflow-hidden w-full", children: /* @__PURE__ */ t(
|
|
150
150
|
"div",
|
|
151
151
|
{
|
|
152
152
|
className: n(
|
|
@@ -62,6 +62,12 @@ export interface AutocompleteProps extends BaseAutocompleteProps {
|
|
|
62
62
|
* hooks, including focus management, dismissal on outside clicks,
|
|
63
63
|
* and proper ARIA roles for the combobox pattern.
|
|
64
64
|
*
|
|
65
|
+
* By default, the dropdown menu uses React's createPortal to render at the
|
|
66
|
+
* document body level. This ensures the menu escapes CSS containment, overflow
|
|
67
|
+
* clipping, and stacking context issues. The portal can be disabled via the
|
|
68
|
+
* `portal` prop or `components.autocomplete.portal` in the config if the menu
|
|
69
|
+
* needs to stay within a specific parent container.
|
|
70
|
+
*
|
|
65
71
|
* @param props - Autocomplete configuration options and input props.
|
|
66
72
|
* @param props.options - Suggestion list.
|
|
67
73
|
* @param props.value - Controlled selected value.
|
|
@@ -77,6 +83,8 @@ export interface AutocompleteProps extends BaseAutocompleteProps {
|
|
|
77
83
|
* @param props.disabled - Whether the input is disabled.
|
|
78
84
|
* @param props.placeholder - Placeholder text for the input.
|
|
79
85
|
* @param props.className - Extra classes for the input.
|
|
86
|
+
* @param props.portal - Whether to render the dropdown in a portal. Defaults to true.
|
|
87
|
+
* @param props.portalTarget - Custom portal target element. Defaults to document.body.
|
|
80
88
|
*
|
|
81
89
|
* @example
|
|
82
90
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/Autocomplete.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAI/B,KAAK,qBAAqB,GAAG,kBAAkB,GAC7C,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D;;;;;OAKG;IACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAE5E;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,eAAO,MAAM,YAAY,gHA+MxB,CAAC"}
|
|
@@ -1,150 +1,152 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import { forwardRef as ae, useMemo as F, useState as A, useEffect as
|
|
5
|
-
import { useAsheeConfig as
|
|
6
|
-
import { resolveCascade as
|
|
2
|
+
import { jsxs as te, jsx as b } from "react/jsx-runtime";
|
|
3
|
+
import { useFocus as re, useDismiss as se, useRole as oe, useInteractions as le } from "@floating-ui/react";
|
|
4
|
+
import { forwardRef as ae, useMemo as F, useState as A, useEffect as ce, useCallback as K } from "react";
|
|
5
|
+
import { useAsheeConfig as ie } from "../../libs/context.js";
|
|
6
|
+
import { resolveCascade as c, resolveRadiusKey as me } from "../../utils/resolve-token.js";
|
|
7
7
|
import { Input as pe } from "../input/Input.js";
|
|
8
|
-
import { SelectMenu as
|
|
9
|
-
import { FALLBACK_AUTOCOMPLETE_CONFIG as
|
|
10
|
-
|
|
8
|
+
import { SelectMenu as de } from "../select-menu/SelectMenu.js";
|
|
9
|
+
import { FALLBACK_AUTOCOMPLETE_CONFIG as o } from "./autocomplete-config.js";
|
|
10
|
+
import { useSelectFloating as fe } from "../select-menu/use-select-floating.js";
|
|
11
|
+
const ue = ae(
|
|
11
12
|
({
|
|
12
|
-
options:
|
|
13
|
-
value:
|
|
14
|
-
onValueChange:
|
|
15
|
-
onInputChange:
|
|
16
|
-
allowCustomValue:
|
|
17
|
-
belowList:
|
|
13
|
+
options: l = [],
|
|
14
|
+
value: r,
|
|
15
|
+
onValueChange: s,
|
|
16
|
+
onInputChange: i,
|
|
17
|
+
allowCustomValue: R = !1,
|
|
18
|
+
belowList: P,
|
|
18
19
|
dropdownClassName: L,
|
|
19
|
-
menu:
|
|
20
|
-
variant:
|
|
21
|
-
color:
|
|
22
|
-
radius:
|
|
20
|
+
menu: z,
|
|
21
|
+
variant: w,
|
|
22
|
+
color: E,
|
|
23
|
+
radius: M,
|
|
23
24
|
size: N,
|
|
24
|
-
endContent:
|
|
25
|
-
onClick:
|
|
25
|
+
endContent: j,
|
|
26
|
+
onClick: v,
|
|
26
27
|
disabled: O,
|
|
27
|
-
placeholder:
|
|
28
|
-
className:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
whileElementsMounted: C,
|
|
46
|
-
middleware: [
|
|
47
|
-
ee(4),
|
|
48
|
-
te(),
|
|
49
|
-
se({ padding: 8 }),
|
|
50
|
-
re({
|
|
51
|
-
apply({ availableHeight: e, elements: l }) {
|
|
52
|
-
Object.assign(l.floating.style, {
|
|
53
|
-
maxHeight: `${e}px`
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
]
|
|
58
|
-
}), G = oe(u), H = ie(u), I = le(u, { role: "combobox" }), { getReferenceProps: $, getFloatingProps: q } = ce([
|
|
59
|
-
G,
|
|
60
|
-
H,
|
|
61
|
-
I
|
|
62
|
-
]), J = S(
|
|
28
|
+
placeholder: _ = "Type to search...",
|
|
29
|
+
className: B,
|
|
30
|
+
portal: D,
|
|
31
|
+
portalTarget: G,
|
|
32
|
+
...I
|
|
33
|
+
}, m) => {
|
|
34
|
+
var x;
|
|
35
|
+
const p = ie(), e = (x = p.components) == null ? void 0 : x.autocomplete, U = c(
|
|
36
|
+
w,
|
|
37
|
+
e == null ? void 0 : e.variant,
|
|
38
|
+
p.defaultVariant,
|
|
39
|
+
o.variant
|
|
40
|
+
), q = c(
|
|
41
|
+
E,
|
|
42
|
+
e == null ? void 0 : e.color,
|
|
43
|
+
p.defaultColor,
|
|
44
|
+
o.color
|
|
45
|
+
), H = me(
|
|
63
46
|
M,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
),
|
|
68
|
-
P,
|
|
69
|
-
t == null ? void 0 : t.color,
|
|
70
|
-
f.defaultColor,
|
|
71
|
-
n.color
|
|
72
|
-
), W = de(
|
|
73
|
-
j,
|
|
74
|
-
t == null ? void 0 : t.radius,
|
|
75
|
-
f.defaultRadius,
|
|
76
|
-
n.radius
|
|
77
|
-
), X = S(
|
|
47
|
+
e == null ? void 0 : e.radius,
|
|
48
|
+
p.defaultRadius,
|
|
49
|
+
o.radius
|
|
50
|
+
), J = c(
|
|
78
51
|
N,
|
|
79
|
-
|
|
52
|
+
e == null ? void 0 : e.size,
|
|
53
|
+
void 0,
|
|
54
|
+
o.size
|
|
55
|
+
), Q = c(
|
|
56
|
+
D,
|
|
57
|
+
e == null ? void 0 : e.portal,
|
|
58
|
+
void 0,
|
|
59
|
+
o.portal
|
|
60
|
+
), W = c(
|
|
61
|
+
G,
|
|
62
|
+
e == null ? void 0 : e.portalTarget,
|
|
80
63
|
void 0,
|
|
81
|
-
|
|
82
|
-
),
|
|
83
|
-
(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
64
|
+
o.portalTarget
|
|
65
|
+
), a = F(
|
|
66
|
+
() => l.find((t) => t.value === r),
|
|
67
|
+
[l, r]
|
|
68
|
+
), [S, d] = A(!1), [f, u] = A(
|
|
69
|
+
() => a ? a.label : String(r ?? "")
|
|
70
|
+
);
|
|
71
|
+
ce(() => {
|
|
72
|
+
a ? u(a.label) : r != null && u(String(r));
|
|
73
|
+
}, [a, r]);
|
|
74
|
+
const { refs: T, floatingStyles: X, context: n } = fe({
|
|
75
|
+
isOpen: S,
|
|
76
|
+
onOpenChange: d,
|
|
77
|
+
disabled: O
|
|
78
|
+
}), Y = re(n), Z = se(n), $ = oe(n, { role: "combobox" }), { getReferenceProps: k, getFloatingProps: h } = le([
|
|
79
|
+
Y,
|
|
80
|
+
Z,
|
|
81
|
+
$
|
|
82
|
+
]), V = F(() => f.trim() ? l.filter(
|
|
83
|
+
(t) => t.label.toLowerCase().includes(f.toLowerCase())
|
|
84
|
+
) : l, [l, f]), g = K(
|
|
85
|
+
(t) => {
|
|
86
|
+
const y = t.target.value;
|
|
87
|
+
u(y), i == null || i(y), d(!0), R && (s == null || s(y));
|
|
88
88
|
},
|
|
89
|
-
[
|
|
90
|
-
),
|
|
91
|
-
(
|
|
92
|
-
|
|
89
|
+
[R, i, s]
|
|
90
|
+
), C = K(
|
|
91
|
+
(t) => {
|
|
92
|
+
u(t.label), s == null || s(t.value, t), d(!1);
|
|
93
93
|
},
|
|
94
|
-
[r]
|
|
95
|
-
), h = F(
|
|
96
|
-
() => s != null ? [s] : [],
|
|
97
94
|
[s]
|
|
95
|
+
), ee = F(
|
|
96
|
+
() => r != null ? [r] : [],
|
|
97
|
+
[r]
|
|
98
98
|
);
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ te("div", { className: "w-full relative inline-block", children: [
|
|
100
|
+
/* @__PURE__ */ b(
|
|
101
101
|
pe,
|
|
102
102
|
{
|
|
103
|
-
ref: (
|
|
104
|
-
|
|
103
|
+
ref: (t) => {
|
|
104
|
+
T.setReference(t), typeof m == "function" ? m(t) : m && (m.current = t);
|
|
105
105
|
},
|
|
106
|
-
variant:
|
|
107
|
-
radius:
|
|
108
|
-
color:
|
|
109
|
-
size:
|
|
106
|
+
variant: U,
|
|
107
|
+
radius: H,
|
|
108
|
+
color: q,
|
|
109
|
+
size: J,
|
|
110
110
|
disabled: O,
|
|
111
|
-
placeholder:
|
|
112
|
-
value:
|
|
113
|
-
onChange:
|
|
114
|
-
onClick: (
|
|
115
|
-
O ||
|
|
111
|
+
placeholder: _,
|
|
112
|
+
value: f,
|
|
113
|
+
onChange: g,
|
|
114
|
+
onClick: (t) => {
|
|
115
|
+
O || d(!0), v == null || v(t);
|
|
116
116
|
},
|
|
117
|
-
"aria-expanded":
|
|
117
|
+
"aria-expanded": S,
|
|
118
118
|
"aria-autocomplete": "none",
|
|
119
|
-
endContent:
|
|
120
|
-
className:
|
|
121
|
-
|
|
119
|
+
endContent: j,
|
|
120
|
+
className: B,
|
|
121
|
+
...k(I)
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
|
|
124
|
+
/* @__PURE__ */ b(
|
|
125
|
+
de,
|
|
126
126
|
{
|
|
127
|
-
isOpen:
|
|
128
|
-
context:
|
|
129
|
-
floatingStyles:
|
|
130
|
-
getFloatingProps:
|
|
131
|
-
setFloatingRef:
|
|
132
|
-
options:
|
|
133
|
-
selectedValues:
|
|
134
|
-
onSelectOption:
|
|
127
|
+
isOpen: S,
|
|
128
|
+
context: n,
|
|
129
|
+
floatingStyles: X,
|
|
130
|
+
getFloatingProps: h,
|
|
131
|
+
setFloatingRef: T.setFloating,
|
|
132
|
+
options: V,
|
|
133
|
+
selectedValues: ee,
|
|
134
|
+
onSelectOption: C,
|
|
135
135
|
isSearch: !1,
|
|
136
|
-
belowList:
|
|
136
|
+
belowList: P,
|
|
137
137
|
dropdownClassName: L,
|
|
138
|
-
menuProps:
|
|
139
|
-
menuConfig:
|
|
138
|
+
menuProps: z,
|
|
139
|
+
menuConfig: e == null ? void 0 : e.menu,
|
|
140
140
|
initialFocus: -1,
|
|
141
|
-
returnFocus: !1
|
|
141
|
+
returnFocus: !1,
|
|
142
|
+
portal: Q,
|
|
143
|
+
portalTarget: W
|
|
142
144
|
}
|
|
143
145
|
)
|
|
144
146
|
] });
|
|
145
147
|
}
|
|
146
148
|
);
|
|
147
|
-
|
|
149
|
+
ue.displayName = "Autocomplete";
|
|
148
150
|
export {
|
|
149
|
-
|
|
151
|
+
ue as Autocomplete
|
|
150
152
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldConfig } from '../field/field-config';
|
|
2
|
-
import {
|
|
2
|
+
import { SelectMenuConfig } from '../select-menu';
|
|
3
3
|
/**
|
|
4
4
|
* Theme configuration options for the Autocomplete component.
|
|
5
5
|
*
|
|
@@ -12,7 +12,23 @@ export interface AutocompleteConfig extends FieldConfig {
|
|
|
12
12
|
* Configuration for the dropdown menu that displays suggestions.
|
|
13
13
|
* Controls the menu's visual appearance and behavior.
|
|
14
14
|
*/
|
|
15
|
-
menu?:
|
|
15
|
+
menu?: SelectMenuConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to render the dropdown menu in a React portal.
|
|
18
|
+
* When true, the menu is rendered at the document body level,
|
|
19
|
+
* escaping any parent DOM hierarchy. This prevents CSS containment
|
|
20
|
+
* and stacking context issues. Defaults to true because dropdowns
|
|
21
|
+
* should always appear above other content.
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
portal?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Custom portal target element for the dropdown menu.
|
|
28
|
+
* When portal is enabled, the menu is rendered into this element.
|
|
29
|
+
* Defaults to document.body.
|
|
30
|
+
*/
|
|
31
|
+
portalTarget?: HTMLElement | null;
|
|
16
32
|
}
|
|
17
33
|
/**
|
|
18
34
|
* Default config values registered for the Autocomplete component.
|
|
@@ -25,7 +41,17 @@ export declare const defaultAutocompleteConfig: AutocompleteConfig;
|
|
|
25
41
|
* These values are used when instance props, component config,
|
|
26
42
|
* and global defaults are all undefined.
|
|
27
43
|
*/
|
|
28
|
-
export declare const FALLBACK_AUTOCOMPLETE_CONFIG:
|
|
44
|
+
export declare const FALLBACK_AUTOCOMPLETE_CONFIG: {
|
|
45
|
+
readonly portal: true;
|
|
46
|
+
readonly portalTarget: null;
|
|
47
|
+
readonly size: import('../field').FieldSizeKey;
|
|
48
|
+
readonly radius: import('../..').Radius;
|
|
49
|
+
readonly variant: import('../..').Variant;
|
|
50
|
+
readonly color: import('../..').Color;
|
|
51
|
+
readonly labelAlign: import('../field').LabelAlign;
|
|
52
|
+
readonly fullWidth: boolean;
|
|
53
|
+
readonly status: import('../field').FieldStatus;
|
|
54
|
+
};
|
|
29
55
|
declare module "../../libs/registry" {
|
|
30
56
|
interface ComponentTypeConfigRegistry {
|
|
31
57
|
autocomplete: AutocompleteConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-config.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"autocomplete-config.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAIvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;CAI/B,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,YAAY,EAAE,kBAAkB,CAAC;KAClC;CACF"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
import { registerComponentDefaults as t } from "../../libs/registry.js";
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as o, defaultFieldConfig as e } from "../field/field-config.js";
|
|
4
|
+
const l = {
|
|
5
|
+
...e,
|
|
6
|
+
portal: !0,
|
|
7
|
+
portalTarget: null
|
|
8
|
+
}, p = {
|
|
9
|
+
...o,
|
|
10
|
+
portal: !0,
|
|
11
|
+
portalTarget: null
|
|
12
|
+
};
|
|
13
|
+
t("autocomplete", l);
|
|
6
14
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
p as FALLBACK_AUTOCOMPLETE_CONFIG,
|
|
16
|
+
l as defaultAutocompleteConfig
|
|
9
17
|
};
|
|
@@ -119,6 +119,18 @@ export interface DatePickerProps {
|
|
|
119
119
|
* Inline styles for the date picker.
|
|
120
120
|
*/
|
|
121
121
|
style?: CSSProperties;
|
|
122
|
+
/**
|
|
123
|
+
* Whether to render the calendar popover in a React portal.
|
|
124
|
+
* When true, the popover is rendered at the document body level.
|
|
125
|
+
* Defaults to true.
|
|
126
|
+
*/
|
|
127
|
+
portal?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Custom portal target element for the calendar popover.
|
|
130
|
+
* When portal is enabled, the popover is rendered into this element.
|
|
131
|
+
* Defaults to document.body.
|
|
132
|
+
*/
|
|
133
|
+
portalTarget?: HTMLElement | null;
|
|
122
134
|
}
|
|
123
135
|
/**
|
|
124
136
|
* A date, time, or datetime picker component with a calendar popover.
|
|
@@ -132,6 +144,12 @@ export interface DatePickerProps {
|
|
|
132
144
|
* role="combobox", aria-expanded, aria-invalid, and proper focus management
|
|
133
145
|
* through Floating UI.
|
|
134
146
|
*
|
|
147
|
+
* By default, the calendar popover uses React's createPortal to render at the
|
|
148
|
+
* document body level. This ensures the popover escapes CSS containment,
|
|
149
|
+
* overflow clipping, and stacking context issues. The portal can be disabled
|
|
150
|
+
* via the `portal` prop or `components.datePicker.portal` in the config if
|
|
151
|
+
* the popover needs to stay within a specific parent container.
|
|
152
|
+
*
|
|
135
153
|
* @param props - DatePicker configuration options.
|
|
136
154
|
* @param props.selected - The currently selected date.
|
|
137
155
|
* @param props.onChange - Callback fired when the selected date changes.
|
|
@@ -154,6 +172,8 @@ export interface DatePickerProps {
|
|
|
154
172
|
* @param props.className - Extra CSS classes.
|
|
155
173
|
* @param props.id - Optional ID for the field.
|
|
156
174
|
* @param props.style - Inline styles.
|
|
175
|
+
* @param props.portal - Whether to render the popover in a portal. Defaults to true.
|
|
176
|
+
* @param props.portalTarget - Custom portal target element. Defaults to document.body.
|
|
157
177
|
*
|
|
158
178
|
* @example
|
|
159
179
|
* ```tsx
|
|
@@ -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":"AAgBA,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,OAAO,CAAC;AAQf,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,MAAM,EAEX,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAsa9B,MAAM,WAAW,eAAe;IAC9B;;;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;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,eAAO,MAAM,UAAU,4GA+QtB,CAAC"}
|