@mantine/dates 4.2.5 → 5.0.0-alpha.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/cjs/components/DatePickerBase/DatePickerBase.js +30 -42
- package/cjs/components/DatePickerBase/DatePickerBase.js.map +1 -1
- package/cjs/components/DatePickerBase/DatePickerBase.styles.js +1 -25
- package/cjs/components/DatePickerBase/DatePickerBase.styles.js.map +1 -1
- package/esm/components/DatePickerBase/DatePickerBase.js +33 -45
- package/esm/components/DatePickerBase/DatePickerBase.js.map +1 -1
- package/esm/components/DatePickerBase/DatePickerBase.styles.js +2 -26
- package/esm/components/DatePickerBase/DatePickerBase.styles.js.map +1 -1
- package/lib/components/DatePickerBase/DatePickerBase.d.ts +2 -4
- package/lib/components/DatePickerBase/DatePickerBase.d.ts.map +1 -1
- package/lib/components/DatePickerBase/DatePickerBase.styles.d.ts +2 -7
- package/lib/components/DatePickerBase/DatePickerBase.styles.d.ts.map +1 -1
- package/lib/components/TimeInput/TimeInput.styles.d.ts +2 -2
- package/package.json +3 -3
|
@@ -63,11 +63,10 @@ const DatePickerBase = React.forwardRef((_a, ref) => {
|
|
|
63
63
|
id,
|
|
64
64
|
description,
|
|
65
65
|
placeholder,
|
|
66
|
-
shadow
|
|
67
|
-
transition = "pop
|
|
68
|
-
transitionDuration =
|
|
66
|
+
shadow,
|
|
67
|
+
transition = "pop",
|
|
68
|
+
transitionDuration = 100,
|
|
69
69
|
transitionTimingFunction,
|
|
70
|
-
closeDropdownOnScroll = false,
|
|
71
70
|
size = "sm",
|
|
72
71
|
children,
|
|
73
72
|
inputLabel,
|
|
@@ -79,7 +78,7 @@ const DatePickerBase = React.forwardRef((_a, ref) => {
|
|
|
79
78
|
clearButtonLabel,
|
|
80
79
|
onClear,
|
|
81
80
|
positionDependencies = [],
|
|
82
|
-
zIndex
|
|
81
|
+
zIndex,
|
|
83
82
|
withinPortal = true,
|
|
84
83
|
onBlur,
|
|
85
84
|
onFocus,
|
|
@@ -95,7 +94,8 @@ const DatePickerBase = React.forwardRef((_a, ref) => {
|
|
|
95
94
|
errorProps,
|
|
96
95
|
labelProps,
|
|
97
96
|
descriptionProps,
|
|
98
|
-
clearButtonTabIndex = 0
|
|
97
|
+
clearButtonTabIndex = 0,
|
|
98
|
+
unstyled
|
|
99
99
|
} = _b, others = __objRest(_b, [
|
|
100
100
|
"classNames",
|
|
101
101
|
"className",
|
|
@@ -113,7 +113,6 @@ const DatePickerBase = React.forwardRef((_a, ref) => {
|
|
|
113
113
|
"transition",
|
|
114
114
|
"transitionDuration",
|
|
115
115
|
"transitionTimingFunction",
|
|
116
|
-
"closeDropdownOnScroll",
|
|
117
116
|
"size",
|
|
118
117
|
"children",
|
|
119
118
|
"inputLabel",
|
|
@@ -141,15 +140,12 @@ const DatePickerBase = React.forwardRef((_a, ref) => {
|
|
|
141
140
|
"errorProps",
|
|
142
141
|
"labelProps",
|
|
143
142
|
"descriptionProps",
|
|
144
|
-
"clearButtonTabIndex"
|
|
143
|
+
"clearButtonTabIndex",
|
|
144
|
+
"unstyled"
|
|
145
145
|
]);
|
|
146
|
-
const { classes, cx, theme } = DatePickerBase_styles['default'](
|
|
146
|
+
const { classes, cx, theme } = DatePickerBase_styles['default'](null, { classNames, styles, name: __staticSelector });
|
|
147
147
|
const { systemStyles, rest } = core.extractSystemStyles(others);
|
|
148
|
-
const [dropdownElement, setDropdownElement] = React.useState(null);
|
|
149
|
-
const [rootElement, setRootElement] = React.useState(null);
|
|
150
|
-
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
151
148
|
const uuid = hooks.useUuid(id);
|
|
152
|
-
const focusTrapRef = hooks.useFocusTrap(!allowFreeInput && dropdownOpened);
|
|
153
149
|
const inputRef = React.useRef();
|
|
154
150
|
const closeDropdown = () => {
|
|
155
151
|
setDropdownOpened(false);
|
|
@@ -172,8 +168,6 @@ const DatePickerBase = React.forwardRef((_a, ref) => {
|
|
|
172
168
|
}, 0);
|
|
173
169
|
}
|
|
174
170
|
};
|
|
175
|
-
hooks.useClickOutside(() => dropdownType === "popover" && !allowFreeInput && closeDropdown(), clickOutsideEvents, [dropdownElement, rootElement]);
|
|
176
|
-
hooks.useWindowEvent("scroll", () => closeDropdownOnScroll && closeDropdown());
|
|
177
171
|
const rightSection = clearable ? /* @__PURE__ */ React__default.createElement(core.CloseButton, {
|
|
178
172
|
variant: "transparent",
|
|
179
173
|
"aria-label": clearButtonLabel,
|
|
@@ -213,13 +207,28 @@ const DatePickerBase = React.forwardRef((_a, ref) => {
|
|
|
213
207
|
size,
|
|
214
208
|
__staticSelector,
|
|
215
209
|
sx,
|
|
216
|
-
ref: setReferenceElement,
|
|
217
210
|
errorProps,
|
|
218
211
|
descriptionProps,
|
|
219
212
|
labelProps
|
|
220
|
-
}, systemStyles), wrapperProps), /* @__PURE__ */ React__default.createElement(
|
|
221
|
-
|
|
222
|
-
|
|
213
|
+
}, systemStyles), wrapperProps), /* @__PURE__ */ React__default.createElement(core.Popover, {
|
|
214
|
+
position: "bottom-start",
|
|
215
|
+
__staticSelector,
|
|
216
|
+
withinPortal,
|
|
217
|
+
offset: 10,
|
|
218
|
+
opened: dropdownOpened,
|
|
219
|
+
transitionDuration,
|
|
220
|
+
transition,
|
|
221
|
+
positionDependencies,
|
|
222
|
+
shadow,
|
|
223
|
+
onClose: closeDropdown,
|
|
224
|
+
trapFocus: !allowFreeInput,
|
|
225
|
+
withRoles: false,
|
|
226
|
+
clickOutsideEvents,
|
|
227
|
+
zIndex,
|
|
228
|
+
classNames,
|
|
229
|
+
styles,
|
|
230
|
+
unstyled
|
|
231
|
+
}, /* @__PURE__ */ React__default.createElement(core.Popover.Target, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
223
232
|
className: classes.wrapper
|
|
224
233
|
}, /* @__PURE__ */ React__default.createElement(core.Input, __spreadValues({
|
|
225
234
|
classNames: __spreadProps(__spreadValues({}, classNames), {
|
|
@@ -244,32 +253,11 @@ const DatePickerBase = React.forwardRef((_a, ref) => {
|
|
|
244
253
|
onFocus: handleInputFocus,
|
|
245
254
|
onChange,
|
|
246
255
|
autoComplete: "off"
|
|
247
|
-
}, rest))), dropdownType === "popover" ? /* @__PURE__ */ React__default.createElement(core.
|
|
248
|
-
referenceElement,
|
|
249
|
-
transitionDuration,
|
|
250
|
-
transitionTimingFunction,
|
|
251
|
-
forceUpdateDependencies: positionDependencies,
|
|
252
|
-
transition,
|
|
253
|
-
mounted: dropdownOpened,
|
|
254
|
-
position: "bottom",
|
|
255
|
-
placement: "start",
|
|
256
|
-
gutter: 10,
|
|
257
|
-
withinPortal,
|
|
258
|
-
withArrow: true,
|
|
259
|
-
arrowSize: 3,
|
|
260
|
-
zIndex,
|
|
261
|
-
arrowClassName: classes.arrow
|
|
262
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
263
|
-
className: classes.dropdownWrapper,
|
|
264
|
-
ref: setDropdownElement,
|
|
256
|
+
}, rest)))), dropdownType === "popover" ? /* @__PURE__ */ React__default.createElement(core.Popover.Dropdown, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
265
257
|
"data-mantine-stop-propagation": dropdownOpened,
|
|
266
258
|
onKeyDownCapture: closeOnEscape,
|
|
267
259
|
"aria-hidden": allowFreeInput || void 0
|
|
268
|
-
}, /* @__PURE__ */ React__default.createElement(core.
|
|
269
|
-
className: classes.dropdown,
|
|
270
|
-
shadow,
|
|
271
|
-
ref: focusTrapRef
|
|
272
|
-
}, children))) : /* @__PURE__ */ React__default.createElement(core.Modal, {
|
|
260
|
+
}, children)) : /* @__PURE__ */ React__default.createElement(core.Modal, {
|
|
273
261
|
opened: dropdownOpened,
|
|
274
262
|
onClose: closeDropdown,
|
|
275
263
|
withCloseButton: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerBase.js","sources":["../../../src/components/DatePickerBase/DatePickerBase.tsx"],"sourcesContent":["import React, { useRef, useState, forwardRef } from 'react';\nimport {\n DefaultProps,\n Input,\n InputWrapper,\n InputBaseProps,\n InputWrapperBaseProps,\n Paper,\n Popper,\n MantineTransition,\n InputStylesNames,\n InputWrapperStylesNames,\n MantineSize,\n Modal,\n CloseButton,\n MantineShadow,\n Selectors,\n extractSystemStyles,\n getDefaultZIndex,\n} from '@mantine/core';\nimport {\n useClickOutside,\n useFocusTrap,\n useMergedRef,\n useWindowEvent,\n useUuid,\n} from '@mantine/hooks';\nimport { CalendarBaseStylesNames } from '../CalendarBase/CalendarBase';\nimport useStyles from './DatePickerBase.styles';\n\nexport type DatePickerStylesNames =\n | Selectors<typeof useStyles>\n | CalendarBaseStylesNames\n | InputStylesNames\n | InputWrapperStylesNames;\n\nexport interface DatePickerBaseSharedProps\n extends InputBaseProps,\n InputWrapperBaseProps,\n DefaultProps<DatePickerStylesNames>,\n Omit<\n React.ComponentPropsWithoutRef<'input'>,\n 'value' | 'defaultValue' | 'placeholder' | 'size'\n > {\n /** Props spread to root element (InputWrapper) */\n wrapperProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Placeholder, displayed when date is not selected */\n placeholder?: string;\n\n /** Dropdown appear/disappear transition */\n transition?: MantineTransition;\n\n /** Dropdown appear/disappear transition duration */\n transitionDuration?: number;\n\n /** Dropdown appear/disappear transition timing function, defaults to theme.transitionTimingFunction */\n transitionTimingFunction?: string;\n\n /** Dropdown shadow from theme or css value for custom box-shadow */\n shadow?: MantineShadow;\n\n /** Input name, useful fon uncontrolled variant to capture data with native form */\n name?: string;\n\n /** Set to true to disable dropdown closing on scroll */\n closeDropdownOnScroll?: boolean;\n\n /** Input size */\n size?: MantineSize;\n\n /** Where to show calendar in modal or popover */\n dropdownType?: 'popover' | 'modal';\n\n /** Allow to clear value */\n clearable?: boolean;\n\n /** aria-label for clear button */\n clearButtonLabel?: string;\n\n /** useEffect dependencies to force update dropdown position */\n positionDependencies?: any[];\n\n /** Popper zIndex */\n zIndex?: number;\n\n /** call onChange with last valid value onBlur */\n fixOnBlur?: boolean;\n\n /** Whether to render the dropdown in a Portal */\n withinPortal?: boolean;\n\n /** Called when dropdown opens */\n onDropdownOpen?(): void;\n\n /** Called when dropdown closes */\n onDropdownClose?(): void;\n\n /** Events that should trigger outside clicks */\n clickOutsideEvents?: string[];\n\n /** Modal z-index */\n modalZIndex?: number;\n\n /** Set the clear button tab index to disabled or default after input field */\n clearButtonTabIndex?: -1 | 0;\n}\n\nexport interface DatePickerBaseProps extends DatePickerBaseSharedProps {\n /** Internal prop to set input label */\n inputLabel?: string;\n\n /** Static css selector base */\n __staticSelector?: string;\n\n /** Controls dropdown opened state */\n dropdownOpened: boolean;\n\n /** Called when dropdown opened state changes */\n setDropdownOpened(opened: boolean): void;\n\n /** Called when clear button in clicked */\n onClear(): void;\n\n /** Allow free input */\n allowFreeInput?: boolean;\n\n /** Amount of months */\n amountOfMonths?: number;\n}\n\nconst RIGHT_SECTION_WIDTH = {\n xs: 24,\n sm: 30,\n md: 34,\n lg: 40,\n xl: 44,\n};\n\nexport const DatePickerBase = forwardRef<HTMLInputElement, DatePickerBaseProps>(\n (\n {\n classNames,\n className,\n style,\n styles,\n wrapperProps,\n required,\n allowFreeInput = false,\n label,\n error,\n id,\n description,\n placeholder,\n shadow = 'sm',\n transition = 'pop-top-left',\n transitionDuration = 200,\n transitionTimingFunction,\n closeDropdownOnScroll = false,\n size = 'sm',\n children,\n inputLabel,\n __staticSelector = 'DatePickerBase',\n dropdownOpened,\n setDropdownOpened,\n dropdownType = 'popover',\n clearable = true,\n clearButtonLabel,\n onClear,\n positionDependencies = [],\n zIndex = getDefaultZIndex('popover'),\n withinPortal = true,\n onBlur,\n onFocus,\n onChange,\n onKeyDown,\n name = 'date',\n sx,\n amountOfMonths = 1,\n onDropdownClose,\n onDropdownOpen,\n clickOutsideEvents = ['mousedown', 'touchstart'],\n modalZIndex,\n errorProps,\n labelProps,\n descriptionProps,\n clearButtonTabIndex = 0,\n ...others\n }: DatePickerBaseProps,\n ref\n ) => {\n const { classes, cx, theme } = useStyles(\n { size, invalid: !!error },\n { classNames, styles, name: __staticSelector }\n );\n const { systemStyles, rest } = extractSystemStyles(others);\n const [dropdownElement, setDropdownElement] = useState<HTMLDivElement>(null);\n const [rootElement, setRootElement] = useState<HTMLDivElement>(null);\n const [referenceElement, setReferenceElement] = useState<HTMLDivElement>(null);\n const uuid = useUuid(id);\n\n const focusTrapRef = useFocusTrap(!allowFreeInput && dropdownOpened);\n const inputRef = useRef<HTMLButtonElement>();\n\n const closeDropdown = () => {\n setDropdownOpened(false);\n onDropdownClose?.();\n };\n\n const openDropdown = () => {\n setDropdownOpened(true);\n onDropdownOpen?.();\n };\n\n const toggleDropdown = () => {\n setDropdownOpened(!dropdownOpened);\n !dropdownOpened ? onDropdownOpen?.() : onDropdownClose?.();\n };\n\n const closeOnEscape = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.nativeEvent.code === 'Escape') {\n closeDropdown();\n window.setTimeout(() => inputRef.current?.focus(), 0);\n }\n };\n\n useClickOutside(\n () => dropdownType === 'popover' && !allowFreeInput && closeDropdown(),\n clickOutsideEvents,\n [dropdownElement, rootElement]\n );\n\n useWindowEvent('scroll', () => closeDropdownOnScroll && closeDropdown());\n\n const rightSection = clearable ? (\n <CloseButton\n variant=\"transparent\"\n aria-label={clearButtonLabel}\n onClick={onClear}\n size={size}\n tabIndex={clearButtonTabIndex}\n />\n ) : null;\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onBlur === 'function' && onBlur(event);\n if (allowFreeInput) {\n closeDropdown();\n }\n };\n\n const handleInputFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event);\n if (allowFreeInput) {\n openDropdown();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n typeof onKeyDown === 'function' && onKeyDown(event);\n if ((event.code === 'Space' || event.code === 'Enter') && !allowFreeInput) {\n event.preventDefault();\n openDropdown();\n }\n };\n\n return (\n <InputWrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n className={className}\n style={style}\n classNames={classNames}\n styles={styles}\n size={size}\n __staticSelector={__staticSelector}\n sx={sx}\n ref={setReferenceElement}\n errorProps={errorProps}\n descriptionProps={descriptionProps}\n labelProps={labelProps}\n {...systemStyles}\n {...wrapperProps}\n >\n <div ref={setRootElement}>\n <div className={classes.wrapper}>\n <Input<'input'>\n classNames={{\n ...classNames,\n input: cx(\n classes.input,\n { [classes.freeInput]: allowFreeInput },\n classNames?.input\n ),\n }}\n styles={styles}\n onClick={() => (!allowFreeInput ? toggleDropdown() : openDropdown())}\n onKeyDown={handleKeyDown}\n id={uuid}\n ref={useMergedRef(ref, inputRef)}\n __staticSelector={__staticSelector}\n size={size}\n name={name}\n placeholder={placeholder}\n value={inputLabel}\n required={required}\n invalid={!!error}\n readOnly={!allowFreeInput}\n rightSection={rightSection}\n rightSectionWidth={theme.fn.size({ size, sizes: RIGHT_SECTION_WIDTH })}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n onChange={onChange}\n autoComplete=\"off\"\n {...rest}\n />\n </div>\n\n {dropdownType === 'popover' ? (\n <Popper\n referenceElement={referenceElement}\n transitionDuration={transitionDuration}\n transitionTimingFunction={transitionTimingFunction}\n forceUpdateDependencies={positionDependencies}\n transition={transition}\n mounted={dropdownOpened}\n position=\"bottom\"\n placement=\"start\"\n gutter={10}\n withinPortal={withinPortal}\n withArrow\n arrowSize={3}\n zIndex={zIndex}\n arrowClassName={classes.arrow}\n >\n <div\n className={classes.dropdownWrapper}\n ref={setDropdownElement}\n data-mantine-stop-propagation={dropdownOpened}\n onKeyDownCapture={closeOnEscape}\n aria-hidden={allowFreeInput || undefined}\n >\n <Paper className={classes.dropdown} shadow={shadow} ref={focusTrapRef}>\n {children}\n </Paper>\n </div>\n </Popper>\n ) : (\n <Modal\n opened={dropdownOpened}\n onClose={closeDropdown}\n withCloseButton={false}\n size={amountOfMonths * 400}\n zIndex={modalZIndex}\n >\n {children}\n </Modal>\n )}\n </div>\n </InputWrapper>\n );\n }\n);\n\nDatePickerBase.displayName = '@mantine/dates/DatePickerBase';\n"],"names":["forwardRef","getDefaultZIndex","useStyles","extractSystemStyles","useState","useUuid","useFocusTrap","useRef","useClickOutside","useWindowEvent","React","CloseButton","InputWrapper","Input","useMergedRef","Popper","Paper","Modal"],"mappings":";;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC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Aa;AACnC,IAAI,aAAa,EAAE,cAAc,IAAI,KAAK,CAAC;AAC3C,GAAG,kBAAkBA,cAAK,CAAC,aAAa,CAACM,UAAK,EAAE;AAChD,IAAI,SAAS,EAAE,OAAO,CAAC,QAAQ;AAC/B,IAAI,MAAM;AACV,IAAI,GAAG,EAAE,YAAY;AACrB,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmBN,cAAK,CAAC,aAAa,CAACO,UAAK,EAAE;AAC9D,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,aAAa;AAC1B,IAAI,eAAe,EAAE,KAAK;AAC1B,IAAI,IAAI,EAAE,cAAc,GAAG,GAAG;AAC9B,IAAI,MAAM,EAAE,WAAW;AACvB,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,EAAE;AACH,cAAc,CAAC,WAAW,GAAG,+BAA+B;;;;"}
|
|
1
|
+
{"version":3,"file":"DatePickerBase.js","sources":["../../../src/components/DatePickerBase/DatePickerBase.tsx"],"sourcesContent":["import React, { useRef, forwardRef } from 'react';\nimport {\n DefaultProps,\n Input,\n InputWrapper,\n InputBaseProps,\n InputWrapperBaseProps,\n MantineTransition,\n InputStylesNames,\n InputWrapperStylesNames,\n MantineSize,\n Modal,\n CloseButton,\n MantineShadow,\n Selectors,\n extractSystemStyles,\n Popover,\n} from '@mantine/core';\nimport { useMergedRef, useUuid } from '@mantine/hooks';\nimport { CalendarBaseStylesNames } from '../CalendarBase/CalendarBase';\nimport useStyles from './DatePickerBase.styles';\n\nexport type DatePickerStylesNames =\n | Selectors<typeof useStyles>\n | CalendarBaseStylesNames\n | InputStylesNames\n | InputWrapperStylesNames\n | 'dropdown';\n\nexport interface DatePickerBaseSharedProps\n extends InputBaseProps,\n InputWrapperBaseProps,\n DefaultProps<DatePickerStylesNames>,\n Omit<\n React.ComponentPropsWithoutRef<'input'>,\n 'value' | 'defaultValue' | 'placeholder' | 'size'\n > {\n /** Props spread to root element (InputWrapper) */\n wrapperProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Placeholder, displayed when date is not selected */\n placeholder?: string;\n\n /** Dropdown appear/disappear transition */\n transition?: MantineTransition;\n\n /** Dropdown appear/disappear transition duration */\n transitionDuration?: number;\n\n /** Dropdown appear/disappear transition timing function, defaults to theme.transitionTimingFunction */\n transitionTimingFunction?: string;\n\n /** Dropdown shadow from theme or css value for custom box-shadow */\n shadow?: MantineShadow;\n\n /** Input name, useful fon uncontrolled variant to capture data with native form */\n name?: string;\n\n /** Input size */\n size?: MantineSize;\n\n /** Where to show calendar in modal or popover */\n dropdownType?: 'popover' | 'modal';\n\n /** Allow to clear value */\n clearable?: boolean;\n\n /** aria-label for clear button */\n clearButtonLabel?: string;\n\n /** useEffect dependencies to force update dropdown position */\n positionDependencies?: any[];\n\n /** Dropdown zIndex */\n zIndex?: number;\n\n /** call onChange with last valid value onBlur */\n fixOnBlur?: boolean;\n\n /** Whether to render the dropdown in a Portal */\n withinPortal?: boolean;\n\n /** Called when dropdown opens */\n onDropdownOpen?(): void;\n\n /** Called when dropdown closes */\n onDropdownClose?(): void;\n\n /** Events that should trigger outside clicks */\n clickOutsideEvents?: string[];\n\n /** Modal z-index */\n modalZIndex?: number;\n\n /** Set the clear button tab index to disabled or default after input field */\n clearButtonTabIndex?: -1 | 0;\n}\n\nexport interface DatePickerBaseProps extends DatePickerBaseSharedProps {\n /** Internal prop to set input label */\n inputLabel?: string;\n\n /** Static css selector base */\n __staticSelector?: string;\n\n /** Controls dropdown opened state */\n dropdownOpened: boolean;\n\n /** Called when dropdown opened state changes */\n setDropdownOpened(opened: boolean): void;\n\n /** Called when clear button in clicked */\n onClear(): void;\n\n /** Allow free input */\n allowFreeInput?: boolean;\n\n /** Amount of months */\n amountOfMonths?: number;\n}\n\nconst RIGHT_SECTION_WIDTH = {\n xs: 24,\n sm: 30,\n md: 34,\n lg: 40,\n xl: 44,\n};\n\nexport const DatePickerBase = forwardRef<HTMLInputElement, DatePickerBaseProps>(\n (\n {\n classNames,\n className,\n style,\n styles,\n wrapperProps,\n required,\n allowFreeInput = false,\n label,\n error,\n id,\n description,\n placeholder,\n shadow,\n transition = 'pop',\n transitionDuration = 100,\n transitionTimingFunction,\n size = 'sm',\n children,\n inputLabel,\n __staticSelector = 'DatePickerBase',\n dropdownOpened,\n setDropdownOpened,\n dropdownType = 'popover',\n clearable = true,\n clearButtonLabel,\n onClear,\n positionDependencies = [],\n zIndex,\n withinPortal = true,\n onBlur,\n onFocus,\n onChange,\n onKeyDown,\n name = 'date',\n sx,\n amountOfMonths = 1,\n onDropdownClose,\n onDropdownOpen,\n clickOutsideEvents = ['mousedown', 'touchstart'],\n modalZIndex,\n errorProps,\n labelProps,\n descriptionProps,\n clearButtonTabIndex = 0,\n unstyled,\n ...others\n }: DatePickerBaseProps,\n ref\n ) => {\n const { classes, cx, theme } = useStyles(null, { classNames, styles, name: __staticSelector });\n const { systemStyles, rest } = extractSystemStyles(others);\n const uuid = useUuid(id);\n const inputRef = useRef<HTMLButtonElement>();\n\n const closeDropdown = () => {\n setDropdownOpened(false);\n onDropdownClose?.();\n };\n\n const openDropdown = () => {\n setDropdownOpened(true);\n onDropdownOpen?.();\n };\n\n const toggleDropdown = () => {\n setDropdownOpened(!dropdownOpened);\n !dropdownOpened ? onDropdownOpen?.() : onDropdownClose?.();\n };\n\n const closeOnEscape = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.nativeEvent.code === 'Escape') {\n closeDropdown();\n window.setTimeout(() => inputRef.current?.focus(), 0);\n }\n };\n\n const rightSection = clearable ? (\n <CloseButton\n variant=\"transparent\"\n aria-label={clearButtonLabel}\n onClick={onClear}\n size={size}\n tabIndex={clearButtonTabIndex}\n />\n ) : null;\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onBlur === 'function' && onBlur(event);\n if (allowFreeInput) {\n closeDropdown();\n }\n };\n\n const handleInputFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event);\n if (allowFreeInput) {\n openDropdown();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n typeof onKeyDown === 'function' && onKeyDown(event);\n if ((event.code === 'Space' || event.code === 'Enter') && !allowFreeInput) {\n event.preventDefault();\n openDropdown();\n }\n };\n\n return (\n <InputWrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n className={className}\n style={style}\n classNames={classNames}\n styles={styles}\n size={size}\n __staticSelector={__staticSelector}\n sx={sx}\n errorProps={errorProps}\n descriptionProps={descriptionProps}\n labelProps={labelProps}\n {...systemStyles}\n {...wrapperProps}\n >\n <Popover\n position=\"bottom-start\"\n __staticSelector={__staticSelector}\n withinPortal={withinPortal}\n offset={10}\n opened={dropdownOpened}\n transitionDuration={transitionDuration}\n transition={transition}\n positionDependencies={positionDependencies}\n shadow={shadow}\n onClose={closeDropdown}\n trapFocus={!allowFreeInput}\n withRoles={false}\n clickOutsideEvents={clickOutsideEvents}\n zIndex={zIndex}\n classNames={classNames}\n styles={styles}\n unstyled={unstyled}\n >\n <Popover.Target>\n <div className={classes.wrapper}>\n <Input<'input'>\n classNames={{\n ...classNames,\n input: cx(\n classes.input,\n { [classes.freeInput]: allowFreeInput },\n classNames?.input\n ),\n }}\n styles={styles}\n onClick={() => (!allowFreeInput ? toggleDropdown() : openDropdown())}\n onKeyDown={handleKeyDown}\n id={uuid}\n ref={useMergedRef(ref, inputRef)}\n __staticSelector={__staticSelector}\n size={size}\n name={name}\n placeholder={placeholder}\n value={inputLabel}\n required={required}\n invalid={!!error}\n readOnly={!allowFreeInput}\n rightSection={rightSection}\n rightSectionWidth={theme.fn.size({ size, sizes: RIGHT_SECTION_WIDTH })}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n onChange={onChange}\n autoComplete=\"off\"\n {...rest}\n />\n </div>\n </Popover.Target>\n\n {dropdownType === 'popover' ? (\n <Popover.Dropdown>\n <div\n data-mantine-stop-propagation={dropdownOpened}\n onKeyDownCapture={closeOnEscape}\n aria-hidden={allowFreeInput || undefined}\n >\n {children}\n </div>\n </Popover.Dropdown>\n ) : (\n <Modal\n opened={dropdownOpened}\n onClose={closeDropdown}\n withCloseButton={false}\n size={amountOfMonths * 400}\n zIndex={modalZIndex}\n >\n {children}\n </Modal>\n )}\n </Popover>\n </InputWrapper>\n );\n }\n);\n\nDatePickerBase.displayName = '@mantine/dates/DatePickerBase';\n"],"names":["forwardRef","useStyles","extractSystemStyles","useUuid","useRef","React","CloseButton","InputWrapper","Popover","Input","useMergedRef","Modal"],"mappings":";;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,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Styles((theme,
|
|
26
|
+
var useStyles = core.createStyles((theme, _params, getRef) => ({
|
|
27
27
|
wrapper: __spreadProps(__spreadValues({}, theme.fn.fontStyles()), {
|
|
28
28
|
position: "relative",
|
|
29
29
|
cursor: "pointer"
|
|
30
30
|
}),
|
|
31
|
-
placeholder: {
|
|
32
|
-
lineHeight: `${theme.fn.size({ size, sizes: core.INPUT_SIZES }) - 2}px`,
|
|
33
|
-
whiteSpace: "nowrap",
|
|
34
|
-
overflow: "hidden",
|
|
35
|
-
textOverflow: "ellipsis",
|
|
36
|
-
color: invalid ? theme.colors.red[theme.colorScheme === "dark" ? 6 : 7] : theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[5]
|
|
37
|
-
},
|
|
38
|
-
value: {
|
|
39
|
-
overflow: "hidden",
|
|
40
|
-
textOverflow: "ellipsis"
|
|
41
|
-
},
|
|
42
|
-
dropdownWrapper: {
|
|
43
|
-
position: "relative",
|
|
44
|
-
pointerEvents: "all"
|
|
45
|
-
},
|
|
46
31
|
input: {
|
|
47
32
|
cursor: "pointer",
|
|
48
33
|
whiteSpace: "nowrap",
|
|
@@ -53,15 +38,6 @@ var useStyles = core.createStyles((theme, { size, invalid }, getRef) => ({
|
|
|
53
38
|
freeInput: {
|
|
54
39
|
ref: getRef("freeInput"),
|
|
55
40
|
cursor: "text"
|
|
56
|
-
},
|
|
57
|
-
dropdown: {
|
|
58
|
-
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.white,
|
|
59
|
-
border: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[2]}`,
|
|
60
|
-
padding: `${theme.spacing.md}px ${theme.spacing.xs}px`
|
|
61
|
-
},
|
|
62
|
-
arrow: {
|
|
63
|
-
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[2],
|
|
64
|
-
background: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.white
|
|
65
41
|
}
|
|
66
42
|
}));
|
|
67
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerBase.styles.js","sources":["../../../src/components/DatePickerBase/DatePickerBase.styles.ts"],"sourcesContent":["import { createStyles
|
|
1
|
+
{"version":3,"file":"DatePickerBase.styles.js","sources":["../../../src/components/DatePickerBase/DatePickerBase.styles.ts"],"sourcesContent":["import { createStyles } from '@mantine/core';\n\nexport default createStyles((theme, _params, getRef) => ({\n wrapper: {\n ...theme.fn.fontStyles(),\n position: 'relative',\n cursor: 'pointer',\n },\n\n input: {\n cursor: 'pointer',\n whiteSpace: 'nowrap',\n\n [`&:not(.${getRef('freeInput')})::selection`]: {\n backgroundColor: 'transparent',\n },\n },\n\n freeInput: {\n ref: getRef('freeInput'),\n cursor: 'text',\n },\n}));\n"],"names":["createStyles"],"mappings":";;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAA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|
1
|
-
import React, { forwardRef,
|
|
2
|
-
import {
|
|
3
|
-
import { useUuid,
|
|
1
|
+
import React, { forwardRef, useRef } from 'react';
|
|
2
|
+
import { extractSystemStyles, InputWrapper, Popover, Input, Modal, CloseButton } from '@mantine/core';
|
|
3
|
+
import { useUuid, useMergedRef } from '@mantine/hooks';
|
|
4
4
|
import useStyles from './DatePickerBase.styles.js';
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
@@ -55,11 +55,10 @@ const DatePickerBase = forwardRef((_a, ref) => {
|
|
|
55
55
|
id,
|
|
56
56
|
description,
|
|
57
57
|
placeholder,
|
|
58
|
-
shadow
|
|
59
|
-
transition = "pop
|
|
60
|
-
transitionDuration =
|
|
58
|
+
shadow,
|
|
59
|
+
transition = "pop",
|
|
60
|
+
transitionDuration = 100,
|
|
61
61
|
transitionTimingFunction,
|
|
62
|
-
closeDropdownOnScroll = false,
|
|
63
62
|
size = "sm",
|
|
64
63
|
children,
|
|
65
64
|
inputLabel,
|
|
@@ -71,7 +70,7 @@ const DatePickerBase = forwardRef((_a, ref) => {
|
|
|
71
70
|
clearButtonLabel,
|
|
72
71
|
onClear,
|
|
73
72
|
positionDependencies = [],
|
|
74
|
-
zIndex
|
|
73
|
+
zIndex,
|
|
75
74
|
withinPortal = true,
|
|
76
75
|
onBlur,
|
|
77
76
|
onFocus,
|
|
@@ -87,7 +86,8 @@ const DatePickerBase = forwardRef((_a, ref) => {
|
|
|
87
86
|
errorProps,
|
|
88
87
|
labelProps,
|
|
89
88
|
descriptionProps,
|
|
90
|
-
clearButtonTabIndex = 0
|
|
89
|
+
clearButtonTabIndex = 0,
|
|
90
|
+
unstyled
|
|
91
91
|
} = _b, others = __objRest(_b, [
|
|
92
92
|
"classNames",
|
|
93
93
|
"className",
|
|
@@ -105,7 +105,6 @@ const DatePickerBase = forwardRef((_a, ref) => {
|
|
|
105
105
|
"transition",
|
|
106
106
|
"transitionDuration",
|
|
107
107
|
"transitionTimingFunction",
|
|
108
|
-
"closeDropdownOnScroll",
|
|
109
108
|
"size",
|
|
110
109
|
"children",
|
|
111
110
|
"inputLabel",
|
|
@@ -133,15 +132,12 @@ const DatePickerBase = forwardRef((_a, ref) => {
|
|
|
133
132
|
"errorProps",
|
|
134
133
|
"labelProps",
|
|
135
134
|
"descriptionProps",
|
|
136
|
-
"clearButtonTabIndex"
|
|
135
|
+
"clearButtonTabIndex",
|
|
136
|
+
"unstyled"
|
|
137
137
|
]);
|
|
138
|
-
const { classes, cx, theme } = useStyles(
|
|
138
|
+
const { classes, cx, theme } = useStyles(null, { classNames, styles, name: __staticSelector });
|
|
139
139
|
const { systemStyles, rest } = extractSystemStyles(others);
|
|
140
|
-
const [dropdownElement, setDropdownElement] = useState(null);
|
|
141
|
-
const [rootElement, setRootElement] = useState(null);
|
|
142
|
-
const [referenceElement, setReferenceElement] = useState(null);
|
|
143
140
|
const uuid = useUuid(id);
|
|
144
|
-
const focusTrapRef = useFocusTrap(!allowFreeInput && dropdownOpened);
|
|
145
141
|
const inputRef = useRef();
|
|
146
142
|
const closeDropdown = () => {
|
|
147
143
|
setDropdownOpened(false);
|
|
@@ -164,8 +160,6 @@ const DatePickerBase = forwardRef((_a, ref) => {
|
|
|
164
160
|
}, 0);
|
|
165
161
|
}
|
|
166
162
|
};
|
|
167
|
-
useClickOutside(() => dropdownType === "popover" && !allowFreeInput && closeDropdown(), clickOutsideEvents, [dropdownElement, rootElement]);
|
|
168
|
-
useWindowEvent("scroll", () => closeDropdownOnScroll && closeDropdown());
|
|
169
163
|
const rightSection = clearable ? /* @__PURE__ */ React.createElement(CloseButton, {
|
|
170
164
|
variant: "transparent",
|
|
171
165
|
"aria-label": clearButtonLabel,
|
|
@@ -205,13 +199,28 @@ const DatePickerBase = forwardRef((_a, ref) => {
|
|
|
205
199
|
size,
|
|
206
200
|
__staticSelector,
|
|
207
201
|
sx,
|
|
208
|
-
ref: setReferenceElement,
|
|
209
202
|
errorProps,
|
|
210
203
|
descriptionProps,
|
|
211
204
|
labelProps
|
|
212
|
-
}, systemStyles), wrapperProps), /* @__PURE__ */ React.createElement(
|
|
213
|
-
|
|
214
|
-
|
|
205
|
+
}, systemStyles), wrapperProps), /* @__PURE__ */ React.createElement(Popover, {
|
|
206
|
+
position: "bottom-start",
|
|
207
|
+
__staticSelector,
|
|
208
|
+
withinPortal,
|
|
209
|
+
offset: 10,
|
|
210
|
+
opened: dropdownOpened,
|
|
211
|
+
transitionDuration,
|
|
212
|
+
transition,
|
|
213
|
+
positionDependencies,
|
|
214
|
+
shadow,
|
|
215
|
+
onClose: closeDropdown,
|
|
216
|
+
trapFocus: !allowFreeInput,
|
|
217
|
+
withRoles: false,
|
|
218
|
+
clickOutsideEvents,
|
|
219
|
+
zIndex,
|
|
220
|
+
classNames,
|
|
221
|
+
styles,
|
|
222
|
+
unstyled
|
|
223
|
+
}, /* @__PURE__ */ React.createElement(Popover.Target, null, /* @__PURE__ */ React.createElement("div", {
|
|
215
224
|
className: classes.wrapper
|
|
216
225
|
}, /* @__PURE__ */ React.createElement(Input, __spreadValues({
|
|
217
226
|
classNames: __spreadProps(__spreadValues({}, classNames), {
|
|
@@ -236,32 +245,11 @@ const DatePickerBase = forwardRef((_a, ref) => {
|
|
|
236
245
|
onFocus: handleInputFocus,
|
|
237
246
|
onChange,
|
|
238
247
|
autoComplete: "off"
|
|
239
|
-
}, rest))), dropdownType === "popover" ? /* @__PURE__ */ React.createElement(
|
|
240
|
-
referenceElement,
|
|
241
|
-
transitionDuration,
|
|
242
|
-
transitionTimingFunction,
|
|
243
|
-
forceUpdateDependencies: positionDependencies,
|
|
244
|
-
transition,
|
|
245
|
-
mounted: dropdownOpened,
|
|
246
|
-
position: "bottom",
|
|
247
|
-
placement: "start",
|
|
248
|
-
gutter: 10,
|
|
249
|
-
withinPortal,
|
|
250
|
-
withArrow: true,
|
|
251
|
-
arrowSize: 3,
|
|
252
|
-
zIndex,
|
|
253
|
-
arrowClassName: classes.arrow
|
|
254
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
255
|
-
className: classes.dropdownWrapper,
|
|
256
|
-
ref: setDropdownElement,
|
|
248
|
+
}, rest)))), dropdownType === "popover" ? /* @__PURE__ */ React.createElement(Popover.Dropdown, null, /* @__PURE__ */ React.createElement("div", {
|
|
257
249
|
"data-mantine-stop-propagation": dropdownOpened,
|
|
258
250
|
onKeyDownCapture: closeOnEscape,
|
|
259
251
|
"aria-hidden": allowFreeInput || void 0
|
|
260
|
-
}, /* @__PURE__ */ React.createElement(
|
|
261
|
-
className: classes.dropdown,
|
|
262
|
-
shadow,
|
|
263
|
-
ref: focusTrapRef
|
|
264
|
-
}, children))) : /* @__PURE__ */ React.createElement(Modal, {
|
|
252
|
+
}, children)) : /* @__PURE__ */ React.createElement(Modal, {
|
|
265
253
|
opened: dropdownOpened,
|
|
266
254
|
onClose: closeDropdown,
|
|
267
255
|
withCloseButton: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerBase.js","sources":["../../../src/components/DatePickerBase/DatePickerBase.tsx"],"sourcesContent":["import React, { useRef, useState, forwardRef } from 'react';\nimport {\n DefaultProps,\n Input,\n InputWrapper,\n InputBaseProps,\n InputWrapperBaseProps,\n Paper,\n Popper,\n MantineTransition,\n InputStylesNames,\n InputWrapperStylesNames,\n MantineSize,\n Modal,\n CloseButton,\n MantineShadow,\n Selectors,\n extractSystemStyles,\n getDefaultZIndex,\n} from '@mantine/core';\nimport {\n useClickOutside,\n useFocusTrap,\n useMergedRef,\n useWindowEvent,\n useUuid,\n} from '@mantine/hooks';\nimport { CalendarBaseStylesNames } from '../CalendarBase/CalendarBase';\nimport useStyles from './DatePickerBase.styles';\n\nexport type DatePickerStylesNames =\n | Selectors<typeof useStyles>\n | CalendarBaseStylesNames\n | InputStylesNames\n | InputWrapperStylesNames;\n\nexport interface DatePickerBaseSharedProps\n extends InputBaseProps,\n InputWrapperBaseProps,\n DefaultProps<DatePickerStylesNames>,\n Omit<\n React.ComponentPropsWithoutRef<'input'>,\n 'value' | 'defaultValue' | 'placeholder' | 'size'\n > {\n /** Props spread to root element (InputWrapper) */\n wrapperProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Placeholder, displayed when date is not selected */\n placeholder?: string;\n\n /** Dropdown appear/disappear transition */\n transition?: MantineTransition;\n\n /** Dropdown appear/disappear transition duration */\n transitionDuration?: number;\n\n /** Dropdown appear/disappear transition timing function, defaults to theme.transitionTimingFunction */\n transitionTimingFunction?: string;\n\n /** Dropdown shadow from theme or css value for custom box-shadow */\n shadow?: MantineShadow;\n\n /** Input name, useful fon uncontrolled variant to capture data with native form */\n name?: string;\n\n /** Set to true to disable dropdown closing on scroll */\n closeDropdownOnScroll?: boolean;\n\n /** Input size */\n size?: MantineSize;\n\n /** Where to show calendar in modal or popover */\n dropdownType?: 'popover' | 'modal';\n\n /** Allow to clear value */\n clearable?: boolean;\n\n /** aria-label for clear button */\n clearButtonLabel?: string;\n\n /** useEffect dependencies to force update dropdown position */\n positionDependencies?: any[];\n\n /** Popper zIndex */\n zIndex?: number;\n\n /** call onChange with last valid value onBlur */\n fixOnBlur?: boolean;\n\n /** Whether to render the dropdown in a Portal */\n withinPortal?: boolean;\n\n /** Called when dropdown opens */\n onDropdownOpen?(): void;\n\n /** Called when dropdown closes */\n onDropdownClose?(): void;\n\n /** Events that should trigger outside clicks */\n clickOutsideEvents?: string[];\n\n /** Modal z-index */\n modalZIndex?: number;\n\n /** Set the clear button tab index to disabled or default after input field */\n clearButtonTabIndex?: -1 | 0;\n}\n\nexport interface DatePickerBaseProps extends DatePickerBaseSharedProps {\n /** Internal prop to set input label */\n inputLabel?: string;\n\n /** Static css selector base */\n __staticSelector?: string;\n\n /** Controls dropdown opened state */\n dropdownOpened: boolean;\n\n /** Called when dropdown opened state changes */\n setDropdownOpened(opened: boolean): void;\n\n /** Called when clear button in clicked */\n onClear(): void;\n\n /** Allow free input */\n allowFreeInput?: boolean;\n\n /** Amount of months */\n amountOfMonths?: number;\n}\n\nconst RIGHT_SECTION_WIDTH = {\n xs: 24,\n sm: 30,\n md: 34,\n lg: 40,\n xl: 44,\n};\n\nexport const DatePickerBase = forwardRef<HTMLInputElement, DatePickerBaseProps>(\n (\n {\n classNames,\n className,\n style,\n styles,\n wrapperProps,\n required,\n allowFreeInput = false,\n label,\n error,\n id,\n description,\n placeholder,\n shadow = 'sm',\n transition = 'pop-top-left',\n transitionDuration = 200,\n transitionTimingFunction,\n closeDropdownOnScroll = false,\n size = 'sm',\n children,\n inputLabel,\n __staticSelector = 'DatePickerBase',\n dropdownOpened,\n setDropdownOpened,\n dropdownType = 'popover',\n clearable = true,\n clearButtonLabel,\n onClear,\n positionDependencies = [],\n zIndex = getDefaultZIndex('popover'),\n withinPortal = true,\n onBlur,\n onFocus,\n onChange,\n onKeyDown,\n name = 'date',\n sx,\n amountOfMonths = 1,\n onDropdownClose,\n onDropdownOpen,\n clickOutsideEvents = ['mousedown', 'touchstart'],\n modalZIndex,\n errorProps,\n labelProps,\n descriptionProps,\n clearButtonTabIndex = 0,\n ...others\n }: DatePickerBaseProps,\n ref\n ) => {\n const { classes, cx, theme } = useStyles(\n { size, invalid: !!error },\n { classNames, styles, name: __staticSelector }\n );\n const { systemStyles, rest } = extractSystemStyles(others);\n const [dropdownElement, setDropdownElement] = useState<HTMLDivElement>(null);\n const [rootElement, setRootElement] = useState<HTMLDivElement>(null);\n const [referenceElement, setReferenceElement] = useState<HTMLDivElement>(null);\n const uuid = useUuid(id);\n\n const focusTrapRef = useFocusTrap(!allowFreeInput && dropdownOpened);\n const inputRef = useRef<HTMLButtonElement>();\n\n const closeDropdown = () => {\n setDropdownOpened(false);\n onDropdownClose?.();\n };\n\n const openDropdown = () => {\n setDropdownOpened(true);\n onDropdownOpen?.();\n };\n\n const toggleDropdown = () => {\n setDropdownOpened(!dropdownOpened);\n !dropdownOpened ? onDropdownOpen?.() : onDropdownClose?.();\n };\n\n const closeOnEscape = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.nativeEvent.code === 'Escape') {\n closeDropdown();\n window.setTimeout(() => inputRef.current?.focus(), 0);\n }\n };\n\n useClickOutside(\n () => dropdownType === 'popover' && !allowFreeInput && closeDropdown(),\n clickOutsideEvents,\n [dropdownElement, rootElement]\n );\n\n useWindowEvent('scroll', () => closeDropdownOnScroll && closeDropdown());\n\n const rightSection = clearable ? (\n <CloseButton\n variant=\"transparent\"\n aria-label={clearButtonLabel}\n onClick={onClear}\n size={size}\n tabIndex={clearButtonTabIndex}\n />\n ) : null;\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onBlur === 'function' && onBlur(event);\n if (allowFreeInput) {\n closeDropdown();\n }\n };\n\n const handleInputFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event);\n if (allowFreeInput) {\n openDropdown();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n typeof onKeyDown === 'function' && onKeyDown(event);\n if ((event.code === 'Space' || event.code === 'Enter') && !allowFreeInput) {\n event.preventDefault();\n openDropdown();\n }\n };\n\n return (\n <InputWrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n className={className}\n style={style}\n classNames={classNames}\n styles={styles}\n size={size}\n __staticSelector={__staticSelector}\n sx={sx}\n ref={setReferenceElement}\n errorProps={errorProps}\n descriptionProps={descriptionProps}\n labelProps={labelProps}\n {...systemStyles}\n {...wrapperProps}\n >\n <div ref={setRootElement}>\n <div className={classes.wrapper}>\n <Input<'input'>\n classNames={{\n ...classNames,\n input: cx(\n classes.input,\n { [classes.freeInput]: allowFreeInput },\n classNames?.input\n ),\n }}\n styles={styles}\n onClick={() => (!allowFreeInput ? toggleDropdown() : openDropdown())}\n onKeyDown={handleKeyDown}\n id={uuid}\n ref={useMergedRef(ref, inputRef)}\n __staticSelector={__staticSelector}\n size={size}\n name={name}\n placeholder={placeholder}\n value={inputLabel}\n required={required}\n invalid={!!error}\n readOnly={!allowFreeInput}\n rightSection={rightSection}\n rightSectionWidth={theme.fn.size({ size, sizes: RIGHT_SECTION_WIDTH })}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n onChange={onChange}\n autoComplete=\"off\"\n {...rest}\n />\n </div>\n\n {dropdownType === 'popover' ? (\n <Popper\n referenceElement={referenceElement}\n transitionDuration={transitionDuration}\n transitionTimingFunction={transitionTimingFunction}\n forceUpdateDependencies={positionDependencies}\n transition={transition}\n mounted={dropdownOpened}\n position=\"bottom\"\n placement=\"start\"\n gutter={10}\n withinPortal={withinPortal}\n withArrow\n arrowSize={3}\n zIndex={zIndex}\n arrowClassName={classes.arrow}\n >\n <div\n className={classes.dropdownWrapper}\n ref={setDropdownElement}\n data-mantine-stop-propagation={dropdownOpened}\n onKeyDownCapture={closeOnEscape}\n aria-hidden={allowFreeInput || undefined}\n >\n <Paper className={classes.dropdown} shadow={shadow} ref={focusTrapRef}>\n {children}\n </Paper>\n </div>\n </Popper>\n ) : (\n <Modal\n opened={dropdownOpened}\n onClose={closeDropdown}\n withCloseButton={false}\n size={amountOfMonths * 400}\n zIndex={modalZIndex}\n >\n {children}\n </Modal>\n )}\n </div>\n </InputWrapper>\n );\n }\n);\n\nDatePickerBase.displayName = '@mantine/dates/DatePickerBase';\n"],"names":[],"mappings":";;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,G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BAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,wBAAwB;AAC5B,IAAI,uBAAuB,EAAE,oBAAoB;AACjD,IAAI,UAAU;AACd,IAAI,OAAO,EAAE,cAAc;AAC3B,IAAI,QAAQ,EAAE,QAAQ;AACtB,IAAI,SAAS,EAAE,OAAO;AACtB,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,YAAY;AAChB,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,SAAS,EAAE,CAAC;AAChB,IAAI,MAAM;AACV,IAAI,cAAc,EAAE,OAAO,CAAC,KAAK;AACjC,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AAChD,IAAI,SAAS,EAAE,OAAO,CAAC,eAAe;AACtC,IAAI,GAAG,EAAE,kBAAkB;AAC3B,IAAI,+BAA+B,EAAE,cAAc;AACnD,IAAI,gBAAgB,EAAE,aAAa;AACnC,IAAI,aAAa,EAAE,cAAc,IAAI,KAAK,CAAC;AAC3C,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AAChD,IAAI,SAAS,EAAE,OAAO,CAAC,QAAQ;AAC/B,IAAI,MAAM;AACV,IAAI,GAAG,EAAE,YAAY;AACrB,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AAC9D,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,aAAa;AAC1B,IAAI,eAAe,EAAE,KAAK;AAC1B,IAAI,IAAI,EAAE,cAAc,GAAG,GAAG;AAC9B,IAAI,MAAM,EAAE,WAAW;AACvB,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,EAAE;AACH,cAAc,CAAC,WAAW,GAAG,+BAA+B;;;;"}
|
|
1
|
+
{"version":3,"file":"DatePickerBase.js","sources":["../../../src/components/DatePickerBase/DatePickerBase.tsx"],"sourcesContent":["import React, { useRef, forwardRef } from 'react';\nimport {\n DefaultProps,\n Input,\n InputWrapper,\n InputBaseProps,\n InputWrapperBaseProps,\n MantineTransition,\n InputStylesNames,\n InputWrapperStylesNames,\n MantineSize,\n Modal,\n CloseButton,\n MantineShadow,\n Selectors,\n extractSystemStyles,\n Popover,\n} from '@mantine/core';\nimport { useMergedRef, useUuid } from '@mantine/hooks';\nimport { CalendarBaseStylesNames } from '../CalendarBase/CalendarBase';\nimport useStyles from './DatePickerBase.styles';\n\nexport type DatePickerStylesNames =\n | Selectors<typeof useStyles>\n | CalendarBaseStylesNames\n | InputStylesNames\n | InputWrapperStylesNames\n | 'dropdown';\n\nexport interface DatePickerBaseSharedProps\n extends InputBaseProps,\n InputWrapperBaseProps,\n DefaultProps<DatePickerStylesNames>,\n Omit<\n React.ComponentPropsWithoutRef<'input'>,\n 'value' | 'defaultValue' | 'placeholder' | 'size'\n > {\n /** Props spread to root element (InputWrapper) */\n wrapperProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Placeholder, displayed when date is not selected */\n placeholder?: string;\n\n /** Dropdown appear/disappear transition */\n transition?: MantineTransition;\n\n /** Dropdown appear/disappear transition duration */\n transitionDuration?: number;\n\n /** Dropdown appear/disappear transition timing function, defaults to theme.transitionTimingFunction */\n transitionTimingFunction?: string;\n\n /** Dropdown shadow from theme or css value for custom box-shadow */\n shadow?: MantineShadow;\n\n /** Input name, useful fon uncontrolled variant to capture data with native form */\n name?: string;\n\n /** Input size */\n size?: MantineSize;\n\n /** Where to show calendar in modal or popover */\n dropdownType?: 'popover' | 'modal';\n\n /** Allow to clear value */\n clearable?: boolean;\n\n /** aria-label for clear button */\n clearButtonLabel?: string;\n\n /** useEffect dependencies to force update dropdown position */\n positionDependencies?: any[];\n\n /** Dropdown zIndex */\n zIndex?: number;\n\n /** call onChange with last valid value onBlur */\n fixOnBlur?: boolean;\n\n /** Whether to render the dropdown in a Portal */\n withinPortal?: boolean;\n\n /** Called when dropdown opens */\n onDropdownOpen?(): void;\n\n /** Called when dropdown closes */\n onDropdownClose?(): void;\n\n /** Events that should trigger outside clicks */\n clickOutsideEvents?: string[];\n\n /** Modal z-index */\n modalZIndex?: number;\n\n /** Set the clear button tab index to disabled or default after input field */\n clearButtonTabIndex?: -1 | 0;\n}\n\nexport interface DatePickerBaseProps extends DatePickerBaseSharedProps {\n /** Internal prop to set input label */\n inputLabel?: string;\n\n /** Static css selector base */\n __staticSelector?: string;\n\n /** Controls dropdown opened state */\n dropdownOpened: boolean;\n\n /** Called when dropdown opened state changes */\n setDropdownOpened(opened: boolean): void;\n\n /** Called when clear button in clicked */\n onClear(): void;\n\n /** Allow free input */\n allowFreeInput?: boolean;\n\n /** Amount of months */\n amountOfMonths?: number;\n}\n\nconst RIGHT_SECTION_WIDTH = {\n xs: 24,\n sm: 30,\n md: 34,\n lg: 40,\n xl: 44,\n};\n\nexport const DatePickerBase = forwardRef<HTMLInputElement, DatePickerBaseProps>(\n (\n {\n classNames,\n className,\n style,\n styles,\n wrapperProps,\n required,\n allowFreeInput = false,\n label,\n error,\n id,\n description,\n placeholder,\n shadow,\n transition = 'pop',\n transitionDuration = 100,\n transitionTimingFunction,\n size = 'sm',\n children,\n inputLabel,\n __staticSelector = 'DatePickerBase',\n dropdownOpened,\n setDropdownOpened,\n dropdownType = 'popover',\n clearable = true,\n clearButtonLabel,\n onClear,\n positionDependencies = [],\n zIndex,\n withinPortal = true,\n onBlur,\n onFocus,\n onChange,\n onKeyDown,\n name = 'date',\n sx,\n amountOfMonths = 1,\n onDropdownClose,\n onDropdownOpen,\n clickOutsideEvents = ['mousedown', 'touchstart'],\n modalZIndex,\n errorProps,\n labelProps,\n descriptionProps,\n clearButtonTabIndex = 0,\n unstyled,\n ...others\n }: DatePickerBaseProps,\n ref\n ) => {\n const { classes, cx, theme } = useStyles(null, { classNames, styles, name: __staticSelector });\n const { systemStyles, rest } = extractSystemStyles(others);\n const uuid = useUuid(id);\n const inputRef = useRef<HTMLButtonElement>();\n\n const closeDropdown = () => {\n setDropdownOpened(false);\n onDropdownClose?.();\n };\n\n const openDropdown = () => {\n setDropdownOpened(true);\n onDropdownOpen?.();\n };\n\n const toggleDropdown = () => {\n setDropdownOpened(!dropdownOpened);\n !dropdownOpened ? onDropdownOpen?.() : onDropdownClose?.();\n };\n\n const closeOnEscape = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.nativeEvent.code === 'Escape') {\n closeDropdown();\n window.setTimeout(() => inputRef.current?.focus(), 0);\n }\n };\n\n const rightSection = clearable ? (\n <CloseButton\n variant=\"transparent\"\n aria-label={clearButtonLabel}\n onClick={onClear}\n size={size}\n tabIndex={clearButtonTabIndex}\n />\n ) : null;\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onBlur === 'function' && onBlur(event);\n if (allowFreeInput) {\n closeDropdown();\n }\n };\n\n const handleInputFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n typeof onFocus === 'function' && onFocus(event);\n if (allowFreeInput) {\n openDropdown();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n typeof onKeyDown === 'function' && onKeyDown(event);\n if ((event.code === 'Space' || event.code === 'Enter') && !allowFreeInput) {\n event.preventDefault();\n openDropdown();\n }\n };\n\n return (\n <InputWrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n className={className}\n style={style}\n classNames={classNames}\n styles={styles}\n size={size}\n __staticSelector={__staticSelector}\n sx={sx}\n errorProps={errorProps}\n descriptionProps={descriptionProps}\n labelProps={labelProps}\n {...systemStyles}\n {...wrapperProps}\n >\n <Popover\n position=\"bottom-start\"\n __staticSelector={__staticSelector}\n withinPortal={withinPortal}\n offset={10}\n opened={dropdownOpened}\n transitionDuration={transitionDuration}\n transition={transition}\n positionDependencies={positionDependencies}\n shadow={shadow}\n onClose={closeDropdown}\n trapFocus={!allowFreeInput}\n withRoles={false}\n clickOutsideEvents={clickOutsideEvents}\n zIndex={zIndex}\n classNames={classNames}\n styles={styles}\n unstyled={unstyled}\n >\n <Popover.Target>\n <div className={classes.wrapper}>\n <Input<'input'>\n classNames={{\n ...classNames,\n input: cx(\n classes.input,\n { [classes.freeInput]: allowFreeInput },\n classNames?.input\n ),\n }}\n styles={styles}\n onClick={() => (!allowFreeInput ? toggleDropdown() : openDropdown())}\n onKeyDown={handleKeyDown}\n id={uuid}\n ref={useMergedRef(ref, inputRef)}\n __staticSelector={__staticSelector}\n size={size}\n name={name}\n placeholder={placeholder}\n value={inputLabel}\n required={required}\n invalid={!!error}\n readOnly={!allowFreeInput}\n rightSection={rightSection}\n rightSectionWidth={theme.fn.size({ size, sizes: RIGHT_SECTION_WIDTH })}\n onBlur={handleInputBlur}\n onFocus={handleInputFocus}\n onChange={onChange}\n autoComplete=\"off\"\n {...rest}\n />\n </div>\n </Popover.Target>\n\n {dropdownType === 'popover' ? (\n <Popover.Dropdown>\n <div\n data-mantine-stop-propagation={dropdownOpened}\n onKeyDownCapture={closeOnEscape}\n aria-hidden={allowFreeInput || undefined}\n >\n {children}\n </div>\n </Popover.Dropdown>\n ) : (\n <Modal\n opened={dropdownOpened}\n onClose={closeDropdown}\n withCloseButton={false}\n size={amountOfMonths * 400}\n zIndex={modalZIndex}\n >\n {children}\n </Modal>\n )}\n </Popover>\n </InputWrapper>\n );\n }\n);\n\nDatePickerBase.displayName = '@mantine/dates/DatePickerBase';\n"],"names":[],"mappings":";;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAA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AK,EAAE;AAC7D,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,aAAa;AAC1B,IAAI,eAAe,EAAE,KAAK;AAC1B,IAAI,IAAI,EAAE,cAAc,GAAG,GAAG;AAC9B,IAAI,MAAM,EAAE,WAAW;AACvB,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,EAAE;AACH,cAAc,CAAC,WAAW,GAAG,+BAA+B;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createStyles
|
|
1
|
+
import { createStyles } from '@mantine/core';
|
|
2
2
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __defProps = Object.defineProperties;
|
|
@@ -19,26 +19,11 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
21
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
var useStyles = createStyles((theme,
|
|
22
|
+
var useStyles = createStyles((theme, _params, getRef) => ({
|
|
23
23
|
wrapper: __spreadProps(__spreadValues({}, theme.fn.fontStyles()), {
|
|
24
24
|
position: "relative",
|
|
25
25
|
cursor: "pointer"
|
|
26
26
|
}),
|
|
27
|
-
placeholder: {
|
|
28
|
-
lineHeight: `${theme.fn.size({ size, sizes: INPUT_SIZES }) - 2}px`,
|
|
29
|
-
whiteSpace: "nowrap",
|
|
30
|
-
overflow: "hidden",
|
|
31
|
-
textOverflow: "ellipsis",
|
|
32
|
-
color: invalid ? theme.colors.red[theme.colorScheme === "dark" ? 6 : 7] : theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[5]
|
|
33
|
-
},
|
|
34
|
-
value: {
|
|
35
|
-
overflow: "hidden",
|
|
36
|
-
textOverflow: "ellipsis"
|
|
37
|
-
},
|
|
38
|
-
dropdownWrapper: {
|
|
39
|
-
position: "relative",
|
|
40
|
-
pointerEvents: "all"
|
|
41
|
-
},
|
|
42
27
|
input: {
|
|
43
28
|
cursor: "pointer",
|
|
44
29
|
whiteSpace: "nowrap",
|
|
@@ -49,15 +34,6 @@ var useStyles = createStyles((theme, { size, invalid }, getRef) => ({
|
|
|
49
34
|
freeInput: {
|
|
50
35
|
ref: getRef("freeInput"),
|
|
51
36
|
cursor: "text"
|
|
52
|
-
},
|
|
53
|
-
dropdown: {
|
|
54
|
-
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.white,
|
|
55
|
-
border: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[2]}`,
|
|
56
|
-
padding: `${theme.spacing.md}px ${theme.spacing.xs}px`
|
|
57
|
-
},
|
|
58
|
-
arrow: {
|
|
59
|
-
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[2],
|
|
60
|
-
background: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.white
|
|
61
37
|
}
|
|
62
38
|
}));
|
|
63
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerBase.styles.js","sources":["../../../src/components/DatePickerBase/DatePickerBase.styles.ts"],"sourcesContent":["import { createStyles
|
|
1
|
+
{"version":3,"file":"DatePickerBase.styles.js","sources":["../../../src/components/DatePickerBase/DatePickerBase.styles.ts"],"sourcesContent":["import { createStyles } from '@mantine/core';\n\nexport default createStyles((theme, _params, getRef) => ({\n wrapper: {\n ...theme.fn.fontStyles(),\n position: 'relative',\n cursor: 'pointer',\n },\n\n input: {\n cursor: 'pointer',\n whiteSpace: 'nowrap',\n\n [`&:not(.${getRef('freeInput')})::selection`]: {\n backgroundColor: 'transparent',\n },\n },\n\n freeInput: {\n ref: getRef('freeInput'),\n cursor: 'text',\n },\n}));\n"],"names":[],"mappings":";;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBA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EAAE,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE;AACpE,IAAI,QAAQ,EAAE,UAAU;AACxB,IAAI,MAAM,EAAE,SAAS;AACrB,GAAG,CAAC;AACJ,EAAE,KAAK,EAAE;AACT,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,UAAU,EAAE,QAAQ;AACxB,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,GAAG;AACnD,MAAM,eAAe,EAAE,aAAa;AACpC,KAAK;AACL,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC;AAC5B,IAAI,MAAM,EAAE,MAAM;AAClB,GAAG;AACH,CAAC,CAAC,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { DefaultProps, InputBaseProps, InputWrapperBaseProps, MantineTransition, InputStylesNames, InputWrapperStylesNames, MantineSize, MantineShadow, Selectors } from '@mantine/core';
|
|
3
3
|
import { CalendarBaseStylesNames } from '../CalendarBase/CalendarBase';
|
|
4
4
|
import useStyles from './DatePickerBase.styles';
|
|
5
|
-
export declare type DatePickerStylesNames = Selectors<typeof useStyles> | CalendarBaseStylesNames | InputStylesNames | InputWrapperStylesNames;
|
|
5
|
+
export declare type DatePickerStylesNames = Selectors<typeof useStyles> | CalendarBaseStylesNames | InputStylesNames | InputWrapperStylesNames | 'dropdown';
|
|
6
6
|
export interface DatePickerBaseSharedProps extends InputBaseProps, InputWrapperBaseProps, DefaultProps<DatePickerStylesNames>, Omit<React.ComponentPropsWithoutRef<'input'>, 'value' | 'defaultValue' | 'placeholder' | 'size'> {
|
|
7
7
|
/** Props spread to root element (InputWrapper) */
|
|
8
8
|
wrapperProps?: React.ComponentPropsWithoutRef<'div'>;
|
|
@@ -18,8 +18,6 @@ export interface DatePickerBaseSharedProps extends InputBaseProps, InputWrapperB
|
|
|
18
18
|
shadow?: MantineShadow;
|
|
19
19
|
/** Input name, useful fon uncontrolled variant to capture data with native form */
|
|
20
20
|
name?: string;
|
|
21
|
-
/** Set to true to disable dropdown closing on scroll */
|
|
22
|
-
closeDropdownOnScroll?: boolean;
|
|
23
21
|
/** Input size */
|
|
24
22
|
size?: MantineSize;
|
|
25
23
|
/** Where to show calendar in modal or popover */
|
|
@@ -30,7 +28,7 @@ export interface DatePickerBaseSharedProps extends InputBaseProps, InputWrapperB
|
|
|
30
28
|
clearButtonLabel?: string;
|
|
31
29
|
/** useEffect dependencies to force update dropdown position */
|
|
32
30
|
positionDependencies?: any[];
|
|
33
|
-
/**
|
|
31
|
+
/** Dropdown zIndex */
|
|
34
32
|
zIndex?: number;
|
|
35
33
|
/** call onChange with last valid value onBlur */
|
|
36
34
|
fixOnBlur?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerBase.d.ts","sourceRoot":"","sources":["../../../src/components/DatePickerBase/DatePickerBase.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DatePickerBase.d.ts","sourceRoot":"","sources":["../../../src/components/DatePickerBase/DatePickerBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,YAAY,EAGZ,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EAGX,aAAa,EACb,SAAS,EAGV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,oBAAY,qBAAqB,GAC7B,SAAS,CAAC,OAAO,SAAS,CAAC,GAC3B,uBAAuB,GACvB,gBAAgB,GAChB,uBAAuB,GACvB,UAAU,CAAC;AAEf,MAAM,WAAW,yBACf,SAAQ,cA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BAAmB,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;IACpE,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,qCAAqC;IACrC,cAAc,EAAE,OAAO,CAAC;IAExB,gDAAgD;IAChD,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzC,0CAA0C;IAC1C,OAAO,IAAI,IAAI,CAAC;IAEhB,uBAAuB;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,uBAAuB;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAUD,eAAO,MAAM,cAAc,8FAkN1B,CAAC"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
size: MantineSize;
|
|
4
|
-
invalid: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: (params: DatePickerBaseStyles, options?: import("@mantine/core").UseStylesOptions<"input" | "value" | "placeholder" | "wrapper" | "dropdownWrapper" | "freeInput" | "dropdown" | "arrow">) => {
|
|
7
|
-
classes: Record<"input" | "value" | "placeholder" | "wrapper" | "dropdownWrapper" | "freeInput" | "dropdown" | "arrow", string>;
|
|
1
|
+
declare const _default: (params: void, options?: import("@mantine/core").UseStylesOptions<"input" | "wrapper" | "freeInput">) => {
|
|
2
|
+
classes: Record<"input" | "wrapper" | "freeInput", string>;
|
|
8
3
|
cx: (...args: any) => string;
|
|
9
4
|
theme: import("@mantine/core").MantineTheme;
|
|
10
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerBase.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DatePickerBase/DatePickerBase.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePickerBase.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DatePickerBase/DatePickerBase.styles.ts"],"names":[],"mappings":";;;;;AAEA,wBAoBI"}
|
|
@@ -2,8 +2,8 @@ import { MantineSize } from '@mantine/core';
|
|
|
2
2
|
export interface TimeInputStylesParams {
|
|
3
3
|
size: MantineSize;
|
|
4
4
|
}
|
|
5
|
-
declare const _default: (params: TimeInputStylesParams, options?: import("@mantine/core").UseStylesOptions<"disabled" | "
|
|
6
|
-
classes: Record<"disabled" | "
|
|
5
|
+
declare const _default: (params: TimeInputStylesParams, options?: import("@mantine/core").UseStylesOptions<"disabled" | "timeInput" | "controls">) => {
|
|
6
|
+
classes: Record<"disabled" | "timeInput" | "controls", string>;
|
|
7
7
|
cx: (...args: any) => string;
|
|
8
8
|
theme: import("@mantine/core").MantineTheme;
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/dates",
|
|
3
3
|
"description": "Calendars, date and time pickers based on Mantine components",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-alpha.0",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"picker"
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@mantine/core": "
|
|
27
|
-
"@mantine/hooks": "
|
|
26
|
+
"@mantine/core": "5.0.0-alpha.0",
|
|
27
|
+
"@mantine/hooks": "5.0.0-alpha.0",
|
|
28
28
|
"dayjs": "^1.10.5",
|
|
29
29
|
"react": ">=16.8.0"
|
|
30
30
|
},
|