xv-webcomponents 0.1.17 → 0.1.18
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/{index-4d938647.js → index-782b9733.js} +55 -3
- package/dist/cjs/index-782b9733.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/utils-c7652b74.js.map +1 -1
- package/dist/cjs/xv-accordion-v2_14.cjs.entry.js +602 -0
- package/dist/cjs/xv-accordion-v2_14.cjs.entry.js.map +1 -0
- package/dist/cjs/xv-breadcrumbs-v2.cjs.entry.js +1 -1
- package/dist/cjs/xv-webcomponents.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.css +108 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.js +364 -10
- package/dist/collection/components/xv-checkbox/xv-checkbox.js.map +1 -1
- package/dist/collection/components/xv-link/xv-link.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +1 -1
- package/dist/collection/components/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
- 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/collection/components/xv-table/xv-table-row/xv-table-row.js.map +1 -0
- 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.js +1 -1
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +1 -1
- package/dist/collection/types/enum.js +9 -0
- package/dist/collection/types/enum.js.map +1 -0
- package/dist/collection/utils/utils.js +7 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/esm/{index-60f5a964.js → index-83ab73b7.js} +55 -3
- package/dist/esm/index-83ab73b7.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/utils-9bb6333b.js.map +1 -1
- package/dist/esm/xv-accordion-v2_14.entry.js +585 -0
- package/dist/esm/xv-accordion-v2_14.entry.js.map +1 -0
- package/dist/esm/xv-breadcrumbs-v2.entry.js +1 -1
- package/dist/esm/xv-webcomponents.js +3 -3
- package/dist/types/components/xv-checkbox/xv-checkbox.d.ts +66 -2
- package/dist/types/components/xv-table/defs.d.ts +16 -0
- package/dist/types/components/xv-table/xv-table-col/xv-table-col.d.ts +3 -0
- package/dist/types/components/xv-table/xv-table-header-row/xv-table-header-row.d.ts +25 -0
- package/dist/types/components/xv-table/xv-table-row/xv-table-row.d.ts +59 -0
- package/dist/types/components/xv-table/xv-table.d.ts +40 -0
- package/dist/types/components.d.ts +342 -0
- package/dist/types/types/enum.d.ts +7 -0
- package/dist/types/utils/utils.d.ts +7 -0
- package/dist/xv-webcomponents/p-5f18d718.entry.js +2 -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.map +1 -1
- package/dist/xv-webcomponents/p-bfe83d1e.entry.js +2 -0
- package/dist/xv-webcomponents/p-bfe83d1e.entry.js.map +1 -0
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
- package/dist/xv-webcomponents/xv-webcomponents.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-4d938647.js.map +0 -1
- package/dist/cjs/xv-accordion-v2_10.cjs.entry.js +0 -265
- package/dist/cjs/xv-accordion-v2_10.cjs.entry.js.map +0 -1
- package/dist/esm/index-60f5a964.js.map +0 -1
- package/dist/esm/xv-accordion-v2_10.entry.js +0 -252
- package/dist/esm/xv-accordion-v2_10.entry.js.map +0 -1
- package/dist/xv-webcomponents/p-08297c60.entry.js +0 -2
- package/dist/xv-webcomponents/p-08297c60.entry.js.map +0 -1
- package/dist/xv-webcomponents/p-543fe755.js +0 -3
- package/dist/xv-webcomponents/p-543fe755.js.map +0 -1
- package/dist/xv-webcomponents/p-6fe85516.entry.js +0 -2
- /package/dist/xv-webcomponents/{p-6fe85516.entry.js.map → p-5f18d718.entry.js.map} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
:host(xv-table-v2-row) {
|
|
2
|
+
display: grid;
|
|
3
|
+
padding: 16px;
|
|
4
|
+
align-items: center;
|
|
5
|
+
transition: height 0.15s cubic-bezier(0.2, 0, 0.38, 0.9), padding 0.15s ease-in-out, background-color 0.2ms ease-in-out;
|
|
6
|
+
background: var(--layer-02, #FFF);
|
|
7
|
+
box-shadow: 0 0 0 1px #E3E3E3 inset;
|
|
8
|
+
}
|
|
9
|
+
:host(xv-table-v2-row) .left-container {
|
|
10
|
+
height: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: flex-end;
|
|
14
|
+
gap: 16px;
|
|
15
|
+
padding: 0 16px;
|
|
16
|
+
}
|
|
17
|
+
:host(xv-table-v2-row) .expand-btn {
|
|
18
|
+
outline: none;
|
|
19
|
+
background-color: transparent;
|
|
20
|
+
display: block;
|
|
21
|
+
margin: 0 auto;
|
|
22
|
+
border: solid black;
|
|
23
|
+
border-width: 0 2px 2px 0;
|
|
24
|
+
padding: 5px;
|
|
25
|
+
transform: rotate(45deg);
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
transition: opacity 300ms ease-in-out, transform 200ms ease-in-out;
|
|
28
|
+
}
|
|
29
|
+
:host(xv-table-v2-row) .expand-btn:active {
|
|
30
|
+
opacity: 0.5;
|
|
31
|
+
}
|
|
32
|
+
:host(xv-table-v2-row) .expand-btn.expanded {
|
|
33
|
+
transform: rotate(225deg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([expanded]) {
|
|
37
|
+
block-size: auto;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([collapsed]) {
|
|
41
|
+
block-size: 0;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
padding-top: 0;
|
|
44
|
+
padding-bottom: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([odd]) {
|
|
48
|
+
background-color: var(--layer-selected-01, #E3E3E3);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([even]) {
|
|
52
|
+
background-color: #fff;
|
|
53
|
+
}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { uidGenerator } from "../../../utils/utils";
|
|
3
|
+
export class XvTableRow {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Is row will be expandable
|
|
7
|
+
* If it's true then the next row will be collapsed
|
|
8
|
+
*/
|
|
9
|
+
this.expandable = false;
|
|
10
|
+
/**
|
|
11
|
+
* Default state of expandable
|
|
12
|
+
*/
|
|
13
|
+
this.expanded = false;
|
|
14
|
+
this.prevRowExpanded = false;
|
|
15
|
+
this.cols = 1;
|
|
16
|
+
this.checkboxChange = (e) => {
|
|
17
|
+
this.checked = e.detail;
|
|
18
|
+
this.checkedChange.emit({
|
|
19
|
+
name: this.selectionName,
|
|
20
|
+
value: this.value,
|
|
21
|
+
checked: e.detail
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Called from outside (From expandable row)
|
|
27
|
+
*/
|
|
28
|
+
async setExpandRelation(id, expanded) {
|
|
29
|
+
this.expandId = id;
|
|
30
|
+
this.prevRowExpanded = !!expanded;
|
|
31
|
+
return this.prevRowExpanded;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Called from outside (From expandable row)
|
|
35
|
+
* to change then expand or collapse
|
|
36
|
+
*/
|
|
37
|
+
async toggleExpand(id, expanded) {
|
|
38
|
+
if (this.expandId !== id)
|
|
39
|
+
return;
|
|
40
|
+
this.prevRowExpanded = expanded !== undefined ? expanded : !this.prevRowExpanded;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Watch for expandable
|
|
44
|
+
* When it's false needs to remove unnecessary properties
|
|
45
|
+
*/
|
|
46
|
+
setExpandableRelationHandle() {
|
|
47
|
+
const nextEl = this.el.nextElementSibling;
|
|
48
|
+
if (!nextEl || nextEl.tagName !== this.el.tagName)
|
|
49
|
+
this.expandable = false;
|
|
50
|
+
if (!this.expandable)
|
|
51
|
+
return;
|
|
52
|
+
if (!this.id)
|
|
53
|
+
this.id = this.el.id || uidGenerator();
|
|
54
|
+
return nextEl.setExpandRelation(this.id, this.expanded);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* When user press on the expand button
|
|
58
|
+
*/
|
|
59
|
+
changeExpandHandle() {
|
|
60
|
+
const nextRow = this.el.nextElementSibling;
|
|
61
|
+
if (!nextRow || nextRow.tagName !== this.el.tagName)
|
|
62
|
+
return;
|
|
63
|
+
this.expanded = !this.expanded;
|
|
64
|
+
// Call method from new row
|
|
65
|
+
nextRow.toggleExpand(this.id, this.expanded);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Highlight the expanded row on hover
|
|
69
|
+
*/
|
|
70
|
+
hoverHandle(active) {
|
|
71
|
+
const prevRow = this.el.previousElementSibling;
|
|
72
|
+
const nextRow = this.el.nextElementSibling;
|
|
73
|
+
if ((nextRow === null || nextRow === void 0 ? void 0 : nextRow.tagName) === this.el.tagName && this.expandable) {
|
|
74
|
+
if (active) {
|
|
75
|
+
nextRow.setAttribute('highlighted', '');
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
nextRow.removeAttribute('highlighted');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if ((prevRow === null || prevRow === void 0 ? void 0 : prevRow.tagName) === this.el.tagName && prevRow.hasAttribute('expandable')) {
|
|
82
|
+
if (active) {
|
|
83
|
+
prevRow.setAttribute('highlighted', '');
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
prevRow.removeAttribute('highlighted');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async componentWillLoad() {
|
|
91
|
+
this.id = this.el.id;
|
|
92
|
+
this.cols = this.el.childElementCount;
|
|
93
|
+
await this.setExpandableRelationHandle();
|
|
94
|
+
}
|
|
95
|
+
render() {
|
|
96
|
+
return (h(Host, { key: '88df976d496799070ad0011da60871d4984f775e', onMouseEnter: () => this.hoverHandle(true), onMouseLeave: () => this.hoverHandle(false), cols: this.cols, expanded: this.expandId && this.prevRowExpanded, collapsed: this.expandId && !this.prevRowExpanded }, h("div", { key: '2a28bfce934d640db4167ce418bec37bddd18494', class: "left-container" }, this.expandable && (h("button", { key: '0cf1d6a4472c05677e7d2edb8b2402bf7687fae8', class: `expand-btn ${this.expanded ? 'expanded' : ''}`, onClick: () => this.changeExpandHandle() })), this.selectionName && (h("xv-checkbox-v2", { key: 'ea01b82db0a990c0352c3310ceaca1cc55a7d2ca', name: this.selectionName, value: this.value, checked: this.checked, onEventChange: this.checkboxChange }))), h("slot", { key: '33be6520fe3e2f7cd352f8ce58ad7286b644d45b' })));
|
|
97
|
+
}
|
|
98
|
+
static get is() { return "xv-table-v2-row"; }
|
|
99
|
+
static get encapsulation() { return "shadow"; }
|
|
100
|
+
static get originalStyleUrls() {
|
|
101
|
+
return {
|
|
102
|
+
"$": ["xv-table-row.scss"]
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
static get styleUrls() {
|
|
106
|
+
return {
|
|
107
|
+
"$": ["xv-table-row.css"]
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
static get properties() {
|
|
111
|
+
return {
|
|
112
|
+
"expandable": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"mutable": true,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "boolean",
|
|
117
|
+
"resolved": "boolean",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Is row will be expandable\nIf it's true then the next row will be collapsed"
|
|
125
|
+
},
|
|
126
|
+
"getter": false,
|
|
127
|
+
"setter": false,
|
|
128
|
+
"attribute": "expandable",
|
|
129
|
+
"reflect": false,
|
|
130
|
+
"defaultValue": "false"
|
|
131
|
+
},
|
|
132
|
+
"expanded": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"mutable": true,
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "boolean",
|
|
137
|
+
"resolved": "boolean",
|
|
138
|
+
"references": {}
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"optional": false,
|
|
142
|
+
"docs": {
|
|
143
|
+
"tags": [],
|
|
144
|
+
"text": "Default state of expandable"
|
|
145
|
+
},
|
|
146
|
+
"getter": false,
|
|
147
|
+
"setter": false,
|
|
148
|
+
"attribute": "expanded",
|
|
149
|
+
"reflect": true,
|
|
150
|
+
"defaultValue": "false"
|
|
151
|
+
},
|
|
152
|
+
"selectionName": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"mutable": false,
|
|
155
|
+
"complexType": {
|
|
156
|
+
"original": "string",
|
|
157
|
+
"resolved": "string",
|
|
158
|
+
"references": {}
|
|
159
|
+
},
|
|
160
|
+
"required": false,
|
|
161
|
+
"optional": true,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": "Checkbox row name"
|
|
165
|
+
},
|
|
166
|
+
"getter": false,
|
|
167
|
+
"setter": false,
|
|
168
|
+
"attribute": "selection-name",
|
|
169
|
+
"reflect": true
|
|
170
|
+
},
|
|
171
|
+
"value": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"mutable": false,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "string",
|
|
176
|
+
"resolved": "string",
|
|
177
|
+
"references": {}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": true,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": "Checkbox row value"
|
|
184
|
+
},
|
|
185
|
+
"getter": false,
|
|
186
|
+
"setter": false,
|
|
187
|
+
"attribute": "value",
|
|
188
|
+
"reflect": true
|
|
189
|
+
},
|
|
190
|
+
"checked": {
|
|
191
|
+
"type": "boolean",
|
|
192
|
+
"mutable": true,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "boolean",
|
|
195
|
+
"resolved": "boolean",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": true,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "Checkbox row status"
|
|
203
|
+
},
|
|
204
|
+
"getter": false,
|
|
205
|
+
"setter": false,
|
|
206
|
+
"attribute": "checked",
|
|
207
|
+
"reflect": true
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
static get states() {
|
|
212
|
+
return {
|
|
213
|
+
"prevRowExpanded": {},
|
|
214
|
+
"expandId": {},
|
|
215
|
+
"id": {},
|
|
216
|
+
"cols": {}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
static get events() {
|
|
220
|
+
return [{
|
|
221
|
+
"method": "checkedChange",
|
|
222
|
+
"name": "checkedChange",
|
|
223
|
+
"bubbles": true,
|
|
224
|
+
"cancelable": true,
|
|
225
|
+
"composed": true,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [],
|
|
228
|
+
"text": ""
|
|
229
|
+
},
|
|
230
|
+
"complexType": {
|
|
231
|
+
"original": "{ name: string, value?: string; checked: boolean }",
|
|
232
|
+
"resolved": "{ name: string; value?: string; checked: boolean; }",
|
|
233
|
+
"references": {}
|
|
234
|
+
}
|
|
235
|
+
}];
|
|
236
|
+
}
|
|
237
|
+
static get methods() {
|
|
238
|
+
return {
|
|
239
|
+
"setExpandRelation": {
|
|
240
|
+
"complexType": {
|
|
241
|
+
"signature": "(id?: string, expanded?: boolean) => Promise<boolean>",
|
|
242
|
+
"parameters": [{
|
|
243
|
+
"name": "id",
|
|
244
|
+
"type": "string",
|
|
245
|
+
"docs": ""
|
|
246
|
+
}, {
|
|
247
|
+
"name": "expanded",
|
|
248
|
+
"type": "boolean",
|
|
249
|
+
"docs": ""
|
|
250
|
+
}],
|
|
251
|
+
"references": {
|
|
252
|
+
"Promise": {
|
|
253
|
+
"location": "global",
|
|
254
|
+
"id": "global::Promise"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"return": "Promise<boolean>"
|
|
258
|
+
},
|
|
259
|
+
"docs": {
|
|
260
|
+
"text": "Called from outside (From expandable row)",
|
|
261
|
+
"tags": []
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"toggleExpand": {
|
|
265
|
+
"complexType": {
|
|
266
|
+
"signature": "(id?: string, expanded?: boolean) => Promise<void>",
|
|
267
|
+
"parameters": [{
|
|
268
|
+
"name": "id",
|
|
269
|
+
"type": "string",
|
|
270
|
+
"docs": ""
|
|
271
|
+
}, {
|
|
272
|
+
"name": "expanded",
|
|
273
|
+
"type": "boolean",
|
|
274
|
+
"docs": ""
|
|
275
|
+
}],
|
|
276
|
+
"references": {
|
|
277
|
+
"Promise": {
|
|
278
|
+
"location": "global",
|
|
279
|
+
"id": "global::Promise"
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"return": "Promise<void>"
|
|
283
|
+
},
|
|
284
|
+
"docs": {
|
|
285
|
+
"text": "Called from outside (From expandable row)\nto change then expand or collapse",
|
|
286
|
+
"tags": []
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
static get elementRef() { return "el"; }
|
|
292
|
+
static get watchers() {
|
|
293
|
+
return [{
|
|
294
|
+
"propName": "expandable",
|
|
295
|
+
"methodName": "setExpandableRelationHandle"
|
|
296
|
+
}];
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
//# sourceMappingURL=xv-table-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xv-table-row.js","sourceRoot":"","sources":["../../../../src/components/xv-table/xv-table-row/xv-table-row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOpD,MAAM,OAAO,UAAU;IALvB;QAOE;;;WAGG;QACsB,eAAU,GAAY,KAAK,CAAC;QACrD;;WAEG;QACqC,aAAQ,GAAY,KAAK,CAAC;QAczD,oBAAe,GAAY,KAAK,CAAC;QAGjC,SAAI,GAAW,CAAC,CAAC;QA8ElB,mBAAc,GAAG,CAAC,CAAuB,EAAE,EAAE;YACnD,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;YACxB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;gBACtB,IAAI,EAAE,IAAI,CAAC,aAAa;gBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,OAAO,EAAE,CAAC,CAAC,MAAM;aAClB,CAAC,CAAC;QACL,CAAC,CAAA;KAqCF;IAtHC;;OAEG;IAEH,KAAK,CAAC,iBAAiB,CAAC,EAAW,EAAE,QAAkB;QACrD,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB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AAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,eAAe,EAC/C,SAAS,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,eAAe;YAEjD,4DAAK,KAAK,EAAC,gBAAgB;gBACxB,IAAI,CAAC,UAAU,IAAI,CAClB,+DACE,KAAK,EAAE,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,EACtD,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,GACxC,CACH;gBACA,IAAI,CAAC,aAAa,IAAI,CACrB,uEACE,IAAI,EAAE,IAAI,CAAC,aAAa,EACxB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,aAAa,EAAE,IAAI,CAAC,cAAc,GAClC,CACH,CACG;YACN,8DAAQ,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Element, Prop, State, Watch, Method, Event, EventEmitter } from '@stencil/core';\nimport { uidGenerator } from '../../../utils/utils';\n\n@Component({\n tag: 'xv-table-v2-row',\n styleUrl: 'xv-table-row.scss',\n shadow: true,\n})\nexport class XvTableRow {\n @Element() el: HTMLElement;\n /**\n * Is row will be expandable\n * If it's true then the next row will be collapsed\n */\n @Prop({ mutable: true }) expandable: boolean = false;\n /**\n * Default state of expandable\n */\n @Prop({ reflect: true, mutable: true }) expanded: boolean = false;\n /**\n * Checkbox row name\n */\n @Prop({ reflect: true, attribute: 'selection-name' }) selectionName?: string;\n /**\n * Checkbox row value\n */\n @Prop({ reflect: true }) value?: string;\n /**\n * Checkbox row status\n */\n @Prop({ reflect: true, mutable: true }) checked?: boolean;\n\n @State() prevRowExpanded: boolean = false;\n @State() expandId?: string;\n @State() id?: string;\n @State() cols: number = 1;\n\n @Event() checkedChange: EventEmitter<{ name: string, value?: string; checked: boolean }>;\n\n /**\n * Called from outside (From expandable row)\n */\n @Method()\n async setExpandRelation(id?: string, expanded?: boolean) {\n this.expandId = id;\n this.prevRowExpanded = !!expanded;\n return this.prevRowExpanded;\n }\n\n /**\n * Called from outside (From expandable row)\n * to change then expand or collapse\n */\n @Method()\n async toggleExpand(id?: string, expanded?: boolean) {\n if (this.expandId !== id) return;\n this.prevRowExpanded = expanded !== undefined ? expanded : !this.prevRowExpanded;\n }\n\n /**\n * Watch for expandable\n * When it's false needs to remove unnecessary properties\n */\n @Watch('expandable')\n setExpandableRelationHandle(): Promise<any> {\n const nextEl = this.el.nextElementSibling;\n\n if (!nextEl || nextEl.tagName !== this.el.tagName) this.expandable = false;\n\n if (!this.expandable) return;\n\n if (!this.id) this.id = this.el.id || uidGenerator();\n\n return (nextEl as any).setExpandRelation(this.id, this.expanded);\n }\n\n /**\n * When user press on the expand button\n */\n private changeExpandHandle() {\n const nextRow = this.el.nextElementSibling;\n\n if (!nextRow || nextRow.tagName !== this.el.tagName) return;\n\n this.expanded = !this.expanded;\n // Call method from new row\n (nextRow as any).toggleExpand(this.id, this.expanded);\n }\n\n /**\n * Highlight the expanded row on hover\n */\n private hoverHandle(active: boolean) {\n const prevRow = this.el.previousElementSibling as HTMLElement | null;\n const nextRow = this.el.nextElementSibling as HTMLElement | null;\n\n if (nextRow?.tagName === this.el.tagName && this.expandable) {\n if (active) {\n nextRow.setAttribute('highlighted', '');\n } else {\n nextRow.removeAttribute('highlighted');\n }\n }\n\n if (prevRow?.tagName === this.el.tagName && prevRow.hasAttribute('expandable')) {\n if (active) {\n prevRow.setAttribute('highlighted', '');\n } else {\n prevRow.removeAttribute('highlighted');\n }\n }\n }\n\n private checkboxChange = (e: CustomEvent<boolean>) => {\n this.checked = e.detail;\n this.checkedChange.emit({\n name: this.selectionName,\n value: this.value,\n checked: e.detail\n });\n }\n\n async componentWillLoad(){\n this.id = this.el.id;\n this.cols = this.el.childElementCount;\n await this.setExpandableRelationHandle();\n }\n\n render() {\n return (\n <Host\n onMouseEnter={() => this.hoverHandle(true)}\n onMouseLeave={() => this.hoverHandle(false)}\n cols={this.cols}\n expanded={this.expandId && this.prevRowExpanded}\n collapsed={this.expandId && !this.prevRowExpanded}\n >\n <div class=\"left-container\">\n {this.expandable && (\n <button\n class={`expand-btn ${this.expanded ? 'expanded' : ''}`}\n onClick={() => this.changeExpandHandle()}\n />\n )}\n {this.selectionName && (\n <xv-checkbox-v2\n name={this.selectionName}\n value={this.value}\n checked={this.checked}\n onEventChange={this.checkboxChange}\n />\n )}\n </div>\n <slot />\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
:host ::slotted(xv-table-v2-header-row[cols="1"]),
|
|
2
|
+
:host ::slotted(xv-table-v2-row[cols="1"]) {
|
|
3
|
+
--xv-table-cols: 1;
|
|
4
|
+
}
|
|
5
|
+
:host ::slotted(xv-table-v2-header-row[cols="2"]),
|
|
6
|
+
:host ::slotted(xv-table-v2-row[cols="2"]) {
|
|
7
|
+
--xv-table-cols: 2;
|
|
8
|
+
}
|
|
9
|
+
:host ::slotted(xv-table-v2-header-row[cols="3"]),
|
|
10
|
+
:host ::slotted(xv-table-v2-row[cols="3"]) {
|
|
11
|
+
--xv-table-cols: 3;
|
|
12
|
+
}
|
|
13
|
+
:host ::slotted(xv-table-v2-header-row[cols="4"]),
|
|
14
|
+
:host ::slotted(xv-table-v2-row[cols="4"]) {
|
|
15
|
+
--xv-table-cols: 4;
|
|
16
|
+
}
|
|
17
|
+
:host ::slotted(xv-table-v2-header-row[cols="5"]),
|
|
18
|
+
:host ::slotted(xv-table-v2-row[cols="5"]) {
|
|
19
|
+
--xv-table-cols: 5;
|
|
20
|
+
}
|
|
21
|
+
:host ::slotted(xv-table-v2-header-row[cols="6"]),
|
|
22
|
+
:host ::slotted(xv-table-v2-row[cols="6"]) {
|
|
23
|
+
--xv-table-cols: 6;
|
|
24
|
+
}
|
|
25
|
+
:host ::slotted(xv-table-v2-header-row[cols="7"]),
|
|
26
|
+
:host ::slotted(xv-table-v2-row[cols="7"]) {
|
|
27
|
+
--xv-table-cols: 7;
|
|
28
|
+
}
|
|
29
|
+
:host ::slotted(xv-table-v2-header-row[cols="8"]),
|
|
30
|
+
:host ::slotted(xv-table-v2-row[cols="8"]) {
|
|
31
|
+
--xv-table-cols: 8;
|
|
32
|
+
}
|
|
33
|
+
:host ::slotted(xv-table-v2-header-row[cols="9"]),
|
|
34
|
+
:host ::slotted(xv-table-v2-row[cols="9"]) {
|
|
35
|
+
--xv-table-cols: 9;
|
|
36
|
+
}
|
|
37
|
+
:host ::slotted(xv-table-v2-header-row[cols="10"]),
|
|
38
|
+
:host ::slotted(xv-table-v2-row[cols="10"]) {
|
|
39
|
+
--xv-table-cols: 10;
|
|
40
|
+
}
|
|
41
|
+
:host ::slotted(xv-table-v2-header-row[cols="11"]),
|
|
42
|
+
:host ::slotted(xv-table-v2-row[cols="11"]) {
|
|
43
|
+
--xv-table-cols: 11;
|
|
44
|
+
}
|
|
45
|
+
:host ::slotted(xv-table-v2-header-row[cols="12"]),
|
|
46
|
+
:host ::slotted(xv-table-v2-row[cols="12"]) {
|
|
47
|
+
--xv-table-cols: 12;
|
|
48
|
+
}
|
|
49
|
+
:host ::slotted(xv-table-v2-header-row[cols="13"]),
|
|
50
|
+
:host ::slotted(xv-table-v2-row[cols="13"]) {
|
|
51
|
+
--xv-table-cols: 13;
|
|
52
|
+
}
|
|
53
|
+
:host ::slotted(xv-table-v2-header-row[cols="14"]),
|
|
54
|
+
:host ::slotted(xv-table-v2-row[cols="14"]) {
|
|
55
|
+
--xv-table-cols: 14;
|
|
56
|
+
}
|
|
57
|
+
:host ::slotted(xv-table-v2-header-row[cols="15"]),
|
|
58
|
+
:host ::slotted(xv-table-v2-row[cols="15"]) {
|
|
59
|
+
--xv-table-cols: 15;
|
|
60
|
+
}
|
|
61
|
+
:host ::slotted(xv-table-v2-header-row[cols="16"]),
|
|
62
|
+
:host ::slotted(xv-table-v2-row[cols="16"]) {
|
|
63
|
+
--xv-table-cols: 16;
|
|
64
|
+
}
|
|
65
|
+
:host ::slotted(xv-table-v2-header-row[cols="17"]),
|
|
66
|
+
:host ::slotted(xv-table-v2-row[cols="17"]) {
|
|
67
|
+
--xv-table-cols: 17;
|
|
68
|
+
}
|
|
69
|
+
:host ::slotted(xv-table-v2-header-row[cols="18"]),
|
|
70
|
+
:host ::slotted(xv-table-v2-row[cols="18"]) {
|
|
71
|
+
--xv-table-cols: 18;
|
|
72
|
+
}
|
|
73
|
+
:host ::slotted(xv-table-v2-header-row[cols="19"]),
|
|
74
|
+
:host ::slotted(xv-table-v2-row[cols="19"]) {
|
|
75
|
+
--xv-table-cols: 19;
|
|
76
|
+
}
|
|
77
|
+
:host ::slotted(xv-table-v2-header-row[cols="20"]),
|
|
78
|
+
:host ::slotted(xv-table-v2-row[cols="20"]) {
|
|
79
|
+
--xv-table-cols: 20;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([size=xs]) ::slotted(xv-table-v2-row),
|
|
83
|
+
:host([size=xs]) ::slotted(xv-table-v2-header-row) {
|
|
84
|
+
padding: 2px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host([size=sm]) ::slotted(xv-table-v2-row),
|
|
88
|
+
:host([size=sm]) ::slotted(xv-table-v2-header-row) {
|
|
89
|
+
padding: 8px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([size=md]) ::slotted(xv-table-v2-row),
|
|
93
|
+
:host([size=md]) ::slotted(xv-table-v2-header-row) {
|
|
94
|
+
padding: 16px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([size=lg]) ::slotted(xv-table-v2-row),
|
|
98
|
+
:host([size=lg]) ::slotted(xv-table-v2-header-row) {
|
|
99
|
+
padding: 18px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([size=xl]) ::slotted(xv-table-v2-row),
|
|
103
|
+
:host([size=xl]) ::slotted(xv-table-v2-header-row) {
|
|
104
|
+
padding: 20px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:host([hoverable]) ::slotted(xv-table-v2-row:hover),
|
|
108
|
+
:host([hoverable]) ::slotted([highlighted]) {
|
|
109
|
+
background-color: var(--layer-hover-01, #E3E3E3);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host(xv-table-v2) ::slotted(xv-table-v2-row),
|
|
113
|
+
:host(xv-table-v2) ::slotted(xv-table-v2-header-row) {
|
|
114
|
+
grid-template-columns: 0 repeat(var(--xv-table-cols, 1), 1fr);
|
|
115
|
+
}
|
|
116
|
+
:host(xv-table-v2) ::slotted(xv-table-v2-row[collapsed]) {
|
|
117
|
+
padding-top: 0;
|
|
118
|
+
padding-bottom: 0;
|
|
119
|
+
}
|
|
120
|
+
:host(xv-table-v2) .caption {
|
|
121
|
+
padding: 16px 16px 18px;
|
|
122
|
+
}
|
|
123
|
+
:host(xv-table-v2) .caption_title, :host(xv-table-v2) .caption_description {
|
|
124
|
+
color: var(--text-primary, #333);
|
|
125
|
+
margin: 0;
|
|
126
|
+
}
|
|
127
|
+
:host(xv-table-v2) .caption_title {
|
|
128
|
+
font-family: var(--ff-heading, "Gill Sans");
|
|
129
|
+
font-size: 21px;
|
|
130
|
+
}
|
|
131
|
+
:host(xv-table-v2) .caption_description {
|
|
132
|
+
font-family: var(--ff-body, Tahoma);
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
line-height: 128.571%;
|
|
135
|
+
letter-spacing: 0.16px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([expandable]) ::slotted(xv-table-v2-row),
|
|
139
|
+
:host([expandable]) ::slotted(xv-table-v2-header-row) {
|
|
140
|
+
position: relative;
|
|
141
|
+
grid-template-columns: 48px repeat(var(--xv-table-cols, 1), 1fr);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host([selectable]) ::slotted(xv-table-v2-row),
|
|
145
|
+
:host([selectable]) ::slotted(xv-table-v2-header-row) {
|
|
146
|
+
position: relative;
|
|
147
|
+
grid-template-columns: 50px repeat(var(--xv-table-cols, 1), 1fr);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
:host([expandable][selectable]) ::slotted(xv-table-v2-row),
|
|
151
|
+
:host([expandable][selectable]) ::slotted(xv-table-v2-header-row) {
|
|
152
|
+
position: relative;
|
|
153
|
+
grid-template-columns: 98px repeat(var(--xv-table-cols, 1), 1fr);
|
|
154
|
+
}
|