@vaadin/date-time-picker
Advanced tools
Comparing version 24.6.0-alpha3 to 24.6.0-alpha4
{ | ||
"name": "@vaadin/date-time-picker", | ||
"version": "24.6.0-alpha3", | ||
"version": "24.6.0-alpha4", | ||
"publishConfig": { | ||
@@ -39,14 +39,14 @@ "access": "public" | ||
"@polymer/polymer": "^3.0.0", | ||
"@vaadin/a11y-base": "24.6.0-alpha3", | ||
"@vaadin/component-base": "24.6.0-alpha3", | ||
"@vaadin/custom-field": "24.6.0-alpha3", | ||
"@vaadin/date-picker": "24.6.0-alpha3", | ||
"@vaadin/field-base": "24.6.0-alpha3", | ||
"@vaadin/time-picker": "24.6.0-alpha3", | ||
"@vaadin/vaadin-lumo-styles": "24.6.0-alpha3", | ||
"@vaadin/vaadin-material-styles": "24.6.0-alpha3", | ||
"@vaadin/vaadin-themable-mixin": "24.6.0-alpha3" | ||
"@vaadin/a11y-base": "24.6.0-alpha4", | ||
"@vaadin/component-base": "24.6.0-alpha4", | ||
"@vaadin/custom-field": "24.6.0-alpha4", | ||
"@vaadin/date-picker": "24.6.0-alpha4", | ||
"@vaadin/field-base": "24.6.0-alpha4", | ||
"@vaadin/time-picker": "24.6.0-alpha4", | ||
"@vaadin/vaadin-lumo-styles": "24.6.0-alpha4", | ||
"@vaadin/vaadin-material-styles": "24.6.0-alpha4", | ||
"@vaadin/vaadin-themable-mixin": "24.6.0-alpha4" | ||
}, | ||
"devDependencies": { | ||
"@vaadin/chai-plugins": "24.6.0-alpha3", | ||
"@vaadin/chai-plugins": "24.6.0-alpha4", | ||
"@vaadin/testing-helpers": "^1.0.0", | ||
@@ -59,3 +59,3 @@ "sinon": "^18.0.0" | ||
], | ||
"gitHead": "f917e587caaf86b3d55598233811409b0f34ff69" | ||
"gitHead": "78967d4f3bb46f58f43c2cc621802554acb2efaf" | ||
} |
@@ -14,3 +14,8 @@ /** | ||
import { DatePicker } from '@vaadin/date-picker/src/vaadin-date-picker.js'; | ||
import { dateEquals, parseDate } from '@vaadin/date-picker/src/vaadin-date-picker-helper.js'; | ||
import { | ||
dateEquals, | ||
formatUTCISODate, | ||
normalizeUTCDate, | ||
parseUTCDate, | ||
} from '@vaadin/date-picker/src/vaadin-date-picker-helper.js'; | ||
import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js'; | ||
@@ -625,6 +630,6 @@ import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js'; | ||
const selectedDate = this.__parseDate(this.__datePicker.value); | ||
const isMinMaxSameDay = dateEquals(this.__minDateTime, this.__maxDateTime); | ||
const isMinMaxSameDay = dateEquals(this.__minDateTime, this.__maxDateTime, normalizeUTCDate); | ||
const oldTimeValue = this.__timePicker.value; | ||
if ((this.__minDateTime && dateEquals(selectedDate, this.__minDateTime)) || isMinMaxSameDay) { | ||
if ((this.__minDateTime && dateEquals(selectedDate, this.__minDateTime, normalizeUTCDate)) || isMinMaxSameDay) { | ||
this.__timePicker.min = this.__dateToIsoTimeString(this.__minDateTime); | ||
@@ -635,3 +640,3 @@ } else { | ||
if ((this.__maxDateTime && dateEquals(selectedDate, this.__maxDateTime)) || isMinMaxSameDay) { | ||
if ((this.__maxDateTime && dateEquals(selectedDate, this.__maxDateTime, normalizeUTCDate)) || isMinMaxSameDay) { | ||
this.__timePicker.max = this.__dateToIsoTimeString(this.__maxDateTime); | ||
@@ -762,3 +767,3 @@ } else { | ||
__parseDate(str) { | ||
return parseDate(str); | ||
return parseUTCDate(str); | ||
} | ||
@@ -777,3 +782,3 @@ | ||
} | ||
return DatePicker.prototype._formatISO(date); | ||
return formatUTCISODate(date); | ||
} | ||
@@ -825,6 +830,6 @@ | ||
date.setHours(parseInt(time.hours)); | ||
date.setMinutes(parseInt(time.minutes || 0)); | ||
date.setSeconds(parseInt(time.seconds || 0)); | ||
date.setMilliseconds(parseInt(time.milliseconds || 0)); | ||
date.setUTCHours(parseInt(time.hours)); | ||
date.setUTCMinutes(parseInt(time.minutes || 0)); | ||
date.setUTCSeconds(parseInt(time.seconds || 0)); | ||
date.setUTCMilliseconds(parseInt(time.milliseconds || 0)); | ||
@@ -859,6 +864,6 @@ return date; | ||
this.__validateTime({ | ||
hours: date.getHours(), | ||
minutes: date.getMinutes(), | ||
seconds: date.getSeconds(), | ||
milliseconds: date.getMilliseconds(), | ||
hours: date.getUTCHours(), | ||
minutes: date.getUTCMinutes(), | ||
seconds: date.getUTCSeconds(), | ||
milliseconds: date.getUTCMilliseconds(), | ||
}), | ||
@@ -920,10 +925,10 @@ ); | ||
__dateTimeEquals(date1, date2) { | ||
if (!dateEquals(date1, date2)) { | ||
if (!dateEquals(date1, date2, normalizeUTCDate)) { | ||
return false; | ||
} | ||
return ( | ||
date1.getHours() === date2.getHours() && | ||
date1.getMinutes() === date2.getMinutes() && | ||
date1.getSeconds() === date2.getSeconds() && | ||
date1.getMilliseconds() === date2.getMilliseconds() | ||
date1.getUTCHours() === date2.getUTCHours() && | ||
date1.getUTCMinutes() === date2.getUTCMinutes() && | ||
date1.getUTCSeconds() === date2.getUTCSeconds() && | ||
date1.getUTCMilliseconds() === date2.getUTCMilliseconds() | ||
); | ||
@@ -930,0 +935,0 @@ } |
{ | ||
"$schema": "https://json.schemastore.org/web-types", | ||
"name": "@vaadin/date-time-picker", | ||
"version": "24.6.0-alpha3", | ||
"version": "24.6.0-alpha4", | ||
"description-markup": "markdown", | ||
@@ -11,3 +11,3 @@ "contributions": { | ||
"name": "vaadin-date-time-picker", | ||
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------------------------------------|------------\n`disabled` | Set when the element is disabled | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set when the element is readonly | :host\n`invalid` | Set when the element is invalid | :host\n`has-label` | Set when the element has a label | :host\n`has-value` | Set when the element has a value | :host\n`has-helper` | Set when the element has helper text | :host\n`has-error-message` | Set when the element has an error message | :host\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-time-picker).\n\nNote: the `theme` attribute value set on `<vaadin-date-time-picker>` is\npropagated to these components.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.", | ||
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------------------------------------|------------\n`disabled` | Set when the element is disabled | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set when the element is readonly | :host\n`invalid` | Set when the element is invalid | :host\n`has-label` | Set when the element has a label | :host\n`has-value` | Set when the element has a value | :host\n`has-helper` | Set when the element has helper text | :host\n`has-error-message` | Set when the element has an error message | :host\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-time-picker).\n\nNote: the `theme` attribute value set on `<vaadin-date-time-picker>` is\npropagated to these components.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.", | ||
"attributes": [ | ||
@@ -228,3 +228,3 @@ { | ||
"name": "overlay-class", | ||
"description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-time-picker#property-overlayClass)", | ||
"description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-time-picker#property-overlayClass)", | ||
"value": { | ||
@@ -466,3 +466,3 @@ "type": [ | ||
"name": "i18n", | ||
"description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object or just the properties you want to modify.\n\nThe object is a combination of the i18n properties supported by\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-time-picker).", | ||
"description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object or just the properties you want to modify.\n\nThe object is a combination of the i18n properties supported by\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-time-picker).", | ||
"value": { | ||
@@ -476,3 +476,3 @@ "type": [ | ||
"name": "overlayClass", | ||
"description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-time-picker#property-overlayClass)", | ||
"description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-time-picker#property-overlayClass)", | ||
"value": { | ||
@@ -479,0 +479,0 @@ "type": [ |
{ | ||
"$schema": "https://json.schemastore.org/web-types", | ||
"name": "@vaadin/date-time-picker", | ||
"version": "24.6.0-alpha3", | ||
"version": "24.6.0-alpha4", | ||
"description-markup": "markdown", | ||
@@ -19,3 +19,3 @@ "framework": "lit", | ||
"name": "vaadin-date-time-picker", | ||
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------------------------------------|------------\n`disabled` | Set when the element is disabled | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set when the element is readonly | :host\n`invalid` | Set when the element is invalid | :host\n`has-label` | Set when the element has a label | :host\n`has-value` | Set when the element has a value | :host\n`has-helper` | Set when the element has helper text | :host\n`has-error-message` | Set when the element has an error message | :host\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-time-picker).\n\nNote: the `theme` attribute value set on `<vaadin-date-time-picker>` is\npropagated to these components.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.", | ||
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------------------------------------|------------\n`disabled` | Set when the element is disabled | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set when the element is readonly | :host\n`invalid` | Set when the element is invalid | :host\n`has-label` | Set when the element has a label | :host\n`has-value` | Set when the element has a value | :host\n`has-helper` | Set when the element has helper text | :host\n`has-error-message` | Set when the element has an error message | :host\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-time-picker).\n\nNote: the `theme` attribute value set on `<vaadin-date-time-picker>` is\npropagated to these components.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.", | ||
"extension": true, | ||
@@ -165,3 +165,3 @@ "attributes": [ | ||
"name": ".i18n", | ||
"description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object or just the properties you want to modify.\n\nThe object is a combination of the i18n properties supported by\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-time-picker).", | ||
"description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object or just the properties you want to modify.\n\nThe object is a combination of the i18n properties supported by\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-time-picker).", | ||
"value": { | ||
@@ -173,3 +173,3 @@ "kind": "expression" | ||
"name": ".overlayClass", | ||
"description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-time-picker#property-overlayClass)", | ||
"description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha4/#/elements/vaadin-time-picker#property-overlayClass)", | ||
"value": { | ||
@@ -176,0 +176,0 @@ "kind": "expression" |
92572
1986
+ Added@vaadin/a11y-base@24.6.0-alpha4(transitive)
+ Added@vaadin/button@24.6.0-alpha4(transitive)
+ Added@vaadin/combo-box@24.6.0-alpha4(transitive)
+ Added@vaadin/component-base@24.6.0-alpha4(transitive)
+ Added@vaadin/custom-field@24.6.0-alpha4(transitive)
+ Added@vaadin/date-picker@24.6.0-alpha4(transitive)
+ Added@vaadin/field-base@24.6.0-alpha4(transitive)
+ Added@vaadin/icon@24.6.0-alpha4(transitive)
+ Added@vaadin/input-container@24.6.0-alpha4(transitive)
+ Added@vaadin/item@24.6.0-alpha4(transitive)
+ Added@vaadin/lit-renderer@24.6.0-alpha4(transitive)
+ Added@vaadin/overlay@24.6.0-alpha4(transitive)
+ Added@vaadin/time-picker@24.6.0-alpha4(transitive)
+ Added@vaadin/vaadin-lumo-styles@24.6.0-alpha4(transitive)
+ Added@vaadin/vaadin-material-styles@24.6.0-alpha4(transitive)
+ Added@vaadin/vaadin-themable-mixin@24.6.0-alpha4(transitive)
- Removed@vaadin/a11y-base@24.6.0-alpha3(transitive)
- Removed@vaadin/button@24.6.0-alpha3(transitive)
- Removed@vaadin/combo-box@24.6.0-alpha3(transitive)
- Removed@vaadin/component-base@24.6.0-alpha3(transitive)
- Removed@vaadin/custom-field@24.6.0-alpha3(transitive)
- Removed@vaadin/date-picker@24.6.0-alpha3(transitive)
- Removed@vaadin/field-base@24.6.0-alpha3(transitive)
- Removed@vaadin/icon@24.6.0-alpha3(transitive)
- Removed@vaadin/input-container@24.6.0-alpha3(transitive)
- Removed@vaadin/item@24.6.0-alpha3(transitive)
- Removed@vaadin/lit-renderer@24.6.0-alpha3(transitive)
- Removed@vaadin/overlay@24.6.0-alpha3(transitive)
- Removed@vaadin/time-picker@24.6.0-alpha3(transitive)
- Removed@vaadin/vaadin-lumo-styles@24.6.0-alpha3(transitive)
- Removed@vaadin/vaadin-material-styles@24.6.0-alpha3(transitive)
- Removed@vaadin/vaadin-themable-mixin@24.6.0-alpha3(transitive)