q2-tecton-elements 1.28.3 → 1.29.0
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/click-elsewhere_2.cjs.entry.js +4 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +10 -5
- package/dist/cjs/q2-badge.cjs.entry.js +43 -0
- package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +16 -7
- package/dist/cjs/q2-data-table.cjs.entry.js +287 -0
- package/dist/cjs/{q2-badge_2.cjs.entry.js → q2-input.cjs.entry.js} +1 -38
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-action-sheet/index.js +26 -4
- package/dist/collection/components/q2-action-sheet/styles.css +2 -2
- package/dist/collection/components/q2-btn/styles.css +4 -0
- package/dist/collection/components/q2-checkbox/index.js +15 -6
- package/dist/collection/components/q2-checkbox/styles.css +4 -0
- package/dist/collection/components/q2-data-table/index.js +539 -0
- package/dist/collection/components/q2-data-table/styles.css +192 -0
- package/dist/collection/components/q2-input/styles.css +1 -1
- package/dist/collection/components/q2-popover/index.js +4 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index10.js +72 -55
- package/dist/components/index11.js +56 -44
- package/dist/components/index12.js +42 -42
- package/dist/components/index13.js +40 -538
- package/dist/components/index14.js +518 -136
- package/dist/components/index15.js +174 -574
- package/dist/components/index16.js +589 -0
- package/dist/components/index3.js +1 -1
- package/dist/components/index5.js +3 -3
- package/dist/components/index6.js +93 -94
- package/dist/components/index7.js +112 -2927
- package/dist/components/index8.js +2919 -3347
- package/dist/components/index9.js +3343 -56
- package/dist/components/q2-action-sheet.js +18 -12
- package/dist/components/q2-calendar.js +6 -6
- package/dist/components/q2-card.js +2 -2
- package/dist/components/q2-carousel-pane.js +1 -1
- package/dist/components/q2-carousel.js +3 -3
- package/dist/components/q2-chart-area.js +1 -1
- package/dist/components/q2-chart-bar.js +1 -1
- package/dist/components/q2-chart-donut.js +2 -2
- package/dist/components/q2-checkbox-group.js +2 -2
- package/dist/components/q2-checkbox.js +1 -133
- package/dist/components/q2-data-table.d.ts +11 -0
- package/dist/components/q2-data-table.js +349 -0
- package/dist/components/q2-dropdown-item.js +1 -1
- package/dist/components/q2-dropdown.js +5 -5
- package/dist/components/q2-editable-field.js +4 -4
- package/dist/components/q2-icon.js +1 -1
- package/dist/components/q2-input.js +1 -1
- package/dist/components/q2-loading.js +1 -1
- package/dist/components/q2-loc.js +1 -1
- package/dist/components/q2-message.js +1 -1
- package/dist/components/q2-month-picker.js +3 -3
- package/dist/components/q2-optgroup.js +1 -1
- package/dist/components/q2-option-list.js +1 -1
- package/dist/components/q2-option.js +1 -1
- package/dist/components/q2-pagination.js +4 -4
- package/dist/components/q2-pill.js +4 -4
- package/dist/components/q2-popover.js +1 -1
- package/dist/components/q2-radio-group.js +2 -2
- package/dist/components/q2-radio.js +1 -1
- package/dist/components/q2-section.js +3 -3
- package/dist/components/q2-select.js +6 -6
- package/dist/components/q2-stepper-pane.js +1 -1
- package/dist/components/q2-stepper-vertical.js +2 -2
- package/dist/components/q2-stepper.js +3 -3
- package/dist/components/q2-tab-container.js +3 -3
- package/dist/components/q2-tag.js +4 -4
- package/dist/components/q2-textarea.js +2 -2
- package/dist/components/q2-tooltip.js +1 -1
- package/dist/docs.json +280 -3
- package/dist/esm/click-elsewhere_2.entry.js +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +10 -5
- package/dist/esm/q2-badge.entry.js +39 -0
- package/dist/esm/q2-btn_2.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +16 -7
- package/dist/esm/q2-data-table.entry.js +283 -0
- package/dist/esm/{q2-badge_2.entry.js → q2-input.entry.js} +3 -39
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/q2-tecton-elements/p-00b2c345.entry.js +1 -0
- package/dist/q2-tecton-elements/p-0112df78.entry.js +1 -0
- package/dist/q2-tecton-elements/p-08286237.entry.js +1 -0
- package/dist/q2-tecton-elements/p-42d03011.entry.js +1 -0
- package/dist/q2-tecton-elements/p-47aefcc2.entry.js +1 -0
- package/dist/q2-tecton-elements/p-9a327827.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c9abc814.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/types/components/q2-action-sheet/index.d.ts +1 -0
- package/dist/types/components/q2-checkbox/index.d.ts +4 -0
- package/dist/types/components/q2-data-table/index.d.ts +94 -0
- package/dist/types/components.d.ts +47 -0
- package/package.json +3 -3
- package/dist/q2-tecton-elements/p-0b7003c4.entry.js +0 -1
- package/dist/q2-tecton-elements/p-1b9e07b4.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3bf06809.entry.js +0 -1
- package/dist/q2-tecton-elements/p-92e746c8.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d6824ce5.entry.js +0 -1
- /package/dist/types/workspace/workspace/{tecton-production_release_1.28.x → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*:active {
|
|
6
|
+
outline: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
*:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
box-shadow: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::-moz-focus-inner {
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
input,
|
|
23
|
+
textarea,
|
|
24
|
+
button {
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
font-stretch: inherit;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host(.sr),
|
|
31
|
+
:host(.sr) button {
|
|
32
|
+
border: 0;
|
|
33
|
+
clip: rect(0 0 0 0);
|
|
34
|
+
height: 1px;
|
|
35
|
+
margin: -1px;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
padding: 0;
|
|
38
|
+
position: absolute;
|
|
39
|
+
width: 1px;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.sr,
|
|
44
|
+
.sr button {
|
|
45
|
+
border: 0;
|
|
46
|
+
clip: rect(0 0 0 0);
|
|
47
|
+
height: 1px;
|
|
48
|
+
margin: -1px;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
padding: 0;
|
|
51
|
+
position: absolute;
|
|
52
|
+
width: 1px;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.hidden {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([hidden]) {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.invisible {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host {
|
|
69
|
+
display: block;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.container {
|
|
73
|
+
--comp-cell-padding: var(--tct-table-cell-padding, var(--app-scale-3x, 15px));
|
|
74
|
+
--comp-select-column-width: var(--tct-table-select-column-width, var(--tct-checkbox-size, 20px));
|
|
75
|
+
--comp-dropdown-column-width: var(--tct-table-dropdown-column-width, var(--tct-btn-icon-width, 44px));
|
|
76
|
+
--comp-expandable-row-control-column-width: var(--tct-table-expandable-row-control-column-width, var(--tct-btn-icon-width, 44px));
|
|
77
|
+
overflow: auto;
|
|
78
|
+
}
|
|
79
|
+
:host([shadowed]:not([shadowed=false])) .container {
|
|
80
|
+
box-shadow: var(--tct-table-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3)));
|
|
81
|
+
}
|
|
82
|
+
:host([density=compact]) .container {
|
|
83
|
+
--comp-cell-padding: var(--tct-table-cell-padding-compact, var(--app-scale-1x, 5px));
|
|
84
|
+
}
|
|
85
|
+
:host([density=comfortable]) .container {
|
|
86
|
+
--comp-cell-padding: var(--tct-table-cell-padding-comfortable, var(--app-scale-5x, 25px));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
table {
|
|
90
|
+
border-collapse: collapse;
|
|
91
|
+
border-spacing: 0;
|
|
92
|
+
width: var(--tct-table-width);
|
|
93
|
+
min-width: 100%;
|
|
94
|
+
background: var(--tct-table-background, var(--t-base, #ffffff));
|
|
95
|
+
caption-side: var(--tct-table-caption-side, bottom);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
thead {
|
|
99
|
+
border-width: var(--tct-table-header-border-width, 0 0 2px 0);
|
|
100
|
+
border-style: var(--tct-table-header-border-style, solid);
|
|
101
|
+
border-color: var(--tct-table-header-border-color, var(--t-gray-9, #999999));
|
|
102
|
+
background: var(--tct-table-header-background);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
col.select-column {
|
|
106
|
+
width: var(--comp-select-column-width);
|
|
107
|
+
}
|
|
108
|
+
col.expandable-row-control-column {
|
|
109
|
+
width: var(--comp-expandable-row-control-column-width);
|
|
110
|
+
}
|
|
111
|
+
col.dropdown-column {
|
|
112
|
+
width: var(--comp-dropdown-column-width);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
td,
|
|
116
|
+
th {
|
|
117
|
+
padding: var(--comp-cell-padding);
|
|
118
|
+
text-align: start;
|
|
119
|
+
}
|
|
120
|
+
td.align-end,
|
|
121
|
+
th.align-end {
|
|
122
|
+
text-align: end;
|
|
123
|
+
}
|
|
124
|
+
td.align-center,
|
|
125
|
+
th.align-center {
|
|
126
|
+
text-align: center;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
th .header-content {
|
|
130
|
+
font-weight: var(--tct-table-header-font-weight, 400);
|
|
131
|
+
}
|
|
132
|
+
th.sorted .header-content {
|
|
133
|
+
font-weight: var(--tct-table-header-sorted-font-weight, 600);
|
|
134
|
+
}
|
|
135
|
+
th .sorted-indicator {
|
|
136
|
+
--comp-header-sortable-icon-size: var(--tct-table-header-sortable-icon-size, var(--app-scale-3x, 15px));
|
|
137
|
+
--tct-icon-stroke-width: 2;
|
|
138
|
+
width: var(--comp-header-sortable-icon-size);
|
|
139
|
+
height: var(--comp-header-sortable-icon-size);
|
|
140
|
+
}
|
|
141
|
+
th .sorted-indicator.direction-ASC {
|
|
142
|
+
transform: rotate(180deg);
|
|
143
|
+
}
|
|
144
|
+
th q2-btn .header-content {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: var(--tct-table-header-content-gap, var(--app-scale-2x, 10px));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
td.expandable-row-control-column {
|
|
151
|
+
--tct-btn-icon-hover-bg: transparent;
|
|
152
|
+
padding: var(--tct-table-expandable-row-control-column-padding, 0 var(--app-scale-1x, 5px));
|
|
153
|
+
}
|
|
154
|
+
td.dropdown-column {
|
|
155
|
+
padding: var(--tct-table-dropdown-column-padding, 0 var(--app-scale-1x, 5px));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
tbody tr.expandable {
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
}
|
|
161
|
+
tbody tr.expandable:hover {
|
|
162
|
+
background: var(--tct-table-expandable-row-background, var(--t-gray-14, #f2f2f2));
|
|
163
|
+
}
|
|
164
|
+
:host([bordered]:not([bordered=false])) tbody tr {
|
|
165
|
+
border-width: var(--tct-table-row-border-width, 0 0 1px 0);
|
|
166
|
+
border-style: var(--tct-table-row-border-style, solid);
|
|
167
|
+
border-color: var(--tct-table-row-border-color, var(--t-gray-9, #999999));
|
|
168
|
+
}
|
|
169
|
+
tbody.expandable-row.loading-row {
|
|
170
|
+
background: var(--tct-table-loading-row-background, var(--t-base, #ffffff));
|
|
171
|
+
}
|
|
172
|
+
tbody.expandable-row.loading-row td {
|
|
173
|
+
text-align: center;
|
|
174
|
+
}
|
|
175
|
+
tbody.expandable-row.loading-row q2-loading {
|
|
176
|
+
font-size: 4em;
|
|
177
|
+
}
|
|
178
|
+
tbody.expandable-row.open .toggle-expandable-row {
|
|
179
|
+
transform: rotate(180deg);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
caption {
|
|
183
|
+
padding: var(--tct-table-caption-padding, var(--app-scale-2x, 10px));
|
|
184
|
+
font-size: var(--tct-table-caption-font-size, inherit);
|
|
185
|
+
font-weight: var(--tct-table-caption-font-weight, 600);
|
|
186
|
+
text-align: var(--tct-table-caption-text-align, center);
|
|
187
|
+
color: var(--tct-table-caption-color, inherit);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
q2-checkbox {
|
|
191
|
+
padding: 0;
|
|
192
|
+
}
|
|
@@ -107,7 +107,7 @@ label {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.input-container {
|
|
110
|
-
background
|
|
110
|
+
background: var(--tct-input-background, var(--t-input-background, var(--tct-input-bg, var(--t-input-bg, var(--t-gray-14, #fcfcfd)))));
|
|
111
111
|
display: flex;
|
|
112
112
|
align-items: center;
|
|
113
113
|
--comp-input-horizontal-gap: var(--tct-input-horizontal-gap, var(--t-input-horizontal-gap, 8px));
|
|
@@ -76,7 +76,7 @@ export class Q2Popover {
|
|
|
76
76
|
this.show = true;
|
|
77
77
|
}
|
|
78
78
|
async determinePopDirection() {
|
|
79
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
79
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
80
80
|
const { containerElement, contentElement, direction, controlElement, currentDirection } = this;
|
|
81
81
|
if (containerElement)
|
|
82
82
|
containerElement.style.maxHeight = null;
|
|
@@ -94,8 +94,9 @@ export class Q2Popover {
|
|
|
94
94
|
const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) ||
|
|
95
95
|
((_d = window.visualViewport) === null || _d === void 0 ? void 0 : _d.offsetTop) || // Only Android Chrome provides this which we need when scrolled
|
|
96
96
|
0;
|
|
97
|
-
const
|
|
98
|
-
const
|
|
97
|
+
const outletOffset = scrollY + (((_f = (_e = window.Tecton) === null || _e === void 0 ? void 0 : _e.platformDimensions) === null || _f === void 0 ? void 0 : _f.outletOffset) || 0);
|
|
98
|
+
const innerHeight = ((_h = (_g = window.Tecton) === null || _g === void 0 ? void 0 : _g.platformDimensions) === null || _h === void 0 ? void 0 : _h.innerHeight) || ((_j = window.visualViewport) === null || _j === void 0 ? void 0 : _j.height) || window.innerHeight;
|
|
99
|
+
const bottomOffset = scrollY + innerHeight - topOffset - height - outletOffset;
|
|
99
100
|
const canShowFullSizeBelow = bottomOffset > contentHeight;
|
|
100
101
|
const canShowFullSizeAbove = contentHeight <= topOffset;
|
|
101
102
|
let determinedDirection;
|
|
@@ -13,6 +13,7 @@ export { Q2ChartBar as Q2ChartBar } from '../types/components/q2-chart-bar/index
|
|
|
13
13
|
export { Q2ChartDonut as Q2ChartDonut } from '../types/components/q2-chart-donut/index';
|
|
14
14
|
export { Q2Checkbox as Q2Checkbox } from '../types/components/q2-checkbox/index';
|
|
15
15
|
export { Q2CheckboxGroup as Q2CheckboxGroup } from '../types/components/q2-checkbox-group/index';
|
|
16
|
+
export { Q2DataTable as Q2DataTable } from '../types/components/q2-data-table/index';
|
|
16
17
|
export { Q2Dropdown as Q2Dropdown } from '../types/components/q2-dropdown/index';
|
|
17
18
|
export { Q2DropdownItem as Q2DropdownItem } from '../types/components/q2-dropdown-item/index';
|
|
18
19
|
export { Q2EditableField as Q2EditableField } from '../types/components/q2-editable-field/index';
|
package/dist/components/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { Q2ChartBar, defineCustomElement as defineCustomElementQ2ChartBar } from
|
|
|
13
13
|
export { Q2ChartDonut, defineCustomElement as defineCustomElementQ2ChartDonut } from './q2-chart-donut.js';
|
|
14
14
|
export { Q2Checkbox, defineCustomElement as defineCustomElementQ2Checkbox } from './q2-checkbox.js';
|
|
15
15
|
export { Q2CheckboxGroup, defineCustomElement as defineCustomElementQ2CheckboxGroup } from './q2-checkbox-group.js';
|
|
16
|
+
export { Q2DataTable, defineCustomElement as defineCustomElementQ2DataTable } from './q2-data-table.js';
|
|
16
17
|
export { Q2Dropdown, defineCustomElement as defineCustomElementQ2Dropdown } from './q2-dropdown.js';
|
|
17
18
|
export { Q2DropdownItem, defineCustomElement as defineCustomElementQ2DropdownItem } from './q2-dropdown-item.js';
|
|
18
19
|
export { Q2EditableField, defineCustomElement as defineCustomElementQ2EditableField } from './q2-editable-field.js';
|
|
@@ -1,84 +1,101 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { l as loc, h as handleAriaLabel } from './index16.js';
|
|
3
|
+
import { s as shapes } from './shapes.js';
|
|
4
4
|
|
|
5
|
-
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}:host([hidden]){display:none}
|
|
5
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.flex{display:flex}.flex-center{justify-content:center}.flex-left{justify-content:flex-start}.flex-right{justify-content:flex-end}.flex-v-center{align-items:center}.no-margin{margin:0}:host{display:block}:host([inline]),:host([modifiers*=inline]){display:inline-block}:host([hidden]){display:none}:host(:not([inline]):not([modifiers*=inline])){font-size:var(--tct-loading-spinner-size, var(--t-loading-spinner-size, var(--app-scale-12x, 60px)))}.q2-loading-animation{height:1em;width:1em}.half-circle-spinner,.half-circle-spinner *{box-sizing:border-box}.half-circle-spinner{border-radius:100%;position:relative}.half-circle-spinner .circle{position:absolute;width:100%;height:100%;border-radius:100%;border:0.0833333333em solid transparent}.half-circle-spinner .circle.circle-1{border-top-color:var(--tct-loading-primary-color, var(--t-loading-primary-color, var(--t-primary, #0079c1)));animation:half-circle-spinner-animation 1s infinite}.half-circle-spinner .circle.circle-2{border-bottom-color:var(--tct-loading-secondary-color, var(--t-loading-secondary-color, #9ddd4f));animation:half-circle-spinner-animation 1s infinite alternate}@keyframes half-circle-spinner-animation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.q2-loading-skeleton{position:relative;width:100%;height:100%;overflow:hidden;--comp-loading-skeleton-shimmer-color:var(--tct-loading-skeleton-shimmer-color, var(--t-base, rgba(255, 255, 255, 0.5)));--comp-loading-skeleton-vertical-gap:var(--tct-loading-skeleton-vertical-gap, var(--tct-scale-2, 10px));--comp-loading-skeleton-horizontal-gap:var(--tct-loading-skeleton-horizontal-gap, var(--tct-scale-2, 10px))}.q2-loading-skeleton-shimmer{position:absolute;width:1rem;height:100%;top:0;left:-100px;animation:skeletonShimmer 3s ease-in-out infinite;background-color:var(--comp-loading-skeleton-shimmer-color);box-shadow:0 0 25px 20px var(--comp-loading-skeleton-shimmer-color);transform:rotate(10deg)}.skeleton-shape.rectangle:not(.no-margin){margin:var(--tct-loading-skeleton-vertical-gap, var(--tct-scale-2, 10px)) var(--tct-loading-skeleton-horizontal-gap, var(--tct-scale-2, 10px))}.skeleton-shape.circle,.skeleton-shape.rectangle{background-color:var(--tct-loading-skeleton-element-bg, var(--tct-gray-l3, var(--t-gray-14, #f2f2f2)))}.skeleton-shape.rectangle{min-height:var(--tct-loading-skeleton-rectangle-min-height, 20px)}.skeleton-shape.circle{border-radius:50%;padding-top:100%}.flex .rectangle{flex-grow:1}.skeleton-table-row .rectangle{margin:var(--comp-loading-skeleton-vertical-gap) var(--comp-loading-skeleton-horizontal-gap)}.skeleton-table-row .rectangle:not(:first-child):not(:last-child){flex-grow:2}.skeleton-table-row-border .skeleton-shape{margin:0 var(--comp-loading-skeleton-horizontal-gap)}.form{flex-wrap:wrap}.form .field{margin:var(--comp-loading-skeleton-vertical-gap) 0}.form.columns-1 .field{flex-basis:100%}.form.columns-2 .field{flex-basis:50%}.form.columns-3 .field{flex-basis:33.3333%}.form.columns-4 .field{flex-basis:25%}.form.columns-5 .field{flex-basis:20%}.text .rectangle{margin-bottom:0}.text .header.center{margin:0 auto}.text .header.right{margin-left:auto}.text .header{height:1.5rem}.text .header.smaller{height:1rem}.detailed-item{flex-wrap:wrap}.detailed-item.right{flex-flow:row-reverse}.detailed-item-image{flex:0 0 auto;display:inline-flex}.center .detailed-item-image{flex-basis:100%;display:flex}.detailed-item-image .rectangle{flex-grow:0}.detailed-item-text>div{width:100%}.detailed-item-text{flex:1 1 auto}.detailed-item-text .text{margin-top:0;margin-bottom:0}.label-value{flex-wrap:wrap}.label-value .rectangle{flex-basis:calc(50% - 2 * var(--comp-loading-skeleton-horizontal-gap))}@keyframes skeletonShimmer{0%{left:-100px;opacity:1}70%{opacity:1}100%{left:800px;opacity:0}}";
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const Q2Loading = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
10
|
this.__registerHost();
|
|
11
11
|
this.__attachShadow();
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.
|
|
12
|
+
this.halfCircleSpinner = () => {
|
|
13
|
+
return (h("div", { class: "q2-loading-animation half-circle-spinner", "aria-label": this.localizedLabel }, h("div", { class: "circle circle-1" }), h("div", { class: "circle circle-2" })));
|
|
14
|
+
};
|
|
15
|
+
this.spinner = () => {
|
|
16
|
+
return this.halfCircleSpinner();
|
|
17
|
+
};
|
|
18
|
+
this.skeletonLoader = () => {
|
|
19
|
+
return (h("div", { class: "q2-loading-skeleton", "aria-label": this.localizedLabel }, this.shape === 'custom' ? h("slot", null) : this.skeletonShape, h("div", { class: "q2-loading-skeleton-shimmer" })));
|
|
20
|
+
};
|
|
21
|
+
this.type = undefined;
|
|
22
|
+
this.shape = undefined;
|
|
23
|
+
this.modifiers = undefined;
|
|
24
|
+
this.counts = undefined;
|
|
25
|
+
this.label = undefined;
|
|
26
|
+
this.inline = undefined;
|
|
27
|
+
this.ariaLabel = undefined;
|
|
16
28
|
}
|
|
17
|
-
get
|
|
18
|
-
|
|
29
|
+
get loader() {
|
|
30
|
+
const loaderMap = {
|
|
31
|
+
default: this.spinner,
|
|
32
|
+
spinner: this.spinner,
|
|
33
|
+
skeleton: this.skeletonLoader,
|
|
34
|
+
};
|
|
35
|
+
return loaderMap[this.type] || loaderMap.default;
|
|
19
36
|
}
|
|
20
|
-
|
|
21
|
-
|
|
37
|
+
get modifiersSet() {
|
|
38
|
+
if (this.type !== 'skeleton' || !this.modifiers) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return new Set(this.modifiers.split('-'));
|
|
22
42
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
nextPaint(() => {
|
|
29
|
-
this.presentToggle = false;
|
|
30
|
-
});
|
|
43
|
+
get countsArray() {
|
|
44
|
+
if (this.type !== 'skeleton' || !this.counts) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
return this.counts.split('x').map(Number);
|
|
31
48
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
get skeletonShape() {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
return (_b = (_a = shapes[this.shape]) === null || _a === void 0 ? void 0 : _a.call(shapes, this.countsArray, this.modifiersSet)) !== null && _b !== void 0 ? _b : '';
|
|
52
|
+
}
|
|
53
|
+
get spinnerShape() {
|
|
54
|
+
const spinnerMap = {
|
|
55
|
+
default: this.halfCircleSpinner,
|
|
56
|
+
'half-circle': this.halfCircleSpinner,
|
|
57
|
+
};
|
|
58
|
+
return spinnerMap[this.type] || spinnerMap.default;
|
|
59
|
+
}
|
|
60
|
+
get localizedLabel() {
|
|
61
|
+
return loc(this.label || 'tecton.element.loading.ariaLabel');
|
|
62
|
+
}
|
|
63
|
+
componentWillLoad() {
|
|
64
|
+
handleAriaLabel(this);
|
|
65
|
+
}
|
|
66
|
+
ariaLabelObserver() {
|
|
67
|
+
handleAriaLabel(this);
|
|
36
68
|
}
|
|
37
69
|
render() {
|
|
38
|
-
|
|
39
|
-
const addAriaHiddenForAriaLive = isFirefox && this.presentToggle;
|
|
40
|
-
const addDivForAriaLive = !isFirefox && this.presentToggle;
|
|
41
|
-
const { description } = this;
|
|
42
|
-
return (h("div", { tabindex: "-1", class: "message", role: description ? undefined : 'alert', "aria-live": description ? undefined : 'assertive', "aria-atomic": description ? undefined : 'true', "aria-relevant": description ? undefined : 'all', "test-id": "messageContainer" }, this.appearance === 'standard' ? generateIcon(this.type) : '', addDivForAriaLive && h("div", { class: "sr" }), h("div", { class: "message-content", "aria-hidden": addAriaHiddenForAriaLive ? 'true' : undefined }, h("slot", null))));
|
|
70
|
+
return this.loader();
|
|
43
71
|
}
|
|
44
72
|
get hostElement() { return this; }
|
|
73
|
+
static get watchers() { return {
|
|
74
|
+
"ariaLabel": ["ariaLabelObserver"]
|
|
75
|
+
}; }
|
|
45
76
|
static get style() { return stylesCss; }
|
|
46
|
-
}, [1, "q2-
|
|
77
|
+
}, [1, "q2-loading", {
|
|
47
78
|
"type": [513],
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
success: 'success',
|
|
56
|
-
warning: 'warning',
|
|
57
|
-
danger: 'error',
|
|
58
|
-
error: 'error',
|
|
59
|
-
info: 'info',
|
|
60
|
-
};
|
|
61
|
-
const icon = iconMap[type] || iconMap.info;
|
|
62
|
-
return (h("q2-icon", { type: icon, class: "message-icon" }));
|
|
63
|
-
}
|
|
79
|
+
"shape": [513],
|
|
80
|
+
"modifiers": [513],
|
|
81
|
+
"counts": [513],
|
|
82
|
+
"label": [1537],
|
|
83
|
+
"inline": [516],
|
|
84
|
+
"ariaLabel": [1537, "aria-label"]
|
|
85
|
+
}]);
|
|
64
86
|
function defineCustomElement() {
|
|
65
87
|
if (typeof customElements === "undefined") {
|
|
66
88
|
return;
|
|
67
89
|
}
|
|
68
|
-
const components = ["q2-
|
|
90
|
+
const components = ["q2-loading"];
|
|
69
91
|
components.forEach(tagName => { switch (tagName) {
|
|
70
|
-
case "q2-
|
|
71
|
-
if (!customElements.get(tagName)) {
|
|
72
|
-
customElements.define(tagName, Q2Message);
|
|
73
|
-
}
|
|
74
|
-
break;
|
|
75
|
-
case "q2-icon":
|
|
92
|
+
case "q2-loading":
|
|
76
93
|
if (!customElements.get(tagName)) {
|
|
77
|
-
|
|
94
|
+
customElements.define(tagName, Q2Loading);
|
|
78
95
|
}
|
|
79
96
|
break;
|
|
80
97
|
} });
|
|
81
98
|
}
|
|
82
99
|
defineCustomElement();
|
|
83
100
|
|
|
84
|
-
export {
|
|
101
|
+
export { Q2Loading as Q, defineCustomElement as d };
|
|
@@ -1,72 +1,84 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { p as isFirefox, o as overrideFocus, n as nextPaint, a as isEventFromElement } from './index16.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './index8.js';
|
|
3
4
|
|
|
4
|
-
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}.
|
|
5
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}:host([hidden]){display:none}.message{border-left-width:var(--tct-message-bar-width, var(--t-message-bar-width, var(--app-scale-1x, 5px)));border-left-style:solid;--comp-line-height:var(--tct-message-line-height, var(--t-message-line-height, var(--app-line-height, 1.428571429em)));display:grid;gap:var(--tct-scale-1, var(--app-scale-1x, 5px));align-items:flex-start;background:var(--tct-message-bg, var(--t-message-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2))))));color:var(--tct-message-font-color, var(--t-message-font-color, inherit));box-shadow:var(--tct-message-box-shadow, var(--t-message-box-shadow, inherit));border-radius:var(--tct-message-border-radius, var(--t-message-border-radius, inherit))}.message:focus{box-shadow:var(--const-global-focus)}.message-icon{--comp-top-offset:calc(calc(var(--comp-line-height) - var(--comp-icon-size)) / 2);--tct-icon-size:var(--comp-icon-size);top:var(--comp-top-offset);margin-bottom:calc(var(--comp-top-offset) * -1)}.message-content{flex:1;line-height:var(--comp-line-height)}::slotted(ul){padding-left:var(--tct-scale-l3, var(--app-scale-3x, 15px))}:host(:not([appearance])),:host([appearance=standard]){margin:var(--tct-scale-l3, var(--app-scale-3x, 15px)) 0}:host(:not([appearance])) .message,:host([appearance=standard]) .message{--comp-icon-size:var(--tct-message-icon-size, var(--t-message-icon-size, 24px));--comp-padding:var(--tct-message-padding, var(--t-message-padding, var(--app-scale-3x, 15px)));grid-template-columns:var(--comp-icon-size) 1fr;padding:var(--comp-padding);padding-left:calc(var(--comp-padding) - var(--tct-scale-2, var(--app-scale-2x, 10px)));padding-bottom:calc(var(--comp-padding) - var(--tct-scale-1, var(--app-scale-1x, 5px)))}:host(:not([appearance])) ::slotted(ul),:host([appearance=standard]) ::slotted(ul){margin:var(--tct-scale-l3, var(--app-scale-3x, 15px)) 0}:host([appearance=minimal]){margin:0}:host([appearance=minimal]) .message{padding:var(--tct-message-minimal-padding, var(--t-message-minimal-padding, var(--app-scale-2x, 10px)));grid-template-columns:1fr}:host([appearance=minimal]) ::slotted(ul){margin:var(--tct-scale-1, var(--app-scale-1x, 5px)) 0}:host(:not([type])) .message,:host([type=info]) .message{border-left-color:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))}:host(:not([type])) .message-icon,:host([type=info]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1));--tct-icon-stroke-secondary:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))}:host([type=success]) .message{border-left-color:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00))}:host([type=success]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00));--tct-icon-stroke-secondary:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00))}:host([type=warning]) .message{border-left-color:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400))}:host([type=warning]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400));--tct-icon-stroke-secondary:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400))}:host([type=error]) .message,:host([type=danger]) .message{border-left-color:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000))}:host([type=error]) .message-icon,:host([type=danger]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000));--tct-icon-stroke-secondary:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000))}";
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
+
const Q2Message = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
8
|
constructor() {
|
|
8
9
|
super();
|
|
9
10
|
this.__registerHost();
|
|
10
11
|
this.__attachShadow();
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.disabled = false;
|
|
16
|
-
this.label = undefined;
|
|
17
|
-
this.hidden = false;
|
|
12
|
+
this.type = 'info';
|
|
13
|
+
this.appearance = 'standard';
|
|
14
|
+
this.description = false;
|
|
15
|
+
this.presentToggle = undefined;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const observer = new MutationObserver(this.setHidden);
|
|
22
|
-
observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
|
|
23
|
-
this.mutationObserver = observer;
|
|
24
|
-
// set initially
|
|
25
|
-
this.setHidden();
|
|
26
|
-
this.disabledWatcher(this.disabled);
|
|
17
|
+
get isFirefox() {
|
|
18
|
+
return isFirefox();
|
|
27
19
|
}
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
this.mutationObserver = null;
|
|
20
|
+
componentDidLoad() {
|
|
21
|
+
overrideFocus(this.hostElement);
|
|
31
22
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
disabledWatcher(disabled) {
|
|
40
|
-
this.options.forEach(opt => {
|
|
41
|
-
opt.disabledGroup = !!disabled;
|
|
23
|
+
async present() {
|
|
24
|
+
const { isFirefox } = this;
|
|
25
|
+
this.presentToggle = !this.presentToggle;
|
|
26
|
+
if (!isFirefox)
|
|
27
|
+
return;
|
|
28
|
+
nextPaint(() => {
|
|
29
|
+
this.presentToggle = false;
|
|
42
30
|
});
|
|
43
31
|
}
|
|
32
|
+
delegateFocus(event) {
|
|
33
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
34
|
+
return;
|
|
35
|
+
this.hostElement.shadowRoot.querySelector('.message').focus();
|
|
36
|
+
}
|
|
44
37
|
render() {
|
|
45
|
-
|
|
38
|
+
const { isFirefox } = this;
|
|
39
|
+
const addAriaHiddenForAriaLive = isFirefox && this.presentToggle;
|
|
40
|
+
const addDivForAriaLive = !isFirefox && this.presentToggle;
|
|
41
|
+
const { description } = this;
|
|
42
|
+
return (h("div", { tabindex: "-1", class: "message", role: description ? undefined : 'alert', "aria-live": description ? undefined : 'assertive', "aria-atomic": description ? undefined : 'true', "aria-relevant": description ? undefined : 'all', "test-id": "messageContainer" }, this.appearance === 'standard' ? generateIcon(this.type) : '', addDivForAriaLive && h("div", { class: "sr" }), h("div", { class: "message-content", "aria-hidden": addAriaHiddenForAriaLive ? 'true' : undefined }, h("slot", null))));
|
|
46
43
|
}
|
|
47
44
|
get hostElement() { return this; }
|
|
48
|
-
static get watchers() { return {
|
|
49
|
-
"disabled": ["disabledWatcher"]
|
|
50
|
-
}; }
|
|
51
45
|
static get style() { return stylesCss; }
|
|
52
|
-
}, [1, "q2-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
46
|
+
}, [1, "q2-message", {
|
|
47
|
+
"type": [513],
|
|
48
|
+
"appearance": [513],
|
|
49
|
+
"description": [516],
|
|
50
|
+
"presentToggle": [32],
|
|
51
|
+
"present": [64]
|
|
52
|
+
}, [[0, "focus", "delegateFocus"]]]);
|
|
53
|
+
function generateIcon(type) {
|
|
54
|
+
const iconMap = {
|
|
55
|
+
success: 'success',
|
|
56
|
+
warning: 'warning',
|
|
57
|
+
danger: 'error',
|
|
58
|
+
error: 'error',
|
|
59
|
+
info: 'info',
|
|
60
|
+
};
|
|
61
|
+
const icon = iconMap[type] || iconMap.info;
|
|
62
|
+
return (h("q2-icon", { type: icon, class: "message-icon" }));
|
|
63
|
+
}
|
|
57
64
|
function defineCustomElement() {
|
|
58
65
|
if (typeof customElements === "undefined") {
|
|
59
66
|
return;
|
|
60
67
|
}
|
|
61
|
-
const components = ["q2-
|
|
68
|
+
const components = ["q2-message", "q2-icon"];
|
|
62
69
|
components.forEach(tagName => { switch (tagName) {
|
|
63
|
-
case "q2-
|
|
70
|
+
case "q2-message":
|
|
71
|
+
if (!customElements.get(tagName)) {
|
|
72
|
+
customElements.define(tagName, Q2Message);
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case "q2-icon":
|
|
64
76
|
if (!customElements.get(tagName)) {
|
|
65
|
-
|
|
77
|
+
defineCustomElement$1();
|
|
66
78
|
}
|
|
67
79
|
break;
|
|
68
80
|
} });
|
|
69
81
|
}
|
|
70
82
|
defineCustomElement();
|
|
71
83
|
|
|
72
|
-
export {
|
|
84
|
+
export { Q2Message as Q, defineCustomElement as d };
|