xv-webcomponents 0.1.26 → 0.1.28
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-aa46f72a.js +50 -0
- package/dist/cjs/utils-aa46f72a.js.map +1 -0
- package/dist/cjs/xv-accordion-v2_27.cjs.entry.js +1358 -0
- package/dist/cjs/xv-accordion-v2_27.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 +39 -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 +154 -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 +132 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.js +402 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.js.map +1 -0
- package/dist/collection/components/xv-dropdown/_vars.js +2 -0
- package/dist/collection/components/xv-dropdown/_vars.js.map +1 -0
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.css +14 -0
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js +151 -0
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js.map +1 -0
- package/dist/collection/components/xv-dropdown/xv-dropdown.css +227 -0
- package/dist/collection/components/xv-dropdown/xv-dropdown.js +340 -0
- package/dist/collection/components/xv-dropdown/xv-dropdown.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 +61 -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-loader/xv-loader.css +65 -0
- package/dist/collection/components/xv-loader/xv-loader.js +106 -0
- package/dist/collection/components/xv-loader/xv-loader.js.map +1 -0
- package/dist/collection/components/xv-modal/xv-modal.css +98 -0
- package/dist/collection/components/xv-modal/xv-modal.js +202 -0
- package/dist/collection/components/xv-modal/xv-modal.js.map +1 -0
- package/dist/collection/components/xv-notification/_vars.js +8 -0
- package/dist/collection/components/xv-notification/_vars.js.map +1 -0
- package/dist/collection/components/xv-notification/xv-notification.css +112 -0
- package/dist/collection/components/xv-notification/xv-notification.js +118 -0
- package/dist/collection/components/xv-notification/xv-notification.js.map +1 -0
- package/dist/collection/components/xv-overflow-menu/_vars.js +6 -0
- package/dist/collection/components/xv-overflow-menu/_vars.js.map +1 -0
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.css +45 -0
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js +137 -0
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js.map +1 -0
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.css +102 -0
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js +202 -0
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js.map +1 -0
- package/dist/collection/components/xv-progress-indicator/_vars.js +12 -0
- package/dist/collection/components/xv-progress-indicator/_vars.js.map +1 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.css +96 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js +54 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js.map +1 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.css +45 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +157 -0
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js.map +1 -0
- package/dist/collection/components/xv-table/defs.js +28 -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 +13 -0
- package/dist/collection/components/xv-table/xv-table-col/xv-table-col.js +111 -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-expand/xv-table-expand.css +116 -0
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +199 -0
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js.map +1 -0
- package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.css +80 -0
- package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.js +172 -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 +46 -0
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +275 -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-toolbar/xv-table-toolbar.css +47 -0
- package/dist/collection/components/xv-table/xv-table-toolbar/xv-table-toolbar.js +78 -0
- package/dist/collection/components/xv-table/xv-table-toolbar/xv-table-toolbar.js.map +1 -0
- package/dist/collection/components/xv-table/xv-table.css +165 -0
- package/dist/collection/components/xv-table/xv-table.js +284 -0
- package/dist/collection/components/xv-table/xv-table.js.map +1 -0
- package/dist/collection/components/xv-tabs/_vars.js +11 -0
- package/dist/collection/components/xv-tabs/_vars.js.map +1 -0
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.css +3 -0
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +65 -0
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js.map +1 -0
- package/dist/collection/components/xv-tabs/xv-tabs.css +79 -0
- package/dist/collection/components/xv-tabs/xv-tabs.js +158 -0
- package/dist/collection/components/xv-tabs/xv-tabs.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/collection/utils/utils.js +46 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.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-0d1c18d5.js +44 -0
- package/dist/esm/utils-0d1c18d5.js.map +1 -0
- package/dist/esm/xv-accordion-v2_27.entry.js +1328 -0
- package/dist/esm/xv-accordion-v2_27.entry.js.map +1 -0
- package/dist/esm/xv-breadcrumbs-v2.entry.js +18 -0
- 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-accordion/xv-accordion.d.ts +20 -0
- package/dist/types/components/xv-accordion-item/xv-accordion-item.d.ts +15 -0
- package/dist/types/components/xv-breadcrumbs/xv-breadcrumbs.d.ts +3 -0
- package/dist/types/components/xv-button/xv-button.d.ts +16 -0
- package/dist/types/components/xv-card/xv-card.d.ts +8 -0
- package/dist/types/components/xv-checkbox/xv-checkbox.d.ts +74 -0
- package/dist/types/components/xv-dropdown/_vars.d.ts +5 -0
- package/dist/types/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.d.ts +17 -0
- package/dist/types/components/xv-dropdown/xv-dropdown.d.ts +28 -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/xv-link/xv-link.d.ts +9 -0
- package/dist/types/components/xv-loader/xv-loader.d.ts +16 -0
- package/dist/types/components/xv-modal/xv-modal.d.ts +26 -0
- package/dist/types/components/xv-notification/_vars.d.ts +6 -0
- package/dist/types/components/xv-notification/xv-notification.d.ts +11 -0
- package/dist/types/components/xv-overflow-menu/_vars.d.ts +8 -0
- package/dist/types/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.d.ts +10 -0
- package/dist/types/components/xv-overflow-menu/xv-overflow-menu.d.ts +21 -0
- package/dist/types/components/xv-progress-indicator/_vars.d.ts +9 -0
- package/dist/types/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.d.ts +6 -0
- package/dist/types/components/xv-progress-indicator/xv-progress-indicator.d.ts +25 -0
- package/dist/types/components/xv-table/defs.d.ts +38 -0
- package/dist/types/components/xv-table/xv-table-col/xv-table-col.d.ts +9 -0
- package/dist/types/components/xv-table/xv-table-expand/xv-table-expand.d.ts +24 -0
- package/dist/types/components/xv-table/xv-table-header-row/xv-table-header-row.d.ts +28 -0
- package/dist/types/components/xv-table/xv-table-row/xv-table-row.d.ts +52 -0
- package/dist/types/components/xv-table/xv-table-toolbar/xv-table-toolbar.d.ts +6 -0
- package/dist/types/components/xv-table/xv-table.d.ts +37 -0
- package/dist/types/components/xv-tabs/_vars.d.ts +7 -0
- package/dist/types/components/xv-tabs/xv-tab/xv-tab.d.ts +5 -0
- package/dist/types/components/xv-tabs/xv-tabs.d.ts +36 -0
- package/dist/types/components/xv-tag/xv-tag.d.ts +11 -0
- package/dist/types/components/xv-tooltip/xv-tooltip.d.ts +11 -0
- package/dist/types/components.d.ts +1217 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1680 -0
- package/dist/types/types/enum.d.ts +7 -0
- package/dist/types/utils/utils.d.ts +17 -0
- package/dist/xv-webcomponents/index.esm.js +2 -0
- package/dist/xv-webcomponents/index.esm.js.map +1 -0
- package/dist/xv-webcomponents/p-07dfeba3.entry.js +2 -0
- package/dist/xv-webcomponents/p-07dfeba3.entry.js.map +1 -0
- package/dist/xv-webcomponents/p-39bf1511.js +2 -0
- package/dist/xv-webcomponents/p-39bf1511.js.map +1 -0
- package/dist/xv-webcomponents/p-5f18d718.entry.js +2 -0
- package/dist/xv-webcomponents/p-5f18d718.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-e1255160.js +2 -0
- package/dist/xv-webcomponents/p-e1255160.js.map +1 -0
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +2 -0
- package/dist/xv-webcomponents/xv-webcomponents.esm.js.map +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class XvTableToolbar {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.selected = 0;
|
|
5
|
+
}
|
|
6
|
+
async setSelectedItems(selected) {
|
|
7
|
+
let count = 0;
|
|
8
|
+
selected.forEach(row => {
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
// not count header
|
|
11
|
+
if (row.name === 'header')
|
|
12
|
+
return;
|
|
13
|
+
// count row if it's not group
|
|
14
|
+
if (!((_a = row.group) === null || _a === void 0 ? void 0 : _a.isMainRow)) {
|
|
15
|
+
count++;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
// count selected group rows
|
|
19
|
+
count += (((_c = (_b = row.group) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.length) || 0);
|
|
20
|
+
});
|
|
21
|
+
this.selected = count;
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return (h(Host, { key: 'ff7f4169161d758dc2d9ecac906fe8f80e1aa0cc', class: { active: !!this.selected } }, h("div", { key: '687aacbb14767fc360a5ebd77333e5cc7d4991e2', class: "toolbar" }, h("slot", { key: '4eb52c981bd1193fb0c4f5c9b2f541329fafe010' })), h("div", { key: 'eb51c8c6d54629623fbf52d930b230067d2199de', class: "butch-editing" }, h("div", { key: '68fea62d37eb5b82ff3536a7bc2117c1d3b40ac7', class: "butch-editing_content" }, h("slot", { key: '513837fd458c511472704e11313345882845e33e', name: "actions" })), h("div", { key: '4e81903ecd38b1c84cede6c0ab64725b47d19dd6', class: "butch-editing_selected" }, this.selected, " ", this.selected === 1 ? 'Position ausgewählt' : 'Positionen ausgewählt'))));
|
|
25
|
+
}
|
|
26
|
+
static get is() { return "xv-table-v2-toolbar"; }
|
|
27
|
+
static get encapsulation() { return "shadow"; }
|
|
28
|
+
static get originalStyleUrls() {
|
|
29
|
+
return {
|
|
30
|
+
"$": ["xv-table-toolbar.scss"]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static get styleUrls() {
|
|
34
|
+
return {
|
|
35
|
+
"$": ["xv-table-toolbar.css"]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
static get states() {
|
|
39
|
+
return {
|
|
40
|
+
"selected": {}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
static get methods() {
|
|
44
|
+
return {
|
|
45
|
+
"setSelectedItems": {
|
|
46
|
+
"complexType": {
|
|
47
|
+
"signature": "(selected: Map<string, TableSelectionEventData>) => Promise<void>",
|
|
48
|
+
"parameters": [{
|
|
49
|
+
"name": "selected",
|
|
50
|
+
"type": "Map<string, TableSelectionEventData>",
|
|
51
|
+
"docs": ""
|
|
52
|
+
}],
|
|
53
|
+
"references": {
|
|
54
|
+
"Promise": {
|
|
55
|
+
"location": "global",
|
|
56
|
+
"id": "global::Promise"
|
|
57
|
+
},
|
|
58
|
+
"Map": {
|
|
59
|
+
"location": "global",
|
|
60
|
+
"id": "global::Map"
|
|
61
|
+
},
|
|
62
|
+
"TableSelectionEventData": {
|
|
63
|
+
"location": "import",
|
|
64
|
+
"path": "../defs",
|
|
65
|
+
"id": "src/components/xv-table/defs.ts::TableSelectionEventData"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"return": "Promise<void>"
|
|
69
|
+
},
|
|
70
|
+
"docs": {
|
|
71
|
+
"text": "",
|
|
72
|
+
"tags": []
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=xv-table-toolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xv-table-toolbar.js","sourceRoot":"","sources":["../../../../src/components/xv-table/xv-table-toolbar/xv-table-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAQlE,MAAM,OAAO,cAAc;IAL3B;QAMW,aAAQ,GAAW,CAAC,CAAC;KAqC/B;IAlCC,KAAK,CAAC,gBAAgB,CAAC,QAA8C;QACnE,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;;YACrB,mBAAmB;YACnB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;gBAAE,OAAO;YAElC,8BAA8B;YAC9B,IAAI,CAAC,CAAA,MAAA,GAAG,CAAC,KAAK,0CAAE,SAAS,CAAA,EAAE,CAAC;gBAC1B,KAAK,EAAE,CAAC;gBACR,OAAO;YACT,CAAC;YAED,4BAA4B;YAC5B,KAAK,IAAI,CAAC,CAAA,MAAA,MAAA,GAAG,CAAC,KAAK,0CAAE,IAAI,0CAAE,MAAM,KAAI,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE;YACtC,4DAAK,KAAK,EAAC,SAAS;gBAAC,8DAAQ,CAAM;YAEnC,4DAAK,KAAK,EAAC,eAAe;gBACxB,4DAAK,KAAK,EAAC,uBAAuB;oBAAC,6DAAM,IAAI,EAAC,SAAS,GAAG,CAAM;gBAChE,4DAAK,KAAK,EAAC,wBAAwB;oBAChC,IAAI,CAAC,QAAQ;;oBAAG,IAAI,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,uBAAuB,CAClF,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, State, Method } from '@stencil/core';\nimport { TableSelectionEventData } from '../defs';\n\n@Component({\n tag: 'xv-table-v2-toolbar',\n styleUrl: 'xv-table-toolbar.scss',\n shadow: true,\n})\nexport class XvTableToolbar {\n @State() selected: number = 0;\n\n @Method()\n async setSelectedItems(selected: Map<string, TableSelectionEventData>) {\n let count = 0;\n\n selected.forEach(row => {\n // not count header\n if (row.name === 'header') return;\n\n // count row if it's not group\n if (!row.group?.isMainRow) {\n count++;\n return;\n }\n\n // count selected group rows\n count += (row.group?.data?.length || 0);\n });\n\n this.selected = count;\n }\n\n render() {\n return (\n <Host class={{ active: !!this.selected }}>\n <div class=\"toolbar\"><slot /></div>\n\n <div class=\"butch-editing\">\n <div class=\"butch-editing_content\"><slot name=\"actions\" /></div>\n <div class=\"butch-editing_selected\">\n {this.selected} {this.selected === 1 ? 'Position ausgewählt' : 'Positionen ausgewählt'}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
position: relative;
|
|
3
|
+
--xv-table-row-bg-color: var(--layer-02, #FFF);
|
|
4
|
+
--xv-table-first-col-size: 0px;
|
|
5
|
+
--xv-table-padding: 16px;
|
|
6
|
+
}
|
|
7
|
+
:host ::slotted(xv-table-v2-header-row[cols="1"]),
|
|
8
|
+
:host ::slotted(xv-table-v2-row[cols="1"]),
|
|
9
|
+
:host ::slotted(xv-table-v2-expand[cols="1"]) {
|
|
10
|
+
--xv-table-cols: 1;
|
|
11
|
+
}
|
|
12
|
+
:host ::slotted(xv-table-v2-header-row[cols="2"]),
|
|
13
|
+
:host ::slotted(xv-table-v2-row[cols="2"]),
|
|
14
|
+
:host ::slotted(xv-table-v2-expand[cols="2"]) {
|
|
15
|
+
--xv-table-cols: 2;
|
|
16
|
+
}
|
|
17
|
+
:host ::slotted(xv-table-v2-header-row[cols="3"]),
|
|
18
|
+
:host ::slotted(xv-table-v2-row[cols="3"]),
|
|
19
|
+
:host ::slotted(xv-table-v2-expand[cols="3"]) {
|
|
20
|
+
--xv-table-cols: 3;
|
|
21
|
+
}
|
|
22
|
+
:host ::slotted(xv-table-v2-header-row[cols="4"]),
|
|
23
|
+
:host ::slotted(xv-table-v2-row[cols="4"]),
|
|
24
|
+
:host ::slotted(xv-table-v2-expand[cols="4"]) {
|
|
25
|
+
--xv-table-cols: 4;
|
|
26
|
+
}
|
|
27
|
+
:host ::slotted(xv-table-v2-header-row[cols="5"]),
|
|
28
|
+
:host ::slotted(xv-table-v2-row[cols="5"]),
|
|
29
|
+
:host ::slotted(xv-table-v2-expand[cols="5"]) {
|
|
30
|
+
--xv-table-cols: 5;
|
|
31
|
+
}
|
|
32
|
+
:host ::slotted(xv-table-v2-header-row[cols="6"]),
|
|
33
|
+
:host ::slotted(xv-table-v2-row[cols="6"]),
|
|
34
|
+
:host ::slotted(xv-table-v2-expand[cols="6"]) {
|
|
35
|
+
--xv-table-cols: 6;
|
|
36
|
+
}
|
|
37
|
+
:host ::slotted(xv-table-v2-header-row[cols="7"]),
|
|
38
|
+
:host ::slotted(xv-table-v2-row[cols="7"]),
|
|
39
|
+
:host ::slotted(xv-table-v2-expand[cols="7"]) {
|
|
40
|
+
--xv-table-cols: 7;
|
|
41
|
+
}
|
|
42
|
+
:host ::slotted(xv-table-v2-header-row[cols="8"]),
|
|
43
|
+
:host ::slotted(xv-table-v2-row[cols="8"]),
|
|
44
|
+
:host ::slotted(xv-table-v2-expand[cols="8"]) {
|
|
45
|
+
--xv-table-cols: 8;
|
|
46
|
+
}
|
|
47
|
+
:host ::slotted(xv-table-v2-header-row[cols="9"]),
|
|
48
|
+
:host ::slotted(xv-table-v2-row[cols="9"]),
|
|
49
|
+
:host ::slotted(xv-table-v2-expand[cols="9"]) {
|
|
50
|
+
--xv-table-cols: 9;
|
|
51
|
+
}
|
|
52
|
+
:host ::slotted(xv-table-v2-header-row[cols="10"]),
|
|
53
|
+
:host ::slotted(xv-table-v2-row[cols="10"]),
|
|
54
|
+
:host ::slotted(xv-table-v2-expand[cols="10"]) {
|
|
55
|
+
--xv-table-cols: 10;
|
|
56
|
+
}
|
|
57
|
+
:host ::slotted(xv-table-v2-header-row[cols="11"]),
|
|
58
|
+
:host ::slotted(xv-table-v2-row[cols="11"]),
|
|
59
|
+
:host ::slotted(xv-table-v2-expand[cols="11"]) {
|
|
60
|
+
--xv-table-cols: 11;
|
|
61
|
+
}
|
|
62
|
+
:host ::slotted(xv-table-v2-header-row[cols="12"]),
|
|
63
|
+
:host ::slotted(xv-table-v2-row[cols="12"]),
|
|
64
|
+
:host ::slotted(xv-table-v2-expand[cols="12"]) {
|
|
65
|
+
--xv-table-cols: 12;
|
|
66
|
+
}
|
|
67
|
+
:host ::slotted(xv-table-v2-header-row[cols="13"]),
|
|
68
|
+
:host ::slotted(xv-table-v2-row[cols="13"]),
|
|
69
|
+
:host ::slotted(xv-table-v2-expand[cols="13"]) {
|
|
70
|
+
--xv-table-cols: 13;
|
|
71
|
+
}
|
|
72
|
+
:host ::slotted(xv-table-v2-header-row[cols="14"]),
|
|
73
|
+
:host ::slotted(xv-table-v2-row[cols="14"]),
|
|
74
|
+
:host ::slotted(xv-table-v2-expand[cols="14"]) {
|
|
75
|
+
--xv-table-cols: 14;
|
|
76
|
+
}
|
|
77
|
+
:host ::slotted(xv-table-v2-header-row[cols="15"]),
|
|
78
|
+
:host ::slotted(xv-table-v2-row[cols="15"]),
|
|
79
|
+
:host ::slotted(xv-table-v2-expand[cols="15"]) {
|
|
80
|
+
--xv-table-cols: 15;
|
|
81
|
+
}
|
|
82
|
+
:host ::slotted(xv-table-v2-header-row[cols="16"]),
|
|
83
|
+
:host ::slotted(xv-table-v2-row[cols="16"]),
|
|
84
|
+
:host ::slotted(xv-table-v2-expand[cols="16"]) {
|
|
85
|
+
--xv-table-cols: 16;
|
|
86
|
+
}
|
|
87
|
+
:host ::slotted(xv-table-v2-header-row[cols="17"]),
|
|
88
|
+
:host ::slotted(xv-table-v2-row[cols="17"]),
|
|
89
|
+
:host ::slotted(xv-table-v2-expand[cols="17"]) {
|
|
90
|
+
--xv-table-cols: 17;
|
|
91
|
+
}
|
|
92
|
+
:host ::slotted(xv-table-v2-header-row[cols="18"]),
|
|
93
|
+
:host ::slotted(xv-table-v2-row[cols="18"]),
|
|
94
|
+
:host ::slotted(xv-table-v2-expand[cols="18"]) {
|
|
95
|
+
--xv-table-cols: 18;
|
|
96
|
+
}
|
|
97
|
+
:host ::slotted(xv-table-v2-header-row[cols="19"]),
|
|
98
|
+
:host ::slotted(xv-table-v2-row[cols="19"]),
|
|
99
|
+
:host ::slotted(xv-table-v2-expand[cols="19"]) {
|
|
100
|
+
--xv-table-cols: 19;
|
|
101
|
+
}
|
|
102
|
+
:host ::slotted(xv-table-v2-header-row[cols="20"]),
|
|
103
|
+
:host ::slotted(xv-table-v2-row[cols="20"]),
|
|
104
|
+
:host ::slotted(xv-table-v2-expand[cols="20"]) {
|
|
105
|
+
--xv-table-cols: 20;
|
|
106
|
+
}
|
|
107
|
+
:host .caption {
|
|
108
|
+
padding: 16px 16px 18px;
|
|
109
|
+
}
|
|
110
|
+
:host .caption_title, :host .caption_description {
|
|
111
|
+
color: var(--text-primary, #333);
|
|
112
|
+
margin: 0;
|
|
113
|
+
}
|
|
114
|
+
:host .caption_title {
|
|
115
|
+
font-family: var(--ff-heading, "Gill Sans");
|
|
116
|
+
font-size: 21px;
|
|
117
|
+
}
|
|
118
|
+
:host .caption_description {
|
|
119
|
+
font-family: var(--ff-body, Tahoma);
|
|
120
|
+
font-size: 14px;
|
|
121
|
+
line-height: 128.571%;
|
|
122
|
+
letter-spacing: 0.16px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([expandable]) {
|
|
126
|
+
--xv-table-first-col-size: 48px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host([selectable]) {
|
|
130
|
+
--xv-table-first-col-size: 50px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([expandable][selectable]) {
|
|
134
|
+
--xv-table-first-col-size: 98px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:host([size=xs]) {
|
|
138
|
+
--xv-table-padding: 2px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:host([size=sm]) {
|
|
142
|
+
--xv-table-padding: 8px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:host([size=md]) {
|
|
146
|
+
--xv-table-padding: 16px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:host([size=lg]) {
|
|
150
|
+
--xv-table-padding: 18px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([size=xl]) {
|
|
154
|
+
--xv-table-padding: 20px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host([hoverable]) ::slotted(xv-table-v2-row:hover),
|
|
158
|
+
:host([hoverable]) ::slotted(xv-table-v2-expand:hover) {
|
|
159
|
+
--xv-table-row-bg-color: var(--layer-hover-01, #E3E3E3);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:host(xv-table-v2) ::slotted(xv-table-v2-row[odd]),
|
|
163
|
+
:host(xv-table-v2) ::slotted(xv-table-v2-expand[odd]) {
|
|
164
|
+
--xv-table-row-bg-color: var(--layer-selected-01, #E3E3E3);
|
|
165
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { TABLE_COLOR_SCHEMA, TABLE_SIZE, TABLE_TAG } from "./defs";
|
|
3
|
+
import { debounce, forEach, setAttr } from "../../utils/utils";
|
|
4
|
+
export class XvTable {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Set current color schema type of enum TABLE_COLOR_SCHEMA
|
|
8
|
+
* Possible options 'zebra'
|
|
9
|
+
*/
|
|
10
|
+
this.colorSchema = TABLE_COLOR_SCHEMA.DEF;
|
|
11
|
+
/**
|
|
12
|
+
* If table is expandable fields
|
|
13
|
+
*/
|
|
14
|
+
this.expandable = false;
|
|
15
|
+
/**
|
|
16
|
+
* Table size
|
|
17
|
+
* enum TABLE_SIZE
|
|
18
|
+
*/
|
|
19
|
+
this.size = TABLE_SIZE.MEDIUM;
|
|
20
|
+
/**
|
|
21
|
+
* Add checkbox selection to the table
|
|
22
|
+
*/
|
|
23
|
+
this.selectable = false;
|
|
24
|
+
this.selectedRows = new Map();
|
|
25
|
+
this.debouncedChangeSelection = debounce(async () => {
|
|
26
|
+
var _a;
|
|
27
|
+
const results = Array.from(this.selectedRows.values());
|
|
28
|
+
const toolbar = this.el.querySelector(TABLE_TAG.TOOLBAR);
|
|
29
|
+
await ((_a = toolbar === null || toolbar === void 0 ? void 0 : toolbar.setSelectedItems) === null || _a === void 0 ? void 0 : _a.call(toolbar, this.selectedRows));
|
|
30
|
+
const header = this.el.querySelector(TABLE_TAG.HEADER);
|
|
31
|
+
let partial = false;
|
|
32
|
+
forEach(this.el.querySelectorAll(TABLE_TAG.ROW), (row) => {
|
|
33
|
+
if (!row.hasAttribute('checked'))
|
|
34
|
+
partial = true;
|
|
35
|
+
});
|
|
36
|
+
setAttr(header, 'checked', !!this.selectedRows.size);
|
|
37
|
+
setAttr(header, 'partial', partial);
|
|
38
|
+
this.changeSelection.emit(results);
|
|
39
|
+
}, 150);
|
|
40
|
+
this.handleCheckedChange = async (e) => {
|
|
41
|
+
const { name, checked } = e.detail;
|
|
42
|
+
if (checked) {
|
|
43
|
+
this.selectedRows.set(name, e.detail);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.selectedRows.delete(name);
|
|
47
|
+
}
|
|
48
|
+
this.debouncedChangeSelection();
|
|
49
|
+
};
|
|
50
|
+
this.setRowProps = () => {
|
|
51
|
+
const rows = Array
|
|
52
|
+
.from(this.el.childNodes)
|
|
53
|
+
.filter((node) => node.nodeType === Node.ELEMENT_NODE && ((node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-ROW` ||
|
|
54
|
+
(node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-HEADER-ROW` ||
|
|
55
|
+
(node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-EXPAND`));
|
|
56
|
+
let visualIndex = 0;
|
|
57
|
+
rows.forEach((node, i) => {
|
|
58
|
+
const row = node;
|
|
59
|
+
const isHeaderRow = (node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-HEADER-ROW`;
|
|
60
|
+
if (isHeaderRow)
|
|
61
|
+
return;
|
|
62
|
+
switch (this.colorSchema) {
|
|
63
|
+
case TABLE_COLOR_SCHEMA.ZEBRA:
|
|
64
|
+
const stripe = visualIndex % 2 === 0 ? 'even' : 'odd';
|
|
65
|
+
if (row.hasAttribute('expandable') && rows[i + 1]) {
|
|
66
|
+
row.setAttribute(stripe, '');
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
visualIndex++;
|
|
70
|
+
row.setAttribute(stripe, '');
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
row.removeAttribute('odd');
|
|
75
|
+
row.removeAttribute('even');
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
handleSetColorSchema() {
|
|
81
|
+
this.setRowProps();
|
|
82
|
+
}
|
|
83
|
+
listenSelectableHandle() {
|
|
84
|
+
if (this.selectable) {
|
|
85
|
+
this.el.addEventListener('checkedChange', this.handleCheckedChange);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.el.removeEventListener('checkedChange', this.handleCheckedChange);
|
|
89
|
+
}
|
|
90
|
+
const rows = Array
|
|
91
|
+
.from(this.el.querySelectorAll(`${TABLE_TAG.ROW}, ${TABLE_TAG.HEADER}`))
|
|
92
|
+
.filter((node) => node.nodeType === Node.ELEMENT_NODE && ((node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-ROW` ||
|
|
93
|
+
(node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-HEADER-ROW`));
|
|
94
|
+
rows.forEach((row, i) => {
|
|
95
|
+
const isExists = row.hasAttribute('selection-name');
|
|
96
|
+
if (this.selectable && row.tagName === TABLE_TAG.HEADER && !isExists) {
|
|
97
|
+
return row.setAttribute('selection-name', 'header');
|
|
98
|
+
}
|
|
99
|
+
if (!this.selectable && isExists) {
|
|
100
|
+
return row.removeAttribute('selection-name');
|
|
101
|
+
}
|
|
102
|
+
if (this.selectable && !isExists) {
|
|
103
|
+
row.setAttribute('selection-name', row.getAttribute('name') || `${i}`);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
render() {
|
|
108
|
+
return (h(Host, { key: '9ffbb8ebef0ef99b71bbc76fce633be86d17f9e8', role: "table", size: this.size, selectable: this.selectable }, (this.el.title || this.description) && (h("div", { key: '96ffe17490215156040b472910f04f36c96d7808', class: "caption" }, this.el.title && h("h5", { key: '2760ff5ac6073315238736dbe9b55f0546b0886a', class: "caption_title" }, this.el.title), this.description && h("p", { key: '7e335e60883615bbe5af66394686944673644f4f', class: "caption_description" }, this.description))), h("slot", { key: 'b28fe0ffe51ea20464b8114830127023e1ccca47', name: "header" }), h("slot", { key: 'd8dcbbe05dadda66b20b4c56adcbb08dfbe7c0db' })));
|
|
109
|
+
}
|
|
110
|
+
componentWillLoad() {
|
|
111
|
+
this.setRowProps();
|
|
112
|
+
this.listenSelectableHandle();
|
|
113
|
+
}
|
|
114
|
+
disconnectedCallback() {
|
|
115
|
+
this.el.removeEventListener('checkedChange', this.handleCheckedChange);
|
|
116
|
+
}
|
|
117
|
+
static get is() { return "xv-table-v2"; }
|
|
118
|
+
static get encapsulation() { return "shadow"; }
|
|
119
|
+
static get originalStyleUrls() {
|
|
120
|
+
return {
|
|
121
|
+
"$": ["xv-table.scss"]
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
static get styleUrls() {
|
|
125
|
+
return {
|
|
126
|
+
"$": ["xv-table.css"]
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
static get properties() {
|
|
130
|
+
return {
|
|
131
|
+
"description": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "Table caption description"
|
|
144
|
+
},
|
|
145
|
+
"getter": false,
|
|
146
|
+
"setter": false,
|
|
147
|
+
"attribute": "description",
|
|
148
|
+
"reflect": false
|
|
149
|
+
},
|
|
150
|
+
"colorSchema": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"mutable": false,
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "TABLE_COLOR_SCHEMA",
|
|
155
|
+
"resolved": "TABLE_COLOR_SCHEMA.DEF | TABLE_COLOR_SCHEMA.ZEBRA",
|
|
156
|
+
"references": {
|
|
157
|
+
"TABLE_COLOR_SCHEMA": {
|
|
158
|
+
"location": "import",
|
|
159
|
+
"path": "./defs",
|
|
160
|
+
"id": "src/components/xv-table/defs.ts::TABLE_COLOR_SCHEMA"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": "Set current color schema type of enum TABLE_COLOR_SCHEMA\nPossible options 'zebra'"
|
|
169
|
+
},
|
|
170
|
+
"getter": false,
|
|
171
|
+
"setter": false,
|
|
172
|
+
"attribute": "color-schema",
|
|
173
|
+
"reflect": false,
|
|
174
|
+
"defaultValue": "TABLE_COLOR_SCHEMA.DEF"
|
|
175
|
+
},
|
|
176
|
+
"expandable": {
|
|
177
|
+
"type": "boolean",
|
|
178
|
+
"mutable": false,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "boolean",
|
|
181
|
+
"resolved": "boolean",
|
|
182
|
+
"references": {}
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"optional": false,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [],
|
|
188
|
+
"text": "If table is expandable fields"
|
|
189
|
+
},
|
|
190
|
+
"getter": false,
|
|
191
|
+
"setter": false,
|
|
192
|
+
"attribute": "expandable",
|
|
193
|
+
"reflect": true,
|
|
194
|
+
"defaultValue": "false"
|
|
195
|
+
},
|
|
196
|
+
"size": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"mutable": false,
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "TABLE_SIZE",
|
|
201
|
+
"resolved": "TABLE_SIZE.EXTRA_LARGE | TABLE_SIZE.EXTRA_SMALL | TABLE_SIZE.LARGE | TABLE_SIZE.MEDIUM | TABLE_SIZE.SMALL",
|
|
202
|
+
"references": {
|
|
203
|
+
"TABLE_SIZE": {
|
|
204
|
+
"location": "import",
|
|
205
|
+
"path": "./defs",
|
|
206
|
+
"id": "src/components/xv-table/defs.ts::TABLE_SIZE"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"required": false,
|
|
211
|
+
"optional": false,
|
|
212
|
+
"docs": {
|
|
213
|
+
"tags": [],
|
|
214
|
+
"text": "Table size\nenum TABLE_SIZE"
|
|
215
|
+
},
|
|
216
|
+
"getter": false,
|
|
217
|
+
"setter": false,
|
|
218
|
+
"attribute": "size",
|
|
219
|
+
"reflect": false,
|
|
220
|
+
"defaultValue": "TABLE_SIZE.MEDIUM"
|
|
221
|
+
},
|
|
222
|
+
"selectable": {
|
|
223
|
+
"type": "boolean",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "boolean",
|
|
227
|
+
"resolved": "boolean",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": false,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": "Add checkbox selection to the table"
|
|
235
|
+
},
|
|
236
|
+
"getter": false,
|
|
237
|
+
"setter": false,
|
|
238
|
+
"attribute": "selectable",
|
|
239
|
+
"reflect": false,
|
|
240
|
+
"defaultValue": "false"
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
static get states() {
|
|
245
|
+
return {
|
|
246
|
+
"selectedRows": {}
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
static get events() {
|
|
250
|
+
return [{
|
|
251
|
+
"method": "changeSelection",
|
|
252
|
+
"name": "changeSelection",
|
|
253
|
+
"bubbles": true,
|
|
254
|
+
"cancelable": true,
|
|
255
|
+
"composed": true,
|
|
256
|
+
"docs": {
|
|
257
|
+
"tags": [],
|
|
258
|
+
"text": ""
|
|
259
|
+
},
|
|
260
|
+
"complexType": {
|
|
261
|
+
"original": "TableSelectionEventData[]",
|
|
262
|
+
"resolved": "TableSelectionEventData[]",
|
|
263
|
+
"references": {
|
|
264
|
+
"TableSelectionEventData": {
|
|
265
|
+
"location": "import",
|
|
266
|
+
"path": "./defs",
|
|
267
|
+
"id": "src/components/xv-table/defs.ts::TableSelectionEventData"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}];
|
|
272
|
+
}
|
|
273
|
+
static get elementRef() { return "el"; }
|
|
274
|
+
static get watchers() {
|
|
275
|
+
return [{
|
|
276
|
+
"propName": "colorSchema",
|
|
277
|
+
"methodName": "handleSetColorSchema"
|
|
278
|
+
}, {
|
|
279
|
+
"propName": "selectable",
|
|
280
|
+
"methodName": "listenSelectableHandle"
|
|
281
|
+
}];
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=xv-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xv-table.js","sourceRoot":"","sources":["../../../src/components/xv-table/xv-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAgD,MAAM,QAAQ,CAAC;AAEjH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAO/D,MAAM,OAAO,OAAO;IALpB;QAWE;;;WAGG;QACkC,gBAAW,GAAuB,kBAAkB,CAAC,GAAG,CAAC;QAC9F;;WAEG;QACsB,eAAU,GAAY,KAAK,CAAC;QACrD;;;WAGG;QACK,SAAI,GAAe,UAAU,CAAC,MAAM,CAAC;QAC7C;;WAEG;QACK,eAAU,GAAY,KAAK,CAAC;QAE3B,iBAAY,GAA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CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAChC,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,eAAe,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACzE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Element, Prop, Watch, Event, EventEmitter, State } from '@stencil/core';\nimport { TABLE_COLOR_SCHEMA, TABLE_SIZE, TABLE_TAG, TableSelectionEvent, TableSelectionEventData } from './defs';\nimport { XvTableToolbar } from './xv-table-toolbar/xv-table-toolbar';\nimport { debounce, forEach, setAttr } from '../../utils/utils';\n\n@Component({\n tag: 'xv-table-v2',\n styleUrl: 'xv-table.scss',\n shadow: true,\n})\nexport class XvTable {\n @Element() el: HTMLElement;\n /**\n * Table caption description\n */\n @Prop() description: string;\n /**\n * Set current color schema type of enum TABLE_COLOR_SCHEMA\n * Possible options 'zebra'\n */\n @Prop({ attribute: 'color-schema' }) colorSchema: TABLE_COLOR_SCHEMA = TABLE_COLOR_SCHEMA.DEF;\n /**\n * If table is expandable fields\n */\n @Prop({ reflect: true }) expandable: boolean = false;\n /**\n * Table size\n * enum TABLE_SIZE\n */\n @Prop() size: TABLE_SIZE = TABLE_SIZE.MEDIUM;\n /**\n * Add checkbox selection to the table\n */\n @Prop() selectable: boolean = false;\n\n @State() selectedRows = new Map<string, TableSelectionEventData>();\n\n @Event() changeSelection: EventEmitter<TableSelectionEventData[]>;\n\n @Watch('colorSchema')\n handleSetColorSchema() {\n this.setRowProps();\n }\n\n @Watch('selectable')\n listenSelectableHandle() {\n if (this.selectable) {\n this.el.addEventListener('checkedChange', this.handleCheckedChange);\n } else {\n this.el.removeEventListener('checkedChange', this.handleCheckedChange);\n }\n\n const rows = Array\n .from(this.el.querySelectorAll(`${TABLE_TAG.ROW}, ${TABLE_TAG.HEADER}`))\n .filter((node) =>\n node.nodeType === Node.ELEMENT_NODE && (\n (node as any)?.tagName === `${this.el.tagName}-ROW` ||\n (node as any)?.tagName === `${this.el.tagName}-HEADER-ROW`\n )\n );\n\n rows.forEach((row, i) => {\n const isExists = row.hasAttribute('selection-name');\n\n if (this.selectable && row.tagName === TABLE_TAG.HEADER && !isExists) {\n return row.setAttribute('selection-name', 'header');\n }\n\n if (!this.selectable && isExists) {\n return row.removeAttribute('selection-name');\n }\n\n if(this.selectable && !isExists) {\n row.setAttribute('selection-name', row.getAttribute('name') || `${i}`);\n }\n })\n }\n\n private debouncedChangeSelection = debounce(async () => {\n const results = Array.from(this.selectedRows.values());\n const toolbar = this.el.querySelector(TABLE_TAG.TOOLBAR) as unknown as XvTableToolbar;\n await toolbar?.setSelectedItems?.(this.selectedRows);\n const header = this.el.querySelector(TABLE_TAG.HEADER);\n let partial = false;\n\n forEach(this.el.querySelectorAll(TABLE_TAG.ROW), (row) => {\n if (!row.hasAttribute('checked')) partial = true;\n })\n\n setAttr(header, 'checked', !!this.selectedRows.size);\n setAttr(header, 'partial', partial);\n\n this.changeSelection.emit(results);\n }, 150);\n\n private handleCheckedChange = async (e: TableSelectionEvent) => {\n const { name, checked } = e.detail;\n\n if (checked) {\n this.selectedRows.set(name, e.detail);\n } else {\n this.selectedRows.delete(name);\n }\n\n this.debouncedChangeSelection();\n };\n\n private setRowProps = () => {\n const rows = Array\n .from(this.el.childNodes)\n .filter((node) =>\n node.nodeType === Node.ELEMENT_NODE && (\n (node as any)?.tagName === `${this.el.tagName}-ROW` ||\n (node as any)?.tagName === `${this.el.tagName}-HEADER-ROW` ||\n (node as any)?.tagName === `${this.el.tagName}-EXPAND`\n )\n );\n let visualIndex = 0;\n\n rows.forEach((node, i) => {\n const row = (node as HTMLElement);\n const isHeaderRow = (node as any)?.tagName === `${this.el.tagName}-HEADER-ROW`;\n\n if (isHeaderRow) return;\n\n switch (this.colorSchema) {\n case TABLE_COLOR_SCHEMA.ZEBRA:\n const stripe = visualIndex % 2 === 0 ? 'even' : 'odd';\n if (row.hasAttribute('expandable') && rows[i + 1]) {\n row.setAttribute(stripe, '');\n } else {\n visualIndex++;\n row.setAttribute(stripe, '');\n }\n break;\n default:\n row.removeAttribute('odd');\n row.removeAttribute('even');\n }\n });\n }\n\n render() {\n return (\n <Host role=\"table\" size={this.size} selectable={this.selectable}>\n {(this.el.title || this.description) && (\n <div class=\"caption\">\n {this.el.title && <h5 class=\"caption_title\">{this.el.title}</h5>}\n {this.description && <p class=\"caption_description\">{this.description}</p>}\n </div>\n )}\n <slot name=\"header\" />\n <slot></slot>\n </Host>\n );\n }\n\n componentWillLoad() {\n this.setRowProps();\n this.listenSelectableHandle();\n }\n\n disconnectedCallback() {\n this.el.removeEventListener('checkedChange', this.handleCheckedChange);\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var TAB_TAGS;
|
|
2
|
+
(function (TAB_TAGS) {
|
|
3
|
+
TAB_TAGS["TABS"] = "xv-tabs-v2";
|
|
4
|
+
TAB_TAGS["TAB"] = "xv-tab-v2";
|
|
5
|
+
})(TAB_TAGS || (TAB_TAGS = {}));
|
|
6
|
+
export var TABS_VATIANT;
|
|
7
|
+
(function (TABS_VATIANT) {
|
|
8
|
+
TABS_VATIANT["DEFAULT"] = "";
|
|
9
|
+
// other variants will be here
|
|
10
|
+
})(TABS_VATIANT || (TABS_VATIANT = {}));
|
|
11
|
+
//# sourceMappingURL=_vars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_vars.js","sourceRoot":"","sources":["../../../src/components/xv-tabs/_vars.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;AACnB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,4BAAY,CAAA;IACZ,8BAA8B;AAChC,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB","sourcesContent":["export enum TAB_TAGS {\n TABS = 'xv-tabs-v2',\n TAB = 'xv-tab-v2'\n}\n\nexport enum TABS_VATIANT {\n DEFAULT = '',\n // other variants will be here\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class XvTab {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.disabled = false;
|
|
5
|
+
}
|
|
6
|
+
render() {
|
|
7
|
+
return h(Host, { key: 'b3991bf63fb73f2c39670477652dfa5b40630126', disabled: this.disabled }, h("slot", { key: 'a5dd5a983a13e97be7d925de669461226dc296c0' }));
|
|
8
|
+
}
|
|
9
|
+
static get is() { return "xv-tab-v2"; }
|
|
10
|
+
static get encapsulation() { return "shadow"; }
|
|
11
|
+
static get originalStyleUrls() {
|
|
12
|
+
return {
|
|
13
|
+
"$": ["xv-tab.scss"]
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
static get styleUrls() {
|
|
17
|
+
return {
|
|
18
|
+
"$": ["xv-tab.css"]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static get properties() {
|
|
22
|
+
return {
|
|
23
|
+
"label": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"mutable": false,
|
|
26
|
+
"complexType": {
|
|
27
|
+
"original": "string",
|
|
28
|
+
"resolved": "string",
|
|
29
|
+
"references": {}
|
|
30
|
+
},
|
|
31
|
+
"required": false,
|
|
32
|
+
"optional": false,
|
|
33
|
+
"docs": {
|
|
34
|
+
"tags": [],
|
|
35
|
+
"text": ""
|
|
36
|
+
},
|
|
37
|
+
"getter": false,
|
|
38
|
+
"setter": false,
|
|
39
|
+
"attribute": "label",
|
|
40
|
+
"reflect": false
|
|
41
|
+
},
|
|
42
|
+
"disabled": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"mutable": false,
|
|
45
|
+
"complexType": {
|
|
46
|
+
"original": "boolean",
|
|
47
|
+
"resolved": "boolean",
|
|
48
|
+
"references": {}
|
|
49
|
+
},
|
|
50
|
+
"required": false,
|
|
51
|
+
"optional": false,
|
|
52
|
+
"docs": {
|
|
53
|
+
"tags": [],
|
|
54
|
+
"text": ""
|
|
55
|
+
},
|
|
56
|
+
"getter": false,
|
|
57
|
+
"setter": false,
|
|
58
|
+
"attribute": "disabled",
|
|
59
|
+
"reflect": false,
|
|
60
|
+
"defaultValue": "false"
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=xv-tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xv-tab.js","sourceRoot":"","sources":["../../../../src/components/xv-tabs/xv-tab/xv-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,KAAK;IALlB;QAOU,aAAQ,GAAY,KAAK,CAAC;KAKnC;IAHC,MAAM;QACJ,OAAO,EAAC,IAAI,qDAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YAAE,8DAAQ,CAAO,CAAC;IACxD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'xv-tab-v2',\n styleUrl: 'xv-tab.scss',\n shadow: true,\n})\nexport class XvTab {\n @Prop() label: string;\n @Prop() disabled: boolean = false;\n\n render() {\n return <Host disabled={this.disabled}><slot /></Host>;\n }\n}\n"]}
|