@entur/datepicker 9.2.0-beta.0 → 9.3.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/Calendar.d.ts +16 -5
- package/dist/DatePicker/CalendarCell.d.ts +2 -1
- package/dist/DatePicker/CalendarGrid.d.ts +3 -1
- package/dist/DatePicker/DatePicker.d.ts +8 -1
- package/dist/datepicker.cjs.development.js +80 -44
- 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 +81 -46
- package/dist/datepicker.esm.js.map +1 -1
- package/dist/shared/utils.d.ts +2 -0
- package/dist/styles.css +35 -27
- package/package.json +10 -10
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CalendarDate, DateValue } from '@internationalized/date';
|
|
3
|
+
import { MappedDateValue } from '@react-types/datepicker';
|
|
3
4
|
import './Calendar.scss';
|
|
4
|
-
export type CalendarProps = {
|
|
5
|
-
selectedDate:
|
|
6
|
-
onChange: (SelectedDate:
|
|
5
|
+
export type CalendarProps<DateType extends DateValue> = {
|
|
6
|
+
selectedDate: DateType | null;
|
|
7
|
+
onChange: (SelectedDate: MappedDateValue<DateType> | null) => void | React.Dispatch<React.SetStateAction<DateType | null>>;
|
|
7
8
|
navigationDescription?: string;
|
|
8
9
|
style?: React.CSSProperties;
|
|
10
|
+
/** Ekstra klassenavn */
|
|
11
|
+
className?: string;
|
|
9
12
|
onSelectedCellClick?: () => void;
|
|
10
13
|
/** Tidligste gyldige datovalg.
|
|
11
14
|
* Eks: today(getLocalTimeZone()) == i dag i lokal tidssone.
|
|
@@ -21,6 +24,13 @@ export type CalendarProps = {
|
|
|
21
24
|
* Gyldig til og med den tiden som legges inn som maxDate.
|
|
22
25
|
* Dato uten tid vil være gyldig hele maxDate-dagen */
|
|
23
26
|
maxDate?: DateValue;
|
|
27
|
+
/** Slå på visning av ukenummere i kalenderen. Overskriften for ukenummer-kolonnen
|
|
28
|
+
* kan endres med prop-en 'weekNumberHeader'
|
|
29
|
+
* @default false */
|
|
30
|
+
showWeekNumbers?: boolean;
|
|
31
|
+
/** Overskrift som vises for ukenummer-kolonnen. Vises kun hvis 'showWeekNumbers' er true.
|
|
32
|
+
* @default 'uke' */
|
|
33
|
+
weekNumberHeader?: string;
|
|
24
34
|
/** Brukes for å legge til klassenavn på spesifikke datoer i kalenderen.
|
|
25
35
|
* Tar inn en dato og skal returnere klassenavnet som skal legges til den datoen.
|
|
26
36
|
* @default undefined
|
|
@@ -36,6 +46,7 @@ export type CalendarProps = {
|
|
|
36
46
|
* @example (date) => isWeekend(date, 'no-NO') ? 'helgedag' : ''
|
|
37
47
|
*/
|
|
38
48
|
ariaLabelForDate?: (date: CalendarDate) => string;
|
|
39
|
-
|
|
49
|
+
locale?: string;
|
|
50
|
+
calendarRef?: React.MutableRefObject<HTMLDivElement | null>;
|
|
40
51
|
};
|
|
41
|
-
export declare const Calendar:
|
|
52
|
+
export declare const Calendar: <DateType extends DateValue>({ locale: localOverride, ...rest }: CalendarProps<DateType>) => React.JSX.Element;
|
|
@@ -4,9 +4,10 @@ import { CalendarDate } from '@internationalized/date';
|
|
|
4
4
|
type CalendarCellProps = {
|
|
5
5
|
state: CalendarState;
|
|
6
6
|
date: CalendarDate;
|
|
7
|
+
weekNumberString: string;
|
|
7
8
|
onSelectedCellClick?: () => void;
|
|
8
9
|
classNameForDate?: (date: CalendarDate) => string;
|
|
9
10
|
ariaLabelForDate?: (date: CalendarDate) => string;
|
|
10
11
|
};
|
|
11
|
-
export declare const CalendarCell: ({ state, date, onSelectedCellClick, classNameForDate, ariaLabelForDate, ...rest }: CalendarCellProps) => React.JSX.Element;
|
|
12
|
+
export declare const CalendarCell: ({ state, date, onSelectedCellClick, weekNumberString, classNameForDate, ariaLabelForDate, ...rest }: CalendarCellProps) => React.JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -4,9 +4,11 @@ import { CalendarDate } from '@internationalized/date';
|
|
|
4
4
|
type CalendarGridProps = {
|
|
5
5
|
state: CalendarState;
|
|
6
6
|
navigationDescription?: string;
|
|
7
|
+
showWeekNumbers: boolean;
|
|
8
|
+
weekNumberHeader: string;
|
|
7
9
|
onSelectedCellClick?: () => void;
|
|
8
10
|
classNameForDate?: (date: CalendarDate) => string;
|
|
9
11
|
ariaLabelForDate?: (date: CalendarDate) => string;
|
|
10
12
|
};
|
|
11
|
-
export declare const CalendarGrid: ({ state, navigationDescription, onSelectedCellClick, classNameForDate, ariaLabelForDate, ...rest }: CalendarGridProps) => React.JSX.Element;
|
|
13
|
+
export declare const CalendarGrid: ({ state, navigationDescription, onSelectedCellClick, showWeekNumbers, weekNumberHeader, classNameForDate, ariaLabelForDate, ...rest }: CalendarGridProps) => React.JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -52,6 +52,13 @@ export type DatePickerProps<DateType extends DateValue> = {
|
|
|
52
52
|
*/
|
|
53
53
|
validationVariant?: VariantType;
|
|
54
54
|
disabled?: boolean;
|
|
55
|
+
/** Slå på visning av ukenummere i kalenderen. Overskriften for ukenummer-kolonnen
|
|
56
|
+
* kan endres med prop-en 'weekNumberHeader'
|
|
57
|
+
* @default false */
|
|
58
|
+
showWeekNumbers?: boolean;
|
|
59
|
+
/** Overskrift som vises for ukenummer-kolonnen. Vises kun hvis 'showWeekNumbers' er true.
|
|
60
|
+
* @default '#' */
|
|
61
|
+
weekNumberHeader?: string;
|
|
55
62
|
/** Hvis true vil kalenderen alltid vises i en popover når den åpnes
|
|
56
63
|
* @default false
|
|
57
64
|
*/
|
|
@@ -94,4 +101,4 @@ export type DatePickerProps<DateType extends DateValue> = {
|
|
|
94
101
|
className?: string;
|
|
95
102
|
style?: React.CSSProperties;
|
|
96
103
|
} & Omit<AriaDatePickerProps<DateType>, 'value' | 'onChange' | 'label' | 'hideTimeZone' | 'placeholder' | 'minValue' | 'maxValue'>;
|
|
97
|
-
export declare const DatePicker: <DateType extends DateValue>({ selectedDate, onChange, locale, disabled, showTime, showTimeZone, classNameForDate, className, style, variant, feedback, validationVariant, validationFeedback, disableModal, labelTooltip, navigationDescription, minDate, maxDate, modalTreshold, forcedReturnType, ariaLabelForDate, ...rest }: DatePickerProps<DateType>) => React.JSX.Element;
|
|
104
|
+
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;
|
|
@@ -197,6 +197,21 @@ var focusSegment = function focusSegment(ref, segment) {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
+
/** Based on code from https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php */
|
|
201
|
+
function getWeekNumberForDate(date$1) {
|
|
202
|
+
if (date$1 === null) return -1;
|
|
203
|
+
var calendarDate = convertValueToType({
|
|
204
|
+
value: date$1,
|
|
205
|
+
type: 'CalendarDate'
|
|
206
|
+
});
|
|
207
|
+
var firstDayOfWeek = date.startOfWeek(calendarDate, 'no-NO');
|
|
208
|
+
var thursdayOfWeek = firstDayOfWeek.add({
|
|
209
|
+
days: 3
|
|
210
|
+
});
|
|
211
|
+
var firstDayOfYearForThursday = date.startOfYear(thursdayOfWeek);
|
|
212
|
+
var weekNumber = Math.ceil((thursdayOfWeek.compare(firstDayOfYearForThursday) + 1) / 7);
|
|
213
|
+
return weekNumber;
|
|
214
|
+
}
|
|
200
215
|
|
|
201
216
|
var _excluded$a = ["selectedDate", "onChange", "label", "locale", "showTimeZone", "showTime", "granularity", "disabled", "isDisabled", "variant", "feedback", "validationVariant", "validationFeedback", "labelTooltip", "minDate", "maxDate", "style", "className", "labelProps", "append"];
|
|
202
217
|
var DateField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -293,15 +308,16 @@ var CalendarButton = function CalendarButton(_ref) {
|
|
|
293
308
|
}), children);
|
|
294
309
|
};
|
|
295
310
|
|
|
296
|
-
var _excluded$8 = ["state", "date", "onSelectedCellClick", "classNameForDate", "ariaLabelForDate"];
|
|
311
|
+
var _excluded$8 = ["state", "date", "onSelectedCellClick", "weekNumberString", "classNameForDate", "ariaLabelForDate"];
|
|
297
312
|
var CalendarCell = function CalendarCell(_ref) {
|
|
298
|
-
var _ariaLabelForDate, _classNameForDate, _state$timeZone;
|
|
313
|
+
var _ariaLabelForDate, _classNameForDate, _state$timeZone, _classNames;
|
|
299
314
|
var state = _ref.state,
|
|
300
315
|
date$1 = _ref.date,
|
|
301
316
|
_ref$onSelectedCellCl = _ref.onSelectedCellClick,
|
|
302
317
|
onSelectedCellClick = _ref$onSelectedCellCl === void 0 ? function () {
|
|
303
318
|
return;
|
|
304
319
|
} : _ref$onSelectedCellCl,
|
|
320
|
+
weekNumberString = _ref.weekNumberString,
|
|
305
321
|
classNameForDate = _ref.classNameForDate,
|
|
306
322
|
ariaLabelForDate = _ref.ariaLabelForDate,
|
|
307
323
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
@@ -316,19 +332,15 @@ var CalendarCell = function CalendarCell(_ref) {
|
|
|
316
332
|
isDisabled = _useCalendarCell.isDisabled,
|
|
317
333
|
isUnavailable = _useCalendarCell.isUnavailable,
|
|
318
334
|
formattedDate = _useCalendarCell.formattedDate;
|
|
319
|
-
var ariaLabel = buttonProps['aria-label'] + " " + ((_ariaLabelForDate = ariaLabelForDate == null ? void 0 : ariaLabelForDate(date$1)) != null ? _ariaLabelForDate : '');
|
|
335
|
+
var ariaLabel = "" + buttonProps['aria-label'] + weekNumberString + " " + ((_ariaLabelForDate = ariaLabelForDate == null ? void 0 : ariaLabelForDate(date$1)) != null ? _ariaLabelForDate : '');
|
|
320
336
|
return React.createElement("td", _extends({}, cellProps, {
|
|
321
337
|
className: "eds-datepicker__calendar__grid__cell__td"
|
|
322
338
|
}), React.createElement("div", _extends({}, buttonProps, {
|
|
323
339
|
"aria-label": ariaLabel,
|
|
340
|
+
"aria-hidden": isOutsideVisibleRange,
|
|
324
341
|
ref: cellRef,
|
|
325
342
|
hidden: isOutsideVisibleRange,
|
|
326
|
-
className: classNames('eds-datepicker__calendar__grid__cell', [(_classNameForDate = classNameForDate == null ? void 0 : classNameForDate(date$1)) != null ? _classNameForDate : ''],
|
|
327
|
-
'eds-datepicker__calendar__grid__cell--selected': isSelected,
|
|
328
|
-
'eds-datepicker__calendar__grid__cell--disabled': isDisabled || isUnavailable,
|
|
329
|
-
'eds-datepicker__calendar__grid__cell--outside-month': isOutsideVisibleRange,
|
|
330
|
-
'eds-datepicker__calendar__grid__cell--today': date.isEqualDay(date$1, date.now((_state$timeZone = state.timeZone) != null ? _state$timeZone : date.getLocalTimeZone()))
|
|
331
|
-
})
|
|
343
|
+
className: classNames('eds-datepicker__calendar__grid__cell', (_classNames = {}, _classNames[(_classNameForDate = classNameForDate == null ? void 0 : classNameForDate(date$1)) != null ? _classNameForDate : ''] = !isOutsideVisibleRange, _classNames['eds-datepicker__calendar__grid__cell--selected'] = isSelected, _classNames['eds-datepicker__calendar__grid__cell--disabled'] = isDisabled || isUnavailable, _classNames['eds-datepicker__calendar__grid__cell--outside-month'] = isOutsideVisibleRange, _classNames['eds-datepicker__calendar__grid__cell--today'] = date.isEqualDay(date$1, date.now((_state$timeZone = state.timeZone) != null ? _state$timeZone : date.getLocalTimeZone())), _classNames))
|
|
332
344
|
}, rest, {
|
|
333
345
|
onClick: function onClick(e) {
|
|
334
346
|
buttonProps.onClick && buttonProps.onClick(e);
|
|
@@ -341,7 +353,7 @@ var CalendarCell = function CalendarCell(_ref) {
|
|
|
341
353
|
}), formattedDate));
|
|
342
354
|
};
|
|
343
355
|
|
|
344
|
-
var _excluded$7 = ["state", "navigationDescription", "onSelectedCellClick", "classNameForDate", "ariaLabelForDate"];
|
|
356
|
+
var _excluded$7 = ["state", "navigationDescription", "onSelectedCellClick", "showWeekNumbers", "weekNumberHeader", "classNameForDate", "ariaLabelForDate"];
|
|
345
357
|
var CalendarGrid = function CalendarGrid(_ref) {
|
|
346
358
|
var state = _ref.state,
|
|
347
359
|
navigationDescription = _ref.navigationDescription,
|
|
@@ -349,6 +361,8 @@ var CalendarGrid = function CalendarGrid(_ref) {
|
|
|
349
361
|
onSelectedCellClick = _ref$onSelectedCellCl === void 0 ? function () {
|
|
350
362
|
return;
|
|
351
363
|
} : _ref$onSelectedCellCl,
|
|
364
|
+
showWeekNumbers = _ref.showWeekNumbers,
|
|
365
|
+
weekNumberHeader = _ref.weekNumberHeader,
|
|
352
366
|
classNameForDate = _ref.classNameForDate,
|
|
353
367
|
ariaLabelForDate = _ref.ariaLabelForDate,
|
|
354
368
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
@@ -379,19 +393,26 @@ var CalendarGrid = function CalendarGrid(_ref) {
|
|
|
379
393
|
return React.createElement(React.Fragment, null, React.createElement("table", _extends({}, gridProps, {
|
|
380
394
|
cellSpacing: "0",
|
|
381
395
|
className: "eds-datepicker__calendar__grid"
|
|
382
|
-
}), React.createElement("thead", _extends({}, headerProps), React.createElement("tr", null,
|
|
396
|
+
}), React.createElement("thead", _extends({}, headerProps), React.createElement("tr", null, showWeekNumbers && React.createElement("th", {
|
|
397
|
+
className: "eds-datepicker__calendar__grid__weeknumber-header"
|
|
398
|
+
}, weekNumberHeader), weekDaysMapped().map(function (day, index) {
|
|
383
399
|
return React.createElement("th", {
|
|
384
400
|
key: index
|
|
385
401
|
}, day);
|
|
386
402
|
}))), React.createElement("tbody", null, weeksArray.map(function (weekIndex) {
|
|
403
|
+
var weekNumber = getWeekNumberForDate(state.getDatesInWeek(weekIndex)[0]);
|
|
387
404
|
return React.createElement("tr", {
|
|
388
405
|
key: weekIndex
|
|
389
|
-
},
|
|
406
|
+
}, showWeekNumbers && React.createElement("th", {
|
|
407
|
+
"aria-hidden": true,
|
|
408
|
+
className: "eds-datepicker__calendar__grid__weeknumber"
|
|
409
|
+
}, weekNumber), state.getDatesInWeek(weekIndex).map(function (date, i) {
|
|
390
410
|
return date ? React.createElement(CalendarCell, {
|
|
391
411
|
key: i,
|
|
392
412
|
state: state,
|
|
393
413
|
date: date,
|
|
394
414
|
"aria-describedby": calendarGridId + 'description',
|
|
415
|
+
weekNumberString: showWeekNumbers ? ", " + weekNumberHeader + " " + weekNumber + "," : '',
|
|
395
416
|
onSelectedCellClick: onSelectedCellClick,
|
|
396
417
|
classNameForDate: classNameForDate,
|
|
397
418
|
ariaLabelForDate: ariaLabelForDate
|
|
@@ -404,28 +425,43 @@ var CalendarGrid = function CalendarGrid(_ref) {
|
|
|
404
425
|
}, getNavigationDescription()));
|
|
405
426
|
};
|
|
406
427
|
|
|
407
|
-
var _excluded$6 = ["
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
customLocale = _ref.locale,
|
|
412
|
-
minDate = _ref.minDate,
|
|
413
|
-
maxDate = _ref.maxDate,
|
|
414
|
-
style = _ref.style,
|
|
415
|
-
navigationDescription = _ref.navigationDescription,
|
|
416
|
-
_ref$onSelectedCellCl = _ref.onSelectedCellClick,
|
|
417
|
-
onSelectedCellClick = _ref$onSelectedCellCl === void 0 ? function () {
|
|
418
|
-
return;
|
|
419
|
-
} : _ref$onSelectedCellCl,
|
|
420
|
-
classNameForDate = _ref.classNameForDate,
|
|
421
|
-
ariaLabelForDate = _ref.ariaLabelForDate,
|
|
428
|
+
var _excluded$6 = ["locale"],
|
|
429
|
+
_excluded2$3 = ["selectedDate", "onChange", "minDate", "maxDate", "showWeekNumbers", "weekNumberHeader", "style", "className", "navigationDescription", "onSelectedCellClick", "classNameForDate", "ariaLabelForDate", "calendarRef"];
|
|
430
|
+
var Calendar = function Calendar(_ref) {
|
|
431
|
+
var localOverride = _ref.locale,
|
|
422
432
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
423
433
|
var _useLocale = i18n.useLocale(),
|
|
424
434
|
locale = _useLocale.locale;
|
|
435
|
+
return React.createElement(i18n.I18nProvider, {
|
|
436
|
+
locale: localOverride != null ? localOverride : locale
|
|
437
|
+
}, React.createElement(CalendarBase, _extends({}, rest)));
|
|
438
|
+
};
|
|
439
|
+
var CalendarBase = function CalendarBase(_ref2) {
|
|
440
|
+
var selectedDate = _ref2.selectedDate,
|
|
441
|
+
onChange = _ref2.onChange,
|
|
442
|
+
minDate = _ref2.minDate,
|
|
443
|
+
maxDate = _ref2.maxDate,
|
|
444
|
+
_ref2$showWeekNumbers = _ref2.showWeekNumbers,
|
|
445
|
+
showWeekNumbers = _ref2$showWeekNumbers === void 0 ? false : _ref2$showWeekNumbers,
|
|
446
|
+
_ref2$weekNumberHeade = _ref2.weekNumberHeader,
|
|
447
|
+
weekNumberHeader = _ref2$weekNumberHeade === void 0 ? 'uke' : _ref2$weekNumberHeade,
|
|
448
|
+
style = _ref2.style,
|
|
449
|
+
className = _ref2.className,
|
|
450
|
+
navigationDescription = _ref2.navigationDescription,
|
|
451
|
+
_ref2$onSelectedCellC = _ref2.onSelectedCellClick,
|
|
452
|
+
onSelectedCellClick = _ref2$onSelectedCellC === void 0 ? function () {
|
|
453
|
+
return;
|
|
454
|
+
} : _ref2$onSelectedCellC,
|
|
455
|
+
classNameForDate = _ref2.classNameForDate,
|
|
456
|
+
ariaLabelForDate = _ref2.ariaLabelForDate,
|
|
457
|
+
calendarRef = _ref2.calendarRef,
|
|
458
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
459
|
+
var _useLocale2 = i18n.useLocale(),
|
|
460
|
+
locale = _useLocale2.locale;
|
|
425
461
|
var allProps = _extends({}, rest, {
|
|
426
462
|
value: selectedDate,
|
|
427
463
|
onChange: onChange,
|
|
428
|
-
locale:
|
|
464
|
+
locale: locale,
|
|
429
465
|
createCalendar: createCalendar,
|
|
430
466
|
minValue: minDate,
|
|
431
467
|
maxValue: maxDate
|
|
@@ -436,16 +472,9 @@ var Calendar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
436
472
|
prevButtonProps = _useCalendar.prevButtonProps,
|
|
437
473
|
nextButtonProps = _useCalendar.nextButtonProps,
|
|
438
474
|
title = _useCalendar.title;
|
|
439
|
-
return React.createElement(
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return React.createElement(i18n.I18nProvider, {
|
|
443
|
-
locale: customLocale
|
|
444
|
-
}, child);
|
|
445
|
-
}
|
|
446
|
-
}, React.createElement("div", _extends({}, calendarProps, {
|
|
447
|
-
ref: ref,
|
|
448
|
-
className: "eds-datepicker__calendar",
|
|
475
|
+
return React.createElement("div", _extends({}, calendarProps, {
|
|
476
|
+
ref: calendarRef,
|
|
477
|
+
className: classNames('eds-datepicker__calendar', className),
|
|
449
478
|
style: style
|
|
450
479
|
}), React.createElement("div", {
|
|
451
480
|
className: "eds-datepicker__calendar__header"
|
|
@@ -462,11 +491,13 @@ var Calendar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
462
491
|
navigationDescription: navigationDescription,
|
|
463
492
|
onSelectedCellClick: onSelectedCellClick,
|
|
464
493
|
classNameForDate: classNameForDate,
|
|
465
|
-
ariaLabelForDate: ariaLabelForDate
|
|
466
|
-
|
|
467
|
-
|
|
494
|
+
ariaLabelForDate: ariaLabelForDate,
|
|
495
|
+
showWeekNumbers: showWeekNumbers,
|
|
496
|
+
weekNumberHeader: weekNumberHeader
|
|
497
|
+
}));
|
|
498
|
+
};
|
|
468
499
|
|
|
469
|
-
var _excluded$5 = ["selectedDate", "onChange", "locale", "disabled", "showTime", "showTimeZone", "classNameForDate", "className", "style", "variant", "feedback", "validationVariant", "validationFeedback", "disableModal", "labelTooltip", "navigationDescription", "minDate", "maxDate", "modalTreshold", "forcedReturnType", "ariaLabelForDate"];
|
|
500
|
+
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"];
|
|
470
501
|
var DatePicker = function DatePicker(_ref) {
|
|
471
502
|
var selectedDate = _ref.selectedDate,
|
|
472
503
|
onChange = _ref.onChange,
|
|
@@ -481,6 +512,8 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
481
512
|
feedback = _ref.feedback,
|
|
482
513
|
validationVariant = _ref.validationVariant,
|
|
483
514
|
validationFeedback = _ref.validationFeedback,
|
|
515
|
+
showWeekNumbers = _ref.showWeekNumbers,
|
|
516
|
+
weekNumberHeader = _ref.weekNumberHeader,
|
|
484
517
|
_ref$disableModal = _ref.disableModal,
|
|
485
518
|
disableModal = _ref$disableModal === void 0 ? false : _ref$disableModal,
|
|
486
519
|
labelTooltip = _ref.labelTooltip,
|
|
@@ -553,9 +586,11 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
553
586
|
onChange: handleOnChange,
|
|
554
587
|
minDate: minDate,
|
|
555
588
|
maxDate: maxDate,
|
|
556
|
-
|
|
589
|
+
calendarRef: calendarRef,
|
|
557
590
|
classNameForDate: classNameForDate,
|
|
558
|
-
ariaLabelForDate: ariaLabelForDate
|
|
591
|
+
ariaLabelForDate: ariaLabelForDate,
|
|
592
|
+
showWeekNumbers: showWeekNumbers,
|
|
593
|
+
weekNumberHeader: weekNumberHeader
|
|
559
594
|
});
|
|
560
595
|
var useModal = typeof width !== 'undefined' && width <= CALENDAR_MODAL_MAX_SCREEN_WIDTH && !disableModal;
|
|
561
596
|
var popoverCalendar = React.createElement("div", {
|
|
@@ -1139,6 +1174,7 @@ exports.ariaLabelIfNorwegian = ariaLabelIfNorwegian;
|
|
|
1139
1174
|
exports.convertValueToType = convertValueToType;
|
|
1140
1175
|
exports.createCalendar = createCalendar;
|
|
1141
1176
|
exports.focusSegment = focusSegment;
|
|
1177
|
+
exports.getWeekNumberForDate = getWeekNumberForDate;
|
|
1142
1178
|
exports.lastMillisecondOfDay = lastMillisecondOfDay;
|
|
1143
1179
|
exports.modulo = modulo;
|
|
1144
1180
|
exports.nativeDateToDateValue = nativeDateToDateValue;
|