@entur/datepicker 9.4.12 → 10.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DatePicker/DateField.d.ts +12 -8
- package/dist/DatePicker/DatePicker.d.ts +3 -2
- package/dist/TimePicker/SimpleTimePicker.d.ts +2 -1
- package/dist/TimePicker/TimePicker.d.ts +3 -2
- package/dist/datepicker.cjs.development.js +114 -73
- package/dist/datepicker.cjs.development.js.map +1 -1
- package/dist/datepicker.cjs.production.min.js +1 -1
- package/dist/datepicker.cjs.production.min.js.map +1 -1
- package/dist/datepicker.esm.js +115 -74
- package/dist/datepicker.esm.js.map +1 -1
- package/dist/styles.css +62 -81
- package/package.json +8 -8
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SpectrumDateFieldProps, DateValue } from '@react-types/datepicker';
|
|
2
|
+
import type { SpectrumDateFieldProps, DateValue, AriaDatePickerProps, MappedDateValue } from '@react-types/datepicker';
|
|
3
|
+
import { BaseFormControlProps } from '@entur/form';
|
|
3
4
|
import { VariantType } from '@entur/utils';
|
|
4
5
|
import './DateField.scss';
|
|
5
6
|
/** @deprecated use variant="information" instead */
|
|
6
7
|
declare const info = "info";
|
|
7
8
|
/** @deprecated use variant="negative" instead */
|
|
8
9
|
declare const error = "error";
|
|
9
|
-
export type DateFieldProps = {
|
|
10
|
+
export type DateFieldProps<DateType extends DateValue> = {
|
|
10
11
|
/** Den valgte tiden. Tid i '@internationalized/date'-pakkens format */
|
|
11
|
-
selectedDate:
|
|
12
|
+
selectedDate: DateType | null;
|
|
12
13
|
/** Kalles når tiden endres. Tid i '@internationalized/date'-pakkens format */
|
|
13
|
-
onChange: (value:
|
|
14
|
+
onChange: (value: MappedDateValue<DateType> | null) => void;
|
|
14
15
|
/** Label til TimePicker */
|
|
15
16
|
label: string;
|
|
16
17
|
/** BCP47-språkkoden til locale-en du ønsker å bruke.
|
|
@@ -47,13 +48,16 @@ export type DateFieldProps = {
|
|
|
47
48
|
/** Valideringsvariant for melding om ugyldig dato
|
|
48
49
|
* @default "negative"
|
|
49
50
|
*/
|
|
50
|
-
validationVariant?: VariantType;
|
|
51
|
+
validationVariant?: VariantType | typeof error | typeof info;
|
|
51
52
|
labelTooltip?: React.ReactNode;
|
|
53
|
+
labelProps?: React.DOMAttributes<Element>;
|
|
54
|
+
fieldProps?: AriaDatePickerProps<DateValue>;
|
|
55
|
+
groupProps?: React.DOMAttributes<Element>;
|
|
56
|
+
dateFieldRef?: React.Ref<HTMLDivElement>;
|
|
52
57
|
disabled?: boolean;
|
|
53
58
|
/** Ekstra klassenavn */
|
|
54
59
|
className?: string;
|
|
55
60
|
style?: React.CSSProperties;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export declare const DateField: React.ForwardRefExoticComponent<Omit<DateFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
+
} & Omit<SpectrumDateFieldProps<DateValue>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'> & Omit<Partial<BaseFormControlProps>, 'children'>;
|
|
62
|
+
export declare const DateField: <DateType extends DateValue>({ selectedDate, onChange, label, locale: customLocale, showTimeZone, showTime, granularity, disabled, isDisabled, variant, feedback, validationVariant, validationFeedback, labelTooltip, minDate, maxDate, style, className, labelProps: parentLabelProps, fieldProps: parentFieldProps, groupProps: parentGroupProps, append, prepend, dateFieldRef: ref, ...rest }: DateFieldProps<DateType>) => React.JSX.Element;
|
|
59
63
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CalendarDate, DateValue } from '@internationalized/date';
|
|
3
3
|
import type { AriaDatePickerProps, MappedDateValue } from '@react-types/datepicker';
|
|
4
|
+
import type { BaseFormControlProps } from '@entur/form';
|
|
4
5
|
import type { VariantType } from '@entur/utils';
|
|
5
6
|
import './DatePicker.scss';
|
|
6
7
|
/** @deprecated use variant="information" instead */
|
|
@@ -104,6 +105,6 @@ export type DatePickerProps<DateType extends DateValue> = {
|
|
|
104
105
|
/** Ekstra klassenavn */
|
|
105
106
|
className?: string;
|
|
106
107
|
style?: React.CSSProperties;
|
|
107
|
-
} & Omit<AriaDatePickerProps<DateType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'>;
|
|
108
|
-
export declare const DatePicker: <DateType extends DateValue>({ selectedDate, onChange, locale, disabled, showTime, showTimeZone, classNameForDate, className, style, variant, feedback, validationVariant, validationFeedback, showWeekNumbers, weekNumberHeader, disableModal, labelTooltip, navigationDescription, minDate, maxDate, modalTreshold, forcedReturnType, ariaLabelForDate, ...rest }: DatePickerProps<DateType>) => React.JSX.Element;
|
|
108
|
+
} & Omit<AriaDatePickerProps<DateType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'> & Omit<Partial<BaseFormControlProps>, 'children'>;
|
|
109
|
+
export declare const DatePicker: <DateType extends DateValue>({ selectedDate, onChange, locale, disabled, showTime, showTimeZone, classNameForDate, className, style, variant, feedback, validationVariant, validationFeedback, showWeekNumbers, weekNumberHeader, disableModal, labelTooltip, navigationDescription, minDate, maxDate, modalTreshold, forcedReturnType, ariaLabelForDate, append, prepend, ...rest }: DatePickerProps<DateType>) => React.JSX.Element;
|
|
109
110
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TimeValue, AriaTimeFieldProps, MappedTimeValue } from '@react-types/datepicker';
|
|
3
|
+
import { BaseFormControlProps } from '@entur/form';
|
|
3
4
|
import { VariantType } from '@entur/utils';
|
|
4
5
|
import './SimpleTimePicker.scss';
|
|
5
6
|
/** @deprecated use variant="information" instead */
|
|
@@ -41,6 +42,6 @@ export type SimpleTimePickerProps<TimeType extends TimeValue> = {
|
|
|
41
42
|
/** Ekstra klassenavn */
|
|
42
43
|
className?: string;
|
|
43
44
|
style?: React.CSSProperties;
|
|
44
|
-
} & Omit<AriaTimeFieldProps<TimeType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue' | 'locale' | 'isReadOnly' | 'isDisabled' | 'locale'>;
|
|
45
|
+
} & Omit<AriaTimeFieldProps<TimeType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue' | 'locale' | 'isReadOnly' | 'isDisabled' | 'locale'> & Omit<Partial<BaseFormControlProps>, 'children'>;
|
|
45
46
|
export declare const SimpleTimePicker: <TimeType extends TimeValue>({ append, className, disabled, feedback, showClockIcon, inputRef, label, labelTooltip, onChange, padding, prepend, readOnly, selectedTime, showSeconds, style, variant, ...rest }: SimpleTimePickerProps<TimeType>) => React.JSX.Element;
|
|
46
47
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TimeValue, AriaTimeFieldProps, MappedTimeValue } from '@react-types/datepicker';
|
|
3
|
+
import { BaseFormControlProps } from '@entur/form';
|
|
3
4
|
import { VariantType } from '@entur/utils';
|
|
4
5
|
import './TimePicker.scss';
|
|
5
6
|
/** @deprecated use variant="information" instead */
|
|
@@ -61,6 +62,6 @@ export type TimePickerProps<TimeType extends TimeValue> = {
|
|
|
61
62
|
/** Ekstra klassenavn */
|
|
62
63
|
className?: string;
|
|
63
64
|
style?: React.CSSProperties;
|
|
64
|
-
} & Omit<AriaTimeFieldProps<TimeType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'>;
|
|
65
|
-
export declare const TimePicker: <TimeType extends TimeValue>({ selectedTime, onChange, disabled, className, style, label, labelTooltip, feedback, granularity, variant, locale: customLocale, showTimeZone, showSeconds, minuteIncrementForArrowButtons, leftArrowButtonAriaLabel, rightArrowButtonAriaLabel, inputRef, forcedReturnType, forcedTimeZone, ...rest }: TimePickerProps<TimeType>) => React.JSX.Element;
|
|
65
|
+
} & Omit<AriaTimeFieldProps<TimeType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'> & Partial<BaseFormControlProps>;
|
|
66
|
+
export declare const TimePicker: <TimeType extends TimeValue>({ selectedTime, onChange, disabled, className, style, label, labelTooltip, feedback, granularity, variant, locale: customLocale, showTimeZone, showSeconds, minuteIncrementForArrowButtons, leftArrowButtonAriaLabel, rightArrowButtonAriaLabel, inputRef, forcedReturnType, forcedTimeZone, append, prepend, ...rest }: TimePickerProps<TimeType>) => React.JSX.Element;
|
|
66
67
|
export {};
|
|
@@ -214,8 +214,8 @@ function getWeekNumberForDate(date$1) {
|
|
|
214
214
|
return weekNumber;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
var _excluded$a = ["selectedDate", "onChange", "label", "locale", "showTimeZone", "showTime", "granularity", "disabled", "isDisabled", "variant", "feedback", "validationVariant", "validationFeedback", "labelTooltip", "minDate", "maxDate", "style", "className", "labelProps", "append"];
|
|
218
|
-
var DateField =
|
|
217
|
+
var _excluded$a = ["selectedDate", "onChange", "label", "locale", "showTimeZone", "showTime", "granularity", "disabled", "isDisabled", "variant", "feedback", "validationVariant", "validationFeedback", "labelTooltip", "minDate", "maxDate", "style", "className", "labelProps", "fieldProps", "groupProps", "append", "prepend", "dateFieldRef"];
|
|
218
|
+
var DateField = function DateField(_ref) {
|
|
219
219
|
var selectedDate = _ref.selectedDate,
|
|
220
220
|
onChange = _ref.onChange,
|
|
221
221
|
label = _ref.label,
|
|
@@ -238,7 +238,11 @@ var DateField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
238
238
|
style = _ref.style,
|
|
239
239
|
className = _ref.className,
|
|
240
240
|
parentLabelProps = _ref.labelProps,
|
|
241
|
+
parentFieldProps = _ref.fieldProps,
|
|
242
|
+
parentGroupProps = _ref.groupProps,
|
|
241
243
|
append = _ref.append,
|
|
244
|
+
prepend = _ref.prepend,
|
|
245
|
+
ref = _ref.dateFieldRef,
|
|
242
246
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
243
247
|
var _useLocale = i18n.useLocale(),
|
|
244
248
|
locale = _useLocale.locale;
|
|
@@ -246,6 +250,7 @@ var DateField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
246
250
|
locale: customLocale != null ? customLocale : locale,
|
|
247
251
|
createCalendar: createCalendar,
|
|
248
252
|
value: selectedDate,
|
|
253
|
+
//@ts-expect-error incorrect type in package
|
|
249
254
|
onChange: onChange,
|
|
250
255
|
hideTimeZone: !showTimeZone,
|
|
251
256
|
granularity: showTime ? 'minute' : granularity,
|
|
@@ -256,7 +261,7 @@ var DateField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
256
261
|
shouldForceLeadingZeros: true
|
|
257
262
|
}));
|
|
258
263
|
var dateFieldRef = React.useRef(null);
|
|
259
|
-
var _useDateField = datepicker.useDateField(_extends({}, rest, {
|
|
264
|
+
var _useDateField = datepicker.useDateField(_extends({}, parentFieldProps, rest, {
|
|
260
265
|
label: label
|
|
261
266
|
}), state, dateFieldRef),
|
|
262
267
|
labelProps = _useDateField.labelProps,
|
|
@@ -270,28 +275,36 @@ var DateField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
270
275
|
}, child);
|
|
271
276
|
}
|
|
272
277
|
}, React.createElement(form.BaseFormControl, _extends({
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
278
|
+
append: append,
|
|
279
|
+
ariaAlertOnFeedback: true,
|
|
280
|
+
className: classNames('eds-datefield', className, {
|
|
281
|
+
'eds-datefield--has-tooltip': labelTooltip !== undefined
|
|
282
|
+
}),
|
|
277
283
|
disabled: isDisabled || disabled,
|
|
278
284
|
disableLabelAnimation: true,
|
|
285
|
+
feedback: feedback != null ? feedback : state.validationState === 'invalid' ? validationFeedback : undefined,
|
|
279
286
|
label: label,
|
|
287
|
+
labelId: id,
|
|
288
|
+
labelProps: parentLabelProps != null ? parentLabelProps : labelProps,
|
|
280
289
|
labelTooltip: labelTooltip,
|
|
281
|
-
|
|
290
|
+
prepend: prepend,
|
|
291
|
+
ref: ref,
|
|
292
|
+
style: style,
|
|
293
|
+
variant: variant != null ? variant : state.validationState === 'invalid' ? validationVariant : undefined
|
|
294
|
+
}, parentGroupProps), React.createElement("span", _extends({
|
|
295
|
+
ref: dateFieldRef
|
|
282
296
|
}, fieldProps, {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
ariaAlertOnFeedback: true
|
|
297
|
+
style: {
|
|
298
|
+
display: 'contents'
|
|
299
|
+
}
|
|
287
300
|
}), state.segments.map(function (segment, i) {
|
|
288
301
|
return React.createElement(FieldSegment, {
|
|
289
302
|
segment: segment,
|
|
290
303
|
state: state,
|
|
291
304
|
key: i
|
|
292
305
|
});
|
|
293
|
-
})));
|
|
294
|
-
}
|
|
306
|
+
}))));
|
|
307
|
+
};
|
|
295
308
|
|
|
296
309
|
var _excluded$9 = ["children", "className", "style"];
|
|
297
310
|
var CalendarButton = function CalendarButton(_ref) {
|
|
@@ -498,7 +511,7 @@ var CalendarBase = function CalendarBase(_ref2) {
|
|
|
498
511
|
}));
|
|
499
512
|
};
|
|
500
513
|
|
|
501
|
-
var _excluded$5 = ["selectedDate", "onChange", "locale", "disabled", "showTime", "showTimeZone", "classNameForDate", "className", "style", "variant", "feedback", "validationVariant", "validationFeedback", "showWeekNumbers", "weekNumberHeader", "disableModal", "labelTooltip", "navigationDescription", "minDate", "maxDate", "modalTreshold", "forcedReturnType", "ariaLabelForDate"];
|
|
514
|
+
var _excluded$5 = ["selectedDate", "onChange", "locale", "disabled", "showTime", "showTimeZone", "classNameForDate", "className", "style", "variant", "feedback", "validationVariant", "validationFeedback", "showWeekNumbers", "weekNumberHeader", "disableModal", "labelTooltip", "navigationDescription", "minDate", "maxDate", "modalTreshold", "forcedReturnType", "ariaLabelForDate", "append", "prepend"];
|
|
502
515
|
var DatePicker = function DatePicker(_ref) {
|
|
503
516
|
var selectedDate = _ref.selectedDate,
|
|
504
517
|
onChange = _ref.onChange,
|
|
@@ -509,6 +522,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
509
522
|
showTimeZone = _ref$showTimeZone === void 0 ? false : _ref$showTimeZone,
|
|
510
523
|
classNameForDate = _ref.classNameForDate,
|
|
511
524
|
className = _ref.className,
|
|
525
|
+
style = _ref.style,
|
|
512
526
|
variant = _ref.variant,
|
|
513
527
|
feedback = _ref.feedback,
|
|
514
528
|
validationVariant = _ref.validationVariant,
|
|
@@ -525,6 +539,8 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
525
539
|
modalTreshold = _ref$modalTreshold === void 0 ? 1000 : _ref$modalTreshold,
|
|
526
540
|
forcedReturnType = _ref.forcedReturnType,
|
|
527
541
|
ariaLabelForDate = _ref.ariaLabelForDate,
|
|
542
|
+
append = _ref.append,
|
|
543
|
+
prepend = _ref.prepend,
|
|
528
544
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
529
545
|
var CALENDAR_MODAL_MAX_SCREEN_WIDTH = modalTreshold;
|
|
530
546
|
var datePickerRef = React.useRef(null);
|
|
@@ -620,38 +636,45 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
620
636
|
locale: locale
|
|
621
637
|
}, child);
|
|
622
638
|
}
|
|
623
|
-
}, React.createElement(
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
639
|
+
}, React.createElement(DateField, {
|
|
640
|
+
append: !disabled && React.createElement("div", {
|
|
641
|
+
style: {
|
|
642
|
+
display: 'flex',
|
|
643
|
+
alignItems: 'center'
|
|
644
|
+
}
|
|
645
|
+
}, append, React.createElement(CalendarButton, _extends({}, buttonProps, {
|
|
646
|
+
onPress: function onPress() {
|
|
647
|
+
state.setOpen(!state.isOpen);
|
|
648
|
+
update();
|
|
649
|
+
},
|
|
650
|
+
className: "eds-datepicker__open-calendar-button"
|
|
651
|
+
}), React.createElement(icons.CalendarIcon, null))),
|
|
652
|
+
prepend: prepend,
|
|
653
|
+
className: classNames('eds-datepicker', className, {
|
|
654
|
+
'eds-datepicker--disabled': disabled
|
|
655
|
+
}),
|
|
656
|
+
disabled: disabled,
|
|
657
|
+
feedback: feedback,
|
|
658
|
+
fieldProps: fieldProps,
|
|
659
|
+
groupProps: groupProps,
|
|
632
660
|
label: rest.label,
|
|
633
661
|
labelProps: labelProps,
|
|
634
|
-
|
|
635
|
-
minDate: minDate,
|
|
662
|
+
labelTooltip: labelTooltip,
|
|
636
663
|
maxDate: maxDate,
|
|
664
|
+
minDate: minDate,
|
|
665
|
+
onChange: handleOnChange,
|
|
666
|
+
dateFieldRef: function dateFieldRef(node) {
|
|
667
|
+
refs.setReference(node);
|
|
668
|
+
datePickerRef.current = node;
|
|
669
|
+
},
|
|
670
|
+
selectedDate: selectedDate,
|
|
637
671
|
showTime: showTime,
|
|
638
672
|
showTimeZone: showTimeZone,
|
|
639
|
-
|
|
640
|
-
variant: variant,
|
|
641
|
-
feedback: feedback,
|
|
642
|
-
validationVariant: validationVariant,
|
|
673
|
+
style: style,
|
|
643
674
|
validationFeedback: validationFeedback,
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
})
|
|
648
|
-
})), !disabled && React.createElement(CalendarButton, _extends({}, buttonProps, {
|
|
649
|
-
onPress: function onPress() {
|
|
650
|
-
state.setOpen(!state.isOpen);
|
|
651
|
-
update();
|
|
652
|
-
},
|
|
653
|
-
className: "eds-datepicker__open-calendar-button"
|
|
654
|
-
}), React.createElement(icons.CalendarIcon, null)), useModal ? modalCalendar : popoverCalendar)));
|
|
675
|
+
validationVariant: validationVariant,
|
|
676
|
+
variant: variant
|
|
677
|
+
}), useModal ? modalCalendar : popoverCalendar);
|
|
655
678
|
};
|
|
656
679
|
|
|
657
680
|
var _excluded$4 = ["className", "style", "label", "onChange", "feedback", "variant", "disableLabelAnimation", "prepend"],
|
|
@@ -746,7 +769,7 @@ var TimePickerArrowButton = function TimePickerArrowButton(_ref) {
|
|
|
746
769
|
}, rest), direction === 'left' ? React.createElement(icons.LeftArrowIcon, null) : React.createElement(icons.RightArrowIcon, null));
|
|
747
770
|
};
|
|
748
771
|
|
|
749
|
-
var _excluded$2 = ["selectedTime", "onChange", "disabled", "className", "style", "label", "labelTooltip", "feedback", "granularity", "variant", "locale", "showTimeZone", "showSeconds", "minuteIncrementForArrowButtons", "leftArrowButtonAriaLabel", "rightArrowButtonAriaLabel", "inputRef", "forcedReturnType", "forcedTimeZone"];
|
|
772
|
+
var _excluded$2 = ["selectedTime", "onChange", "disabled", "className", "style", "label", "labelTooltip", "feedback", "granularity", "variant", "locale", "showTimeZone", "showSeconds", "minuteIncrementForArrowButtons", "leftArrowButtonAriaLabel", "rightArrowButtonAriaLabel", "inputRef", "forcedReturnType", "forcedTimeZone", "append", "prepend"];
|
|
750
773
|
var TimePicker = function TimePicker(_ref) {
|
|
751
774
|
var selectedTime = _ref.selectedTime,
|
|
752
775
|
onChange = _ref.onChange,
|
|
@@ -771,6 +794,8 @@ var TimePicker = function TimePicker(_ref) {
|
|
|
771
794
|
inputRef = _ref.inputRef,
|
|
772
795
|
forcedReturnType = _ref.forcedReturnType,
|
|
773
796
|
forcedTimeZone = _ref.forcedTimeZone,
|
|
797
|
+
append = _ref.append,
|
|
798
|
+
prepend = _ref.prepend,
|
|
774
799
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
775
800
|
var _useLocale = i18n.useLocale(),
|
|
776
801
|
locale = _useLocale.locale;
|
|
@@ -826,28 +851,44 @@ var TimePicker = function TimePicker(_ref) {
|
|
|
826
851
|
};
|
|
827
852
|
return React.createElement(i18n.I18nProvider, {
|
|
828
853
|
locale: locale
|
|
829
|
-
}, React.createElement(
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
854
|
+
}, React.createElement(form.BaseFormControl, {
|
|
855
|
+
append: React.createElement("div", {
|
|
856
|
+
style: {
|
|
857
|
+
display: 'flex',
|
|
858
|
+
alignItems: 'center'
|
|
859
|
+
}
|
|
860
|
+
}, append, React.createElement(TimePickerArrowButton, {
|
|
861
|
+
direction: "right",
|
|
862
|
+
disabled: disabled,
|
|
863
|
+
"aria-label": rightArrowButtonAriaLabel,
|
|
864
|
+
onClick: function onClick() {
|
|
865
|
+
return handleOnClickArrowButton('add');
|
|
866
|
+
},
|
|
867
|
+
onFocus: function onFocus() {
|
|
868
|
+
return focusSegment(timeFieldRef, 'last');
|
|
869
|
+
}
|
|
870
|
+
})),
|
|
871
|
+
ariaAlertOnFeedback: true,
|
|
872
|
+
"aria-describedby": timePickerId + 'description',
|
|
873
|
+
className: classNames('eds-timepicker', className, {
|
|
874
|
+
'eds-timepicker--disabled': disabled,
|
|
875
|
+
'eds-timepicker--has-tooltip': labelTooltip !== undefined
|
|
835
876
|
}),
|
|
836
|
-
|
|
877
|
+
disabled: disabled,
|
|
878
|
+
disableLabelAnimation: true,
|
|
879
|
+
feedback: feedback,
|
|
837
880
|
label: label,
|
|
881
|
+
labelId: id,
|
|
838
882
|
labelProps: _extends({}, labelProps, {
|
|
839
883
|
'aria-describedby': timePickerId + 'description'
|
|
840
884
|
}),
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
ariaAlertOnFeedback: true,
|
|
849
|
-
"aria-describedby": timePickerId + 'description',
|
|
850
|
-
prepend: React.createElement(TimePickerArrowButton, {
|
|
885
|
+
labelTooltip: labelTooltip,
|
|
886
|
+
prepend: React.createElement("div", {
|
|
887
|
+
style: {
|
|
888
|
+
display: 'flex',
|
|
889
|
+
alignItems: 'center'
|
|
890
|
+
}
|
|
891
|
+
}, React.createElement(TimePickerArrowButton, {
|
|
851
892
|
direction: "left",
|
|
852
893
|
disabled: disabled,
|
|
853
894
|
"aria-label": leftArrowButtonAriaLabel,
|
|
@@ -857,18 +898,16 @@ var TimePicker = function TimePicker(_ref) {
|
|
|
857
898
|
onFocus: function onFocus() {
|
|
858
899
|
return focusSegment(timeFieldRef, 'first');
|
|
859
900
|
}
|
|
860
|
-
}),
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}
|
|
871
|
-
})
|
|
901
|
+
}), prepend),
|
|
902
|
+
ref: inputRef,
|
|
903
|
+
style: style,
|
|
904
|
+
variant: variant
|
|
905
|
+
}, React.createElement("span", _extends({
|
|
906
|
+
ref: timeFieldRef
|
|
907
|
+
}, fieldProps, {
|
|
908
|
+
style: {
|
|
909
|
+
display: 'contents'
|
|
910
|
+
}
|
|
872
911
|
}), state.segments.map(function (segment, i) {
|
|
873
912
|
return React.createElement(FieldSegment, {
|
|
874
913
|
segment: segment,
|
|
@@ -1093,12 +1132,14 @@ var SimpleTimePicker = function SimpleTimePicker(_ref) {
|
|
|
1093
1132
|
onClick: function onClick() {
|
|
1094
1133
|
var _timeFieldRef$current;
|
|
1095
1134
|
return timeFieldRef == null ? void 0 : (_timeFieldRef$current = timeFieldRef.current) == null ? void 0 : _timeFieldRef$current.focus();
|
|
1096
|
-
}
|
|
1135
|
+
},
|
|
1136
|
+
inline: true
|
|
1097
1137
|
}) : undefined),
|
|
1098
1138
|
className: classNames('eds-simple-timepicker', {
|
|
1099
1139
|
'eds-simple-timepicker--padding-large': padding === 'large',
|
|
1100
1140
|
'eds-simple-timepicker--show-seconds': showSeconds,
|
|
1101
|
-
'eds-simple-timepicker--hide-clock': !showClockIcon
|
|
1141
|
+
'eds-simple-timepicker--hide-clock': !showClockIcon,
|
|
1142
|
+
'eds-simple-timepicker--has-tooltip': labelTooltip !== undefined
|
|
1102
1143
|
}),
|
|
1103
1144
|
disabled: disabled,
|
|
1104
1145
|
disableLabelAnimation: true,
|