xv-webcomponents 0.1.38 → 0.1.41
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-D41mMXvd.js → index-MLh9SbX2.js} +349 -8
- package/dist/cjs/index-MLh9SbX2.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xv-accordion-v2_33.cjs.entry.js +3411 -0
- package/dist/cjs/xv-accordion-v2_33.cjs.entry.js.map +1 -0
- package/dist/cjs/xv-breadcrumbs-v2.cjs.entry.js +1 -1
- package/dist/cjs/xv-webcomponents.cjs.js +3 -3
- package/dist/cjs/xv-webcomponents.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +8 -1
- package/dist/collection/components/xv-button/xv-button-v2.css +136 -118
- package/dist/collection/components/xv-button/xv-button.js +132 -67
- package/dist/collection/components/xv-button/xv-button.js.map +1 -1
- package/dist/collection/components/xv-card/xv-card.js +1 -1
- package/dist/collection/components/xv-checkbox/xv-checkbox.css +3 -0
- package/dist/collection/components/xv-checkbox/xv-checkbox.js +1 -1
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.css +30 -0
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.js +80 -0
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.js.map +1 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.css +4 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.js +42 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.js.map +1 -0
- package/dist/collection/components/xv-data-table/xv-data-table.css +51 -0
- package/dist/collection/components/xv-data-table/xv-data-table.js +130 -0
- package/dist/collection/components/xv-data-table/xv-data-table.js.map +1 -0
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js +1 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.css +6 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.js +20 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.js.map +1 -1
- package/dist/collection/components/xv-file-uploader/_vars.js +6 -0
- package/dist/collection/components/xv-file-uploader/_vars.js.map +1 -0
- package/dist/collection/components/xv-file-uploader/xv-file-uploader.css +136 -0
- package/dist/collection/components/xv-file-uploader/xv-file-uploader.js +448 -0
- package/dist/collection/components/xv-file-uploader/xv-file-uploader.js.map +1 -0
- package/dist/collection/components/xv-footer/xv-footer.js +1 -1
- package/dist/collection/components/xv-header/xv-header.js +10 -2
- package/dist/collection/components/xv-header/xv-header.js.map +1 -1
- package/dist/collection/components/xv-link/xv-link.js +1 -1
- package/dist/collection/components/xv-login-modal/xv-login-modal.css +22575 -0
- package/dist/collection/components/xv-login-modal/xv-login-modal.js +146 -0
- package/dist/collection/components/xv-login-modal/xv-login-modal.js.map +1 -0
- package/dist/collection/components/xv-modal/xv-modal.js +1 -1
- package/dist/collection/components/xv-notification/xv-notification.css +1 -0
- package/dist/collection/components/xv-notification/xv-notification.js +1 -1
- package/dist/collection/components/xv-number-input/xv-number-input.css +128 -0
- package/dist/collection/components/xv-number-input/xv-number-input.js +373 -0
- package/dist/collection/components/xv-number-input/xv-number-input.js.map +1 -0
- 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.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/xv-table-cell/xv-table-cell.js +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.js +1 -1
- package/dist/collection/components/xv-table/xv-table.js +1 -1
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +1 -1
- package/dist/collection/components/xv-tabs/xv-tabs.js +1 -2
- 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 +110 -89
- package/dist/collection/components/xv-text-input/xv-text-input.js +113 -80
- package/dist/collection/components/xv-text-input/xv-text-input.js.map +1 -1
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.css +95 -0
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js +201 -0
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js.map +1 -0
- package/dist/collection/components/xv-tooltip/xv-tooltip.css +31 -147
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +59 -34
- package/dist/collection/components/xv-tooltip/xv-tooltip.js.map +1 -1
- package/dist/esm/{index-Datpns0U.js → index-DLYJiP99.js} +349 -8
- package/dist/esm/index-DLYJiP99.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xv-accordion-v2_33.entry.js +3377 -0
- package/dist/esm/xv-accordion-v2_33.entry.js.map +1 -0
- package/dist/esm/xv-breadcrumbs-v2.entry.js +1 -1
- package/dist/esm/xv-webcomponents.js +4 -4
- package/dist/esm/xv-webcomponents.js.map +1 -1
- package/dist/types/components/xv-button/xv-button.d.ts +21 -12
- package/dist/types/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.d.ts +6 -0
- package/dist/types/components/xv-data-table/xv-data-table-row/xv-data-table-row.d.ts +4 -0
- package/dist/types/components/xv-data-table/xv-data-table.d.ts +9 -0
- package/dist/types/components/xv-dropdown/xv-dropdown.d.ts +1 -0
- package/dist/types/components/xv-file-uploader/_vars.d.ts +4 -0
- package/dist/types/components/xv-file-uploader/xv-file-uploader.d.ts +36 -0
- package/dist/types/components/xv-header/xv-header.d.ts +3 -0
- package/dist/types/components/xv-login-modal/xv-login-modal.d.ts +29 -0
- package/dist/types/components/xv-number-input/xv-number-input.d.ts +26 -0
- package/dist/types/components/xv-text-input/xv-text-input.d.ts +10 -11
- package/dist/types/components/xv-toggle-tip/xv-toggle-tip.d.ts +19 -0
- package/dist/types/components/xv-tooltip/xv-tooltip.d.ts +10 -8
- package/dist/types/components.d.ts +636 -49
- package/dist/xv-webcomponents/{p-054f5d59.entry.js → p-5b63a259.entry.js} +2 -2
- package/dist/xv-webcomponents/p-DLYJiP99.js +3 -0
- package/dist/xv-webcomponents/p-DLYJiP99.js.map +1 -0
- package/dist/xv-webcomponents/p-ec72208c.entry.js +2 -0
- package/dist/xv-webcomponents/p-ec72208c.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 +6 -4
- package/dist/cjs/index-D41mMXvd.js.map +0 -1
- package/dist/cjs/xv-accordion-v2_26.cjs.entry.js +0 -1193
- package/dist/cjs/xv-accordion-v2_26.cjs.entry.js.map +0 -1
- package/dist/collection/components/xv-text-input/_vars.js +0 -7
- package/dist/collection/components/xv-text-input/_vars.js.map +0 -1
- package/dist/esm/index-Datpns0U.js.map +0 -1
- package/dist/esm/xv-accordion-v2_26.entry.js +0 -1166
- package/dist/esm/xv-accordion-v2_26.entry.js.map +0 -1
- package/dist/types/components/xv-text-input/_vars.d.ts +0 -5
- package/dist/xv-webcomponents/p-4d970ae4.entry.js +0 -2
- package/dist/xv-webcomponents/p-4d970ae4.entry.js.map +0 -1
- package/dist/xv-webcomponents/p-Datpns0U.js +0 -3
- package/dist/xv-webcomponents/p-Datpns0U.js.map +0 -1
- /package/dist/xv-webcomponents/{p-054f5d59.entry.js.map → p-5b63a259.entry.js.map} +0 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { SIZE_VAR } from "../../types/enum";
|
|
3
|
+
export class XvNumberInput {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.step = 10;
|
|
6
|
+
this.loading = false;
|
|
7
|
+
this.size = SIZE_VAR.MD;
|
|
8
|
+
this.increment = () => {
|
|
9
|
+
const newValue = (this.value || 0) + this.step;
|
|
10
|
+
if (this.max !== undefined && newValue > this.max)
|
|
11
|
+
return;
|
|
12
|
+
this.setValue(newValue);
|
|
13
|
+
};
|
|
14
|
+
this.decrement = () => {
|
|
15
|
+
const newValue = (this.value || 0) - this.step;
|
|
16
|
+
if (this.min !== undefined && newValue < this.min)
|
|
17
|
+
return;
|
|
18
|
+
this.setValue(newValue);
|
|
19
|
+
};
|
|
20
|
+
this.handleInput = (event) => {
|
|
21
|
+
const input = event.target;
|
|
22
|
+
const num = parseFloat(input.value) || 0;
|
|
23
|
+
if (isNaN(num))
|
|
24
|
+
return;
|
|
25
|
+
this.setValue(num);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
setValue(value) {
|
|
29
|
+
var _a;
|
|
30
|
+
this.value = value;
|
|
31
|
+
this.internals.setFormValue((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString());
|
|
32
|
+
this.valueChange.emit(this.value);
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h(Host, { key: '110699b94aabcbb96f29a63a893f6fd0c4c2724b', class: { disabled: !!this.disabled } }, h("label", { key: '05c864b467c85fd2c35605b2c4d35e158345df19', class: "control" }, this.label && h("span", { key: 'ee1f92578bd90677b54d49154286ff83a1e0106c', class: "control_label" }, this.label), h("div", { key: 'a4745ad74f55576f06587f162baf581373e630a6', class: {
|
|
36
|
+
'control_input': true,
|
|
37
|
+
readonly: !!this.readonly,
|
|
38
|
+
error: !!this.error,
|
|
39
|
+
warning: !!this.warning
|
|
40
|
+
} }, h("input", { key: 'b797225274e669683326b747e7c4a3f7dadd618d', type: "number", placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, onInput: this.handleInput, name: this.name, min: this.min, max: this.max, step: this.step, value: this.value }), h("div", { key: '8f6632ad50ff3e2eb143f6e5d8f5897e86e65f9e', class: "control_input__icons" }, this.loading ? (h("xv-loader-v2", { size: SIZE_VAR.XS })) : !!this.error ? (h("span", { class: "status-icon error", "aria-hidden": "true" }, "!")) : !!this.warning ? (h("span", { class: "status-icon warning", "aria-hidden": "true" }, "\u26A0")) : null, h("xv-button-v2", { key: 'feb522703f489f47ef80cf50f513c4c13a8c4c9e', size: this.size, variant: "ghost", disabled: this.disabled || this.readonly, onClick: this.decrement, "aria-label": "Decrease" }, h("span", { key: '12be1db37508f37eb4f02e3e160a502918099fe4', slot: "icon-left", class: "status-icon" }, "\u2212")), h("hr", { key: '7b92c8e9f6123064f909a8263e26bb08f5557f47' }), h("xv-button-v2", { key: '0c6bc01f56b2e95e7f493b9183b2dda86311e030', size: this.size, variant: "ghost", disabled: this.disabled || this.readonly, onClick: this.increment, "aria-label": "Increase" }, h("span", { key: '8e72d1a977743731c5cd5a186e014510fc046839', slot: "icon-left", class: "status-icon" }, "+"))))), this.helper && h("p", { key: '09a014e9b38ce4f3a8e98722401234642d57b51f', class: "message" }, this.helper), typeof this.error === 'string' ? (h("p", { class: "message error" }, this.error)) : typeof this.warning === 'string' ? (h("p", { class: "message warning" }, this.warning)) : null));
|
|
41
|
+
}
|
|
42
|
+
static get is() { return "xv-number-input-v2"; }
|
|
43
|
+
static get encapsulation() { return "shadow"; }
|
|
44
|
+
static get formAssociated() { return true; }
|
|
45
|
+
static get originalStyleUrls() {
|
|
46
|
+
return {
|
|
47
|
+
"$": ["xv-number-input.scss"]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
static get styleUrls() {
|
|
51
|
+
return {
|
|
52
|
+
"$": ["xv-number-input.css"]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static get properties() {
|
|
56
|
+
return {
|
|
57
|
+
"label": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"attribute": "label",
|
|
60
|
+
"mutable": false,
|
|
61
|
+
"complexType": {
|
|
62
|
+
"original": "string",
|
|
63
|
+
"resolved": "string",
|
|
64
|
+
"references": {}
|
|
65
|
+
},
|
|
66
|
+
"required": false,
|
|
67
|
+
"optional": false,
|
|
68
|
+
"docs": {
|
|
69
|
+
"tags": [],
|
|
70
|
+
"text": ""
|
|
71
|
+
},
|
|
72
|
+
"getter": false,
|
|
73
|
+
"setter": false,
|
|
74
|
+
"reflect": false
|
|
75
|
+
},
|
|
76
|
+
"placeholder": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"attribute": "placeholder",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "string",
|
|
82
|
+
"resolved": "string",
|
|
83
|
+
"references": {}
|
|
84
|
+
},
|
|
85
|
+
"required": false,
|
|
86
|
+
"optional": true,
|
|
87
|
+
"docs": {
|
|
88
|
+
"tags": [],
|
|
89
|
+
"text": ""
|
|
90
|
+
},
|
|
91
|
+
"getter": false,
|
|
92
|
+
"setter": false,
|
|
93
|
+
"reflect": true
|
|
94
|
+
},
|
|
95
|
+
"name": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"attribute": "name",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "string",
|
|
101
|
+
"resolved": "string",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": false,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": ""
|
|
109
|
+
},
|
|
110
|
+
"getter": false,
|
|
111
|
+
"setter": false,
|
|
112
|
+
"reflect": true
|
|
113
|
+
},
|
|
114
|
+
"value": {
|
|
115
|
+
"type": "number",
|
|
116
|
+
"attribute": "value",
|
|
117
|
+
"mutable": true,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "number",
|
|
120
|
+
"resolved": "number",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": ""
|
|
128
|
+
},
|
|
129
|
+
"getter": false,
|
|
130
|
+
"setter": false,
|
|
131
|
+
"reflect": true
|
|
132
|
+
},
|
|
133
|
+
"helper": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"attribute": "helper",
|
|
136
|
+
"mutable": false,
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "string",
|
|
139
|
+
"resolved": "string",
|
|
140
|
+
"references": {}
|
|
141
|
+
},
|
|
142
|
+
"required": false,
|
|
143
|
+
"optional": true,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": ""
|
|
147
|
+
},
|
|
148
|
+
"getter": false,
|
|
149
|
+
"setter": false,
|
|
150
|
+
"reflect": false
|
|
151
|
+
},
|
|
152
|
+
"error": {
|
|
153
|
+
"type": "any",
|
|
154
|
+
"attribute": "error",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "string | boolean",
|
|
158
|
+
"resolved": "boolean | string",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": true,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": ""
|
|
166
|
+
},
|
|
167
|
+
"getter": false,
|
|
168
|
+
"setter": false,
|
|
169
|
+
"reflect": false
|
|
170
|
+
},
|
|
171
|
+
"warning": {
|
|
172
|
+
"type": "any",
|
|
173
|
+
"attribute": "warning",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "string | boolean",
|
|
177
|
+
"resolved": "boolean | string",
|
|
178
|
+
"references": {}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": true,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": ""
|
|
185
|
+
},
|
|
186
|
+
"getter": false,
|
|
187
|
+
"setter": false,
|
|
188
|
+
"reflect": false
|
|
189
|
+
},
|
|
190
|
+
"step": {
|
|
191
|
+
"type": "number",
|
|
192
|
+
"attribute": "step",
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "number",
|
|
196
|
+
"resolved": "number",
|
|
197
|
+
"references": {}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": false,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": ""
|
|
204
|
+
},
|
|
205
|
+
"getter": false,
|
|
206
|
+
"setter": false,
|
|
207
|
+
"reflect": false,
|
|
208
|
+
"defaultValue": "10"
|
|
209
|
+
},
|
|
210
|
+
"max": {
|
|
211
|
+
"type": "number",
|
|
212
|
+
"attribute": "max",
|
|
213
|
+
"mutable": false,
|
|
214
|
+
"complexType": {
|
|
215
|
+
"original": "number",
|
|
216
|
+
"resolved": "number",
|
|
217
|
+
"references": {}
|
|
218
|
+
},
|
|
219
|
+
"required": false,
|
|
220
|
+
"optional": true,
|
|
221
|
+
"docs": {
|
|
222
|
+
"tags": [],
|
|
223
|
+
"text": ""
|
|
224
|
+
},
|
|
225
|
+
"getter": false,
|
|
226
|
+
"setter": false,
|
|
227
|
+
"reflect": false
|
|
228
|
+
},
|
|
229
|
+
"min": {
|
|
230
|
+
"type": "number",
|
|
231
|
+
"attribute": "min",
|
|
232
|
+
"mutable": false,
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "number",
|
|
235
|
+
"resolved": "number",
|
|
236
|
+
"references": {}
|
|
237
|
+
},
|
|
238
|
+
"required": false,
|
|
239
|
+
"optional": true,
|
|
240
|
+
"docs": {
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": ""
|
|
243
|
+
},
|
|
244
|
+
"getter": false,
|
|
245
|
+
"setter": false,
|
|
246
|
+
"reflect": false
|
|
247
|
+
},
|
|
248
|
+
"readonly": {
|
|
249
|
+
"type": "boolean",
|
|
250
|
+
"attribute": "readonly",
|
|
251
|
+
"mutable": false,
|
|
252
|
+
"complexType": {
|
|
253
|
+
"original": "boolean",
|
|
254
|
+
"resolved": "boolean",
|
|
255
|
+
"references": {}
|
|
256
|
+
},
|
|
257
|
+
"required": false,
|
|
258
|
+
"optional": true,
|
|
259
|
+
"docs": {
|
|
260
|
+
"tags": [],
|
|
261
|
+
"text": ""
|
|
262
|
+
},
|
|
263
|
+
"getter": false,
|
|
264
|
+
"setter": false,
|
|
265
|
+
"reflect": false
|
|
266
|
+
},
|
|
267
|
+
"disabled": {
|
|
268
|
+
"type": "boolean",
|
|
269
|
+
"attribute": "disabled",
|
|
270
|
+
"mutable": false,
|
|
271
|
+
"complexType": {
|
|
272
|
+
"original": "boolean",
|
|
273
|
+
"resolved": "boolean",
|
|
274
|
+
"references": {}
|
|
275
|
+
},
|
|
276
|
+
"required": false,
|
|
277
|
+
"optional": true,
|
|
278
|
+
"docs": {
|
|
279
|
+
"tags": [],
|
|
280
|
+
"text": ""
|
|
281
|
+
},
|
|
282
|
+
"getter": false,
|
|
283
|
+
"setter": false,
|
|
284
|
+
"reflect": false
|
|
285
|
+
},
|
|
286
|
+
"loading": {
|
|
287
|
+
"type": "boolean",
|
|
288
|
+
"attribute": "loading",
|
|
289
|
+
"mutable": false,
|
|
290
|
+
"complexType": {
|
|
291
|
+
"original": "boolean",
|
|
292
|
+
"resolved": "boolean",
|
|
293
|
+
"references": {}
|
|
294
|
+
},
|
|
295
|
+
"required": false,
|
|
296
|
+
"optional": false,
|
|
297
|
+
"docs": {
|
|
298
|
+
"tags": [],
|
|
299
|
+
"text": ""
|
|
300
|
+
},
|
|
301
|
+
"getter": false,
|
|
302
|
+
"setter": false,
|
|
303
|
+
"reflect": false,
|
|
304
|
+
"defaultValue": "false"
|
|
305
|
+
},
|
|
306
|
+
"block": {
|
|
307
|
+
"type": "boolean",
|
|
308
|
+
"attribute": "block",
|
|
309
|
+
"mutable": false,
|
|
310
|
+
"complexType": {
|
|
311
|
+
"original": "boolean",
|
|
312
|
+
"resolved": "boolean",
|
|
313
|
+
"references": {}
|
|
314
|
+
},
|
|
315
|
+
"required": false,
|
|
316
|
+
"optional": true,
|
|
317
|
+
"docs": {
|
|
318
|
+
"tags": [],
|
|
319
|
+
"text": ""
|
|
320
|
+
},
|
|
321
|
+
"getter": false,
|
|
322
|
+
"setter": false,
|
|
323
|
+
"reflect": false
|
|
324
|
+
},
|
|
325
|
+
"size": {
|
|
326
|
+
"type": "string",
|
|
327
|
+
"attribute": "size",
|
|
328
|
+
"mutable": false,
|
|
329
|
+
"complexType": {
|
|
330
|
+
"original": "SIZE_VAR",
|
|
331
|
+
"resolved": "SIZE_VAR.LG | SIZE_VAR.MD | SIZE_VAR.SM | SIZE_VAR.XL | SIZE_VAR.XS",
|
|
332
|
+
"references": {
|
|
333
|
+
"SIZE_VAR": {
|
|
334
|
+
"location": "import",
|
|
335
|
+
"path": "../../types/enum",
|
|
336
|
+
"id": "src/types/enum.ts::SIZE_VAR"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"required": false,
|
|
341
|
+
"optional": false,
|
|
342
|
+
"docs": {
|
|
343
|
+
"tags": [],
|
|
344
|
+
"text": ""
|
|
345
|
+
},
|
|
346
|
+
"getter": false,
|
|
347
|
+
"setter": false,
|
|
348
|
+
"reflect": true,
|
|
349
|
+
"defaultValue": "SIZE_VAR.MD"
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
static get events() {
|
|
354
|
+
return [{
|
|
355
|
+
"method": "valueChange",
|
|
356
|
+
"name": "valueChange",
|
|
357
|
+
"bubbles": true,
|
|
358
|
+
"cancelable": true,
|
|
359
|
+
"composed": true,
|
|
360
|
+
"docs": {
|
|
361
|
+
"tags": [],
|
|
362
|
+
"text": ""
|
|
363
|
+
},
|
|
364
|
+
"complexType": {
|
|
365
|
+
"original": "number",
|
|
366
|
+
"resolved": "number",
|
|
367
|
+
"references": {}
|
|
368
|
+
}
|
|
369
|
+
}];
|
|
370
|
+
}
|
|
371
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
372
|
+
}
|
|
373
|
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AI,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Event, EventEmitter, AttachInternals } from '@stencil/core';\nimport { SIZE_VAR } from '../../types/enum';\n\n@Component({\n tag: 'xv-number-input-v2',\n styleUrl: 'xv-number-input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class XvNumberInput {\n @Prop() label: string;\n @Prop({ reflect: true }) placeholder?: string;\n @Prop({ reflect: true }) name: string;\n @Prop({ reflect: true, mutable: true }) value: number;\n @Event({ eventName: 'valueChange' }) valueChange: EventEmitter<number>;\n @Prop() helper?: string;\n @Prop() error?: string | boolean;\n @Prop() warning?: string | boolean;\n @Prop() step: number = 10;\n @Prop() max?: number;\n @Prop() min?: number;\n @Prop() readonly?: boolean;\n @Prop() disabled?: boolean;\n @Prop() loading: boolean = false;\n @Prop() block?: boolean;\n @Prop({ reflect: true }) size: SIZE_VAR = SIZE_VAR.MD;\n\n @AttachInternals() internals: ElementInternals;\n\n private increment = () => {\n const newValue = (this.value || 0) + this.step;\n if (this.max !== undefined && newValue > this.max) return;\n this.setValue(newValue)\n };\n\n private decrement = () => {\n const newValue = (this.value || 0) - this.step;\n if (this.min !== undefined && newValue < this.min) return;\n this.setValue(newValue)\n };\n\n private handleInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n const num = parseFloat(input.value) || 0;\n\n if (isNaN(num)) return;\n\n this.setValue(num);\n };\n\n private setValue(value: number) {\n this.value = value;\n this.internals.setFormValue(this.value?.toString());\n this.valueChange.emit(this.value);\n }\n\n render() {\n return (\n <Host class={{ disabled: !!this.disabled }}>\n <label class=\"control\">\n {this.label && <span class=\"control_label\">{this.label}</span>}\n\n <div class={{\n 'control_input': true,\n readonly: !!this.readonly,\n error: !!this.error,\n warning: !!this.warning\n }}>\n <input\n type=\"number\"\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n onInput={this.handleInput}\n name={this.name}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.value}\n />\n\n <div class=\"control_input__icons\">\n {this.loading ? (\n <xv-loader-v2 size={SIZE_VAR.XS} />\n ) : !!this.error ? (\n <span class=\"status-icon error\" aria-hidden=\"true\">!</span>\n ) : !!this.warning ? (\n <span class=\"status-icon warning\" aria-hidden=\"true\">⚠</span>\n ) : null}\n <xv-button-v2\n size={this.size}\n variant=\"ghost\"\n disabled={this.disabled || this.readonly}\n onClick={this.decrement}\n aria-label=\"Decrease\"\n ><span slot=\"icon-left\" class=\"status-icon\">−</span></xv-button-v2>\n <hr />\n <xv-button-v2\n size={this.size}\n variant=\"ghost\"\n disabled={this.disabled || this.readonly}\n onClick={this.increment}\n aria-label=\"Increase\"\n ><span slot=\"icon-left\" class=\"status-icon\">+</span></xv-button-v2>\n </div>\n </div>\n </label>\n\n\n {this.helper && <p class=\"message\">{this.helper}</p>}\n {typeof this.error === 'string' ? (\n <p class=\"message error\">{this.error}</p>\n ) : typeof this.warning === 'string' ? (\n <p class=\"message warning\">{this.warning}</p>\n ) : null}\n </Host>\n );\n }\n}\n"]}
|
package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js
CHANGED
|
@@ -11,7 +11,7 @@ export class XvOverflowMenuItem {
|
|
|
11
11
|
this.itemClick.emit({ event, value: this.value });
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: 'b77fdd436fb29e1619c91dd9199496b712209978', class: "xv-overflow-menu-item", role: "menuitem", disabled: this.disabled }, h("slot", { key: '79ad627095559eaafc17c24658969bbe74ce200b' })));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "xv-overflow-menu-v2-item"; }
|
|
17
17
|
static get encapsulation() { return "shadow"; }
|
|
@@ -48,7 +48,7 @@ export class XvOverflowMenu {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
|
-
return (h(Host, { key: '
|
|
51
|
+
return (h(Host, { key: '1dc9416f0d046119e11b2c99bb3eb6d333304ee0', class: "xv-overflow-menu", size: this.size, role: "menu", tabindex: -1 }, h("button", { key: 'df078f87e1b9b2e9fdb057f6186599f86873aa6f', class: { btn: true, open: this.open }, onClick: this.onOpenToggle, disabled: this.disabled }, h("svg", { key: 'd89ae23334072ed22358920a9a8e909c5572936b', xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 128 512" }, h("path", { key: '3a4aaf227ca86efbdf2655c34c8cc7dc05e55b21', d: "M64 368a48 48 0 1 0 0 96 48 48 0 1 0 0-96zm0-160a48 48 0 1 0 0 96 48 48 0 1 0 0-96zM112 96A48 48 0 1 0 16 96a48 48 0 1 0 96 0z" }))), h("div", { key: '8370f57fe6a9dc79ae90980f68b9ac91364bcdd1', class: { list: true, open: this.open, [`position-${this.position}`]: true } }, h("slot", { key: '8a40ab08790a23db858c8e5d393dbb555f7f8d52' }))));
|
|
52
52
|
}
|
|
53
53
|
componentDidLoad() {
|
|
54
54
|
this.openChangeHandle();
|
|
@@ -5,7 +5,7 @@ export class XvProgressIndicatorItem {
|
|
|
5
5
|
this.status = PROGRESS_ITEM_STATUS.NO_STARTED;
|
|
6
6
|
}
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: 'aa7a93c986dad88003765936698bd0a9b9ab69c9', status: this.status, class: { 'xv-progress-indicator-item': true } }, h("span", { key: '0858a4714f47c017768c565e97686edba8d01fac', class: "line" }), h("span", { key: 'a4984429a6fa6d24b102ff1f547e6b02060a2ace', class: "icon" }, h("svg", { key: 'aaafe9512fcbd04c6eb08df1cac3abe3a9672187', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512" }, h("path", { key: 'e2016e50eea686b070bee9060ae08b428ac9166c', fill: "currentColor", d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }))), h("p", { key: '31231bac86472ec197f1f777fafa409c3be4f3fe', class: "label" }, h("slot", { key: '2aa765f1e87050f1398d31fbae3cfd1c79729bc4' }))));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "xv-progress-indicator-v2-item"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -56,7 +56,7 @@ export class XvProgressIndicator {
|
|
|
56
56
|
this.updateChildItems();
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: '3e05f1ba497e8c471d93122e6bce9da9520fb41e', variant: this.variant, size: this.size, class: { 'xv-progress-indicator': true } }, h("slot", { key: 'dbefc5482792a6cbab611aef15e32709125b85b3' })));
|
|
60
60
|
}
|
|
61
61
|
static get is() { return "xv-progress-indicator-v2"; }
|
|
62
62
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22,7 +22,7 @@ export class XvTableCell {
|
|
|
22
22
|
}
|
|
23
23
|
;
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '49c2faf25ce05c90ba4813108cfe4fc73fa165ce' }, h("slot", { key: '885295db92236d22b675d3fdf40a68f828d3ca1a' })));
|
|
26
26
|
}
|
|
27
27
|
static get is() { return "xv-table-v2-cell"; }
|
|
28
28
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,7 +10,7 @@ export class XvTableExpand {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: '1cdc6260aa3933b453fb16211c28d6fbea2a0350' }, h("button", { key: '53dbd31f7c4a47190af4963bf8437c061ca59827', class: { 'expand-btn': true, open: this.open }, disabled: this.disabled, onClick: this.handleExpand }), h("slot", { key: 'ba53a344f92e28fa173bba7fa49e0b9c8a3036db', name: XV_EXPANDABLE_KEY }), h("div", { key: '24b785baa2b308a46414b14f5fbe87a88bb91deb', class: { expandableContent: true, open: this.open } }, h("slot", { key: '8dbc793cd4e27694dac3cf240b9dd919bac0f36b' }))));
|
|
14
14
|
}
|
|
15
15
|
componentDidLoad() {
|
|
16
16
|
setAttr(this.el.parentElement, XV_EXPANDABLE_KEY, true);
|
|
@@ -42,7 +42,7 @@ export class XvTableRow {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: 'bbf22a27e0dad429a6b78add5cc7582af2c9fb05' }, this.variant !== undefined && (h("xv-table-v2-cell", { key: '55c69e4d4b996db975015a5c4583e7b47e08a84a', class: "cell-control" }, this.variant === 'checkbox' && (h("xv-checkbox-v2", { key: 'ab88c9827b708e849088214eb26a83157f4775aa', name: this.name, partial: this.partial, checked: this.checked || this.partial, disabled: this.disabled, required: this.required, readonly: this.readonly, onEventChange: this.checkHandle })), this.variant === 'radio' && (h("input", { key: 'dbb9e381633828073940e32bf5b40231e3e34857', type: "radio", name: this.name, checked: this.checked || this.partial, disabled: this.disabled, required: this.required, readonly: this.readonly })))), h("slot", { key: 'a2043f89fb359453c4839c000fdcead5ab8769ae' })));
|
|
46
46
|
}
|
|
47
47
|
componentWillLoad() {
|
|
48
48
|
this.setInitialAttrs();
|
|
@@ -31,7 +31,7 @@ export class XvTable {
|
|
|
31
31
|
.join(' ') + ' repeat(auto-fit, minmax(0, 1fr))');
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '173110599b9a11fec560bfa5f648f5fed235175f', class: { batchVisible: !!this.selectedCount } }, h("slot", { key: '3966a6ba192313ab9cbe5b26cadd765c12b08262', name: "title" }, !!this.el.title && h("h2", { key: '51bf9b76da8f3605f1254ff3df0e9bf68751ec2c', class: "xv-table-title" }, this.el.title)), h("slot", { key: '9276e8836c4086bc2b8d1dc4aacdc2b447b31f57', name: "toolbar" }), h("div", { key: '8fa9c349b7d377cd2860054de08fdea4061462cd', class: "xv-table" }, h("div", { key: '0dd60cd039409d66e6c024a46e9c7353b825fc39', class: "batch-actions" }, h(Fragment, { key: '5b2b17c1ba82cb36c57fb7c99c54f1a66f4146e0' }, h("div", { key: '6fbdb8faad086fe53fe9dc277065db514327a498', class: "batch-actions_content" }, h("slot", { key: 'e8769e3dfe0e539dbfc14033079636f364556e31', name: "batch" })), h("p", { key: '857f33d3595cf5e5f0a0ffc4474e801ea9e4aeaa', class: "batch-actions_count" }, !!this.selectedCount && `${this.selectedCount} ${this.selectedCount === 1 ? 'Position ausgewählt' : 'Positionen ausgewählt'}`))), h("div", { key: '4f0d41aabd8f78f04c0ded187c2dc117794802a8', class: "xv-table_wrapper" }, h("slot", { key: '7de743d320da2d68f9835b0dacd3db192b5e12b9' }), h("slot", { key: 'b0fb15c2fb82e94a249d2f0be12a04066ff244ea', name: "footer" })), !!this.loading && (h("div", { key: 'bd3947a1ad4d34bb0ea57a4648336d40d2b4499b', class: "xv-table_loading" }, h("xv-loader-v2", { key: '0991ecbde1fae86b8a7da8b348594a76e176fc09', size: SIZE_VAR.LG }))))));
|
|
35
35
|
}
|
|
36
36
|
componentWillLoad() {
|
|
37
37
|
this.setColsSizeTemplate();
|
|
@@ -6,7 +6,7 @@ export class XvTab {
|
|
|
6
6
|
this.loading = false;
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return (h(Host, { key: '
|
|
9
|
+
return (h(Host, { key: '560790ac18797ba2238cff26a7ef87eb8b53d483', disabled: this.disabled, name: this.name }, this.loading ? h("xv-loader-v2", { size: SIZE_VAR.LG }) : h("slot", null)));
|
|
10
10
|
}
|
|
11
11
|
static get is() { return "xv-tab-v2"; }
|
|
12
12
|
static get encapsulation() { return "shadow"; }
|
|
@@ -68,8 +68,7 @@ export class XvTabs {
|
|
|
68
68
|
const nextTab = this.tabElements[nextIdx];
|
|
69
69
|
if (!nextTab || nextTab.hasAttribute('disabled'))
|
|
70
70
|
return;
|
|
71
|
-
this.
|
|
72
|
-
this.scrollToActiveTab();
|
|
71
|
+
this.handleTabClick(nextTab.getAttribute('name') || nextIdx);
|
|
73
72
|
}
|
|
74
73
|
render() {
|
|
75
74
|
var _a, _b, _c;
|
|
@@ -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,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,MAA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G,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,YAAY,CAAK,CACtE;gBACN,4BACa,MAAM,EACjB,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,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.handleTabClick(nextTab.getAttribute('name') || nextIdx);\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: '0f30c136dab805c0c443c6ca81d8245d4ec6f0b5', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, h("div", { key: 'ac1ee723f78ed280af64ea13b8475d7f0ddd01ee', class: "xv-tag_content" }, h("slot", { key: 'b808df5553d25f32bbe875c1ff68f68b6a6d4c73' })), this.closeable && (h("button", { key: '23784cc30119255ad0e7f80a8d23322922e2c633', 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"; }
|