@hazelcast/ui 1.3.2-next.17 → 1.3.2-next.18
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/lib/Calendar/Calendar.d.ts +1 -0
- package/lib/Calendar/Calendar.js +6 -4
- package/lib/Calendar/Calendar.js.map +1 -1
- package/lib/Calendar/Calendar.module.scss +2 -1
- package/lib/Calendar/CalendarRange.d.ts +4 -3
- package/lib/Calendar/CalendarRange.js +5 -5
- package/lib/Calendar/CalendarRange.js.map +1 -1
- package/lib/Calendar/CalendarRange.module.scss +5 -0
- package/package.json +2 -2
|
@@ -10,5 +10,6 @@ export declare type CalendarProps = {
|
|
|
10
10
|
onDateChange: ReactDatePickerProps['onChange'];
|
|
11
11
|
size?: CalendarSize;
|
|
12
12
|
container?: PortalContainer;
|
|
13
|
+
insidePopover?: boolean;
|
|
13
14
|
} & Omit<ReactDatePickerProps, 'value' | 'onChange'>;
|
|
14
15
|
export declare const Calendar: FC<CalendarProps>;
|
package/lib/Calendar/Calendar.js
CHANGED
|
@@ -9,11 +9,13 @@ import styles from './Calendar.module.scss';
|
|
|
9
9
|
import { getPortalContainer } from '../utils/portal';
|
|
10
10
|
const DATE_FORMAT = 'yyyy-MM-dd';
|
|
11
11
|
const DATE_FORMAT_WITH_TIME = 'yyyy-MM-dd hh:mm a';
|
|
12
|
-
const CalendarPopperContainer = (container) => ({ children }) => container && children
|
|
13
|
-
? createPortal(
|
|
12
|
+
const CalendarPopperContainer = (container, insidePopover) => ({ children }) => container && children
|
|
13
|
+
? createPortal(
|
|
14
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
15
|
+
React.createElement("div", { className: styles.popper, onMouseDown: insidePopover ? (e) => e.nativeEvent.stopImmediatePropagation() : undefined },
|
|
14
16
|
React.createElement("div", { "data-test": "date-picker-popper-container", className: "hz-date-picker-popper-container" }, children)), container)
|
|
15
17
|
: null;
|
|
16
|
-
export const Calendar = ({ calendarClassName, className, containerClassName, date, inputLabel, inputClassName, onDateChange, showTimeInput, size = 'medium', container = `body`, ...props }) => (React.createElement("div", { className: cn(styles.container, {
|
|
18
|
+
export const Calendar = ({ calendarClassName, className, containerClassName, date, inputLabel, inputClassName, onDateChange, showTimeInput, size = 'medium', container = `body`, insidePopover = false, ...props }) => (React.createElement("div", { className: cn(styles.container, {
|
|
17
19
|
[styles.time]: showTimeInput,
|
|
18
20
|
}, containerClassName) },
|
|
19
21
|
React.createElement(DatePicker, { ...props, calendarClassName: cn(styles.calendar, calendarClassName), className: className,
|
|
@@ -21,7 +23,7 @@ export const Calendar = ({ calendarClassName, className, containerClassName, dat
|
|
|
21
23
|
* Note: The library instantiates the component using React.cloneElement
|
|
22
24
|
* Source: https://github.com/Hacker0x01/react-datepicker/blob/master/src/index.jsx#L926
|
|
23
25
|
*/
|
|
24
|
-
customInput: React.createElement(CalendarInput, { label: inputLabel, textFieldSize: size, className: inputClassName }), customTimeInput: React.createElement(CalendarTime, null), dateFormat: showTimeInput ? DATE_FORMAT_WITH_TIME : DATE_FORMAT, onChange: onDateChange, popperContainer: CalendarPopperContainer(getPortalContainer(container)),
|
|
26
|
+
customInput: React.createElement(CalendarInput, { label: inputLabel, textFieldSize: size, className: inputClassName }), customTimeInput: React.createElement(CalendarTime, null), dateFormat: showTimeInput ? DATE_FORMAT_WITH_TIME : DATE_FORMAT, onChange: onDateChange, popperContainer: CalendarPopperContainer(getPortalContainer(container), insidePopover),
|
|
25
27
|
/*
|
|
26
28
|
* Note:
|
|
27
29
|
* 'renderCustomHeader' is the only child component override prop that is not instantiated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,UAAoC,MAA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3;
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:global .react-datepicker {
|
|
36
|
+
padding: $inputPadding;
|
|
37
|
+
|
|
36
38
|
:global .react-datepicker__header {
|
|
37
39
|
margin: 0;
|
|
38
40
|
padding: 0;
|
|
@@ -161,7 +163,6 @@ $inputPadding: c.$grid * 3;
|
|
|
161
163
|
flex-direction: row;
|
|
162
164
|
border: c.$borderWidth solid c.$colorNeutralLight;
|
|
163
165
|
background-color: c.$colorNeutralLighter;
|
|
164
|
-
padding: $inputPadding;
|
|
165
166
|
box-sizing: border-box;
|
|
166
167
|
|
|
167
168
|
.headerContainer {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { ReactDatePickerProps } from 'react-datepicker';
|
|
3
2
|
import { CalendarProps } from './Calendar';
|
|
3
|
+
export declare type CalendarRangeVariant = 'horizontal' | 'vertical';
|
|
4
4
|
export declare type CalendarRangeProps = {
|
|
5
5
|
startDate: CalendarProps['date'];
|
|
6
6
|
startInputLabel?: string;
|
|
@@ -9,7 +9,8 @@ export declare type CalendarRangeProps = {
|
|
|
9
9
|
endDate: CalendarProps['date'];
|
|
10
10
|
endInputLabel?: string;
|
|
11
11
|
endOpen?: boolean;
|
|
12
|
+
variant?: CalendarRangeVariant;
|
|
12
13
|
onEndDateChange: CalendarProps['onDateChange'];
|
|
13
|
-
|
|
14
|
-
} &
|
|
14
|
+
insidePopover?: boolean;
|
|
15
|
+
} & Omit<CalendarProps, 'onDateChange' | 'date' | 'inputLabel'>;
|
|
15
16
|
export declare const CalendarRange: FC<CalendarRangeProps>;
|
|
@@ -4,10 +4,10 @@ import cn from 'classnames';
|
|
|
4
4
|
import { Icon } from '../Icon';
|
|
5
5
|
import { Calendar } from './Calendar';
|
|
6
6
|
import styles from './CalendarRange.module.scss';
|
|
7
|
-
export const CalendarRange = ({ startDate, startInputLabel = 'From', startOpen, onStartDateChange, endDate, endInputLabel = 'To', endOpen, onEndDateChange,
|
|
8
|
-
return (React.createElement("div", { className: styles.container },
|
|
9
|
-
React.createElement(Calendar, { "data-test": "calendar-range-start", date: startDate, onDateChange: onStartDateChange, selectsStart: true, startDate: startDate, endDate: endDate, inputLabel: startInputLabel,
|
|
10
|
-
React.createElement(Icon, { "data-test": "calendar-range-icon", className: cn(styles.arrowRight, { [styles.small]: size === 'small' }), icon: ArrowRight, ariaLabel: "Arrow Right" }),
|
|
11
|
-
React.createElement(Calendar, { "data-test": "calendar-range-end", date: endDate, onDateChange: onEndDateChange, selectsEnd: true, startDate: startDate, endDate: endDate, minDate: startDate, inputLabel: endInputLabel,
|
|
7
|
+
export const CalendarRange = ({ startDate, startInputLabel = 'From', startOpen, onStartDateChange, endDate, endInputLabel = 'To', endOpen, onEndDateChange, size, insidePopover = false, variant = 'horizontal', ...rest }) => {
|
|
8
|
+
return (React.createElement("div", { className: cn(styles.container, { [styles.vertical]: variant === 'vertical' }) },
|
|
9
|
+
React.createElement(Calendar, { "data-test": "calendar-range-start", date: startDate, onDateChange: onStartDateChange, selectsStart: true, startDate: startDate, endDate: endDate, inputLabel: startInputLabel, open: startOpen, size: size, insidePopover: insidePopover, ...rest }),
|
|
10
|
+
variant === 'horizontal' && (React.createElement(Icon, { "data-test": "calendar-range-icon", className: cn(styles.arrowRight, { [styles.small]: size === 'small' }), icon: ArrowRight, ariaLabel: "Arrow Right" })),
|
|
11
|
+
React.createElement(Calendar, { "data-test": "calendar-range-end", date: endDate, onDateChange: onEndDateChange, selectsEnd: true, startDate: startDate, endDate: endDate, minDate: startDate, inputLabel: endInputLabel, open: endOpen, size: size, insidePopover: insidePopover, ...rest })));
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=CalendarRange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarRange.js","sourceRoot":"","sources":["../../src/Calendar/CalendarRange.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":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,GACvB,CACH;QACD,oBAAC,QAAQ,iBACG,oBAAoB,EAC9B,IAAI,EAAE,OAAO,EACb,YAAY,EAAE,eAAe,EAC7B,UAAU,QACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,aAAa,EACzB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,KACxB,IAAI,GACR,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hazelcast/ui",
|
|
3
|
-
"version": "1.3.2-next.
|
|
3
|
+
"version": "1.3.2-next.18+254b6f0",
|
|
4
4
|
"description": "Hazelcast design system components",
|
|
5
5
|
"author": "",
|
|
6
6
|
"homepage": "https://github.com/hazelcast/frontend-shared#readme",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"webpack": "^5.65.0",
|
|
114
114
|
"yup": "^0.32.11"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "254b6f09b71b097c9fa1163af85699cccaedfc3d"
|
|
117
117
|
}
|