@entur/datepicker 9.3.4 → 9.4.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 +9 -4
- package/dist/DatePicker/DatePicker.d.ts +10 -5
- package/dist/DatePicker/NativeDatePicker.d.ts +10 -5
- package/dist/TimePicker/NativeTimePicker.d.ts +10 -5
- package/dist/TimePicker/SimpleTimePicker.d.ts +8 -3
- package/dist/TimePicker/TimePicker.d.ts +8 -3
- package/dist/datepicker.cjs.development.js +1 -1
- 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 +1 -1
- package/dist/datepicker.esm.js.map +1 -1
- package/dist/styles.css +87 -87
- package/package.json +10 -10
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SpectrumDateFieldProps, DateValue } from '@react-types/datepicker';
|
|
3
|
-
import { VariantType } from '@entur/
|
|
3
|
+
import { VariantType } from '@entur/utils';
|
|
4
4
|
import './DateField.scss';
|
|
5
|
+
/** @deprecated use variant="information" instead */
|
|
6
|
+
declare const info = "info";
|
|
7
|
+
/** @deprecated use variant="negative" instead */
|
|
8
|
+
declare const error = "error";
|
|
5
9
|
export type DateFieldProps = {
|
|
6
10
|
/** Den valgte tiden. Tid i '@internationalized/date'-pakkens format */
|
|
7
11
|
selectedDate: DateValue | null;
|
|
@@ -34,14 +38,14 @@ export type DateFieldProps = {
|
|
|
34
38
|
maxDate?: DateValue;
|
|
35
39
|
/** Varselmelding, som vil komme under TimePicker */
|
|
36
40
|
feedback?: string;
|
|
37
|
-
/** Valideringsvariant
|
|
38
|
-
variant?: VariantType;
|
|
41
|
+
/** Valideringsvariant*/
|
|
42
|
+
variant?: VariantType | typeof error | typeof info;
|
|
39
43
|
/** Varselmelding som forteller om ugyldig dato
|
|
40
44
|
* @default "Ugyldig dato"
|
|
41
45
|
*/
|
|
42
46
|
validationFeedback?: string;
|
|
43
47
|
/** Valideringsvariant for melding om ugyldig dato
|
|
44
|
-
* @default "
|
|
48
|
+
* @default "negative"
|
|
45
49
|
*/
|
|
46
50
|
validationVariant?: VariantType;
|
|
47
51
|
labelTooltip?: React.ReactNode;
|
|
@@ -52,3 +56,4 @@ export type DateFieldProps = {
|
|
|
52
56
|
[key: string]: any;
|
|
53
57
|
} & Omit<SpectrumDateFieldProps<DateValue>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'>;
|
|
54
58
|
export declare const DateField: React.ForwardRefExoticComponent<Omit<DateFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
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 { VariantType } from '@entur/
|
|
4
|
+
import type { VariantType } from '@entur/utils';
|
|
5
5
|
import './DatePicker.scss';
|
|
6
|
+
/** @deprecated use variant="information" instead */
|
|
7
|
+
declare const info = "info";
|
|
8
|
+
/** @deprecated use variant="negative" instead */
|
|
9
|
+
declare const error = "error";
|
|
6
10
|
export type DatePickerProps<DateType extends DateValue> = {
|
|
7
11
|
/** Den valgte datoen. Dato i '@internationalized/date'-pakkens format */
|
|
8
12
|
selectedDate: DateType | null;
|
|
@@ -41,16 +45,16 @@ export type DatePickerProps<DateType extends DateValue> = {
|
|
|
41
45
|
isDateUnavailable?: (date: DateValue) => boolean;
|
|
42
46
|
/** Varselmelding, som vil komme under DatePicker sitt inputfelt */
|
|
43
47
|
feedback?: string;
|
|
44
|
-
/** Valideringsvariant
|
|
45
|
-
variant?: VariantType;
|
|
48
|
+
/** Valideringsvariant*/
|
|
49
|
+
variant?: VariantType | typeof error | typeof info;
|
|
46
50
|
/** Varselmelding som forteller om ugyldig dato
|
|
47
51
|
* @default "Ugyldig dato"
|
|
48
52
|
*/
|
|
49
53
|
validationFeedback?: string;
|
|
50
54
|
/** Valideringsvariant for melding om ugyldig dato
|
|
51
|
-
* @default "
|
|
55
|
+
* @default "negative"
|
|
52
56
|
*/
|
|
53
|
-
validationVariant?: VariantType;
|
|
57
|
+
validationVariant?: VariantType | typeof error | typeof info;
|
|
54
58
|
disabled?: boolean;
|
|
55
59
|
/** Slå på visning av ukenummere i kalenderen. Overskriften for ukenummer-kolonnen
|
|
56
60
|
* kan endres med prop-en 'weekNumberHeader'
|
|
@@ -102,3 +106,4 @@ export type DatePickerProps<DateType extends DateValue> = {
|
|
|
102
106
|
style?: React.CSSProperties;
|
|
103
107
|
} & Omit<AriaDatePickerProps<DateType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'>;
|
|
104
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;
|
|
109
|
+
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { VariantType } from '@entur/
|
|
2
|
+
import { VariantType } from '@entur/utils';
|
|
3
|
+
/** @deprecated use variant="information" instead */
|
|
4
|
+
declare const info = "info";
|
|
5
|
+
/** @deprecated use variant="negative" instead */
|
|
6
|
+
declare const error = "error";
|
|
3
7
|
export type NativeDatePickerProps = {
|
|
4
8
|
/** Ekstra klassenavn */
|
|
5
9
|
className?: string;
|
|
@@ -7,8 +11,8 @@ export type NativeDatePickerProps = {
|
|
|
7
11
|
label: string;
|
|
8
12
|
/** Varselmelding, som vil komme under NativeDatePicker */
|
|
9
13
|
feedback?: string;
|
|
10
|
-
/** Valideringsvariant
|
|
11
|
-
variant?: VariantType;
|
|
14
|
+
/** Valideringsvariant*/
|
|
15
|
+
variant?: VariantType | typeof error | typeof info;
|
|
12
16
|
/** Plasserer labelen statisk på toppen av inputfeltet
|
|
13
17
|
* @default false
|
|
14
18
|
*/
|
|
@@ -25,8 +29,8 @@ export declare const NativeDatePicker: React.ForwardRefExoticComponent<{
|
|
|
25
29
|
label: string;
|
|
26
30
|
/** Varselmelding, som vil komme under NativeDatePicker */
|
|
27
31
|
feedback?: string | undefined;
|
|
28
|
-
/** Valideringsvariant
|
|
29
|
-
variant?: VariantType | undefined;
|
|
32
|
+
/** Valideringsvariant*/
|
|
33
|
+
variant?: "info" | "error" | VariantType | undefined;
|
|
30
34
|
/** Plasserer labelen statisk på toppen av inputfeltet
|
|
31
35
|
* @default false
|
|
32
36
|
*/
|
|
@@ -36,3 +40,4 @@ export declare const NativeDatePicker: React.ForwardRefExoticComponent<{
|
|
|
36
40
|
*/
|
|
37
41
|
prepend?: React.ReactNode;
|
|
38
42
|
} & React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
43
|
+
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { VariantType } from '@entur/
|
|
2
|
+
import { VariantType } from '@entur/utils';
|
|
3
3
|
import './NativeTimePicker.scss';
|
|
4
|
+
/** @deprecated use variant="information" instead */
|
|
5
|
+
declare const info = "info";
|
|
6
|
+
/** @deprecated use variant="negative" instead */
|
|
7
|
+
declare const error = "error";
|
|
4
8
|
export type NativeTimePickerProps = {
|
|
5
9
|
/** Ekstra klassenavn */
|
|
6
10
|
className?: string;
|
|
@@ -8,8 +12,8 @@ export type NativeTimePickerProps = {
|
|
|
8
12
|
label: string;
|
|
9
13
|
/** Varselmelding, som vil komme under NativeTimePicker */
|
|
10
14
|
feedback?: string;
|
|
11
|
-
/** Valideringsvariant
|
|
12
|
-
variant?: VariantType;
|
|
15
|
+
/** Valideringsvariant*/
|
|
16
|
+
variant?: VariantType | typeof error | typeof info;
|
|
13
17
|
/** Tekst eller ikon som kommer før inputfelter */
|
|
14
18
|
prepend?: React.ReactNode;
|
|
15
19
|
} & React.InputHTMLAttributes<HTMLInputElement>;
|
|
@@ -20,8 +24,9 @@ export declare const NativeTimePicker: React.ForwardRefExoticComponent<{
|
|
|
20
24
|
label: string;
|
|
21
25
|
/** Varselmelding, som vil komme under NativeTimePicker */
|
|
22
26
|
feedback?: string | undefined;
|
|
23
|
-
/** Valideringsvariant
|
|
24
|
-
variant?: VariantType | undefined;
|
|
27
|
+
/** Valideringsvariant*/
|
|
28
|
+
variant?: "info" | "error" | VariantType | undefined;
|
|
25
29
|
/** Tekst eller ikon som kommer før inputfelter */
|
|
26
30
|
prepend?: React.ReactNode;
|
|
27
31
|
} & React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
32
|
+
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TimeValue, AriaTimeFieldProps, MappedTimeValue } from '@react-types/datepicker';
|
|
3
|
-
import { VariantType } from '@entur/
|
|
3
|
+
import { VariantType } from '@entur/utils';
|
|
4
4
|
import './SimpleTimePicker.scss';
|
|
5
|
+
/** @deprecated use variant="information" instead */
|
|
6
|
+
declare const info = "info";
|
|
7
|
+
/** @deprecated use variant="negative" instead */
|
|
8
|
+
declare const error = "error";
|
|
5
9
|
export type SimpleTimePickerProps<TimeType extends TimeValue> = {
|
|
6
10
|
/** Den valgte tiden. Tid i '@internationalized/date'-pakkens format */
|
|
7
11
|
selectedTime: TimeType | null;
|
|
@@ -24,8 +28,8 @@ export type SimpleTimePickerProps<TimeType extends TimeValue> = {
|
|
|
24
28
|
padding?: 'default' | 'large';
|
|
25
29
|
/** Varselmelding, som vil komme under TimePicker */
|
|
26
30
|
feedback?: string;
|
|
27
|
-
/** Valideringsvariant
|
|
28
|
-
variant?: VariantType;
|
|
31
|
+
/** Valideringsvariant*/
|
|
32
|
+
variant?: VariantType | typeof error | typeof info;
|
|
29
33
|
/** Tekst eller ikon som vises foran skjema-elementet */
|
|
30
34
|
prepend?: React.ReactNode;
|
|
31
35
|
/** Tekst eller ikon som vises etter skjema-elementet */
|
|
@@ -39,3 +43,4 @@ export type SimpleTimePickerProps<TimeType extends TimeValue> = {
|
|
|
39
43
|
style?: React.CSSProperties;
|
|
40
44
|
} & Omit<AriaTimeFieldProps<TimeType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue' | 'locale' | 'isReadOnly' | 'isDisabled' | 'locale'>;
|
|
41
45
|
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
|
+
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TimeValue, AriaTimeFieldProps, MappedTimeValue } from '@react-types/datepicker';
|
|
3
|
-
import { VariantType } from '@entur/
|
|
3
|
+
import { VariantType } from '@entur/utils';
|
|
4
4
|
import './TimePicker.scss';
|
|
5
|
+
/** @deprecated use variant="information" instead */
|
|
6
|
+
declare const info = "info";
|
|
7
|
+
/** @deprecated use variant="negative" instead */
|
|
8
|
+
declare const error = "error";
|
|
5
9
|
export type TimePickerProps<TimeType extends TimeValue> = {
|
|
6
10
|
/** Den valgte tiden. Tid i '@internationalized/date'-pakkens format */
|
|
7
11
|
selectedTime: TimeType | null;
|
|
@@ -38,8 +42,8 @@ export type TimePickerProps<TimeType extends TimeValue> = {
|
|
|
38
42
|
rightArrowButtonAriaLabel?: string;
|
|
39
43
|
/** Varselmelding, som vil komme under TimePicker */
|
|
40
44
|
feedback?: string;
|
|
41
|
-
/** Valideringsvariant
|
|
42
|
-
variant?: VariantType;
|
|
45
|
+
/** Valideringsvariant*/
|
|
46
|
+
variant?: VariantType | typeof error | typeof info;
|
|
43
47
|
labelTooltip?: React.ReactNode;
|
|
44
48
|
disabled?: boolean;
|
|
45
49
|
inputRef?: React.ForwardedRef<HTMLDivElement>;
|
|
@@ -59,3 +63,4 @@ export type TimePickerProps<TimeType extends TimeValue> = {
|
|
|
59
63
|
style?: React.CSSProperties;
|
|
60
64
|
} & Omit<AriaTimeFieldProps<TimeType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'>;
|
|
61
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;
|
|
66
|
+
export {};
|
|
@@ -229,7 +229,7 @@ var DateField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
229
229
|
variant = _ref.variant,
|
|
230
230
|
feedback = _ref.feedback,
|
|
231
231
|
_ref$validationVarian = _ref.validationVariant,
|
|
232
|
-
validationVariant = _ref$validationVarian === void 0 ? '
|
|
232
|
+
validationVariant = _ref$validationVarian === void 0 ? 'negative' : _ref$validationVarian,
|
|
233
233
|
_ref$validationFeedba = _ref.validationFeedback,
|
|
234
234
|
validationFeedback = _ref$validationFeedba === void 0 ? 'Ugyldig dato' : _ref$validationFeedba,
|
|
235
235
|
labelTooltip = _ref.labelTooltip,
|