xv-webcomponents 0.1.20 → 0.1.23
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/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/index-782b9733.js +1535 -0
- package/dist/cjs/index-782b9733.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/utils-c7652b74.js +13 -0
- package/dist/cjs/utils-c7652b74.js.map +1 -0
- package/dist/cjs/xv-accordion-v2_16.cjs.entry.js +663 -0
- package/dist/cjs/xv-accordion-v2_16.cjs.entry.js.map +1 -0
- package/dist/cjs/xv-breadcrumbs-v2.cjs.entry.js +22 -0
- package/dist/cjs/xv-breadcrumbs-v2.cjs.entry.js.map +1 -0
- package/dist/cjs/xv-webcomponents.cjs.js +27 -0
- package/dist/cjs/xv-webcomponents.cjs.js.map +1 -0
- package/dist/collection/assets/fonts/fontawesome5/fa-brands-400.svg +3717 -0
- package/dist/collection/assets/fonts/fontawesome5/fa-duotone-900.svg +15326 -0
- package/dist/collection/assets/fonts/fontawesome5/fa-light-300.svg +12420 -0
- package/dist/collection/assets/fonts/fontawesome5/fa-regular-400.svg +11323 -0
- package/dist/collection/assets/fonts/fontawesome5/fa-solid-900.svg +9653 -0
- package/dist/collection/collection-manifest.json +28 -0
- package/dist/collection/components/xv-accordion/xv-accordion.css +3 -0
- package/dist/collection/components/xv-accordion/xv-accordion.js +163 -0
- package/dist/collection/components/xv-accordion/xv-accordion.js.map +1 -0
- package/dist/collection/components/xv-accordion-item/xv-accordion-item.css +68 -0
- package/dist/collection/components/xv-accordion-item/xv-accordion-item.js +132 -0
- package/dist/collection/components/xv-accordion-item/xv-accordion-item.js.map +1 -0
- package/dist/collection/components/xv-breadcrumbs/xv-breadcrumbs.css +3 -0
- package/dist/collection/components/xv-breadcrumbs/xv-breadcrumbs.js +19 -0
- package/dist/collection/components/xv-breadcrumbs/xv-breadcrumbs.js.map +1 -0
- package/dist/collection/components/xv-button/xv-button-v2.css +153 -0
- package/dist/collection/components/xv-button/xv-button.js +138 -0
- package/dist/collection/components/xv-button/xv-button.js.map +1 -0
- package/dist/collection/components/xv-card/xv-card.css +63 -0
- package/dist/collection/components/xv-card/xv-card.js +122 -0
- package/dist/collection/components/xv-card/xv-card.js.map +1 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.css +108 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.js +376 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.js.map +1 -0
- package/dist/collection/components/xv-footer/xv-footer.css +230 -0
- package/dist/collection/components/xv-footer/xv-footer.js +37 -0
- package/dist/collection/components/xv-footer/xv-footer.js.map +1 -0
- package/dist/collection/components/xv-header/xv-header.css +22587 -0
- package/dist/collection/components/xv-header/xv-header.js +46 -0
- package/dist/collection/components/xv-header/xv-header.js.map +1 -0
- package/dist/collection/components/xv-link/xv-link.css +60 -0
- package/dist/collection/components/xv-link/xv-link.js +132 -0
- package/dist/collection/components/xv-link/xv-link.js.map +1 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.css +7 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +70 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js.map +1 -0
- package/dist/collection/components/xv-progress-indicator-item/xv-progress-indicator-item.css +66 -0
- package/dist/collection/components/xv-progress-indicator-item/xv-progress-indicator-item.js +47 -0
- package/dist/collection/components/xv-progress-indicator-item/xv-progress-indicator-item.js.map +1 -0
- package/dist/collection/components/xv-table/defs.js +14 -0
- package/dist/collection/components/xv-table/defs.js.map +1 -0
- package/dist/collection/components/xv-table/xv-table-col/xv-table-col.css +8 -0
- package/dist/collection/components/xv-table/xv-table-col/xv-table-col.js +19 -0
- package/dist/collection/components/xv-table/xv-table-col/xv-table-col.js.map +1 -0
- package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.css +21 -0
- package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.js +122 -0
- package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.js.map +1 -0
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.css +53 -0
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +299 -0
- package/dist/{xv-webcomponents/xv-table-v2-row.entry.js.map → collection/components/xv-table/xv-table-row/xv-table-row.js.map} +1 -1
- package/dist/collection/components/xv-table/xv-table.css +154 -0
- package/dist/collection/components/xv-table/xv-table.js +245 -0
- package/dist/collection/components/xv-table/xv-table.js.map +1 -0
- package/dist/collection/components/xv-tag/xv-tag.css +97 -0
- package/dist/collection/components/xv-tag/xv-tag.js +158 -0
- package/dist/collection/components/xv-tag/xv-tag.js.map +1 -0
- package/dist/collection/components/xv-tooltip/xv-tooltip.css +154 -0
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +70 -0
- package/dist/collection/components/xv-tooltip/xv-tooltip.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/scss/xv/images/xv-sprite.svg +1 -0
- package/dist/collection/scss/xv/sprite/images/xv-sprite.svg +1 -0
- package/dist/collection/types/enum.js +9 -0
- package/dist/collection/types/enum.js.map +1 -0
- package/dist/{xv-webcomponents/utils-e6dc0550.js → collection/utils/utils.js} +4 -7
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/esm/index-83ab73b7.js +1506 -0
- package/dist/esm/index-83ab73b7.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/utils-9bb6333b.js +10 -0
- package/dist/esm/utils-9bb6333b.js.map +1 -0
- package/dist/esm/xv-accordion-v2_16.entry.js +644 -0
- package/dist/esm/xv-accordion-v2_16.entry.js.map +1 -0
- package/dist/{xv-webcomponents → esm}/xv-breadcrumbs-v2.entry.js +3 -2
- package/dist/esm/xv-breadcrumbs-v2.entry.js.map +1 -0
- package/dist/esm/xv-webcomponents.js +22 -0
- package/dist/esm/xv-webcomponents.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/xv-footer/xv-footer.d.ts +6 -0
- package/dist/types/components/xv-header/xv-header.d.ts +6 -0
- package/dist/types/components.d.ts +26 -0
- package/dist/xv-webcomponents/index.esm.js +1 -12
- package/dist/xv-webcomponents/index.esm.js.map +1 -1
- package/dist/xv-webcomponents/p-59dc31ad.entry.js +2 -0
- package/dist/xv-webcomponents/p-59dc31ad.entry.js.map +1 -0
- package/dist/xv-webcomponents/p-840929c5.js +3 -0
- package/dist/xv-webcomponents/p-840929c5.js.map +1 -0
- package/dist/xv-webcomponents/p-a0b74d3c.js +2 -0
- package/dist/xv-webcomponents/p-a0b74d3c.js.map +1 -0
- package/dist/xv-webcomponents/p-c1cf7200.entry.js +2 -0
- package/dist/xv-webcomponents/p-c1cf7200.entry.js.map +1 -0
- package/dist/xv-webcomponents/p-e1255160.js +2 -0
- package/dist/xv-webcomponents/p-e1255160.js.map +1 -0
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -48
- package/dist/xv-webcomponents/xv-webcomponents.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/xv-webcomponents/index-90b82796.js +0 -3971
- package/dist/xv-webcomponents/index-90b82796.js.map +0 -1
- package/dist/xv-webcomponents/utils-e6dc0550.js.map +0 -1
- package/dist/xv-webcomponents/xv-accordion-v2-item.entry.js +0 -35
- package/dist/xv-webcomponents/xv-accordion-v2-item.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-accordion-v2.entry.js +0 -40
- package/dist/xv-webcomponents/xv-accordion-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-breadcrumbs-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-button-v2.entry.js +0 -33
- package/dist/xv-webcomponents/xv-button-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-card-v2.entry.js +0 -18
- package/dist/xv-webcomponents/xv-card-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-checkbox-v2.entry.js +0 -99
- package/dist/xv-webcomponents/xv-checkbox-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-link-v2.entry.js +0 -26
- package/dist/xv-webcomponents/xv-link-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-progress-indicator-v2-item.entry.js +0 -19
- package/dist/xv-webcomponents/xv-progress-indicator-v2-item.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-progress-indicator-v2.entry.js +0 -39
- package/dist/xv-webcomponents/xv-progress-indicator-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-table-v2-col.entry.js +0 -17
- package/dist/xv-webcomponents/xv-table-v2-col.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-table-v2-header-row.entry.js +0 -34
- package/dist/xv-webcomponents/xv-table-v2-header-row.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-table-v2-row.entry.js +0 -112
- package/dist/xv-webcomponents/xv-table-v2.entry.js +0 -114
- package/dist/xv-webcomponents/xv-table-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-tag-v2.entry.js +0 -28
- package/dist/xv-webcomponents/xv-tag-v2.entry.js.map +0 -1
- package/dist/xv-webcomponents/xv-tooltip-v2.entry.js +0 -23
- package/dist/xv-webcomponents/xv-tooltip-v2.entry.js.map +0 -1
- /package/dist/{xv-webcomponents → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{xv-webcomponents → esm}/app-globals-0f993ce5.js.map +0 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { TABLE_COLOR_SCHEMA, TABLE_SIZE } from "./defs";
|
|
3
|
+
export class XvTable {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Set current color schema type of enum TABLE_COLOR_SCHEMA
|
|
7
|
+
* Possible options 'zebra'
|
|
8
|
+
*/
|
|
9
|
+
this.colorSchema = TABLE_COLOR_SCHEMA.DEF;
|
|
10
|
+
/**
|
|
11
|
+
* If table is expandable fields
|
|
12
|
+
*/
|
|
13
|
+
this.expandable = false;
|
|
14
|
+
/**
|
|
15
|
+
* Table size
|
|
16
|
+
* enum TABLE_SIZE
|
|
17
|
+
*/
|
|
18
|
+
this.size = TABLE_SIZE.MEDIUM;
|
|
19
|
+
/**
|
|
20
|
+
* Add checkbox selection to the table
|
|
21
|
+
*/
|
|
22
|
+
this.selectable = false;
|
|
23
|
+
this.selectedRows = new Map();
|
|
24
|
+
this.handleCheckedChange = (e) => {
|
|
25
|
+
const { name, value, checked } = e.detail;
|
|
26
|
+
if (checked) {
|
|
27
|
+
this.selectedRows.set(name, { name, value });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.selectedRows.delete(name);
|
|
31
|
+
}
|
|
32
|
+
this.changeSelection.emit(Array.from(this.selectedRows.values()));
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
setRowPropsHandler() {
|
|
36
|
+
const rows = Array
|
|
37
|
+
.from(this.el.childNodes)
|
|
38
|
+
.filter((node) => node.nodeType === Node.ELEMENT_NODE &&
|
|
39
|
+
((node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-ROW` || (node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-HEADER-ROW`));
|
|
40
|
+
let visualIndex = 0;
|
|
41
|
+
rows.forEach((node, i) => {
|
|
42
|
+
var _a;
|
|
43
|
+
const row = node;
|
|
44
|
+
const isHeaderRow = (node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-HEADER-ROW`;
|
|
45
|
+
if (this.selectable) {
|
|
46
|
+
let name = row.getAttribute('selection-name');
|
|
47
|
+
if (!name) {
|
|
48
|
+
name = isHeaderRow ? 'header' : `xv-table-row-${i}`;
|
|
49
|
+
row.setAttribute('selection-name', name);
|
|
50
|
+
}
|
|
51
|
+
if (row.hasAttribute('checked')) {
|
|
52
|
+
this.selectedRows.set(name, {
|
|
53
|
+
name,
|
|
54
|
+
value: (_a = row.getAttribute('value')) !== null && _a !== void 0 ? _a : undefined,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (isHeaderRow)
|
|
59
|
+
return;
|
|
60
|
+
switch (this.colorSchema) {
|
|
61
|
+
case TABLE_COLOR_SCHEMA.ZEBRA:
|
|
62
|
+
const stripe = visualIndex % 2 === 0 ? 'even' : 'odd';
|
|
63
|
+
if (row.hasAttribute('expandable') && rows[i + 1]) {
|
|
64
|
+
row.setAttribute(stripe, '');
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
visualIndex++;
|
|
68
|
+
row.setAttribute(stripe, '');
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
row.removeAttribute('odd');
|
|
73
|
+
row.removeAttribute('even');
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
return (h(Host, { key: '514ec9bc5e8baa2ba10d6362ad99adbeb80da6ae', size: this.size, selectable: this.selectable }, (this.el.title || this.description) && (h("div", { key: '085ee0a2f2154d8f59d5a904982ce3b535f56fb9', class: "caption" }, this.el.title && h("h5", { key: '7950e00138afefca12f9ccae625556ce785af0d8', class: "caption_title" }, this.el.title), this.description && h("p", { key: 'c8b88da8bd0fcc90782d2a785b61cdfab03cd6f9', class: "caption_description" }, this.description))), h("slot", { key: '6f54c35517ca01861836b6606e0b25177c6ba5b7' })));
|
|
79
|
+
}
|
|
80
|
+
componentWillLoad() {
|
|
81
|
+
this.setRowPropsHandler();
|
|
82
|
+
this.el.addEventListener('checkedChange', this.handleCheckedChange);
|
|
83
|
+
}
|
|
84
|
+
disconnectedCallback() {
|
|
85
|
+
this.el.removeEventListener('checkedChange', this.handleCheckedChange);
|
|
86
|
+
}
|
|
87
|
+
static get is() { return "xv-table-v2"; }
|
|
88
|
+
static get encapsulation() { return "shadow"; }
|
|
89
|
+
static get originalStyleUrls() {
|
|
90
|
+
return {
|
|
91
|
+
"$": ["xv-table.scss"]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
static get styleUrls() {
|
|
95
|
+
return {
|
|
96
|
+
"$": ["xv-table.css"]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get properties() {
|
|
100
|
+
return {
|
|
101
|
+
"description": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "string",
|
|
106
|
+
"resolved": "string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": "Table caption description"
|
|
114
|
+
},
|
|
115
|
+
"getter": false,
|
|
116
|
+
"setter": false,
|
|
117
|
+
"attribute": "description",
|
|
118
|
+
"reflect": false
|
|
119
|
+
},
|
|
120
|
+
"colorSchema": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "TABLE_COLOR_SCHEMA",
|
|
125
|
+
"resolved": "TABLE_COLOR_SCHEMA.DEF | TABLE_COLOR_SCHEMA.ZEBRA",
|
|
126
|
+
"references": {
|
|
127
|
+
"TABLE_COLOR_SCHEMA": {
|
|
128
|
+
"location": "import",
|
|
129
|
+
"path": "./defs",
|
|
130
|
+
"id": "src/components/xv-table/defs.ts::TABLE_COLOR_SCHEMA"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "Set current color schema type of enum TABLE_COLOR_SCHEMA\r\nPossible options 'zebra'"
|
|
139
|
+
},
|
|
140
|
+
"getter": false,
|
|
141
|
+
"setter": false,
|
|
142
|
+
"attribute": "color-schema",
|
|
143
|
+
"reflect": false,
|
|
144
|
+
"defaultValue": "TABLE_COLOR_SCHEMA.DEF"
|
|
145
|
+
},
|
|
146
|
+
"expandable": {
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"mutable": false,
|
|
149
|
+
"complexType": {
|
|
150
|
+
"original": "boolean",
|
|
151
|
+
"resolved": "boolean",
|
|
152
|
+
"references": {}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "If table is expandable fields"
|
|
159
|
+
},
|
|
160
|
+
"getter": false,
|
|
161
|
+
"setter": false,
|
|
162
|
+
"attribute": "expandable",
|
|
163
|
+
"reflect": false,
|
|
164
|
+
"defaultValue": "false"
|
|
165
|
+
},
|
|
166
|
+
"size": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "TABLE_SIZE",
|
|
171
|
+
"resolved": "TABLE_SIZE.EXTRA_LARGE | TABLE_SIZE.EXTRA_SMALL | TABLE_SIZE.LARGE | TABLE_SIZE.MEDIUM | TABLE_SIZE.SMALL",
|
|
172
|
+
"references": {
|
|
173
|
+
"TABLE_SIZE": {
|
|
174
|
+
"location": "import",
|
|
175
|
+
"path": "./defs",
|
|
176
|
+
"id": "src/components/xv-table/defs.ts::TABLE_SIZE"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": false,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": "Table size\r\nenum TABLE_SIZE"
|
|
185
|
+
},
|
|
186
|
+
"getter": false,
|
|
187
|
+
"setter": false,
|
|
188
|
+
"attribute": "size",
|
|
189
|
+
"reflect": false,
|
|
190
|
+
"defaultValue": "TABLE_SIZE.MEDIUM"
|
|
191
|
+
},
|
|
192
|
+
"selectable": {
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"mutable": false,
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "boolean",
|
|
197
|
+
"resolved": "boolean",
|
|
198
|
+
"references": {}
|
|
199
|
+
},
|
|
200
|
+
"required": false,
|
|
201
|
+
"optional": false,
|
|
202
|
+
"docs": {
|
|
203
|
+
"tags": [],
|
|
204
|
+
"text": "Add checkbox selection to the table"
|
|
205
|
+
},
|
|
206
|
+
"getter": false,
|
|
207
|
+
"setter": false,
|
|
208
|
+
"attribute": "selectable",
|
|
209
|
+
"reflect": false,
|
|
210
|
+
"defaultValue": "false"
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
static get states() {
|
|
215
|
+
return {
|
|
216
|
+
"selectedRows": {}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
static get events() {
|
|
220
|
+
return [{
|
|
221
|
+
"method": "changeSelection",
|
|
222
|
+
"name": "changeSelection",
|
|
223
|
+
"bubbles": true,
|
|
224
|
+
"cancelable": true,
|
|
225
|
+
"composed": true,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [],
|
|
228
|
+
"text": ""
|
|
229
|
+
},
|
|
230
|
+
"complexType": {
|
|
231
|
+
"original": "{ name: string, value?: any }[]",
|
|
232
|
+
"resolved": "{ name: string; value?: any; }[]",
|
|
233
|
+
"references": {}
|
|
234
|
+
}
|
|
235
|
+
}];
|
|
236
|
+
}
|
|
237
|
+
static get elementRef() { return "el"; }
|
|
238
|
+
static get watchers() {
|
|
239
|
+
return [{
|
|
240
|
+
"propName": "colorSchema",
|
|
241
|
+
"methodName": "setRowPropsHandler"
|
|
242
|
+
}];
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=xv-table.js.map
|
|
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,CAAC,mBAAmB,CAAC,eAAe,EAAE,IAAI,CAAC,mBAA0B,CAAC,CAAC;IAChF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Element, Prop, Watch, Event, EventEmitter, State } from '@stencil/core';\r\nimport { TABLE_COLOR_SCHEMA, TABLE_SIZE, TableSelectionEvent } from './defs';\r\n\r\n@Component({\r\n tag: 'xv-table-v2',\r\n styleUrl: 'xv-table.scss',\r\n shadow: true,\r\n})\r\nexport class XvTable {\r\n @Element() el: HTMLElement;\r\n /**\r\n * Table caption description\r\n */\r\n @Prop() description: string;\r\n /**\r\n * Set current color schema type of enum TABLE_COLOR_SCHEMA\r\n * Possible options 'zebra'\r\n */\r\n @Prop({ attribute: 'color-schema' }) colorSchema: TABLE_COLOR_SCHEMA = TABLE_COLOR_SCHEMA.DEF;\r\n /**\r\n * If table is expandable fields\r\n */\r\n @Prop() expandable: boolean = false;\r\n /**\r\n * Table size\r\n * enum TABLE_SIZE\r\n */\r\n @Prop() size: TABLE_SIZE = TABLE_SIZE.MEDIUM;\r\n /**\r\n * Add checkbox selection to the table\r\n */\r\n @Prop() selectable: boolean = false;\r\n\r\n @State() selectedRows = new Map<string, { name: string, value?: string }>();\r\n\r\n @Event() changeSelection: EventEmitter<{ name: string, value?: any }[]>;\r\n\r\n @Watch('colorSchema')\r\n setRowPropsHandler() {\r\n const rows = Array\r\n .from(this.el.childNodes)\r\n .filter((node) =>\r\n node.nodeType === Node.ELEMENT_NODE &&\r\n ((node as any)?.tagName === `${this.el.tagName}-ROW` || (node as any)?.tagName === `${this.el.tagName}-HEADER-ROW`)\r\n );\r\n let visualIndex = 0;\r\n\r\n rows.forEach((node, i) => {\r\n const row = (node as HTMLElement);\r\n const isHeaderRow = (node as any)?.tagName === `${this.el.tagName}-HEADER-ROW`;\r\n\r\n if (this.selectable) {\r\n let name = row.getAttribute('selection-name');\r\n\r\n if (!name) {\r\n name = isHeaderRow ? 'header' : `xv-table-row-${i}`;\r\n row.setAttribute('selection-name', name);\r\n }\r\n\r\n if (row.hasAttribute('checked')) {\r\n this.selectedRows.set(name, {\r\n name,\r\n value: row.getAttribute('value') ?? undefined,\r\n })\r\n }\r\n }\r\n\r\n if (isHeaderRow) return;\r\n\r\n switch (this.colorSchema) {\r\n case TABLE_COLOR_SCHEMA.ZEBRA:\r\n const stripe = visualIndex % 2 === 0 ? 'even' : 'odd';\r\n if (row.hasAttribute('expandable') && rows[i + 1]) {\r\n row.setAttribute(stripe, '');\r\n } else {\r\n visualIndex++;\r\n row.setAttribute(stripe, '');\r\n }\r\n break;\r\n default:\r\n row.removeAttribute('odd');\r\n row.removeAttribute('even');\r\n }\r\n });\r\n }\r\n\r\n private handleCheckedChange = (e: TableSelectionEvent) => {\r\n const { name, value, checked } = e.detail;\r\n\r\n if (checked) {\r\n this.selectedRows.set(name, { name, value });\r\n } else {\r\n this.selectedRows.delete(name);\r\n }\r\n\r\n this.changeSelection.emit(Array.from(this.selectedRows.values()));\r\n }\r\n\r\n render() {\r\n return (\r\n <Host size={this.size} selectable={this.selectable}>\r\n {(this.el.title || this.description) && (\r\n <div class=\"caption\">\r\n {this.el.title && <h5 class=\"caption_title\">{this.el.title}</h5>}\r\n {this.description && <p class=\"caption_description\">{this.description}</p>}\r\n </div>\r\n )}\r\n <slot></slot>\r\n </Host>\r\n );\r\n }\r\n\r\n componentWillLoad() {\r\n this.setRowPropsHandler();\r\n this.el.addEventListener('checkedChange', this.handleCheckedChange as any);\r\n }\r\n\r\n disconnectedCallback() {\r\n this.el.removeEventListener('checkedChange', this.handleCheckedChange as any);\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
border-radius: 1000px;
|
|
7
|
+
background-color: var(--background);
|
|
8
|
+
color: var(--text-primary);
|
|
9
|
+
font-family: var(--ff-body, inherit);
|
|
10
|
+
}
|
|
11
|
+
:host .xv-tag_content {
|
|
12
|
+
padding-left: 8px;
|
|
13
|
+
padding-right: 8px;
|
|
14
|
+
color: inherit;
|
|
15
|
+
font-family: var(--ff-body);
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
line-height: 16px;
|
|
19
|
+
letter-spacing: 0.32px;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
}
|
|
24
|
+
:host .xv-tag_close {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
border: none;
|
|
28
|
+
background-color: inherit;
|
|
29
|
+
outline: none;
|
|
30
|
+
border-spacing: 0;
|
|
31
|
+
list-style: none outside none;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
border-radius: 62px;
|
|
38
|
+
width: 15px;
|
|
39
|
+
height: 15px;
|
|
40
|
+
text-align: left;
|
|
41
|
+
color: inherit;
|
|
42
|
+
text-indent: 0;
|
|
43
|
+
transition: opacity 300ms ease-in-out, filter 300ms ease-in-out;
|
|
44
|
+
}
|
|
45
|
+
:host .xv-tag_close:hover {
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
filter: brightness(80%);
|
|
48
|
+
}
|
|
49
|
+
:host .xv-tag_close:active {
|
|
50
|
+
opacity: 0.7;
|
|
51
|
+
}
|
|
52
|
+
:host .xv-tag_close:focus {
|
|
53
|
+
outline: 1px solid currentColor;
|
|
54
|
+
}
|
|
55
|
+
:host .xv-tag_close:after {
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
width: inherit;
|
|
58
|
+
height: inherit;
|
|
59
|
+
color: inherit;
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
content: "×";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host(.sm) {
|
|
68
|
+
font-size: var(--fz-sm);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host(.md) {
|
|
72
|
+
font-size: var(--fz-md);
|
|
73
|
+
}
|
|
74
|
+
:host(.md) .xv-tag_content {
|
|
75
|
+
line-height: 24px;
|
|
76
|
+
}
|
|
77
|
+
:host(.md) .xv-tag_close {
|
|
78
|
+
height: 24px;
|
|
79
|
+
width: 24px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host(.lg) {
|
|
83
|
+
font-size: var(--fz-lg);
|
|
84
|
+
}
|
|
85
|
+
:host(.lg) .xv-tag_content {
|
|
86
|
+
line-height: 26px;
|
|
87
|
+
}
|
|
88
|
+
:host(.lg) .xv-tag_close {
|
|
89
|
+
height: 26px;
|
|
90
|
+
width: 26px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host(.disabled) {
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
background-color: var(--layer-01);
|
|
96
|
+
color: var(--text-disabled);
|
|
97
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class XvTag {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.size = 'md';
|
|
5
|
+
this.color = '';
|
|
6
|
+
this.bg = '';
|
|
7
|
+
this.disabled = false;
|
|
8
|
+
this.closeable = false;
|
|
9
|
+
}
|
|
10
|
+
closeHandler(e) {
|
|
11
|
+
if (this.disabled)
|
|
12
|
+
return;
|
|
13
|
+
this.closeClick.emit(e);
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return (h(Host, { key: 'c0ea1021e75dc02e77853d6dc8d6bd9f00258251', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, h("div", { key: '5d1d2a536312719ca7f093a711e2536ac1db085a', class: "xv-tag_content" }, h("slot", { key: '51c232b76ecd2216387eefc1321cfc22ad32cabb' })), this.closeable && (h("button", { key: '5e815c7c566e1a05d2b2c585a6cc8ec9b67e1565', onClick: this.closeHandler.bind(this), class: "xv-tag_close" }))));
|
|
17
|
+
}
|
|
18
|
+
static get is() { return "xv-tag-v2"; }
|
|
19
|
+
static get encapsulation() { return "shadow"; }
|
|
20
|
+
static get originalStyleUrls() {
|
|
21
|
+
return {
|
|
22
|
+
"$": ["xv-tag.scss"]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
static get styleUrls() {
|
|
26
|
+
return {
|
|
27
|
+
"$": ["xv-tag.css"]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static get properties() {
|
|
31
|
+
return {
|
|
32
|
+
"size": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"mutable": false,
|
|
35
|
+
"complexType": {
|
|
36
|
+
"original": "'sm' | 'md' | 'lg'",
|
|
37
|
+
"resolved": "\"lg\" | \"md\" | \"sm\"",
|
|
38
|
+
"references": {}
|
|
39
|
+
},
|
|
40
|
+
"required": false,
|
|
41
|
+
"optional": false,
|
|
42
|
+
"docs": {
|
|
43
|
+
"tags": [],
|
|
44
|
+
"text": ""
|
|
45
|
+
},
|
|
46
|
+
"getter": false,
|
|
47
|
+
"setter": false,
|
|
48
|
+
"attribute": "size",
|
|
49
|
+
"reflect": false,
|
|
50
|
+
"defaultValue": "'md'"
|
|
51
|
+
},
|
|
52
|
+
"color": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"mutable": false,
|
|
55
|
+
"complexType": {
|
|
56
|
+
"original": "string",
|
|
57
|
+
"resolved": "string",
|
|
58
|
+
"references": {}
|
|
59
|
+
},
|
|
60
|
+
"required": false,
|
|
61
|
+
"optional": false,
|
|
62
|
+
"docs": {
|
|
63
|
+
"tags": [],
|
|
64
|
+
"text": ""
|
|
65
|
+
},
|
|
66
|
+
"getter": false,
|
|
67
|
+
"setter": false,
|
|
68
|
+
"attribute": "color",
|
|
69
|
+
"reflect": false,
|
|
70
|
+
"defaultValue": "''"
|
|
71
|
+
},
|
|
72
|
+
"bg": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"mutable": false,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "string",
|
|
77
|
+
"resolved": "string",
|
|
78
|
+
"references": {}
|
|
79
|
+
},
|
|
80
|
+
"required": false,
|
|
81
|
+
"optional": false,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": ""
|
|
85
|
+
},
|
|
86
|
+
"getter": false,
|
|
87
|
+
"setter": false,
|
|
88
|
+
"attribute": "bg",
|
|
89
|
+
"reflect": false,
|
|
90
|
+
"defaultValue": "''"
|
|
91
|
+
},
|
|
92
|
+
"disabled": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "boolean",
|
|
97
|
+
"resolved": "boolean",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": ""
|
|
105
|
+
},
|
|
106
|
+
"getter": false,
|
|
107
|
+
"setter": false,
|
|
108
|
+
"attribute": "disabled",
|
|
109
|
+
"reflect": false,
|
|
110
|
+
"defaultValue": "false"
|
|
111
|
+
},
|
|
112
|
+
"closeable": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "boolean",
|
|
117
|
+
"resolved": "boolean",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": ""
|
|
125
|
+
},
|
|
126
|
+
"getter": false,
|
|
127
|
+
"setter": false,
|
|
128
|
+
"attribute": "closeable",
|
|
129
|
+
"reflect": false,
|
|
130
|
+
"defaultValue": "false"
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
static get events() {
|
|
135
|
+
return [{
|
|
136
|
+
"method": "closeClick",
|
|
137
|
+
"name": "closeClick",
|
|
138
|
+
"bubbles": true,
|
|
139
|
+
"cancelable": true,
|
|
140
|
+
"composed": true,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": ""
|
|
144
|
+
},
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "PointerEvent",
|
|
147
|
+
"resolved": "PointerEvent",
|
|
148
|
+
"references": {
|
|
149
|
+
"PointerEvent": {
|
|
150
|
+
"location": "global",
|
|
151
|
+
"id": "global::PointerEvent"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=xv-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xv-tag.js","sourceRoot":"","sources":["../../../src/components/xv-tag/xv-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAO9E,MAAM,OAAO,KAAK;IALlB;QAMU,SAAI,GAAuB,IAAI,CAAC;QAChC,UAAK,GAAW,EAAE,CAAC;QACnB,OAAE,GAAW,EAAE,CAAC;QAChB,aAAQ,GAAY,KAAK,CAAC;QAC1B,cAAS,GAAY,KAAK,CAAC;KAwBpC;IArBC,YAAY,CAAC,CAAe;QAC1B,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAE1B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,EACjD,KAAK,EAAE,UAAU,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE;YAE/D,4DAAK,KAAK,EAAC,gBAAgB;gBACzB,8DAAa,CACT;YACL,IAAI,CAAC,SAAS,IAAI,CACjB,+DAAQ,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAC,cAAc,GAAU,CAC9E,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Event, EventEmitter } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'xv-tag-v2',\r\n styleUrl: 'xv-tag.scss',\r\n shadow: true,\r\n})\r\nexport class XvTag {\r\n @Prop() size: 'sm' | 'md' | 'lg' = 'md';\r\n @Prop() color: string = '';\r\n @Prop() bg: string = '';\r\n @Prop() disabled: boolean = false;\r\n @Prop() closeable: boolean = false;\r\n @Event() closeClick: EventEmitter<PointerEvent>;\r\n\r\n closeHandler(e: PointerEvent) {\r\n if (this.disabled) return;\r\n\r\n this.closeClick.emit(e);\r\n }\r\n\r\n render() {\r\n return (\r\n <Host\r\n style={{ color: this.color, background: this.bg }}\r\n class={`xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}`}\r\n >\r\n <div class=\"xv-tag_content\">\r\n <slot></slot>\r\n </div>\r\n {this.closeable && (\r\n <button onClick={this.closeHandler.bind(this)} class=\"xv-tag_close\"></button>\r\n )}\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
line-height: 0.5;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* General styles for tooltip */
|
|
9
|
+
:host::before,
|
|
10
|
+
:host::after {
|
|
11
|
+
position: absolute;
|
|
12
|
+
opacity: 0;
|
|
13
|
+
visibility: hidden;
|
|
14
|
+
transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
|
|
15
|
+
z-index: 10;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Tooltip */
|
|
19
|
+
:host::before {
|
|
20
|
+
content: attr(tooltip);
|
|
21
|
+
background: var(--background-inverse, #333);
|
|
22
|
+
color: var(--icon-inverse, #fff);
|
|
23
|
+
padding: var(--gap-sm, 5px) var(--gap-md, 16px);
|
|
24
|
+
border-radius: 2px;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
text-overflow: ellipsis;
|
|
28
|
+
max-width: 70vw;
|
|
29
|
+
font-family: var(--fz-body, Tahoma);
|
|
30
|
+
font-size: var(fz-md, 14px);
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
line-height: 18px;
|
|
33
|
+
letter-spacing: 0.16px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Arrow */
|
|
37
|
+
:host::after {
|
|
38
|
+
content: "";
|
|
39
|
+
border: 6px solid transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Show Tooltip and arrow */
|
|
43
|
+
:host(:hover)::before,
|
|
44
|
+
:host(:hover)::after,
|
|
45
|
+
:host(:focus)::before,
|
|
46
|
+
:host(:focus)::after {
|
|
47
|
+
opacity: 1;
|
|
48
|
+
visibility: visible;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Tooltip positions */
|
|
52
|
+
:host(.xv-tooltip_top)::before {
|
|
53
|
+
bottom: 100%;
|
|
54
|
+
left: 50%;
|
|
55
|
+
transform: translateX(-50%) translateY(-5px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host(.xv-tooltip_top)::after {
|
|
59
|
+
bottom: 100%;
|
|
60
|
+
left: 50%;
|
|
61
|
+
border-top-color: var(--background-inverse, #333);
|
|
62
|
+
transform: translateX(-50%) translateY(5px);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host(.xv-tooltip_top-left)::before {
|
|
66
|
+
bottom: 100%;
|
|
67
|
+
left: 0;
|
|
68
|
+
transform: translateY(-5px);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host(.xv-tooltip_top-left)::after {
|
|
72
|
+
bottom: 100%;
|
|
73
|
+
left: 10px;
|
|
74
|
+
border-top-color: black;
|
|
75
|
+
transform: translateY(5px);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host(.xv-tooltip_top-right)::before {
|
|
79
|
+
bottom: 100%;
|
|
80
|
+
right: 0;
|
|
81
|
+
transform: translateY(-5px);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host(.xv-tooltip_top-right)::after {
|
|
85
|
+
bottom: 100%;
|
|
86
|
+
right: 10px;
|
|
87
|
+
border-top-color: var(--background-inverse, #333);
|
|
88
|
+
transform: translateY(5px);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host(.xv-tooltip_bottom)::before {
|
|
92
|
+
top: 100%;
|
|
93
|
+
left: 50%;
|
|
94
|
+
transform: translateX(-50%) translateY(5px);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host(.xv-tooltip_bottom)::after {
|
|
98
|
+
top: 100%;
|
|
99
|
+
left: 50%;
|
|
100
|
+
border-bottom-color: black;
|
|
101
|
+
transform: translateX(-50%) translateY(-5px);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host(.xv-tooltip_bottom-left)::before {
|
|
105
|
+
top: 100%;
|
|
106
|
+
left: 0;
|
|
107
|
+
transform: translateY(5px);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host(.xv-tooltip_bottom-left)::after {
|
|
111
|
+
top: 100%;
|
|
112
|
+
left: 10px;
|
|
113
|
+
border-bottom-color: var(--background-inverse, #333);
|
|
114
|
+
transform: translateY(-5px);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host(.xv-tooltip_bottom-right)::before {
|
|
118
|
+
top: 100%;
|
|
119
|
+
right: 0;
|
|
120
|
+
transform: translateY(5px);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:host(.xv-tooltip_bottom-right)::after {
|
|
124
|
+
top: 100%;
|
|
125
|
+
right: 10px;
|
|
126
|
+
border-bottom-color: var(--background-inverse, #333);
|
|
127
|
+
transform: translateY(-5px);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host(.xv-tooltip_left)::before {
|
|
131
|
+
right: 100%;
|
|
132
|
+
top: 50%;
|
|
133
|
+
transform: translateY(-50%) translateX(-5px);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host(.xv-tooltip_left)::after {
|
|
137
|
+
right: 100%;
|
|
138
|
+
top: 50%;
|
|
139
|
+
border-left-color: var(--background-inverse, #333);
|
|
140
|
+
transform: translateY(-50%) translateX(5px);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host(.xv-tooltip_right)::before {
|
|
144
|
+
left: 100%;
|
|
145
|
+
top: 50%;
|
|
146
|
+
transform: translateY(-50%) translateX(5px);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:host(.xv-tooltip_right)::after {
|
|
150
|
+
left: 100%;
|
|
151
|
+
top: 50%;
|
|
152
|
+
border-right-color: var(--background-inverse, #333);
|
|
153
|
+
transform: translateY(-50%) translateX(-5px);
|
|
154
|
+
}
|