@vaadin/vaadin-date-picker 4.3.0 → 4.4.2

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/README.md CHANGED
@@ -1,20 +1,18 @@
1
- [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-date-picker)](https://www.npmjs.com/package/@vaadin/vaadin-date-picker)
2
- [![Bower version](https://badgen.net/github/release/vaadin/vaadin-date-picker)](https://github.com/vaadin/vaadin-date-picker/releases)
3
- [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-date-picker)
4
- [![Build Status](https://travis-ci.org/vaadin/vaadin-date-picker.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-date-picker)
5
- [![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-date-picker/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-date-picker?branch=master)
6
- [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1
+ # <vaadin-date-picker>
7
2
 
8
- [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-date-picker)
9
- [![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-date-picker.svg)](https://vaadin.com/directory/component/vaadinvaadin-date-picker)
3
+ > ⚠️ Starting from Vaadin 20, the source code and issues for this component are migrated to the [`vaadin/web-components`](https://github.com/vaadin/web-components/tree/master/packages/vaadin-date-picker) monorepository.
4
+ > This repository contains the source code and releases of `<vaadin-date-picker>` for the Vaadin versions 10 to 19.
10
5
 
11
- # &lt;vaadin-date-picker&gt;
6
+ [&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a Web Component providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components).
12
7
 
13
8
  [Live Demo ↗](https://vaadin.com/components/vaadin-date-picker/html-examples)
14
9
  |
15
10
  [API documentation ↗](https://vaadin.com/components/vaadin-date-picker/html-api)
16
11
 
17
- [&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a Web Component providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components).
12
+ [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-date-picker)](https://www.npmjs.com/package/@vaadin/vaadin-date-picker)
13
+ [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/va
14
+ [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-date-picker)
15
+ [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
18
16
 
19
17
  <!--
20
18
  ```
@@ -80,18 +78,18 @@ To use the Material theme, import the correspondent file from the `theme/materia
80
78
 
81
79
  - The components with the Lumo theme:
82
80
 
83
- `theme/lumo/vaadin-date-picker.html`
81
+ `theme/lumo/vaadin-date-picker.html`
84
82
  `theme/lumo/vaadin-date-picker-light.html`
85
83
 
86
84
  - The components with the Material theme:
87
85
 
88
- `theme/material/vaadin-date-picker.html`
86
+ `theme/material/vaadin-date-picker.html`
89
87
  `theme/material/vaadin-date-picker-light.html`
90
88
 
91
- - Alias for `theme/lumo/vaadin-date-picker.html`
89
+ - Alias for `theme/lumo/vaadin-date-picker.html`
92
90
  `theme/lumo/vaadin-date-picker-light.html`:
93
91
 
94
- `vaadin-date-picker.html`
92
+ `vaadin-date-picker.html`
95
93
  `vaadin-date-picker-light.html`
96
94
 
97
95
 
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "repository": "vaadin/vaadin-date-picker",
11
11
  "homepage": "https://vaadin.com/components",
12
12
  "name": "@vaadin/vaadin-date-picker",
13
- "version": "4.3.0",
13
+ "version": "4.4.2",
14
14
  "main": "vaadin-date-picker.js",
15
15
  "author": "Vaadin Ltd",
16
16
  "license": "Apache-2.0",
@@ -25,6 +25,8 @@
25
25
  "theme"
26
26
  ],
27
27
  "resolutions": {
28
+ "es-abstract": "1.17.6",
29
+ "@types/doctrine": "0.0.3",
28
30
  "inherits": "2.0.3",
29
31
  "samsam": "1.1.3",
30
32
  "supports-color": "3.1.2",
@@ -37,7 +39,7 @@
37
39
  "@polymer/iron-resizable-behavior": "^3.0.0",
38
40
  "@polymer/polymer": "^3.0.0",
39
41
  "@vaadin/vaadin-button": "^2.4.0",
40
- "@vaadin/vaadin-text-field": "^2.7.0",
42
+ "@vaadin/vaadin-text-field": "^2.8.0",
41
43
  "@vaadin/vaadin-themable-mixin": "^1.6.1",
42
44
  "@vaadin/vaadin-control-state-mixin": "^2.2.2",
43
45
  "@vaadin/vaadin-overlay": "^3.5.0",
@@ -46,9 +48,9 @@
46
48
  "@vaadin/vaadin-element-mixin": "^2.4.1"
47
49
  },
48
50
  "scripts": {
49
- "generate-typings": "gen-typescript-declarations --outDir . --verify"
50
- },
51
- "devDependencies": {
51
+ "generate-typings": "gen-typescript-declarations --outDir . --verify"
52
+ },
53
+ "devDependencies": {
52
54
  "@polymer/iron-component-page": "^4.0.0",
53
55
  "@polymer/iron-form": "^3.0.0",
54
56
  "@polymer/iron-icon": "^3.0.0",
@@ -307,7 +307,7 @@ export const DatePickerMixin = subclass => class VaadinDatePickerMixin extends m
307
307
  /** @private */
308
308
  _noInput: {
309
309
  type: Boolean,
310
- computed: '_isNoInput(_fullscreen, _ios, i18n, i18n.*)'
310
+ computed: '_isNoInput(_fullscreen, _ios, i18n, i18n.*, opened, autoOpenDisabled)'
311
311
  },
312
312
 
313
313
  /** @private */
@@ -370,7 +370,7 @@ export const DatePickerMixin = subclass => class VaadinDatePickerMixin extends m
370
370
  });
371
371
 
372
372
  this.addEventListener('touchend', e => {
373
- if (!isClearButton(e)) {
373
+ if (this._noInput && !isClearButton(e)) {
374
374
  e.preventDefault();
375
375
  }
376
376
  });
@@ -498,8 +498,16 @@ export const DatePickerMixin = subclass => class VaadinDatePickerMixin extends m
498
498
  }
499
499
 
500
500
  /** @private */
501
- _isNoInput(fullscreen, ios, i18n) {
502
- return !this._inputElement || fullscreen || ios || !i18n.parseDate;
501
+ _isNoInput(fullscreen, ios, i18n, i18nChanges, opened, autoOpenDisabled) {
502
+ // On fullscreen mode, text input is disabled if auto-open isn't disabled or
503
+ // whenever the dropdown is opened
504
+ const noInputOnFullscreenMode = fullscreen && (!autoOpenDisabled || opened);
505
+ // On iOS, text input is disabled whenever the dropdown is opened, because
506
+ // the virtual keyboard doesn't affect the viewport metrics and thus the
507
+ // dropdown could get covered by the keyboard.
508
+ const noInputOnIos = ios && opened;
509
+
510
+ return !this._inputElement || noInputOnFullscreenMode || noInputOnIos || !i18n.parseDate;
503
511
  }
504
512
 
505
513
  /** @private */
@@ -199,10 +199,10 @@ class DatePickerOverlayContentElement extends
199
199
  </div>
200
200
 
201
201
  <div on-touchend="_preventDefault" role="toolbar" part="toolbar">
202
- <vaadin-button id="todayButton" part="today-button" disabled="[[!_isTodayAllowed(minDate, maxDate)]]" on-tap="_onTodayTap">
202
+ <vaadin-button id="todayButton" theme="tertiary" part="today-button" disabled="[[!_isTodayAllowed(minDate, maxDate)]]" on-tap="_onTodayTap">
203
203
  [[i18n.today]]
204
204
  </vaadin-button>
205
- <vaadin-button id="cancelButton" part="cancel-button" on-tap="_cancel">
205
+ <vaadin-button id="cancelButton" theme="tertiary" part="cancel-button" on-tap="_cancel">
206
206
  [[i18n.cancel]]
207
207
  </vaadin-button>
208
208
  </div>
@@ -134,6 +134,12 @@ declare class DatePickerElement extends
134
134
  */
135
135
  placeholder: string|null|undefined;
136
136
 
137
+ /**
138
+ * String used for the helper text.
139
+ * @attr {string} helper-text
140
+ */
141
+ helperText: string|null|undefined;
142
+
137
143
  /**
138
144
  * Set to true to make this element read-only.
139
145
  */
@@ -124,8 +124,9 @@ class DatePickerElement extends
124
124
  </style>
125
125
 
126
126
 
127
- <vaadin-date-picker-text-field id="input" role="application" autocomplete="off" on-focus="_focus" value="{{_userInputValue}}" invalid="[[invalid]]" label="[[label]]" name="[[name]]" placeholder="[[placeholder]]" required="[[required]]" disabled="[[disabled]]" readonly="[[readonly]]" error-message="[[errorMessage]]" clear-button-visible="[[clearButtonVisible]]" aria-label\$="[[label]]" part="text-field" theme\$="[[theme]]">
127
+ <vaadin-date-picker-text-field id="input" role="application" autocomplete="off" on-focus="_focus" value="{{_userInputValue}}" invalid="[[invalid]]" label="[[label]]" name="[[name]]" placeholder="[[placeholder]]" required="[[required]]" disabled="[[disabled]]" readonly="[[readonly]]" error-message="[[errorMessage]]" clear-button-visible="[[clearButtonVisible]]" aria-label\$="[[label]]" part="text-field" helper-text="[[helperText]]" theme\$="[[theme]]">
128
128
  <slot name="prefix" slot="prefix"></slot>
129
+ <slot name="helper" slot="helper">[[helperText]]</slot>
129
130
  <div part="toggle-button" slot="suffix" on-tap="_toggle" role="button" aria-label\$="[[i18n.calendar]]" aria-expanded\$="[[_getAriaExpanded(opened)]]"></div>
130
131
  </vaadin-date-picker-text-field>
131
132
 
@@ -146,7 +147,7 @@ class DatePickerElement extends
146
147
  }
147
148
 
148
149
  static get version() {
149
- return '4.3.0';
150
+ return '4.4.2';
150
151
  }
151
152
 
152
153
  static get properties() {
@@ -182,6 +183,15 @@ class DatePickerElement extends
182
183
  */
183
184
  placeholder: String,
184
185
 
186
+ /**
187
+ * String used for the helper text.
188
+ * @attr {string} helper-text
189
+ */
190
+ helperText: {
191
+ type: String,
192
+ value: ''
193
+ },
194
+
185
195
  /**
186
196
  * Set to true to make this element read-only.
187
197
  * @type {boolean}
@@ -129,14 +129,8 @@ const $_documentContainer = html`<dom-module id="lumo-date-picker-overlay-conten
129
129
  }
130
130
  }
131
131
 
132
- /* Today and Cancel buttons */
133
-
134
- /* TODO: Would be great if I could apply the "tertiary" theme from here instead of copying those styles */
135
132
  [part="toolbar"] [part\$="button"] {
136
- background-color: transparent;
137
133
  margin: 0;
138
- min-width: 0;
139
- padding: 0 0.75em;
140
134
  }
141
135
 
142
136
  /* Narrow viewport mode (fullscreen) */