@vaadin/field-highlighter 24.7.0-alpha4 → 24.7.0-alpha6
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.
- package/package.json +21 -21
- package/src/fields/outline.js +4 -0
- package/src/vaadin-field-highlighter-styles.d.ts +12 -0
- package/src/vaadin-field-highlighter-styles.js +107 -0
- package/src/vaadin-field-outline.js +5 -21
- package/src/vaadin-user-tag.js +5 -38
- package/src/vaadin-user-tags-overlay.js +2 -48
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/field-highlighter",
|
|
3
|
-
"version": "24.7.0-
|
|
3
|
+
"version": "24.7.0-alpha6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,30 +34,30 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/a11y-base": "24.7.0-
|
|
38
|
-
"@vaadin/component-base": "24.7.0-
|
|
39
|
-
"@vaadin/overlay": "24.7.0-
|
|
40
|
-
"@vaadin/vaadin-lumo-styles": "24.7.0-
|
|
41
|
-
"@vaadin/vaadin-material-styles": "24.7.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "24.7.0-
|
|
37
|
+
"@vaadin/a11y-base": "24.7.0-alpha6",
|
|
38
|
+
"@vaadin/component-base": "24.7.0-alpha6",
|
|
39
|
+
"@vaadin/overlay": "24.7.0-alpha6",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "24.7.0-alpha6",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "24.7.0-alpha6",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "24.7.0-alpha6",
|
|
43
43
|
"lit": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@vaadin/chai-plugins": "24.7.0-
|
|
47
|
-
"@vaadin/checkbox": "24.7.0-
|
|
48
|
-
"@vaadin/checkbox-group": "24.7.0-
|
|
49
|
-
"@vaadin/combo-box": "24.7.0-
|
|
50
|
-
"@vaadin/date-picker": "24.7.0-
|
|
51
|
-
"@vaadin/date-time-picker": "24.7.0-
|
|
52
|
-
"@vaadin/item": "24.7.0-
|
|
53
|
-
"@vaadin/list-box": "24.7.0-
|
|
54
|
-
"@vaadin/radio-group": "24.7.0-
|
|
55
|
-
"@vaadin/select": "24.7.0-
|
|
46
|
+
"@vaadin/chai-plugins": "24.7.0-alpha6",
|
|
47
|
+
"@vaadin/checkbox": "24.7.0-alpha6",
|
|
48
|
+
"@vaadin/checkbox-group": "24.7.0-alpha6",
|
|
49
|
+
"@vaadin/combo-box": "24.7.0-alpha6",
|
|
50
|
+
"@vaadin/date-picker": "24.7.0-alpha6",
|
|
51
|
+
"@vaadin/date-time-picker": "24.7.0-alpha6",
|
|
52
|
+
"@vaadin/item": "24.7.0-alpha6",
|
|
53
|
+
"@vaadin/list-box": "24.7.0-alpha6",
|
|
54
|
+
"@vaadin/radio-group": "24.7.0-alpha6",
|
|
55
|
+
"@vaadin/select": "24.7.0-alpha6",
|
|
56
56
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
57
|
-
"@vaadin/text-area": "24.7.0-
|
|
58
|
-
"@vaadin/text-field": "24.7.0-
|
|
59
|
-
"@vaadin/time-picker": "24.7.0-
|
|
57
|
+
"@vaadin/text-area": "24.7.0-alpha6",
|
|
58
|
+
"@vaadin/text-field": "24.7.0-alpha6",
|
|
59
|
+
"@vaadin/time-picker": "24.7.0-alpha6",
|
|
60
60
|
"sinon": "^18.0.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "6255a512997a648da91fed37de4d5000809eaebf"
|
|
63
63
|
}
|
package/src/fields/outline.js
CHANGED
|
@@ -48,6 +48,10 @@ export const initOutline = (field) => {
|
|
|
48
48
|
|
|
49
49
|
const style = document.createElement('style');
|
|
50
50
|
style.textContent = `
|
|
51
|
+
:host([focused]) [part="outline"] {
|
|
52
|
+
opacity: calc(1 - var(--lumo-input-field-pointer-focus-visible, 0));
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
:host([active]) [part="outline"],
|
|
52
56
|
:host([focus-ring]) [part="outline"] {
|
|
53
57
|
display: none;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 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 fieldOutlineStyles: CSSResult;
|
|
9
|
+
|
|
10
|
+
export const userTagStyles: CSSResult;
|
|
11
|
+
|
|
12
|
+
export const userTagsOverlayStyles: CSSResult;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 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 '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
|
+
|
|
8
|
+
export const fieldOutlineStyles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
position: absolute;
|
|
13
|
+
inset: 0;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
user-select: none;
|
|
18
|
+
opacity: 0;
|
|
19
|
+
--_active-user-color: transparent;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([has-active-user]) {
|
|
23
|
+
opacity: 1;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const userTagStyles = css`
|
|
28
|
+
:host {
|
|
29
|
+
display: block;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
margin: 0 0 var(--vaadin-user-tag-offset);
|
|
32
|
+
opacity: 0;
|
|
33
|
+
height: 1.3rem;
|
|
34
|
+
transition: opacity 0.2s ease-in-out;
|
|
35
|
+
background-color: var(--vaadin-user-tag-color);
|
|
36
|
+
color: #fff;
|
|
37
|
+
cursor: default;
|
|
38
|
+
-webkit-user-select: none;
|
|
39
|
+
user-select: none;
|
|
40
|
+
--vaadin-user-tag-offset: 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host(.show) {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host(:last-of-type) {
|
|
48
|
+
margin-bottom: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[part='name'] {
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
padding: 2px 4px;
|
|
57
|
+
height: 1.3rem;
|
|
58
|
+
font-size: 13px;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
export const userTagsOverlayStyles = css`
|
|
63
|
+
:host {
|
|
64
|
+
background: transparent;
|
|
65
|
+
box-shadow: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[part='overlay'] {
|
|
69
|
+
box-shadow: none;
|
|
70
|
+
background: transparent;
|
|
71
|
+
position: relative;
|
|
72
|
+
left: -4px;
|
|
73
|
+
padding: 4px;
|
|
74
|
+
outline: none;
|
|
75
|
+
overflow: visible;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
::slotted([part='tags']) {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
align-items: flex-start;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([dir='rtl']) [part='overlay'] {
|
|
85
|
+
left: auto;
|
|
86
|
+
right: -4px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[part='content'] {
|
|
90
|
+
padding: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host([opening]),
|
|
94
|
+
:host([closing]) {
|
|
95
|
+
animation: 0.14s user-tags-overlay-dummy-animation;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@keyframes user-tags-overlay-dummy-animation {
|
|
99
|
+
0% {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
100% {
|
|
104
|
+
opacity: 1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
+
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
+
import { fieldOutlineStyles } from './vaadin-field-highlighter-styles.js';
|
|
11
|
+
|
|
12
|
+
registerStyles('vaadin-field-outline', fieldOutlineStyles, { moduleId: 'vaadin-field-outline-styles' });
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* An element used internally by `<vaadin-field-highlighter>`. Not intended to be used separately.
|
|
@@ -22,26 +25,7 @@ export class FieldOutline extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
static get template() {
|
|
25
|
-
return html
|
|
26
|
-
<style>
|
|
27
|
-
:host {
|
|
28
|
-
display: block;
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
position: absolute;
|
|
31
|
-
inset: 0;
|
|
32
|
-
width: 100%;
|
|
33
|
-
height: 100%;
|
|
34
|
-
pointer-events: none;
|
|
35
|
-
user-select: none;
|
|
36
|
-
opacity: 0;
|
|
37
|
-
--_active-user-color: transparent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:host([has-active-user]) {
|
|
41
|
-
opacity: 1;
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
44
|
-
`;
|
|
28
|
+
return html``;
|
|
45
29
|
}
|
|
46
30
|
|
|
47
31
|
static get properties() {
|
package/src/vaadin-user-tag.js
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
+
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
+
import { userTagStyles } from './vaadin-field-highlighter-styles.js';
|
|
11
|
+
|
|
12
|
+
registerStyles('vaadin-user-tag', userTagStyles, { moduleId: 'vaadin-user-tag-styles' });
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* An element used internally by `<vaadin-field-highlighter>`. Not intended to be used separately.
|
|
@@ -23,43 +26,7 @@ export class UserTag extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
static get template() {
|
|
26
|
-
return html
|
|
27
|
-
<style>
|
|
28
|
-
:host {
|
|
29
|
-
display: block;
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
margin: 0 0 var(--vaadin-user-tag-offset);
|
|
32
|
-
opacity: 0;
|
|
33
|
-
height: 1.3rem;
|
|
34
|
-
transition: opacity 0.2s ease-in-out;
|
|
35
|
-
background-color: var(--vaadin-user-tag-color);
|
|
36
|
-
color: #fff;
|
|
37
|
-
cursor: default;
|
|
38
|
-
-webkit-user-select: none;
|
|
39
|
-
user-select: none;
|
|
40
|
-
--vaadin-user-tag-offset: 4px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host(.show) {
|
|
44
|
-
opacity: 1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host(:last-of-type) {
|
|
48
|
-
margin-bottom: 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
[part='name'] {
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
white-space: nowrap;
|
|
54
|
-
text-overflow: ellipsis;
|
|
55
|
-
box-sizing: border-box;
|
|
56
|
-
padding: 2px 4px;
|
|
57
|
-
height: 1.3rem;
|
|
58
|
-
font-size: 13px;
|
|
59
|
-
}
|
|
60
|
-
</style>
|
|
61
|
-
<div part="name">[[name]]</div>
|
|
62
|
-
`;
|
|
29
|
+
return html`<div part="name">[[name]]</div>`;
|
|
63
30
|
}
|
|
64
31
|
|
|
65
32
|
static get properties() {
|
|
@@ -9,54 +9,8 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
|
9
9
|
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
10
10
|
import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
|
|
11
11
|
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
const userTagsOverlayStyles = css`
|
|
15
|
-
:host {
|
|
16
|
-
background: transparent;
|
|
17
|
-
box-shadow: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
[part='overlay'] {
|
|
21
|
-
box-shadow: none;
|
|
22
|
-
background: transparent;
|
|
23
|
-
position: relative;
|
|
24
|
-
left: -4px;
|
|
25
|
-
padding: 4px;
|
|
26
|
-
outline: none;
|
|
27
|
-
overflow: visible;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
::slotted([part='tags']) {
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
align-items: flex-start;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:host([dir='rtl']) [part='overlay'] {
|
|
37
|
-
left: auto;
|
|
38
|
-
right: -4px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
[part='content'] {
|
|
42
|
-
padding: 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host([opening]),
|
|
46
|
-
:host([closing]) {
|
|
47
|
-
animation: 0.14s user-tags-overlay-dummy-animation;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@keyframes user-tags-overlay-dummy-animation {
|
|
51
|
-
0% {
|
|
52
|
-
opacity: 1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
100% {
|
|
56
|
-
opacity: 1;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
12
|
+
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { userTagsOverlayStyles } from './vaadin-field-highlighter-styles.js';
|
|
60
14
|
|
|
61
15
|
registerStyles('vaadin-user-tags-overlay', [overlayStyles, userTagsOverlayStyles]);
|
|
62
16
|
|