@entur/datepicker 4.0.0-beta.5 → 4.0.1
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/CHANGELOG.md +56 -0
- package/LICENSE.md +0 -71
- package/dist/DatePicker/{beta/Calendar.d.ts → Calendar.d.ts} +1 -0
- package/dist/DatePicker/{beta/CalendarCell.d.ts → CalendarCell.d.ts} +2 -1
- package/dist/DatePicker/{beta/CalendarGrid.d.ts → CalendarGrid.d.ts} +2 -1
- package/dist/DatePicker/{beta/DateField.d.ts → DateField.d.ts} +2 -3
- package/dist/DatePicker/DatePicker.d.ts +48 -175
- package/dist/{NativeDatePicker.d.ts → DatePicker/NativeDatePicker.d.ts} +0 -0
- package/dist/DatePicker/index.d.ts +3 -1
- package/dist/TimePicker/TimePicker.d.ts +3 -3
- package/dist/datepicker.cjs.development.js +91 -517
- 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 +91 -515
- package/dist/datepicker.esm.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/styles.css +100 -206
- package/package.json +21 -22
- package/dist/DatePicker/DatePickerHeader.d.ts +0 -9
- package/dist/DatePicker/DatePickerInput.d.ts +0 -31
- package/dist/DatePicker/beta/DatePicker.d.ts +0 -62
- package/dist/DatePicker/beta/index.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,62 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.0.1](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@4.0.0...@entur/datepicker@4.0.1) (2023-02-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.0.10](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@3.0.9...@entur/datepicker@3.0.10) (2023-01-19)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
17
|
+
|
|
18
|
+
## [3.0.9](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@3.0.6...@entur/datepicker@3.0.9) (2022-12-09)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
21
|
+
|
|
22
|
+
## [3.0.8](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@3.0.7...@entur/datepicker@3.0.8) (2022-11-24)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
25
|
+
|
|
26
|
+
## [3.0.7](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@3.0.6...@entur/datepicker@3.0.7) (2022-10-31)
|
|
27
|
+
|
|
28
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
29
|
+
|
|
30
|
+
## [3.0.6](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@3.0.5...@entur/datepicker@3.0.6) (2022-10-31)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
33
|
+
|
|
34
|
+
## [3.0.5](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@3.0.4...@entur/datepicker@3.0.5) (2022-10-31)
|
|
35
|
+
|
|
36
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
37
|
+
|
|
38
|
+
## [3.0.4](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@3.0.3...@entur/datepicker@3.0.4) (2022-10-20)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
41
|
+
|
|
42
|
+
## [3.0.3](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@3.0.2...@entur/datepicker@3.0.3) (2022-10-20)
|
|
43
|
+
|
|
44
|
+
# [4.0.0-RC.3](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@4.0.0-RC.2...@entur/datepicker@4.0.0-RC.3) (2022-11-22)
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
47
|
+
|
|
48
|
+
# [4.0.0-RC.2](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@4.0.0-RC.1...@entur/datepicker@4.0.0-RC.2) (2022-11-22)
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
- **datepicker:** fix modal not being scrollable when larger than screen due to zoom ([0a75d57](https://bitbucket.org/enturas/design-system/commits/0a75d577b95521fd12fadb0f3e0258687aaba1cb))
|
|
53
|
+
|
|
54
|
+
# [4.0.0-RC.1](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@4.0.0-RC.0...@entur/datepicker@4.0.0-RC.1) (2022-11-21)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
57
|
+
|
|
58
|
+
# [4.0.0-RC.0](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@4.0.0-beta.5...@entur/datepicker@4.0.0-RC.0) (2022-11-21)
|
|
59
|
+
|
|
60
|
+
**Note:** Version bump only for package @entur/datepicker
|
|
61
|
+
|
|
6
62
|
# [4.0.0-beta.5](https://bitbucket.org/enturas/design-system/compare/@entur/datepicker@4.0.0-beta.3...@entur/datepicker@4.0.0-beta.5) (2022-11-11)
|
|
7
63
|
|
|
8
64
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
|
@@ -208,74 +208,3 @@ The European Commission may update this Appendix to later versions of the above
|
|
|
208
208
|
a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the
|
|
209
209
|
covered Source Code from exclusive appropriation.
|
|
210
210
|
All other changes or additions to this Appendix require the production of a new EUPL version.
|
|
211
|
-
|
|
212
|
-
# Standard Nucleo License
|
|
213
|
-
|
|
214
|
-
- Last updated: July 2, 2018
|
|
215
|
-
- [Github repo](https://github.com/NucleoApp/license-standard)
|
|
216
|
-
|
|
217
|
-
By purchasing the Nucleo icons, you have the right to:
|
|
218
|
-
|
|
219
|
-
- Use the Nucleo icons in unlimited personal and commercial projects, for yourself or a client, with no limitation to the number of impressions for your end product.
|
|
220
|
-
- Use the Nucleo icons in applications, software, UI/UX design, print, and logo design.
|
|
221
|
-
- Modify the Nucleo icons to create your icon variations.
|
|
222
|
-
|
|
223
|
-
You don't have the right to:
|
|
224
|
-
|
|
225
|
-
- Sublicense, resell, share, transfer, or otherwise redistribute the Nucleo icons (even for free or within a more complex downloadable file).
|
|
226
|
-
- Use the Nucleo icons in a product that is directly competitive with Nucleo.
|
|
227
|
-
|
|
228
|
-
## Limitations & Extended license
|
|
229
|
-
|
|
230
|
-
- **For each project, you can use a maximum of 250 Nucleo icons** (intended per unique style: for example, if you're using the same icon in both the outline and glyph styles, or in 2 different sizes, you're using 2 icons). You can lift this limit by purchasing an Extended License.
|
|
231
|
-
- If you're using Nucleo icons in templates, themes or plugins offered for sale, you can use a maximum of 100 Nucleo icons. You can lift this limit by purchasing an Extended License.
|
|
232
|
-
- If you're using the Nucleo icons in open source projects, you can use a maximum of 100 Nucleo icons.
|
|
233
|
-
- If you're interested in using the Nucleo icons in items offered for sale (or for free) where the Nucleo icons contribute to the core value of the product being sold/shared, you will need an Extended License (e.g., a CMS where users can browse the Nucleo icons and pick the ones to include in their design).
|
|
234
|
-
|
|
235
|
-
[Learn more about the Extended License](https://nucleoapp.com/extended-license)
|
|
236
|
-
|
|
237
|
-
## Freelance Projects & Contracted work
|
|
238
|
-
|
|
239
|
-
If you're working on a project for a client, you can share with your client a maximum of 250 Nucleo icons per project. You can't share the Nucleo source files unless the client purchases a license.
|
|
240
|
-
|
|
241
|
-
If the Nucleo icons contribute to the core value of the product being sold/shared, or if you (or your client) wish to include more than 250 icons in the project, the [Extended License](https://nucleoapp.com/extended-license) is required.
|
|
242
|
-
|
|
243
|
-
## Templates, Themes, UI Kits & Plugins
|
|
244
|
-
|
|
245
|
-
If you're using Nucleo icons in templates, themes or plugins offered for sale (e.g., UI kits, Wordpress Themes, HTML/CSS Templates), **you can include up to 100 icons in the downloadable source files**. This limitation applies to the icon fonts as well.
|
|
246
|
-
|
|
247
|
-
The downloadable source file has to include the [Nucleo Copyright Notice](https://nucleoapp.com/copyright-notice).
|
|
248
|
-
|
|
249
|
-
If the Nucleo icons contribute to the core value of the template, theme or plugin sold (e.g., a theme builder where users can browse Nucleo icons and pick the ones to include in their design), or if you wish to use more than 100 Nucleo icons, you will need an [Extended License](https://nucleoapp.com/extended-license).
|
|
250
|
-
|
|
251
|
-
It's not possible to purchase an Extended License if the template, theme or plugin is distributed for free.
|
|
252
|
-
|
|
253
|
-
If you're offering a free and pro version of your product, the free version cannot include more than 100 icons even if you purchased an Extended License to lift the limit. The Extended License applies only to the pro version of your product.
|
|
254
|
-
|
|
255
|
-
## Open source projects
|
|
256
|
-
|
|
257
|
-
If you're using the Nucleo icons in open source projects, **you can include up to 100 icons in the downloadable source files**. This limitation applies to the icon fonts as well.
|
|
258
|
-
|
|
259
|
-
The downloadable source file has to include the [Nucleo Copyright Notice](https://nucleoapp.com/copyright-notice).
|
|
260
|
-
|
|
261
|
-
It's not possible to purchase an Extended License for open source projects.
|
|
262
|
-
|
|
263
|
-
## Sharing Nucleo icons with team members
|
|
264
|
-
|
|
265
|
-
If you're the sole owner of a Nucleo license, you can share with your team members only the icons used in your work, with a maximum of 250 icons (e.g., if you're a designer, you can share with the developers of your team only the Nucleo icons used in your design files).
|
|
266
|
-
|
|
267
|
-
Your team members cannot reuse the Nucleo icons in other projects unless they purchase a license.
|
|
268
|
-
|
|
269
|
-
If more than one team member needs access to the Nucleo icons, you can consider purchasing a [team license](https://nucleoapp.com/pricing).
|
|
270
|
-
|
|
271
|
-
## Design systems
|
|
272
|
-
|
|
273
|
-
If you wish to include the Nucleo icons in a design system available on a public server, you can use a maximum of 250 Nucleo icons, even if your team purchased a Nucleo team license.
|
|
274
|
-
|
|
275
|
-
If the design system is accessible only by the members of your organization (e.g., is hosted on a password protected server), but you're the sole owner of a Nucleo license, you can share with your colleagues a maximum of 250 Nucleo icons.
|
|
276
|
-
|
|
277
|
-
If the design system is on a public server, you can lift the 250 icons limit by buying an [Extended License](https://nucleoapp.com/extended-license). However, please keep in mind you can't provide a link/button to download all the icons.
|
|
278
|
-
|
|
279
|
-
If your team purchased a Nucleo team license that covers all the users with access to the design system, and the design system is not public (e.g., is hosted on a password protected server), then there's no limitation to the number of icons that can be included.
|
|
280
|
-
|
|
281
|
-
If you're still unclear about what is or isn't allowed under this license, please contact us at info@nucleoapp.com.
|
|
@@ -6,6 +6,7 @@ declare type CalendarProps = {
|
|
|
6
6
|
onChange: (SelectedDate: DateValue) => void;
|
|
7
7
|
navigationDescription?: string;
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
|
+
onSelectedCellClick?: () => void;
|
|
9
10
|
[key: string]: any;
|
|
10
11
|
};
|
|
11
12
|
export declare const Calendar: React.ForwardRefExoticComponent<Pick<CalendarProps, keyof CalendarProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -4,6 +4,7 @@ import { CalendarDate } from '@internationalized/date';
|
|
|
4
4
|
declare type CalendarCellProps = {
|
|
5
5
|
state: CalendarState;
|
|
6
6
|
date: CalendarDate;
|
|
7
|
+
onSelectedCellClick?: () => void;
|
|
7
8
|
};
|
|
8
|
-
export declare const CalendarCell: ({ state, date, ...rest }: CalendarCellProps) => JSX.Element;
|
|
9
|
+
export declare const CalendarCell: ({ state, date, onSelectedCellClick, ...rest }: CalendarCellProps) => JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -3,6 +3,7 @@ import { CalendarState } from '@react-stately/calendar';
|
|
|
3
3
|
declare type CalendarGridProps = {
|
|
4
4
|
state: CalendarState;
|
|
5
5
|
navigationDescription?: string;
|
|
6
|
+
onSelectedCellClick?: () => void;
|
|
6
7
|
};
|
|
7
|
-
export declare const CalendarGrid: ({ state, navigationDescription, ...rest }: CalendarGridProps) => JSX.Element;
|
|
8
|
+
export declare const CalendarGrid: ({ state, navigationDescription, onSelectedCellClick, ...rest }: CalendarGridProps) => JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SpectrumDateFieldProps, DateValue } from '@react-types/datepicker';
|
|
3
|
-
import type { CalendarDate } from '@internationalized/date';
|
|
4
3
|
import { VariantType } from '@entur/form';
|
|
5
4
|
import './DateField.scss';
|
|
6
5
|
export declare type DateFieldProps = {
|
|
@@ -21,9 +20,9 @@ export declare type DateFieldProps = {
|
|
|
21
20
|
showTime?: boolean;
|
|
22
21
|
/** Tidligste gyldige datovalg.
|
|
23
22
|
* Eks: today(getLocalTimeZone()) == i dag i lokal tidssone */
|
|
24
|
-
|
|
23
|
+
minDate?: DateValue;
|
|
25
24
|
/** Seneste gyldige datovalg. (se minValue) */
|
|
26
|
-
|
|
25
|
+
maxDate?: DateValue;
|
|
27
26
|
/** Varselmelding, som vil komme under TimePicker */
|
|
28
27
|
feedback?: string;
|
|
29
28
|
/** Valideringsvariant */
|
|
@@ -1,192 +1,65 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { VariantType } from '@entur/form';
|
|
2
|
+
import type { DateValue, AriaDatePickerProps } from '@react-types/datepicker';
|
|
3
|
+
import type { VariantType } from '@entur/form';
|
|
5
4
|
import './DatePicker.scss';
|
|
6
|
-
import 'react-datepicker/dist/react-datepicker.css';
|
|
7
5
|
export declare type DatePickerProps = {
|
|
8
|
-
/**
|
|
9
|
-
selectedDate:
|
|
10
|
-
/** Kalles når
|
|
11
|
-
onChange: (date:
|
|
12
|
-
/**
|
|
13
|
-
* Kalles når en tast trykkes i inputfeltet
|
|
14
|
-
*/
|
|
15
|
-
onKeyDown?: (event: KeyboardEvent) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Datoformater som skal støttes. Første i listen er formatet alt input omgjøres til.
|
|
18
|
-
* Format-valg tilgjengelig her: https://date-fns.org/v2.28.0/docs/format
|
|
19
|
-
* OBS: Noen kombinasjoner av datoformater kan gi rar og uønsket oppførsel,
|
|
20
|
-
* test nøye ved endring
|
|
21
|
-
* @default "['dd.MM.yyyy', 'ddMMyyyy', 'dd/MM/yyyy', 'ddMMyy']"
|
|
22
|
-
*/
|
|
23
|
-
dateFormats?: string[];
|
|
24
|
-
/**
|
|
25
|
-
* Locale fra date-fns som brukes av Datepicker-en
|
|
26
|
-
* @default nb
|
|
27
|
-
*/
|
|
28
|
-
locale?: Locale;
|
|
29
|
-
/** Placeholder om ingen dato er valgt
|
|
30
|
-
* @default "dd.mm.yyyy"
|
|
31
|
-
*/
|
|
32
|
-
placeholder?: string;
|
|
33
|
-
/** Ekstra klassenavn */
|
|
34
|
-
className?: string;
|
|
35
|
-
/** Label over DatePicker */
|
|
6
|
+
/** Den valgte datoen. Dato i '@internationalized/date'-pakkens format */
|
|
7
|
+
selectedDate: DateValue;
|
|
8
|
+
/** Kalles når tiden endres. Dato i '@internationalized/date'-pakkens format */
|
|
9
|
+
onChange: (date: DateValue) => void;
|
|
10
|
+
/** Ledetekst for inputfeltet til DatePicker */
|
|
36
11
|
label: string;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
12
|
+
/** BCP47-språkkoden til locale-en du ønsker å bruke.
|
|
13
|
+
* @default Brukerenhetens selvvalgte locale
|
|
39
14
|
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
15
|
+
locale?: string;
|
|
16
|
+
/** Viser den gjeldende tidssonen hvis en er valgt (krever at tid også vises)
|
|
17
|
+
* @default false
|
|
42
18
|
*/
|
|
19
|
+
showTimeZone?: boolean;
|
|
20
|
+
/** Viser tidspunkt i tillegg til dato.
|
|
21
|
+
* OBS: selectedDate må være av typen CalendarDateTime eller ZonedDateTime
|
|
22
|
+
*/
|
|
23
|
+
showTime?: boolean;
|
|
24
|
+
/** Tidligste gyldige datovalg.
|
|
25
|
+
* Eks: today(getLocalTimeZone()) == i dag i lokal tidssone. */
|
|
26
|
+
minDate?: DateValue;
|
|
27
|
+
/** Seneste gyldige datovalg.
|
|
28
|
+
* Eks: today(getLocalTimeZone()) == i dag i lokal tidssone
|
|
29
|
+
*
|
|
30
|
+
* OBS: Hvis du bruker dato med tid vil det være til, men ikke med denne datoen */
|
|
31
|
+
maxDate?: DateValue;
|
|
32
|
+
/** Funksjon som tar inn en dato og sier om den er utilgjengelig.
|
|
33
|
+
* Eks. (date) => isWeekend(date, 'no-NO') == helgedager er ikke tilgjengelig */
|
|
34
|
+
isDateUnavailable?: (date: DateValue) => boolean;
|
|
35
|
+
/** Varselmelding, som vil komme under DatePicker sitt inputfelt */
|
|
36
|
+
feedback?: string;
|
|
37
|
+
/** Valideringsvariant */
|
|
43
38
|
variant?: VariantType;
|
|
44
|
-
/** Varselmelding
|
|
39
|
+
/** Varselmelding som forteller om ugyldig dato
|
|
45
40
|
* @default "Ugyldig dato"
|
|
46
41
|
*/
|
|
47
42
|
validationFeedback?: string;
|
|
48
|
-
/** Valideringsvariant for melding om
|
|
43
|
+
/** Valideringsvariant for melding om ugyldig dato
|
|
49
44
|
* @default "error"
|
|
50
45
|
*/
|
|
51
46
|
validationVariant?: VariantType;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
disableLabelAnimation?: boolean;
|
|
57
|
-
/** Tekst eller ikon som kommer før inputfelter
|
|
58
|
-
* @default <DateIcon />
|
|
59
|
-
*/
|
|
60
|
-
prepend?: React.ReactNode;
|
|
61
|
-
/**
|
|
62
|
-
* Tekst som vises når kalender ikke er åpen på «Åpne/Lukk kalender»-knappen ved hover
|
|
63
|
-
*/
|
|
64
|
-
calendarButtonTooltipOpen?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Tekst som vises når kalender er åpen på «Åpne/Lukk kalender»-knappen ved hover
|
|
67
|
-
*/
|
|
68
|
-
calendarButtonTooltipClose?: string;
|
|
69
|
-
/** Skjuler knapp for åpning av kalender
|
|
70
|
-
* @default false
|
|
71
|
-
*/
|
|
72
|
-
hideCalendarButton?: boolean;
|
|
73
|
-
/** Skjuler tilbakemeldingsteksten ved feil dato-input
|
|
74
|
-
* @default false
|
|
75
|
-
*/
|
|
76
|
-
hideValidation?: boolean;
|
|
77
|
-
/** Skjuler kalender-GUI-et
|
|
78
|
-
* @default false
|
|
79
|
-
*/
|
|
80
|
-
hideCalendar?: boolean;
|
|
81
|
-
/** Viser kun kalender-popover-en
|
|
82
|
-
* @default false
|
|
83
|
-
*/
|
|
84
|
-
inline?: boolean;
|
|
85
|
-
/** Skjermlesertekst for forrige måned-knapen
|
|
86
|
-
* @default "Forrige måned"
|
|
87
|
-
*/
|
|
88
|
-
previousMonthAriaLabel?: string;
|
|
89
|
-
/** Skjermlesertekst for neste måned-knapen
|
|
90
|
-
* @default "Neste måned"
|
|
91
|
-
*/
|
|
92
|
-
nextMonthAriaLabel?: string;
|
|
93
|
-
/**
|
|
94
|
-
* Skjermlesertekst som leses før dato i kalenderGUI-et
|
|
95
|
-
* @default "Velg"
|
|
96
|
-
*/
|
|
97
|
-
chooseDayAriaLabelPrefix?: string;
|
|
98
|
-
'data-cy'?: any;
|
|
99
|
-
} & Omit<ReactDatePickerProps, 'selected' | 'customInput' | 'onChangeRaw' | 'dateFormat' | 'locale' | 'previousMonthAriaLabel' | 'nextMonthAriaLabel'>;
|
|
100
|
-
export declare const DatePicker: React.ForwardRefExoticComponent<{
|
|
101
|
-
/** Hva som er den valgte datoen */
|
|
102
|
-
selectedDate: Date | null;
|
|
103
|
-
/** Kalles når datoen/tiden endres */
|
|
104
|
-
onChange: (date: Date | null, event: React.SyntheticEvent<any, Event> | undefined) => void;
|
|
105
|
-
/**
|
|
106
|
-
* Kalles når en tast trykkes i inputfeltet
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** Hvis true vil kalenderen alltid vises i en popover når den åpnes
|
|
49
|
+
* @default false
|
|
107
50
|
*/
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
* Format-valg tilgjengelig her: https://date-fns.org/v2.28.0/docs/format
|
|
112
|
-
* OBS: Noen kombinasjoner av datoformater kan gi rar og uønsket oppførsel,
|
|
113
|
-
* test nøye ved endring
|
|
114
|
-
* @default "['dd.MM.yyyy', 'ddMMyyyy', 'dd/MM/yyyy', 'ddMMyy']"
|
|
51
|
+
disableModal?: boolean;
|
|
52
|
+
/** Maxbredden til viewport-en for at modal skal vises
|
|
53
|
+
* @default 1000
|
|
115
54
|
*/
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
* @default
|
|
55
|
+
modalTreshold?: number;
|
|
56
|
+
labelTooltip?: React.ReactNode;
|
|
57
|
+
/** Skjermlesertest som forklarer navigasjon i kalenderen. Oversettes automatisk for engelsk locale, men ikke andre språk.
|
|
58
|
+
* @default 'Bruk piltastene til å navigere mellom datoer'
|
|
120
59
|
*/
|
|
121
|
-
|
|
122
|
-
/** Placeholder om ingen dato er valgt
|
|
123
|
-
* @default "dd.mm.yyyy"
|
|
124
|
-
*/
|
|
125
|
-
placeholder?: string | undefined;
|
|
60
|
+
navigationDescription?: string;
|
|
126
61
|
/** Ekstra klassenavn */
|
|
127
|
-
className?: string
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
* Varselmelding, som vil komme under DatePicker
|
|
132
|
-
*/
|
|
133
|
-
feedback?: string | undefined;
|
|
134
|
-
/** Valideringsvariant
|
|
135
|
-
*/
|
|
136
|
-
variant?: VariantType | undefined;
|
|
137
|
-
/** Varselmelding for når datoen er på feil format
|
|
138
|
-
* @default "Ugyldig dato"
|
|
139
|
-
*/
|
|
140
|
-
validationFeedback?: string | undefined;
|
|
141
|
-
/** Valideringsvariant for melding om feil datoformat
|
|
142
|
-
* @default "error"
|
|
143
|
-
*/
|
|
144
|
-
validationVariant?: VariantType | undefined;
|
|
145
|
-
style?: React.CSSProperties | undefined;
|
|
146
|
-
/** Plasserer labelen statisk på toppen av inputfeltet
|
|
147
|
-
* @default false
|
|
148
|
-
*/
|
|
149
|
-
disableLabelAnimation?: boolean | undefined;
|
|
150
|
-
/** Tekst eller ikon som kommer før inputfelter
|
|
151
|
-
* @default <DateIcon />
|
|
152
|
-
*/
|
|
153
|
-
prepend?: React.ReactNode;
|
|
154
|
-
/**
|
|
155
|
-
* Tekst som vises når kalender ikke er åpen på «Åpne/Lukk kalender»-knappen ved hover
|
|
156
|
-
*/
|
|
157
|
-
calendarButtonTooltipOpen?: string | undefined;
|
|
158
|
-
/**
|
|
159
|
-
* Tekst som vises når kalender er åpen på «Åpne/Lukk kalender»-knappen ved hover
|
|
160
|
-
*/
|
|
161
|
-
calendarButtonTooltipClose?: string | undefined;
|
|
162
|
-
/** Skjuler knapp for åpning av kalender
|
|
163
|
-
* @default false
|
|
164
|
-
*/
|
|
165
|
-
hideCalendarButton?: boolean | undefined;
|
|
166
|
-
/** Skjuler tilbakemeldingsteksten ved feil dato-input
|
|
167
|
-
* @default false
|
|
168
|
-
*/
|
|
169
|
-
hideValidation?: boolean | undefined;
|
|
170
|
-
/** Skjuler kalender-GUI-et
|
|
171
|
-
* @default false
|
|
172
|
-
*/
|
|
173
|
-
hideCalendar?: boolean | undefined;
|
|
174
|
-
/** Viser kun kalender-popover-en
|
|
175
|
-
* @default false
|
|
176
|
-
*/
|
|
177
|
-
inline?: boolean | undefined;
|
|
178
|
-
/** Skjermlesertekst for forrige måned-knapen
|
|
179
|
-
* @default "Forrige måned"
|
|
180
|
-
*/
|
|
181
|
-
previousMonthAriaLabel?: string | undefined;
|
|
182
|
-
/** Skjermlesertekst for neste måned-knapen
|
|
183
|
-
* @default "Neste måned"
|
|
184
|
-
*/
|
|
185
|
-
nextMonthAriaLabel?: string | undefined;
|
|
186
|
-
/**
|
|
187
|
-
* Skjermlesertekst som leses før dato i kalenderGUI-et
|
|
188
|
-
* @default "Velg"
|
|
189
|
-
*/
|
|
190
|
-
chooseDayAriaLabelPrefix?: string | undefined;
|
|
191
|
-
'data-cy'?: any;
|
|
192
|
-
} & Omit<ReactDatePickerProps<never, undefined>, "selected" | "customInput" | "onChangeRaw" | "dateFormat" | "locale" | "previousMonthAriaLabel" | "nextMonthAriaLabel"> & React.RefAttributes<HTMLInputElement>>;
|
|
62
|
+
className?: string;
|
|
63
|
+
style?: React.CSSProperties;
|
|
64
|
+
} & Omit<AriaDatePickerProps<DateValue>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'>;
|
|
65
|
+
export declare const DatePicker: ({ selectedDate: value, onChange, locale, disabled: isDisabled, showTime, showTimeZone, className, style, variant, feedback, validationVariant, validationFeedback, disableModal, labelTooltip, navigationDescription, minDate: minValue, maxDate: maxValue, modalTreshold, ...rest }: DatePickerProps) => JSX.Element;
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TimeValue, AriaTimeFieldProps } from '@react-types/datepicker';
|
|
3
3
|
import { VariantType } from '@entur/form';
|
|
4
4
|
import './TimePicker.scss';
|
|
5
5
|
export declare type TimePickerProps = {
|
|
@@ -38,7 +38,7 @@ export declare type TimePickerProps = {
|
|
|
38
38
|
/** Ekstra klassenavn */
|
|
39
39
|
className?: string;
|
|
40
40
|
style?: React.CSSProperties;
|
|
41
|
-
} & Omit<
|
|
41
|
+
} & Omit<AriaTimeFieldProps<TimeValue>, 'onChange' | 'label' | 'hideTimeZone' | 'placeholder'>;
|
|
42
42
|
export declare const TimePicker: React.ForwardRefExoticComponent<{
|
|
43
43
|
/** Den valgte tiden. Tid i '@internationalized/date'-pakkens format */
|
|
44
44
|
selectedTime: TimeValue | null;
|
|
@@ -75,4 +75,4 @@ export declare const TimePicker: React.ForwardRefExoticComponent<{
|
|
|
75
75
|
/** Ekstra klassenavn */
|
|
76
76
|
className?: string | undefined;
|
|
77
77
|
style?: React.CSSProperties | undefined;
|
|
78
|
-
} & Omit<
|
|
78
|
+
} & Omit<AriaTimeFieldProps<TimeValue>, "onChange" | "label" | "hideTimeZone" | "placeholder"> & React.RefAttributes<HTMLDivElement>>;
|