q2-tecton-elements 1.10.5 → 1.10.8
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/dist/cjs/{icons-921779df.js → icons-4595ee47.js} +61 -1
- package/dist/cjs/{index-f4153f5a.js → index-a55d3c34.js} +9 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-btn_2.cjs.entry.js +10 -6
- package/dist/cjs/q2-calendar.cjs.entry.js +2902 -6078
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +50 -7
- package/dist/cjs/q2-carousel.cjs.entry.js +2719 -6513
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox.cjs.entry.js +10 -2
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-dropdown.cjs.entry.js +8 -2
- package/dist/cjs/q2-editable-field.cjs.entry.js +26 -11
- package/dist/cjs/q2-icon.cjs.entry.js +2 -2
- package/dist/cjs/q2-input.cjs.entry.js +9 -7
- package/dist/cjs/q2-loading-element.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +11 -3
- package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
- package/dist/cjs/q2-option.cjs.entry.js +3 -34
- package/dist/cjs/q2-radio-group.cjs.entry.js +10 -2
- package/dist/cjs/q2-radio.cjs.entry.js +10 -2
- package/dist/cjs/q2-section.cjs.entry.js +9 -3
- package/dist/cjs/q2-select.cjs.entry.js +175 -130
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +10 -4
- package/dist/cjs/q2-tab-container.cjs.entry.js +9 -11
- package/dist/cjs/q2-tab-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +8 -4
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
- package/dist/collection/components/q2-avatar/index.js +1 -1
- package/dist/collection/components/q2-avatar/styles.css +63 -61
- package/dist/collection/components/q2-btn/index.js +8 -4
- package/dist/collection/components/q2-btn/styles.css +96 -96
- package/dist/collection/components/q2-calendar/helpers.js +77 -52
- package/dist/collection/components/q2-calendar/index.js +248 -196
- package/dist/collection/components/q2-calendar/styles.css +63 -84
- package/dist/collection/components/q2-calendar/validation.js +100 -166
- package/dist/collection/components/q2-carousel/index.js +204 -266
- package/dist/collection/components/q2-carousel/styles.css +152 -155
- package/dist/collection/components/q2-carousel-pane/index.js +67 -28
- package/dist/collection/components/q2-carousel-pane/styles.css +82 -16
- package/dist/collection/components/q2-checkbox/index.js +16 -2
- package/dist/collection/components/q2-checkbox/styles.css +152 -176
- package/dist/collection/components/q2-checkbox-group/index.js +1 -1
- package/dist/collection/components/q2-checkbox-group/styles.css +65 -81
- package/dist/collection/components/q2-dropdown/index.js +15 -2
- package/dist/collection/components/q2-dropdown/styles.css +49 -36
- package/dist/collection/components/q2-dropdown-item/index.js +1 -1
- package/dist/collection/components/q2-dropdown-item/styles.css +48 -62
- package/dist/collection/components/q2-editable-field/index.js +33 -12
- package/dist/collection/components/q2-editable-field/styles.css +49 -50
- package/dist/collection/components/q2-icon/icons.js +61 -1
- package/dist/collection/components/q2-icon/styles.css +29 -29
- package/dist/collection/components/q2-input/index.js +9 -7
- package/dist/collection/components/q2-input/styles.css +211 -292
- package/dist/collection/components/q2-loading/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/styles.css +5 -6
- package/dist/collection/components/q2-loading/styles.css +130 -136
- package/dist/collection/components/q2-loc/index.js +1 -1
- package/dist/collection/components/q2-loc/styles.css +30 -31
- package/dist/collection/components/q2-message/index.js +18 -3
- package/dist/collection/components/q2-message/styles.css +32 -29
- package/dist/collection/components/q2-optgroup/index.js +1 -1
- package/dist/collection/components/q2-optgroup/styles.css +42 -47
- package/dist/collection/components/q2-option/index.js +4 -42
- package/dist/collection/components/q2-option/styles.css +29 -29
- package/dist/collection/components/q2-radio/index.js +16 -2
- package/dist/collection/components/q2-radio/styles.css +29 -29
- package/dist/collection/components/q2-radio-group/index.js +16 -2
- package/dist/collection/components/q2-radio-group/styles.css +67 -72
- package/dist/collection/components/q2-section/index.js +15 -3
- package/dist/collection/components/q2-section/styles.css +77 -77
- package/dist/collection/components/q2-select/index.js +182 -131
- package/dist/collection/components/q2-select/styles.css +33 -34
- package/dist/collection/components/q2-stepper/index.js +15 -3
- package/dist/collection/components/q2-stepper/styles.css +32 -32
- package/dist/collection/components/q2-stepper-pane/styles.css +29 -29
- package/dist/collection/components/q2-tab-container/index.js +7 -9
- package/dist/collection/components/q2-tab-container/styles.css +29 -29
- package/dist/collection/components/q2-tab-pane/index.js +2 -2
- package/dist/collection/components/q2-tab-pane/styles.css +34 -36
- package/dist/collection/components/q2-textarea/index.js +8 -4
- package/dist/collection/components/q2-textarea/styles.css +180 -228
- package/dist/collection/components/tecton-tab-pane/index.js +2 -2
- package/dist/collection/components/tecton-tab-pane/styles.css +50 -50
- package/dist/collection/utils/index.js +7 -0
- package/dist/esm/{icons-a3817842.js → icons-3ee662ea.js} +61 -1
- package/dist/esm/{index-476b86cc.js → index-ec6660af.js} +8 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-btn_2.entry.js +10 -6
- package/dist/esm/q2-calendar.entry.js +2902 -6078
- package/dist/esm/q2-carousel-pane.entry.js +51 -8
- package/dist/esm/q2-carousel.entry.js +2720 -6514
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox.entry.js +10 -2
- package/dist/esm/q2-dropdown-item.entry.js +2 -2
- package/dist/esm/q2-dropdown.entry.js +8 -2
- package/dist/esm/q2-editable-field.entry.js +26 -11
- package/dist/esm/q2-icon.entry.js +2 -2
- package/dist/esm/q2-input.entry.js +9 -7
- package/dist/esm/q2-loading-element.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +11 -3
- package/dist/esm/q2-optgroup.entry.js +2 -2
- package/dist/esm/q2-option.entry.js +4 -35
- package/dist/esm/q2-radio-group.entry.js +10 -2
- package/dist/esm/q2-radio.entry.js +10 -2
- package/dist/esm/q2-section.entry.js +9 -3
- package/dist/esm/q2-select.entry.js +175 -130
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +10 -4
- package/dist/esm/q2-tab-container.entry.js +7 -9
- package/dist/esm/q2-tab-pane.entry.js +2 -2
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +8 -4
- package/dist/esm/tecton-tab-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/{p-4830affe.entry.js → p-07a5d703.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-84c05db6.entry.js → p-32ad664c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-37aba2a4.js +1 -0
- package/dist/q2-tecton-elements/p-4ae9d1f3.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-67d86e3c.js → p-4cd00f1a.js} +1 -1
- package/dist/q2-tecton-elements/p-52f53e07.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5559f126.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6702eb4d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-750bcd33.entry.js +1 -0
- package/dist/q2-tecton-elements/p-78642b7b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-7e6fc65d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-7eb39c90.entry.js +1 -0
- package/dist/q2-tecton-elements/p-81df91a1.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-01e00610.entry.js → p-843b1ee9.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-8509b171.entry.js +1 -0
- package/dist/q2-tecton-elements/p-8ea2c4f7.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-d1d040ef.entry.js → p-95a73559.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-96c9eb75.entry.js +1 -0
- package/dist/q2-tecton-elements/p-9b50c3c3.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-a9bdd814.entry.js → p-a6f8d09a.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ab977515.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-9314863f.entry.js → p-bb2e110a.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-bbacb804.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c555f1de.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-4229b057.entry.js → p-df182f61.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-61c0e5fd.entry.js → p-fbf7c5e6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-fc804ebd.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +4 -0
- package/dist/types/components/q2-btn/index.d.ts +1 -0
- package/dist/types/components/q2-calendar/helpers.d.ts +6 -6
- package/dist/types/components/q2-calendar/index.d.ts +16 -17
- package/dist/types/components/q2-calendar/types.d.ts +9 -26
- package/dist/types/components/q2-calendar/validation.d.ts +27 -12
- package/dist/types/components/q2-carousel/index.d.ts +15 -45
- package/dist/types/components/q2-carousel-pane/index.d.ts +5 -2
- package/dist/types/components/q2-checkbox/index.d.ts +2 -0
- package/dist/types/components/q2-dropdown/index.d.ts +1 -0
- package/dist/types/components/q2-editable-field/index.d.ts +5 -1
- package/dist/types/components/q2-input/index.d.ts +1 -1
- package/dist/types/components/q2-message/index.d.ts +2 -0
- package/dist/types/components/q2-option/index.d.ts +0 -4
- package/dist/types/components/q2-radio/index.d.ts +3 -0
- package/dist/types/components/q2-radio-group/index.d.ts +1 -0
- package/dist/types/components/q2-section/index.d.ts +1 -0
- package/dist/types/components/q2-select/index.d.ts +10 -7
- package/dist/types/components/q2-stepper/index.d.ts +2 -1
- package/dist/types/components/q2-tab-container/index.d.ts +1 -1
- package/dist/types/components/q2-textarea/index.d.ts +2 -1
- package/dist/types/components.d.ts +3 -2
- package/dist/types/util.d.ts +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/workspace/workspace/tecton-production_release_1.10.x/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -1
- package/package.json +4 -5
- package/dist/q2-tecton-elements/p-1fc4e6f6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-25a5f691.js +0 -1
- package/dist/q2-tecton-elements/p-27353237.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3e100450.entry.js +0 -1
- package/dist/q2-tecton-elements/p-428d15fd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-48fc317d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5222b792.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5469c1e9.entry.js +0 -1
- package/dist/q2-tecton-elements/p-74c1a311.entry.js +0 -1
- package/dist/q2-tecton-elements/p-784af485.entry.js +0 -1
- package/dist/q2-tecton-elements/p-7c99a58b.entry.js +0 -1
- package/dist/q2-tecton-elements/p-7f74b629.entry.js +0 -1
- package/dist/q2-tecton-elements/p-831a461f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-84c52d3b.entry.js +0 -9
- package/dist/q2-tecton-elements/p-997e4c7e.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a224bc9c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d893fcf2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-da7cca07.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f17761da.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f5e074f8.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, Prop, Element, State, Watch, h, Fragment } from '@stencil/core';
|
|
2
|
-
import { handleAriaLabel, loc, setPopProperties } from 'src/utils';
|
|
1
|
+
import { Component, Prop, Element, State, Watch, h, Fragment, Listen } from '@stencil/core';
|
|
2
|
+
import { handleAriaLabel, isEventFromElement, loc, overrideFocus, setPopProperties } from 'src/utils';
|
|
3
3
|
export class Q2Dropdown {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.type = 'icon';
|
|
@@ -205,12 +205,18 @@ export class Q2Dropdown {
|
|
|
205
205
|
resolvedTypeHandler() {
|
|
206
206
|
this.orchestrateResolvedMenuItems();
|
|
207
207
|
}
|
|
208
|
+
delegateFocus(event) {
|
|
209
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
210
|
+
return;
|
|
211
|
+
this.controlElement.shadowRoot.querySelector('button').focus();
|
|
212
|
+
}
|
|
208
213
|
///// Lifecycle Hooks ////////
|
|
209
214
|
componentWillLoad() {
|
|
210
215
|
handleAriaLabel(this);
|
|
211
216
|
}
|
|
212
217
|
componentDidLoad() {
|
|
213
218
|
this.orchestrateResolvedMenuItems();
|
|
219
|
+
overrideFocus(this.hostElement);
|
|
214
220
|
}
|
|
215
221
|
componentDidRender() {
|
|
216
222
|
setTimeout(() => {
|
|
@@ -482,4 +488,11 @@ export class Q2Dropdown {
|
|
|
482
488
|
"propName": "resolvedType",
|
|
483
489
|
"methodName": "resolvedTypeHandler"
|
|
484
490
|
}]; }
|
|
491
|
+
static get listeners() { return [{
|
|
492
|
+
"name": "focus",
|
|
493
|
+
"method": "delegateFocus",
|
|
494
|
+
"target": undefined,
|
|
495
|
+
"capture": false,
|
|
496
|
+
"passive": false
|
|
497
|
+
}]; }
|
|
485
498
|
}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
* {
|
|
2
|
-
|
|
2
|
+
box-sizing: border-box;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
*:active {
|
|
6
|
-
|
|
6
|
+
outline: none;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
*:focus {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-global-focus);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:host {
|
|
15
|
-
|
|
15
|
+
box-shadow: none !important;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
::-moz-focus-inner {
|
|
19
|
-
|
|
19
|
+
border: none;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
input,
|
|
23
23
|
textarea,
|
|
24
24
|
button {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
:host(.sr),
|
|
30
30
|
:host(.sr) button {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
border: 0;
|
|
32
|
+
clip: rect(0 0 0 0);
|
|
33
|
+
height: 1px;
|
|
34
|
+
margin: -1px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
white-space: nowrap;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.sr,
|
|
43
43
|
.sr button {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
border: 0;
|
|
45
|
+
clip: rect(0 0 0 0);
|
|
46
|
+
height: 1px;
|
|
47
|
+
margin: -1px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding: 0;
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
white-space: nowrap;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.hidden {
|
|
56
|
-
|
|
56
|
+
display: none;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
:host([hidden]) {
|
|
60
|
-
|
|
60
|
+
display: none;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.invisible {
|
|
64
|
-
|
|
64
|
+
visibility: hidden;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.q2-element-dropdown {
|
|
@@ -79,10 +79,10 @@ button {
|
|
|
79
79
|
opacity: 0;
|
|
80
80
|
visibility: hidden;
|
|
81
81
|
transition: opacity var(--app-tween-1);
|
|
82
|
-
border-radius: var(--tct-dropdown-
|
|
83
|
-
--comp-scrollbar-size: var(--tct-scrollbar-size, var(--app-scale-1x, 5px));
|
|
84
|
-
--comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--app-border-radius-1, 3px));
|
|
85
|
-
--comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-a11y-gray-color, #747474));
|
|
82
|
+
border-radius: var(--tct-dropdown-border-radius, --t-dropdown-border-radius, 0);
|
|
83
|
+
--comp-scrollbar-size: var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));
|
|
84
|
+
--comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));
|
|
85
|
+
--comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));
|
|
86
86
|
scrollbar-width: thin;
|
|
87
87
|
scrollbar-color: var(--comp-scrollbar-color) transparent;
|
|
88
88
|
}
|
|
@@ -111,7 +111,6 @@ button {
|
|
|
111
111
|
overflow: auto;
|
|
112
112
|
opacity: 1;
|
|
113
113
|
visibility: visible;
|
|
114
|
-
margin-bottom: var(--app-scale-2);
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
:host([alignment=right]) .q2-element-dropdown {
|
|
@@ -138,9 +137,23 @@ button {
|
|
|
138
137
|
}
|
|
139
138
|
|
|
140
139
|
.q2-element-dropdown {
|
|
141
|
-
width: var(--tct-
|
|
140
|
+
width: var(--tct-dropdown-width, var(--t-dropdown-width, 175px));
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
.q2-element-dropdown.dropup {
|
|
145
|
-
bottom:
|
|
144
|
+
bottom: var(--tct-btn-icon-height, var(--t-btn-icon-height, 44px));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
q2-btn[color=primary] ~ .q2-element-dropdown.dropup,
|
|
148
|
+
q2-btn[intent=workflow-primary] ~ .q2-element-dropdown.dropup {
|
|
149
|
+
bottom: calc( var-list(var-prefixer(btn-icon-height), 44px) + var-list(var-prefixer(btn-primary-border-width), 0) );
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
q2-btn[color=secondary] ~ .q2-element-dropdown.dropup,
|
|
153
|
+
q2-btn[intent=workflow-secondary] ~ .q2-element-dropdown.dropup {
|
|
154
|
+
bottom: calc( var-list(var-prefixer(btn-icon-height), 44px) + var-list(var-prefixer(btn-secondary-border-width), 0) );
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
q2-btn[intent=neutral] ~ .q2-element-dropdown.dropup {
|
|
158
|
+
bottom: calc( var-list(var-prefixer(btn-icon-height), 44px) + var-list(var-prefixer(btn-neutral-border-width), 0) );
|
|
146
159
|
}
|
|
@@ -92,7 +92,7 @@ export class Q2DropdownItem {
|
|
|
92
92
|
static get is() { return "q2-dropdown-item"; }
|
|
93
93
|
static get encapsulation() { return "shadow"; }
|
|
94
94
|
static get originalStyleUrls() { return {
|
|
95
|
-
"$": ["styles.
|
|
95
|
+
"$": ["styles.scss"]
|
|
96
96
|
}; }
|
|
97
97
|
static get styleUrls() { return {
|
|
98
98
|
"$": ["styles.css"]
|
|
@@ -1,116 +1,102 @@
|
|
|
1
1
|
* {
|
|
2
|
-
|
|
2
|
+
box-sizing: border-box;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
*:active {
|
|
6
|
-
|
|
6
|
+
outline: none;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
*:focus {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-global-focus);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:host {
|
|
15
|
-
|
|
15
|
+
box-shadow: none !important;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
::-moz-focus-inner {
|
|
19
|
-
|
|
19
|
+
border: none;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
input,
|
|
23
23
|
textarea,
|
|
24
24
|
button {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
:host(.sr),
|
|
30
30
|
:host(.sr) button {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
border: 0;
|
|
32
|
+
clip: rect(0 0 0 0);
|
|
33
|
+
height: 1px;
|
|
34
|
+
margin: -1px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
white-space: nowrap;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.sr,
|
|
43
43
|
.sr button {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
border: 0;
|
|
45
|
+
clip: rect(0 0 0 0);
|
|
46
|
+
height: 1px;
|
|
47
|
+
margin: -1px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding: 0;
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
white-space: nowrap;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.hidden {
|
|
56
|
-
|
|
56
|
+
display: none;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
:host([hidden]) {
|
|
60
|
-
|
|
60
|
+
display: none;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.invisible {
|
|
64
|
-
|
|
64
|
+
visibility: hidden;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
67
|
.dropdown-separator {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var(
|
|
72
|
-
--tct-dropdown-item-separator-color,
|
|
73
|
-
var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))
|
|
74
|
-
);
|
|
68
|
+
margin: 0 var(--tct-scale-1, var(--app-scale-1, 5px));
|
|
69
|
+
border-bottom: 1px solid var(--tct-dropdown-item-separator-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc)))));
|
|
75
70
|
}
|
|
76
71
|
|
|
77
72
|
.dropdown-item-wrapper {
|
|
78
|
-
|
|
73
|
+
display: flex;
|
|
79
74
|
}
|
|
80
75
|
|
|
81
76
|
.dropdown-item {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
min-height: 44px;
|
|
78
|
+
flex: 1 1 100%;
|
|
79
|
+
padding: var(--tct-dropdown-item-padding, 2px);
|
|
85
80
|
}
|
|
86
81
|
|
|
87
82
|
.dropdown-item-content {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
overflow: hidden;
|
|
97
|
-
text-overflow: ellipsis;
|
|
98
|
-
flex: 1;
|
|
83
|
+
padding: 12px var(--tct-scale-3, var(--app-scale-3, 15px));
|
|
84
|
+
text-align: left;
|
|
85
|
+
background-color: var(--tct-dropdown-item-bg, var(--tct-white, var(--t-base, var(--app-white, #ffffff))));
|
|
86
|
+
color: var(--tct-dropdown-item-font-color, inherit);
|
|
87
|
+
transition: background-color var(--tct-tween-1, var(--app-tween-1, 0.2s ease));
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
text-overflow: ellipsis;
|
|
90
|
+
flex: 1;
|
|
99
91
|
}
|
|
100
92
|
|
|
101
93
|
:host(:not([disabled])) .dropdown-item-content:hover,
|
|
102
94
|
:host(:not([disabled])) .dropdown-item:focus-within .dropdown-item-content {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var(
|
|
106
|
-
--tct-gray-14,
|
|
107
|
-
var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, var(--t-base, #f2f2f2))))
|
|
108
|
-
)
|
|
109
|
-
);
|
|
110
|
-
color: var(--tct-dropdown-item-selected-font-color, inherit);
|
|
95
|
+
background-color: var(--tct-dropdown-item-selected-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, var(--t-base, #f2f2f2))))));
|
|
96
|
+
color: var(--tct-dropdown-item-selected-font-color, inherit);
|
|
111
97
|
}
|
|
112
98
|
|
|
113
99
|
.remove-dropdown-item {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
100
|
+
flex: 0 0 44px;
|
|
101
|
+
margin: 2px;
|
|
102
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, Prop, h, Listen, Element, Event, Watch } from '@stencil/core';
|
|
2
|
-
import { handleAriaLabel, loc } from 'src/utils';
|
|
2
|
+
import { handleAriaLabel, isEventFromElement, loc, overrideFocus } from 'src/utils';
|
|
3
3
|
export class Q2EditableField {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.value = '';
|
|
@@ -42,11 +42,11 @@ export class Q2EditableField {
|
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
this.editClick = (event) => {
|
|
45
|
-
event.stopPropagation();
|
|
45
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
46
46
|
this.change.emit({ editing: true, name: 'edit' });
|
|
47
47
|
};
|
|
48
48
|
this.cancelClick = (event) => {
|
|
49
|
-
event
|
|
49
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
50
50
|
this.change.emit({ editing: false, name: 'cancel' });
|
|
51
51
|
};
|
|
52
52
|
}
|
|
@@ -61,6 +61,9 @@ export class Q2EditableField {
|
|
|
61
61
|
this.scheduledAfterRender.forEach(fn => fn());
|
|
62
62
|
this.scheduledAfterRender = [];
|
|
63
63
|
}
|
|
64
|
+
componentDidLoad() {
|
|
65
|
+
overrideFocus(this.hostElement);
|
|
66
|
+
}
|
|
64
67
|
//////// OBSERVERS //////////
|
|
65
68
|
ariaLabelObserver() {
|
|
66
69
|
handleAriaLabel(this);
|
|
@@ -89,13 +92,25 @@ export class Q2EditableField {
|
|
|
89
92
|
return `q2-editable-field-wrapper ${this.editing ? 'editing' : ''}`;
|
|
90
93
|
}
|
|
91
94
|
///////// HOST ELEMENT EVENTS //////
|
|
92
|
-
onHostElementChange(
|
|
93
|
-
if (event
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
onHostElementChange(event) {
|
|
96
|
+
if (!isEventFromElement(event, this.hostElement) || this.hostElement.onchange)
|
|
97
|
+
return;
|
|
98
|
+
switch (event.detail.name) {
|
|
99
|
+
case 'save':
|
|
100
|
+
this.value = event.detail.value;
|
|
101
|
+
break;
|
|
102
|
+
case 'cancel':
|
|
103
|
+
this.q2InputElement.value = this.value;
|
|
104
|
+
break;
|
|
98
105
|
}
|
|
106
|
+
this.editing = event.detail.editing;
|
|
107
|
+
}
|
|
108
|
+
delegateFocus(event) {
|
|
109
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
110
|
+
return;
|
|
111
|
+
this.hostElement.shadowRoot
|
|
112
|
+
.querySelector(this.editing ? 'q2-input' : 'q2-btn.begin-edit')
|
|
113
|
+
.focus();
|
|
99
114
|
}
|
|
100
115
|
render() {
|
|
101
116
|
return (h("div", null,
|
|
@@ -104,7 +119,7 @@ export class Q2EditableField {
|
|
|
104
119
|
}
|
|
105
120
|
generateEditStateDOM() {
|
|
106
121
|
return (h("div", { class: this.wrapperClass, hidden: !this.editing },
|
|
107
|
-
h("q2-input", { label: this.locLabel, hideLabel: this.hideLabel, value: this.value, hints: (Array.isArray(this.hints) && this.hints.map(str => loc(str))) || undefined, errors: (Array.isArray(this.errors) && this.errors.map(str => loc(str))) ||
|
|
122
|
+
h("q2-input", { ref: el => (this.q2InputElement = el), label: this.locLabel, hideLabel: this.hideLabel, value: this.value, hints: (Array.isArray(this.hints) && this.hints.map(str => loc(str))) || undefined, errors: (Array.isArray(this.errors) && this.errors.map(str => loc(str))) ||
|
|
108
123
|
undefined, type: this.type, formatModifier: this.formatModifier, maxlength: this.maxlength, "test-id": "editableInput", onInput: this.inputInput, onChange: this.inputChange, onKeyDown: this.inputKeyDown, onClick: this.inputClick }),
|
|
109
124
|
h("q2-btn", { class: "cancel-edit", label: `${loc('tecton.element.editableField.cancel')} ${this.locLabel}`, "hide-label": true, "test-id": "cancelButton", onClick: this.cancelClick },
|
|
110
125
|
h("q2-icon", { type: "close" })),
|
|
@@ -125,13 +140,13 @@ export class Q2EditableField {
|
|
|
125
140
|
this.generateEditBtn()));
|
|
126
141
|
}
|
|
127
142
|
generateEditBtn() {
|
|
128
|
-
return (h("q2-btn", { class: "begin-edit", label: `${loc('tecton.element.editableField.edit')} ${this.locLabel}`, "hide-label": true, "test-id": "editButton", onClick: this.editClick },
|
|
143
|
+
return (h("q2-btn", { ref: el => (this.q2EditBtnElement = el), class: "begin-edit", label: `${loc('tecton.element.editableField.edit')} ${this.locLabel}`, "hide-label": true, "test-id": "editButton", onClick: this.editClick },
|
|
129
144
|
h("q2-icon", { type: "edit" })));
|
|
130
145
|
}
|
|
131
146
|
static get is() { return "q2-editable-field"; }
|
|
132
147
|
static get encapsulation() { return "shadow"; }
|
|
133
148
|
static get originalStyleUrls() { return {
|
|
134
|
-
"$": ["styles.
|
|
149
|
+
"$": ["styles.scss"]
|
|
135
150
|
}; }
|
|
136
151
|
static get styleUrls() { return {
|
|
137
152
|
"$": ["styles.css"]
|
|
@@ -386,5 +401,11 @@ export class Q2EditableField {
|
|
|
386
401
|
"target": undefined,
|
|
387
402
|
"capture": false,
|
|
388
403
|
"passive": false
|
|
404
|
+
}, {
|
|
405
|
+
"name": "focus",
|
|
406
|
+
"method": "delegateFocus",
|
|
407
|
+
"target": undefined,
|
|
408
|
+
"capture": false,
|
|
409
|
+
"passive": false
|
|
389
410
|
}]; }
|
|
390
411
|
}
|
|
@@ -1,119 +1,118 @@
|
|
|
1
1
|
* {
|
|
2
|
-
|
|
2
|
+
box-sizing: border-box;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
*:active {
|
|
6
|
-
|
|
6
|
+
outline: none;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
*:focus {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-global-focus);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:host {
|
|
15
|
-
|
|
15
|
+
box-shadow: none !important;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
::-moz-focus-inner {
|
|
19
|
-
|
|
19
|
+
border: none;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
input,
|
|
23
23
|
textarea,
|
|
24
24
|
button {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
:host(.sr),
|
|
30
30
|
:host(.sr) button {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
border: 0;
|
|
32
|
+
clip: rect(0 0 0 0);
|
|
33
|
+
height: 1px;
|
|
34
|
+
margin: -1px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
white-space: nowrap;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.sr,
|
|
43
43
|
.sr button {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
border: 0;
|
|
45
|
+
clip: rect(0 0 0 0);
|
|
46
|
+
height: 1px;
|
|
47
|
+
margin: -1px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding: 0;
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
white-space: nowrap;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.hidden {
|
|
56
|
-
|
|
56
|
+
display: none;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
:host([hidden]) {
|
|
60
|
-
|
|
60
|
+
display: none;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.invisible {
|
|
64
|
-
|
|
64
|
+
visibility: hidden;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
67
|
:host {
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
display: inline-block;
|
|
69
|
+
max-width: 100%;
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
.q2-editable-field-wrapper:not([hidden]) {
|
|
74
|
-
|
|
73
|
+
display: flex;
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
.q2-editable-field-wrapper.editing {
|
|
78
|
-
|
|
77
|
+
align-items: flex-end;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
q2-input,
|
|
82
81
|
.text-wrapper {
|
|
83
|
-
|
|
82
|
+
margin: 0 var(--tct-scale-2, var(--app-scale-2, 10px)) 0 0;
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
q2-input {
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
flex: 1 0 auto;
|
|
87
|
+
min-width: 170px;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
.text-wrapper {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
flex: 0 auto;
|
|
92
|
+
align-self: center;
|
|
93
|
+
display: inline-block;
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
:host([truncated]) .text-wrapper {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
text-overflow: ellipsis;
|
|
99
|
+
white-space: nowrap;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
q2-btn {
|
|
104
|
-
|
|
103
|
+
flex: 0 0 44px;
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
dl {
|
|
108
|
-
|
|
107
|
+
margin: var(--tct-scale-0, var(--app-scale-0, 0));
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
dt {
|
|
112
|
-
|
|
111
|
+
font-weight: 600;
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
dd {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
115
|
+
margin-left: var(--tct-scale-0, var(--app-scale-0, 0));
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
}
|