@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
package/README.md CHANGED
@@ -26,29 +26,6 @@ Once installed, import the component in your application:
26
26
  import '@vaadin/time-picker';
27
27
  ```
28
28
 
29
- ## Themes
30
-
31
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
32
- The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/time-picker/vaadin-time-picker.js) of the package uses the Lumo theme.
33
-
34
- To use the Material theme, import the component from the `theme/material` folder:
35
-
36
- ```js
37
- import '@vaadin/time-picker/theme/material/vaadin-time-picker.js';
38
- ```
39
-
40
- You can also import the Lumo version of the component explicitly:
41
-
42
- ```js
43
- import '@vaadin/time-picker/theme/lumo/vaadin-time-picker.js';
44
- ```
45
-
46
- Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
47
-
48
- ```js
49
- import '@vaadin/time-picker/src/vaadin-time-picker.js';
50
- ```
51
-
52
29
  ## Contributing
53
30
 
54
31
  Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/time-picker",
3
- "version": "24.8.4",
3
+ "version": "25.0.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,6 +21,8 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
+ "!src/styles/*-base-styles.d.ts",
25
+ "!src/styles/*-base-styles.js",
24
26
  "theme",
25
27
  "vaadin-*.d.ts",
26
28
  "vaadin-*.js",
@@ -31,32 +33,29 @@
31
33
  "Vaadin",
32
34
  "vaadin-time-picker",
33
35
  "web-components",
34
- "web-component",
35
- "polymer"
36
+ "web-component"
36
37
  ],
37
38
  "dependencies": {
38
39
  "@open-wc/dedupe-mixin": "^1.3.0",
39
- "@polymer/polymer": "^3.0.0",
40
- "@vaadin/combo-box": "~24.8.4",
41
- "@vaadin/component-base": "~24.8.4",
42
- "@vaadin/field-base": "~24.8.4",
43
- "@vaadin/input-container": "~24.8.4",
44
- "@vaadin/item": "~24.8.4",
45
- "@vaadin/overlay": "~24.8.4",
46
- "@vaadin/vaadin-lumo-styles": "~24.8.4",
47
- "@vaadin/vaadin-material-styles": "~24.8.4",
48
- "@vaadin/vaadin-themable-mixin": "~24.8.4",
40
+ "@vaadin/combo-box": "25.0.0-alpha10",
41
+ "@vaadin/component-base": "25.0.0-alpha10",
42
+ "@vaadin/field-base": "25.0.0-alpha10",
43
+ "@vaadin/input-container": "25.0.0-alpha10",
44
+ "@vaadin/item": "25.0.0-alpha10",
45
+ "@vaadin/overlay": "25.0.0-alpha10",
46
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
47
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
49
48
  "lit": "^3.0.0"
50
49
  },
51
50
  "devDependencies": {
52
- "@vaadin/chai-plugins": "~24.8.4",
53
- "@vaadin/test-runner-commands": "~24.8.4",
54
- "@vaadin/testing-helpers": "^1.1.0",
51
+ "@vaadin/chai-plugins": "25.0.0-alpha10",
52
+ "@vaadin/test-runner-commands": "25.0.0-alpha10",
53
+ "@vaadin/testing-helpers": "^2.0.0",
55
54
  "sinon": "^18.0.0"
56
55
  },
57
56
  "web-types": [
58
57
  "web-types.json",
59
58
  "web-types.lit.json"
60
59
  ],
61
- "gitHead": "849e54e967563080a685965e2dced02060b3ab23"
60
+ "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
62
61
  }
@@ -3,5 +3,6 @@
3
3
  * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import './vaadin-time-picker-styles.js';
7
- import '../../src/vaadin-time-picker.js';
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const timePickerStyles: CSSResult;
@@ -0,0 +1,27 @@
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/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+
9
+ export const timePickerStyles = css`
10
+ :host([opened]) {
11
+ pointer-events: auto;
12
+ }
13
+
14
+ [part='toggle-button']::before {
15
+ mask-image: var(--_vaadin-icon-clock);
16
+ }
17
+
18
+ /* See https://github.com/vaadin/vaadin-time-picker/issues/145 */
19
+ :host([dir='rtl']) [part='input-field'] {
20
+ direction: ltr;
21
+ }
22
+
23
+ :host([dir='rtl']) [part='input-field'] ::slotted(input)::placeholder {
24
+ direction: rtl;
25
+ text-align: left;
26
+ }
27
+ `;
@@ -3,5 +3,6 @@
3
3
  * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import './vaadin-time-picker-styles.js';
7
- import '../../src/vaadin-time-picker.js';
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const timePickerStyles: CSSResult;
@@ -0,0 +1,26 @@
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
+ :host([opened]) {
10
+ pointer-events: auto;
11
+ }
12
+
13
+ /* See https://github.com/vaadin/vaadin-time-picker/issues/145 */
14
+ :host([dir='rtl']) [part='input-field'] {
15
+ direction: ltr;
16
+ }
17
+
18
+ :host([dir='rtl']) [part='input-field'] ::slotted(input)::placeholder {
19
+ direction: rtl;
20
+ text-align: left;
21
+ }
22
+
23
+ [part~='toggle-button'] {
24
+ cursor: pointer;
25
+ }
26
+ `;
@@ -0,0 +1,22 @@
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
+ :host {
10
+ --vaadin-item-checkmark-display: block;
11
+ }
12
+
13
+ #overlay {
14
+ width: var(--vaadin-time-picker-overlay-width, var(--_vaadin-time-picker-overlay-default-width, auto));
15
+ }
16
+
17
+ [part='content'] {
18
+ display: flex;
19
+ flex-direction: column;
20
+ height: 100%;
21
+ }
22
+ `;
@@ -0,0 +1,18 @@
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
+ `;
@@ -0,0 +1,8 @@
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 { comboBoxScrollerStyles } from '@vaadin/combo-box/src/styles/vaadin-combo-box-scroller-base-styles.js';
7
+
8
+ export { comboBoxScrollerStyles as timePickerScrollerStyles };
@@ -0,0 +1,27 @@
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
+ /* Fixes scrollbar disappearing when 'Show scroll bars: Always' enabled in Safari */
18
+ box-shadow: 0 0 0 white;
19
+ }
20
+
21
+ #selector {
22
+ border-width: var(--_vaadin-time-picker-items-container-border-width);
23
+ border-style: var(--_vaadin-time-picker-items-container-border-style);
24
+ border-color: var(--_vaadin-time-picker-items-container-border-color, transparent);
25
+ position: relative;
26
+ }
27
+ `;
@@ -3,10 +3,13 @@
3
3
  * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { ComboBoxItemMixin } from '@vaadin/combo-box/src/vaadin-combo-box-item-mixin.js';
8
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
+ import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-core-styles.js';
12
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
10
13
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
14
 
12
15
  /**
@@ -36,22 +39,20 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
36
39
  * @mixes DirMixin
37
40
  * @private
38
41
  */
39
- export class TimePickerItem extends ComboBoxItemMixin(ThemableMixin(DirMixin(PolymerElement))) {
42
+ export class TimePickerItem extends ComboBoxItemMixin(
43
+ ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
44
+ ) {
40
45
  static get is() {
41
46
  return 'vaadin-time-picker-item';
42
47
  }
43
48
 
44
- static get template() {
45
- return html`
46
- <style>
47
- :host {
48
- display: block;
49
- }
49
+ static get styles() {
50
+ return itemStyles;
51
+ }
50
52
 
51
- :host([hidden]) {
52
- display: none !important;
53
- }
54
- </style>
53
+ /** @protected */
54
+ render() {
55
+ return html`
55
56
  <span part="checkmark" aria-hidden="true"></span>
56
57
  <div part="content">
57
58
  <slot></slot>
@@ -8,8 +8,9 @@ import type { DelegateFocusMixinClass } from '@vaadin/a11y-base/src/delegate-foc
8
8
  import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
9
9
  import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
10
10
  import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
11
- import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
11
+ import type { ComboBoxBaseMixinClass } from '@vaadin/combo-box/src/vaadin-combo-box-base-mixin.js';
12
12
  import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
13
+ import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
13
14
  import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
14
15
  import type { ClearButtonMixinClass } from '@vaadin/field-base/src/clear-button-mixin.js';
15
16
  import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
@@ -32,7 +33,7 @@ export interface TimePickerI18n {
32
33
  export declare function TimePickerMixin<T extends Constructor<HTMLElement>>(
33
34
  base: T,
34
35
  ): Constructor<ClearButtonMixinClass> &
35
- Constructor<ControllerMixinClass> &
36
+ Constructor<ComboBoxBaseMixinClass> &
36
37
  Constructor<DelegateFocusMixinClass> &
37
38
  Constructor<DelegateStateMixinClass> &
38
39
  Constructor<DisabledMixinClass> &
@@ -43,6 +44,7 @@ export declare function TimePickerMixin<T extends Constructor<HTMLElement>>(
43
44
  Constructor<InputMixinClass> &
44
45
  Constructor<KeyboardMixinClass> &
45
46
  Constructor<LabelMixinClass> &
47
+ Constructor<OverlayClassMixinClass> &
46
48
  Constructor<PatternMixinClass> &
47
49
  Constructor<SlotStylesMixinClass> &
48
50
  Constructor<TimePickerMixinClass> &
@@ -60,11 +62,6 @@ export declare class TimePickerMixinClass {
60
62
  */
61
63
  value: string;
62
64
 
63
- /**
64
- * True if the dropdown is open, false otherwise.
65
- */
66
- opened: boolean;
67
-
68
65
  /**
69
66
  * Minimum time allowed.
70
67
  *
@@ -103,19 +100,6 @@ export declare class TimePickerMixinClass {
103
100
  */
104
101
  step: number | null | undefined;
105
102
 
106
- /**
107
- * Set true to prevent the overlay from opening automatically.
108
- * @attr {boolean} auto-open-disabled
109
- */
110
- autoOpenDisabled: boolean | null | undefined;
111
-
112
- /**
113
- * A space-delimited list of CSS class names to set on the overlay element.
114
- *
115
- * @attr {string} overlay-class
116
- */
117
- overlayClass: string;
118
-
119
103
  /**
120
104
  * The object used to localize this component.
121
105
  * To change the default localization, replace the entire
@@ -146,14 +130,4 @@ export declare class TimePickerMixinClass {
146
130
  * to ensure the component works properly.
147
131
  */
148
132
  i18n: TimePickerI18n;
149
-
150
- /**
151
- * Opens the dropdown list.
152
- */
153
- open(): void;
154
-
155
- /**
156
- * Closes the dropdown list.
157
- */
158
- close(): void;
159
133
  }