impact-nova 2.4.0 → 2.5.1
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/data-table/data-table-column-list.js +16 -16
- package/dist/components/data/data-table/data-table-sheet-layout.d.ts +26 -0
- package/dist/components/data/data-table/data-table-sheet-layout.js +71 -0
- package/dist/components/data/data-table/data-table-sheet.d.ts +2 -0
- package/dist/components/data/data-table/index.d.ts +1 -0
- package/dist/components/data/data-table/index.js +40 -34
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +2 -3
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +2 -3
- package/dist/components/data/nested-list/hooks/useNestedListHandlers.d.ts +3 -2
- package/dist/components/data/nested-list/hooks/useNestedListHandlers.js +129 -130
- package/dist/components/data/nested-list/hooks/useNestedListState.d.ts +2 -3
- package/dist/components/data/nested-list/hooks/useNestedListState.js +118 -117
- package/dist/components/data/nested-list/nested-list.js +219 -221
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
- package/dist/components/flows/accordion-nested-list/accordion-nested-list.js +80 -65
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/date-picker/month-picker.js +136 -109
- package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
- package/dist/components/forms/select/components/Submenu.js +2 -3
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +170 -164
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,103 +1,118 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
2
|
-
import { useState as H, useCallback as
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as H, useCallback as f, useMemo as J } from "react";
|
|
3
3
|
import { AccordionItem as K, AccordionTrigger as Q, AccordionContent as R, Accordion as N } from "../../primitives/accordion/accordion.js";
|
|
4
|
-
import { Button as
|
|
4
|
+
import { Button as y } from "../../primitives/button/button.js";
|
|
5
5
|
import { NestedList as U } from "../../data/nested-list/nested-list.js";
|
|
6
6
|
import { useAccordionNestedListState as X } from "./hooks/useAccordionNestedListState.js";
|
|
7
7
|
import { SelectionMode as Y } from "../../data/nested-list/nested-list.types.js";
|
|
8
8
|
import { cn as Z } from "../../../lib/utils.js";
|
|
9
9
|
import { useImpactNovaI18n as $ } from "../../../i18n/use-impact-nova-i18n.js";
|
|
10
|
-
const
|
|
10
|
+
const ce = ({
|
|
11
11
|
sections: l,
|
|
12
12
|
onChange: m,
|
|
13
13
|
onSubmit: h,
|
|
14
|
-
onCancel:
|
|
14
|
+
onCancel: u,
|
|
15
15
|
enableApplyDiscard: C = !0,
|
|
16
|
-
submitButtonLabel:
|
|
17
|
-
cancelButtonLabel:
|
|
18
|
-
className:
|
|
19
|
-
enableSearch:
|
|
20
|
-
enableDragDrop:
|
|
21
|
-
enableSelectAll:
|
|
22
|
-
selectionMode:
|
|
23
|
-
searchPlaceholder:
|
|
24
|
-
value:
|
|
25
|
-
onValueChange:
|
|
26
|
-
isMultiExpanded:
|
|
27
|
-
defaultCollapseAll:
|
|
28
|
-
validateApply:
|
|
16
|
+
submitButtonLabel: g,
|
|
17
|
+
cancelButtonLabel: L,
|
|
18
|
+
className: S = "",
|
|
19
|
+
enableSearch: k = !0,
|
|
20
|
+
enableDragDrop: w = !0,
|
|
21
|
+
enableSelectAll: B = !0,
|
|
22
|
+
selectionMode: D = Y.CASCADE_DOWN,
|
|
23
|
+
searchPlaceholder: I,
|
|
24
|
+
value: V,
|
|
25
|
+
onValueChange: j,
|
|
26
|
+
isMultiExpanded: r = !0,
|
|
27
|
+
defaultCollapseAll: P = !1,
|
|
28
|
+
validateApply: c
|
|
29
29
|
}) => {
|
|
30
|
-
const { t: i } = $(), M =
|
|
31
|
-
currentSections:
|
|
32
|
-
hasChanges:
|
|
30
|
+
const { t: i } = $(), M = g ?? i("nestedList.apply"), O = L ?? i("nestedList.reset"), T = I ?? i("nestedList.searchPlaceholder"), {
|
|
31
|
+
currentSections: n,
|
|
32
|
+
hasChanges: o,
|
|
33
33
|
setCurrentSection: p,
|
|
34
|
-
saveAllSections:
|
|
35
|
-
discardAllSections:
|
|
36
|
-
} = X({ sections: l }), [W, _] = H(() =>
|
|
37
|
-
(e,
|
|
38
|
-
p(e,
|
|
34
|
+
saveAllSections: x,
|
|
35
|
+
discardAllSections: v
|
|
36
|
+
} = X({ sections: l }), [W, _] = H(() => P ? r ? [] : "" : l.length > 0 ? r ? [l[0].id] : l[0].id : r ? [] : ""), a = V ?? W, b = j ?? _, q = f(
|
|
37
|
+
(e, s) => {
|
|
38
|
+
p(e, s), m?.(e, s);
|
|
39
39
|
},
|
|
40
40
|
[m, p]
|
|
41
|
-
), z =
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
), z = f(() => {
|
|
42
|
+
x(), h?.(n);
|
|
43
|
+
}, [n, h, x]), F = f(() => {
|
|
44
|
+
v(), u?.();
|
|
45
|
+
}, [v, u]), G = J(() => o ? c ? c(n) : !0 : !1, [o, c, n]), A = l.map((e) => /* @__PURE__ */ d(
|
|
46
|
+
K,
|
|
47
|
+
{
|
|
48
|
+
value: e.id,
|
|
49
|
+
className: "flex flex-col border-b-0 data-[state=open]:flex-1 data-[state=open]:min-h-0",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ t(Q, { className: "shrink-0", children: e.label }),
|
|
52
|
+
/* @__PURE__ */ t(
|
|
53
|
+
R,
|
|
54
|
+
{
|
|
55
|
+
className: "flex min-h-0 flex-1 flex-col px-0 pb-2 pt-0",
|
|
56
|
+
surfaceClassName: "overflow-hidden data-[state=open]:flex data-[state=open]:flex-1 data-[state=open]:min-h-0 data-[state=open]:flex-col data-[state=open]:overflow-hidden data-[state=open]:h-full data-[state=open]:animate-none",
|
|
57
|
+
children: /* @__PURE__ */ t(
|
|
58
|
+
U,
|
|
59
|
+
{
|
|
60
|
+
items: n[e.id] || [],
|
|
61
|
+
onChange: (s) => q(e.id, s),
|
|
62
|
+
enableApplyDiscard: !1,
|
|
63
|
+
enableSearch: k,
|
|
64
|
+
enableDragDrop: w,
|
|
65
|
+
enableSelectAll: B,
|
|
66
|
+
selectionMode: e.selectionMode ?? D,
|
|
67
|
+
searchPlaceholder: T,
|
|
68
|
+
className: "flex-1 min-h-0"
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
e.id
|
|
76
|
+
));
|
|
62
77
|
return /* @__PURE__ */ d(
|
|
63
78
|
"div",
|
|
64
79
|
{
|
|
65
|
-
className: Z("flex flex-col
|
|
80
|
+
className: Z("flex min-h-0 flex-col", S),
|
|
66
81
|
"data-component": "accordion-nested-list",
|
|
67
|
-
"data-has-changes":
|
|
82
|
+
"data-has-changes": o ? "" : void 0,
|
|
68
83
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: r ? /* @__PURE__ */ t(
|
|
70
85
|
N,
|
|
71
86
|
{
|
|
72
87
|
type: "multiple",
|
|
73
|
-
value: Array.isArray(
|
|
74
|
-
onValueChange:
|
|
75
|
-
className: "space-y-4",
|
|
76
|
-
children:
|
|
88
|
+
value: Array.isArray(a) ? a : a ? [a] : [],
|
|
89
|
+
onValueChange: b,
|
|
90
|
+
className: "flex min-h-0 flex-1 flex-col overflow-hidden space-y-4",
|
|
91
|
+
children: A
|
|
77
92
|
}
|
|
78
|
-
) : /* @__PURE__ */
|
|
93
|
+
) : /* @__PURE__ */ t(
|
|
79
94
|
N,
|
|
80
95
|
{
|
|
81
96
|
type: "single",
|
|
82
97
|
collapsible: !0,
|
|
83
|
-
value: Array.isArray(
|
|
84
|
-
onValueChange:
|
|
85
|
-
className: "space-y-4",
|
|
86
|
-
children:
|
|
98
|
+
value: Array.isArray(a) ? a[0] ?? "" : a,
|
|
99
|
+
onValueChange: b,
|
|
100
|
+
className: "flex min-h-0 flex-1 flex-col overflow-hidden space-y-4",
|
|
101
|
+
children: A
|
|
87
102
|
}
|
|
88
103
|
) }),
|
|
89
104
|
C && /* @__PURE__ */ d("div", { className: "flex-shrink-0 flex justify-end gap-2 pt-4 border-t mt-4", children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
105
|
+
/* @__PURE__ */ t(
|
|
106
|
+
y,
|
|
92
107
|
{
|
|
93
108
|
variant: "tertiary",
|
|
94
109
|
onClick: F,
|
|
95
|
-
disabled: !
|
|
110
|
+
disabled: !o,
|
|
96
111
|
children: O
|
|
97
112
|
}
|
|
98
113
|
),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
114
|
+
/* @__PURE__ */ t(
|
|
115
|
+
y,
|
|
101
116
|
{
|
|
102
117
|
variant: "default",
|
|
103
118
|
onClick: z,
|
|
@@ -111,5 +126,5 @@ const se = ({
|
|
|
111
126
|
);
|
|
112
127
|
};
|
|
113
128
|
export {
|
|
114
|
-
|
|
129
|
+
ce as AccordionNestedList
|
|
115
130
|
};
|
|
@@ -2,17 +2,17 @@ import { jsx as r, jsxs as h, Fragment as z } from "react/jsx-runtime";
|
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
import { Person as G, Monitor as U, PriorityAlert as q, Locked as O, Reset as B } from "impact-nova-icons";
|
|
4
4
|
import { cn as p } from "../../../lib/utils.js";
|
|
5
|
-
import { Kbd as $ } from "../../primitives/kbd/kbd.js";
|
|
6
|
-
import { keybindingToString as H } from "../../primitives/kbd/keybinding-display.js";
|
|
7
5
|
import { OverflowTooltip as A } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
8
|
-
import { ModuleRegistry as
|
|
9
|
-
import { AllEnterpriseModule as
|
|
10
|
-
import { DataTable as
|
|
6
|
+
import { ModuleRegistry as $, AllCommunityModule as H } from "ag-grid-community";
|
|
7
|
+
import { AllEnterpriseModule as V } from "ag-grid-enterprise";
|
|
8
|
+
import { DataTable as J, DataTableContent as Q } from "../../data/data-table/data-table.js";
|
|
11
9
|
import { AG_CELL_NO_PADDING as F } from "../../data/ag-grid-react/cell-renderers/index.js";
|
|
10
|
+
import { Kbd as X } from "../../primitives/kbd/kbd.js";
|
|
11
|
+
import { keybindingToString as Y } from "../../primitives/kbd/keybinding-display.js";
|
|
12
12
|
import { useCommandPalette as Z } from "./use-command-palette.js";
|
|
13
13
|
import { COMMAND_SOURCE_LABELS as m, keybindingFromEvent as W, isReservedShortcut as ee } from "./utils.js";
|
|
14
14
|
import { BadgeCellRenderer as te } from "../../data/ag-grid-react/cell-renderers/badge-cell-renderer.js";
|
|
15
|
-
|
|
15
|
+
$.registerModules([H, V]);
|
|
16
16
|
function re(a) {
|
|
17
17
|
const t = a.data;
|
|
18
18
|
return t ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
|
|
@@ -69,7 +69,7 @@ function ne(a) {
|
|
|
69
69
|
"flex items-center justify-end h-full w-full text-end",
|
|
70
70
|
t.customisable ? "cursor-pointer" : "cursor-default opacity-70"
|
|
71
71
|
),
|
|
72
|
-
children: /* @__PURE__ */ r(
|
|
72
|
+
children: /* @__PURE__ */ r(X, { keybinding: t.keybinding, size: "sm" })
|
|
73
73
|
}
|
|
74
74
|
) : t.customisable ? /* @__PURE__ */ r(
|
|
75
75
|
"button",
|
|
@@ -133,7 +133,7 @@ function le({
|
|
|
133
133
|
description: e.description || "",
|
|
134
134
|
category: e.category || "General",
|
|
135
135
|
keybinding: i,
|
|
136
|
-
keybindingDisplay: i ?
|
|
136
|
+
keybindingDisplay: i ? Y(i) : "",
|
|
137
137
|
scope: e.scope,
|
|
138
138
|
source: D,
|
|
139
139
|
sourceColor: T ? "primary" : "neutral",
|
|
@@ -278,10 +278,10 @@ function le({
|
|
|
278
278
|
u?.type === "conflict" ? /* @__PURE__ */ r(q, { className: "h-3.5 w-3.5 shrink-0" }) : u?.type === "reserved" ? /* @__PURE__ */ r(O, { className: "h-3.5 w-3.5 shrink-0" }) : c ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
|
|
279
279
|
/* @__PURE__ */ r("span", { children: u ? u.text : L })
|
|
280
280
|
] }) : null;
|
|
281
|
-
return /* @__PURE__ */ h(
|
|
281
|
+
return /* @__PURE__ */ h(J, { className: p("flex flex-col w-full h-full border-t-0", a), children: [
|
|
282
282
|
s ? s(E) : E,
|
|
283
283
|
/* @__PURE__ */ r(
|
|
284
|
-
|
|
284
|
+
Q,
|
|
285
285
|
{
|
|
286
286
|
rowData: y,
|
|
287
287
|
columnDefs: I,
|
|
@@ -6,8 +6,8 @@ import { cn as o } from "../../../lib/utils.js";
|
|
|
6
6
|
import { MultiColorFilter as F, Cross as P, InfoBadge as u } from "impact-nova-icons";
|
|
7
7
|
import { Button as D } from "../../primitives/button/button.js";
|
|
8
8
|
import { Tooltip as c, TooltipTrigger as f, TooltipContent as h } from "../../feedback/tooltip/tooltip.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { OverflowTooltip as S } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
10
|
+
import { Kbd as j } from "../../primitives/kbd/kbd.js";
|
|
11
11
|
import { useImpactNovaI18n as v } from "../../../i18n/use-impact-nova-i18n.js";
|
|
12
12
|
import { useOverlayHostDismissNestedLayersOnNavigation as I } from "../../../lib/overlay/overlay-portal-context.js";
|
|
13
13
|
import { preventDismissOnTooltipOutside as x } from "../../../lib/overlay/prevent-dismiss-on-tooltip-outside.js";
|
|
@@ -145,14 +145,14 @@ const O = ({
|
|
|
145
145
|
),
|
|
146
146
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
147
147
|
/* @__PURE__ */ e(
|
|
148
|
-
|
|
148
|
+
S,
|
|
149
149
|
{
|
|
150
150
|
triggerClassName: "truncate font-['Manrope'] block min-w-0",
|
|
151
151
|
content: t.tooltipKeybinding ? /* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
|
|
152
152
|
t.label,
|
|
153
153
|
" ",
|
|
154
154
|
/* @__PURE__ */ e(
|
|
155
|
-
|
|
155
|
+
j,
|
|
156
156
|
{
|
|
157
157
|
keybinding: t.tooltipKeybinding,
|
|
158
158
|
size: "sm"
|
|
@@ -1,189 +1,216 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as P, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { usePickerDismissActionsRef as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import { useImpactNovaI18n as
|
|
11
|
-
import { coerceSingleMonthApply as
|
|
12
|
-
import { buildDateBoundsMatcher as
|
|
13
|
-
const
|
|
3
|
+
import { Cross as ne, CalendarMonth as re } from "impact-nova-icons";
|
|
4
|
+
import { cn as oe } from "../../../lib/utils.js";
|
|
5
|
+
import { usePickerDismissActionsRef as se, usePickerFooterDismissNudge as ie, isDateInputInvalid as ae, resolveSingleValueDismissFlash as ce, compareMonthSelection as le, handlePickerSurfacePointerDown as pe, maskDateInput as fe, parseDateInput as ue, resolveDateInputOnEnter as de, resolveDateInputOnBlur as me } from "./date-input-behavior.js";
|
|
6
|
+
import { Input as he } from "../input/input.js";
|
|
7
|
+
import { Popover as ye, PopoverAnchor as ge, PopoverContent as Me } from "../../feedback/popover/popover.js";
|
|
8
|
+
import { Calendar as De } from "../../data-display/calendar/calendar.js";
|
|
9
|
+
import { Tooltip as T, TooltipTrigger as O, TooltipContent as V } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
+
import { useImpactNovaI18n as ke } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
|
+
import { coerceSingleMonthApply as Pe, coerceSingleMonth as Ie } from "./calendar-selection-adapters.js";
|
|
12
|
+
import { buildDateBoundsMatcher as Ce } from "../../../lib/date-bounds-matcher.js";
|
|
13
|
+
const h = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Se = o.forwardRef(
|
|
14
14
|
({
|
|
15
15
|
value: t,
|
|
16
16
|
onChange: p,
|
|
17
|
-
placeholder:
|
|
18
|
-
minDate:
|
|
19
|
-
maxDate:
|
|
20
|
-
startMonth:
|
|
21
|
-
endMonth:
|
|
22
|
-
showFooter:
|
|
23
|
-
disabled:
|
|
17
|
+
placeholder: B,
|
|
18
|
+
minDate: F,
|
|
19
|
+
maxDate: j,
|
|
20
|
+
startMonth: v,
|
|
21
|
+
endMonth: K,
|
|
22
|
+
showFooter: c = !0,
|
|
23
|
+
disabled: i,
|
|
24
24
|
className: Y,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
onBlur: z,
|
|
26
|
+
...H
|
|
27
|
+
}, $) => {
|
|
28
|
+
const { t: u } = ke(), L = B ?? u("datePicker.selectMonth"), I = o.useRef(null), x = o.useRef(null);
|
|
29
|
+
o.useImperativeHandle($, () => I.current);
|
|
30
|
+
const [r, R] = o.useState(!1), f = o.useCallback(() => {
|
|
31
|
+
R(!1);
|
|
32
|
+
}, []), d = (e) => {
|
|
33
|
+
if (!i) {
|
|
34
|
+
if (e) {
|
|
35
|
+
R(!0);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
f();
|
|
39
|
+
}
|
|
40
|
+
}, b = se(), { footerFlashKey: q, footerFlashTarget: G, popoverHandlers: J } = ie(c, r, b, x), [M, a] = o.useState(t), [m, l] = o.useState(t ? h(t) : ""), [Q, C] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
|
|
30
41
|
o.useEffect(() => {
|
|
31
|
-
r || (l(t ?
|
|
42
|
+
r || (l(t ? h(t) : ""), a(t));
|
|
32
43
|
}, [r, t]), o.useEffect(() => {
|
|
33
|
-
r && (
|
|
44
|
+
r && (a(t), C(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), l(t ? h(t) : ""));
|
|
34
45
|
}, [r, t]);
|
|
35
|
-
const
|
|
36
|
-
const n =
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
const n =
|
|
40
|
-
p?.(n),
|
|
46
|
+
const U = (e) => {
|
|
47
|
+
const n = Ie(e);
|
|
48
|
+
a(n), n && l(h(n)), c || (p?.(n), f());
|
|
49
|
+
}, w = (e) => {
|
|
50
|
+
const n = Pe(e, M);
|
|
51
|
+
p?.(n), f();
|
|
41
52
|
}, S = () => {
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
const n =
|
|
53
|
+
a(t), l(t ? h(t) : ""), f();
|
|
54
|
+
}, N = () => {
|
|
55
|
+
a(void 0), l(""), p?.(void 0), c || f();
|
|
56
|
+
}, y = "MM/yyyy", D = t ? h(t) : "", g = o.useRef(!1), W = (e) => {
|
|
57
|
+
const n = fe(e.target.value, y, m);
|
|
47
58
|
if (l(n), n === "") {
|
|
48
|
-
|
|
59
|
+
a(void 0), c || p?.(void 0);
|
|
49
60
|
return;
|
|
50
61
|
}
|
|
51
|
-
const { parsed:
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
62
|
+
const { parsed: k, isValid: te } = ue(n, y);
|
|
63
|
+
if (te && k) {
|
|
64
|
+
const E = { month: k.getMonth(), year: k.getFullYear() };
|
|
65
|
+
a(E), C(k), c || p?.(E);
|
|
55
66
|
}
|
|
56
|
-
},
|
|
67
|
+
}, X = () => {
|
|
57
68
|
if (r) return;
|
|
58
|
-
const e =
|
|
69
|
+
const e = me(m, y, D);
|
|
59
70
|
if (e.resetToCommitted) {
|
|
60
|
-
l(
|
|
71
|
+
l(D), a(t);
|
|
61
72
|
return;
|
|
62
73
|
}
|
|
63
74
|
if (e.parsed) {
|
|
64
75
|
const n = { month: e.parsed.getMonth(), year: e.parsed.getFullYear() };
|
|
65
|
-
l(e.display),
|
|
76
|
+
l(e.display), a(n), c || p?.(n);
|
|
66
77
|
return;
|
|
67
78
|
}
|
|
68
|
-
l(
|
|
69
|
-
},
|
|
70
|
-
if (r &&
|
|
71
|
-
|
|
79
|
+
l(D), a(t);
|
|
80
|
+
}, Z = () => {
|
|
81
|
+
if (r && c) {
|
|
82
|
+
w();
|
|
72
83
|
return;
|
|
73
84
|
}
|
|
74
|
-
const e =
|
|
85
|
+
const e = de(m, y);
|
|
75
86
|
if (e.parsed) {
|
|
76
87
|
const n = {
|
|
77
88
|
month: e.parsed.getMonth(),
|
|
78
89
|
year: e.parsed.getFullYear()
|
|
79
90
|
};
|
|
80
|
-
|
|
91
|
+
c && (p?.(n), f());
|
|
81
92
|
return;
|
|
82
93
|
}
|
|
83
|
-
r || (
|
|
84
|
-
},
|
|
85
|
-
() =>
|
|
86
|
-
|
|
94
|
+
r || (g.current = !0, d(!0));
|
|
95
|
+
}, A = D !== m, _ = ae(m, y), ee = o.useCallback(
|
|
96
|
+
() => ce(
|
|
97
|
+
M,
|
|
87
98
|
t,
|
|
88
|
-
(e, n) =>
|
|
99
|
+
(e, n) => le(e, n) === 0
|
|
89
100
|
),
|
|
90
|
-
[
|
|
101
|
+
[M, t]
|
|
91
102
|
);
|
|
92
103
|
return o.useLayoutEffect(() => {
|
|
93
|
-
|
|
104
|
+
b.current = {
|
|
94
105
|
onDismiss: S,
|
|
95
|
-
resolveFlash:
|
|
106
|
+
resolveFlash: ee
|
|
96
107
|
};
|
|
97
|
-
}), /* @__PURE__ */
|
|
98
|
-
|
|
99
|
-
}, children: [
|
|
100
|
-
/* @__PURE__ */ s(me, { asChild: !0, children: /* @__PURE__ */ s(
|
|
108
|
+
}), /* @__PURE__ */ P(ye, { open: i ? !1 : r, onOpenChange: d, children: [
|
|
109
|
+
/* @__PURE__ */ s(ge, { asChild: !0, children: /* @__PURE__ */ s(
|
|
101
110
|
"div",
|
|
102
111
|
{
|
|
103
|
-
ref:
|
|
112
|
+
ref: x,
|
|
104
113
|
"data-component": "month-picker",
|
|
105
114
|
"data-state": r ? "open" : "closed",
|
|
106
|
-
"data-pending":
|
|
107
|
-
onPointerDown: (e) =>
|
|
108
|
-
disabled:
|
|
115
|
+
"data-pending": A || void 0,
|
|
116
|
+
onPointerDown: (e) => pe({
|
|
117
|
+
disabled: i,
|
|
109
118
|
event: e,
|
|
110
|
-
onOpen: () =>
|
|
119
|
+
onOpen: () => d(!0),
|
|
111
120
|
focusField: () => I.current?.focus()
|
|
112
121
|
}),
|
|
113
122
|
children: /* @__PURE__ */ s(
|
|
114
|
-
|
|
123
|
+
he,
|
|
115
124
|
{
|
|
116
125
|
ref: I,
|
|
117
|
-
value:
|
|
118
|
-
onChange:
|
|
119
|
-
onBlur:
|
|
120
|
-
|
|
126
|
+
value: m,
|
|
127
|
+
onChange: W,
|
|
128
|
+
onBlur: (e) => {
|
|
129
|
+
X(), z?.(e);
|
|
130
|
+
},
|
|
131
|
+
onClick: () => !i && d(!0),
|
|
121
132
|
onKeyDown: (e) => {
|
|
122
|
-
e.key === "Enter" && !
|
|
133
|
+
e.key === "Enter" && !i && (e.preventDefault(), Z()), e.key === "ArrowDown" && !r && !i && (e.preventDefault(), g.current = !0, d(!0)), e.key === "Escape" && r && (e.preventDefault(), S());
|
|
123
134
|
},
|
|
124
|
-
placeholder: r ?
|
|
125
|
-
disabled:
|
|
135
|
+
placeholder: r ? u("datePicker.monthYearFormat") : L,
|
|
136
|
+
disabled: i,
|
|
126
137
|
"data-form-control": "input",
|
|
127
|
-
className:
|
|
138
|
+
className: oe(
|
|
128
139
|
"cursor-pointer",
|
|
129
|
-
|
|
140
|
+
_ ? "text-destructive" : A ? "text-content-placeholder" : "",
|
|
130
141
|
Y
|
|
131
142
|
),
|
|
132
|
-
suffix: /* @__PURE__ */
|
|
133
|
-
t && !
|
|
134
|
-
/* @__PURE__ */ s(
|
|
143
|
+
suffix: /* @__PURE__ */ P("div", { className: "flex items-center gap-1", children: [
|
|
144
|
+
t && !i && /* @__PURE__ */ P(T, { children: [
|
|
145
|
+
/* @__PURE__ */ s(O, { asChild: !0, children: /* @__PURE__ */ s(
|
|
135
146
|
"button",
|
|
136
147
|
{
|
|
137
148
|
type: "button",
|
|
138
149
|
tabIndex: 0,
|
|
139
|
-
"aria-label":
|
|
150
|
+
"aria-label": u("calendar.clear"),
|
|
140
151
|
onClick: (e) => {
|
|
141
|
-
e.stopPropagation(),
|
|
152
|
+
e.stopPropagation(), N();
|
|
142
153
|
},
|
|
143
154
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
144
|
-
children: /* @__PURE__ */ s(
|
|
155
|
+
children: /* @__PURE__ */ s(ne, { className: "size-3 hover:text-content" })
|
|
145
156
|
}
|
|
146
157
|
) }),
|
|
147
|
-
/* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children:
|
|
158
|
+
/* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: u("calendar.clear") })
|
|
148
159
|
] }),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */ s(
|
|
151
|
-
|
|
160
|
+
/* @__PURE__ */ P(T, { children: [
|
|
161
|
+
/* @__PURE__ */ s(O, { asChild: !0, children: /* @__PURE__ */ s(
|
|
162
|
+
"button",
|
|
163
|
+
{
|
|
164
|
+
type: "button",
|
|
165
|
+
tabIndex: 0,
|
|
166
|
+
"data-component": "calendar-trigger",
|
|
167
|
+
"aria-label": u("datePicker.selectMonth"),
|
|
168
|
+
onClick: (e) => {
|
|
169
|
+
e.stopPropagation(), i || (r ? f() : d(!0));
|
|
170
|
+
},
|
|
171
|
+
onKeyDown: (e) => {
|
|
172
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), i || (g.current = !0, r ? f() : d(!0)));
|
|
173
|
+
},
|
|
174
|
+
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
175
|
+
children: /* @__PURE__ */ s(re, { className: "h-4 w-4 text-secondary-foreground" })
|
|
176
|
+
}
|
|
177
|
+
) }),
|
|
178
|
+
/* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: u("datePicker.selectMonth") })
|
|
152
179
|
] })
|
|
153
180
|
] }),
|
|
154
|
-
...
|
|
181
|
+
...H
|
|
155
182
|
}
|
|
156
183
|
)
|
|
157
184
|
}
|
|
158
185
|
) }),
|
|
159
186
|
/* @__PURE__ */ s(
|
|
160
|
-
|
|
187
|
+
Me,
|
|
161
188
|
{
|
|
162
189
|
className: "w-auto p-0",
|
|
163
190
|
align: "start",
|
|
164
|
-
"aria-label":
|
|
191
|
+
"aria-label": u("datePicker.selectMonth"),
|
|
165
192
|
onOpenAutoFocus: (e) => {
|
|
166
|
-
|
|
193
|
+
g.current || e.preventDefault(), g.current = !1;
|
|
167
194
|
},
|
|
168
|
-
...
|
|
195
|
+
...J,
|
|
169
196
|
children: /* @__PURE__ */ s(
|
|
170
|
-
|
|
197
|
+
De,
|
|
171
198
|
{
|
|
172
199
|
pickerType: "month",
|
|
173
200
|
monthMode: "single",
|
|
174
|
-
selectedMonths:
|
|
175
|
-
footerFlashKey:
|
|
176
|
-
footerFlashTarget:
|
|
177
|
-
onMonthSelect:
|
|
178
|
-
month:
|
|
179
|
-
onMonthChange:
|
|
180
|
-
disabled:
|
|
181
|
-
startMonth:
|
|
182
|
-
endMonth:
|
|
183
|
-
showFooter:
|
|
184
|
-
onApply:
|
|
201
|
+
selectedMonths: M,
|
|
202
|
+
footerFlashKey: q,
|
|
203
|
+
footerFlashTarget: G,
|
|
204
|
+
onMonthSelect: U,
|
|
205
|
+
month: Q,
|
|
206
|
+
onMonthChange: C,
|
|
207
|
+
disabled: Ce(F, j),
|
|
208
|
+
startMonth: v,
|
|
209
|
+
endMonth: K,
|
|
210
|
+
showFooter: c,
|
|
211
|
+
onApply: w,
|
|
185
212
|
onCancel: S,
|
|
186
|
-
onClear:
|
|
213
|
+
onClear: N
|
|
187
214
|
}
|
|
188
215
|
)
|
|
189
216
|
}
|
|
@@ -191,7 +218,7 @@ const m = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Ie =
|
|
|
191
218
|
] });
|
|
192
219
|
}
|
|
193
220
|
);
|
|
194
|
-
|
|
221
|
+
Se.displayName = "MonthPicker";
|
|
195
222
|
export {
|
|
196
|
-
|
|
223
|
+
Se as MonthPicker
|
|
197
224
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { cn as x } from "../../../../lib/utils.js";
|
|
3
|
-
import "react";
|
|
4
3
|
import { OverflowTooltip as m } from "../../../feedback/tooltip/overflow-tooltip.js";
|
|
5
4
|
import { isInvertedSelection as h, isOptionArray as d } from "../utils/select.js";
|
|
6
|
-
function
|
|
5
|
+
function w({
|
|
7
6
|
isMulti: u,
|
|
8
7
|
isDisabled: p,
|
|
9
8
|
internalValue: o,
|
|
@@ -53,5 +52,5 @@ function C({
|
|
|
53
52
|
);
|
|
54
53
|
}
|
|
55
54
|
export {
|
|
56
|
-
|
|
55
|
+
w as SelectTriggerValue
|
|
57
56
|
};
|