impact-nova 1.0.0 → 1.1.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/ui/ag-grid-react/cell-renderers/date-display-renderer.js +32 -21
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.d.ts +3 -5
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +57 -55
- package/dist/components/ui/calendar.d.ts +4 -4
- package/dist/components/ui/calendar.js +205 -219
- package/dist/components/ui/date-picker/date-picker.js +89 -86
- package/dist/components/ui/date-picker/date-range-picker.js +132 -127
- package/dist/components/ui/date-picker/month-picker.js +92 -86
- package/dist/components/ui/date-picker/month-range-picker.js +134 -127
- package/dist/components/ui/date-picker/multi-date-picker.js +32 -33
- package/dist/components/ui/date-picker/multi-month-picker.js +25 -26
- package/dist/components/ui/date-picker/multi-week-picker.js +37 -38
- package/dist/components/ui/date-picker/week-picker.js +119 -113
- package/dist/components/ui/date-picker/week-range-picker.js +163 -151
- package/dist/components/ui/dynamic-layout.d.ts +1 -1
- package/dist/components/ui/types/date-picker.types.d.ts +18 -18
- package/dist/lib/utils.d.ts +2 -1
- package/dist/lib/utils.js +29 -13
- package/package.json +1 -1
|
@@ -1,50 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
if (
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import "lucide-react";
|
|
3
|
+
const u = (t, r) => {
|
|
4
|
+
if (t == null || t === "") return "";
|
|
5
5
|
try {
|
|
6
|
-
const
|
|
7
|
-
return isNaN(
|
|
6
|
+
const i = t instanceof Date ? t : new Date(String(t));
|
|
7
|
+
return isNaN(i.getTime()) ? String(t) : r === "time" ? i.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) : r === "datetime-local" ? i.toLocaleString(void 0, {
|
|
8
8
|
year: "numeric",
|
|
9
9
|
month: "short",
|
|
10
10
|
day: "numeric",
|
|
11
11
|
hour: "2-digit",
|
|
12
12
|
minute: "2-digit"
|
|
13
|
-
}) :
|
|
13
|
+
}) : i.toLocaleDateString(void 0, {
|
|
14
14
|
year: "numeric",
|
|
15
15
|
month: "short",
|
|
16
16
|
day: "numeric"
|
|
17
17
|
});
|
|
18
18
|
} catch {
|
|
19
|
-
return String(
|
|
19
|
+
return String(t);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, m = (t) => {
|
|
22
22
|
const {
|
|
23
|
-
valueFormatted:
|
|
24
|
-
value:
|
|
25
|
-
dateType:
|
|
26
|
-
placeholder:
|
|
23
|
+
valueFormatted: r,
|
|
24
|
+
value: i,
|
|
25
|
+
dateType: s = "date",
|
|
26
|
+
placeholder: h = "Select date...",
|
|
27
27
|
disabled: n,
|
|
28
|
-
colDef:
|
|
29
|
-
} =
|
|
30
|
-
return /* @__PURE__ */
|
|
28
|
+
colDef: l
|
|
29
|
+
} = t, c = !n && l?.editable === !0, a = r ?? u(i, s), d = !a;
|
|
30
|
+
return /* @__PURE__ */ e(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
className: `w-full h-full flex items-center ag-cell-inner-padding ${n ? "opacity-60 cursor-not-allowed" : c ? "in-ag-editable-cell-highlight" : ""}`,
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ o(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
className: "flex w-full items-center justify-between rounded-[8px] bg-white px-1.5 h-7 cursor-pointer",
|
|
38
38
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ e("span", { className: `truncate text-sm font-medium text-[#1f2b4d] ${d ? "text-[#dfe2e7]" : ""}`, children: d ? h : a }),
|
|
40
|
+
/* @__PURE__ */ e("span", { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground", children: /* @__PURE__ */ o("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
41
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
42
|
+
/* @__PURE__ */ e("path", { d: "M16 2v4" }),
|
|
43
|
+
/* @__PURE__ */ e("path", { d: "M8 2v4" }),
|
|
44
|
+
/* @__PURE__ */ e("path", { d: "M3 10h18" }),
|
|
45
|
+
/* @__PURE__ */ e("path", { d: "M8 14h.01" }),
|
|
46
|
+
/* @__PURE__ */ e("path", { d: "M12 14h.01" }),
|
|
47
|
+
/* @__PURE__ */ e("path", { d: "M16 14h.01" }),
|
|
48
|
+
/* @__PURE__ */ e("path", { d: "M8 18h.01" }),
|
|
49
|
+
/* @__PURE__ */ e("path", { d: "M12 18h.01" }),
|
|
50
|
+
/* @__PURE__ */ e("path", { d: "M16 18h.01" })
|
|
51
|
+
] }) })
|
|
41
52
|
]
|
|
42
53
|
}
|
|
43
54
|
)
|
|
44
55
|
}
|
|
45
56
|
);
|
|
46
57
|
};
|
|
47
|
-
|
|
58
|
+
m.displayName = "DateDisplayRenderer";
|
|
48
59
|
export {
|
|
49
|
-
|
|
60
|
+
m as DateDisplayRenderer
|
|
50
61
|
};
|
|
@@ -8,15 +8,13 @@ export interface DateCellEditorProps extends ICellEditorParams {
|
|
|
8
8
|
max?: string;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* DateCellEditor - AG Grid popup cell editor
|
|
11
|
+
* DateCellEditor - AG Grid popup cell editor using the project's Calendar component.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Opens the Calendar directly on mount so the user sees the calendar popup
|
|
14
|
+
* immediately on click — no extra interaction needed.
|
|
15
15
|
*
|
|
16
16
|
* Returns an ISO string on commit, which AG Grid stores as the cell value.
|
|
17
17
|
*
|
|
18
|
-
* Only holds a single piece of state: the current date string.
|
|
19
|
-
*
|
|
20
18
|
* Usage in colDef:
|
|
21
19
|
* ```ts
|
|
22
20
|
* {
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as M, useState as b, useImperativeHandle as y, useEffect as N, useCallback as c } from "react";
|
|
3
|
+
import { Calendar as P } from "../../../calendar.js";
|
|
4
|
+
const d = (t) => {
|
|
5
|
+
if (!(t == null || t === ""))
|
|
6
|
+
try {
|
|
7
|
+
const n = t instanceof Date ? t : new Date(String(t));
|
|
8
|
+
return isNaN(n.getTime()) ? void 0 : n;
|
|
9
|
+
} catch {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
}, I = M((t, n) => {
|
|
12
13
|
const {
|
|
13
|
-
value:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
value: l,
|
|
15
|
+
min: u,
|
|
16
|
+
max: p,
|
|
17
|
+
node: i,
|
|
18
|
+
column: m,
|
|
19
|
+
stopEditing: f
|
|
20
|
+
} = t, g = d(l), [C, h] = b(g), [v, D] = b(g || /* @__PURE__ */ new Date());
|
|
21
|
+
y(n, () => ({
|
|
20
22
|
getValue() {
|
|
21
|
-
|
|
22
|
-
if (a === "time") return o;
|
|
23
|
-
try {
|
|
24
|
-
return new Date(o).toISOString();
|
|
25
|
-
} catch {
|
|
26
|
-
return o;
|
|
27
|
-
}
|
|
23
|
+
return l;
|
|
28
24
|
},
|
|
29
25
|
isCancelBeforeStart() {
|
|
30
26
|
return !1;
|
|
@@ -34,40 +30,46 @@ const w = (e, n) => {
|
|
|
34
30
|
},
|
|
35
31
|
isPopup() {
|
|
36
32
|
return !0;
|
|
37
|
-
},
|
|
38
|
-
afterGuiAttached() {
|
|
39
|
-
if (i.current) {
|
|
40
|
-
i.current.focus();
|
|
41
|
-
try {
|
|
42
|
-
i.current.showPicker?.();
|
|
43
|
-
} catch {
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
33
|
}
|
|
47
|
-
}))
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
34
|
+
})), N(() => {
|
|
35
|
+
const e = "ag-custom-component-popup", a = (o) => {
|
|
36
|
+
o instanceof HTMLElement && o.hasAttribute("data-radix-popper-content-wrapper") && o.classList.add(e);
|
|
37
|
+
}, s = new MutationObserver((o) => {
|
|
38
|
+
for (const L of o)
|
|
39
|
+
L.addedNodes.forEach(a);
|
|
40
|
+
});
|
|
41
|
+
return s.observe(document.body, { childList: !0, subtree: !0 }), document.querySelectorAll("[data-radix-popper-content-wrapper]").forEach((o) => {
|
|
42
|
+
o.classList.add(e);
|
|
43
|
+
}), () => s.disconnect();
|
|
44
|
+
}, []);
|
|
45
|
+
const r = c((e) => {
|
|
46
|
+
const a = m?.getColId();
|
|
47
|
+
if (a && i) {
|
|
48
|
+
const s = e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : null;
|
|
49
|
+
i.setDataValue(a, s);
|
|
50
|
+
}
|
|
51
|
+
f();
|
|
52
|
+
}, [m, i, f]), w = c((e) => {
|
|
53
|
+
h(e), r(e);
|
|
54
|
+
}, [r]), E = c(() => {
|
|
55
|
+
h(void 0), r(void 0);
|
|
56
|
+
}, [r]), A = u ? d(u) : void 0, x = p ? d(p) : void 0;
|
|
57
|
+
return /* @__PURE__ */ S("div", { className: "ag-custom-component-popup bg-white border border-input rounded-md shadow-lg", children: /* @__PURE__ */ S(
|
|
58
|
+
P,
|
|
57
59
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
mode: "single",
|
|
61
|
+
selected: C,
|
|
62
|
+
onSelect: w,
|
|
63
|
+
month: v,
|
|
64
|
+
onMonthChange: D,
|
|
65
|
+
disabled: { before: A, after: x },
|
|
66
|
+
showFooter: !1,
|
|
67
|
+
onClear: E,
|
|
68
|
+
captionLayout: "dropdown"
|
|
67
69
|
}
|
|
68
70
|
) });
|
|
69
71
|
});
|
|
70
|
-
|
|
72
|
+
I.displayName = "DateCellEditor";
|
|
71
73
|
export {
|
|
72
|
-
|
|
74
|
+
I as DateCellEditor
|
|
73
75
|
};
|
|
@@ -27,8 +27,8 @@ export interface CalendarProps extends Omit<React.ComponentProps<typeof DayPicke
|
|
|
27
27
|
onApply?: (date: Date | Date[] | DateRange | undefined) => void;
|
|
28
28
|
onCancel?: () => void;
|
|
29
29
|
onClear?: () => void;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
startMonth?: Date;
|
|
31
|
+
endMonth?: Date;
|
|
32
32
|
mode?: "single" | "multiple" | "range";
|
|
33
33
|
selected?: Date | Date[] | DateRange;
|
|
34
34
|
onSelect?: (date: Date | Date[] | DateRange | undefined) => void;
|
|
@@ -51,8 +51,8 @@ export interface CalendarProps extends Omit<React.ComponentProps<typeof DayPicke
|
|
|
51
51
|
selectedMonths?: MonthSelection | MonthSelection[] | MonthRange;
|
|
52
52
|
onMonthSelect?: (months: MonthSelection | MonthSelection[] | MonthRange | undefined) => void;
|
|
53
53
|
}
|
|
54
|
-
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, showFooter, onApply, onCancel, onClear,
|
|
55
|
-
monthMode, selectedMonths, onMonthSelect, month, defaultMonth, onMonthChange, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, showFooter, onApply, onCancel, onClear, mode, selected, onSelect, pickerType, weekMode, selectedWeeks, onWeekSelect, calendarType, fiscalMode, selectionMode, fiscalMonthPattern, fiscalYearStartMonth, weekStartsOn, // Default Monday
|
|
55
|
+
monthMode, selectedMonths, onMonthSelect, month, defaultMonth, onMonthChange, startMonth, endMonth, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
56
56
|
declare function CalendarDayButton({ className, day, modifiers, pickerType, ...props }: React.ComponentProps<typeof DayButton> & {
|
|
57
57
|
pickerType?: "date" | "week" | "month";
|
|
58
58
|
}): import("react/jsx-runtime").JSX.Element;
|