@hazelcast/ui 1.3.2-next.26 → 1.3.2-next.27
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.js +1 -1
- package/lib/Calendar/Calendar.js.map +1 -1
- package/lib/Calendar/components/CalendarTime.js +5 -8
- package/lib/Calendar/components/CalendarTime.js.map +1 -1
- package/lib/Calendar/components/CalendarTime.module.scss +4 -0
- package/lib/Calendar/helpers/consts.js +97 -97
- package/lib/Calendar/helpers/consts.js.map +1 -1
- package/lib/TimeField.js +4 -12
- package/lib/TimeField.js.map +1 -1
- package/lib/TimeField.module.scss +0 -87
- package/package.json +3 -2
package/lib/Calendar/Calendar.js
CHANGED
|
@@ -8,7 +8,7 @@ import { CalendarTime } from './components/CalendarTime';
|
|
|
8
8
|
import styles from './Calendar.module.scss';
|
|
9
9
|
import { getPortalContainer } from '../utils/portal';
|
|
10
10
|
const DATE_FORMAT = 'yyyy-MM-dd';
|
|
11
|
-
const TIME_FORMAT = '
|
|
11
|
+
const TIME_FORMAT = 'HH:mm';
|
|
12
12
|
const CalendarPopperContainer = (container, inPortal) => ({ children }) => {
|
|
13
13
|
const content = ( // eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
14
14
|
React.createElement("div", { className: styles.popper },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,OAAO,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,UAAoC,MAAM,kBAAkB,CAAA;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,Y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,12 +3,9 @@ import { format, parse } from 'date-fns';
|
|
|
3
3
|
import { Button } from '../../Button';
|
|
4
4
|
import { timePoints } from '../helpers/consts';
|
|
5
5
|
import { TimeField } from '../../TimeField';
|
|
6
|
-
import styles from './CalendarTime.module.scss';
|
|
7
6
|
import { useRefValue } from '../../hooks';
|
|
8
|
-
|
|
9
|
-
const DATE_FORMAT = '
|
|
10
|
-
// Note: 0-23 hours time
|
|
11
|
-
const DATE_FORMAT_NO_MERIDIEM = 'HH:mm';
|
|
7
|
+
import styles from './CalendarTime.module.scss';
|
|
8
|
+
const DATE_FORMAT = 'HH:mm';
|
|
12
9
|
export const CalendarTimeInternal = ({ date, value, onChange }) => {
|
|
13
10
|
const [time, setTime] = useState(value);
|
|
14
11
|
const [timeInputError, setTimeInputError] = useState();
|
|
@@ -37,7 +34,7 @@ export const CalendarTimeInternal = ({ date, value, onChange }) => {
|
|
|
37
34
|
}, [value]);
|
|
38
35
|
const handleTimeInputChange = useCallback(({ target: { value } }) => {
|
|
39
36
|
setTime(value);
|
|
40
|
-
const parsedDate = parse(value,
|
|
37
|
+
const parsedDate = parse(value, DATE_FORMAT, date);
|
|
41
38
|
if (!isNaN(parsedDate.valueOf())) {
|
|
42
39
|
setTimeInputError(undefined);
|
|
43
40
|
onChange(value);
|
|
@@ -50,7 +47,7 @@ export const CalendarTimeInternal = ({ date, value, onChange }) => {
|
|
|
50
47
|
// Note: Input time (derived from timePoints) is in 'DATE_FORMAT'
|
|
51
48
|
const parsedDate = parse(dp, DATE_FORMAT, date);
|
|
52
49
|
// Note: Output time, that we feed back to 'react-datetime' is in 'DATE_FORMAT_NO_MERIDIEM' format
|
|
53
|
-
const timeStringWithoutAm = format(parsedDate,
|
|
50
|
+
const timeStringWithoutAm = format(parsedDate, DATE_FORMAT);
|
|
54
51
|
onChange(timeStringWithoutAm);
|
|
55
52
|
// remove error because time from the list can not be invalid
|
|
56
53
|
setTimeInputError(undefined);
|
|
@@ -61,7 +58,7 @@ export const CalendarTimeInternal = ({ date, value, onChange }) => {
|
|
|
61
58
|
}, [onChange, getValue, date]);
|
|
62
59
|
return (React.createElement("div", { "data-test": "calendar-time", className: styles.container },
|
|
63
60
|
React.createElement("div", { "data-test": "calendar-time-header", className: styles.header },
|
|
64
|
-
React.createElement(TimeField, { showAriaLabel: true, label: "Time Input", error: timeInputError, name: "time", value: time.toString(), onChange: handleTimeInputChange })),
|
|
61
|
+
React.createElement(TimeField, { showAriaLabel: true, size: "small", label: "Time Input", error: timeInputError, name: "time", value: time.toString(), inputClassName: styles.timeInput, onChange: handleTimeInputChange })),
|
|
65
62
|
React.createElement("div", { "data-test": "calendar-time-timePoints", className: styles.timePoints }, timePoints.map((tP) => (React.createElement(Button, { className: styles.timePoint, bodyClassName: styles.timePointBody, key: tP, variant: "text", onClick: handleDateClick(tP) }, tP))))));
|
|
66
63
|
};
|
|
67
64
|
export const CalendarTime = (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarTime.js","sourceRoot":"","sources":["../../../src/Calendar/components/CalendarTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"CalendarTime.js","sourceRoot":"","sources":["../../../src/Calendar/components/CalendarTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,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AC,MAAM,YAAY,GAA0B,CAAC,KAAK,EAAE,EAAE;IAC3D,oDAAoD;IACpD,MAAM,UAAU,GAAG,KAAkC,CAAA;IAErD,OAAO,oBAAC,oBAAoB,OAAK,UAAU,GAAI,CAAA;AACjD,CAAC,CAAA"}
|
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
export const timePoints = [
|
|
2
|
-
// Source: https://simple.wikipedia.org/wiki/
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'01:00
|
|
8
|
-
'01:15
|
|
9
|
-
'01:30
|
|
10
|
-
'01:45
|
|
11
|
-
'02:00
|
|
12
|
-
'02:15
|
|
13
|
-
'02:30
|
|
14
|
-
'02:45
|
|
15
|
-
'03:00
|
|
16
|
-
'03:15
|
|
17
|
-
'03:30
|
|
18
|
-
'03:45
|
|
19
|
-
'04:00
|
|
20
|
-
'04:15
|
|
21
|
-
'04:30
|
|
22
|
-
'04:45
|
|
23
|
-
'05:00
|
|
24
|
-
'05:15
|
|
25
|
-
'05:30
|
|
26
|
-
'05:45
|
|
27
|
-
'06:00
|
|
28
|
-
'06:15
|
|
29
|
-
'06:30
|
|
30
|
-
'06:45
|
|
31
|
-
'07:00
|
|
32
|
-
'07:15
|
|
33
|
-
'07:30
|
|
34
|
-
'07:45
|
|
35
|
-
'08:00
|
|
36
|
-
'08:15
|
|
37
|
-
'08:30
|
|
38
|
-
'08:45
|
|
39
|
-
'09:00
|
|
40
|
-
'09:15
|
|
41
|
-
'09:30
|
|
42
|
-
'09:45
|
|
43
|
-
'10:00
|
|
44
|
-
'10:15
|
|
45
|
-
'10:30
|
|
46
|
-
'10:45
|
|
47
|
-
'11:00
|
|
48
|
-
'11:15
|
|
49
|
-
'11:30
|
|
50
|
-
'11:45
|
|
51
|
-
'12:00
|
|
52
|
-
'12:15
|
|
53
|
-
'12:30
|
|
54
|
-
'12:45
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
65
|
-
'
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
77
|
-
'
|
|
78
|
-
'
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
'
|
|
82
|
-
'
|
|
83
|
-
'
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
'
|
|
88
|
-
'
|
|
89
|
-
'
|
|
90
|
-
'
|
|
91
|
-
'
|
|
92
|
-
'
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
'
|
|
96
|
-
'
|
|
97
|
-
'
|
|
98
|
-
'
|
|
2
|
+
// Source: https://simple.wikipedia.org/wiki/24-hour_clock
|
|
3
|
+
'00:00',
|
|
4
|
+
'00:15',
|
|
5
|
+
'00:30',
|
|
6
|
+
'00:45',
|
|
7
|
+
'01:00',
|
|
8
|
+
'01:15',
|
|
9
|
+
'01:30',
|
|
10
|
+
'01:45',
|
|
11
|
+
'02:00',
|
|
12
|
+
'02:15',
|
|
13
|
+
'02:30',
|
|
14
|
+
'02:45',
|
|
15
|
+
'03:00',
|
|
16
|
+
'03:15',
|
|
17
|
+
'03:30',
|
|
18
|
+
'03:45',
|
|
19
|
+
'04:00',
|
|
20
|
+
'04:15',
|
|
21
|
+
'04:30',
|
|
22
|
+
'04:45',
|
|
23
|
+
'05:00',
|
|
24
|
+
'05:15',
|
|
25
|
+
'05:30',
|
|
26
|
+
'05:45',
|
|
27
|
+
'06:00',
|
|
28
|
+
'06:15',
|
|
29
|
+
'06:30',
|
|
30
|
+
'06:45',
|
|
31
|
+
'07:00',
|
|
32
|
+
'07:15',
|
|
33
|
+
'07:30',
|
|
34
|
+
'07:45',
|
|
35
|
+
'08:00',
|
|
36
|
+
'08:15',
|
|
37
|
+
'08:30',
|
|
38
|
+
'08:45',
|
|
39
|
+
'09:00',
|
|
40
|
+
'09:15',
|
|
41
|
+
'09:30',
|
|
42
|
+
'09:45',
|
|
43
|
+
'10:00',
|
|
44
|
+
'10:15',
|
|
45
|
+
'10:30',
|
|
46
|
+
'10:45',
|
|
47
|
+
'11:00',
|
|
48
|
+
'11:15',
|
|
49
|
+
'11:30',
|
|
50
|
+
'11:45',
|
|
51
|
+
'12:00',
|
|
52
|
+
'12:15',
|
|
53
|
+
'12:30',
|
|
54
|
+
'12:45',
|
|
55
|
+
'13:00',
|
|
56
|
+
'13:15',
|
|
57
|
+
'13:30',
|
|
58
|
+
'13:45',
|
|
59
|
+
'14:00',
|
|
60
|
+
'14:15',
|
|
61
|
+
'14:30',
|
|
62
|
+
'14:45',
|
|
63
|
+
'15:00',
|
|
64
|
+
'15:15',
|
|
65
|
+
'15:30',
|
|
66
|
+
'15:45',
|
|
67
|
+
'16:00',
|
|
68
|
+
'16:15',
|
|
69
|
+
'16:30',
|
|
70
|
+
'16:45',
|
|
71
|
+
'17:00',
|
|
72
|
+
'17:15',
|
|
73
|
+
'17:30',
|
|
74
|
+
'17:45',
|
|
75
|
+
'18:00',
|
|
76
|
+
'18:15',
|
|
77
|
+
'18:30',
|
|
78
|
+
'18:45',
|
|
79
|
+
'19:00',
|
|
80
|
+
'19:15',
|
|
81
|
+
'19:30',
|
|
82
|
+
'19:45',
|
|
83
|
+
'20:00',
|
|
84
|
+
'20:15',
|
|
85
|
+
'20:30',
|
|
86
|
+
'20:45',
|
|
87
|
+
'21:00',
|
|
88
|
+
'21:15',
|
|
89
|
+
'21:30',
|
|
90
|
+
'21:45',
|
|
91
|
+
'22:00',
|
|
92
|
+
'22:15',
|
|
93
|
+
'22:30',
|
|
94
|
+
'22:45',
|
|
95
|
+
'23:00',
|
|
96
|
+
'23:15',
|
|
97
|
+
'23:30',
|
|
98
|
+
'23:45',
|
|
99
99
|
];
|
|
100
100
|
//# sourceMappingURL=consts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../src/Calendar/helpers/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,0DAA0D;IAC1D,
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../src/Calendar/helpers/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,0DAA0D;IAC1D,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAA"}
|
package/lib/TimeField.js
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { useUID } from 'react-uid';
|
|
4
|
-
import
|
|
5
|
-
import { FieldHeader } from './FieldHeader';
|
|
4
|
+
import SimpleTimeField from 'react-simple-timefield';
|
|
6
5
|
import styles from './TimeField.module.scss';
|
|
6
|
+
import { TextField } from './TextField';
|
|
7
7
|
export const TimeField = (props) => {
|
|
8
8
|
const { 'data-test': dataTest, className, disabled, error, errorClassName, id: explicitId, inputClassName, label, labelClassName, name, onBlur, onChange, required, seconds = false, value, helperText, size, showAriaLabel, ...rest } = props;
|
|
9
9
|
// Use an auto generated id if it's not set explicitly
|
|
10
10
|
const autoId = useUID();
|
|
11
11
|
const id = explicitId !== null && explicitId !== void 0 ? explicitId : autoId;
|
|
12
|
-
return (React.createElement("div", { "data-test": dataTest, className: cn(styles.container, className
|
|
13
|
-
React.createElement(
|
|
14
|
-
React.createElement("div", { className: styles.inputBlock },
|
|
15
|
-
React.createElement("div", { className: styles.inputContainer },
|
|
16
|
-
React.createElement("input", { type: "time", step: seconds ? '1' : undefined, id: id, name: name, className: cn(styles.input, inputClassName, {
|
|
17
|
-
[styles.disabled]: disabled,
|
|
18
|
-
[styles.error]: error,
|
|
19
|
-
}), onChange: onChange, onBlur: onBlur, value: value, required: required, disabled: disabled, "aria-invalid": !!error, "aria-label": showAriaLabel ? label : undefined, "aria-required": required, "aria-errormessage": error && errorId(id), ...rest }),
|
|
20
|
-
React.createElement("div", { className: styles.borderOverlay }))),
|
|
21
|
-
React.createElement(Error, { truncated: true, error: error, className: cn(styles.errorContainer, errorClassName), inputId: id })));
|
|
12
|
+
return (React.createElement("div", { "data-test": dataTest, className: cn(styles.container, className) },
|
|
13
|
+
React.createElement(SimpleTimeField, { showSeconds: seconds, input: React.createElement(TextField, { name: name, id: id, label: label, error: error, onChange: onChange, errorClassName: errorClassName, inputClassName: inputClassName, labelClassName: labelClassName, onBlur: onBlur, size: size, required: required, disabled: disabled, showAriaLabel: showAriaLabel, helperText: helperText, ...rest }), onChange: onChange, value: value })));
|
|
22
14
|
};
|
|
23
15
|
//# sourceMappingURL=TimeField.js.map
|
package/lib/TimeField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeField.js","sourceRoot":"","sources":["../src/TimeField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAA;AAC/E,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"TimeField.js","sourceRoot":"","sources":["../src/TimeField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAA;AAC/E,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,eAAe,MAAM,wBAAwB,CAAA;AAKpD,OAAO,MAAM,MAAM,yBAAyB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAmBvC,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,KAAK,EAAE,EAAE;IACrD,MAAM,EACJ,WAAW,EAAE,QAAQ,EACrB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,cAAc,EACd,EAAE,EAAE,UAAU,EACd,cAAc,EACd,KAAK,EACL,cAAc,EACd,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,KAAK,EACL,UAAU,EACV,IAAI,EACJ,aAAa,EACb,GAAG,IAAI,EACR,GAAG,KAAK,CAAA;IACT,sDAAsD;IACtD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAA;IACvB,MAAM,EAAE,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,MAAM,CAAA;IAE/B,OAAO,CACL,0CAAgB,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC;QAClE,oBAAC,eAAe,IACd,WAAW,EAAE,OAAO,EACpB,KAAK,EACH,oBAAC,SAAS,IACR,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,KAClB,IAAI,GACR,EAEJ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACZ,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,91 +1,4 @@
|
|
|
1
|
-
@use '../styles/constants' as c;
|
|
2
|
-
@use '../styles/helpers' as h;
|
|
3
|
-
|
|
4
1
|
.container {
|
|
5
2
|
display: inline-flex;
|
|
6
3
|
flex-direction: column;
|
|
7
|
-
|
|
8
|
-
&.small {
|
|
9
|
-
input {
|
|
10
|
-
height: c.$inputHeightSmall;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.inputBlock {
|
|
15
|
-
display: flex;
|
|
16
|
-
|
|
17
|
-
.inputContainer {
|
|
18
|
-
position: relative;
|
|
19
|
-
|
|
20
|
-
.borderOverlay {
|
|
21
|
-
position: absolute;
|
|
22
|
-
display: block;
|
|
23
|
-
top: 0;
|
|
24
|
-
left: 0;
|
|
25
|
-
height: 100%;
|
|
26
|
-
width: 100%;
|
|
27
|
-
pointer-events: none;
|
|
28
|
-
z-index: c.$zIndex100;
|
|
29
|
-
border: c.$borderWidth solid c.$colorNeutral;
|
|
30
|
-
border-radius: c.$borderRadiusTimeField;
|
|
31
|
-
box-sizing: border-box;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
input {
|
|
35
|
-
box-sizing: border-box;
|
|
36
|
-
display: flex;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
align-items: center;
|
|
39
|
-
height: c.$grid * 5;
|
|
40
|
-
background-color: c.$colorNeutralWhite;
|
|
41
|
-
color: c.$colorTextSubdued;
|
|
42
|
-
padding: (c.$grid * 0.5) c.$grid c.$grid;
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
border-radius: c.$borderRadiusTimeField;
|
|
45
|
-
border: none;
|
|
46
|
-
|
|
47
|
-
// TODO: Check other browsers
|
|
48
|
-
&::-webkit-calendar-picker-indicator {
|
|
49
|
-
display: none;
|
|
50
|
-
background: none;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
input.error {
|
|
55
|
-
& ~ .borderOverlay {
|
|
56
|
-
border-color: c.$colorError;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
input:hover,
|
|
61
|
-
input.hover {
|
|
62
|
-
& ~ .borderOverlay {
|
|
63
|
-
border-color: c.$colorPrimary;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
input:focus,
|
|
68
|
-
input.focus {
|
|
69
|
-
// Do not remove outline for high-contrast modes
|
|
70
|
-
// https://stackoverflow.com/a/52616313
|
|
71
|
-
outline: transparent solid c.$outlineWidth;
|
|
72
|
-
|
|
73
|
-
& ~ .borderOverlay {
|
|
74
|
-
@include h.outlineFormField;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
input.disabled {
|
|
79
|
-
cursor: not-allowed;
|
|
80
|
-
color: c.$colorTextSecondary;
|
|
81
|
-
background-color: c.$colorNeutral;
|
|
82
|
-
|
|
83
|
-
& ~ .borderOverlay {
|
|
84
|
-
border-color: c.$colorNeutralLight;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
4
|
}
|
|
90
|
-
|
|
91
|
-
@include h.withError;
|
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.27+ec67a8e",
|
|
4
4
|
"description": "Hazelcast design system components",
|
|
5
5
|
"author": "",
|
|
6
6
|
"homepage": "https://github.com/hazelcast/frontend-shared#readme",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"react-popper": "^2.2.3",
|
|
68
68
|
"react-resize-aware": "^3.1.1",
|
|
69
69
|
"react-select": "^4.1.0",
|
|
70
|
+
"react-simple-timefield": "^3.2.5",
|
|
70
71
|
"react-table": "^7.7.0",
|
|
71
72
|
"react-uid": "^2.3.1",
|
|
72
73
|
"react-use": "^17.3.1",
|
|
@@ -109,5 +110,5 @@
|
|
|
109
110
|
"webpack": "^5.65.0",
|
|
110
111
|
"yup": "^0.32.11"
|
|
111
112
|
},
|
|
112
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "ec67a8e39d0a9e87afea42299eacd7c6d513cb9c"
|
|
113
114
|
}
|