@vaadin/vaadin-combo-box 21.0.1 → 22.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.
@@ -1,16 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
-
7
- /*
8
- * Placeholder object class representing items being loaded.
9
- *
10
- * @private
11
- */
12
- export const ComboBoxPlaceholder = class ComboBoxPlaceholder {
13
- toString() {
14
- return '';
15
- }
16
- };
@@ -1,87 +0,0 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import '@vaadin/vaadin-lumo-styles/color.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-overlay/theme/lumo/vaadin-overlay.js';
6
- import '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';
7
-
8
- registerStyles(
9
- 'vaadin-combo-box-overlay',
10
- css`
11
- [part='content'] {
12
- padding: 0;
13
- }
14
-
15
- :host {
16
- /* TODO: using a legacy mixin (unsupported) */
17
- --iron-list-items-container: {
18
- border-width: var(--lumo-space-xs);
19
- border-style: solid;
20
- border-color: transparent;
21
- }
22
- }
23
-
24
- /* Loading state */
25
-
26
- /* When items are empty, the spinner needs some room */
27
- :host(:not([closing])) [part~='content'] {
28
- min-height: calc(2 * var(--lumo-space-s) + var(--lumo-icon-size-s));
29
- }
30
-
31
- [part~='overlay'] {
32
- position: relative;
33
- }
34
-
35
- :host([loading]) [part~='loader'] {
36
- box-sizing: border-box;
37
- width: var(--lumo-icon-size-s);
38
- height: var(--lumo-icon-size-s);
39
- position: absolute;
40
- z-index: 1;
41
- left: var(--lumo-space-s);
42
- right: var(--lumo-space-s);
43
- top: var(--lumo-space-s);
44
- margin-left: auto;
45
- margin-inline-start: auto;
46
- margin-inline-end: 0;
47
- border: 2px solid transparent;
48
- border-color: var(--lumo-primary-color-50pct) var(--lumo-primary-color-50pct) var(--lumo-primary-color)
49
- var(--lumo-primary-color);
50
- border-radius: calc(0.5 * var(--lumo-icon-size-s));
51
- opacity: 0;
52
- animation: 1s linear infinite lumo-combo-box-loader-rotate, 0.3s 0.1s lumo-combo-box-loader-fade-in both;
53
- pointer-events: none;
54
- }
55
-
56
- @keyframes lumo-combo-box-loader-fade-in {
57
- 0% {
58
- opacity: 0;
59
- }
60
-
61
- 100% {
62
- opacity: 1;
63
- }
64
- }
65
-
66
- @keyframes lumo-combo-box-loader-rotate {
67
- 0% {
68
- transform: rotate(0deg);
69
- }
70
-
71
- 100% {
72
- transform: rotate(360deg);
73
- }
74
- }
75
-
76
- /* RTL specific styles */
77
-
78
- :host([loading][dir='rtl']) [part~='loader'] {
79
- left: auto;
80
- margin-left: 0;
81
- margin-right: auto;
82
- margin-inline-start: 0;
83
- margin-inline-end: auto;
84
- }
85
- `,
86
- { moduleId: 'lumo-combo-box-overlay', include: ['lumo-overlay', 'lumo-menu-overlay-core'] }
87
- );
@@ -1,47 +0,0 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import '@vaadin/vaadin-lumo-styles/color.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-item/theme/lumo/vaadin-item.js';
6
-
7
- /* TODO partly duplicated from vaadin-list-box styles. Should find a way to make it DRY */
8
- registerStyles(
9
- 'vaadin-combo-box-item',
10
- css`
11
- :host {
12
- cursor: default;
13
- -webkit-tap-highlight-color: var(--lumo-primary-color-10pct);
14
- padding-left: calc(var(--lumo-border-radius-m) / 4);
15
- padding-right: calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4);
16
- transition: background-color 100ms;
17
- border-radius: var(--lumo-border-radius-m);
18
- overflow: hidden;
19
- --_lumo-item-selected-icon-display: block;
20
- }
21
-
22
- :host(:hover) {
23
- background-color: var(--lumo-primary-color-10pct);
24
- }
25
-
26
- :host([focused]:not([disabled])) {
27
- box-shadow: inset 0 0 0 2px var(--lumo-primary-color-50pct);
28
- }
29
-
30
- @media (pointer: coarse) {
31
- :host(:hover) {
32
- background-color: transparent;
33
- }
34
-
35
- :host([focused]:not([disabled])) {
36
- box-shadow: none;
37
- }
38
- }
39
-
40
- /* RTL specific styles */
41
- :host([dir='rtl']) {
42
- padding-right: calc(var(--lumo-border-radius-m) / 4);
43
- padding-left: calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4);
44
- }
45
- `,
46
- { moduleId: 'lumo-combo-box-item', include: ['lumo-item'] }
47
- );
@@ -1,18 +0,0 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
3
- import '@vaadin/vaadin-lumo-styles/mixins/field-button.js';
4
- import '@vaadin/vaadin-text-field/theme/lumo/vaadin-text-field.js';
5
-
6
- registerStyles(
7
- 'vaadin-combo-box',
8
- css`
9
- :host {
10
- outline: none;
11
- }
12
-
13
- [part='toggle-button']::before {
14
- content: var(--lumo-icons-dropdown);
15
- }
16
- `,
17
- { moduleId: 'lumo-combo-box', include: ['lumo-field-button'] }
18
- );
@@ -1,124 +0,0 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import '@vaadin/vaadin-material-styles/color.js';
3
- import '@vaadin/vaadin-material-styles/mixins/menu-overlay.js';
4
-
5
- registerStyles(
6
- 'vaadin-combo-box-overlay',
7
- css`
8
- :host {
9
- /* TODO using a legacy mixin (unsupported) */
10
- --iron-list-items-container: {
11
- border-width: 8px 0;
12
- border-style: solid;
13
- border-color: transparent;
14
- }
15
- }
16
-
17
- [part='overlay'] {
18
- position: relative;
19
- overflow: visible;
20
- border-top-left-radius: 0;
21
- border-top-right-radius: 0;
22
- }
23
-
24
- [part='content'] {
25
- padding: 0;
26
- }
27
-
28
- :host([loading]) [part='loader'] {
29
- height: 2px;
30
- position: absolute;
31
- z-index: 1;
32
- top: -2px;
33
- left: 0;
34
- right: 0;
35
- background: var(--material-background-color)
36
- linear-gradient(
37
- 90deg,
38
- transparent 0%,
39
- transparent 20%,
40
- var(--material-primary-color) 20%,
41
- var(--material-primary-color) 40%,
42
- transparent 40%,
43
- transparent 60%,
44
- var(--material-primary-color) 60%,
45
- var(--material-primary-color) 80%,
46
- transparent 80%,
47
- transparent 100%
48
- )
49
- 0 0 / 400% 100% repeat-x;
50
- opacity: 0;
51
- animation: 3s linear infinite material-combo-box-loader-progress, 0.3s 0.1s both material-combo-box-loader-fade-in;
52
- }
53
-
54
- [part='loader']::before {
55
- content: '';
56
- display: block;
57
- height: 100%;
58
- opacity: 0.16;
59
- background: var(--material-primary-color);
60
- }
61
-
62
- @keyframes material-combo-box-loader-fade-in {
63
- 0% {
64
- opacity: 0;
65
- }
66
-
67
- 100% {
68
- opacity: 1;
69
- }
70
- }
71
-
72
- @keyframes material-combo-box-loader-progress {
73
- 0% {
74
- background-position: 0 0;
75
- background-size: 300% 100%;
76
- }
77
-
78
- 33% {
79
- background-position: -100% 0;
80
- background-size: 400% 100%;
81
- }
82
-
83
- 67% {
84
- background-position: -200% 0;
85
- background-size: 250% 100%;
86
- }
87
-
88
- 100% {
89
- background-position: -300% 0;
90
- background-size: 300% 100%;
91
- }
92
- }
93
-
94
- /* RTL specific styles */
95
-
96
- @keyframes material-combo-box-loader-progress-rtl {
97
- 0% {
98
- background-position: 100% 0;
99
- background-size: 300% 100%;
100
- }
101
-
102
- 33% {
103
- background-position: 200% 0;
104
- background-size: 400% 100%;
105
- }
106
-
107
- 67% {
108
- background-position: 300% 0;
109
- background-size: 250% 100%;
110
- }
111
-
112
- 100% {
113
- background-position: 400% 0;
114
- background-size: 300% 100%;
115
- }
116
- }
117
-
118
- :host([loading][dir='rtl']) [part='loader'] {
119
- animation: 3s linear infinite material-combo-box-loader-progress-rtl,
120
- 0.3s 0.1s both material-combo-box-loader-fade-in;
121
- }
122
- `,
123
- { moduleId: 'material-combo-box-overlay', include: ['material-menu-overlay'] }
124
- );
@@ -1,35 +0,0 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import '@vaadin/vaadin-material-styles/color.js';
3
- import '@vaadin/vaadin-material-styles/font-icons.js';
4
- import '@vaadin/vaadin-material-styles/typography.js';
5
- import '@vaadin/vaadin-item/theme/material/vaadin-item.js';
6
-
7
- registerStyles(
8
- 'vaadin-combo-box-item',
9
- css`
10
- :host {
11
- cursor: pointer;
12
- -webkit-tap-highlight-color: transparent;
13
- padding: 4px 10px;
14
- min-height: 36px;
15
- font-size: var(--material-small-font-size);
16
- --_material-item-selected-icon-display: block;
17
- }
18
-
19
- :host(:hover) {
20
- background-color: var(--material-secondary-background-color);
21
- }
22
-
23
- :host([focused]) {
24
- background-color: var(--material-divider-color);
25
- }
26
-
27
- @media (pointer: coarse) {
28
- :host(:hover),
29
- :host([focused]) {
30
- background-color: transparent;
31
- }
32
- }
33
- `,
34
- { moduleId: 'material-combo-box-item', include: ['material-item'] }
35
- );
@@ -1,25 +0,0 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import '@vaadin/vaadin-text-field/theme/material/vaadin-text-field.js';
3
- import '@vaadin/vaadin-material-styles/color.js';
4
- import '@vaadin/vaadin-material-styles/font-icons.js';
5
- import '@vaadin/vaadin-material-styles/mixins/field-button.js';
6
-
7
- registerStyles(
8
- 'vaadin-combo-box',
9
- css`
10
- :host {
11
- display: inline-flex;
12
- outline: none;
13
- -webkit-tap-highlight-color: transparent;
14
- }
15
-
16
- [part='toggle-button']::before {
17
- content: var(--material-icons-dropdown);
18
- }
19
-
20
- :host([opened]) [part='toggle-button'] {
21
- transform: rotate(180deg);
22
- }
23
- `,
24
- { moduleId: 'material-combo-box', include: ['material-field-button'] }
25
- );