xv-webcomponents 0.1.28 → 0.1.30
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/loader.cjs.js +1 -1
- package/dist/cjs/{xv-accordion-v2_27.cjs.entry.js → xv-accordion-v2_28.cjs.entry.js} +105 -17
- package/dist/cjs/xv-accordion-v2_28.cjs.entry.js.map +1 -0
- package/dist/cjs/xv-webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/xv-button/xv-button.js +34 -8
- package/dist/collection/components/xv-button/xv-button.js.map +1 -1
- package/dist/collection/components/xv-dropdown/_vars.js +1 -1
- package/dist/collection/components/xv-dropdown/_vars.js.map +1 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js +8 -6
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js.map +1 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.js +61 -7
- package/dist/collection/components/xv-dropdown/xv-dropdown.js.map +1 -1
- package/dist/collection/components/xv-text-input/_vars.js +7 -0
- package/dist/collection/components/xv-text-input/_vars.js.map +1 -0
- package/dist/collection/components/xv-text-input/xv-text-input.css +122 -0
- package/dist/collection/components/xv-text-input/xv-text-input.js +248 -0
- package/dist/collection/components/xv-text-input/xv-text-input.js.map +1 -0
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{xv-accordion-v2_27.entry.js → xv-accordion-v2_28.entry.js} +105 -18
- package/dist/esm/xv-accordion-v2_28.entry.js.map +1 -0
- package/dist/esm/xv-webcomponents.js +1 -1
- package/dist/types/components/xv-button/xv-button.d.ts +3 -1
- package/dist/types/components/xv-dropdown/_vars.d.ts +1 -0
- package/dist/types/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.d.ts +1 -0
- package/dist/types/components/xv-dropdown/xv-dropdown.d.ts +4 -0
- package/dist/types/components/xv-text-input/_vars.d.ts +5 -0
- package/dist/types/components/xv-text-input/xv-text-input.d.ts +24 -0
- package/dist/types/components.d.ts +73 -2
- package/dist/xv-webcomponents/p-cc83f7ea.entry.js +2 -0
- package/dist/xv-webcomponents/p-cc83f7ea.entry.js.map +1 -0
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
- package/dist/xv-webcomponents/xv-webcomponents.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/xv-accordion-v2_27.cjs.entry.js.map +0 -1
- package/dist/esm/xv-accordion-v2_27.entry.js.map +0 -1
- package/dist/xv-webcomponents/p-07dfeba3.entry.js +0 -2
- package/dist/xv-webcomponents/p-07dfeba3.entry.js.map +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["xv-breadcrumbs-v2.cjs",[[1,"xv-breadcrumbs-v2"]]],["xv-accordion-
|
|
11
|
+
return index.bootstrapLazy([["xv-breadcrumbs-v2.cjs",[[1,"xv-breadcrumbs-v2"]]],["xv-accordion-v2_28.cjs",[[1,"xv-table-v2-header-row",{"sortable":[516],"selectionName":[513,"selection-name"],"partial":[1540],"checked":[1540],"cols":[32]}],[1,"xv-table-v2-row",{"expandable":[516],"expanded":[1540],"disabled":[516],"selectionName":[513,"selection-name"],"value":[513],"checked":[1540],"partial":[516],"groupId":[513,"group-id"],"id":[32],"cols":[32],"hovered":[32]},null,{"checked":["checkedChangeHandle"]}],[1,"xv-accordion-v2",{"multiple":[4],"xvId":[1,"xv-id"],"value":[1025],"opened":[32],"toggleItem":[64]}],[1,"xv-accordion-v2-item",{"disabled":[4],"label":[1],"value":[1],"isOpen":[32]},[[16,"accordionChange","handleAccordionChange"]]],[1,"xv-button-v2",{"label":[1],"block":[4],"type":[1],"variant":[1],"disabled":[4]}],[1,"xv-card-v2",{"variant":[1],"media":[1],"header":[1],"body":[1],"footer":[1]}],[1,"xv-dropdown-v2",{"disabled":[4],"multiple":[4],"required":[4],"open":[1540],"error":[1],"label":[1],"helper":[1],"warning":[1],"placeholder":[1],"size":[1],"defaultValue":[8,"default-value"],"selected":[32],"selectedMap":[32]},[[0,"itemSelected","handleItemSelected"]],{"open":["openChangeHandle"]}],[1,"xv-dropdown-v2-item",{"disabled":[4],"value":[1544],"selected":[1540]},[[0,"click","handleClick"]]],[0,"xv-footer",{"htmlContent":[32]}],[0,"xv-header",{"htmlContent":[32]}],[1,"xv-link-v2",{"href":[1],"target":[1],"disabled":[4],"size":[1],"variant":[1]}],[1,"xv-loader-v2",{"show":[4],"variant":[1],"size":[1]}],[1,"xv-modal-v2",{"open":[1540],"permanent":[4],"size":[1],"openModal":[64],"closeModal":[64]}],[1,"xv-notification-v2",{"variant":[1],"dismissible":[4]}],[1,"xv-overflow-menu-v2",{"open":[1540],"disabled":[516],"position":[1],"size":[1]},[[0,"keydown","handleKeyDown"]],{"open":["openChangeHandle"]}],[1,"xv-overflow-menu-v2-item",{"disabled":[516],"value":[520],"variant":[1]},[[0,"click","handleClick"]]],[1,"xv-progress-indicator-v2",{"progress":[2],"variant":[1],"size":[1]},null,{"progress":["updateChildItems"]}],[1,"xv-progress-indicator-v2-item",{"status":[1]}],[1,"xv-tab-v2",{"label":[1],"disabled":[4]}],[1,"xv-table-v2",{"description":[1],"colorSchema":[1,"color-schema"],"expandable":[516],"size":[1],"selectable":[4],"selectedRows":[32]},null,{"colorSchema":["handleSetColorSchema"],"selectable":["listenSelectableHandle"]}],[1,"xv-table-v2-col",{"sort":[1537],"sortName":[1,"sort-name"]},[[0,"click","handleClick"]]],[1,"xv-table-v2-expand",{"expanded":[1540],"cols":[32],"hovered":[32],"checkedGroup":[32],"selectedRows":[32],"mainRowData":[32],"toggleExpand":[64]}],[1,"xv-table-v2-toolbar",{"selected":[32],"setSelectedItems":[64]}],[1,"xv-tabs-v2",{"active":[1538],"variant":[1],"height":[32]},null,{"active":["onActiveTabChanged"]}],[1,"xv-tag-v2",{"size":[1],"color":[1],"bg":[1],"disabled":[4],"closeable":[4]}],[65,"xv-text-input-v2",{"label":[1],"placeholder":[1],"helper":[1],"name":[1],"size":[1],"status":[1],"value":[1025],"disabled":[4],"readonly":[4]}],[1,"xv-tooltip-v2",{"message":[1],"position":[1]}],[65,"xv-checkbox-v2",{"checked":[1540],"indeterminate":[516],"disabled":[516],"name":[513],"value":[513],"readonly":[516],"required":[516],"partial":[516],"label":[1],"size":[513],"error":[520],"hasFocus":[32]},null,{"checked":["onCheckedChange"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -82,20 +82,21 @@ const XvButton = class {
|
|
|
82
82
|
this.label = '';
|
|
83
83
|
/** Container width Button */
|
|
84
84
|
this.block = false;
|
|
85
|
+
/** Button type */
|
|
86
|
+
this.type = 'button';
|
|
85
87
|
/** Variant */
|
|
86
88
|
this.variant = 'primary';
|
|
87
89
|
/** Disabled state */
|
|
88
90
|
this.disabled = false;
|
|
89
91
|
/** Handle click only if not disabled */
|
|
90
|
-
this.handleClick = () => {
|
|
91
|
-
if (this.disabled)
|
|
92
|
+
this.handleClick = (e) => {
|
|
93
|
+
if (this.disabled)
|
|
92
94
|
return;
|
|
93
|
-
|
|
94
|
-
this.buttonClick.emit();
|
|
95
|
+
this.buttonClick.emit(e);
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
render() {
|
|
98
|
-
return (index.h("button", { key: '
|
|
99
|
+
return (index.h("button", { key: '4a9a7d9eb8f0b9fb264c03e804fa157d14a15805', type: this.type, part: "button", class: `xv-button ${this.variant} ${this.block ? 'xv-button-block' : ''}`, disabled: this.disabled, onClick: this.handleClick }, index.h("slot", { key: 'd9102ce481222999d9f1a35b4782b550e1a3179c', name: "icon-left" }), index.h("slot", { key: '5960e30d35b9d403da9da635414cd4db95f165d6' }, this.label), index.h("slot", { key: 'aae667909ef6932eaa31a8a6b89165960d0cf8a3', name: "icon-right" })));
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
XvButton.style = XvButtonV2Style0;
|
|
@@ -224,6 +225,8 @@ var SIZE_VAR;
|
|
|
224
225
|
SIZE_VAR["XL"] = "xl";
|
|
225
226
|
})(SIZE_VAR || (SIZE_VAR = {}));
|
|
226
227
|
|
|
228
|
+
const DropdownItemSelector = '.xv-dropdown-item';
|
|
229
|
+
|
|
227
230
|
const xvDropdownCss = ":host{--dropdown-padding-x:16px;--dropdown-padding-y:11px;--dropdown-max-width:300px;display:block;position:relative;text-align:left;max-width:min(var(--dropdown-max-width), 100%)}:host .label{color:var(--text-secondary, #515151);font-family:var(--ff-body, Tahoma);font-size:12px;font-style:normal;font-weight:700;line-height:16px;letter-spacing:0.32px}:host .label ::slotted([slot=label]){color:var(--text-secondary, #515151);font-family:var(--ff-body, Tahoma);font-size:12px;font-style:normal;font-weight:700;line-height:16px;letter-spacing:0.32px}:host .control{background-blend-mode:multiply;border-radius:3px;box-shadow:0 0 0 1px #8B8B8B inset;transition:0.2s ease-in-out background-color;cursor:pointer;margin:4px 0;box-sizing:border-box;font-family:inherit;font-size:100%;padding:0;border:0;appearance:none;background-color:var(--field-02, #FFF);text-align:start;inline-size:100%;position:relative;display:inline-flex;overflow:hidden;align-items:center;block-size:calc(100% + 1px);outline:none;padding-block:var(--dropdown-padding-y);padding-inline:var(--dropdown-padding-x);text-overflow:ellipsis;vertical-align:top;white-space:nowrap}:host .control_value,:host .control_placeholder{flex:1;margin:0;overflow:hidden;color:var(--text-primary, #333);user-select:none;text-overflow:ellipsis;white-space:nowrap;font-family:var(--fz-body, Tahoma);font-size:14px;font-style:normal;font-weight:400;line-height:18px;letter-spacing:0.16px;padding-inline:0 1rem}:host .control_placeholder{color:var(--text-placeholder, #ACACAC)}:host .control_icon{width:18px;height:18px}:host .control_icon.error{color:var(--support-error, #F1290E)}:host .control_icon.warning{color:var(--support-warning, #FF7F04)}:host .control_arrow{box-sizing:border-box;margin:0;font-size:100%;vertical-align:baseline;padding:0;border:0;appearance:none;background:none;text-align:start;display:flex;align-items:center;justify-content:center;block-size:1.5rem;inline-size:1.5rem;inset-inline-end:0.75rem;outline:none;transition:transform 70ms cubic-bezier(0.2, 0, 0.38, 0.9)}:host .control:hover{background-color:var(--field-hover-02, #E9E9E9)}:host .control:active{background-color:var(--layer-selected-02, #E3E3E3)}:host .options{inset-block-start:100%;margin-block-start:1px;display:block;max-block-size:13.75rem;box-shadow:0 2px 6px rgba(0, 0, 0, 0.3);position:absolute;z-index:10;inline-size:100%;inset-inline:0;overflow-y:auto;transition:max-height 0.11s cubic-bezier(0.2, 0, 0.38, 0.9);border-radius:3px;background-color:var(--field-02, #FFF);scrollbar-width:thin;scrollbar-color:var(--layer-accent-03) transparent}:host .options ::slotted(.xv-dropdown-item){display:block;max-block-size:13.75rem;inset-inline:0;box-sizing:border-box;padding:var(--dropdown-padding-y) calc(var(--dropdown-padding-x) + 16px) var(--dropdown-padding-y) var(--dropdown-padding-x);position:relative;cursor:pointer;overflow:hidden;color:var(--text-secondary, #515151);text-overflow:ellipsis;white-space:nowrap;font-family:var(--ff-body, Tahoma);font-size:var(--fz-md, 14px);font-style:normal;font-weight:400;line-height:18px;letter-spacing:0.16px;transition:0.2s ease-in-out background-color;user-select:none}:host .options ::slotted(.xv-dropdown-item):after{content:\"\";position:absolute;bottom:0;height:1px;left:10px;width:calc(100% - 20px);background-color:var(--border-subtle-01)}:host .options ::slotted(.xv-dropdown-item:hover){background-color:var(--layer-hover-02, #F7F7F7)}:host .options ::slotted(.xv-dropdown-item:active){background-color:var(--layer-selected-hover-02, #DADADA)}:host .options ::slotted(.xv-dropdown-item[selected]){background-color:var(--layer-selected-02, #E3E3E3)}:host .options ::slotted(.xv-dropdown-item[selected]:hover){background-color:var(--layer-selected-hover-02, #DADADA)}:host .options ::slotted(.xv-dropdown-item[disabled]){background-color:transparent;opacity:0.4;cursor:not-allowed}:host .helper{color:var(--text-helper, #646464);font-family:var(--ff-heading, \"IBM Plex Sans\");font-size:12px;font-style:normal;font-weight:400;line-height:16px;letter-spacing:0.32px;margin:0;padding:0}:host([open]) .control_arrow{transform:rotate(180deg)}:host([disabled]){opacity:0.4;cursor:not-allowed}:host([disabled]) .control{cursor:inherit}:host([disabled]) .control:hover,:host([disabled]) .control:active,:host([disabled]) .control:focus-within{background-color:transparent}:host([error]) .control{box-shadow:none;outline:2px solid var(--support-support-error, #F1290E)}:host([error]) .helper{color:var(--text-error, #D62512)}:host([size=xs]){--dropdown-padding-y:4px}:host([size=sm]){--dropdown-padding-y:7px}:host([size=md]){--dropdown-padding-y:11px}:host([size=lg]){--dropdown-padding-y:15px}:host([size=xl]){--dropdown-padding-y:16px}";
|
|
228
231
|
const XvDropdownV2Style0 = xvDropdownCss;
|
|
229
232
|
|
|
@@ -234,6 +237,14 @@ const XvDropdown = class {
|
|
|
234
237
|
this.size = SIZE_VAR.MD;
|
|
235
238
|
this.selected = [];
|
|
236
239
|
this.selectedMap = new Map();
|
|
240
|
+
this.setSelected = (selectedMap, optionNodes) => {
|
|
241
|
+
const values = Array.from(selectedMap.values());
|
|
242
|
+
const options = optionNodes || this.el.querySelectorAll(DropdownItemSelector);
|
|
243
|
+
this.selected = values.length === options.length ?
|
|
244
|
+
['Alle ausgewählt'] : values.length > 2 ?
|
|
245
|
+
[`${values.length} ausgewählt`] : values.map((v) => v.text);
|
|
246
|
+
return values;
|
|
247
|
+
};
|
|
237
248
|
this.handleOpen = () => {
|
|
238
249
|
if (this.disabled || this.open)
|
|
239
250
|
return;
|
|
@@ -251,6 +262,27 @@ const XvDropdown = class {
|
|
|
251
262
|
this.removeListeners = () => {
|
|
252
263
|
document.body.removeEventListener('click', this.handleClickOutside);
|
|
253
264
|
};
|
|
265
|
+
this.setDefaultValues = () => {
|
|
266
|
+
if (!this.defaultValue)
|
|
267
|
+
return;
|
|
268
|
+
// Needs to wait next Javascript tik
|
|
269
|
+
setTimeout(() => {
|
|
270
|
+
const options = this.el.querySelectorAll(DropdownItemSelector);
|
|
271
|
+
utils.forEach(options, (option) => {
|
|
272
|
+
const dropdownItemData = {
|
|
273
|
+
value: option.getAttribute('value'),
|
|
274
|
+
text: option.innerText,
|
|
275
|
+
selected: `${this.defaultValue}` === option.getAttribute('value'),
|
|
276
|
+
};
|
|
277
|
+
if (dropdownItemData.selected) {
|
|
278
|
+
console.log('dropdownItemData', dropdownItemData);
|
|
279
|
+
utils.setAttr(option, 'selected', dropdownItemData.selected);
|
|
280
|
+
this.selectedMap.set(dropdownItemData.value, dropdownItemData);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
this.setSelected(this.selectedMap, options);
|
|
284
|
+
});
|
|
285
|
+
};
|
|
254
286
|
}
|
|
255
287
|
openChangeHandle() {
|
|
256
288
|
if (this.disabled)
|
|
@@ -288,16 +320,15 @@ const XvDropdown = class {
|
|
|
288
320
|
}
|
|
289
321
|
this.open = false;
|
|
290
322
|
}
|
|
291
|
-
const optionElements = this.el.querySelectorAll(
|
|
323
|
+
const optionElements = this.el.querySelectorAll(DropdownItemSelector);
|
|
292
324
|
utils.forEach(optionElements, (option) => utils.setAttr(option, 'selected', this.selectedMap.has(option.getAttribute('value'))));
|
|
293
|
-
|
|
294
|
-
this.selected = values.length === optionElements.length ?
|
|
295
|
-
['Alle ausgewählt'] : values.length > 2 ?
|
|
296
|
-
[`${values.length} ausgewählt`] : values.map((v) => v.text);
|
|
297
|
-
this.changeSelection.emit(values);
|
|
325
|
+
this.changeSelection.emit(this.setSelected(this.selectedMap, optionElements));
|
|
298
326
|
}
|
|
299
327
|
render() {
|
|
300
|
-
return (index.h(index.Host, { key: '
|
|
328
|
+
return (index.h(index.Host, { key: '7c3f08a31359efeba9c35dabba6b9d1cfa66086d', size: this.size, class: "xv-dropdown", role: "combobox", tabindex: this.disabled ? -1 : false }, index.h("label", { key: '530293b5a2bd148576f41cb343d5ccaefb51cdd3', class: "label" }, index.h("slot", { key: 'fd66aff04936aedd63bcecf2decec0d4176f6174', name: "label" }, this.label)), index.h("div", { key: '72c4bd316a9104b0610d06cecdbc57de3b98df88', class: "xv-dropdown-control control", onClick: this.handleOpen }, this.selected.length ? (index.h("p", { class: "control_value" }, this.selected.join(', '))) : (index.h("p", { class: "control_placeholder" }, this.placeholder || '')), this.error && (index.h("svg", { key: '26ebc2800b21e02d783e928abb7fb4ef0280cee4', class: "control_icon error", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { key: 'bfce50f7bd4972652941003a42e3205f8d4a014f', 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" }))), (!this.error && !!this.warning) && (index.h("svg", { key: '4fe8eccfb3322d1595a327face9ebb762dfa4c4f', class: "control_icon warning", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { key: 'fd0df7d4d2e439ac314fa227dc315c8edf6aff3d', fill: "currentColor", 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" }))), index.h("svg", { key: 'bb39e6b12ca1dbd20b3f299c3602045c26128c14', class: "control_arrow", focusable: "false", preserveAspectRatio: "xMidYMid meet", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", "aria-hidden": "true", width: "16", height: "16", viewBox: "0 0 16 16" }, index.h("path", { key: '37918f651612b529d8120cc230e09e768a0cda11', d: "M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z" }))), this.open && index.h("div", { key: '70b5add96ff43f0eff9074822ad767b5b78e0e92', class: "options" }, index.h("slot", { key: "xv-dropdown-options" })), (this.helper || this.error || this.warning) && (index.h("p", { key: 'c5b425f7406751318f53f549584cff6892f8a173', class: "helper" }, this.error || this.warning || this.helper))));
|
|
329
|
+
}
|
|
330
|
+
componentWillLoad() {
|
|
331
|
+
this.setDefaultValues();
|
|
301
332
|
}
|
|
302
333
|
componentDidLoad() {
|
|
303
334
|
this.openChangeHandle();
|
|
@@ -320,13 +351,12 @@ const XvDropdownItem = class {
|
|
|
320
351
|
index.registerInstance(this, hostRef);
|
|
321
352
|
this.itemSelected = index.createEvent(this, "itemSelected", 7);
|
|
322
353
|
this.disabled = false;
|
|
323
|
-
this.value =
|
|
354
|
+
this.value = '';
|
|
324
355
|
this.selected = false;
|
|
325
356
|
}
|
|
326
357
|
handleClick() {
|
|
327
358
|
if (this.disabled)
|
|
328
359
|
return;
|
|
329
|
-
// this.selected = !this.selected;
|
|
330
360
|
this.itemSelected.emit({
|
|
331
361
|
selected: !this.selected,
|
|
332
362
|
value: this.value,
|
|
@@ -334,7 +364,11 @@ const XvDropdownItem = class {
|
|
|
334
364
|
});
|
|
335
365
|
}
|
|
336
366
|
render() {
|
|
337
|
-
return (index.h(index.Host, { key: '
|
|
367
|
+
return (index.h(index.Host, { key: '5f53db0c93d6268bdbcf67cac0fdb4f0e81348d8', class: "xv-dropdown-item", value: this.value, role: "option", tabindex: this.disabled ? -1 : false }, index.h("slot", { key: 'b19170a4eae7ee4580d9b486fc271766c304148f' }), this.selected && index.h("span", { key: 'c3abf41a488cf964fbc854d80ee59b7a111b3147', class: "checkmark" })));
|
|
368
|
+
}
|
|
369
|
+
componentWillLoad() {
|
|
370
|
+
if (!this.value)
|
|
371
|
+
this.value = this.el.innerText;
|
|
338
372
|
}
|
|
339
373
|
get el() { return index.getElement(this); }
|
|
340
374
|
};
|
|
@@ -1308,6 +1342,59 @@ const XvTag = class {
|
|
|
1308
1342
|
};
|
|
1309
1343
|
XvTag.style = XvTagV2Style0;
|
|
1310
1344
|
|
|
1345
|
+
var TextInputStatus;
|
|
1346
|
+
(function (TextInputStatus) {
|
|
1347
|
+
TextInputStatus["ERROR"] = "error";
|
|
1348
|
+
TextInputStatus["WARNING"] = "warning";
|
|
1349
|
+
TextInputStatus["DEF"] = "";
|
|
1350
|
+
})(TextInputStatus || (TextInputStatus = {}));
|
|
1351
|
+
|
|
1352
|
+
const xvTextInputCss = ":host{--text-input-padding-x:16px;--text-input-padding-y:11px;display:inline-flex;flex-direction:column;row-gap:calc(var(--text-input-padding-y) / 2);text-align:left;font-family:var(--ff-body, Tahoma)}:host .label{margin:0;color:var(--text-secondary, #515151);font-size:var(--fz-sm, 12px);font-weight:700;line-height:133.333%;letter-spacing:0.32px}:host .control{margin:0;position:relative;box-sizing:border-box;display:flex;column-gap:5px;align-items:center;flex-direction:row}:host .control input{background-color:var(--field-02, #FFF);border:1px solid var(--border-strong-01, #E3E3E3);border-radius:3px;padding-block:var(--text-input-padding-y);padding-inline-start:var(--text-input-padding-x);padding-inline-end:var(--text-input-padding-x);flex:1;outline:2px solid transparent;color:var(--text-primary, #333);font-size:var(--fz-md, 14px);font-style:normal;font-weight:400;line-height:128.571%;letter-spacing:0.16px;transition:0.2s ease-in-out border-color, 0.2s ease-in-out outline-color}:host .control input.withIcon{padding-inline-end:calc(var(--text-input-padding-x) + 22px)}:host .control input::placeholder{color:var(--text-placeholder, #ACACAC)}:host .control input:focus{outline:2px solid var(--focus, #273435)}:host .control_icon{position:absolute;top:calc(50% - 9px);right:var(--text-input-padding-y);width:18px;height:18px}:host .control_icon.error{color:var(--support-error, #F1290E)}:host .control_icon.warning{color:var(--support-warning, #FF7F04)}:host .helper{margin:0;color:var(--text-helper, #646464);font-size:var(--fz-sm, 12px);line-height:133.333%;letter-spacing:0.32px}:host([status=error]) .control input{border-color:var(--support-error, #F1290E)}:host([status=error]) .control input:focus{outline-color:var(--support-error, #F1290E)}:host([status=error]) .helper{color:var(--text-error, #D62512)}:host([readonly]) .control input{border-top-color:transparent;border-right-color:transparent;border-left-color:transparent;cursor:default;background-color:transparent}:host([readonly]) .control input:focus{outline-color:transparent}:host([disabled]){opacity:0.4}:host([disabled]) .control input{cursor:not-allowed}:host([size=xs]){--text-input-padding-y:4px;--text-input-padding-x:6px}:host([size=sm]){--text-input-padding-y:7px}:host([size=md]){--text-input-padding-y:11px}:host([size=lg]){--text-input-padding-y:15px}:host([size=xl]){--text-input-padding-y:16px;--text-input-padding-x:18px}";
|
|
1353
|
+
const XvTextInputV2Style0 = xvTextInputCss;
|
|
1354
|
+
|
|
1355
|
+
const XvTextInput = class {
|
|
1356
|
+
constructor(hostRef) {
|
|
1357
|
+
index.registerInstance(this, hostRef);
|
|
1358
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
1359
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
1360
|
+
}
|
|
1361
|
+
else {
|
|
1362
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
1363
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
1364
|
+
}
|
|
1365
|
+
this.helper = '';
|
|
1366
|
+
this.size = SIZE_VAR.MD;
|
|
1367
|
+
this.status = TextInputStatus.DEF;
|
|
1368
|
+
this.value = '';
|
|
1369
|
+
this.disabled = false;
|
|
1370
|
+
this.readonly = false;
|
|
1371
|
+
this.handleInput = (e) => {
|
|
1372
|
+
const target = e.target;
|
|
1373
|
+
this.value = target.value;
|
|
1374
|
+
this.internals.setFormValue(target.value);
|
|
1375
|
+
};
|
|
1376
|
+
this.getControlIcon = (status) => {
|
|
1377
|
+
switch (status) {
|
|
1378
|
+
case TextInputStatus.ERROR: {
|
|
1379
|
+
return (index.h("svg", { class: "control_icon error", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.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" })));
|
|
1380
|
+
}
|
|
1381
|
+
case TextInputStatus.WARNING:
|
|
1382
|
+
return (index.h("svg", { class: "control_icon warning", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, index.h("path", { fill: "currentColor", 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" })));
|
|
1383
|
+
default: return null;
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
render() {
|
|
1388
|
+
return (index.h(index.Host, { key: '4a16cd6ea36fd074e118bc262bf2aa50a32bbc90', name: this.name, class: "xv-text-input", role: "textbox", tabindex: this.disabled ? -1 : false }, this.label && index.h("label", { key: 'a18f098c242b7923951ad745d8fdca68289b6a1e', class: "label" }, this.label), index.h("div", { key: '3fc93834180279e5dfcc4b203e6e821e13acb539', class: "control" }, index.h("input", { key: '5d4b743dcb4c7afff9475f69b0127b478bc6a2a1', 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 && index.h("p", { key: 'e24b2c111e6fdba83006493d1fc7dcdf08256880', class: "helper" }, this.helper)));
|
|
1389
|
+
}
|
|
1390
|
+
componentWillLoad() {
|
|
1391
|
+
this.internals.setFormValue(this.value);
|
|
1392
|
+
}
|
|
1393
|
+
static get formAssociated() { return true; }
|
|
1394
|
+
get el() { return index.getElement(this); }
|
|
1395
|
+
};
|
|
1396
|
+
XvTextInput.style = XvTextInputV2Style0;
|
|
1397
|
+
|
|
1311
1398
|
const xvTooltipCss = ":host{position:relative;display:inline-block;cursor:pointer;line-height:0.5}:host::before,:host::after{position:absolute;opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out, transform 0.2s ease-in-out;z-index:10}:host::before{content:attr(tooltip);background:var(--background-inverse, #333);color:var(--icon-inverse, #fff);padding:var(--gap-sm, 5px) var(--gap-md, 16px);border-radius:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:70vw;font-family:var(--fz-body, Tahoma);font-size:var(fz-md, 14px);font-weight:400;line-height:18px;letter-spacing:0.16px}:host::after{content:\"\";border:6px solid transparent}:host(:hover)::before,:host(:hover)::after,:host(:focus)::before,:host(:focus)::after{opacity:1;visibility:visible}:host(.xv-tooltip_top)::before{bottom:100%;left:50%;transform:translateX(-50%) translateY(-5px)}:host(.xv-tooltip_top)::after{bottom:100%;left:50%;border-top-color:var(--background-inverse, #333);transform:translateX(-50%) translateY(5px)}:host(.xv-tooltip_top-left)::before{bottom:100%;left:0;transform:translateY(-5px)}:host(.xv-tooltip_top-left)::after{bottom:100%;left:10px;border-top-color:black;transform:translateY(5px)}:host(.xv-tooltip_top-right)::before{bottom:100%;right:0;transform:translateY(-5px)}:host(.xv-tooltip_top-right)::after{bottom:100%;right:10px;border-top-color:var(--background-inverse, #333);transform:translateY(5px)}:host(.xv-tooltip_bottom)::before{top:100%;left:50%;transform:translateX(-50%) translateY(5px)}:host(.xv-tooltip_bottom)::after{top:100%;left:50%;border-bottom-color:black;transform:translateX(-50%) translateY(-5px)}:host(.xv-tooltip_bottom-left)::before{top:100%;left:0;transform:translateY(5px)}:host(.xv-tooltip_bottom-left)::after{top:100%;left:10px;border-bottom-color:var(--background-inverse, #333);transform:translateY(-5px)}:host(.xv-tooltip_bottom-right)::before{top:100%;right:0;transform:translateY(5px)}:host(.xv-tooltip_bottom-right)::after{top:100%;right:10px;border-bottom-color:var(--background-inverse, #333);transform:translateY(-5px)}:host(.xv-tooltip_left)::before{right:100%;top:50%;transform:translateY(-50%) translateX(-5px)}:host(.xv-tooltip_left)::after{right:100%;top:50%;border-left-color:var(--background-inverse, #333);transform:translateY(-50%) translateX(5px)}:host(.xv-tooltip_right)::before{left:100%;top:50%;transform:translateY(-50%) translateX(5px)}:host(.xv-tooltip_right)::after{left:100%;top:50%;border-right-color:var(--background-inverse, #333);transform:translateY(-50%) translateX(-5px)}";
|
|
1312
1399
|
const XvTooltipV2Style0 = xvTooltipCss;
|
|
1313
1400
|
|
|
@@ -1322,7 +1409,7 @@ const XvTooltip = class {
|
|
|
1322
1409
|
this.position = 'top';
|
|
1323
1410
|
}
|
|
1324
1411
|
render() {
|
|
1325
|
-
return (index.h(index.Host, { key: '
|
|
1412
|
+
return (index.h(index.Host, { key: '3cbaa0f4193f8d41adfa47fac25a9e77b4deaa0d', tooltip: this.message, class: `xv-tooltip_${this.position}` }, index.h("slot", { key: '176f13a692ca159849dacf780030f1a71f22de87' }, index.h("svg", { key: '334581c0388fcf67337605189461f8d7433fbf8c', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: 16, height: 16 }, index.h("path", { key: 'd0bbcb1d8ed14bcc183d6dc3277873702510900e', 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" })))));
|
|
1326
1413
|
}
|
|
1327
1414
|
};
|
|
1328
1415
|
XvTooltip.style = XvTooltipV2Style0;
|
|
@@ -1353,6 +1440,7 @@ exports.xv_table_v2_row = XvTableRow;
|
|
|
1353
1440
|
exports.xv_table_v2_toolbar = XvTableToolbar;
|
|
1354
1441
|
exports.xv_tabs_v2 = XvTabs;
|
|
1355
1442
|
exports.xv_tag_v2 = XvTag;
|
|
1443
|
+
exports.xv_text_input_v2 = XvTextInput;
|
|
1356
1444
|
exports.xv_tooltip_v2 = XvTooltip;
|
|
1357
1445
|
|
|
1358
|
-
//# sourceMappingURL=xv-accordion-
|
|
1446
|
+
//# sourceMappingURL=xv-accordion-v2_28.cjs.entry.js.map
|