@vaadin/time-picker 24.8.4 → 25.0.0-alpha10

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.
Files changed (33) hide show
  1. package/README.md +0 -23
  2. package/package.json +16 -17
  3. package/{theme/material/vaadin-time-picker.d.ts → src/styles/vaadin-time-picker-base-styles.d.ts} +3 -2
  4. package/src/styles/vaadin-time-picker-base-styles.js +27 -0
  5. package/{theme/material/vaadin-time-picker.js → src/styles/vaadin-time-picker-core-styles.d.ts} +3 -2
  6. package/src/styles/vaadin-time-picker-core-styles.js +26 -0
  7. package/src/styles/vaadin-time-picker-overlay-base-styles.js +22 -0
  8. package/src/styles/vaadin-time-picker-overlay-core-styles.js +18 -0
  9. package/src/styles/vaadin-time-picker-scroller-base-styles.js +8 -0
  10. package/src/styles/vaadin-time-picker-scroller-core-styles.js +27 -0
  11. package/src/vaadin-time-picker-item.js +13 -12
  12. package/src/vaadin-time-picker-mixin.d.ts +4 -30
  13. package/src/vaadin-time-picker-mixin.js +158 -84
  14. package/src/vaadin-time-picker-overlay.js +15 -22
  15. package/src/vaadin-time-picker-scroller.js +10 -26
  16. package/src/vaadin-time-picker.d.ts +5 -4
  17. package/src/vaadin-time-picker.js +47 -54
  18. package/web-types.json +108 -112
  19. package/web-types.lit.json +33 -33
  20. package/src/vaadin-lit-time-picker-combo-box.js +0 -92
  21. package/src/vaadin-lit-time-picker-item.js +0 -68
  22. package/src/vaadin-lit-time-picker-overlay.js +0 -60
  23. package/src/vaadin-lit-time-picker-scroller.js +0 -59
  24. package/src/vaadin-lit-time-picker.js +0 -117
  25. package/src/vaadin-time-picker-combo-box.js +0 -88
  26. package/theme/lumo/vaadin-lit-time-picker.d.ts +0 -7
  27. package/theme/lumo/vaadin-lit-time-picker.js +0 -7
  28. package/theme/material/vaadin-lit-time-picker.d.ts +0 -7
  29. package/theme/material/vaadin-lit-time-picker.js +0 -7
  30. package/theme/material/vaadin-time-picker-styles.d.ts +0 -7
  31. package/theme/material/vaadin-time-picker-styles.js +0 -42
  32. package/vaadin-lit-time-picker.d.ts +0 -1
  33. package/vaadin-lit-time-picker.js +0 -2
@@ -1,60 +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, html, LitElement } from 'lit';
7
- import { ComboBoxOverlayMixin } from '@vaadin/combo-box/src/vaadin-combo-box-overlay-mixin.js';
8
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
- import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
- import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
12
- import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
13
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
-
15
- const timePickerOverlayStyles = css`
16
- #overlay {
17
- width: var(--vaadin-time-picker-overlay-width, var(--_vaadin-time-picker-overlay-default-width, auto));
18
- }
19
-
20
- [part='content'] {
21
- display: flex;
22
- flex-direction: column;
23
- height: 100%;
24
- }
25
- `;
26
-
27
- /**
28
- * An element used internally by `<vaadin-time-picker>`. Not intended to be used separately.
29
- *
30
- * @extends HTMLElement
31
- * @mixes ComboBoxOverlayMixin
32
- * @mixes DirMixin
33
- * @mixes OverlayMixin
34
- * @mixes ThemableMixin
35
- * @private
36
- */
37
- export class TimePickerOverlay extends ComboBoxOverlayMixin(
38
- OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))),
39
- ) {
40
- static get is() {
41
- return 'vaadin-time-picker-overlay';
42
- }
43
-
44
- static get styles() {
45
- return [overlayStyles, timePickerOverlayStyles];
46
- }
47
-
48
- /** @protected */
49
- render() {
50
- return html`
51
- <div id="backdrop" part="backdrop" hidden></div>
52
- <div part="overlay" id="overlay">
53
- <div part="loader"></div>
54
- <div part="content" id="content"><slot></slot></div>
55
- </div>
56
- `;
57
- }
58
- }
59
-
60
- defineCustomElement(TimePickerOverlay);
@@ -1,59 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2015 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css, html, LitElement } from 'lit';
7
- import { ComboBoxScrollerMixin } from '@vaadin/combo-box/src/vaadin-combo-box-scroller-mixin.js';
8
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
-
11
- /**
12
- * An element used internally by `<vaadin-time-picker>`. Not intended to be used separately.
13
- *
14
- * @extends HTMLElement
15
- * @mixes ComboBoxScrollerMixin
16
- * @private
17
- */
18
- export class TimePickerScroller extends ComboBoxScrollerMixin(PolylitMixin(LitElement)) {
19
- static get is() {
20
- return 'vaadin-time-picker-scroller';
21
- }
22
-
23
- static get styles() {
24
- return css`
25
- :host {
26
- display: block;
27
- min-height: 1px;
28
- overflow: auto;
29
-
30
- /* Fixes item background from getting on top of scrollbars on Safari */
31
- transform: translate3d(0, 0, 0);
32
-
33
- /* Enable momentum scrolling on iOS */
34
- -webkit-overflow-scrolling: touch;
35
-
36
- /* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
37
- box-shadow: 0 0 0 white;
38
- }
39
-
40
- #selector {
41
- border-width: var(--_vaadin-time-picker-items-container-border-width);
42
- border-style: var(--_vaadin-time-picker-items-container-border-style);
43
- border-color: var(--_vaadin-time-picker-items-container-border-color, transparent);
44
- position: relative;
45
- }
46
- `;
47
- }
48
-
49
- /** @protected */
50
- render() {
51
- return html`
52
- <div id="selector">
53
- <slot></slot>
54
- </div>
55
- `;
56
- }
57
- }
58
-
59
- defineCustomElement(TimePickerScroller);
@@ -1,117 +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/src/vaadin-lit-input-container.js';
7
- import './vaadin-lit-time-picker-combo-box.js';
8
- import { css, html, LitElement } from 'lit';
9
- import { ifDefined } from 'lit/directives/if-defined.js';
10
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
11
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
13
- import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
14
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
- import { TimePickerMixin } from './vaadin-time-picker-mixin.js';
16
-
17
- /**
18
- * LitElement based version of `<vaadin-time-picker>` web component.
19
- *
20
- * ## Disclaimer
21
- *
22
- * This component is an experiment and not yet a part of Vaadin platform.
23
- * There is no ETA regarding specific Vaadin version where it'll land.
24
- * Feel free to try this code in your apps as per Apache 2.0 license.
25
- */
26
- class TimePicker extends TimePickerMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
27
- static get is() {
28
- return 'vaadin-time-picker';
29
- }
30
-
31
- static get styles() {
32
- return [
33
- inputFieldShared,
34
- css`
35
- /* See https://github.com/vaadin/vaadin-time-picker/issues/145 */
36
- :host([dir='rtl']) [part='input-field'] {
37
- direction: ltr;
38
- }
39
-
40
- :host([dir='rtl']) [part='input-field'] ::slotted(input)::placeholder {
41
- direction: rtl;
42
- text-align: left;
43
- }
44
-
45
- [part~='toggle-button'] {
46
- cursor: pointer;
47
- }
48
- `,
49
- ];
50
- }
51
-
52
- /** @protected */
53
- render() {
54
- return html`
55
- <div class="vaadin-time-picker-container">
56
- <div part="label">
57
- <slot name="label"></slot>
58
- <span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
59
- </div>
60
-
61
- <vaadin-time-picker-combo-box
62
- id="comboBox"
63
- .filteredItems="${this.__dropdownItems}"
64
- .value="${this._comboBoxValue}"
65
- .opened="${this.opened}"
66
- .disabled="${this.disabled}"
67
- .readonly="${this.readonly}"
68
- .clearButtonVisible="${this.clearButtonVisible}"
69
- .autoOpenDisabled="${this.autoOpenDisabled}"
70
- .overlayClass="${this.overlayClass}"
71
- .positionTarget="${this._inputContainer}"
72
- theme="${ifDefined(this._theme)}"
73
- @value-changed="${this.__onComboBoxValueChanged}"
74
- @opened-changed="${this.__onComboBoxOpenedChanged}"
75
- @change="${this.__onComboBoxChange}"
76
- >
77
- <vaadin-input-container
78
- part="input-field"
79
- .readonly="${this.readonly}"
80
- .disabled="${this.disabled}"
81
- .invalid="${this.invalid}"
82
- theme="${ifDefined(this._theme)}"
83
- >
84
- <slot name="prefix" slot="prefix"></slot>
85
- <slot name="input"></slot>
86
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
87
- <div id="toggleButton" class="toggle-button" part="toggle-button" slot="suffix" aria-hidden="true"></div>
88
- </vaadin-input-container>
89
- </vaadin-time-picker-combo-box>
90
-
91
- <div part="helper-text">
92
- <slot name="helper"></slot>
93
- </div>
94
-
95
- <div part="error-message">
96
- <slot name="error-message"></slot>
97
- </div>
98
- </div>
99
-
100
- <slot name="tooltip"></slot>
101
- `;
102
- }
103
-
104
- /** @private */
105
- __onComboBoxOpenedChanged(event) {
106
- this.opened = event.detail.value;
107
- }
108
-
109
- /** @private */
110
- __onComboBoxValueChanged(event) {
111
- this._comboBoxValue = event.detail.value;
112
- }
113
- }
114
-
115
- defineCustomElement(TimePicker);
116
-
117
- export { TimePicker };
@@ -1,88 +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 { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
10
- import { ComboBoxMixin } from '@vaadin/combo-box/src/vaadin-combo-box-mixin.js';
11
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
12
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
-
14
- /**
15
- * An element used internally by `<vaadin-time-picker>`. Not intended to be used separately.
16
- *
17
- * @customElement
18
- * @extends HTMLElement
19
- * @mixes ComboBoxMixin
20
- * @mixes ThemableMixin
21
- * @private
22
- */
23
- class TimePickerComboBox extends ComboBoxMixin(ThemableMixin(PolymerElement)) {
24
- static get is() {
25
- return 'vaadin-time-picker-combo-box';
26
- }
27
-
28
- static get template() {
29
- return html`
30
- <style>
31
- :host([opened]) {
32
- pointer-events: auto;
33
- }
34
- </style>
35
-
36
- <slot></slot>
37
-
38
- <vaadin-time-picker-overlay
39
- id="overlay"
40
- opened="[[_overlayOpened]]"
41
- loading$="[[loading]]"
42
- theme$="[[_theme]]"
43
- position-target="[[positionTarget]]"
44
- no-vertical-overlap
45
- restore-focus-node="[[inputElement]]"
46
- ></vaadin-time-picker-overlay>
47
- `;
48
- }
49
-
50
- static get properties() {
51
- return {
52
- positionTarget: {
53
- type: Object,
54
- },
55
- };
56
- }
57
-
58
- /**
59
- * Tag name prefix used by scroller and items.
60
- * @protected
61
- * @return {string}
62
- */
63
- get _tagNamePrefix() {
64
- return 'vaadin-time-picker';
65
- }
66
-
67
- /**
68
- * Reference to the clear button element.
69
- * @protected
70
- * @return {!HTMLElement}
71
- */
72
- get clearElement() {
73
- return this.querySelector('[part="clear-button"]');
74
- }
75
-
76
- /** @protected */
77
- ready() {
78
- super.ready();
79
-
80
- this.allowCustomValue = true;
81
- this._toggleElement = this.querySelector('.toggle-button');
82
-
83
- // See https://github.com/vaadin/vaadin-time-picker/issues/145
84
- this.setAttribute('dir', 'ltr');
85
- }
86
- }
87
-
88
- 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-time-picker-styles.js';
7
- import '../../src/vaadin-lit-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-lit-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-lit-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-lit-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/input-container/theme/material/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-material-styles/font-icons.js';
@@ -1,42 +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/material/vaadin-input-container-styles.js';
7
- import '@vaadin/vaadin-material-styles/font-icons.js';
8
- import { comboBoxItem } from '@vaadin/combo-box/theme/material/vaadin-combo-box-item-styles.js';
9
- import { comboBoxOverlay } from '@vaadin/combo-box/theme/material/vaadin-combo-box-overlay-styles.js';
10
- import { item } from '@vaadin/item/theme/material/vaadin-item-styles.js';
11
- import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
12
- import { menuOverlay } from '@vaadin/vaadin-material-styles/mixins/menu-overlay.js';
13
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
-
15
- registerStyles('vaadin-time-picker-item', [item, comboBoxItem], {
16
- moduleId: 'material-time-picker-item',
17
- });
18
-
19
- registerStyles(
20
- 'vaadin-time-picker-overlay',
21
- [
22
- menuOverlay,
23
- comboBoxOverlay,
24
- css`
25
- :host {
26
- --_vaadin-time-picker-items-container-border-width: 8px 0;
27
- --_vaadin-time-picker-items-container-border-style: solid;
28
- }
29
- `,
30
- ],
31
- {
32
- moduleId: 'material-time-picker-overlay',
33
- },
34
- );
35
-
36
- const timePicker = css`
37
- [part~='toggle-button']::before {
38
- content: var(--material-icons-clock);
39
- }
40
- `;
41
-
42
- registerStyles('vaadin-time-picker', [inputFieldShared, timePicker], { moduleId: 'material-time-picker' });
@@ -1 +0,0 @@
1
- export * from './src/vaadin-time-picker.js';
@@ -1,2 +0,0 @@
1
- import './theme/lumo/vaadin-lit-time-picker.js';
2
- export * from './src/vaadin-lit-time-picker.js';