impact-nova 2.2.1 → 2.2.3
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/data/ag-grid-react/ag-grid-header-dom.d.ts +8 -0
- package/dist/components/data/ag-grid-react/ag-grid-header-dom.js +11 -0
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +4 -1
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +14 -3
- package/dist/components/data/ag-grid-react/headers/column-menu/column-header-settings-menu.d.ts +19 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-header-settings-menu.js +74 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.d.ts +4 -5
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +110 -144
- package/dist/components/data/ag-grid-react/headers/components/header-info.d.ts +2 -1
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +73 -70
- package/dist/components/data/ag-grid-react/headers/context/grid-header-context.d.ts +0 -8
- package/dist/components/data/ag-grid-react/headers/custom-header.js +112 -118
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +27 -23
- package/dist/components/data/ag-grid-react/headers/resolve-header-info-params.d.ts +10 -0
- package/dist/components/data/ag-grid-react/headers/resolve-header-info-params.js +19 -0
- package/dist/components/data/ag-grid-react/index.js +169 -210
- package/dist/components/data/ag-grid-react/info-system-story-columns.d.ts +12 -0
- package/dist/components/data/ag-grid-react/merge-column-group-defs.d.ts +3 -0
- package/dist/components/data/ag-grid-react/merge-column-group-defs.js +27 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +2 -1
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +7 -7
- package/dist/components/data/data-table/data-table-view-menu.d.ts +1 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +6 -7
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +3 -2
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +70 -68
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +29 -29
- package/dist/components/data-display/calendar/calendar.js +96 -94
- package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
- package/dist/components/feedback/dialog/dialog.js +107 -61
- package/dist/components/feedback/dropdown-menu/dropdown-menu.d.ts +1 -0
- package/dist/components/feedback/dropdown-menu/dropdown-menu.js +83 -76
- package/dist/components/feedback/popover/popover.d.ts +5 -2
- package/dist/components/feedback/popover/popover.js +43 -40
- package/dist/components/feedback/sheet/sheet.js +149 -102
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
- package/dist/components/flows/filter-panel/filter-panel.js +79 -76
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -4
- package/dist/components/forms/date-picker/date-input-behavior.js +86 -67
- package/dist/components/forms/date-picker/date-picker.js +59 -52
- package/dist/components/forms/date-picker/date-range-picker.js +26 -25
- package/dist/components/forms/date-picker/month-picker.js +76 -69
- package/dist/components/forms/date-picker/month-range-picker.js +41 -40
- package/dist/components/forms/date-picker/multi-date-picker.js +31 -31
- package/dist/components/forms/date-picker/multi-month-picker.js +27 -27
- package/dist/components/forms/date-picker/multi-week-picker.js +37 -37
- package/dist/components/forms/date-picker/week-picker.js +85 -78
- package/dist/components/forms/date-picker/week-range-picker.js +67 -66
- package/dist/components/forms/select/components/SelectMenuPanel.js +19 -15
- package/dist/components/forms/select/components/SelectOptionRow.js +110 -90
- package/dist/components/forms/select/components/Submenu.js +39 -34
- package/dist/components/forms/select/hooks/useSelectOpenEffects.js +65 -70
- package/dist/components/forms/select/select.js +228 -223
- package/dist/components/forms/select/select.types.d.ts +8 -0
- package/dist/impact-nova-components.css +59 -15
- package/dist/impact-nova.css +1 -1
- package/dist/lib/overlay/merge-element-refs.d.ts +2 -0
- package/dist/lib/overlay/merge-element-refs.js +17 -0
- package/dist/lib/overlay/overlay-host.constants.d.ts +4 -0
- package/dist/lib/overlay/overlay-host.constants.js +5 -0
- package/dist/lib/overlay/overlay-portal-context.d.ts +26 -0
- package/dist/lib/overlay/overlay-portal-context.js +65 -0
- package/dist/lib/overlay/use-overlay-portal-container-state.d.ts +5 -0
- package/dist/lib/overlay/use-overlay-portal-container-state.js +13 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +23 -8
- package/dist/components/forms/select/components/LabelWithSequence.d.ts +0 -13
- package/dist/components/forms/select/components/LabelWithSequence.js +0 -18
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Sheet as
|
|
4
|
-
import { createCompoundPart as
|
|
2
|
+
import v from "react";
|
|
3
|
+
import { Sheet as b, SheetContent as g, SheetDescription as N, SheetTitle as y, SheetClose as w } from "../../feedback/sheet/sheet.js";
|
|
4
|
+
import { createCompoundPart as C } from "../../../lib/primitives/create-compound.js";
|
|
5
5
|
import { cn as o } from "../../../lib/utils.js";
|
|
6
|
-
import { MultiColorFilter as
|
|
6
|
+
import { MultiColorFilter as k, Cross as F, InfoBadge as x } from "impact-nova-icons";
|
|
7
7
|
import { Button as P } from "../../primitives/button/button.js";
|
|
8
|
-
import { Tooltip as
|
|
9
|
-
import { Kbd as
|
|
8
|
+
import { Tooltip as c, TooltipTrigger as h, TooltipContent as f } from "../../feedback/tooltip/tooltip.js";
|
|
9
|
+
import { Kbd as j } from "../../primitives/kbd/kbd.js";
|
|
10
10
|
import { useImpactNovaI18n as u } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
import { useOverlayHostDismissBeforeClose as I } from "../../../lib/overlay/overlay-portal-context.js";
|
|
12
|
+
const S = ({
|
|
13
|
+
title: i,
|
|
14
|
+
children: n,
|
|
15
|
+
className: l
|
|
15
16
|
}) => {
|
|
16
|
-
const { t:
|
|
17
|
+
const { t: d } = u();
|
|
17
18
|
return /* @__PURE__ */ t(
|
|
18
19
|
"div",
|
|
19
20
|
{
|
|
20
21
|
"data-component": "filter-panel-header",
|
|
21
22
|
className: o(
|
|
22
23
|
"flex shrink-0 flex-row items-center justify-between border-b px-4 py-[9px] bg-canvas-elevated",
|
|
23
|
-
|
|
24
|
+
l
|
|
24
25
|
),
|
|
25
26
|
children: [
|
|
26
27
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
|
|
@@ -29,20 +30,20 @@ const j = ({
|
|
|
29
30
|
{
|
|
30
31
|
className: "flex size-8 shrink-0 items-center justify-center rounded-md border border-brand-tint bg-canvas-elevated",
|
|
31
32
|
"aria-hidden": !0,
|
|
32
|
-
children: /* @__PURE__ */ e(
|
|
33
|
+
children: /* @__PURE__ */ e(k, { className: "size-5 shrink-0" })
|
|
33
34
|
}
|
|
34
35
|
),
|
|
35
|
-
/* @__PURE__ */ e(y, { className: "text-lg font-bold text-content", children:
|
|
36
|
+
/* @__PURE__ */ e(y, { className: "text-lg font-bold text-content", children: i })
|
|
36
37
|
] }),
|
|
37
38
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
38
|
-
|
|
39
|
+
n,
|
|
39
40
|
/* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(
|
|
40
41
|
P,
|
|
41
42
|
{
|
|
42
43
|
variant: "secondary",
|
|
43
44
|
size: "icon",
|
|
44
45
|
tabIndex: -1,
|
|
45
|
-
"aria-label":
|
|
46
|
+
"aria-label": d("aria.close"),
|
|
46
47
|
"data-component": "filter-panel-close",
|
|
47
48
|
children: /* @__PURE__ */ e(F, { className: "h-3 w-3" })
|
|
48
49
|
}
|
|
@@ -51,72 +52,74 @@ const j = ({
|
|
|
51
52
|
]
|
|
52
53
|
}
|
|
53
54
|
);
|
|
54
|
-
},
|
|
55
|
-
open:
|
|
56
|
-
onOpenChange:
|
|
57
|
-
title:
|
|
58
|
-
children:
|
|
59
|
-
header:
|
|
60
|
-
sidebar:
|
|
61
|
-
className:
|
|
62
|
-
preventClose:
|
|
63
|
-
}) => /* @__PURE__ */ e(
|
|
55
|
+
}, W = ({
|
|
56
|
+
open: i,
|
|
57
|
+
onOpenChange: n,
|
|
58
|
+
title: l = "Filter panel",
|
|
59
|
+
children: d,
|
|
60
|
+
header: s,
|
|
61
|
+
sidebar: p,
|
|
62
|
+
className: m,
|
|
63
|
+
preventClose: a = !1
|
|
64
|
+
}) => /* @__PURE__ */ e(b, { open: i, onOpenChange: n, children: /* @__PURE__ */ t(
|
|
64
65
|
g,
|
|
65
66
|
{
|
|
66
67
|
side: "right",
|
|
67
68
|
className: o(
|
|
68
69
|
"w-full !max-w-[840px] p-0 sm:!max-w-[840px] gap-0 border-l shadow-xl transition-all duration-300 ease-in-out bg-canvas-elevated",
|
|
69
|
-
|
|
70
|
+
m
|
|
70
71
|
),
|
|
71
|
-
onInteractOutside: (
|
|
72
|
-
|
|
72
|
+
onInteractOutside: (r) => {
|
|
73
|
+
a && r.preventDefault();
|
|
73
74
|
},
|
|
74
|
-
onEscapeKeyDown: (
|
|
75
|
-
|
|
75
|
+
onEscapeKeyDown: (r) => {
|
|
76
|
+
a && r.preventDefault();
|
|
76
77
|
},
|
|
77
78
|
children: [
|
|
78
79
|
/* @__PURE__ */ e(N, { className: "sr-only", children: "Select filters to apply to the current view." }),
|
|
79
80
|
/* @__PURE__ */ t("div", { className: "flex h-full flex-col bg-canvas-elevated", "data-component": "filter-panel", children: [
|
|
80
|
-
|
|
81
|
+
s || /* @__PURE__ */ e(S, { title: l }),
|
|
81
82
|
/* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children:
|
|
83
|
+
p,
|
|
84
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children: d })
|
|
84
85
|
] })
|
|
85
86
|
] })
|
|
86
87
|
]
|
|
87
88
|
}
|
|
88
|
-
) }),
|
|
89
|
-
items:
|
|
90
|
-
activeTab:
|
|
91
|
-
onTabChange:
|
|
92
|
-
className:
|
|
89
|
+
) }), _ = ({
|
|
90
|
+
items: i,
|
|
91
|
+
activeTab: n,
|
|
92
|
+
onTabChange: l,
|
|
93
|
+
className: d
|
|
93
94
|
}) => {
|
|
94
|
-
const { t:
|
|
95
|
+
const { t: s } = u(), p = I(), m = (a) => {
|
|
96
|
+
a !== n && p(), l(a);
|
|
97
|
+
};
|
|
95
98
|
return /* @__PURE__ */ e(
|
|
96
99
|
"div",
|
|
97
100
|
{
|
|
98
101
|
"data-component": "filter-panel-sidebar",
|
|
99
102
|
className: o(
|
|
100
103
|
"flex w-[200px] shrink-0 flex-col border-r bg-navigation-canvas",
|
|
101
|
-
|
|
104
|
+
d
|
|
102
105
|
),
|
|
103
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col py-2 gap-1 overflow-y-auto", children:
|
|
104
|
-
const
|
|
105
|
-
return /* @__PURE__ */ t(
|
|
106
|
+
children: /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col py-2 gap-1 overflow-y-auto", children: i.map((a) => {
|
|
107
|
+
const r = n === a.id;
|
|
108
|
+
return /* @__PURE__ */ t(v.Fragment, { children: [
|
|
106
109
|
a.separator && /* @__PURE__ */ e("div", { className: "my-2 h-px bg-stroke-hairline" }),
|
|
107
110
|
/* @__PURE__ */ t(
|
|
108
111
|
"button",
|
|
109
112
|
{
|
|
110
113
|
type: "button",
|
|
111
|
-
autoFocus:
|
|
112
|
-
onClick: () =>
|
|
114
|
+
autoFocus: r,
|
|
115
|
+
onClick: () => m(a.id),
|
|
113
116
|
"data-component": "filter-panel-sidebar-item",
|
|
114
|
-
"data-active":
|
|
117
|
+
"data-active": r ? "true" : "false",
|
|
115
118
|
"data-tab": a.id,
|
|
116
119
|
"data-shortcut-id": a.shortcutId,
|
|
117
120
|
className: o(
|
|
118
121
|
"group flex items-center justify-between px-3 py-[6px] mx-2 rounded-lg text-left text-sm font-medium transition-colors",
|
|
119
|
-
|
|
122
|
+
r ? "bg-canvas-accent text-brand" : "text-content-secondary hover:bg-canvas-accent"
|
|
120
123
|
),
|
|
121
124
|
children: [
|
|
122
125
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
@@ -125,19 +128,19 @@ const j = ({
|
|
|
125
128
|
{
|
|
126
129
|
className: o(
|
|
127
130
|
"shrink-0",
|
|
128
|
-
|
|
131
|
+
r ? "text-brand" : "text-content-secondary"
|
|
129
132
|
),
|
|
130
133
|
children: a.icon
|
|
131
134
|
}
|
|
132
135
|
),
|
|
133
136
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
134
|
-
/* @__PURE__ */ t(
|
|
137
|
+
/* @__PURE__ */ t(c, { children: [
|
|
135
138
|
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "truncate font-['Manrope']", children: a.label }) }),
|
|
136
139
|
/* @__PURE__ */ e(f, { variant: "tertiary", side: "right", children: a.tooltipKeybinding ? /* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: [
|
|
137
140
|
a.label,
|
|
138
141
|
" ",
|
|
139
142
|
/* @__PURE__ */ e(
|
|
140
|
-
|
|
143
|
+
j,
|
|
141
144
|
{
|
|
142
145
|
keybinding: a.tooltipKeybinding,
|
|
143
146
|
size: "sm"
|
|
@@ -149,33 +152,33 @@ const j = ({
|
|
|
149
152
|
] })
|
|
150
153
|
] }),
|
|
151
154
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1 shrink-0 ml-1", children: [
|
|
152
|
-
a.count !== void 0 && a.count > 0 && /* @__PURE__ */ t(
|
|
155
|
+
a.count !== void 0 && a.count > 0 && /* @__PURE__ */ t(c, { children: [
|
|
153
156
|
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(
|
|
154
157
|
"span",
|
|
155
158
|
{
|
|
156
159
|
className: o(
|
|
157
160
|
"inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[11px] font-medium tabular-nums leading-none shrink-0",
|
|
158
|
-
|
|
161
|
+
r ? "bg-canvas-elevated text-brand border border-stroke-subtle" : "bg-brand-tint border border-stroke-subtle"
|
|
159
162
|
),
|
|
160
163
|
children: a.count
|
|
161
164
|
}
|
|
162
165
|
) }),
|
|
163
|
-
/* @__PURE__ */ e(f, { variant: "tertiary", side: "top", children:
|
|
166
|
+
/* @__PURE__ */ e(f, { variant: "tertiary", side: "top", children: s(
|
|
164
167
|
a.countBadgeContext === "savedFiltersTotal" ? "filterPanel.savedFiltersAvailableCount" : "filterPanel.filtersAppliedCount",
|
|
165
168
|
{ count: a.count }
|
|
166
169
|
) })
|
|
167
170
|
] }),
|
|
168
|
-
a.hasError && /* @__PURE__ */ t(
|
|
169
|
-
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(
|
|
170
|
-
/* @__PURE__ */ e(f, { variant: "tertiary", children:
|
|
171
|
+
a.hasError && /* @__PURE__ */ t(c, { children: [
|
|
172
|
+
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(x, { className: "h-5 w-5 shrink-0 text-danger" }) }),
|
|
173
|
+
/* @__PURE__ */ e(f, { variant: "tertiary", children: s("filterPanel.tabContainsErrors") })
|
|
171
174
|
] }),
|
|
172
|
-
a.hasWarning && /* @__PURE__ */ t(
|
|
173
|
-
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(
|
|
174
|
-
/* @__PURE__ */ e(f, { variant: "tertiary", children:
|
|
175
|
+
a.hasWarning && /* @__PURE__ */ t(c, { children: [
|
|
176
|
+
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(x, { className: "h-5 w-5 shrink-0 text-warning" }) }),
|
|
177
|
+
/* @__PURE__ */ e(f, { variant: "tertiary", children: s("filterPanel.tabHasWarnings") })
|
|
175
178
|
] }),
|
|
176
|
-
a.hasInfo && /* @__PURE__ */ t(
|
|
177
|
-
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(
|
|
178
|
-
/* @__PURE__ */ e(f, { variant: "tertiary", children:
|
|
179
|
+
a.hasInfo && /* @__PURE__ */ t(c, { children: [
|
|
180
|
+
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(x, { className: "h-5 w-5 shrink-0 text-content-icon" }) }),
|
|
181
|
+
/* @__PURE__ */ e(f, { variant: "tertiary", children: s("filterPanel.additionalInfoAvailable") })
|
|
179
182
|
] })
|
|
180
183
|
] })
|
|
181
184
|
]
|
|
@@ -185,32 +188,32 @@ const j = ({
|
|
|
185
188
|
}) })
|
|
186
189
|
}
|
|
187
190
|
);
|
|
188
|
-
},
|
|
191
|
+
}, q = C("filter-panel", {
|
|
189
192
|
part: "body",
|
|
190
193
|
displayName: "FilterPanelBody",
|
|
191
194
|
className: "flex flex-1 flex-col overflow-auto bg-canvas-elevated p-4"
|
|
192
|
-
}),
|
|
193
|
-
children:
|
|
194
|
-
className:
|
|
195
|
-
leftAction:
|
|
195
|
+
}), L = ({
|
|
196
|
+
children: i,
|
|
197
|
+
className: n,
|
|
198
|
+
leftAction: l
|
|
196
199
|
}) => /* @__PURE__ */ t(
|
|
197
200
|
"div",
|
|
198
201
|
{
|
|
199
202
|
"data-component": "filter-panel-footer",
|
|
200
203
|
className: o(
|
|
201
204
|
"flex items-center justify-between border-t bg-canvas-elevated px-4 py-3 shrink-0",
|
|
202
|
-
|
|
205
|
+
n
|
|
203
206
|
),
|
|
204
207
|
children: [
|
|
205
|
-
/* @__PURE__ */ e("div", { children:
|
|
206
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children:
|
|
208
|
+
/* @__PURE__ */ e("div", { children: l && l }),
|
|
209
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: i })
|
|
207
210
|
]
|
|
208
211
|
}
|
|
209
212
|
);
|
|
210
213
|
export {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
W as FilterPanel,
|
|
215
|
+
q as FilterPanelBody,
|
|
216
|
+
L as FilterPanelFooter,
|
|
217
|
+
S as FilterPanelHeader,
|
|
218
|
+
_ as FilterPanelSidebar
|
|
216
219
|
};
|
|
@@ -30,13 +30,15 @@ export declare function isEventOnPickerSurface(event: Event, surfaceRef: RefObje
|
|
|
30
30
|
/** Block Radix outside-dismiss when the calendar footer requires explicit Apply/Cancel. */
|
|
31
31
|
export declare function preventOutsideDismissWhenFooter(showFooter: boolean, dismissActionsRef?: RefObject<{
|
|
32
32
|
onDismiss: () => void;
|
|
33
|
-
resolveFlash: () =>
|
|
33
|
+
resolveFlash: () => PickerDismissAction;
|
|
34
34
|
}>, triggerOutsideFlash?: (target: FooterFlashTarget) => void, surfaceRef?: RefObject<HTMLElement | null>): {
|
|
35
35
|
onInteractOutside?: (event: Event) => void;
|
|
36
36
|
onPointerDownOutside?: (event: Event) => void;
|
|
37
37
|
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
38
38
|
};
|
|
39
39
|
export type { FooterFlashTarget } from '../../data-display/calendar/calendar-footer-emphasis';
|
|
40
|
+
export type PickerDismissAction = FooterFlashTarget | "dismiss";
|
|
41
|
+
export declare function resolveSingleValueDismissFlash<T>(pending: T | undefined, committed: T | undefined, isEqual: (left: T, right: T) => boolean): PickerDismissAction;
|
|
40
42
|
export declare function resolveRangePickerDismissFlash<TFrom, TTo>(params: {
|
|
41
43
|
startInput: string;
|
|
42
44
|
endInput: string;
|
|
@@ -46,6 +48,10 @@ export declare function resolveRangePickerDismissFlash<TFrom, TTo>(params: {
|
|
|
46
48
|
from?: TFrom;
|
|
47
49
|
to?: TTo;
|
|
48
50
|
} | undefined;
|
|
51
|
+
pendingRange?: {
|
|
52
|
+
from?: TFrom;
|
|
53
|
+
to?: TTo;
|
|
54
|
+
} | undefined;
|
|
49
55
|
computeEffectiveRange: () => {
|
|
50
56
|
from?: TFrom;
|
|
51
57
|
to?: TTo;
|
|
@@ -57,14 +63,14 @@ export declare function resolveRangePickerDismissFlash<TFrom, TTo>(params: {
|
|
|
57
63
|
from?: TFrom;
|
|
58
64
|
to?: TTo;
|
|
59
65
|
} | undefined) => boolean;
|
|
60
|
-
}):
|
|
66
|
+
}): PickerDismissAction;
|
|
61
67
|
export declare function usePickerDismissActionsRef(): React.RefObject<{
|
|
62
68
|
onDismiss: () => void;
|
|
63
|
-
resolveFlash: () =>
|
|
69
|
+
resolveFlash: () => PickerDismissAction;
|
|
64
70
|
}>;
|
|
65
71
|
export declare function usePickerFooterDismissNudge(showFooter: boolean, open: boolean, dismissActionsRef: React.RefObject<{
|
|
66
72
|
onDismiss: () => void;
|
|
67
|
-
resolveFlash: () =>
|
|
73
|
+
resolveFlash: () => PickerDismissAction;
|
|
68
74
|
}>, surfaceRef?: RefObject<HTMLElement | null>): {
|
|
69
75
|
footerFlashKey: number;
|
|
70
76
|
footerFlashTarget: FooterFlashTarget | undefined;
|
|
@@ -1,104 +1,122 @@
|
|
|
1
|
-
import { parse as
|
|
2
|
-
import * as
|
|
3
|
-
import { resolveRangeFooterFlashTarget as
|
|
4
|
-
import { padValidDateString as
|
|
5
|
-
function
|
|
6
|
-
return
|
|
1
|
+
import { parse as h, isValid as D } from "date-fns";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { resolveRangeFooterFlashTarget as v } from "../../data-display/calendar/calendar-footer-emphasis.js";
|
|
4
|
+
import { padValidDateString as y, maskDate as k } from "../../../lib/utils.js";
|
|
5
|
+
function E(e, t, n) {
|
|
6
|
+
return k(e, t, n);
|
|
7
7
|
}
|
|
8
8
|
function f(e, t, n) {
|
|
9
|
-
const r =
|
|
9
|
+
const r = y(e, t), s = h(r, t, /* @__PURE__ */ new Date(), n ? { locale: n } : {}), a = D(s) && r.length === t.length;
|
|
10
10
|
return {
|
|
11
11
|
padded: r,
|
|
12
|
-
parsed:
|
|
12
|
+
parsed: a ? s : void 0,
|
|
13
13
|
isComplete: e.length === t.length,
|
|
14
|
-
isValid:
|
|
14
|
+
isValid: a
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function T(e, t, n) {
|
|
18
18
|
return !e || e.length !== t.length ? !1 : !f(e, t, n).isValid;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function m(e, t) {
|
|
21
21
|
const n = document.activeElement;
|
|
22
22
|
return n instanceof Node ? !!(e.current?.contains(n) || t.current?.contains(n)) : !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function S(e) {
|
|
25
25
|
return (t) => {
|
|
26
26
|
if (!e.disabled) {
|
|
27
27
|
if (t) {
|
|
28
28
|
e.setOpen(!0);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
e.showFooter
|
|
32
|
-
|
|
31
|
+
if (e.showFooter) {
|
|
32
|
+
e.setOpen(!1);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
queueMicrotask(() => {
|
|
36
|
+
m(e.containerRef, e.popoverContentRef) || e.setOpen(!1);
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
39
|
};
|
|
36
40
|
}
|
|
37
|
-
function
|
|
41
|
+
function O(e, t) {
|
|
38
42
|
const n = e.target;
|
|
39
43
|
return n instanceof Node ? !!t.current?.contains(n) : !1;
|
|
40
44
|
}
|
|
41
|
-
function
|
|
45
|
+
function F(e, t, n, r) {
|
|
42
46
|
return e ? {
|
|
43
|
-
onInteractOutside: (
|
|
44
|
-
|
|
47
|
+
onInteractOutside: (i) => {
|
|
48
|
+
i.preventDefault();
|
|
45
49
|
},
|
|
46
|
-
onPointerDownOutside: (
|
|
47
|
-
|
|
50
|
+
onPointerDownOutside: (i) => {
|
|
51
|
+
if (i.preventDefault(), !(r && O(i, r)) && t) {
|
|
52
|
+
const o = t.current.resolveFlash();
|
|
53
|
+
if (o === "dismiss") {
|
|
54
|
+
t.current.onDismiss();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
n?.(o);
|
|
58
|
+
}
|
|
48
59
|
},
|
|
49
|
-
onEscapeKeyDown: t ? (
|
|
50
|
-
|
|
60
|
+
onEscapeKeyDown: t ? (i) => {
|
|
61
|
+
i.preventDefault(), t.current.onDismiss();
|
|
51
62
|
} : void 0
|
|
52
63
|
} : {};
|
|
53
64
|
}
|
|
54
|
-
function
|
|
65
|
+
function V(e, t, n) {
|
|
66
|
+
const r = e == null, s = t == null;
|
|
67
|
+
return r && s || !r && !s && n(e, t) ? "dismiss" : r ? "cancel" : "apply";
|
|
68
|
+
}
|
|
69
|
+
function B(e) {
|
|
55
70
|
const {
|
|
56
71
|
startInput: t,
|
|
57
72
|
endInput: n,
|
|
58
73
|
committedStart: r,
|
|
59
74
|
committedEnd: s,
|
|
60
|
-
committedRange:
|
|
61
|
-
|
|
75
|
+
committedRange: a,
|
|
76
|
+
pendingRange: i,
|
|
77
|
+
computeEffectiveRange: u,
|
|
62
78
|
rangesEqual: o
|
|
63
|
-
} = e, c =
|
|
64
|
-
return
|
|
79
|
+
} = e, c = t !== r || n !== s, l = u(), p = !c && i !== void 0 ? i : l, g = !o(p, a);
|
|
80
|
+
return !c && !g ? "dismiss" : v(
|
|
81
|
+
c ? l : p
|
|
82
|
+
) === "apply" ? "apply" : "cancel";
|
|
65
83
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
84
|
+
function q() {
|
|
85
|
+
return d.useRef({
|
|
68
86
|
onDismiss: () => {
|
|
69
87
|
},
|
|
70
88
|
resolveFlash: () => "cancel"
|
|
71
89
|
});
|
|
72
90
|
}
|
|
73
|
-
function
|
|
74
|
-
const [s,
|
|
75
|
-
|
|
76
|
-
|
|
91
|
+
function b(e, t, n, r) {
|
|
92
|
+
const [s, a] = d.useState({ key: 0, target: "cancel" }), i = d.useRef(t);
|
|
93
|
+
d.useLayoutEffect(() => {
|
|
94
|
+
i.current !== t && (i.current = t, a({ key: 0, target: "cancel" }));
|
|
77
95
|
}, [t]);
|
|
78
|
-
const
|
|
79
|
-
(
|
|
80
|
-
e &&
|
|
96
|
+
const u = d.useCallback(
|
|
97
|
+
(c) => {
|
|
98
|
+
e && a((l) => ({ key: l.key + 1, target: c }));
|
|
81
99
|
},
|
|
82
100
|
[e]
|
|
83
|
-
),
|
|
101
|
+
), o = F(
|
|
84
102
|
e,
|
|
85
103
|
n,
|
|
86
|
-
|
|
104
|
+
u,
|
|
87
105
|
r
|
|
88
106
|
);
|
|
89
107
|
return {
|
|
90
108
|
footerFlashKey: s.key,
|
|
91
109
|
footerFlashTarget: s.key > 0 ? s.target : void 0,
|
|
92
|
-
triggerFooterFlash:
|
|
93
|
-
popoverHandlers:
|
|
110
|
+
triggerFooterFlash: u,
|
|
111
|
+
popoverHandlers: o
|
|
94
112
|
};
|
|
95
113
|
}
|
|
96
|
-
function
|
|
114
|
+
function M(e, t, n) {
|
|
97
115
|
queueMicrotask(() => {
|
|
98
|
-
|
|
116
|
+
m(e, t) || n();
|
|
99
117
|
});
|
|
100
118
|
}
|
|
101
|
-
function
|
|
119
|
+
function R(e, t, n, r) {
|
|
102
120
|
if (!e)
|
|
103
121
|
return { display: "", parsed: void 0, resetToCommitted: !1 };
|
|
104
122
|
const s = f(e, t, r);
|
|
@@ -108,27 +126,27 @@ function F(e, t, n, r) {
|
|
|
108
126
|
resetToCommitted: !1
|
|
109
127
|
} : e.length < t.length ? { display: e, parsed: void 0, resetToCommitted: !1 } : { display: n, parsed: void 0, resetToCommitted: !0 };
|
|
110
128
|
}
|
|
111
|
-
function
|
|
112
|
-
const s =
|
|
129
|
+
function X(e, t, n, r) {
|
|
130
|
+
const s = R(e, t, n, r);
|
|
113
131
|
return {
|
|
114
132
|
...s,
|
|
115
133
|
isPartial: !!e && e.length < t.length && !s.resetToCommitted
|
|
116
134
|
};
|
|
117
135
|
}
|
|
118
|
-
function
|
|
136
|
+
function x(e, t, n) {
|
|
119
137
|
const r = f(e, t, n);
|
|
120
138
|
return r.isValid && r.parsed ? { parsed: r.parsed, shouldOpenPopover: !1 } : { parsed: void 0, shouldOpenPopover: !0 };
|
|
121
139
|
}
|
|
122
|
-
function
|
|
140
|
+
function N(e, t, n) {
|
|
123
141
|
return e === void 0 || t === void 0 ? { from: e, to: t, swapped: !1 } : n(e, t) <= 0 ? { from: e, to: t, swapped: !1 } : { from: t, to: e, swapped: !0 };
|
|
124
142
|
}
|
|
125
|
-
function
|
|
143
|
+
function H(e, t) {
|
|
126
144
|
return e.year * 12 + e.month - (t.year * 12 + t.month);
|
|
127
145
|
}
|
|
128
|
-
function
|
|
146
|
+
function K(e, t) {
|
|
129
147
|
return e.getTime() - t.getTime();
|
|
130
148
|
}
|
|
131
|
-
function
|
|
149
|
+
function z(e) {
|
|
132
150
|
if (!e || typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
|
|
133
151
|
return;
|
|
134
152
|
const t = e.querySelector('[data-field="start"]'), n = e.querySelector('[data-field="end"]');
|
|
@@ -143,22 +161,23 @@ function N(e) {
|
|
|
143
161
|
));
|
|
144
162
|
}
|
|
145
163
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
164
|
+
K as compareDates,
|
|
165
|
+
H as compareMonthSelection,
|
|
166
|
+
S as createRangePickerOpenChangeHandler,
|
|
167
|
+
M as deferRangeInputBlur,
|
|
168
|
+
z as flashRangeReorder,
|
|
169
|
+
T as isDateInputInvalid,
|
|
170
|
+
O as isEventOnPickerSurface,
|
|
171
|
+
m as isFocusInsidePicker,
|
|
172
|
+
E as maskDateInput,
|
|
173
|
+
N as normalizeOrderedRange,
|
|
156
174
|
f as parseDateInput,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
175
|
+
F as preventOutsideDismissWhenFooter,
|
|
176
|
+
R as resolveDateInputOnBlur,
|
|
177
|
+
x as resolveDateInputOnEnter,
|
|
178
|
+
X as resolveRangeFieldBlur,
|
|
179
|
+
B as resolveRangePickerDismissFlash,
|
|
180
|
+
V as resolveSingleValueDismissFlash,
|
|
181
|
+
q as usePickerDismissActionsRef,
|
|
182
|
+
b as usePickerFooterDismissNudge
|
|
164
183
|
};
|