@vaadin/date-picker 23.0.5 → 23.0.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/date-picker",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
36
36
|
"@polymer/polymer": "^3.2.0",
|
|
37
|
-
"@vaadin/button": "^23.0.
|
|
38
|
-
"@vaadin/component-base": "^23.0.
|
|
39
|
-
"@vaadin/field-base": "^23.0.
|
|
40
|
-
"@vaadin/input-container": "^23.0.
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "^23.0.
|
|
42
|
-
"@vaadin/vaadin-material-styles": "^23.0.
|
|
43
|
-
"@vaadin/vaadin-overlay": "^23.0.
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "^23.0.
|
|
37
|
+
"@vaadin/button": "^23.0.8",
|
|
38
|
+
"@vaadin/component-base": "^23.0.8",
|
|
39
|
+
"@vaadin/field-base": "^23.0.8",
|
|
40
|
+
"@vaadin/input-container": "^23.0.8",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "^23.0.8",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "^23.0.8",
|
|
43
|
+
"@vaadin/vaadin-overlay": "^23.0.8",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "^23.0.8"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@esm-bundle/chai": "^4.3.4",
|
|
48
|
-
"@vaadin/dialog": "^23.0.
|
|
49
|
-
"@vaadin/polymer-legacy-adapter": "^23.0.
|
|
48
|
+
"@vaadin/dialog": "^23.0.8",
|
|
49
|
+
"@vaadin/polymer-legacy-adapter": "^23.0.8",
|
|
50
50
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
51
51
|
"sinon": "^9.2.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "43fe9d95c8cd745adc7bef214c0097c47f4f83ed"
|
|
54
54
|
}
|
|
@@ -55,6 +55,7 @@ export declare class DatePickerMixinClass {
|
|
|
55
55
|
* Date which should be visible when there is no value selected.
|
|
56
56
|
*
|
|
57
57
|
* The same date formats as for the `value` property are supported.
|
|
58
|
+
* @attr {string} initial-position
|
|
58
59
|
*/
|
|
59
60
|
initialPosition: string | null | undefined;
|
|
60
61
|
|
|
@@ -65,6 +66,7 @@ export declare class DatePickerMixinClass {
|
|
|
65
66
|
|
|
66
67
|
/**
|
|
67
68
|
* Set true to prevent the overlay from opening automatically.
|
|
69
|
+
* @attr {boolean} auto-open-disabled
|
|
68
70
|
*/
|
|
69
71
|
autoOpenDisabled: boolean | null | undefined;
|
|
70
72
|
|
|
@@ -72,6 +74,7 @@ export declare class DatePickerMixinClass {
|
|
|
72
74
|
* Set true to display ISO-8601 week numbers in the calendar. Notice that
|
|
73
75
|
* displaying week numbers is only supported when `i18n.firstDayOfWeek`
|
|
74
76
|
* is 1 (Monday).
|
|
77
|
+
* @attr {boolean} show-week-numbers
|
|
75
78
|
*/
|
|
76
79
|
showWeekNumbers: boolean | null | undefined;
|
|
77
80
|
|
|
@@ -233,6 +233,11 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
|
|
|
233
233
|
|
|
234
234
|
static get properties() {
|
|
235
235
|
return {
|
|
236
|
+
scrollDuration: {
|
|
237
|
+
type: Number,
|
|
238
|
+
default: 300
|
|
239
|
+
},
|
|
240
|
+
|
|
236
241
|
/**
|
|
237
242
|
* The value for this element.
|
|
238
243
|
*/
|
|
@@ -524,7 +529,6 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
|
|
|
524
529
|
return (-c / 2) * (t * (t - 2) - 1) + b;
|
|
525
530
|
};
|
|
526
531
|
|
|
527
|
-
var duration = animate ? 300 : 0;
|
|
528
532
|
var start = 0;
|
|
529
533
|
var initialPosition = this.$.monthScroller.position;
|
|
530
534
|
|
|
@@ -532,8 +536,13 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
|
|
|
532
536
|
start = start || timestamp;
|
|
533
537
|
var currentTime = timestamp - start;
|
|
534
538
|
|
|
535
|
-
if (currentTime <
|
|
536
|
-
var currentPos = easingFunction(
|
|
539
|
+
if (currentTime < this.scrollDuration) {
|
|
540
|
+
var currentPos = easingFunction(
|
|
541
|
+
currentTime,
|
|
542
|
+
initialPosition,
|
|
543
|
+
this._targetPosition - initialPosition,
|
|
544
|
+
this.scrollDuration
|
|
545
|
+
);
|
|
537
546
|
this.$.monthScroller.position = currentPos;
|
|
538
547
|
window.requestAnimationFrame(smoothScroll);
|
|
539
548
|
} else {
|
|
@@ -113,6 +113,7 @@ registerStyles('vaadin-date-picker', [inputFieldShared, datePickerStyles], { mod
|
|
|
113
113
|
* @mixes ElementMixin
|
|
114
114
|
* @mixes ThemableMixin
|
|
115
115
|
* @mixes InputControlMixin
|
|
116
|
+
* @mixes DatePickerMixin
|
|
116
117
|
*/
|
|
117
118
|
class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(ElementMixin(PolymerElement)))) {
|
|
118
119
|
static get is() {
|
|
@@ -23,18 +23,8 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
#monthGrid {
|
|
26
|
-
display: block;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
#monthGrid thead,
|
|
30
|
-
#monthGrid tbody {
|
|
31
|
-
display: block;
|
|
32
26
|
width: 100%;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[part='weekdays'] {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-grow: 1;
|
|
27
|
+
border-collapse: collapse;
|
|
38
28
|
}
|
|
39
29
|
|
|
40
30
|
#days-container tr,
|
|
@@ -53,9 +43,7 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
|
|
|
53
43
|
|
|
54
44
|
[part='weekday'],
|
|
55
45
|
[part='date'] {
|
|
56
|
-
|
|
57
|
-
/* Would use calc(100% / 7) but it doesn't work nice on IE */
|
|
58
|
-
width: 14.285714286%;
|
|
46
|
+
width: calc(100% / 7);
|
|
59
47
|
padding: 0;
|
|
60
48
|
font-weight: normal;
|
|
61
49
|
}
|
|
@@ -64,6 +52,12 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
|
|
|
64
52
|
[part='week-number'] {
|
|
65
53
|
width: 12.5%;
|
|
66
54
|
flex-shrink: 0;
|
|
55
|
+
padding: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([week-numbers]) [part='weekday']:not(:empty),
|
|
59
|
+
:host([week-numbers]) [part='date'] {
|
|
60
|
+
width: 12.5%;
|
|
67
61
|
}
|
|
68
62
|
</style>
|
|
69
63
|
|
|
@@ -68,6 +68,11 @@ registerStyles(
|
|
|
68
68
|
cursor: var(--lumo-clickable-cursor);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
:host([week-numbers]) [part='weekday']:not(:empty),
|
|
72
|
+
:host([week-numbers]) [part='date'] {
|
|
73
|
+
width: calc((100% - var(--lumo-size-xs)) / 7);
|
|
74
|
+
}
|
|
75
|
+
|
|
71
76
|
/* Today date */
|
|
72
77
|
|
|
73
78
|
[part='date'][today] {
|