@northlight/ui 2.38.1 → 2.38.2
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/es/northlight.d.ts +32 -1
- package/dist/es/northlight.js +173 -173
- package/dist/es/northlight.js.map +1 -1
- package/dist/umd/northlight.cjs +172 -172
- package/dist/umd/northlight.cjs.map +1 -1
- package/dist/umd/northlight.min.cjs +3 -3
- package/dist/umd/northlight.min.cjs.map +1 -1
- package/package.json +2 -2
package/dist/es/northlight.d.ts
CHANGED
|
@@ -996,7 +996,14 @@ interface DatePickerSettings {
|
|
|
996
996
|
interface DatePickerProps extends Omit<AriaDatePickerProps<DateValue>, 'firstDayOfWeek'>, DatePickerSettings {
|
|
997
997
|
}
|
|
998
998
|
interface DateRangePickerProps extends Omit<AriaDateRangePickerProps<DateValue>, 'firstDayOfWeek' | 'onChange' | 'value' | 'minValue' | 'maxValue'>, DatePickerSettings {
|
|
999
|
+
/**
|
|
1000
|
+
* Function to be called when the user changes the date, both in
|
|
1001
|
+
* the modal and the input field.
|
|
1002
|
+
*/
|
|
999
1003
|
onChange?: (date: null | DateRange) => void;
|
|
1004
|
+
/**
|
|
1005
|
+
* Function to be called when the user saves the date change.
|
|
1006
|
+
*/
|
|
1000
1007
|
onSave?: () => void;
|
|
1001
1008
|
value: DateRange | null;
|
|
1002
1009
|
minValue?: string | undefined;
|
|
@@ -1004,12 +1011,36 @@ interface DateRangePickerProps extends Omit<AriaDateRangePickerProps<DateValue>,
|
|
|
1004
1011
|
fiscalStartMonth?: number;
|
|
1005
1012
|
fiscalStartDay?: number;
|
|
1006
1013
|
renderInPortal?: boolean;
|
|
1014
|
+
/**
|
|
1015
|
+
* Label for the save button in the date range picker modal
|
|
1016
|
+
*/
|
|
1007
1017
|
buttonLabel?: string;
|
|
1008
|
-
|
|
1018
|
+
/**
|
|
1019
|
+
* The previously saved date range used for save/cancel functionality.
|
|
1020
|
+
* When provided along with defaultDateRange, enables save and cancel buttons that appear
|
|
1021
|
+
* when the current value differs from the saved value. The component will revert to this
|
|
1022
|
+
* value when the popover is closed without saving or when cancel is clicked.
|
|
1023
|
+
*/
|
|
1009
1024
|
savedDateRange?: DateRange | null;
|
|
1025
|
+
/**
|
|
1026
|
+
* The default date range to set when the input is cleared.
|
|
1027
|
+
* When provided, the clear button will be shown next to the input field when
|
|
1028
|
+
* modal is closed if the current value differs from the default value.
|
|
1029
|
+
* If not provided, the clear button will always be shown when modal is closed.
|
|
1030
|
+
*/
|
|
1010
1031
|
defaultDateRange?: DateRange | null;
|
|
1032
|
+
/**
|
|
1033
|
+
* Custom reset button to be shown next to the input field when modal is closed.
|
|
1034
|
+
* If not provided, the default clear button will be shown.
|
|
1035
|
+
*/
|
|
1011
1036
|
CustomResetButton?: React.ReactNode;
|
|
1037
|
+
/**
|
|
1038
|
+
* Custom label for the clear button in the date range picker modal
|
|
1039
|
+
*/
|
|
1012
1040
|
clearButtonLabel?: string;
|
|
1041
|
+
/**
|
|
1042
|
+
* Function to be called when the user cancels the date change
|
|
1043
|
+
*/
|
|
1013
1044
|
onCancelChanges?: () => void;
|
|
1014
1045
|
}
|
|
1015
1046
|
interface DatePickerFieldProps extends Omit<InputProps, 'onChange'>, InputFieldProps {
|
package/dist/es/northlight.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordion as Accordion$1, AccordionButton as AccordionButton$1, AccordionPanel as AccordionPanel$1, AccordionItem as AccordionItem$1, useInterval, useMediaQuery, useToken as useToken$1, extendTheme, Box, useMultiStyleConfig, chakra, Alert as Alert$2, AspectRatio as AspectRatio$1, forwardRef, useStyleConfig, Icon as Icon$2, Heading, Text, FormLabel as FormLabel$1, VisuallyHidden, HStack, Badge as Badge$2, Flex, Spinner as Spinner$2, Button as Button$2, Checkbox as Checkbox$2, FormControl, Stack, FormErrorMessage, CheckboxGroup, IconButton as IconButton$1, Popover as Popover$2, Portal, useDisclosure, useBoolean, PopoverTrigger, PopoverContent, PopoverHeader, PopoverBody, SimpleGrid, SlideFade as SlideFade$1, Table as Table$2, Thead, Tr, Tbody, Select as Select$2, PopoverAnchor, InputGroup, InputRightElement, Link as Link$1, Spacer,
|
|
1
|
+
import { Accordion as Accordion$1, AccordionButton as AccordionButton$1, AccordionPanel as AccordionPanel$1, AccordionItem as AccordionItem$1, useInterval, useMediaQuery, useToken as useToken$1, extendTheme, Box, useMultiStyleConfig, chakra, Alert as Alert$2, AspectRatio as AspectRatio$1, forwardRef, useStyleConfig, Icon as Icon$2, Heading, Text, FormLabel as FormLabel$1, VisuallyHidden, HStack, Badge as Badge$2, Flex, Spinner as Spinner$2, Button as Button$2, Checkbox as Checkbox$2, FormControl, Stack, FormErrorMessage, CheckboxGroup, IconButton as IconButton$1, Popover as Popover$2, Portal, useDisclosure, useBoolean, PopoverTrigger, PopoverContent, PopoverHeader, PopoverBody, SimpleGrid, SlideFade as SlideFade$1, Table as Table$2, Thead, Tr, Tbody, Select as Select$2, PopoverAnchor, InputGroup, InputRightElement, Link as Link$1, Spacer, Tooltip as Tooltip$2, VStack, useOutsideClick, Circle, Center, Fade as Fade$1, ScaleFade as ScaleFade$1, Slide as Slide$1, Collapse as Collapse$1, CloseButton as CloseButton$1, Radio as Radio$2, RadioGroup as RadioGroup$1, Tag as Tag$2, TagLabel, TagRightIcon, useEditableControls, useEditableState, Editable, InputLeftElement, Input as Input$1, EditablePreview, EditableInput, Modal as Modal$2, ModalOverlay, ModalContent, ModalCloseButton, ModalBody as ModalBody$1, ModalHeader, Slider, SliderTrack, SliderFilledTrack, SliderThumb, ModalFooter, Progress as Progress$1, Image as Image$1, ChakraProvider, Menu as Menu$2, NumberInputStepper as NumberInputStepper$1, Divider, NumberIncrementStepper, NumberDecrementStepper, NumberInput as NumberInput$2, NumberInputField as NumberInputField$1, PinInput as PinInput$2, Switch as Switch$2, TabPanel as TabPanel$1, Tabs as Tabs$2, Textarea as Textarea$2, useToast as useToast$1, AlertTitle, AlertDescription, Tab, TabList, useClipboard, Grid, GridItem, theme as theme$1 } from '@chakra-ui/react';
|
|
2
2
|
export { AbsoluteCenter, AccordionIcon, AlertDescription, AlertDialog, AlertDialogBody, AlertDialogCloseButton, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertIcon, AlertTitle, Box, BreadcrumbItem as Breadcrumb, BreadcrumbLink, BreadcrumbSeparator, Breadcrumb as Breadcrumbs, ButtonGroup, Card, CardBody, CardFooter, CardHeader, Center, Modal as ChakraModal, CheckboxGroup, Circle, CircularProgress, CircularProgressLabel, CloseButton, Code, Container, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, Editable, EditableInput, EditablePreview, Flex, FormControl, FormErrorMessage, FormHelperText, Grid, GridItem, HStack, Heading, Hide, Highlight, Image, Input, InputAddon, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Kbd, Link, LinkBox, LinkOverlay, List, ListIcon, ListItem, Mark, MenuButton, MenuCommand, MenuDivider, MenuGroup, MenuIcon, MenuItem, MenuItemOption, MenuList, MenuOptionGroup, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, NumberDecrementStepper, NumberIncrementStepper, OrderedList, PinInputField, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, RangeSlider, RangeSliderFilledTrack, RangeSliderMark, RangeSliderThumb, RangeSliderTrack, Show, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack, Spacer, Stack, StackDivider, Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber, TabIndicator as StepIndicator, TabPanels as StepPanels, Tab, TabIndicator, TabList, TabPanels, TableCaption, TableContainer, TagCloseButton, TagLabel, TagLeftIcon, TagRightIcon, Tbody, Td, Text, Tfoot, Th, Thead, Tr, UnorderedList, VStack, VisuallyHidden, VisuallyHiddenInput, Wrap, WrapItem, useBoolean, useBreakpoint, useBreakpointValue, useClipboard, useControllableProp, useControllableState, useDisclosure, useEditable, useEditableControls, useEditableState, useInterval, useMediaQuery, useMergeRefs, useNumberInput, useOutsideClick, usePrefersReducedMotion, useRadio, useRadioGroup, useTab, useTabs, useTheme, useToken } from '@chakra-ui/react';
|
|
3
3
|
import React, { useState, useEffect, useRef, isValidElement, cloneElement, Children, createContext, useContext, forwardRef as forwardRef$1, useImperativeHandle, memo, useMemo, useCallback } from 'react';
|
|
4
4
|
import { CreatableSelect, chakraComponents, AsyncSelect, Select as Select$3 } from 'chakra-react-select';
|
|
@@ -7765,8 +7765,7 @@ const RangeCalendar = (props) => {
|
|
|
7765
7765
|
firstDayOfWeek,
|
|
7766
7766
|
onSave,
|
|
7767
7767
|
buttonLabel = "Save",
|
|
7768
|
-
clearButtonLabel = "Clear"
|
|
7769
|
-
onCancel
|
|
7768
|
+
clearButtonLabel = "Clear"
|
|
7770
7769
|
} = props;
|
|
7771
7770
|
const { locale } = useLocale();
|
|
7772
7771
|
const ref = useRef(null);
|
|
@@ -7797,14 +7796,6 @@ const RangeCalendar = (props) => {
|
|
|
7797
7796
|
locale,
|
|
7798
7797
|
createCalendar: () => new GregorianCalendar()
|
|
7799
7798
|
});
|
|
7800
|
-
const handleOnReset = () => {
|
|
7801
|
-
if (onCancel) {
|
|
7802
|
-
onCancel();
|
|
7803
|
-
} else {
|
|
7804
|
-
resetDate();
|
|
7805
|
-
}
|
|
7806
|
-
handleClose();
|
|
7807
|
-
};
|
|
7808
7799
|
const focusDateRange = (dateRange) => {
|
|
7809
7800
|
if (dateRange && dateRange.start && dateRange.end) {
|
|
7810
7801
|
calendarOneState.setFocusedDate(dateRange.start);
|
|
@@ -7824,6 +7815,10 @@ const RangeCalendar = (props) => {
|
|
|
7824
7815
|
onSave == null ? void 0 : onSave();
|
|
7825
7816
|
handleClose();
|
|
7826
7817
|
};
|
|
7818
|
+
const handleReset = () => {
|
|
7819
|
+
resetDate();
|
|
7820
|
+
handleClose();
|
|
7821
|
+
};
|
|
7827
7822
|
return /* @__PURE__ */ React.createElement(Box, { ref, __css: rangeCalendarContainer }, /* @__PURE__ */ React.createElement(Stack, null, /* @__PURE__ */ React.createElement(Flex, { gap: 4 }, /* @__PURE__ */ React.createElement(
|
|
7828
7823
|
QuickSelect,
|
|
7829
7824
|
{
|
|
@@ -7846,14 +7841,23 @@ const RangeCalendar = (props) => {
|
|
|
7846
7841
|
range: value,
|
|
7847
7842
|
firstDayOfWeek
|
|
7848
7843
|
}
|
|
7849
|
-
))), /* @__PURE__ */ React.createElement(HStack, { pt: "2", alignSelf: "end" }, isClearable && /* @__PURE__ */ React.createElement(Button, { onClick:
|
|
7844
|
+
))), /* @__PURE__ */ React.createElement(HStack, { pt: "2", alignSelf: "end" }, isClearable && /* @__PURE__ */ React.createElement(Button, { onClick: handleReset, variant: "ghost", size: "sm" }, clearButtonLabel), /* @__PURE__ */ React.createElement(Button, { variant: "brand", onClick: handleSave, size: "sm" }, buttonLabel))))))));
|
|
7850
7845
|
};
|
|
7851
7846
|
|
|
7852
7847
|
const isValidDateRange = (value) => is(Object, value) && has("startDate", value) && has("endDate", value) && is(String, value.startDate) && is(String, value.endDate);
|
|
7853
7848
|
|
|
7849
|
+
const tooltipIconMap = {
|
|
7850
|
+
success: CheckCircleSolid,
|
|
7851
|
+
warning: AlertTriangleSolid,
|
|
7852
|
+
error: AlertCircleSolid,
|
|
7853
|
+
danger: AlertOctagonSolid,
|
|
7854
|
+
info: InfoSolid,
|
|
7855
|
+
ai: BrightnessSolid,
|
|
7856
|
+
default: HelpCircleSolid,
|
|
7857
|
+
ghost: HelpCircleSolid
|
|
7858
|
+
};
|
|
7859
|
+
|
|
7854
7860
|
var __defProp$1p = Object.defineProperty;
|
|
7855
|
-
var __defProps$e = Object.defineProperties;
|
|
7856
|
-
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
7857
7861
|
var __getOwnPropSymbols$1p = Object.getOwnPropertySymbols;
|
|
7858
7862
|
var __hasOwnProp$1p = Object.prototype.hasOwnProperty;
|
|
7859
7863
|
var __propIsEnum$1p = Object.prototype.propertyIsEnumerable;
|
|
@@ -7869,6 +7873,73 @@ var __spreadValues$1p = (a, b) => {
|
|
|
7869
7873
|
}
|
|
7870
7874
|
return a;
|
|
7871
7875
|
};
|
|
7876
|
+
var __objRest$1b = (source, exclude) => {
|
|
7877
|
+
var target = {};
|
|
7878
|
+
for (var prop in source)
|
|
7879
|
+
if (__hasOwnProp$1p.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
7880
|
+
target[prop] = source[prop];
|
|
7881
|
+
if (source != null && __getOwnPropSymbols$1p)
|
|
7882
|
+
for (var prop of __getOwnPropSymbols$1p(source)) {
|
|
7883
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$1p.call(source, prop))
|
|
7884
|
+
target[prop] = source[prop];
|
|
7885
|
+
}
|
|
7886
|
+
return target;
|
|
7887
|
+
};
|
|
7888
|
+
const Tooltip = (_a) => {
|
|
7889
|
+
var _b = _a, {
|
|
7890
|
+
variant = "default",
|
|
7891
|
+
hasArrow = true,
|
|
7892
|
+
title = "",
|
|
7893
|
+
description = "",
|
|
7894
|
+
hasIcon = false
|
|
7895
|
+
} = _b, rest = __objRest$1b(_b, [
|
|
7896
|
+
"variant",
|
|
7897
|
+
"hasArrow",
|
|
7898
|
+
"title",
|
|
7899
|
+
"description",
|
|
7900
|
+
"hasIcon"
|
|
7901
|
+
]);
|
|
7902
|
+
const iconVariant = variant;
|
|
7903
|
+
const icon = tooltipIconMap[iconVariant];
|
|
7904
|
+
const TooltipContent = /* @__PURE__ */ React.createElement(HStack, { alignItems: "flex-start" }, hasIcon && /* @__PURE__ */ React.createElement(Icon, { as: icon, color: `icon.toast.${iconVariant}` }), /* @__PURE__ */ React.createElement(VStack, { spacing: 0, alignItems: "flex-start" }, /* @__PURE__ */ React.createElement(Label, { size: "sm" }, title), /* @__PURE__ */ React.createElement(
|
|
7905
|
+
P,
|
|
7906
|
+
{
|
|
7907
|
+
variant: "14",
|
|
7908
|
+
sx: {
|
|
7909
|
+
color: !variant || variant === "ai" ? "text.inverted" : "text.default"
|
|
7910
|
+
}
|
|
7911
|
+
},
|
|
7912
|
+
description
|
|
7913
|
+
)));
|
|
7914
|
+
return /* @__PURE__ */ React.createElement(
|
|
7915
|
+
Tooltip$2,
|
|
7916
|
+
__spreadValues$1p({
|
|
7917
|
+
hasArrow,
|
|
7918
|
+
hasIcon,
|
|
7919
|
+
label: title || description ? TooltipContent : void 0,
|
|
7920
|
+
variant
|
|
7921
|
+
}, rest)
|
|
7922
|
+
);
|
|
7923
|
+
};
|
|
7924
|
+
|
|
7925
|
+
var __defProp$1o = Object.defineProperty;
|
|
7926
|
+
var __defProps$e = Object.defineProperties;
|
|
7927
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
7928
|
+
var __getOwnPropSymbols$1o = Object.getOwnPropertySymbols;
|
|
7929
|
+
var __hasOwnProp$1o = Object.prototype.hasOwnProperty;
|
|
7930
|
+
var __propIsEnum$1o = Object.prototype.propertyIsEnumerable;
|
|
7931
|
+
var __defNormalProp$1o = (obj, key, value) => key in obj ? __defProp$1o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7932
|
+
var __spreadValues$1o = (a, b) => {
|
|
7933
|
+
for (var prop in b || (b = {}))
|
|
7934
|
+
if (__hasOwnProp$1o.call(b, prop))
|
|
7935
|
+
__defNormalProp$1o(a, prop, b[prop]);
|
|
7936
|
+
if (__getOwnPropSymbols$1o)
|
|
7937
|
+
for (var prop of __getOwnPropSymbols$1o(b)) {
|
|
7938
|
+
if (__propIsEnum$1o.call(b, prop))
|
|
7939
|
+
__defNormalProp$1o(a, prop, b[prop]);
|
|
7940
|
+
}
|
|
7941
|
+
return a;
|
|
7942
|
+
};
|
|
7872
7943
|
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
7873
7944
|
const parseValue = (value) => {
|
|
7874
7945
|
if (!isValidDateRange(value))
|
|
@@ -7904,10 +7975,8 @@ const DateRangePicker = (props) => {
|
|
|
7904
7975
|
onSave,
|
|
7905
7976
|
buttonLabel = "Save",
|
|
7906
7977
|
clearButtonLabel = "Clear",
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
savedDateRange = value,
|
|
7910
|
-
defaultDateRange = value,
|
|
7978
|
+
savedDateRange,
|
|
7979
|
+
defaultDateRange,
|
|
7911
7980
|
CustomResetButton,
|
|
7912
7981
|
onCancelChanges
|
|
7913
7982
|
} = props;
|
|
@@ -7937,9 +8006,6 @@ const DateRangePicker = (props) => {
|
|
|
7937
8006
|
shouldCloseOnSelect: false,
|
|
7938
8007
|
hideTimeZone: true
|
|
7939
8008
|
});
|
|
7940
|
-
useEffect(() => {
|
|
7941
|
-
setIsOpen(state.isOpen);
|
|
7942
|
-
}, [state.isOpen]);
|
|
7943
8009
|
const {
|
|
7944
8010
|
groupProps,
|
|
7945
8011
|
startFieldProps,
|
|
@@ -7964,14 +8030,14 @@ const DateRangePicker = (props) => {
|
|
|
7964
8030
|
isDisabled,
|
|
7965
8031
|
isInvalid,
|
|
7966
8032
|
startName: props.startName,
|
|
7967
|
-
endName: props.endName
|
|
8033
|
+
endName: props.endName,
|
|
8034
|
+
"aria-label": "Date range picker"
|
|
7968
8035
|
},
|
|
7969
8036
|
state,
|
|
7970
8037
|
ref
|
|
7971
8038
|
);
|
|
7972
8039
|
const togglePopup = () => state.setOpen(!state.isOpen);
|
|
7973
8040
|
const handleClose = () => {
|
|
7974
|
-
onChangeCallback(savedDateRange);
|
|
7975
8041
|
state.setOpen(false);
|
|
7976
8042
|
};
|
|
7977
8043
|
useOutsideClick({
|
|
@@ -7991,12 +8057,14 @@ const DateRangePicker = (props) => {
|
|
|
7991
8057
|
icon: /* @__PURE__ */ React.createElement(Icon, { as: XCloseSolid })
|
|
7992
8058
|
}
|
|
7993
8059
|
);
|
|
7994
|
-
const
|
|
7995
|
-
const isCurrentDateDefault = isDatesEqual(value, defaultDateRange);
|
|
7996
|
-
const cancelDateChange = () => {
|
|
8060
|
+
const cancelOrResetDateChange = () => {
|
|
7997
8061
|
if (onCancelChanges) {
|
|
8062
|
+
if (!isNil(savedDateRange))
|
|
8063
|
+
onChangeCallback(savedDateRange);
|
|
7998
8064
|
onCancelChanges();
|
|
7999
8065
|
} else {
|
|
8066
|
+
if (!isNil(defaultDateRange))
|
|
8067
|
+
onChangeCallback(defaultDateRange);
|
|
8000
8068
|
resetDate();
|
|
8001
8069
|
}
|
|
8002
8070
|
};
|
|
@@ -8004,41 +8072,49 @@ const DateRangePicker = (props) => {
|
|
|
8004
8072
|
onSave == null ? void 0 : onSave();
|
|
8005
8073
|
handleClose();
|
|
8006
8074
|
};
|
|
8007
|
-
const
|
|
8008
|
-
|
|
8075
|
+
const handleModalClose = () => {
|
|
8076
|
+
if (!isNil(savedDateRange))
|
|
8077
|
+
onChangeCallback(savedDateRange);
|
|
8078
|
+
handleClose();
|
|
8079
|
+
};
|
|
8080
|
+
const isCurrentDateSaved = isNil(savedDateRange) || isDatesEqual(value, savedDateRange);
|
|
8081
|
+
const isDateResettable = isNil(defaultDateRange) || !isDatesEqual(value, defaultDateRange);
|
|
8082
|
+
const canShowSaveAndCancelButtons = !isNil(savedDateRange) && !isNil(defaultDateRange);
|
|
8083
|
+
const shouldShowResetButton = !state.isOpen && isCurrentDateSaved && isDateResettable;
|
|
8084
|
+
const shouldShowSaveAndCancelButtons = canShowSaveAndCancelButtons && !state.isOpen && !isCurrentDateSaved;
|
|
8009
8085
|
return /* @__PURE__ */ React.createElement(
|
|
8010
8086
|
Popover,
|
|
8011
8087
|
{
|
|
8012
8088
|
isOpen: state.isOpen,
|
|
8013
|
-
onClose:
|
|
8089
|
+
onClose: handleModalClose,
|
|
8014
8090
|
placement: "bottom-start"
|
|
8015
8091
|
},
|
|
8016
|
-
/* @__PURE__ */ React.createElement(PopoverAnchor, null, /* @__PURE__ */ React.createElement(HStack, null, /* @__PURE__ */ React.createElement(InputGroup, __spreadProps$e(__spreadValues$
|
|
8092
|
+
/* @__PURE__ */ React.createElement(PopoverAnchor, null, /* @__PURE__ */ React.createElement(HStack, null, /* @__PURE__ */ React.createElement(InputGroup, __spreadProps$e(__spreadValues$1o({}, groupProps), { ref, __css: group }), /* @__PURE__ */ React.createElement(
|
|
8017
8093
|
StyledField,
|
|
8018
8094
|
{
|
|
8019
8095
|
isDisabled,
|
|
8020
8096
|
isInvalid,
|
|
8021
8097
|
variant
|
|
8022
8098
|
},
|
|
8023
|
-
/* @__PURE__ */ React.createElement(HStack, { paddingInlineStart: "1a", paddingInlineEnd: 10 }, /* @__PURE__ */ React.createElement(DateField, __spreadProps$e(__spreadValues$
|
|
8099
|
+
/* @__PURE__ */ React.createElement(HStack, { paddingInlineStart: "1a", paddingInlineEnd: 10 }, /* @__PURE__ */ React.createElement(DateField, __spreadProps$e(__spreadValues$1o({}, startFieldProps), { dateFormat })), /* @__PURE__ */ React.createElement(P, null, "-"), /* @__PURE__ */ React.createElement(DateField, __spreadProps$e(__spreadValues$1o({}, endFieldProps), { dateFormat })))
|
|
8024
8100
|
), /* @__PURE__ */ React.createElement(InputRightElement, { sx: { height: "100%", paddingRight: "1" } }, /* @__PURE__ */ React.createElement(
|
|
8025
8101
|
Trigger,
|
|
8026
|
-
__spreadProps$e(__spreadValues$
|
|
8102
|
+
__spreadProps$e(__spreadValues$1o({}, buttonProps), {
|
|
8027
8103
|
isDisabled,
|
|
8028
8104
|
handleClick: togglePopup
|
|
8029
8105
|
})
|
|
8030
|
-
))), shouldShowResetButton && ResetButton, shouldShowSaveAndCancelButtons && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
8106
|
+
))), shouldShowResetButton && ResetButton, shouldShowSaveAndCancelButtons && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip, { label: clearButtonLabel }, /* @__PURE__ */ React.createElement(
|
|
8031
8107
|
IconButton,
|
|
8032
8108
|
{
|
|
8033
8109
|
"aria-label": "cancel-date-change",
|
|
8034
8110
|
variant: "ghost",
|
|
8035
8111
|
size: "sm",
|
|
8036
8112
|
fontSize: "xs",
|
|
8037
|
-
onClick:
|
|
8113
|
+
onClick: onCancelChanges,
|
|
8038
8114
|
isDisabled,
|
|
8039
8115
|
icon: /* @__PURE__ */ React.createElement(Icon, { as: XCloseSolid })
|
|
8040
8116
|
}
|
|
8041
|
-
), /* @__PURE__ */ React.createElement(
|
|
8117
|
+
)), /* @__PURE__ */ React.createElement(Tooltip, { label: buttonLabel }, /* @__PURE__ */ React.createElement(
|
|
8042
8118
|
IconButton,
|
|
8043
8119
|
{
|
|
8044
8120
|
"aria-label": "save-date",
|
|
@@ -8046,20 +8122,20 @@ const DateRangePicker = (props) => {
|
|
|
8046
8122
|
size: "sm",
|
|
8047
8123
|
fontSize: "xs",
|
|
8048
8124
|
onClick: handleSave,
|
|
8125
|
+
isDisabled,
|
|
8049
8126
|
icon: /* @__PURE__ */ React.createElement(Icon, { as: CheckSolid })
|
|
8050
8127
|
}
|
|
8051
|
-
)))),
|
|
8052
|
-
/* @__PURE__ */ React.createElement(PortalWrapper, { renderInPortal }, state.isOpen && /* @__PURE__ */ React.createElement(PopoverContent, __spreadProps$e(__spreadValues$
|
|
8128
|
+
))))),
|
|
8129
|
+
/* @__PURE__ */ React.createElement(PortalWrapper, { renderInPortal }, state.isOpen && /* @__PURE__ */ React.createElement(PopoverContent, __spreadProps$e(__spreadValues$1o({}, dialogProps), { ref, w: "max-content" }), /* @__PURE__ */ React.createElement(FocusScope, { contain: true, restoreFocus: true }, /* @__PURE__ */ React.createElement(DatePickerLocaleWrapper, { firstDayOfWeek }, /* @__PURE__ */ React.createElement(
|
|
8053
8130
|
RangeCalendar,
|
|
8054
|
-
__spreadProps$e(__spreadValues$
|
|
8055
|
-
resetDate,
|
|
8131
|
+
__spreadProps$e(__spreadValues$1o({}, calendarProps), {
|
|
8132
|
+
resetDate: cancelOrResetDateChange,
|
|
8056
8133
|
handleClose,
|
|
8057
8134
|
fiscalStartMonth: fiscalStartMonth || 0,
|
|
8058
8135
|
fiscalStartDay: fiscalStartDay || 0,
|
|
8059
8136
|
isClearable,
|
|
8060
8137
|
firstDayOfWeek,
|
|
8061
8138
|
onSave,
|
|
8062
|
-
onCancel: onCancelChanges,
|
|
8063
8139
|
clearButtonLabel,
|
|
8064
8140
|
buttonLabel
|
|
8065
8141
|
})
|
|
@@ -8067,30 +8143,30 @@ const DateRangePicker = (props) => {
|
|
|
8067
8143
|
);
|
|
8068
8144
|
};
|
|
8069
8145
|
|
|
8070
|
-
var __defProp$
|
|
8071
|
-
var __getOwnPropSymbols$
|
|
8072
|
-
var __hasOwnProp$
|
|
8073
|
-
var __propIsEnum$
|
|
8074
|
-
var __defNormalProp$
|
|
8075
|
-
var __spreadValues$
|
|
8146
|
+
var __defProp$1n = Object.defineProperty;
|
|
8147
|
+
var __getOwnPropSymbols$1n = Object.getOwnPropertySymbols;
|
|
8148
|
+
var __hasOwnProp$1n = Object.prototype.hasOwnProperty;
|
|
8149
|
+
var __propIsEnum$1n = Object.prototype.propertyIsEnumerable;
|
|
8150
|
+
var __defNormalProp$1n = (obj, key, value) => key in obj ? __defProp$1n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8151
|
+
var __spreadValues$1n = (a, b) => {
|
|
8076
8152
|
for (var prop in b || (b = {}))
|
|
8077
|
-
if (__hasOwnProp$
|
|
8078
|
-
__defNormalProp$
|
|
8079
|
-
if (__getOwnPropSymbols$
|
|
8080
|
-
for (var prop of __getOwnPropSymbols$
|
|
8081
|
-
if (__propIsEnum$
|
|
8082
|
-
__defNormalProp$
|
|
8153
|
+
if (__hasOwnProp$1n.call(b, prop))
|
|
8154
|
+
__defNormalProp$1n(a, prop, b[prop]);
|
|
8155
|
+
if (__getOwnPropSymbols$1n)
|
|
8156
|
+
for (var prop of __getOwnPropSymbols$1n(b)) {
|
|
8157
|
+
if (__propIsEnum$1n.call(b, prop))
|
|
8158
|
+
__defNormalProp$1n(a, prop, b[prop]);
|
|
8083
8159
|
}
|
|
8084
8160
|
return a;
|
|
8085
8161
|
};
|
|
8086
|
-
var __objRest$
|
|
8162
|
+
var __objRest$1a = (source, exclude) => {
|
|
8087
8163
|
var target = {};
|
|
8088
8164
|
for (var prop in source)
|
|
8089
|
-
if (__hasOwnProp$
|
|
8165
|
+
if (__hasOwnProp$1n.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8090
8166
|
target[prop] = source[prop];
|
|
8091
|
-
if (source != null && __getOwnPropSymbols$
|
|
8092
|
-
for (var prop of __getOwnPropSymbols$
|
|
8093
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
8167
|
+
if (source != null && __getOwnPropSymbols$1n)
|
|
8168
|
+
for (var prop of __getOwnPropSymbols$1n(source)) {
|
|
8169
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$1n.call(source, prop))
|
|
8094
8170
|
target[prop] = source[prop];
|
|
8095
8171
|
}
|
|
8096
8172
|
return target;
|
|
@@ -8100,39 +8176,39 @@ const InputGroupWrapper = (_a) => {
|
|
|
8100
8176
|
inputLeftElement,
|
|
8101
8177
|
inputRightElement,
|
|
8102
8178
|
children
|
|
8103
|
-
} = _b, rest = __objRest$
|
|
8179
|
+
} = _b, rest = __objRest$1a(_b, [
|
|
8104
8180
|
"inputLeftElement",
|
|
8105
8181
|
"inputRightElement",
|
|
8106
8182
|
"children"
|
|
8107
8183
|
]);
|
|
8108
8184
|
const containsInputGroupElement = not(all(isNil, [inputLeftElement, inputRightElement]));
|
|
8109
|
-
return containsInputGroupElement ? /* @__PURE__ */ React.createElement(InputGroup, __spreadValues$
|
|
8185
|
+
return containsInputGroupElement ? /* @__PURE__ */ React.createElement(InputGroup, __spreadValues$1n({}, rest), inputLeftElement, children, inputRightElement) : /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
8110
8186
|
};
|
|
8111
8187
|
|
|
8112
|
-
var __defProp$
|
|
8113
|
-
var __getOwnPropSymbols$
|
|
8114
|
-
var __hasOwnProp$
|
|
8115
|
-
var __propIsEnum$
|
|
8116
|
-
var __defNormalProp$
|
|
8117
|
-
var __spreadValues$
|
|
8188
|
+
var __defProp$1m = Object.defineProperty;
|
|
8189
|
+
var __getOwnPropSymbols$1m = Object.getOwnPropertySymbols;
|
|
8190
|
+
var __hasOwnProp$1m = Object.prototype.hasOwnProperty;
|
|
8191
|
+
var __propIsEnum$1m = Object.prototype.propertyIsEnumerable;
|
|
8192
|
+
var __defNormalProp$1m = (obj, key, value) => key in obj ? __defProp$1m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8193
|
+
var __spreadValues$1m = (a, b) => {
|
|
8118
8194
|
for (var prop in b || (b = {}))
|
|
8119
|
-
if (__hasOwnProp$
|
|
8120
|
-
__defNormalProp$
|
|
8121
|
-
if (__getOwnPropSymbols$
|
|
8122
|
-
for (var prop of __getOwnPropSymbols$
|
|
8123
|
-
if (__propIsEnum$
|
|
8124
|
-
__defNormalProp$
|
|
8195
|
+
if (__hasOwnProp$1m.call(b, prop))
|
|
8196
|
+
__defNormalProp$1m(a, prop, b[prop]);
|
|
8197
|
+
if (__getOwnPropSymbols$1m)
|
|
8198
|
+
for (var prop of __getOwnPropSymbols$1m(b)) {
|
|
8199
|
+
if (__propIsEnum$1m.call(b, prop))
|
|
8200
|
+
__defNormalProp$1m(a, prop, b[prop]);
|
|
8125
8201
|
}
|
|
8126
8202
|
return a;
|
|
8127
8203
|
};
|
|
8128
|
-
var __objRest$
|
|
8204
|
+
var __objRest$19 = (source, exclude) => {
|
|
8129
8205
|
var target = {};
|
|
8130
8206
|
for (var prop in source)
|
|
8131
|
-
if (__hasOwnProp$
|
|
8207
|
+
if (__hasOwnProp$1m.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8132
8208
|
target[prop] = source[prop];
|
|
8133
|
-
if (source != null && __getOwnPropSymbols$
|
|
8134
|
-
for (var prop of __getOwnPropSymbols$
|
|
8135
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
8209
|
+
if (source != null && __getOwnPropSymbols$1m)
|
|
8210
|
+
for (var prop of __getOwnPropSymbols$1m(source)) {
|
|
8211
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$1m.call(source, prop))
|
|
8136
8212
|
target[prop] = source[prop];
|
|
8137
8213
|
}
|
|
8138
8214
|
return target;
|
|
@@ -8150,7 +8226,7 @@ const DatePickerField = forwardRef$1((_a, ref) => {
|
|
|
8150
8226
|
onChange: onChangeCallback = identity,
|
|
8151
8227
|
inputLeftElement,
|
|
8152
8228
|
inputRightElement
|
|
8153
|
-
} = _b, rest = __objRest$
|
|
8229
|
+
} = _b, rest = __objRest$19(_b, [
|
|
8154
8230
|
"name",
|
|
8155
8231
|
"minValue",
|
|
8156
8232
|
"maxValue",
|
|
@@ -8194,7 +8270,7 @@ const DatePickerField = forwardRef$1((_a, ref) => {
|
|
|
8194
8270
|
},
|
|
8195
8271
|
/* @__PURE__ */ React.createElement(
|
|
8196
8272
|
DatePicker,
|
|
8197
|
-
__spreadValues$
|
|
8273
|
+
__spreadValues$1m({
|
|
8198
8274
|
firstDayOfWeek,
|
|
8199
8275
|
"aria-label": label,
|
|
8200
8276
|
isInvalid: !!errors[name],
|
|
@@ -8210,30 +8286,30 @@ const DatePickerField = forwardRef$1((_a, ref) => {
|
|
|
8210
8286
|
);
|
|
8211
8287
|
});
|
|
8212
8288
|
|
|
8213
|
-
var __defProp$
|
|
8214
|
-
var __getOwnPropSymbols$
|
|
8215
|
-
var __hasOwnProp$
|
|
8216
|
-
var __propIsEnum$
|
|
8217
|
-
var __defNormalProp$
|
|
8218
|
-
var __spreadValues$
|
|
8289
|
+
var __defProp$1l = Object.defineProperty;
|
|
8290
|
+
var __getOwnPropSymbols$1l = Object.getOwnPropertySymbols;
|
|
8291
|
+
var __hasOwnProp$1l = Object.prototype.hasOwnProperty;
|
|
8292
|
+
var __propIsEnum$1l = Object.prototype.propertyIsEnumerable;
|
|
8293
|
+
var __defNormalProp$1l = (obj, key, value) => key in obj ? __defProp$1l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8294
|
+
var __spreadValues$1l = (a, b) => {
|
|
8219
8295
|
for (var prop in b || (b = {}))
|
|
8220
|
-
if (__hasOwnProp$
|
|
8221
|
-
__defNormalProp$
|
|
8222
|
-
if (__getOwnPropSymbols$
|
|
8223
|
-
for (var prop of __getOwnPropSymbols$
|
|
8224
|
-
if (__propIsEnum$
|
|
8225
|
-
__defNormalProp$
|
|
8296
|
+
if (__hasOwnProp$1l.call(b, prop))
|
|
8297
|
+
__defNormalProp$1l(a, prop, b[prop]);
|
|
8298
|
+
if (__getOwnPropSymbols$1l)
|
|
8299
|
+
for (var prop of __getOwnPropSymbols$1l(b)) {
|
|
8300
|
+
if (__propIsEnum$1l.call(b, prop))
|
|
8301
|
+
__defNormalProp$1l(a, prop, b[prop]);
|
|
8226
8302
|
}
|
|
8227
8303
|
return a;
|
|
8228
8304
|
};
|
|
8229
|
-
var __objRest$
|
|
8305
|
+
var __objRest$18 = (source, exclude) => {
|
|
8230
8306
|
var target = {};
|
|
8231
8307
|
for (var prop in source)
|
|
8232
|
-
if (__hasOwnProp$
|
|
8308
|
+
if (__hasOwnProp$1l.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8233
8309
|
target[prop] = source[prop];
|
|
8234
|
-
if (source != null && __getOwnPropSymbols$
|
|
8235
|
-
for (var prop of __getOwnPropSymbols$
|
|
8236
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
8310
|
+
if (source != null && __getOwnPropSymbols$1l)
|
|
8311
|
+
for (var prop of __getOwnPropSymbols$1l(source)) {
|
|
8312
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$1l.call(source, prop))
|
|
8237
8313
|
target[prop] = source[prop];
|
|
8238
8314
|
}
|
|
8239
8315
|
return target;
|
|
@@ -8252,7 +8328,7 @@ const DateRangePickerField = forwardRef$1((_a, ref) => {
|
|
|
8252
8328
|
isClearable = true,
|
|
8253
8329
|
onSave,
|
|
8254
8330
|
buttonLabel = "Save"
|
|
8255
|
-
} = _b, rest = __objRest$
|
|
8331
|
+
} = _b, rest = __objRest$18(_b, [
|
|
8256
8332
|
"name",
|
|
8257
8333
|
"minValue",
|
|
8258
8334
|
"maxValue",
|
|
@@ -8291,7 +8367,7 @@ const DateRangePickerField = forwardRef$1((_a, ref) => {
|
|
|
8291
8367
|
},
|
|
8292
8368
|
({ value, onChange }, { formState: { errors } }) => /* @__PURE__ */ React.createElement(
|
|
8293
8369
|
DateRangePicker,
|
|
8294
|
-
__spreadValues$
|
|
8370
|
+
__spreadValues$1l({
|
|
8295
8371
|
firstDayOfWeek,
|
|
8296
8372
|
"aria-label": label,
|
|
8297
8373
|
isInvalid: !!errors[name],
|
|
@@ -8309,82 +8385,6 @@ const DateRangePickerField = forwardRef$1((_a, ref) => {
|
|
|
8309
8385
|
);
|
|
8310
8386
|
});
|
|
8311
8387
|
|
|
8312
|
-
const tooltipIconMap = {
|
|
8313
|
-
success: CheckCircleSolid,
|
|
8314
|
-
warning: AlertTriangleSolid,
|
|
8315
|
-
error: AlertCircleSolid,
|
|
8316
|
-
danger: AlertOctagonSolid,
|
|
8317
|
-
info: InfoSolid,
|
|
8318
|
-
ai: BrightnessSolid,
|
|
8319
|
-
default: HelpCircleSolid,
|
|
8320
|
-
ghost: HelpCircleSolid
|
|
8321
|
-
};
|
|
8322
|
-
|
|
8323
|
-
var __defProp$1l = Object.defineProperty;
|
|
8324
|
-
var __getOwnPropSymbols$1l = Object.getOwnPropertySymbols;
|
|
8325
|
-
var __hasOwnProp$1l = Object.prototype.hasOwnProperty;
|
|
8326
|
-
var __propIsEnum$1l = Object.prototype.propertyIsEnumerable;
|
|
8327
|
-
var __defNormalProp$1l = (obj, key, value) => key in obj ? __defProp$1l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8328
|
-
var __spreadValues$1l = (a, b) => {
|
|
8329
|
-
for (var prop in b || (b = {}))
|
|
8330
|
-
if (__hasOwnProp$1l.call(b, prop))
|
|
8331
|
-
__defNormalProp$1l(a, prop, b[prop]);
|
|
8332
|
-
if (__getOwnPropSymbols$1l)
|
|
8333
|
-
for (var prop of __getOwnPropSymbols$1l(b)) {
|
|
8334
|
-
if (__propIsEnum$1l.call(b, prop))
|
|
8335
|
-
__defNormalProp$1l(a, prop, b[prop]);
|
|
8336
|
-
}
|
|
8337
|
-
return a;
|
|
8338
|
-
};
|
|
8339
|
-
var __objRest$18 = (source, exclude) => {
|
|
8340
|
-
var target = {};
|
|
8341
|
-
for (var prop in source)
|
|
8342
|
-
if (__hasOwnProp$1l.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8343
|
-
target[prop] = source[prop];
|
|
8344
|
-
if (source != null && __getOwnPropSymbols$1l)
|
|
8345
|
-
for (var prop of __getOwnPropSymbols$1l(source)) {
|
|
8346
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$1l.call(source, prop))
|
|
8347
|
-
target[prop] = source[prop];
|
|
8348
|
-
}
|
|
8349
|
-
return target;
|
|
8350
|
-
};
|
|
8351
|
-
const Tooltip = (_a) => {
|
|
8352
|
-
var _b = _a, {
|
|
8353
|
-
variant = "default",
|
|
8354
|
-
hasArrow = true,
|
|
8355
|
-
title = "",
|
|
8356
|
-
description = "",
|
|
8357
|
-
hasIcon = false
|
|
8358
|
-
} = _b, rest = __objRest$18(_b, [
|
|
8359
|
-
"variant",
|
|
8360
|
-
"hasArrow",
|
|
8361
|
-
"title",
|
|
8362
|
-
"description",
|
|
8363
|
-
"hasIcon"
|
|
8364
|
-
]);
|
|
8365
|
-
const iconVariant = variant;
|
|
8366
|
-
const icon = tooltipIconMap[iconVariant];
|
|
8367
|
-
const TooltipContent = /* @__PURE__ */ React.createElement(HStack, { alignItems: "flex-start" }, hasIcon && /* @__PURE__ */ React.createElement(Icon, { as: icon, color: `icon.toast.${iconVariant}` }), /* @__PURE__ */ React.createElement(VStack, { spacing: 0, alignItems: "flex-start" }, /* @__PURE__ */ React.createElement(Label, { size: "sm" }, title), /* @__PURE__ */ React.createElement(
|
|
8368
|
-
P,
|
|
8369
|
-
{
|
|
8370
|
-
variant: "14",
|
|
8371
|
-
sx: {
|
|
8372
|
-
color: !variant || variant === "ai" ? "text.inverted" : "text.default"
|
|
8373
|
-
}
|
|
8374
|
-
},
|
|
8375
|
-
description
|
|
8376
|
-
)));
|
|
8377
|
-
return /* @__PURE__ */ React.createElement(
|
|
8378
|
-
Tooltip$2,
|
|
8379
|
-
__spreadValues$1l({
|
|
8380
|
-
hasArrow,
|
|
8381
|
-
hasIcon,
|
|
8382
|
-
label: title || description ? TooltipContent : void 0,
|
|
8383
|
-
variant
|
|
8384
|
-
}, rest)
|
|
8385
|
-
);
|
|
8386
|
-
};
|
|
8387
|
-
|
|
8388
8388
|
var __defProp$1k = Object.defineProperty;
|
|
8389
8389
|
var __getOwnPropSymbols$1k = Object.getOwnPropertySymbols;
|
|
8390
8390
|
var __hasOwnProp$1k = Object.prototype.hasOwnProperty;
|