lecom-ui 5.3.88 → 5.3.90
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.
|
@@ -19,19 +19,30 @@ function DatePicker({
|
|
|
19
19
|
calendarVariant,
|
|
20
20
|
calendarColor,
|
|
21
21
|
format: format$1 = "PPP",
|
|
22
|
-
status
|
|
22
|
+
status,
|
|
23
|
+
closeOnSelect = true
|
|
23
24
|
}) {
|
|
24
25
|
const [internalDate, setInternalDate] = React.useState();
|
|
26
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
25
27
|
const isControlled = value !== void 0 && onChange !== void 0;
|
|
26
28
|
const date = isControlled ? value : internalDate;
|
|
27
29
|
const handleSelect = (selected) => {
|
|
30
|
+
console.log("\u{1F7E2} DatePicker handleSelect chamado:", selected);
|
|
31
|
+
console.log("\u{1F7E2} isControlled:", isControlled);
|
|
32
|
+
console.log("\u{1F7E2} onChange existe:", !!onChange);
|
|
28
33
|
if (isControlled && onChange) {
|
|
34
|
+
console.log("\u{1F7E2} Chamando onChange com:", selected);
|
|
29
35
|
onChange(selected);
|
|
30
36
|
} else {
|
|
37
|
+
console.log("\u{1F7E2} Setando internalDate:", selected);
|
|
31
38
|
setInternalDate(selected);
|
|
32
39
|
}
|
|
40
|
+
if (closeOnSelect && selected) {
|
|
41
|
+
setIsOpen(false);
|
|
42
|
+
}
|
|
33
43
|
};
|
|
34
|
-
|
|
44
|
+
const resolvedCalendarVariant = calendarVariant === "datepicker" ? variant : calendarVariant ?? variant;
|
|
45
|
+
return /* @__PURE__ */ React.createElement(Popover, { open: isOpen, onOpenChange: setIsOpen }, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
35
46
|
Button,
|
|
36
47
|
{
|
|
37
48
|
variant: buttonVariant || variant,
|
|
@@ -53,7 +64,7 @@ function DatePicker({
|
|
|
53
64
|
onSelect: handleSelect,
|
|
54
65
|
autoFocus: true,
|
|
55
66
|
locale,
|
|
56
|
-
variant:
|
|
67
|
+
variant: resolvedCalendarVariant,
|
|
57
68
|
color: calendarColor ?? color ?? void 0
|
|
58
69
|
}
|
|
59
70
|
)));
|
package/dist/index.d.ts
CHANGED
|
@@ -962,7 +962,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
|
|
|
962
962
|
declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
963
963
|
|
|
964
964
|
declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
|
|
965
|
-
declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement |
|
|
965
|
+
declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLHeadingElement | HTMLParagraphElement | HTMLLabelElement | HTMLSpanElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLInputElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
|
|
966
966
|
className?: string;
|
|
967
967
|
collapsedSize?: number | undefined;
|
|
968
968
|
collapsible?: boolean | undefined;
|
|
@@ -1256,8 +1256,9 @@ interface DatePickerProps {
|
|
|
1256
1256
|
onChange?: (date: Date | undefined) => void;
|
|
1257
1257
|
format?: string;
|
|
1258
1258
|
status?: string;
|
|
1259
|
+
closeOnSelect?: boolean;
|
|
1259
1260
|
}
|
|
1260
|
-
declare function DatePicker({ className, locale, placeholder, value, onChange, variant, color, buttonVariant, buttonColor, calendarVariant, calendarColor, format, status, }: DatePickerProps): React$1.JSX.Element;
|
|
1261
|
+
declare function DatePicker({ className, locale, placeholder, value, onChange, variant, color, buttonVariant, buttonColor, calendarVariant, calendarColor, format, status, closeOnSelect, }: DatePickerProps): React$1.JSX.Element;
|
|
1261
1262
|
declare namespace DatePicker {
|
|
1262
1263
|
var displayName: string;
|
|
1263
1264
|
}
|