@vaadin/time-picker 25.0.0-alpha1 → 25.0.0-alpha11

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-alpha1",
4
+ "version": "25.0.0-alpha11",
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-alpha1/#/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-alpha1/#/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-alpha1/#/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-alpha1/#/elements/vaadin-item).\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/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\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-alpha11/#/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`overlay` | The overlay container\n`content` | The overlay content\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-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha11/#/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": ".overlayClass",
101
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
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,13 +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
197
  {
198
198
  "name": ".i18n",
199
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.",
@@ -223,22 +223,22 @@
223
223
  }
224
224
  },
225
225
  {
226
- "name": "@invalid-changed",
227
- "description": "Fired when the `invalid` property changes.",
226
+ "name": "@value-changed",
227
+ "description": "Fired when the `value` property changes.",
228
228
  "value": {
229
229
  "kind": "expression"
230
230
  }
231
231
  },
232
232
  {
233
- "name": "@value-changed",
234
- "description": "Fired when the `value` property changes.",
233
+ "name": "@opened-changed",
234
+ "description": "Fired when the `opened` property changes.",
235
235
  "value": {
236
236
  "kind": "expression"
237
237
  }
238
238
  },
239
239
  {
240
- "name": "@opened-changed",
241
- "description": "Fired when the `opened` property changes.",
240
+ "name": "@invalid-changed",
241
+ "description": "Fired when the `invalid` property changes.",
242
242
  "value": {
243
243
  "kind": "expression"
244
244
  }
@@ -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';