@povio/ui 0.0.9 → 0.1.0
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/buttons/Button/Button.d.ts +3 -2
- package/dist/components/buttons/Button/Button.js +6 -1
- package/dist/components/buttons/IconButton/IconButton.d.ts +3 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +3 -2
- package/dist/components/buttons/SplitButton/SplitButton.d.ts +3 -2
- package/dist/components/buttons/TextButton/TextButton.d.ts +3 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +53 -45
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +86 -77
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +63 -55
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +46 -38
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +1 -0
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +1 -0
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +30 -21
- package/dist/components/inputs/Input/TextArea/TextArea.js +41 -32
- package/dist/components/inputs/Input/TextInput/TextInput.js +32 -40
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/SelectBase.js +3 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +72 -60
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +3 -0
- package/dist/components/inputs/Selection/shared/SelectInputTags.d.ts +2 -1
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +43 -16
- package/dist/components/inputs/Selection/shared/SelectListBox.js +74 -55
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +6 -2
- package/dist/components/inputs/shared/TooltipWrapper.d.ts +8 -0
- package/dist/components/inputs/shared/TooltipWrapper.js +21 -0
- package/dist/components/inputs/shared/label.cva.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +2 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +12 -2
- package/dist/components/table/HeaderText.js +1 -1
- package/dist/components/table/table.cva.js +6 -6
- package/dist/components/text/Link/Link.d.ts +3 -1
- package/dist/components/text/Link/Link.js +7 -1
- package/dist/config/link.context.d.ts +10 -0
- package/dist/config/link.context.js +19 -0
- package/dist/config/uiConfig.context.d.ts +1 -1
- package/dist/config/uiConfig.context.js +2 -1
- package/dist/hooks/useTableNav.js +0 -15
- package/dist/index.d.ts +2 -4
- package/dist/index.js +3 -3
- package/dist/utils/vendor/acl/AclGuard.d.ts +5 -5
- package/dist/utils/vendor/acl/AclGuard.js +2 -3
- package/dist/utils/vendor/auth/auth.context.d.ts +2 -1
- package/dist/utils/vendor/auth/auth.context.js +2 -0
- package/package.json +1 -1
- package/dist/utils/vendor/auth/withPrivateAuthGuard.d.ts +0 -6
- package/dist/utils/vendor/auth/withPrivateAuthGuard.js +0 -17
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC, ReactElement, SVGProps } from 'react';
|
|
2
|
-
import { ButtonProps as AriaButtonProps,
|
|
2
|
+
import { ButtonProps as AriaButtonProps, ToggleButtonProps as AriaToggleButtonProps } from 'react-aria-components';
|
|
3
3
|
import { ButtonContentVariantProps } from '../shared/buttonContent.cva';
|
|
4
|
+
import { LinkNavigationProps } from '../../text/Link/Link';
|
|
4
5
|
import { ButtonVariantProps } from './button.cva';
|
|
5
6
|
export type ButtonIconProps<IconOnly extends boolean = false> = {
|
|
6
7
|
iconOnly?: IconOnly;
|
|
@@ -18,7 +19,7 @@ type ToggleButtonProps = {
|
|
|
18
19
|
export type ButtonProps<IconOnly extends boolean = false> = ButtonVariantProps & ButtonContentVariantProps & AriaButtonProps & ButtonIconProps<IconOnly> & ToggleButtonProps & {
|
|
19
20
|
children: string;
|
|
20
21
|
isLoading?: boolean;
|
|
21
|
-
link?:
|
|
22
|
+
link?: LinkNavigationProps;
|
|
22
23
|
noDisableWhenLoading?: boolean;
|
|
23
24
|
iconClassName?: string;
|
|
24
25
|
disableTooltip?: boolean;
|
|
@@ -3,6 +3,7 @@ import { clsx } from "clsx";
|
|
|
3
3
|
import { Link, ToggleButton, Button as Button$1 } from "react-aria-components";
|
|
4
4
|
import { ButtonContent } from "../shared/ButtonContent.js";
|
|
5
5
|
import { TooltipEllipsis } from "../../overlays/Tooltip/TooltipEllipsis.js";
|
|
6
|
+
import { LinkContext } from "../../../config/link.context.js";
|
|
6
7
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
7
8
|
import { button, buttonSize, buttonContent, buttonIconSize, buttonTypography } from "./button.cva.js";
|
|
8
9
|
const Button = ({
|
|
@@ -17,6 +18,7 @@ const Button = ({
|
|
|
17
18
|
disableTooltip,
|
|
18
19
|
...props
|
|
19
20
|
}) => {
|
|
21
|
+
const linkContext = LinkContext.useLinkContext();
|
|
20
22
|
const uiStyle = UIStyle.useConfig();
|
|
21
23
|
const buttonCva = uiStyle?.button?.cva ?? button;
|
|
22
24
|
const buttonSizeCva = uiStyle?.button?.sizeCva ?? buttonSize;
|
|
@@ -25,13 +27,16 @@ const Button = ({
|
|
|
25
27
|
const typographyMap = uiStyle?.button?.typography ?? buttonTypography;
|
|
26
28
|
const Component = (() => {
|
|
27
29
|
if (link) {
|
|
28
|
-
return Link;
|
|
30
|
+
return linkContext?.LinkComponent ?? Link;
|
|
29
31
|
}
|
|
30
32
|
if (props.toggle != null) {
|
|
31
33
|
return ToggleButton;
|
|
32
34
|
}
|
|
33
35
|
return Button$1;
|
|
34
36
|
})();
|
|
37
|
+
if (link && !link.to && link.href) {
|
|
38
|
+
link.to = link.href;
|
|
39
|
+
}
|
|
35
40
|
return /* @__PURE__ */ jsx(
|
|
36
41
|
TooltipEllipsis,
|
|
37
42
|
{
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FC, ReactElement, SVGProps } from 'react';
|
|
2
|
-
import { ButtonProps as AriaButtonProps
|
|
2
|
+
import { ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
3
|
import { ButtonVariantProps } from '../Button/button.cva';
|
|
4
|
+
import { LinkNavigationProps } from '../../text/Link/Link';
|
|
4
5
|
export interface IconButtonProps extends ButtonVariantProps, Omit<AriaButtonProps, "children"> {
|
|
5
6
|
label: string;
|
|
6
7
|
icon: FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
7
|
-
link?:
|
|
8
|
+
link?: LinkNavigationProps;
|
|
8
9
|
disableTooltip?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const IconButton: ({ label, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FC, ReactElement, RefObject, SVGProps } from 'react';
|
|
2
|
-
import { ButtonProps as AriaButtonProps
|
|
2
|
+
import { ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
3
|
import { ButtonVariantProps } from '../Button/button.cva';
|
|
4
|
+
import { LinkNavigationProps } from '../../text/Link/Link';
|
|
4
5
|
export interface InlineIconButtonProps extends Omit<AriaButtonProps, "children">, ButtonVariantProps {
|
|
5
6
|
label: string;
|
|
6
7
|
icon: FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
7
|
-
link?:
|
|
8
|
+
link?: LinkNavigationProps;
|
|
8
9
|
ref?: RefObject<HTMLButtonElement | HTMLAnchorElement | null>;
|
|
9
10
|
disableTooltip?: boolean;
|
|
10
11
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ButtonProps as AriaButtonProps
|
|
1
|
+
import { ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
2
2
|
import { ButtonVariantProps } from '../Button/button.cva';
|
|
3
3
|
import { MenuItem } from '../../Menu/Menu';
|
|
4
|
+
import { LinkNavigationProps } from '../../text/Link/Link';
|
|
4
5
|
export interface SplitButtonProps extends ButtonVariantProps, Omit<AriaButtonProps, "children"> {
|
|
5
6
|
label: string;
|
|
6
7
|
labelRight: string;
|
|
7
|
-
link?:
|
|
8
|
+
link?: LinkNavigationProps;
|
|
8
9
|
items: MenuItem[];
|
|
9
10
|
}
|
|
10
11
|
export declare const SplitButton: ({ variant, color, width, size, label, labelRight, link, items, className, ...props }: SplitButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ButtonProps as AriaButtonProps
|
|
1
|
+
import { ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
2
2
|
import { ButtonIconProps } from '../Button/Button';
|
|
3
3
|
import { ButtonVariantProps } from '../Button/button.cva';
|
|
4
4
|
import { ButtonContentVariantProps } from '../shared/buttonContent.cva';
|
|
5
|
+
import { LinkNavigationProps } from '../../text/Link/Link';
|
|
5
6
|
export type TextButtonProps = Omit<ButtonVariantProps, "variant"> & ButtonContentVariantProps & AriaButtonProps & ButtonIconProps<true | false> & {
|
|
6
7
|
children: string;
|
|
7
8
|
isLoading?: boolean;
|
|
8
|
-
link?:
|
|
9
|
+
link?: LinkNavigationProps;
|
|
9
10
|
disableTooltip?: boolean;
|
|
10
11
|
};
|
|
11
12
|
export declare const TextButton: ({ children, ...props }: TextButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,6 +12,7 @@ import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
|
12
12
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
13
13
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
14
14
|
import { FormField } from "../../FormField/FormField.js";
|
|
15
|
+
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
15
16
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
16
17
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
17
18
|
const PLACEHOLDER_VALUE = new CalendarDate(2024, 1, 1);
|
|
@@ -115,59 +116,66 @@ const DatePickerBase = (props) => {
|
|
|
115
116
|
dialogState.setValue(state.value);
|
|
116
117
|
}
|
|
117
118
|
};
|
|
118
|
-
return /* @__PURE__ */
|
|
119
|
-
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
TooltipWrapper,
|
|
120
121
|
{
|
|
121
|
-
...formFieldProps,
|
|
122
122
|
as,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
isDisabled,
|
|
135
|
-
isInvalid: !!error,
|
|
136
|
-
disableDropdown,
|
|
137
|
-
variant,
|
|
138
|
-
size,
|
|
139
|
-
isClearable,
|
|
140
|
-
headerProps,
|
|
141
|
-
todayIcon
|
|
142
|
-
}
|
|
143
|
-
),
|
|
144
|
-
!disableDropdown && /* @__PURE__ */ jsx(
|
|
145
|
-
DateTimeDialog,
|
|
146
|
-
{
|
|
147
|
-
footer: /* @__PURE__ */ jsx(
|
|
148
|
-
DateTimeDialogFooter,
|
|
123
|
+
error,
|
|
124
|
+
children: /* @__PURE__ */ jsxs(
|
|
125
|
+
FormField,
|
|
126
|
+
{
|
|
127
|
+
...formFieldProps,
|
|
128
|
+
as,
|
|
129
|
+
labelProps,
|
|
130
|
+
className: clsx("relative inline-flex w-full flex-col text-left", className),
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
DatePickerInput,
|
|
149
134
|
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
135
|
+
ref: mergeRefs(ref, datePickerRef),
|
|
136
|
+
as,
|
|
137
|
+
groupProps,
|
|
138
|
+
fieldProps: { ...fieldProps, placeholderValue: PLACEHOLDER_VALUE },
|
|
139
|
+
buttonProps,
|
|
140
|
+
isDisabled,
|
|
141
|
+
isInvalid: !!error,
|
|
142
|
+
disableDropdown,
|
|
143
|
+
variant,
|
|
144
|
+
size,
|
|
145
|
+
isClearable,
|
|
146
|
+
headerProps,
|
|
147
|
+
todayIcon
|
|
153
148
|
}
|
|
154
149
|
),
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
dialogProps,
|
|
158
|
-
isOpen: state.isOpen,
|
|
159
|
-
onOpenChange,
|
|
160
|
-
children: /* @__PURE__ */ jsx(
|
|
161
|
-
Calendar,
|
|
150
|
+
!disableDropdown && /* @__PURE__ */ jsx(
|
|
151
|
+
DateTimeDialog,
|
|
162
152
|
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
footer: /* @__PURE__ */ jsx(
|
|
154
|
+
DateTimeDialogFooter,
|
|
155
|
+
{
|
|
156
|
+
isValid: !dialogState.isInvalid && !!dialogState.value,
|
|
157
|
+
onTodayPress,
|
|
158
|
+
onApply
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
label,
|
|
162
|
+
triggerRef: datePickerRef,
|
|
163
|
+
dialogProps,
|
|
164
|
+
isOpen: state.isOpen,
|
|
165
|
+
onOpenChange,
|
|
166
|
+
children: /* @__PURE__ */ jsx(
|
|
167
|
+
Calendar,
|
|
168
|
+
{
|
|
169
|
+
state: calendarState,
|
|
170
|
+
calendarProps,
|
|
171
|
+
onApply
|
|
172
|
+
}
|
|
173
|
+
)
|
|
166
174
|
}
|
|
167
175
|
)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
)
|
|
171
179
|
}
|
|
172
180
|
);
|
|
173
181
|
};
|
|
@@ -14,6 +14,7 @@ import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
|
14
14
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
15
15
|
import { RangeCalendar } from "../shared/RangeCalendar.js";
|
|
16
16
|
import { FormField } from "../../FormField/FormField.js";
|
|
17
|
+
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
17
18
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
18
19
|
import { ns } from "../../../../config/i18n.js";
|
|
19
20
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
@@ -367,6 +368,7 @@ const DateRangePickerBase = (props) => {
|
|
|
367
368
|
const todayDate2 = today(getLocalTimeZone());
|
|
368
369
|
leftCalendarState.setFocusedDate(todayDate2);
|
|
369
370
|
rightCalendarState.setFocusedDate(todayDate2.add({ months: 1 }));
|
|
371
|
+
syncCalendarStates({ start: todayDate2, end: todayDate2 });
|
|
370
372
|
};
|
|
371
373
|
const onOpenChange = (isOpen) => {
|
|
372
374
|
state.toggle();
|
|
@@ -492,90 +494,97 @@ const DateRangePickerBase = (props) => {
|
|
|
492
494
|
rightCalendarState.setFocusedDate(rightCalendarMonth);
|
|
493
495
|
}
|
|
494
496
|
};
|
|
495
|
-
return /* @__PURE__ */
|
|
496
|
-
|
|
497
|
+
return /* @__PURE__ */ jsx(
|
|
498
|
+
TooltipWrapper,
|
|
497
499
|
{
|
|
498
|
-
...formFieldProps,
|
|
499
500
|
as,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
buttonProps,
|
|
512
|
-
isDisabled,
|
|
513
|
-
isInvalid: !!error,
|
|
514
|
-
disableDropdown,
|
|
515
|
-
variant,
|
|
516
|
-
size,
|
|
517
|
-
isClearable,
|
|
518
|
-
headerProps,
|
|
519
|
-
todayIcon
|
|
520
|
-
}
|
|
521
|
-
),
|
|
522
|
-
/* @__PURE__ */ jsx(
|
|
523
|
-
DateTimeDialog,
|
|
524
|
-
{
|
|
525
|
-
hideSidebar,
|
|
526
|
-
sidebar: /* @__PURE__ */ jsx("div", { className: "flex w-full flex-row overflow-auto border-elevation-outline-default-1 border-solid [-ms-overflow-style:none] [scrollbar-width:none] md:w-[156px] md:flex-col md:border-r [&::-webkit-scrollbar]:hidden", children: presets.map((preset) => /* @__PURE__ */ jsx(
|
|
527
|
-
Button,
|
|
501
|
+
error,
|
|
502
|
+
children: /* @__PURE__ */ jsxs(
|
|
503
|
+
FormField,
|
|
504
|
+
{
|
|
505
|
+
...formFieldProps,
|
|
506
|
+
as,
|
|
507
|
+
labelProps,
|
|
508
|
+
className: clsx("relative inline-flex w-full flex-col text-left", className),
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ jsx(
|
|
511
|
+
DatePickerInput,
|
|
528
512
|
{
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
)
|
|
545
|
-
},
|
|
546
|
-
preset.label
|
|
547
|
-
)) }),
|
|
548
|
-
footer: /* @__PURE__ */ jsx(
|
|
549
|
-
DateTimeDialogFooter,
|
|
550
|
-
{
|
|
551
|
-
isValid: !dialogState.isInvalid && !!dialogState.value,
|
|
552
|
-
onTodayPress,
|
|
553
|
-
onApply
|
|
513
|
+
ref: mergeRefs(ref, dateRangePickerRef),
|
|
514
|
+
as,
|
|
515
|
+
groupProps,
|
|
516
|
+
fieldProps: { ...startFieldProps, placeholderValue: PLACEHOLDER_VALUE },
|
|
517
|
+
endFieldProps: { ...endFieldProps, placeholderValue: PLACEHOLDER_VALUE },
|
|
518
|
+
buttonProps,
|
|
519
|
+
isDisabled,
|
|
520
|
+
isInvalid: !!error,
|
|
521
|
+
disableDropdown,
|
|
522
|
+
variant,
|
|
523
|
+
size,
|
|
524
|
+
isClearable,
|
|
525
|
+
headerProps,
|
|
526
|
+
todayIcon
|
|
554
527
|
}
|
|
555
528
|
),
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
dialogProps,
|
|
559
|
-
isOpen: state.isOpen,
|
|
560
|
-
onOpenChange,
|
|
561
|
-
children: /* @__PURE__ */ jsx("div", { className: "mb-4 flex max-w-[804px] md:mb-0", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ jsx(
|
|
562
|
-
RangeCalendar,
|
|
529
|
+
/* @__PURE__ */ jsx(
|
|
530
|
+
DateTimeDialog,
|
|
563
531
|
{
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
532
|
+
hideSidebar,
|
|
533
|
+
sidebar: /* @__PURE__ */ jsx("div", { className: "flex w-full flex-row overflow-auto border-elevation-outline-default-1 border-solid [-ms-overflow-style:none] [scrollbar-width:none] md:w-[156px] md:flex-col md:border-r [&::-webkit-scrollbar]:hidden", children: presets.map((preset) => /* @__PURE__ */ jsx(
|
|
534
|
+
Button,
|
|
535
|
+
{
|
|
536
|
+
onClick: () => selectPreset(preset),
|
|
537
|
+
className: clsx(
|
|
538
|
+
"w-full px-2 py-1 text-left md:px-list-side-item md:py-list-height-item",
|
|
539
|
+
activePreset !== preset.label && "text-interactive-text-secondary-idle hover:text-interactive-text-secondary-hover",
|
|
540
|
+
activePreset === preset.label && "bg-interactive-contained-primary-idle text-interactive-text-secondary-idle-inverted"
|
|
541
|
+
),
|
|
542
|
+
children: /* @__PURE__ */ jsx(
|
|
543
|
+
Typography,
|
|
544
|
+
{
|
|
545
|
+
size: "label-2",
|
|
546
|
+
sizeMobile: "label-3",
|
|
547
|
+
as: "span",
|
|
548
|
+
className: "whitespace-nowrap",
|
|
549
|
+
children: preset.label
|
|
550
|
+
}
|
|
551
|
+
)
|
|
552
|
+
},
|
|
553
|
+
preset.label
|
|
554
|
+
)) }),
|
|
555
|
+
footer: /* @__PURE__ */ jsx(
|
|
556
|
+
DateTimeDialogFooter,
|
|
557
|
+
{
|
|
558
|
+
isValid: !dialogState.isInvalid && !!dialogState.value,
|
|
559
|
+
onTodayPress,
|
|
560
|
+
onApply
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
label,
|
|
564
|
+
triggerRef: dateRangePickerRef,
|
|
565
|
+
dialogProps,
|
|
566
|
+
isOpen: state.isOpen,
|
|
567
|
+
onOpenChange,
|
|
568
|
+
children: /* @__PURE__ */ jsx("div", { className: "mb-4 flex max-w-[804px] md:mb-0", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ jsx(
|
|
569
|
+
RangeCalendar,
|
|
570
|
+
{
|
|
571
|
+
leftCalendarState,
|
|
572
|
+
rightCalendarState,
|
|
573
|
+
calendarProps,
|
|
574
|
+
onApply,
|
|
575
|
+
onRangeChange: syncCalendarStates,
|
|
576
|
+
onDateSelection: handleDateSelection,
|
|
577
|
+
onDateHover: handleDateHover,
|
|
578
|
+
rangeSelection,
|
|
579
|
+
hoverDate,
|
|
580
|
+
onKeyboardNavigation: handleKeyboardNavigation
|
|
581
|
+
}
|
|
582
|
+
) }) })
|
|
574
583
|
}
|
|
575
|
-
)
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
584
|
+
)
|
|
585
|
+
]
|
|
586
|
+
}
|
|
587
|
+
)
|
|
579
588
|
}
|
|
580
589
|
);
|
|
581
590
|
};
|
|
@@ -10,6 +10,7 @@ import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
|
10
10
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
11
11
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
12
12
|
import { FormField } from "../../FormField/FormField.js";
|
|
13
|
+
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
13
14
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
14
15
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
15
16
|
const PLACEHOLDER_VALUE = new CalendarDateTime(2024, 1, 1);
|
|
@@ -130,69 +131,76 @@ const DateTimePickerBase = (props) => {
|
|
|
130
131
|
dialogState.setTimeValue(new Time(0, 0));
|
|
131
132
|
}
|
|
132
133
|
};
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
TooltipWrapper,
|
|
135
136
|
{
|
|
136
|
-
...formFieldProps,
|
|
137
137
|
as,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
placeholderValue: PLACEHOLDER_VALUE,
|
|
150
|
-
onBlur: (e) => {
|
|
151
|
-
fieldProps.onBlur?.(e);
|
|
152
|
-
onInputBlur(e);
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
buttonProps,
|
|
156
|
-
isDisabled,
|
|
157
|
-
isInvalid: !!error,
|
|
158
|
-
disableDropdown,
|
|
159
|
-
variant,
|
|
160
|
-
size,
|
|
161
|
-
isDateTime: true,
|
|
162
|
-
isClearable,
|
|
163
|
-
headerProps,
|
|
164
|
-
todayIcon
|
|
165
|
-
}
|
|
166
|
-
),
|
|
167
|
-
!disableDropdown && /* @__PURE__ */ jsx(
|
|
168
|
-
DateTimeDialog,
|
|
169
|
-
{
|
|
170
|
-
footer: /* @__PURE__ */ jsx(
|
|
171
|
-
DateTimeDialogFooter,
|
|
138
|
+
error,
|
|
139
|
+
children: /* @__PURE__ */ jsxs(
|
|
140
|
+
FormField,
|
|
141
|
+
{
|
|
142
|
+
...formFieldProps,
|
|
143
|
+
as,
|
|
144
|
+
labelProps,
|
|
145
|
+
className: "relative inline-flex w-full flex-col text-left",
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx(
|
|
148
|
+
DatePickerInput,
|
|
172
149
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
150
|
+
ref: mergeRefs(ref, datePickerRef),
|
|
151
|
+
as,
|
|
152
|
+
groupProps,
|
|
153
|
+
fieldProps: {
|
|
154
|
+
...fieldProps,
|
|
155
|
+
placeholderValue: PLACEHOLDER_VALUE,
|
|
156
|
+
onBlur: (e) => {
|
|
157
|
+
fieldProps.onBlur?.(e);
|
|
158
|
+
onInputBlur(e);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
buttonProps,
|
|
162
|
+
isDisabled,
|
|
163
|
+
isInvalid: !!error,
|
|
164
|
+
disableDropdown,
|
|
165
|
+
variant,
|
|
166
|
+
size,
|
|
167
|
+
isDateTime: true,
|
|
168
|
+
isClearable,
|
|
169
|
+
headerProps,
|
|
170
|
+
todayIcon
|
|
176
171
|
}
|
|
177
172
|
),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
dialogProps,
|
|
181
|
-
isOpen: state.isOpen,
|
|
182
|
-
onOpenChange,
|
|
183
|
-
children: /* @__PURE__ */ jsx(
|
|
184
|
-
Calendar,
|
|
173
|
+
!disableDropdown && /* @__PURE__ */ jsx(
|
|
174
|
+
DateTimeDialog,
|
|
185
175
|
{
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
176
|
+
footer: /* @__PURE__ */ jsx(
|
|
177
|
+
DateTimeDialogFooter,
|
|
178
|
+
{
|
|
179
|
+
isValid: !dialogState.isInvalid && !!dialogState.value,
|
|
180
|
+
onTodayPress,
|
|
181
|
+
onApply
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
label,
|
|
185
|
+
triggerRef: datePickerRef,
|
|
186
|
+
dialogProps,
|
|
187
|
+
isOpen: state.isOpen,
|
|
188
|
+
onOpenChange,
|
|
189
|
+
children: /* @__PURE__ */ jsx(
|
|
190
|
+
Calendar,
|
|
191
|
+
{
|
|
192
|
+
state: calendarState,
|
|
193
|
+
calendarProps,
|
|
194
|
+
includesTime: true,
|
|
195
|
+
datePickerState: dialogState,
|
|
196
|
+
onApply
|
|
197
|
+
}
|
|
198
|
+
)
|
|
191
199
|
}
|
|
192
200
|
)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
)
|
|
196
204
|
}
|
|
197
205
|
);
|
|
198
206
|
};
|
|
@@ -11,6 +11,7 @@ import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
|
11
11
|
import { TimePickerForm } from "../shared/TimePickerForm.js";
|
|
12
12
|
import { TimePickerInput } from "../shared/TimePickerInput.js";
|
|
13
13
|
import { FormField } from "../../FormField/FormField.js";
|
|
14
|
+
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
14
15
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
15
16
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
16
17
|
const TimePickerBase = (props) => {
|
|
@@ -125,49 +126,56 @@ const TimePickerBase = (props) => {
|
|
|
125
126
|
dialogState.setValue(state.value);
|
|
126
127
|
setIsOpen(true);
|
|
127
128
|
};
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
-
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
TooltipWrapper,
|
|
130
131
|
{
|
|
131
|
-
...formFieldProps,
|
|
132
132
|
as,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
isDisabled,
|
|
145
|
-
isInvalid: !!error,
|
|
146
|
-
disableDropdown,
|
|
147
|
-
variant,
|
|
148
|
-
size,
|
|
149
|
-
isClearable,
|
|
150
|
-
headerProps
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
!disableDropdown && /* @__PURE__ */ jsx(
|
|
154
|
-
DateTimeDialog,
|
|
155
|
-
{
|
|
156
|
-
footer: /* @__PURE__ */ jsx(
|
|
157
|
-
DateTimeDialogFooter,
|
|
133
|
+
error,
|
|
134
|
+
children: /* @__PURE__ */ jsxs(
|
|
135
|
+
FormField,
|
|
136
|
+
{
|
|
137
|
+
...formFieldProps,
|
|
138
|
+
as,
|
|
139
|
+
labelProps,
|
|
140
|
+
className: "relative inline-flex w-full flex-col text-left",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
TimePickerInput,
|
|
158
144
|
{
|
|
159
|
-
|
|
160
|
-
|
|
145
|
+
ref: mergeRefs(ref, timeFieldRef),
|
|
146
|
+
as,
|
|
147
|
+
fieldProps,
|
|
148
|
+
state,
|
|
149
|
+
onPress: onOpen,
|
|
150
|
+
isDisabled,
|
|
151
|
+
isInvalid: !!error,
|
|
152
|
+
disableDropdown,
|
|
153
|
+
variant,
|
|
154
|
+
size,
|
|
155
|
+
isClearable,
|
|
156
|
+
headerProps
|
|
161
157
|
}
|
|
162
158
|
),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
159
|
+
!disableDropdown && /* @__PURE__ */ jsx(
|
|
160
|
+
DateTimeDialog,
|
|
161
|
+
{
|
|
162
|
+
footer: /* @__PURE__ */ jsx(
|
|
163
|
+
DateTimeDialogFooter,
|
|
164
|
+
{
|
|
165
|
+
onApply,
|
|
166
|
+
isValid: !dialogState.isInvalid && !!dialogState.value
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
label,
|
|
170
|
+
triggerRef: timeFieldRef,
|
|
171
|
+
isOpen,
|
|
172
|
+
onOpenChange,
|
|
173
|
+
children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
)
|
|
171
179
|
}
|
|
172
180
|
);
|
|
173
181
|
};
|