xv-webcomponents 0.1.31 → 0.1.35
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-5ee1b884.js → index-2705073a.js} +5 -2
- package/dist/cjs/index-2705073a.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xv-accordion-v2_26.cjs.entry.js +126 -46
- package/dist/cjs/xv-accordion-v2_26.cjs.entry.js.map +1 -1
- package/dist/cjs/xv-breadcrumbs-v2.cjs.entry.js +1 -1
- package/dist/cjs/xv-webcomponents.cjs.js +2 -2
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js +1 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.js +41 -10
- package/dist/collection/components/xv-dropdown/xv-dropdown.js.map +1 -1
- package/dist/collection/components/xv-footer/xv-footer.js +1 -1
- package/dist/collection/components/xv-header/xv-header.js +1 -1
- package/dist/collection/components/xv-link/xv-link.css +5 -0
- package/dist/collection/components/xv-link/xv-link.js +3 -3
- package/dist/collection/components/xv-link/xv-link.js.map +1 -1
- package/dist/collection/components/xv-modal/xv-modal.css +3 -0
- package/dist/collection/components/xv-modal/xv-modal.js +31 -7
- package/dist/collection/components/xv-modal/xv-modal.js.map +1 -1
- package/dist/collection/components/xv-notification/xv-notification.js +3 -3
- package/dist/collection/components/xv-notification/xv-notification.js.map +1 -1
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js +1 -1
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.css +3 -0
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +1 -1
- package/dist/collection/components/xv-table/_vars.js.map +1 -1
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.css +10 -3
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +10 -10
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js.map +1 -1
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +1 -1
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.css +8 -1
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +33 -2
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js.map +1 -1
- package/dist/collection/components/xv-table/xv-table.css +29 -0
- package/dist/collection/components/xv-table/xv-table.js +30 -4
- package/dist/collection/components/xv-table/xv-table.js.map +1 -1
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.css +7 -0
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +42 -1
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js.map +1 -1
- package/dist/collection/components/xv-tabs/xv-tabs.css +67 -9
- package/dist/collection/components/xv-tabs/xv-tabs.js +109 -17
- package/dist/collection/components/xv-tabs/xv-tabs.js.map +1 -1
- package/dist/collection/components/xv-tag/xv-tag.js +1 -1
- package/dist/collection/components/xv-text-input/xv-text-input.css +1 -0
- package/dist/collection/components/xv-text-input/xv-text-input.js +44 -1
- package/dist/collection/components/xv-text-input/xv-text-input.js.map +1 -1
- package/dist/collection/components/xv-tooltip/xv-tooltip.css +6 -1
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +22 -3
- package/dist/collection/components/xv-tooltip/xv-tooltip.js.map +1 -1
- package/dist/esm/{index-590eb7d2.js → index-a650cb06.js} +5 -2
- package/dist/esm/index-a650cb06.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xv-accordion-v2_26.entry.js +126 -46
- package/dist/esm/xv-accordion-v2_26.entry.js.map +1 -1
- package/dist/esm/xv-breadcrumbs-v2.entry.js +1 -1
- package/dist/esm/xv-webcomponents.js +3 -3
- package/dist/types/components/xv-dropdown/xv-dropdown.d.ts +2 -0
- package/dist/types/components/xv-link/xv-link.d.ts +1 -1
- package/dist/types/components/xv-modal/xv-modal.d.ts +5 -1
- package/dist/types/components/xv-table/_vars.d.ts +4 -0
- package/dist/types/components/xv-table/xv-table-cell/xv-table-cell.d.ts +3 -6
- package/dist/types/components/xv-table/xv-table-row/xv-table-row.d.ts +1 -0
- package/dist/types/components/xv-table/xv-table.d.ts +2 -1
- package/dist/types/components/xv-tabs/xv-tab/xv-tab.d.ts +2 -0
- package/dist/types/components/xv-tabs/xv-tabs.d.ts +18 -4
- package/dist/types/components/xv-text-input/xv-text-input.d.ts +3 -0
- package/dist/types/components/xv-tooltip/xv-tooltip.d.ts +1 -0
- package/dist/types/components.d.ts +76 -14
- package/dist/xv-webcomponents/p-497959a9.js +3 -0
- package/dist/xv-webcomponents/p-497959a9.js.map +1 -0
- package/dist/xv-webcomponents/p-e1b76c23.entry.js +2 -0
- package/dist/xv-webcomponents/p-e1b76c23.entry.js.map +1 -0
- package/dist/xv-webcomponents/{p-c09a0bfe.entry.js → p-ea853c5c.entry.js} +2 -2
- 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-5ee1b884.js.map +0 -1
- package/dist/esm/index-590eb7d2.js.map +0 -1
- package/dist/xv-webcomponents/p-612356e6.js +0 -3
- package/dist/xv-webcomponents/p-612356e6.js.map +0 -1
- package/dist/xv-webcomponents/p-e750290d.entry.js +0 -2
- package/dist/xv-webcomponents/p-e750290d.entry.js.map +0 -1
- /package/dist/xv-webcomponents/{p-c09a0bfe.entry.js.map → p-ea853c5c.entry.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { TAB_TAGS, TABS_VATIANT } from "./_vars";
|
|
3
|
+
import { SIZE_VAR } from "../../types/enum";
|
|
3
4
|
export class XvTabs {
|
|
4
5
|
constructor() {
|
|
5
6
|
/**
|
|
@@ -14,28 +15,71 @@ export class XvTabs {
|
|
|
14
15
|
* local variable for tab labels collection
|
|
15
16
|
*/
|
|
16
17
|
this.tabElements = [];
|
|
18
|
+
/**
|
|
19
|
+
* Is show arrows for scroll
|
|
20
|
+
*/
|
|
21
|
+
this.showArrows = false;
|
|
17
22
|
this.collectTabs = () => {
|
|
18
23
|
if (!this.tabElements.length) {
|
|
19
24
|
this.tabElements = Array.from(this.el.querySelectorAll(TAB_TAGS.TAB));
|
|
25
|
+
this.tabElements.forEach((tab) => {
|
|
26
|
+
if (tab.hasAttribute('name') && !this.active) {
|
|
27
|
+
this.active = tab.getAttribute('name');
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
setTimeout(() => this.updateArrowVisibility(), 100);
|
|
20
31
|
}
|
|
21
32
|
};
|
|
22
33
|
}
|
|
34
|
+
updateArrowVisibility() {
|
|
35
|
+
var _a;
|
|
36
|
+
const container = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.tab-headers_container');
|
|
37
|
+
if (!container)
|
|
38
|
+
return;
|
|
39
|
+
this.showArrows = container.scrollWidth > container.clientWidth;
|
|
40
|
+
}
|
|
23
41
|
updateTabClasses() {
|
|
24
42
|
this.tabElements.forEach((tab, i) => {
|
|
25
|
-
tab.classList.toggle('active', i === this.active);
|
|
43
|
+
tab.classList.toggle('active', (tab.getAttribute('name') || `${i}`) === `${this.active}`);
|
|
26
44
|
});
|
|
27
45
|
}
|
|
28
|
-
handleTabClick(
|
|
29
|
-
if (
|
|
46
|
+
handleTabClick(active) {
|
|
47
|
+
if (active === this.active)
|
|
30
48
|
return;
|
|
31
|
-
this.active =
|
|
32
|
-
this.
|
|
49
|
+
this.active = active;
|
|
50
|
+
this.activeChange.emit(Number(this.active) || this.active);
|
|
51
|
+
this.scrollToActiveTab();
|
|
33
52
|
}
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
scrollToActiveTab() {
|
|
54
|
+
if (!this.showArrows)
|
|
55
|
+
return;
|
|
56
|
+
// wait next JS tik
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
this.el.shadowRoot
|
|
59
|
+
.querySelector('.tab-headers_tab.active')
|
|
60
|
+
.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' });
|
|
61
|
+
});
|
|
36
62
|
}
|
|
37
|
-
|
|
38
|
-
|
|
63
|
+
setTab(count = 1) {
|
|
64
|
+
const currentIdx = this.tabElements.findIndex((tab, i) => (tab.getAttribute('name') || `${i}`) === `${this.active}`);
|
|
65
|
+
const nextIdx = currentIdx + count;
|
|
66
|
+
if (nextIdx < 0 || nextIdx >= this.tabElements.length)
|
|
67
|
+
return;
|
|
68
|
+
const nextTab = this.tabElements[nextIdx];
|
|
69
|
+
if (!nextTab || nextTab.hasAttribute('disabled'))
|
|
70
|
+
return;
|
|
71
|
+
this.active = nextTab.getAttribute('name') || `${nextIdx}`;
|
|
72
|
+
this.scrollToActiveTab();
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
var _a, _b, _c;
|
|
76
|
+
if (this.loading) {
|
|
77
|
+
return (h(Host, { class: "xv-tabs", variant: this.variant }, h("xv-loader-v2", { size: SIZE_VAR.XL })));
|
|
78
|
+
}
|
|
79
|
+
return (h(Host, { class: "xv-tabs", variant: this.variant }, h("div", { class: "tab-headers", role: "tablist" }, h("button", { hidden: !this.showArrows || !((_a = this.tabElements) === null || _a === void 0 ? void 0 : _a.length), "aria-label": "Previous", class: "tab-headers_btn prev", onClick: () => this.setTab(-1) }), h("div", { class: "tab-headers_container" }, ((_b = this.tabElements) === null || _b === void 0 ? void 0 : _b.length) ? this.tabElements.map((tab, index) => (h("button", { role: "tab", disabled: !!tab.getAttribute('disabled') || !!(tab === null || tab === void 0 ? void 0 : tab.disabled), class: {
|
|
80
|
+
'tab-headers_tab': true,
|
|
81
|
+
active: (tab.getAttribute('name') || `${index}`) === `${this.active}`,
|
|
82
|
+
}, onClick: () => this.handleTabClick(tab.getAttribute('name') || `${index}`) }, tab.getAttribute('label') || `Tab ${index + 1}`))) : this.emptyMessage && h("p", { class: "xv-tabs_empty" }, this.emptyMessage)), h("button", { "aria-label": "Next", hidden: !this.showArrows || !((_c = this.tabElements) === null || _c === void 0 ? void 0 : _c.length), class: "tab-headers_btn next", onClick: () => this.setTab(1) })), h("div", { class: "tab-content-wrapper", role: "tabpanel", tabindex: -1 }, h("slot", { onSlotchange: this.collectTabs }))));
|
|
39
83
|
}
|
|
40
84
|
componentDidRender() {
|
|
41
85
|
this.updateTabClasses();
|
|
@@ -55,11 +99,11 @@ export class XvTabs {
|
|
|
55
99
|
static get properties() {
|
|
56
100
|
return {
|
|
57
101
|
"active": {
|
|
58
|
-
"type": "
|
|
102
|
+
"type": "any",
|
|
59
103
|
"mutable": true,
|
|
60
104
|
"complexType": {
|
|
61
|
-
"original": "number",
|
|
62
|
-
"resolved": "number",
|
|
105
|
+
"original": "number | string",
|
|
106
|
+
"resolved": "number | string",
|
|
63
107
|
"references": {}
|
|
64
108
|
},
|
|
65
109
|
"required": false,
|
|
@@ -74,6 +118,25 @@ export class XvTabs {
|
|
|
74
118
|
"reflect": true,
|
|
75
119
|
"defaultValue": "0"
|
|
76
120
|
},
|
|
121
|
+
"loading": {
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"mutable": false,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "boolean",
|
|
126
|
+
"resolved": "boolean",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": true,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Show loader"
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false,
|
|
137
|
+
"attribute": "loading",
|
|
138
|
+
"reflect": true
|
|
139
|
+
},
|
|
77
140
|
"variant": {
|
|
78
141
|
"type": "string",
|
|
79
142
|
"mutable": false,
|
|
@@ -99,18 +162,38 @@ export class XvTabs {
|
|
|
99
162
|
"attribute": "variant",
|
|
100
163
|
"reflect": false,
|
|
101
164
|
"defaultValue": "TABS_VATIANT.DEFAULT"
|
|
165
|
+
},
|
|
166
|
+
"emptyMessage": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "string",
|
|
171
|
+
"resolved": "string",
|
|
172
|
+
"references": {}
|
|
173
|
+
},
|
|
174
|
+
"required": false,
|
|
175
|
+
"optional": true,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": "Message when have no tabs"
|
|
179
|
+
},
|
|
180
|
+
"getter": false,
|
|
181
|
+
"setter": false,
|
|
182
|
+
"attribute": "empty-message",
|
|
183
|
+
"reflect": false
|
|
102
184
|
}
|
|
103
185
|
};
|
|
104
186
|
}
|
|
105
187
|
static get states() {
|
|
106
188
|
return {
|
|
107
|
-
"tabElements": {}
|
|
189
|
+
"tabElements": {},
|
|
190
|
+
"showArrows": {}
|
|
108
191
|
};
|
|
109
192
|
}
|
|
110
193
|
static get events() {
|
|
111
194
|
return [{
|
|
112
|
-
"method": "
|
|
113
|
-
"name": "
|
|
195
|
+
"method": "activeChange",
|
|
196
|
+
"name": "activeChange",
|
|
114
197
|
"bubbles": true,
|
|
115
198
|
"cancelable": true,
|
|
116
199
|
"composed": true,
|
|
@@ -119,12 +202,21 @@ export class XvTabs {
|
|
|
119
202
|
"text": "Emit event to outside"
|
|
120
203
|
},
|
|
121
204
|
"complexType": {
|
|
122
|
-
"original": "number",
|
|
123
|
-
"resolved": "number",
|
|
205
|
+
"original": "number | string",
|
|
206
|
+
"resolved": "number | string",
|
|
124
207
|
"references": {}
|
|
125
208
|
}
|
|
126
209
|
}];
|
|
127
210
|
}
|
|
128
211
|
static get elementRef() { return "el"; }
|
|
212
|
+
static get listeners() {
|
|
213
|
+
return [{
|
|
214
|
+
"name": "resize",
|
|
215
|
+
"method": "updateArrowVisibility",
|
|
216
|
+
"target": "window",
|
|
217
|
+
"capture": false,
|
|
218
|
+
"passive": true
|
|
219
|
+
}];
|
|
220
|
+
}
|
|
129
221
|
}
|
|
130
222
|
//# sourceMappingURL=xv-tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xv-tabs.js","sourceRoot":"","sources":["../../../src/components/xv-tabs/xv-tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"xv-tabs.js","sourceRoot":"","sources":["../../../src/components/xv-tabs/xv-tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAO5C,MAAM,OAAO,MAAM;IALnB;QAOE;;WAEG;QACqC,WAAM,GAAoB,CAAC,CAAC;QASpE;;WAEG;QACK,YAAO,GAAiB,YAAY,CAAC,OAAO,CAAC;QAKrD;;WAEG;QACM,gBAAW,GAAkB,EAAE,CAAC;QACzC;;WAEG;QACM,eAAU,GAAY,KAAK,CAAC;QAU7B,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;gBAC7B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;gBACtE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;oBAC/B,IAAI,GAAG,CAAC,YAAY,CAAC,MA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WAAW,0CAAE,MAAM,CAAA,EACrD,KAAK,EAAC,sBAAsB,EAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAC7B,CACE;YAEN,WACE,KAAK,EAAC,qBAAqB,EAC3B,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,CAAC,CAAC;gBAEZ,YAAM,YAAY,EAAE,IAAI,CAAC,WAAW,GAAI,CACpC,CACD,CACR,CAAC;IACJ,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Element, Prop, Event, EventEmitter, State, Listen } from '@stencil/core';\nimport { TAB_TAGS, TABS_VATIANT } from './_vars';\nimport { SIZE_VAR } from '../../types/enum';\n\n@Component({\n tag: 'xv-tabs-v2',\n styleUrl: 'xv-tabs.scss',\n shadow: true,\n})\nexport class XvTabs {\n @Element() el: HTMLElement;\n /**\n * Index of active tab\n */\n @Prop({ reflect: true, mutable: true }) active: number | string = 0;\n /**\n * Emit event to outside\n */\n @Event() activeChange: EventEmitter<number | string>;\n /**\n * Show loader\n */\n @Prop({ reflect: true }) loading?: boolean;\n /**\n * Variant of tabs from TABS_VATIANT enum\n */\n @Prop() variant: TABS_VATIANT = TABS_VATIANT.DEFAULT;\n /**\n * Message when have no tabs\n */\n @Prop() emptyMessage?: string;\n /**\n * local variable for tab labels collection\n */\n @State() tabElements: HTMLElement[] = [];\n /**\n * Is show arrows for scroll\n */\n @State() showArrows: boolean = false;\n\n @Listen('resize', { target: 'window' })\n updateArrowVisibility() {\n const container = this.el.shadowRoot?.querySelector('.tab-headers_container') as HTMLElement | null;\n if (!container) return;\n\n this.showArrows = container.scrollWidth > container.clientWidth;\n }\n\n private collectTabs = () => {\n if (!this.tabElements.length) {\n this.tabElements = Array.from(this.el.querySelectorAll(TAB_TAGS.TAB));\n this.tabElements.forEach((tab) => {\n if (tab.hasAttribute('name') && !this.active) {\n this.active = tab.getAttribute('name');\n }\n })\n\n setTimeout(() => this.updateArrowVisibility(), 100);\n }\n }\n\n private updateTabClasses() {\n this.tabElements.forEach((tab, i) => {\n tab.classList.toggle(\n 'active',\n (tab.getAttribute('name') || `${i}`) === `${this.active}`\n );\n });\n }\n\n private handleTabClick(active: string | number) {\n if (active === this.active) return;\n\n this.active = active;\n this.activeChange.emit(Number(this.active) || this.active);\n this.scrollToActiveTab();\n }\n\n private scrollToActiveTab() {\n if (!this.showArrows) return;\n\n // wait next JS tik\n setTimeout(() => {\n this.el.shadowRoot\n .querySelector('.tab-headers_tab.active')\n .scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' });\n });\n }\n\n private setTab(count: number = 1) {\n const currentIdx = this.tabElements.findIndex(\n (tab, i) =>\n (tab.getAttribute('name') || `${i}`) === `${this.active}`\n );\n const nextIdx = currentIdx + count;\n\n if (nextIdx < 0 || nextIdx >= this.tabElements.length) return;\n\n const nextTab = this.tabElements[nextIdx];\n\n if (!nextTab || nextTab.hasAttribute('disabled')) return;\n\n this.active = nextTab.getAttribute('name') || `${nextIdx}`;\n this.scrollToActiveTab();\n }\n\n render() {\n if (this.loading) {\n return (\n <Host class=\"xv-tabs\" variant={this.variant}>\n <xv-loader-v2 size={SIZE_VAR.XL} />\n </Host>\n )\n }\n\n return (\n <Host class=\"xv-tabs\" variant={this.variant}>\n <div class=\"tab-headers\" role=\"tablist\">\n <button\n hidden={!this.showArrows || !this.tabElements?.length}\n aria-label=\"Previous\"\n class=\"tab-headers_btn prev\"\n onClick={() => this.setTab(-1)}\n />\n <div class=\"tab-headers_container\">\n {this.tabElements?.length ? this.tabElements.map((tab, index) => (\n <button\n role=\"tab\"\n disabled={!!tab.getAttribute('disabled') || !!(tab as any)?.disabled}\n class={{\n 'tab-headers_tab': true,\n active: (tab.getAttribute('name') || `${index}`) === `${this.active}`,\n }}\n onClick={() => this.handleTabClick(tab.getAttribute('name') || `${index}`)}\n >\n {tab.getAttribute('label') || `Tab ${index + 1}`}\n </button>\n )) : this.emptyMessage && <p class=\"xv-tabs_empty\">{this.emptyMessage}</p>}\n </div>\n <button\n aria-label=\"Next\"\n hidden={!this.showArrows || !this.tabElements?.length}\n class=\"tab-headers_btn next\"\n onClick={() => this.setTab(1)}\n />\n </div>\n\n <div\n class=\"tab-content-wrapper\"\n role=\"tabpanel\"\n tabindex={-1}\n >\n <slot onSlotchange={this.collectTabs} />\n </div>\n </Host>\n );\n }\n\n componentDidRender() {\n this.updateTabClasses();\n }\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export class XvTag {
|
|
|
13
13
|
this.closeClick.emit(e);
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: '5b1a43a20c89355aae7830dab1b41381a6aa9ab3', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, h("div", { key: '1a7bcdadd14cdc34703916ad390ed2f3f2a57f7a', class: "xv-tag_content" }, h("slot", { key: 'a12fa11b3659c140bc5b3e6b455aaec87a5f33e1' })), this.closeable && (h("button", { key: 'df1b2ac0a97b5d10304c9f829f7dd7bdc2026bb9', onClick: this.closeHandler.bind(this), class: "xv-tag_close" }))));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "xv-tag-v2"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -14,12 +14,17 @@ export class XvTextInput {
|
|
|
14
14
|
this.value = '';
|
|
15
15
|
this.disabled = false;
|
|
16
16
|
this.readonly = false;
|
|
17
|
+
this.loading = false;
|
|
17
18
|
this.handleInput = (e) => {
|
|
18
19
|
const target = e.target;
|
|
19
20
|
this.value = target.value;
|
|
21
|
+
this.valueChange.emit(this.value);
|
|
20
22
|
this.internals.setFormValue(target.value);
|
|
21
23
|
};
|
|
22
24
|
this.getControlIcon = (status) => {
|
|
25
|
+
if (this.loading) {
|
|
26
|
+
return h("xv-loader-v2", { class: "control_icon", size: SIZE_VAR.XS });
|
|
27
|
+
}
|
|
23
28
|
switch (status) {
|
|
24
29
|
case TextInputStatus.ERROR: {
|
|
25
30
|
return (h("svg", { class: "control_icon error", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { fill: "currentColor", d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })));
|
|
@@ -31,7 +36,7 @@ export class XvTextInput {
|
|
|
31
36
|
};
|
|
32
37
|
}
|
|
33
38
|
render() {
|
|
34
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: 'b03e76ad22fa85e05d9dc9fe08f41bd5bbfbeb68', name: this.name, class: "xv-text-input", role: "textbox", tabindex: this.disabled ? -1 : false }, this.label && h("label", { key: 'de7b44ff18e443237b956548d3b0ff6451311aa4', class: "label" }, this.label), h("div", { key: 'fbd59313f8ed10b325c8c821508f1a1a33f1bd14', class: "control" }, h("input", { key: '03bd2b4b50a0df3d2d7251f1a767941409a05ae6', type: "text", class: { withIcon: this.status !== TextInputStatus.DEF }, readonly: this.readonly, value: this.value, disabled: this.disabled, onInput: this.handleInput, placeholder: this.placeholder }), this.getControlIcon(this.status)), this.helper && h("p", { key: '621688137e647269a82f6c8e23017a435d7cf785', class: "helper" }, this.helper)));
|
|
35
40
|
}
|
|
36
41
|
componentWillLoad() {
|
|
37
42
|
this.internals.setFormValue(this.value);
|
|
@@ -239,9 +244,47 @@ export class XvTextInput {
|
|
|
239
244
|
"attribute": "readonly",
|
|
240
245
|
"reflect": true,
|
|
241
246
|
"defaultValue": "false"
|
|
247
|
+
},
|
|
248
|
+
"loading": {
|
|
249
|
+
"type": "boolean",
|
|
250
|
+
"mutable": false,
|
|
251
|
+
"complexType": {
|
|
252
|
+
"original": "boolean",
|
|
253
|
+
"resolved": "boolean",
|
|
254
|
+
"references": {}
|
|
255
|
+
},
|
|
256
|
+
"required": false,
|
|
257
|
+
"optional": false,
|
|
258
|
+
"docs": {
|
|
259
|
+
"tags": [],
|
|
260
|
+
"text": ""
|
|
261
|
+
},
|
|
262
|
+
"getter": false,
|
|
263
|
+
"setter": false,
|
|
264
|
+
"attribute": "loading",
|
|
265
|
+
"reflect": true,
|
|
266
|
+
"defaultValue": "false"
|
|
242
267
|
}
|
|
243
268
|
};
|
|
244
269
|
}
|
|
270
|
+
static get events() {
|
|
271
|
+
return [{
|
|
272
|
+
"method": "valueChange",
|
|
273
|
+
"name": "valueChange",
|
|
274
|
+
"bubbles": true,
|
|
275
|
+
"cancelable": true,
|
|
276
|
+
"composed": true,
|
|
277
|
+
"docs": {
|
|
278
|
+
"tags": [],
|
|
279
|
+
"text": ""
|
|
280
|
+
},
|
|
281
|
+
"complexType": {
|
|
282
|
+
"original": "string",
|
|
283
|
+
"resolved": "string",
|
|
284
|
+
"references": {}
|
|
285
|
+
}
|
|
286
|
+
}];
|
|
287
|
+
}
|
|
245
288
|
static get elementRef() { return "el"; }
|
|
246
289
|
static get attachInternalsMemberName() { return "internals"; }
|
|
247
290
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xv-text-input.js","sourceRoot":"","sources":["../../../src/components/xv-text-input/xv-text-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"xv-text-input.js","sourceRoot":"","sources":["../../../src/components/xv-text-input/xv-text-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,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,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBF","sourcesContent":["import { AttachInternals, Component, h, Host, Element, Prop, Event, EventEmitter } from '@stencil/core';\nimport { SIZE_VAR } from '../../types/enum';\nimport { TextInputStatus } from './_vars';\n\n/**\n * xv-text-input — custom input\n * ti get data you can use default Input event\n * Angular - (input), React - (onInput), Pure - addEventListener('input', e => ...)\n */\n@Component({\n tag: 'xv-text-input-v2',\n styleUrl: 'xv-text-input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class XvTextInput {\n @Element() el: HTMLElement;\n @Prop({ reflect: true }) label?: string;\n @Prop({ reflect: true }) placeholder?: string;\n @Prop({ reflect: true }) helper: string = '';\n @Prop({ reflect: true }) name?: string;\n @Prop({ reflect: true }) size: SIZE_VAR = SIZE_VAR.MD;\n @Prop({ reflect: true }) status: TextInputStatus = TextInputStatus.DEF;\n @Prop({ reflect: true, mutable: true }) value: string = '';\n @Event({ eventName: 'valueChange' }) valueChange: EventEmitter<string>;\n @Prop({ reflect: true }) disabled: boolean = false;\n @Prop({ reflect: true }) readonly: boolean = false;\n @Prop({ reflect: true }) loading: boolean = false;\n\n @AttachInternals() internals: ElementInternals;\n\n private handleInput = (e: InputEvent) => {\n const target = e.target as HTMLInputElement;\n this.value = target.value;\n this.valueChange.emit(this.value);\n this.internals.setFormValue(target.value);\n }\n\n render() {\n return (\n <Host name={this.name} class=\"xv-text-input\" role=\"textbox\" tabindex={this.disabled ? -1 : false}>\n {this.label && <label class=\"label\">{this.label}</label>}\n\n <div class=\"control\">\n <input\n type=\"text\"\n class={{ withIcon: this.status !== TextInputStatus.DEF }}\n readonly={this.readonly}\n value={this.value}\n disabled={this.disabled}\n onInput={this.handleInput}\n placeholder={this.placeholder}\n />\n\n {this.getControlIcon(this.status)}\n </div>\n\n {this.helper && <p class=\"helper\">{this.helper}</p>}\n </Host>\n );\n }\n\n componentWillLoad() {\n this.internals.setFormValue(this.value);\n }\n\n private getControlIcon = (status: TextInputStatus) => {\n if (this.loading) {\n return <xv-loader-v2 class=\"control_icon\" size={SIZE_VAR.XS} />\n }\n switch (status) {\n case TextInputStatus.ERROR: {\n return (\n <svg class=\"control_icon error\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\" />\n </svg>\n )\n }\n case TextInputStatus.WARNING:\n return (\n <svg class=\"control_icon warning\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\" />\n </svg>\n )\n default: return null;\n }\n };\n}\n"]}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
position: absolute;
|
|
12
12
|
opacity: 0;
|
|
13
13
|
visibility: hidden;
|
|
14
|
-
transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
|
|
14
|
+
transition: opacity 0.2s ease-in-out 0.5s, transform 0.2s ease-in-out 0.5s;
|
|
15
15
|
z-index: 10;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
letter-spacing: 0.16px;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
:host([multiline])::before {
|
|
37
|
+
white-space: normal;
|
|
38
|
+
min-width: 300px;
|
|
39
|
+
}
|
|
40
|
+
|
|
36
41
|
/* Arrow */
|
|
37
42
|
:host::after {
|
|
38
43
|
content: "";
|
|
@@ -9,7 +9,7 @@ export class XvTooltip {
|
|
|
9
9
|
this.position = 'top';
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: 'fa18866398003754364b653f1f90d1a44ed8151d', tooltip: this.message, class: `xv-tooltip_${this.position}` }, h("slot", { key: '428a412b62a1503794eefad29707fe540095b3d8' }, h("svg", { key: '88cb8ddc29c07022493eaf04344e508c049f24e5', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: 16, height: 16 }, h("path", { key: '7cf29bc6c74b0cdc7613b2bf6e5aa6b851ad2aeb', fill: "currentColor", d: "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-88c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 64-24 0zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z" })))));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "xv-tooltip-v2"; }
|
|
15
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -42,7 +42,7 @@ export class XvTooltip {
|
|
|
42
42
|
"getter": false,
|
|
43
43
|
"setter": false,
|
|
44
44
|
"attribute": "message",
|
|
45
|
-
"reflect":
|
|
45
|
+
"reflect": true
|
|
46
46
|
},
|
|
47
47
|
"position": {
|
|
48
48
|
"type": "string",
|
|
@@ -61,8 +61,27 @@ export class XvTooltip {
|
|
|
61
61
|
"getter": false,
|
|
62
62
|
"setter": false,
|
|
63
63
|
"attribute": "position",
|
|
64
|
-
"reflect":
|
|
64
|
+
"reflect": true,
|
|
65
65
|
"defaultValue": "'top'"
|
|
66
|
+
},
|
|
67
|
+
"multiline": {
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "boolean",
|
|
72
|
+
"resolved": "boolean",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": false,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": ""
|
|
80
|
+
},
|
|
81
|
+
"getter": false,
|
|
82
|
+
"setter": false,
|
|
83
|
+
"attribute": "multiline",
|
|
84
|
+
"reflect": true
|
|
66
85
|
}
|
|
67
86
|
};
|
|
68
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xv-tooltip.js","sourceRoot":"","sources":["../../../src/components/xv-tooltip/xv-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,SAAS;IALtB;QAQE;;;;WAIG;
|
|
1
|
+
{"version":3,"file":"xv-tooltip.js","sourceRoot":"","sources":["../../../src/components/xv-tooltip/xv-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,SAAS;IALtB;QAQE;;;;WAIG;QACsB,aAAQ,GAAoG,KAAK,CAAC;KAiB5I;IAdC,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,cAAc,IAAI,CAAC,QAAQ,EAAE;YAC/D;gBACE,4DAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,aAAa,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;oBACjF,6DACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,yTAAyT,GAC3T,CACE,CACD,CACF,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'xv-tooltip-v2',\n styleUrl: 'xv-tooltip.scss',\n shadow: true,\n})\nexport class XvTooltip {\n /** Message what will be shown for tooltip **/\n @Prop({ reflect: true }) message: string;\n /**\n * Tooltip and arrow position related to element\n * possible options: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right'.\n * By default, \"top\"\n */\n @Prop({ reflect: true }) position: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right' = 'top';\n\n @Prop({ reflect: true }) multiline: boolean;\n render() {\n return (\n <Host tooltip={this.message} class={`xv-tooltip_${this.position}`}>\n <slot>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" width={16} height={16}>\n <path\n fill=\"currentColor\"\n d=\"M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-88c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 64-24 0zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"\n />\n </svg>\n </slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'xv-webcomponents';
|
|
2
|
-
const BUILD = /* xv-webcomponents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow:
|
|
2
|
+
const BUILD = /* xv-webcomponents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Platform v4.27.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -1528,6 +1528,9 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
};
|
|
1530
1530
|
var getHostListenerTarget = (doc, elm, flags) => {
|
|
1531
|
+
if (flags & 8 /* TargetWindow */) {
|
|
1532
|
+
return win;
|
|
1533
|
+
}
|
|
1531
1534
|
if (flags & 16 /* TargetBody */) {
|
|
1532
1535
|
return doc.body;
|
|
1533
1536
|
}
|
|
@@ -1543,4 +1546,4 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
|
1543
1546
|
|
|
1544
1547
|
export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1545
1548
|
|
|
1546
|
-
//# sourceMappingURL=index-
|
|
1549
|
+
//# sourceMappingURL=index-a650cb06.js.map
|