@vaadin/time-picker 25.0.0-alpha2 → 25.0.0-alpha20

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/time-picker",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha20",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-time-picker",
19
- "description": "`<vaadin-time-picker>` is a Web Component providing a time-selection field.\n\n```html\n<vaadin-time-picker></vaadin-time-picker>\n```\n```js\ntimePicker.value = '14:30';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-time-picker-overlay-width` | Width of the overlay | `auto`\n`--vaadin-time-picker-overlay-max-height`| Max height of the overlay | `65vh`\n\n`<vaadin-time-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------\n`toggle-button` | The toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n----------|------------------------------------------\n`opened` | Set when the time-picker dropdown is open\n\n### Internal components\n\nIn addition to `<vaadin-time-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-time-picker-combo-box>` - an internal version of [`<vaadin-combo-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-combo-box).\n- `<vaadin-time-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-overlay).\n- `<vaadin-time-picker-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nNote: the `theme` attribute value set on `<vaadin-time-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
19
+ "description": "`<vaadin-time-picker>` is a Web Component providing a time-selection field.\n\n```html\n<vaadin-time-picker></vaadin-time-picker>\n```\n```js\ntimePicker.value = '14:30';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-----------------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n`--vaadin-time-picker-overlay-width` | Width of the overlay | `auto`\n`--vaadin-time-picker-overlay-max-height`| Max height of the overlay | `65vh`\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n\n### Internal components\n\nIn addition to `<vaadin-time-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-time-picker-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha20/#/elements/vaadin-item).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -26,6 +26,27 @@
26
26
  "kind": "expression"
27
27
  }
28
28
  },
29
+ {
30
+ "name": "?opened",
31
+ "description": "True if the dropdown is open, false otherwise.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": "?autoOpenDisabled",
38
+ "description": "Set true to prevent the overlay from opening automatically.",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": "?readonly",
45
+ "description": "When present, it specifies that the field is read-only.",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ },
29
50
  {
30
51
  "name": "?autofocus",
31
52
  "description": "Specify that this control should have input focus when the page loads.",
@@ -69,22 +90,15 @@
69
90
  }
70
91
  },
71
92
  {
72
- "name": "?readonly",
73
- "description": "When present, it specifies that the field is read-only.",
74
- "value": {
75
- "kind": "expression"
76
- }
77
- },
78
- {
79
- "name": "?opened",
80
- "description": "True if the dropdown is open, false otherwise.",
93
+ "name": ".value",
94
+ "description": "The time value for this element.\n\nSupported time formats are in ISO 8601:\n- `hh:mm` (default)\n- `hh:mm:ss`\n- `hh:mm:ss.fff`",
81
95
  "value": {
82
96
  "kind": "expression"
83
97
  }
84
98
  },
85
99
  {
86
- "name": "?autoOpenDisabled",
87
- "description": "Set true to prevent the overlay from opening automatically.",
100
+ "name": ".i18n",
101
+ "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.",
88
102
  "value": {
89
103
  "kind": "expression"
90
104
  }
@@ -124,13 +138,6 @@
124
138
  "kind": "expression"
125
139
  }
126
140
  },
127
- {
128
- "name": ".value",
129
- "description": "The time value for this element.\n\nSupported time formats are in ISO 8601:\n- `hh:mm` (default)\n- `hh:mm:ss`\n- `hh:mm:ss.fff`",
130
- "value": {
131
- "kind": "expression"
132
- }
133
- },
134
141
  {
135
142
  "name": ".allowedCharPattern",
136
143
  "description": "A pattern matched against individual characters the user inputs.\n\nWhen set, the field will prevent:\n- `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`\n- `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`\n- `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`\n\nFor example, to allow entering only numbers and minus signs, use:\n`allowedCharPattern = \"[\\\\d-]\"`",
@@ -187,20 +194,6 @@
187
194
  "kind": "expression"
188
195
  }
189
196
  },
190
- {
191
- "name": ".overlayClass",
192
- "description": "A space-delimited list of CSS class names to set on the overlay element.",
193
- "value": {
194
- "kind": "expression"
195
- }
196
- },
197
- {
198
- "name": ".i18n",
199
- "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n_i18n_ object or just the property you want to modify.\n\nThe object has the following JSON structure:\n\n```\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nBoth `formatTime` and `parseTime` need to be implemented\nto ensure the component works properly.",
200
- "value": {
201
- "kind": "expression"
202
- }
203
- },
204
197
  {
205
198
  "name": "@validated",
206
199
  "description": "Fired whenever the field is validated.",
@@ -223,22 +216,22 @@
223
216
  }
224
217
  },
225
218
  {
226
- "name": "@invalid-changed",
227
- "description": "Fired when the `invalid` property changes.",
219
+ "name": "@value-changed",
220
+ "description": "Fired when the `value` property changes.",
228
221
  "value": {
229
222
  "kind": "expression"
230
223
  }
231
224
  },
232
225
  {
233
- "name": "@value-changed",
234
- "description": "Fired when the `value` property changes.",
226
+ "name": "@opened-changed",
227
+ "description": "Fired when the `opened` property changes.",
235
228
  "value": {
236
229
  "kind": "expression"
237
230
  }
238
231
  },
239
232
  {
240
- "name": "@opened-changed",
241
- "description": "Fired when the `opened` property changes.",
233
+ "name": "@invalid-changed",
234
+ "description": "Fired when the `invalid` property changes.",
242
235
  "value": {
243
236
  "kind": "expression"
244
237
  }
@@ -1,8 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import type { CSSResult } from 'lit';
7
-
8
- export const timePickerStyles: CSSResult;
@@ -1,22 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const timePickerStyles = css`
9
- /* See https://github.com/vaadin/vaadin-time-picker/issues/145 */
10
- :host([dir='rtl']) [part='input-field'] {
11
- direction: ltr;
12
- }
13
-
14
- :host([dir='rtl']) [part='input-field'] ::slotted(input)::placeholder {
15
- direction: rtl;
16
- text-align: left;
17
- }
18
-
19
- [part~='toggle-button'] {
20
- cursor: pointer;
21
- }
22
- `;
@@ -1,18 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const timePickerOverlayStyles = css`
9
- #overlay {
10
- width: var(--vaadin-time-picker-overlay-width, var(--_vaadin-time-picker-overlay-default-width, auto));
11
- }
12
-
13
- [part='content'] {
14
- display: flex;
15
- flex-direction: column;
16
- height: 100%;
17
- }
18
- `;
@@ -1,30 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from 'lit';
7
-
8
- export const timePickerScrollerStyles = css`
9
- :host {
10
- display: block;
11
- min-height: 1px;
12
- overflow: auto;
13
-
14
- /* Fixes item background from getting on top of scrollbars on Safari */
15
- transform: translate3d(0, 0, 0);
16
-
17
- /* Enable momentum scrolling on iOS */
18
- -webkit-overflow-scrolling: touch;
19
-
20
- /* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
21
- box-shadow: 0 0 0 white;
22
- }
23
-
24
- #selector {
25
- border-width: var(--_vaadin-time-picker-items-container-border-width);
26
- border-style: var(--_vaadin-time-picker-items-container-border-style);
27
- border-color: var(--_vaadin-time-picker-items-container-border-color, transparent);
28
- position: relative;
29
- }
30
- `;
@@ -1,92 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-time-picker-item.js';
7
- import './vaadin-time-picker-overlay.js';
8
- import './vaadin-time-picker-scroller.js';
9
- import { css, html, LitElement } from 'lit';
10
- import { ifDefined } from 'lit/directives/if-defined.js';
11
- import { ComboBoxMixin } from '@vaadin/combo-box/src/vaadin-combo-box-mixin.js';
12
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
13
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
14
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
-
16
- /**
17
- * An element used internally by `<vaadin-time-picker>`. Not intended to be used separately.
18
- *
19
- * @customElement
20
- * @extends HTMLElement
21
- * @mixes ComboBoxMixin
22
- * @mixes ThemableMixin
23
- * @private
24
- */
25
- class TimePickerComboBox extends ComboBoxMixin(ThemableMixin(PolylitMixin(LitElement))) {
26
- static get is() {
27
- return 'vaadin-time-picker-combo-box';
28
- }
29
-
30
- static get styles() {
31
- return css`
32
- :host([opened]) {
33
- pointer-events: auto;
34
- }
35
- `;
36
- }
37
-
38
- static get properties() {
39
- return {
40
- positionTarget: {
41
- type: Object,
42
- },
43
- };
44
- }
45
-
46
- /**
47
- * Tag name prefix used by scroller and items.
48
- * @protected
49
- * @return {string}
50
- */
51
- get _tagNamePrefix() {
52
- return 'vaadin-time-picker';
53
- }
54
-
55
- /**
56
- * Reference to the clear button element.
57
- * @protected
58
- * @return {!HTMLElement}
59
- */
60
- get clearElement() {
61
- return this.querySelector('[part="clear-button"]');
62
- }
63
-
64
- /** @protected */
65
- render() {
66
- return html`
67
- <slot></slot>
68
-
69
- <vaadin-time-picker-overlay
70
- id="overlay"
71
- .opened="${this._overlayOpened}"
72
- ?loading="${this.loading}"
73
- theme="${ifDefined(this._theme)}"
74
- .positionTarget="${this.positionTarget}"
75
- .restoreFocusNode="${this.inputElement}"
76
- no-vertical-overlap
77
- ></vaadin-time-picker-overlay>
78
- `;
79
- }
80
- /** @protected */
81
- ready() {
82
- super.ready();
83
-
84
- this.allowCustomValue = true;
85
- this._toggleElement = this.querySelector('.toggle-button');
86
-
87
- // See https://github.com/vaadin/vaadin-time-picker/issues/145
88
- this.setAttribute('dir', 'ltr');
89
- }
90
- }
91
-
92
- defineCustomElement(TimePickerComboBox);
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
@@ -1,52 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
8
- import { comboBoxItem } from '@vaadin/combo-box/theme/lumo/vaadin-combo-box-item-styles.js';
9
- import { comboBoxOverlay } from '@vaadin/combo-box/theme/lumo/vaadin-combo-box-overlay-styles.js';
10
- import { item } from '@vaadin/item/theme/lumo/vaadin-item-styles.js';
11
- import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
12
- import { menuOverlayCore } from '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';
13
- import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
14
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
-
16
- registerStyles('vaadin-time-picker-item', [item, comboBoxItem], {
17
- moduleId: 'lumo-time-picker-item',
18
- });
19
-
20
- registerStyles(
21
- 'vaadin-time-picker-overlay',
22
- [
23
- overlay,
24
- menuOverlayCore,
25
- comboBoxOverlay,
26
- css`
27
- :host {
28
- --_vaadin-time-picker-items-container-border-width: var(--lumo-space-xs);
29
- --_vaadin-time-picker-items-container-border-style: solid;
30
- }
31
- `,
32
- ],
33
- {
34
- moduleId: 'lumo-time-picker-overlay',
35
- },
36
- );
37
-
38
- const timePicker = css`
39
- [part~='toggle-button']::before {
40
- content: var(--lumo-icons-clock);
41
- }
42
-
43
- :host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
44
- --_lumo-text-field-overflow-mask-image: none;
45
- }
46
-
47
- :host([dir='rtl']) [part='input-field'] ::slotted(input) {
48
- --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
49
- }
50
- `;
51
-
52
- registerStyles('vaadin-time-picker', [inputFieldShared, timePicker], { moduleId: 'lumo-time-picker' });
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-time-picker-styles.js';
7
- import '../../src/vaadin-time-picker.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-time-picker-styles.js';
7
- import '../../src/vaadin-time-picker.js';