@vaadin/date-time-picker 23.0.0-alpha4 → 23.0.0-alpha5
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-time-picker",
|
|
3
|
-
"version": "23.0.0-
|
|
3
|
+
"version": "23.0.0-alpha5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/component-base": "23.0.0-
|
|
38
|
-
"@vaadin/custom-field": "23.0.0-
|
|
39
|
-
"@vaadin/date-picker": "23.0.0-
|
|
40
|
-
"@vaadin/field-base": "23.0.0-
|
|
41
|
-
"@vaadin/time-picker": "23.0.0-
|
|
42
|
-
"@vaadin/vaadin-lumo-styles": "23.0.0-
|
|
43
|
-
"@vaadin/vaadin-material-styles": "23.0.0-
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "23.0.0-
|
|
37
|
+
"@vaadin/component-base": "23.0.0-alpha5",
|
|
38
|
+
"@vaadin/custom-field": "23.0.0-alpha5",
|
|
39
|
+
"@vaadin/date-picker": "23.0.0-alpha5",
|
|
40
|
+
"@vaadin/field-base": "23.0.0-alpha5",
|
|
41
|
+
"@vaadin/time-picker": "23.0.0-alpha5",
|
|
42
|
+
"@vaadin/vaadin-lumo-styles": "23.0.0-alpha5",
|
|
43
|
+
"@vaadin/vaadin-material-styles": "23.0.0-alpha5",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-alpha5"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@esm-bundle/chai": "^4.3.4",
|
|
48
48
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
49
49
|
"sinon": "^9.2.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "74f9294964eb8552d96578c14af6ad214f5257bc"
|
|
52
52
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { DisabledMixin } from '@vaadin/component-base/src/disabled-mixin.js';
|
|
7
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
|
+
import { FocusMixin } from '@vaadin/component-base/src/focus-mixin.js';
|
|
8
9
|
import { SlotMixin } from '@vaadin/component-base/src/slot-mixin.js';
|
|
9
10
|
import { DatePickerI18n } from '@vaadin/date-picker/src/vaadin-date-picker.js';
|
|
10
11
|
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
@@ -69,6 +70,8 @@ export interface DateTimePickerEventMap extends DateTimePickerCustomEventMap, HT
|
|
|
69
70
|
* Attribute | Description | Part name
|
|
70
71
|
* --------------------|-------------------------------------------|------------
|
|
71
72
|
* `disabled` | Set when the element is disabled | :host
|
|
73
|
+
* `focused` | Set when the element is focused | :host
|
|
74
|
+
* `focus-ring` | Set when the element is keyboard focused | :host
|
|
72
75
|
* `readonly` | Set when the element is readonly | :host
|
|
73
76
|
* `invalid` | Set when the element is invalid | :host
|
|
74
77
|
* `has-label` | Set when the element has a label | :host
|
|
@@ -93,7 +96,9 @@ export interface DateTimePickerEventMap extends DateTimePickerCustomEventMap, HT
|
|
|
93
96
|
* @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
|
|
94
97
|
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
95
98
|
*/
|
|
96
|
-
declare class DateTimePicker extends FieldMixin(
|
|
99
|
+
declare class DateTimePicker extends FieldMixin(
|
|
100
|
+
SlotMixin(DisabledMixin(FocusMixin(ThemableMixin(ElementMixin(HTMLElement)))))
|
|
101
|
+
) {
|
|
97
102
|
/**
|
|
98
103
|
* The name of the control, which is submitted with the form data.
|
|
99
104
|
*/
|
|
@@ -9,6 +9,7 @@ import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nod
|
|
|
9
9
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
10
10
|
import { DisabledMixin } from '@vaadin/component-base/src/disabled-mixin.js';
|
|
11
11
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
|
+
import { FocusMixin } from '@vaadin/component-base/src/focus-mixin.js';
|
|
12
13
|
import { SlotMixin } from '@vaadin/component-base/src/slot-mixin.js';
|
|
13
14
|
import { dateEquals } from '@vaadin/date-picker/src/vaadin-date-picker-helper.js';
|
|
14
15
|
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
|
|
@@ -71,6 +72,8 @@ const timePickerI18nProps = Object.keys(timePickerI18nDefaults);
|
|
|
71
72
|
* Attribute | Description | Part name
|
|
72
73
|
* --------------------|-------------------------------------------|------------
|
|
73
74
|
* `disabled` | Set when the element is disabled | :host
|
|
75
|
+
* `focused` | Set when the element is focused | :host
|
|
76
|
+
* `focus-ring` | Set when the element is keyboard focused | :host
|
|
74
77
|
* `readonly` | Set when the element is readonly | :host
|
|
75
78
|
* `invalid` | Set when the element is invalid | :host
|
|
76
79
|
* `has-label` | Set when the element has a label | :host
|
|
@@ -98,11 +101,14 @@ const timePickerI18nProps = Object.keys(timePickerI18nDefaults);
|
|
|
98
101
|
* @extends HTMLElement
|
|
99
102
|
* @mixes ElementMixin
|
|
100
103
|
* @mixes ThemableMixin
|
|
104
|
+
* @mixes FocusMixin
|
|
101
105
|
* @mixes DisabledMixin
|
|
102
106
|
* @mixes SlotMixin
|
|
103
107
|
* @mixes FieldMixin
|
|
104
108
|
*/
|
|
105
|
-
class DateTimePicker extends FieldMixin(
|
|
109
|
+
class DateTimePicker extends FieldMixin(
|
|
110
|
+
SlotMixin(DisabledMixin(FocusMixin(ThemableMixin(ElementMixin(PolymerElement)))))
|
|
111
|
+
) {
|
|
106
112
|
static get template() {
|
|
107
113
|
return html`
|
|
108
114
|
<style>
|
|
@@ -434,6 +440,28 @@ class DateTimePicker extends FieldMixin(SlotMixin(DisabledMixin(ThemableMixin(El
|
|
|
434
440
|
this.__datePicker.focus();
|
|
435
441
|
}
|
|
436
442
|
|
|
443
|
+
/**
|
|
444
|
+
* Override method inherited from `FocusMixin` to not remove focused
|
|
445
|
+
* state when focus moves between pickers or to the overlay.
|
|
446
|
+
* @param {FocusEvent} event
|
|
447
|
+
* @return {boolean}
|
|
448
|
+
* @protected
|
|
449
|
+
* @override
|
|
450
|
+
*/
|
|
451
|
+
_shouldRemoveFocus(event) {
|
|
452
|
+
const target = event.relatedTarget;
|
|
453
|
+
|
|
454
|
+
if (
|
|
455
|
+
this.__datePicker.contains(target) ||
|
|
456
|
+
this.__timePicker.contains(target) ||
|
|
457
|
+
target === this.__datePicker.$.overlay
|
|
458
|
+
) {
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return true;
|
|
463
|
+
}
|
|
464
|
+
|
|
437
465
|
/** @private */
|
|
438
466
|
__syncI18n(target, source, props) {
|
|
439
467
|
props = props || Object.keys(source.i18n);
|