xv-webcomponents 0.1.39 → 0.1.42
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_27.cjs.entry.js → xv-accordion-v2_34.cjs.entry.js} +2323 -97
- package/dist/cjs/xv-accordion-v2_34.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/_vars.js +3 -0
- package/dist/collection/components/xv-data-table/_vars.js.map +1 -0
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.css +90 -0
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.js +182 -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-collapse/xv-data-table-collapse.css +7 -0
- package/dist/collection/components/xv-data-table/xv-data-table-collapse/xv-data-table-collapse.js +101 -0
- package/dist/collection/components/xv-data-table/xv-data-table-collapse/xv-data-table-collapse.js.map +1 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.css +71 -0
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.js +354 -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 +104 -0
- package/dist/collection/components/xv-data-table/xv-data-table.js +114 -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 +1 -1
- package/dist/collection/components/xv-link/xv-link.css +1 -0
- package/dist/collection/components/xv-link/xv-link.js +1 -1
- 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/_vars.js +0 -6
- package/dist/collection/components/xv-table/_vars.js.map +1 -1
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +4 -4
- 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.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/collection/types/enum.js +6 -0
- package/dist/collection/types/enum.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_27.entry.js → xv-accordion-v2_34.entry.js} +2317 -98
- package/dist/esm/xv-accordion-v2_34.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/_vars.d.ts +11 -0
- package/dist/types/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.d.ts +13 -0
- package/dist/types/components/xv-data-table/xv-data-table-collapse/xv-data-table-collapse.d.ts +9 -0
- package/dist/types/components/xv-data-table/xv-data-table-row/xv-data-table-row.d.ts +25 -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-number-input/xv-number-input.d.ts +26 -0
- package/dist/types/components/xv-table/_vars.d.ts +1 -5
- package/dist/types/components/xv-table/xv-table-cell/xv-table-cell.d.ts +2 -1
- 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 +761 -53
- package/dist/types/types/enum.d.ts +5 -0
- package/dist/xv-webcomponents/{p-054f5d59.entry.js → p-5b63a259.entry.js} +2 -2
- package/dist/xv-webcomponents/p-9c06f44c.entry.js +2 -0
- package/dist/xv-webcomponents/p-9c06f44c.entry.js.map +1 -0
- package/dist/xv-webcomponents/p-DLYJiP99.js +3 -0
- package/dist/xv-webcomponents/p-DLYJiP99.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_27.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_27.entry.js.map +0 -1
- package/dist/types/components/xv-text-input/_vars.d.ts +0 -5
- package/dist/xv-webcomponents/p-6a4cc790.entry.js +0 -2
- package/dist/xv-webcomponents/p-6a4cc790.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-MLh9SbX2.js');
|
|
4
4
|
var index$1 = require('./index-BE3kw7I4.js');
|
|
5
5
|
|
|
6
6
|
const xvAccordionCss = ":host{display:block}";
|
|
@@ -67,32 +67,87 @@ const XvAccordionItem = class {
|
|
|
67
67
|
};
|
|
68
68
|
XvAccordionItem.style = xvAccordionItemCss;
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
var SIZE_VAR;
|
|
71
|
+
(function (SIZE_VAR) {
|
|
72
|
+
SIZE_VAR["XS"] = "xs";
|
|
73
|
+
SIZE_VAR["SM"] = "sm";
|
|
74
|
+
SIZE_VAR["MD"] = "md";
|
|
75
|
+
SIZE_VAR["LG"] = "lg";
|
|
76
|
+
SIZE_VAR["XL"] = "xl";
|
|
77
|
+
})(SIZE_VAR || (SIZE_VAR = {}));
|
|
78
|
+
var XV_SORT_DIR;
|
|
79
|
+
(function (XV_SORT_DIR) {
|
|
80
|
+
XV_SORT_DIR["ASC"] = "asc";
|
|
81
|
+
XV_SORT_DIR["DESC"] = "desc";
|
|
82
|
+
XV_SORT_DIR["NONE"] = "none";
|
|
83
|
+
})(XV_SORT_DIR || (XV_SORT_DIR = {}));
|
|
84
|
+
|
|
85
|
+
const xvButtonV2Css = ":host{display:inline-block}:host([block]){display:block;width:100%}.xv-button{all:unset;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:3px;font-size:var(--fz-md);font-family:var(--ff-body, Tahoma);font-style:normal;font-weight:700;line-height:128.571%;letter-spacing:0.16px;cursor:pointer;position:relative;transition:background 0.2s, color 0.2s, border-color 0.2s;user-select:none;width:100%}.xv-button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}.xv-button--xs{--xv-button-icon-size:16px;padding:var(--spacing-02);height:var(--xv-button-icon-size)}.xv-button--sm{--xv-button-icon-size:32px;padding:var(--spacing-03);height:var(--xv-button-icon-size)}.xv-button--md{--xv-button-icon-size:40px;padding:var(--spacing-04);height:var(--xv-button-icon-size)}.xv-button--lg{--xv-button-icon-size:48px;padding:var(--spacing-05);height:var(--xv-button-icon-size)}.xv-button--xl{--xv-button-icon-size:60px;font-size:1.1em;padding:var(--spacing-06);height:auto}.xv-button--primary{background-color:var(--button-primary);color:var(--text-on-color)}.xv-button--primary:hover{background-color:var(--button-primary-hover)}.xv-button--primary:active{background-color:var(--button-primary-active)}.xv-button--accent{background-color:var(--button-accent);color:var(--text-on-color)}.xv-button--accent:hover{background-color:var(--button-accent-hover)}.xv-button--accent:active{background-color:var(--button-accent-active)}.xv-button--secondary{background-color:var(--button-secondary);border:1px solid var(--border-subtle-01)}.xv-button--secondary:hover{background-color:var(--button-secondary-hover)}.xv-button--secondary:active{background-color:var(--button-secondary-active)}.xv-button--danger{background:var(--support-error);color:white}.xv-button--danger:hover{background-color:#ba1b23}.xv-button--danger:active{background-color:#750e13}.xv-button--danger:disabled{background-color:var(--button-disabled);border-color:transparent;color:var(--text-on-color-disabled, #8B8B8B)}.xv-button--tertiary{background-color:transparent;border:1px solid var(--button-tertiary)}.xv-button--tertiary:hover{background-color:var(--button-tertiary-hover)}.xv-button--tertiary:active{background-color:var(--button-tertiary-active)}.xv-button--tertiary:disabled{color:var(--text-disabled);border-color:var(--button-disabled, #D1D1D1);background-color:transparent}.xv-button--ghost{background-color:transparent;color:var(--text-primary)}.xv-button--ghost:hover{background-color:transparent}.xv-button--ghost:active{background-color:rgba(139, 139, 139, 0.5)}.xv-button--ghost:disabled{color:var(--text-disabled);border-color:transparent;background-color:transparent}.xv-button--primary:disabled,.xv-button--accent:disabled,.xv-button--secondary:disabled,.xv-button--danger:disabled{border-color:var(--border-subtle-01, #D1D1D1);background-color:var(--button-disabled, #D1D1D1);color:var(--text-on-color-disabled, #8B8B8B)}.xv-button--disabled{cursor:not-allowed}.xv-button--loading{pointer-events:none;opacity:0.8}.xv-button__label{display:inline-flex;align-items:center}.xv-button__loader{position:absolute;left:50%;transform:translateX(-50%)}.xv-button__icon{display:inline-flex;align-items:center}.xv-button--icon-left .xv-button__icon--left{margin-inline-end:var(--spacing-05)}.xv-button--icon-right .xv-button__icon--right{margin-inline-start:var(--spacing-05)}.xv-button--icon-only{padding:0;width:var(--xv-button-icon-size, 40px);height:var(--xv-button-icon-size, 40px);justify-content:center}.xv-button--icon-only .xv-button__icon{margin:0}";
|
|
71
86
|
|
|
72
87
|
const XvButton = class {
|
|
73
88
|
constructor(hostRef) {
|
|
74
89
|
index.registerInstance(this, hostRef);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
90
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
91
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
95
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
96
|
+
}
|
|
97
|
+
/** Button variants */
|
|
98
|
+
this.variant = 'primary';
|
|
99
|
+
/** Button size */
|
|
100
|
+
this.size = SIZE_VAR.MD;
|
|
101
|
+
/** Button disabled state */
|
|
102
|
+
this.disabled = false;
|
|
103
|
+
/** Button loading state */
|
|
104
|
+
this.loading = false;
|
|
105
|
+
/** Button for full width */
|
|
79
106
|
this.block = false;
|
|
80
107
|
/** Button type */
|
|
81
108
|
this.type = 'button';
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
109
|
+
this.hasLeftIcon = false;
|
|
110
|
+
this.hasRightIcon = false;
|
|
111
|
+
this.hasContent = false;
|
|
112
|
+
this.handleSlotChangeLeft = (event) => {
|
|
113
|
+
this.hasLeftIcon = event.target.assignedElements().length > 0;
|
|
114
|
+
};
|
|
115
|
+
this.handleSlotChangeContent = (event) => {
|
|
116
|
+
this.hasContent = event.target.assignedNodes().some(node => {
|
|
117
|
+
var _a;
|
|
118
|
+
return node.nodeType === Node.ELEMENT_NODE ||
|
|
119
|
+
(node.nodeType === Node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== '');
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
this.handleSlotChangeRight = (event) => {
|
|
123
|
+
this.hasRightIcon = event.target.assignedElements().length > 0;
|
|
124
|
+
};
|
|
125
|
+
this.handleClick = () => {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
if (this.type === 'submit') {
|
|
128
|
+
(_a = this.internals.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
|
|
129
|
+
}
|
|
130
|
+
else if (this.type === 'reset') {
|
|
131
|
+
(_b = this.internals.form) === null || _b === void 0 ? void 0 : _b.reset();
|
|
132
|
+
}
|
|
91
133
|
};
|
|
92
134
|
}
|
|
93
135
|
render() {
|
|
94
|
-
|
|
136
|
+
var _a;
|
|
137
|
+
return (index.h(index.Host, { key: 'ad8e2051c6023d13626e65861099114e2ff06db2' }, index.h("button", { key: '1f2b8e13a29a63b3f50ced928a83e92d0eb5c0ea', class: {
|
|
138
|
+
'xv-button': true,
|
|
139
|
+
[`xv-button--${this.variant}`]: !!this.variant,
|
|
140
|
+
[`xv-button--${this.size}`]: !!this.size,
|
|
141
|
+
'xv-button--disabled': this.disabled || this.loading,
|
|
142
|
+
'xv-button--block': this.block,
|
|
143
|
+
'xv-button--loading': this.loading,
|
|
144
|
+
'xv-button--icon-left': this.hasLeftIcon,
|
|
145
|
+
'xv-button--icon-right': this.hasRightIcon,
|
|
146
|
+
'xv-button--icon-only': !this.hasContent,
|
|
147
|
+
}, part: "button", onClick: this.handleClick, type: this.type, disabled: this.disabled || this.loading, "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": ((_a = this.el) === null || _a === void 0 ? void 0 : _a.ariaLabel) || 'XV button' }, this.loading && (index.h("xv-loader-v2", { key: 'a7c55e4823b233f845f1a9e5e654f2c98a88001d', class: "xv-button__loader", size: this.size !== SIZE_VAR.XL ? this.size : SIZE_VAR.LG })), index.h("span", { key: '57f0ced69f7022ba8b602083b69fa2804061ccef', class: "xv-button__icon xv-button__icon--left" }, index.h("slot", { key: '8c6c0c1a12bfafe6a3674352b5e8ba77e0562eb3', name: "icon-left", onSlotchange: this.handleSlotChangeLeft })), index.h("span", { key: '8e19d4691b333a0d70a76ed476f59bacfeefa963', class: "xv-button__label" }, index.h("slot", { key: 'c9d9896b34e3137442b11db5d4f44d097d952d37', onSlotchange: this.handleSlotChangeContent }, this.label)), index.h("span", { key: '25a3256dff8ec326c081601dd46cff45149a7683', class: "xv-button__icon xv-button__icon--right" }, index.h("slot", { key: '90505c36d3620fa19c3d01fc1e66cc57e705a8db', name: "icon-right", onSlotchange: this.handleSlotChangeRight })))));
|
|
95
148
|
}
|
|
149
|
+
static get formAssociated() { return true; }
|
|
150
|
+
get el() { return index.getElement(this); }
|
|
96
151
|
};
|
|
97
152
|
XvButton.style = xvButtonV2Css;
|
|
98
153
|
|
|
@@ -104,12 +159,12 @@ const XvCard = class {
|
|
|
104
159
|
this.variant = 'vertical';
|
|
105
160
|
}
|
|
106
161
|
render() {
|
|
107
|
-
return (index.h(index.Host, { key: '
|
|
162
|
+
return (index.h(index.Host, { key: '7c19e1d91f9040c116dc18d6f58be859e66b0629', class: `xv-card xv-card_${this.variant}`, part: this.variant }, index.h("div", { key: '8ef942983bc31d278810372bfed3fe4cb8f1922a', class: "xv-card_media" }, index.h("slot", { key: '86bc68bcb80c563a91448c15ab1ebd89c1e5b245', name: "media" }, this.media && index.h("img", { key: 'c4351a7426b5b73ed37f038f1f355dcf46dae597', class: "xv-card_media__content", src: this.media, alt: this.header }))), index.h("div", { key: '906393c52bb7c27bfbc9527dfba34f712ec8a420', class: "xv-card_content" }, index.h("div", { key: 'd703353d99066a4f395f126f0ec8aa462c7a5c7b', class: "xv-card_header" }, index.h("slot", { key: '4fb9c65d701629dce6f99c8ad871adbd7659ecdd', name: "header" }, this.header && index.h("p", { key: 'e4a3f971b5dca8cdf3e44c9ba2a37baeff67fd59', class: "xv-card_header__content" }, this.header))), index.h("div", { key: '7029219d670fe9a94e5c50f657f5f2f2d45a2edb', class: "xv-card_body" }, index.h("slot", { key: '0f570bb3938b6c44e8cc3fb004ed1d7c487fb5a7', name: "body" }, this.body && index.h("p", { key: '02fc0abdc52c3a0bf833c0bfe24ec573f1457f21', class: "xv-card_body__content" }, this.header))), index.h("div", { key: '9734dca4512ace0e29e332acce27bf01c8a05e24', class: "xv-card_footer" }, index.h("slot", { key: '3cf0141845baf68e0149b823b921705978953ade', name: "footer" }, this.footer)))));
|
|
108
163
|
}
|
|
109
164
|
};
|
|
110
165
|
XvCard.style = xvCardCss;
|
|
111
166
|
|
|
112
|
-
const xvCheckboxCss = ":host{--checkbox-size:max(1rem, 16px);box-sizing:border-box;display:inline-flex;flex-direction:column}:host([error]) .xv-checkbox .checkmark{border-color:var(--text-error, #D62512)}.error,[name=info]{display:inline-flex;align-items:center;justify-content:flex-start;font-size:var(--fz-sm, 12px);font-family:var(--ff-body, Tahoma);line-height:133.333%;letter-spacing:0.32px}.error{margin-top:var(--gap-xs, 5px);color:var(--text-error, #D62512)}.error::before{margin-right:var(--gap-xs, 5px);content:\"!\";display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;font-size:var(--fz-sm, 12px);font-weight:bold;color:white;background-color:var(--text-error, #D62512);border-radius:50%}.xv-checkbox{display:inline-flex;align-items:center;cursor:pointer;user-select:none}.xv-checkbox input[type=checkbox]{position:absolute;width:var(--checkbox-size);height:var(--checkbox-size);margin:0;padding:0;opacity:0;pointer-events:none;box-sizing:border-box}.xv-checkbox .checkmark{width:var(--checkbox-size);min-width:var(--checkbox-size);height:var(--checkbox-size);min-height:var(--checkbox-size);box-sizing:border-box;margin:0;padding:0;border:1.4px solid var(--icon-primary, #D1D1D1);border-radius:2px;background-color:var(--background, #FFF);transition:all 0.2s ease;display:inline-flex;align-items:center;justify-content:center}.xv-checkbox input:checked+.checkmark{background-color:var(--background-brand, #97BF0D);border-color:var(--background-brand, #97BF0D)}.xv-checkbox input:checked+.checkmark:not(.checkmark-partial)::after{content:\"\";width:calc(var(--checkbox-size) / 4);height:calc(var(--checkbox-size) / 2.5);border:solid var(--background, #FFF);margin-bottom:calc(var(--checkbox-size) / 10);border-width:0 2px 2px 0;transform:rotate(45deg);display:block}.xv-checkbox input:checked+.checkmark.checkmark-partial::after{content:\"\";width:calc(var(--checkbox-size) / 3);height:calc(var(--checkbox-size) / 10);background-color:var(--background, #FFF)}.xv-checkbox input:focus+.checkmark{outline:1.4px solid var(--focus, #8B8B8B)}.xv-checkbox .label{color:var(--text-primary, #333);font-family:var(--ff-body, Tahoma);font-size:var(--fz-md, 14px);line-height:128.571%;letter-spacing:0.16px}.xv-checkbox .label_str,.xv-checkbox .label ::slotted(*){margin-left:8px}.xv-checkbox.readonly{cursor:initial}.xv-checkbox.readonly input:checked+.checkmark{background-color:var(--background, #FFF);border:1.4px solid var(--icon-disabled, #D1D1D1)}.xv-checkbox.readonly input:checked+.checkmark:after{border-color:var(--icon-primary, #131313)}.xv-checkbox.readonly input:checked+.checkmark-partial:after{background-color:var(--icon-primary, #131313)}.xv-checkbox.readonly .checkmark{border:1.4px solid var(--icon-disabled, #D1D1D1)}.xv-checkbox.readonly .label{color:var(--text-primary, #333)}.xv-checkbox.disabled{cursor:not-allowed}.xv-checkbox.disabled .checkmark{border:1.4px solid var(--icon-disabled, #D1D1D1)}.xv-checkbox.disabled .label{color:var(--text-disabled, rgba(19, 19, 19, 0.25))}";
|
|
167
|
+
const xvCheckboxCss = ":host{--checkbox-size:max(1rem, 16px);box-sizing:border-box;display:inline-flex;flex-direction:column;overflow:visible !important}:host([error]) .xv-checkbox .checkmark{border-color:var(--text-error, #D62512)}.error,[name=info]{display:inline-flex;align-items:center;justify-content:flex-start;font-size:var(--fz-sm, 12px);font-family:var(--ff-body, Tahoma);line-height:133.333%;letter-spacing:0.32px}.error{margin-top:var(--gap-xs, 5px);color:var(--text-error, #D62512)}.error::before{margin-right:var(--gap-xs, 5px);content:\"!\";display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;font-size:var(--fz-sm, 12px);font-weight:bold;color:white;background-color:var(--text-error, #D62512);border-radius:50%}.xv-checkbox{display:inline-flex;align-items:center;cursor:pointer;user-select:none}.xv-checkbox input[type=checkbox]{position:absolute;width:var(--checkbox-size);height:var(--checkbox-size);margin:0;padding:0;opacity:0;pointer-events:none;box-sizing:border-box}.xv-checkbox .checkmark{width:var(--checkbox-size);min-width:var(--checkbox-size);height:var(--checkbox-size);min-height:var(--checkbox-size);box-sizing:border-box;margin:0;padding:0;border:1.4px solid var(--icon-primary, #D1D1D1);border-radius:2px;background-color:var(--background, #FFF);transition:all 0.2s ease;display:inline-flex;align-items:center;justify-content:center}.xv-checkbox input:checked+.checkmark{background-color:var(--background-brand, #97BF0D);border-color:var(--background-brand, #97BF0D)}.xv-checkbox input:checked+.checkmark:not(.checkmark-partial)::after{content:\"\";position:absolute;width:calc(var(--checkbox-size) / 4);height:calc(var(--checkbox-size) / 2.5);border:solid var(--background, #FFF);margin-bottom:calc(var(--checkbox-size) / 10);border-width:0 2px 2px 0;transform:rotate(45deg);display:block}.xv-checkbox input:checked+.checkmark.checkmark-partial::after{content:\"\";position:absolute;width:calc(var(--checkbox-size) / 3);height:calc(var(--checkbox-size) / 10);background-color:var(--background, #FFF)}.xv-checkbox input:focus+.checkmark{outline:1.4px solid var(--focus, #8B8B8B)}.xv-checkbox .label{color:var(--text-primary, #333);font-family:var(--ff-body, Tahoma);font-size:var(--fz-md, 14px);line-height:128.571%;letter-spacing:0.16px}.xv-checkbox .label_str,.xv-checkbox .label ::slotted(*){margin-left:8px}.xv-checkbox.readonly{cursor:initial}.xv-checkbox.readonly input:checked+.checkmark{background-color:var(--background, #FFF);border:1.4px solid var(--icon-disabled, #D1D1D1)}.xv-checkbox.readonly input:checked+.checkmark:after{border-color:var(--icon-primary, #131313)}.xv-checkbox.readonly input:checked+.checkmark-partial:after{background-color:var(--icon-primary, #131313)}.xv-checkbox.readonly .checkmark{border:1.4px solid var(--icon-disabled, #D1D1D1)}.xv-checkbox.readonly .label{color:var(--text-primary, #333)}.xv-checkbox.disabled{cursor:not-allowed}.xv-checkbox.disabled .checkmark{border:1.4px solid var(--icon-disabled, #D1D1D1)}.xv-checkbox.disabled .label{color:var(--text-disabled, rgba(19, 19, 19, 0.25))}";
|
|
113
168
|
|
|
114
169
|
const XvCheckbox = class {
|
|
115
170
|
constructor(hostRef) {
|
|
@@ -183,7 +238,7 @@ const XvCheckbox = class {
|
|
|
183
238
|
}
|
|
184
239
|
}
|
|
185
240
|
render() {
|
|
186
|
-
return (index.h(index.Host, { key: '
|
|
241
|
+
return (index.h(index.Host, { key: '9eb988ec6a7a02392b4ed77685eed2bc5814c137' }, index.h("label", { key: '3e4c7112c959897c5b61cbcff890eaf437e476fc', class: { 'xv-checkbox': true, disabled: this.disabled, readonly: this.readonly } }, index.h("input", { key: '3a2e68b5780ae3951f86d30f9b2e8d9af1805e97', ref: el => (this.inputEl = el), type: "checkbox", readonly: this.readonly, name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.readonly, required: this.required, indeterminate: this.indeterminate, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur }), index.h("span", { key: 'b57f073a258a1ea15d04969a68eab7c36023e596', class: `checkmark ${this.partial ? 'checkmark-partial' : ''}` }), index.h("div", { key: '1abe0c133bf203b228b86bd68053856b79cdf170', class: "label" }, index.h("slot", { key: '155a80701f1a050a73a0079308de0b932407549e' }, this.label && index.h("span", { key: 'f9d493bfb663fcf91712b754b4c1b841d10beb05', class: "label_str" }, this.label)))), index.h("slot", { key: 'fae7055dc73235126a633a705b6e8f045a20954c', name: "info" }), !!this.error && index.h("span", { key: '5c3bb7d31289862bf421614ee9906671e65c1b7c', class: "error" }, this.error)));
|
|
187
242
|
}
|
|
188
243
|
componentDidLoad() {
|
|
189
244
|
if (this.indeterminate) {
|
|
@@ -209,18 +264,145 @@ const XvCheckbox = class {
|
|
|
209
264
|
};
|
|
210
265
|
XvCheckbox.style = xvCheckboxCss;
|
|
211
266
|
|
|
212
|
-
var
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
267
|
+
const xvDataTableCss = ":host{--xv-data-table-border-width:1px;--xv-data-table-border-color:var(--border-subtle-01, #D1D1D1);--xv-data-table-padding-x:var(--spacing-05, 16px);--xv-data-table-padding-y:var(--spacing-05, 16px);--xv-data-table-row-bg:transparent;width:inherit;text-align:left;color:var(--text-primary, #333);font-family:var(--ff-body, Tahoma);font-size:var(--fz-md, 14px);line-height:18px;letter-spacing:0.16px}@media screen and (max-width: 980px){:host{display:block;position:relative;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--layer-accent-03) transparent}:host ::slotted([slot=title]),:host>table{min-width:1000px}}:host .bar{position:sticky;left:0}:host .bar_batch{position:absolute;bottom:0;left:0;right:0;pointer-events:unset;user-select:unset;z-index:2;background-color:var(--interactive-01, #273435);color:var(--text-on-color, #fff);border-radius:3px 3px 0 0;display:flex;align-items:center}:host .bar_toolbar{z-index:1;border-radius:3px 3px 0 0}:host ::slotted([slot=title]){margin:0 !important;color:var(--text-primary, #333) !important;font-family:var(--ff-heading, \"Gill Sans\") !important;font-size:var(--fz-xl, 21px) !important;text-align:left;font-style:normal !important;font-weight:400 !important;line-height:normal !important;padding:var(--spacing-05) var(--spacing-05) var(--spacing-06) !important}:host ::slotted([slot=toolbar]){margin-bottom:var(--spacing-03)}:host>table{width:inherit;border-collapse:collapse;table-layout:fixed;border-left:1px solid var(--xv-data-table-border-color);border-right:1px solid var(--xv-data-table-border-color)}:host>caption{display:contents}:host([block]){width:100%}:host([block])>table{table-layout:fixed}:host([size=xs]){--xv-data-table-padding-x:var(--spacing-02, 4px);--xv-data-table-padding-y:var(--spacing-02, 4px)}:host([size=sm]){--xv-data-table-padding-x:var(--spacing-04, 12px);--xv-data-table-padding-y:var(--spacing-03, 8px)}:host([size=md]){--xv-data-table-padding-x:var(--spacing-05, 16px);--xv-data-table-padding-y:var(--spacing-05, 16px)}:host([size=lg]){--xv-data-table-padding-x:var(--spacing-05, 16px);--xv-data-table-padding-y:var(--spacing-06, 24px)}:host([size=xl]){--xv-data-table-padding-x:var(--spacing-06, 24px);--xv-data-table-padding-y:var(--spacing-07, 32px)}";
|
|
268
|
+
|
|
269
|
+
const XvDataTable = class {
|
|
270
|
+
constructor(hostRef) {
|
|
271
|
+
index.registerInstance(this, hostRef);
|
|
272
|
+
this.size = SIZE_VAR.MD;
|
|
273
|
+
this.columnWidths = [];
|
|
274
|
+
this.hover = false;
|
|
275
|
+
}
|
|
276
|
+
render() {
|
|
277
|
+
return (index.h(index.Host, { key: '207324db4e9adea03e0137788fa43f8e9a7eb677', class: "xv-data-table" }, index.h("caption", { key: 'f5925136510194c00db68b12ef921f6e68b56904' }, index.h("slot", { key: 'b0b40ae6031c154f75f84587c4fa54f2c86fb011', name: "title" })), index.h("div", { key: '69121d921fcdc8f1c82e44d7eede6cdcab9e22d4', class: "bar" }, index.h("div", { key: '6b3db04362ba12983581946f00a66738dee3c2da', class: "bar_batch" }, index.h("slot", { key: 'caac537802365f29fefb13ac7f2c3060849ac47e', name: "batch" })), index.h("div", { key: 'b918df57e54dca14d66dd8a14994ceab12ff7ad2', class: "bar_toolbar" }, index.h("slot", { key: 'a567d9d6258abf3b3ed888e5ecee3817962949f6', name: "toolbar" }))), index.h("table", { key: 'fd0e463d79710b09db9a6e5655279d6c6591ed2e', role: "table" }, this.columnWidths.length > 0 && (index.h("colgroup", { key: '05aa18155327d5ecb1c62081dc081efb1f3b8db3' }, this.columnWidths.map((width = 'auto') => index.h("col", { style: { width } })))), index.h("slot", { key: 'f95cdd075cad05b53bf8e3cef85eccd908c1191f' }))));
|
|
278
|
+
}
|
|
279
|
+
get el() { return index.getElement(this); }
|
|
280
|
+
};
|
|
281
|
+
XvDataTable.style = xvDataTableCss;
|
|
282
|
+
|
|
283
|
+
const xvDataTableCellCss = "@charset \"UTF-8\";:host{display:table-cell;border-style:solid;border-left-width:0;border-right-width:0;border-top-width:var(--xv-data-table-border-width, 0);border-bottom-width:var(--xv-data-table-border-width, 0);border-color:var(--xv-data-table-border-color, transparent);padding-inline:var(--xv-data-table-padding-x, 0);padding-block:var(--xv-data-table-padding-y, 0);vertical-align:middle;word-break:break-all;font-style:normal;font-weight:400}:host .line-clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}:host(:not(.multiline)){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host(:not(.multiline)) ::slotted(*){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([sort]){position:relative;cursor:pointer;user-select:none}:host([sort]):before,:host([sort]):after{font-size:12px;line-height:10px;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;right:8px;pointer-events:none;transition:350ms ease-in-out opacity;opacity:0}:host([sort]):before{content:\"▲\";top:50%;transform:translateY(calc(-50% - 5px))}:host([sort])::after{content:\"▼\";top:50%;transform:translateY(calc(-50% + 5px))}:host([sort]:hover){background-color:var(--layer-accent-hover-01, #E3E3E3)}:host([sort]:hover)::before,:host([sort]:hover)::after{opacity:1}:host([sort=asc]){background-color:var(--layer-accent-active-01, #D1D1D1)}:host([sort=asc])::before{opacity:1}:host([sort=asc])::after{display:none}:host([sort=desc]){background-color:var(--layer-accent-active-01, #D1D1D1)}:host([sort=desc])::before{display:none}:host([sort=desc])::after{opacity:1}";
|
|
284
|
+
|
|
285
|
+
const XvDataTableCell = class {
|
|
286
|
+
constructor(hostRef) {
|
|
287
|
+
index.registerInstance(this, hostRef);
|
|
288
|
+
this.sortChange = index.createEvent(this, "sortChange");
|
|
289
|
+
}
|
|
290
|
+
handleSort() {
|
|
291
|
+
if (this.sort === undefined)
|
|
292
|
+
return;
|
|
293
|
+
let sort = this.sort;
|
|
294
|
+
if (this.sort === '')
|
|
295
|
+
sort = XV_SORT_DIR.NONE;
|
|
296
|
+
this.sort = sort === XV_SORT_DIR.NONE ?
|
|
297
|
+
XV_SORT_DIR.ASC : sort === XV_SORT_DIR.ASC ?
|
|
298
|
+
XV_SORT_DIR.DESC : XV_SORT_DIR.NONE;
|
|
299
|
+
index$1.forEach(this.el.parentElement.children, (cell) => {
|
|
300
|
+
if (cell !== this.el && cell.hasAttribute('sort')) {
|
|
301
|
+
cell.setAttribute('sort', 'none');
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
if (!this.name)
|
|
305
|
+
this.name = index$1.uidGenerator();
|
|
306
|
+
this.sortChange.emit(this.sort);
|
|
307
|
+
}
|
|
308
|
+
;
|
|
309
|
+
render() {
|
|
310
|
+
return (index.h(index.Host, { key: 'bfc254739fa56d47210d43d134ba6c3534c5e567', role: "cell", style: { width: this.width }, class: {
|
|
311
|
+
multiline: this.multiline !== undefined,
|
|
312
|
+
[`align--${this.align}`]: !!this.align
|
|
313
|
+
} }, !this.multiline || isNaN(this.multiline) ? index.h("slot", null) : (index.h("div", { class: "line-clamp", style: { ['-webkit-line-clamp']: `${this.multiline}` } }, index.h("slot", null)))));
|
|
314
|
+
}
|
|
315
|
+
get el() { return index.getElement(this); }
|
|
316
|
+
};
|
|
317
|
+
XvDataTableCell.style = xvDataTableCellCss;
|
|
318
|
+
|
|
319
|
+
const XV_DATA_TABLE_TAG = 'xv-data-table';
|
|
320
|
+
const XV_DATA_TABLE_ROW_TAG = 'xv-data-table-row';
|
|
321
|
+
|
|
322
|
+
const xvDataTableCollapseCss = ":host([collapsed]){display:none}:host([expanded]){display:contents}";
|
|
323
|
+
|
|
324
|
+
const XvDataTableCollapse = class {
|
|
325
|
+
constructor(hostRef) {
|
|
326
|
+
index.registerInstance(this, hostRef);
|
|
327
|
+
this.collapsedChange = index.createEvent(this, "collapsedChange");
|
|
328
|
+
this.collapsed = false;
|
|
329
|
+
}
|
|
330
|
+
async setCollapsed(collapsed) {
|
|
331
|
+
this.collapsed = collapsed;
|
|
332
|
+
this.collapsedChange.emit(this.collapsed);
|
|
333
|
+
return this.collapsed;
|
|
334
|
+
}
|
|
335
|
+
componentWillLoad() {
|
|
336
|
+
const table = this.el.closest(XV_DATA_TABLE_TAG);
|
|
337
|
+
const rows = table.querySelectorAll(XV_DATA_TABLE_ROW_TAG);
|
|
338
|
+
rows.forEach((row) => row === null || row === void 0 ? void 0 : row.setAttribute('collapsable', ''));
|
|
339
|
+
}
|
|
340
|
+
render() {
|
|
341
|
+
return (index.h(index.Host, { key: '7704e9d073c449d3efd35bada4f632129378308e', id: this.el.id, part: "xv-collapse", class: this.el.className, collapsed: this.collapsed, expanded: !this.collapsed }, index.h("slot", { key: 'a9684bbe4c0bf29fdf12c81344236d1b38865fd3' })));
|
|
342
|
+
}
|
|
343
|
+
get el() { return index.getElement(this); }
|
|
344
|
+
};
|
|
345
|
+
XvDataTableCollapse.style = xvDataTableCollapseCss;
|
|
346
|
+
|
|
347
|
+
const xvDataTableRowCss = ":host{display:table-row;background-color:var(--xv-data-table-row-bg, transparent);transition:0.2s ease-in-out background-color}:host .cell-control{font-size:8px;max-width:16px;position:relative;padding-left:calc(var(--xv-data-table-padding-x) + var(--xv-data-table-padding-x) + 10px + 1em);overflow:visible}:host .cell-control_collapse{font-size:inherit;width:1em;height:1em;margin:0;padding:0;position:absolute;overflow:visible;background-color:transparent;outline:none;top:calc(50% - 0.7em);left:var(--xv-data-table-padding-x);display:inline-flex;border-top:none;border-left:none;border-right:2px solid var(--icon-primary, #333);border-bottom:2px solid var(--icon-primary, #333);transform:rotate(45deg);transform-origin:center center;transition:0.2s ease-in-out transform, 0.2s ease-in-out opacity;cursor:pointer;box-sizing:content-box}:host .cell-control_collapse:active{opacity:0.4}:host .cell-control_collapse.open{transform:rotate(-135deg)}:host .cell-control_checkbox{display:flex}:host(.hover:not([header]):hover){background-color:var(--layer-hover-01, #E9E9E9)}:host([header]){background-color:var(--layer-accent-01, #F7F7F7)}:host(.checked){background-color:var(--layer-selected-01, #E3E3E3)}:host(.hover.checked:hover){background-color:var(--layer-selected-hover-01, #DADADA)}:host([footer]),:host([footer]:hover),:host([footer].hover),:host([footer].hover:hover){background-color:var(--layer-accent-02, #E3E3E3)}:host([disabled]){opacity:0.5}";
|
|
348
|
+
|
|
349
|
+
const XvDataTableRow = class {
|
|
350
|
+
constructor(hostRef) {
|
|
351
|
+
index.registerInstance(this, hostRef);
|
|
352
|
+
this.check = index.createEvent(this, "check");
|
|
353
|
+
this.checked = false;
|
|
354
|
+
this.partial = false;
|
|
355
|
+
this.hover = false;
|
|
356
|
+
this.header = false;
|
|
357
|
+
this.footer = false;
|
|
358
|
+
this.disabled = false;
|
|
359
|
+
this.readonly = false;
|
|
360
|
+
this.required = false;
|
|
361
|
+
this.collapsed = false;
|
|
362
|
+
this.collapseClick = async () => {
|
|
363
|
+
var _a;
|
|
364
|
+
if (!this.collapse || !this.collapseEl)
|
|
365
|
+
return;
|
|
366
|
+
this.collapsed = !this.collapsed;
|
|
367
|
+
await ((_a = this.collapseEl) === null || _a === void 0 ? void 0 : _a.setCollapsed(this.collapsed));
|
|
368
|
+
};
|
|
369
|
+
this.setInitialState = () => {
|
|
370
|
+
var _a;
|
|
371
|
+
if (this.collapse && !this.collapseEl) {
|
|
372
|
+
this.collapseEl = this.el.parentElement.querySelector(`xv-data-table-collapse${this.collapse}`);
|
|
373
|
+
this.collapsed = (_a = this.collapseEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('collapsed');
|
|
374
|
+
}
|
|
375
|
+
if (!this.hover) {
|
|
376
|
+
const table = this.el.closest(XV_DATA_TABLE_TAG);
|
|
377
|
+
this.hover = table.hasAttribute('hover');
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
this.checkedChangeHandle = ({ detail: checked }) => {
|
|
381
|
+
if (!checked && this.partial)
|
|
382
|
+
this.partial = checked;
|
|
383
|
+
if (!this.name)
|
|
384
|
+
this.name = index$1.uidGenerator();
|
|
385
|
+
this.check.emit({
|
|
386
|
+
checked,
|
|
387
|
+
name: this.name,
|
|
388
|
+
value: this.value,
|
|
389
|
+
partial: this.partial,
|
|
390
|
+
header: this.header,
|
|
391
|
+
footer: this.footer,
|
|
392
|
+
expandable: !!this.collapseEl,
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
render() {
|
|
397
|
+
return (index.h(index.Host, { key: '4e452026f2b03d8d54811cb1de7342bc0a4d38b1', role: "row", part: "xv-row", class: { checked: this.checked, hover: this.hover } }, (!!this.variant || this.collapsable) && (index.h("xv-data-table-cell", { key: '28d1bb41ac6c4de32701315e1a201892041d4b42', width: !!this.variant ? '16px' : '0', class: "cell-control" }, !!this.collapse && (index.h("button", { key: 'b7d4c5d1e8121ce9797ca292d7367df734b356fe', class: { 'cell-control_collapse': true, open: !this.collapsed }, onClick: this.collapseClick })), this.variant === 'checkbox' && (index.h("xv-checkbox-v2", { key: '6095d07a8626988bb863317284fb3ebd137ef58a', name: this.name, partial: this.partial, checked: this.checked || this.partial, disabled: this.disabled, readonly: this.readonly, required: this.required, onEventChange: this.checkedChangeHandle, class: "cell-control_checkbox" })))), index.h("slot", { key: '0ae007a4595a3cc854246c2e46d058df0f596b17', onSlotchange: this.setInitialState })));
|
|
398
|
+
}
|
|
399
|
+
get el() { return index.getElement(this); }
|
|
400
|
+
};
|
|
401
|
+
XvDataTableRow.style = xvDataTableRowCss;
|
|
220
402
|
|
|
221
403
|
const DropdownItemSelector = '.xv-dropdown-item';
|
|
222
404
|
|
|
223
|
-
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: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}";
|
|
405
|
+
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{display:block;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;margin-bottom:8px}: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 .label_info{margin-left:var(--spacing-02)}: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: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:4px 0 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}";
|
|
224
406
|
|
|
225
407
|
const XvDropdown = class {
|
|
226
408
|
constructor(hostRef) {
|
|
@@ -316,7 +498,7 @@ const XvDropdown = class {
|
|
|
316
498
|
this.changeSelection.emit(this.setSelected(this.selectedMap, optionElements));
|
|
317
499
|
}
|
|
318
500
|
render() {
|
|
319
|
-
return (index.h(index.Host, { key: '
|
|
501
|
+
return (index.h(index.Host, { key: '556a488d40dfcf1510f183fefbbf9d9bd1d0be80', class: "xv-dropdown", role: "combobox", size: this.size, open: this.open, error: this.error, disabled: this.disabled, tabindex: this.disabled ? -1 : false }, index.h("label", { key: '54550cb9b8a26cc4df4a55abc677bd3f5bb9730d', class: "label" }, index.h("slot", { key: '46270d1b0e6b5ee26a07aeaf318617c73e82cfdb', name: "label" }, this.label), this.info && index.h("xv-tooltip-v2", { key: 'f3b7c09e3346dbaeb0fd720e20e4bbcd58bde7eb', class: "label_info", message: this.info })), index.h("div", { key: '4b4a2794ba78378cd89b3b2ad67bc66edbf4c52f', 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.renderIcon(), index.h("svg", { key: '7c79ee0d976229090c0c0a25d01d7beb9a0c3afc', 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: 'a895b585e7750cf4a01f7bd0dff390e70f2c482c', d: "M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z" }))), this.open && index.h("div", { key: '846792bfd1683daeb3223fb68c3559543b540787', class: "options" }, index.h("slot", { key: "xv-dropdown-options" })), (this.helper || this.error || this.warning) && (index.h("p", { key: '741d4636d86a44091e4a4b275806f745ded156f7', class: "helper" }, this.error || this.warning || this.helper))));
|
|
320
502
|
}
|
|
321
503
|
componentWillLoad() {
|
|
322
504
|
this.setDefaultValues();
|
|
@@ -366,7 +548,7 @@ const XvDropdownItem = class {
|
|
|
366
548
|
});
|
|
367
549
|
}
|
|
368
550
|
render() {
|
|
369
|
-
return (index.h(index.Host, { key: '
|
|
551
|
+
return (index.h(index.Host, { key: '85ba648d8281168521c1ed8c4b0b861fb428ce8e', class: "xv-dropdown-item", value: this.value, role: "option", tabindex: this.disabled ? -1 : false }, index.h("slot", { key: '6c303d085e23e1ecfa433aefa22f02be1cd5711f' }), this.selected && index.h("span", { key: 'c555912f9727a0e42b09279b31fe3b3b740bf7eb', class: "checkmark" })));
|
|
370
552
|
}
|
|
371
553
|
componentWillLoad() {
|
|
372
554
|
if (!this.value)
|
|
@@ -376,6 +558,129 @@ const XvDropdownItem = class {
|
|
|
376
558
|
};
|
|
377
559
|
XvDropdownItem.style = xvDropdownItemCss;
|
|
378
560
|
|
|
561
|
+
var XvFileUploaderVariants;
|
|
562
|
+
(function (XvFileUploaderVariants) {
|
|
563
|
+
XvFileUploaderVariants["BUTTON"] = "button";
|
|
564
|
+
XvFileUploaderVariants["DRAG_DROP"] = "drag-drop";
|
|
565
|
+
})(XvFileUploaderVariants || (XvFileUploaderVariants = {}));
|
|
566
|
+
|
|
567
|
+
const xvFileUploaderCss = ":host{font-family:inherit;display:flex;flex-direction:column;gap:var(--spacing-05);font-size:14px}:host .label{font-weight:600;font-size:1em;color:var(--text-primary)}:host .description{font-size:1em;margin:0;color:var(--text-secondary)}:host .upload-btn{padding:0 1.14em;border-radius:0.285em;background-color:var(--background-inverse);color:var(--text-inverse);border:none;cursor:pointer;font-size:1em;height:2.86em;transition:250ms ease-in-out background-color}:host .upload-btn:hover{background-color:var(--background-inverse-hover)}:host .drop-zone{border:1px dashed var(--border-strong-01);background-color:transparent;padding:1.14em;border-radius:0.285em;transition:border-color 0.2s ease, background-color 0.2s ease;font-size:1em;cursor:pointer}:host .drop-zone.active{border-color:var(--border-interactive);background-color:var(--background-active)}:host .drop-zone:hover{background-color:var(--background-hover)}:host .file-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}:host .file-list .file{border-radius:3px;background-color:var(--layer-01, #F7F7F7);font-size:1em}:host .file-list .file_container{padding:var(--spacing-04) var(--spacing-05);display:flex;justify-content:space-between;align-items:center}:host .file-list .file_container_name{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;color:var(--text-primary, #333);font-style:normal;font-weight:400;line-height:128.571%;letter-spacing:0.16px;padding-right:var(--spacing-04)}:host .file-list .file_container_errorIcon{color:var(--text-error);margin-right:var(--spacing-03)}:host .file-list .file.withError{outline:2px solid var(--support-error)}:host .error-container{padding:var(--spacing-04) var(--spacing-05);border-top:1px solid var(--border-subtle-01);font-size:0.858em;font-style:normal;font-weight:400;color:var(--text-error)}:host .error-container_primary,:host .error-container_secondary{margin:0;padding:0}:host .error-container__secondary{color:var(--text-secondary, #515151)}:host(.disabled){pointer-events:none;opacity:0.6}:host(.disabled) .upload-btn,:host(.disabled) .drop-zone{cursor:not-allowed;background-color:var(--button-disabled-background, #ccc);color:var(--button-disabled-text, #666);border-color:var(--border-disabled, #bbb)}:host(.disabled) .remove-btn{display:none}:host([size=xs]){font-size:10px}:host([size=sm]){font-size:12px}:host([size=md]){font-size:14px}:host([size=lg]){font-size:18px}:host([size=xl]){font-size:22px}";
|
|
568
|
+
|
|
569
|
+
const XvFileUploader = class {
|
|
570
|
+
constructor(hostRef) {
|
|
571
|
+
index.registerInstance(this, hostRef);
|
|
572
|
+
this.filesChange = index.createEvent(this, "filesChange");
|
|
573
|
+
this.variant = XvFileUploaderVariants.BUTTON;
|
|
574
|
+
this.size = SIZE_VAR.MD;
|
|
575
|
+
this.accept = [];
|
|
576
|
+
this.maxFileSizeMB = 5;
|
|
577
|
+
this.maxFiles = 20;
|
|
578
|
+
this.multiple = true;
|
|
579
|
+
this.files = [];
|
|
580
|
+
this.loadingStates = [];
|
|
581
|
+
this.errors = [];
|
|
582
|
+
this.dragActive = false;
|
|
583
|
+
this.errorMessages = [];
|
|
584
|
+
this.onFileSelect = (event) => {
|
|
585
|
+
const input = event.target;
|
|
586
|
+
const selectedFiles = Array.from(input.files || []);
|
|
587
|
+
this.handleFiles(selectedFiles);
|
|
588
|
+
};
|
|
589
|
+
this.onDrop = (event) => {
|
|
590
|
+
var _a;
|
|
591
|
+
event.preventDefault();
|
|
592
|
+
this.dragActive = false;
|
|
593
|
+
const droppedFiles = Array.from(((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) || []);
|
|
594
|
+
this.handleFiles(droppedFiles);
|
|
595
|
+
};
|
|
596
|
+
this.handleFiles = (files) => {
|
|
597
|
+
this.files = this.validation(this.multiple ? [...this.files, ...files] : files);
|
|
598
|
+
this.filesChange.emit(this.files);
|
|
599
|
+
};
|
|
600
|
+
this.onDragOver = (event) => {
|
|
601
|
+
event.preventDefault();
|
|
602
|
+
this.dragActive = true;
|
|
603
|
+
};
|
|
604
|
+
this.onDragLeave = () => {
|
|
605
|
+
this.dragActive = false;
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
validation(files) {
|
|
609
|
+
var _a;
|
|
610
|
+
const maxSize = this.maxFileSizeMB * 1024 * 1024;
|
|
611
|
+
const seenFileNames = new Set();
|
|
612
|
+
const errorMessages = [];
|
|
613
|
+
const uniqueFiles = [];
|
|
614
|
+
for (const file of files) {
|
|
615
|
+
let error = null;
|
|
616
|
+
if (!seenFileNames.has(file.name)) {
|
|
617
|
+
seenFileNames.add(file.name);
|
|
618
|
+
uniqueFiles.push(file);
|
|
619
|
+
}
|
|
620
|
+
const extension = (_a = file.name.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
621
|
+
const isAccepted = this.accept.length === 0 ||
|
|
622
|
+
this.accept.some(type => {
|
|
623
|
+
const normalized = type.toLowerCase().replace(/^\./, '');
|
|
624
|
+
return normalized === extension;
|
|
625
|
+
});
|
|
626
|
+
if (!isAccepted) {
|
|
627
|
+
error = 'Unsupported file type.';
|
|
628
|
+
}
|
|
629
|
+
else if (file.size > maxSize) {
|
|
630
|
+
error = `File ${file.name} is too large.`;
|
|
631
|
+
}
|
|
632
|
+
errorMessages.push(error);
|
|
633
|
+
}
|
|
634
|
+
this.error = uniqueFiles.length > this.maxFiles
|
|
635
|
+
? `Only ${this.maxFiles} file(s) allowed.`
|
|
636
|
+
: null;
|
|
637
|
+
this.errorMessages = errorMessages;
|
|
638
|
+
return uniqueFiles;
|
|
639
|
+
}
|
|
640
|
+
removeFile(index) {
|
|
641
|
+
this.files = this.validation([...this.files.slice(0, index), ...this.files.slice(index + 1)]);
|
|
642
|
+
this.filesChange.emit(this.files);
|
|
643
|
+
if (this.fileInput) {
|
|
644
|
+
this.fileInput.value = '';
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
render() {
|
|
648
|
+
var _a;
|
|
649
|
+
return (index.h(index.Host, { key: '1105dfa28937f83f3508498ecf3b00b181f3f062', class: { 'upload-wrapper': true, [`uploader-${this.size}`]: true, disabled: !!this.disabled } }, this.label && index.h("label", { key: 'bb7aeb7744325dc15cee88e63672ab2f1cac48fa', class: "label" }, this.label), this.description && index.h("p", { key: '17d6076cf70f1d69b9d760992739f5f8ae571711', class: "description" }, this.description), this.variant === 'button' ? (index.h("button", { disabled: this.disabled, class: "upload-btn", onClick: () => this.fileInput.click() }, this.addText || 'Dateien auswählen')) : (index.h("div", { class: { 'drop-zone': true, active: this.dragActive }, onDrop: this.onDrop, onDragOver: this.onDragOver, onDragLeave: this.onDragLeave, onClick: () => this.fileInput.click() }, this.addText || 'Dateien hierher ziehen oder darauf klicken, um eine Datei auszuwählen.', ((_a = this.accept) === null || _a === void 0 ? void 0 : _a.length) > 0 && index.h("span", null, " (", this.accept.join(', '), ")"))), index.h("input", { key: 'bc25da9c977df0452fd8946b160d7b89487a5aee', ref: el => (this.fileInput = el), type: "file", hidden: true, onChange: this.onFileSelect, multiple: this.multiple, accept: this.accept.map(type => `.${type}`).join(',') }), index.h("ul", { key: '3d2b5a6505a70c4a14004f0e0f3c6da7213b0007', class: "file-list" }, this.files.map((file, index$1) => {
|
|
650
|
+
var _a, _b;
|
|
651
|
+
return (index.h("li", { class: { file: true, withError: !!(((_a = this.errors) === null || _a === void 0 ? void 0 : _a[index$1]) || ((_b = this.errorMessages) === null || _b === void 0 ? void 0 : _b[index$1])) } }, index.h("div", { class: "file_container" }, index.h("span", { class: "file_container_name" }, file.name), this._renderLoaderState(index$1)), this._renderError(index$1)));
|
|
652
|
+
})), this.error && (index.h("div", { key: '3918fcaf5c5660eb2a5553886e191e2969d81cb4', class: "error-container" }, index.h("p", { key: '26fcb672d89ec14e99b83dfc78712b72d9042d72', class: "error-container_primary" }, this.error)))));
|
|
653
|
+
}
|
|
654
|
+
_renderLoaderState(index$1) {
|
|
655
|
+
var _a, _b, _c;
|
|
656
|
+
const state = ((_a = this.loadingStates) === null || _a === void 0 ? void 0 : _a[index$1]) || null;
|
|
657
|
+
const errorIcon = ((_b = this.errors) === null || _b === void 0 ? void 0 : _b[index$1]) || ((_c = this.errorMessages) === null || _c === void 0 ? void 0 : _c[index$1]) ? (index.h("svg", { class: "file_container_errorIcon", width: "16", height: "16", 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" }))) : null;
|
|
658
|
+
switch (state) {
|
|
659
|
+
case 'loading':
|
|
660
|
+
return (index.h(index.Fragment, null, errorIcon, index.h("xv-loader-v2", { size: SIZE_VAR.XS })));
|
|
661
|
+
case 'success':
|
|
662
|
+
return (index.h(index.Fragment, null, errorIcon, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 18 16", fill: "none" }, index.h("path", { d: "M9 16C6.125 16 3.5 14.5 2.0625 12C0.625 9.53125 0.625 6.5 2.0625 4C3.5 1.53125 6.125 0 9 0C11.8438 0 14.4688 1.53125 15.9062 4C17.3438 6.5 17.3438 9.53125 15.9062 12C14.4688 14.5 11.8438 16 9 16ZM12.5312 6.53125H12.5C12.8125 6.25 12.8125 5.78125 12.5 5.46875C12.2188 5.1875 11.75 5.1875 11.4688 5.46875L8 8.96875L6.53125 7.5C6.21875 7.1875 5.75 7.1875 5.46875 7.5C5.15625 7.78125 5.15625 8.25 5.46875 8.53125L7.46875 10.5312C7.75 10.8438 8.21875 10.8438 8.53125 10.5312L12.5312 6.53125Z", fill: "#97BF0D" }))));
|
|
663
|
+
case 'uploaded':
|
|
664
|
+
default:
|
|
665
|
+
return (index.h(index.Fragment, null, errorIcon, index.h("xv-button-v2", { variant: "ghost", size: SIZE_VAR.XS, onClick: () => this.removeFile(index$1) }, index.h("span", { slot: "icon-left" }, "\u00D7"))));
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
_renderError(index$1) {
|
|
669
|
+
var _a, _b;
|
|
670
|
+
const error = ((_a = this.errors) === null || _a === void 0 ? void 0 : _a[index$1]) || ((_b = this.errorMessages) === null || _b === void 0 ? void 0 : _b[index$1]);
|
|
671
|
+
if (!error)
|
|
672
|
+
return;
|
|
673
|
+
if (typeof error === 'object') {
|
|
674
|
+
return (index.h("div", { class: "error-container" }, index.h("p", { class: "error-container_primary" }, error.primary), index.h("p", { class: "error-container_secondary" }, error.secondary)));
|
|
675
|
+
}
|
|
676
|
+
if (typeof error === 'string') {
|
|
677
|
+
return (index.h("div", { class: "error-container" }, index.h("p", { class: "error-container_primary" }, error)));
|
|
678
|
+
}
|
|
679
|
+
return null;
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
XvFileUploader.style = xvFileUploaderCss;
|
|
683
|
+
|
|
379
684
|
const xvFooterCss = ".svg-assets--src--project--images--svg-sprite--youtube,.svg-assets--src--project--images--svg-sprite--xing,.svg-assets--src--project--images--svg-sprite--vorkasse,.svg-assets--src--project--images--svg-sprite--visa,.svg-assets--src--project--images--svg-sprite--sepa,.svg-assets--src--project--images--svg-sprite--paypal,.svg-assets--src--project--images--svg-sprite--mastercard,.svg-assets--src--project--images--svg-sprite--linkedin,.svg-assets--src--project--images--svg-sprite--kauf-auf-rechnung,.svg-assets--src--project--images--svg-sprite--instagram,.svg-assets--src--project--images--svg-sprite--facebook{background:url(\"https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.svg\") no-repeat}.svg-assets--src--project--images--svg-sprite--facebook{background-position:0 100%;width:32px;height:32px}.svg-assets--src--project--images--svg-sprite--instagram{background-position:14.5454545455% 100%;width:32px;height:32px}.svg-assets--src--project--images--svg-sprite--kauf-auf-rechnung{background-position:0 0;width:84px;height:58px}.svg-assets--src--project--images--svg-sprite--linkedin{background-position:29.0909090909% 100%;width:32px;height:32px}.svg-assets--src--project--images--svg-sprite--mastercard{background-position:50% 0;width:84px;height:58px}.svg-assets--src--project--images--svg-sprite--paypal{background-position:0 64.4444444444%;width:84px;height:58px}.svg-assets--src--project--images--svg-sprite--sepa{background-position:50% 64.4444444444%;width:84px;height:58px}.svg-assets--src--project--images--svg-sprite--visa{background-position:100% 0;width:84px;height:58px}.svg-assets--src--project--images--svg-sprite--vorkasse{background-position:100% 64.4444444444%;width:84px;height:58px}.svg-assets--src--project--images--svg-sprite--xing{background-position:43.6363636364% 100%;width:32px;height:32px}.svg-assets--src--project--images--svg-sprite--youtube{background-position:58.1818181818% 100%;width:32px;height:32px}.sprite-icon-beachten{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-90px 0px;width:80px;height:80px}.sprite-icon-buchen{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:0px -82px;width:80px;height:80px}.sprite-icon-direct{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-284px -99px;width:21px;height:21px}.sprite-icon-downloads{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-80px -82px;width:80px;height:80px}.sprite-icon-kino{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-305px -99px;width:21px;height:21px}.sprite-icon-kosten{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-170px 0px;width:80px;height:80px}.sprite-icon-kreation{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-170px -80px;width:80px;height:80px}.sprite-icon-logo-full{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:0px -242px;width:189px;height:32px}.sprite-icon-logo-small{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-250px -99px;width:34px;height:34px}.sprite-icon-mobile{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-326px -99px;width:21px;height:21px}.sprite-icon-online{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-347px -99px;width:21px;height:21px}.sprite-icon-partner-agma{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-250px -66px;width:88px;height:33px}.sprite-icon-partner-bvdw{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-338px -66px;width:88px;height:33px}.sprite-icon-partner-climate{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-250px 0px;width:186px;height:33px}.sprite-icon-partner-google{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:0px 0px;width:90px;height:82px}.sprite-icon-partner-microsoft{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-250px -33px;width:186px;height:33px}.sprite-icon-plakat{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-368px -99px;width:21px;height:21px}.sprite-icon-print{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-389px -99px;width:21px;height:21px}.sprite-icon-radio{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-410px -99px;width:21px;height:21px}.sprite-icon-services{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-250px -133px;width:21px;height:21px}.sprite-icon-topangebote{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-271px -133px;width:21px;height:21px}.sprite-icon-tv{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:-292px -133px;width:21px;height:21px}.sprite-icon-werbeformen{background-image:url(https://crossvertise.blob.core.windows.net/assets/images/xv-sprite.png?1739974291120);background-position:0px -162px;width:80px;height:80px}";
|
|
380
685
|
|
|
381
686
|
const Xvfooter = class {
|
|
@@ -394,7 +699,7 @@ const Xvfooter = class {
|
|
|
394
699
|
}
|
|
395
700
|
}
|
|
396
701
|
render() {
|
|
397
|
-
return (index.h("footer", { key: '
|
|
702
|
+
return (index.h("footer", { key: 'ded377d47464f3f171b99929f6517d4a2bc0be7b' }, index.h("div", { key: 'f1cfbd7b0277f073ed45a7be034bc86d60bf8880', innerHTML: this.htmlContent })));
|
|
398
703
|
}
|
|
399
704
|
get el() { return index.getElement(this); }
|
|
400
705
|
};
|
|
@@ -434,13 +739,13 @@ const XvHeader = class {
|
|
|
434
739
|
}
|
|
435
740
|
}
|
|
436
741
|
render() {
|
|
437
|
-
return (index.h("div", { key: '
|
|
742
|
+
return (index.h("div", { key: 'e23865373ad9ea2ad72b911763532a825f606bc5', id: "nav-container", class: "xv-header" }, index.h("nav", { key: '7a621ccedbbcea7752e8f0535718e714ac3b87a7', class: "navbar navbar-default navbar-fixed-top backend-force-relative" }, index.h("div", { key: '5d48c595a601eb4aecbf20acf7bad412173b0c43', class: "container" }, index.h("div", { key: '495a0c316a6eaf585704e5d8c7fc1ad6a98ef0a2', class: "row" }, index.h("div", { key: 'ae0135513b1afd15a8a732b433226ea4c2e5fb34', class: "col-sm-3 col-xs-3 col-xxs-4 no-padding-right" }, index.h("div", { key: '941dcc71efd9fcd591fc37d3b79658a5895c0cf5', class: "navbar-header" }, index.h("button", { key: '05422376a774a3fb2bad4f3d99260c14c9591ac3', class: "btn btn-default navbar-toggle pull-left navbar-btn", "data-toggle": "collapse", "data-target": "#main-menu" }, index.h("i", { key: '2724965e90ff27350749d35e4f334c896222adbd', class: "fa fa-bars fa-lg", "aria-hidden": "true" })), index.h("div", { key: '540e61643a05c89e92739af9e5639dae1c7a3a89', class: "visible-xs-inline" }, index.h("a", { key: 'a90967bfd343bfa84310f439e869d5cf6fd7b245', href: "https://www.crossvertise.com/", class: "navbar-brand" }, index.h("img", { key: '9a4a05061aab1c1b9f47f3c8a5f1d233f2d0585f', src: "https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo-small.svg", alt: "Crossvertise" }))), index.h("div", { key: '6be821a687b33ff2ec170722ced74f916380f351', class: "hidden-xs" }, index.h("a", { key: '30494848524505dfd30b205d781628ecd76d7133', href: "https://www.crossvertise.com/", class: "navbar-brand" }, index.h("img", { key: '3d295824a957db5789a0712bcce707679a0b61eb', loading: "lazy", src: "https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo.svg", alt: "Crossvertise" }))))), index.h("div", { key: 'ccda27c0fc15d51d8bb36a0edc6449a2a0ad96ab', class: "col-sm-9 col-xs-9 col-xxs-8 no-padding-left" }, index.h("ul", { key: '11cb71d231254db9f1c5c53695aae2e721da4b20', class: "nav nav-pills nav-meta pull-right" }, index.h("li", { key: '50c5f81db2f1f0e85c5f6bbf9a253465d9e84b35' }, index.h("a", { key: '79bc7f4274fc938a35e38682ba0f65fccdfb4b03', class: "btn btn-link navbar-btn hidden-xs", href: "#" }, index.h("i", { key: '21710845d33579fab0dc70d063b5d872387378c9', class: "fa fa-user" }), index.h("i", { key: 'c6061afb38e2b2ed44c03ce4e910d9d2b5801a17', class: "fa fa-exchange-alt" }))), index.h("li", { key: '49348a283e4ede773307681345099e57207fcdda' }, index.h("a", { key: '290fd16b3aafec374b449d5050a19f606894b1d7', class: "btn btn-link navbar-btn hidden-xs", href: "#" }, "Kontakt"), index.h("a", { key: 'b51214e7831f07a03ac866bda5266c8d525fe558', href: "https://www.crossvertise.com/contact", class: "btn btn-link navbar-btn hidden-xs", style: { display: 'none' } }, "Kontakt"), index.h("a", { key: '31fd0c8390e09334e1996330efa04c9899620cc6', class: "btn btn-default btn-link navbar-btn visible-xs hidden-xxs", href: "#" }, index.h("i", { key: '17684ce738751f491369695434ab9183008a9b0d', class: "fa fa-phone" }))), index.h("li", { key: '38ece1d7260b8d73c7e48e3bd3b6ac29d389b88b', class: "dropdown", id: "my-xv-menu" }, index.h("a", { key: '70ba7716137f93f52ea952ea401fb634a85bd672', href: "#", class: "dropdown-toggle btn btn-default navbar-btn btn-link", "data-toggle": "dropdown" }, index.h("i", { key: 'bba83584c110f747aeb7e1f64d1010eb76588e93', class: "fa fa-user fa-lg text-success", "aria-hidden": "true" }), "\u00A0", index.h("span", { key: '6438bc959dfd6245859425f8e325127f869a4a8a', class: "hidden-xs" }, "Mein Bereich"), index.h("span", { key: '48b03adc129165116ac53166508b7d85a50d9110', class: "caret" })), index.h("ul", { key: '41a1e53662bc7c4b01b4dc50ed498b904d3e1fe0', class: "dropdown-menu-left dropdown-menu navbar-myxv" }, index.h("li", { key: 'f74892854e52d7109b3f40aeb9f0df75db7df6b9' }, index.h("a", { key: '0b41a267d437bab5d1c721942901c90c2b5f544c', href: "#" }, index.h("i", { key: '8824476df69bb5efeed55b742c2bf660711e9946', class: "fa fa-tachometer-alt fa-fw" }), "\u00A0Cockpitfunktionen\u00A0", index.h("i", { key: 'eea0470f9510c6bb4be719edb4592511fbe9db2f', class: "fa fa-caret-down" }))), index.h("li", { key: '8db405011c404f6f62ca6f849fd1a5c7fb6130b5' }, index.h("a", { key: '2a07deb167ebeb88396424325057ded6a5d3bb79', href: "#" }, index.h("i", { key: 'c278dfc51bb82626032dda352ec0fef4fe292d0e', class: "fa fa-cubes" }), "\u00A0Entit\u00E4ten\u00A0", index.h("i", { key: 'df99378caeca61ff7fc34e0e5ba4ef300945c91b', class: "fa fa-caret-down" }))), index.h("li", { key: 'ac30718411da279c57fadadc62a6cd669a34d715', role: "separator", class: "divider" }), index.h("li", { key: '869b0c629487677b67c713ca73651755cbf6f383' }, index.h("a", { key: 'ac460c523ce2202ba08b7de10bdac67b48912dd6', href: "#" }, index.h("i", { key: 'feda1a2c2999dead3b2b3eb834f8b51cc63dd991', class: "fa fa-user" }), "\u00A0Mein Crossvertise\u00A0", index.h("span", { key: 'db19052087c8efff2cf408629775636aa1980250', class: "badge" }, "0"), index.h("i", { key: '5225f5b72738346c19fb1613950410bca93d8d2a', class: "fa fa-caret-down" }))), index.h("li", { key: '5590a102180218c69e065cc57794b835a5f224d1' }, index.h("a", { key: '316a47a72b47da1f68fd1f717f7246740f25a6a8', href: "https://www.crossvertise.com/de-de/mycrossvertise/account/logoff?returnUrl=https%3A%2F%2Fwww.crossvertise.com" }, index.h("i", { key: 'bb8ccc79300a525d4f8194d2fd00abb2581db9f6', class: "fa fa-sign-out-alt fa-fw", "aria-hidden": "true" }), "\u00A0Logout")))), index.h("li", { key: 'd0ba91f2c496398d5aa5dbb1117d6309e8f1e606', class: "visible-sm-block visible-xs-block hidden-xxs" }, index.h("a", { key: '22b74c5543d27d32c2d02e351b7c21e16b9ce78c', class: "btn btn-default navbar-btn btn-link", "data-toggle": "collapse", "data-target": "#search-collapse" }, index.h("i", { key: '01b86811a768fc2a19d72cb4f17c6a9785829ab0', class: "fa fa-search", "aria-hidden": "true" }))), index.h("li", { key: 'c0d72f6ddd76f3dfa9d96f12118d0a73241753e8', class: "hidden-xs hidden-sm" }, index.h("a", { key: '71a09c453ede7a36bc6b8fc5fa79d1e608a16cfb', role: "button", onClick: this.openLoginModal, class: "btn btn-default navbar-btn btn-link" }, index.h("i", { key: '74142f2bd13d8de2d85fc1e82377407152d14c92', class: "fa fa-user fa-lg", "aria-hidden": "true" }), index.h("span", { key: '1b5116849bca8e05dc349f8554b1b552c88369dc' }, "Login"))), index.h("xv-login-modal", { key: 'cb142ee870252f3633b90b4e9abcd05f9f7e2df7', visible: this.showLoginModal, onClose: this.closeLoginModal }), index.h("li", { key: 'bb2855d3c34440d8fb379624ddd5acda1a8df347', class: "hidden-xs" }, index.h("a", { key: 'ad31c42ae4f0cfffa369b8c6471f89dc21bbbfa8', class: "btn btn-default navbar-btn btn-link", href: "https://market.crossvertise.com/de-de/mycrossvertise/account/register" }, index.h("span", { key: '6a9faaac3cfe6211636be703df13a104762e2fb2' }, "Registrieren"))), index.h("li", { key: '2211f6d0672a708956f3cc615bf0c7ee7b3ce1ec', class: "navbar-divider hidden-xs" }), index.h("li", { key: '252bdabd42167b13a7e338c6554dc62f6dbf5156' }, index.h("a", { key: 'e4e3b75d0be8af70ca5e7fe64e3ee2b21eff072b', class: "btn btn-success navbar-btn", href: "https://market.crossvertise.com/de-de/mycrossvertise/shoppingcart/activecart" }, index.h("span", { key: 'f5c1b26dd26a7baf67cfccfe4817aaa7b9cf0c9d', class: "xv-font-icon-warenkorb fa-lg fa-fw", "aria-hidden": "true" }), index.h("span", { key: '8e4e16628d7662e46bb92817e430471557390432', class: "hidden-xs hidden-sm" }, "\u00A0Warenkorb\u00A0"), index.h("span", { key: 'da18423a0585a0298ec080cb2526c1104f46e907', class: "badge badge-success" }, "0"))))))), index.h("div", { key: '282355ac46855e03ae8a3d64bb4eaf62c86e77ca', class: "collapse hidden-md hidden-lg", id: "search-collapse" }, index.h("div", { key: '5007ccb71a3ff29b7325f0fcf8bce09eb93f603c', class: "container" }, index.h("form", { key: '55627dcc8b419e24b65cd6f6ad5e4fdde1a368d0', action: "https://market.crossvertise.com/de-de/media/search", class: "navbar-form", method: "get", role: "search" }, index.h("div", { key: '0d39c0d7cd9b098f6d5ab5f1f1c3418128753816', class: "input-group" }, index.h("input", { key: 'fb554f8ba5df87ec3fe372c9834497accafdd451', class: "form-control", name: "Q", placeholder: "Suche", type: "text", autocomplete: "off" }), index.h("span", { key: '353cc24679f1092fea80f7c033525d8291ec8d0b', class: "input-group-btn force-full-width" }, index.h("button", { key: 'bbde50921f67baa753a65540f544bfcae80379c6', class: "btn btn-default search-addon", type: "submit" }, index.h("i", { key: '17749c3879831e532d36a08cc7c1ef43d72e5591', class: "fa fa-search", "aria-hidden": "true" })))))))), index.h("div", { key: '37675efdf9ad133373d0b4053d1007b92b9be622', innerHTML: this.htmlContent })));
|
|
438
743
|
}
|
|
439
744
|
get el() { return index.getElement(this); }
|
|
440
745
|
};
|
|
441
746
|
XvHeader.style = xvHeaderCss;
|
|
442
747
|
|
|
443
|
-
const xvLinkCss = ":host{font-family:var(--ff-body, inherit)}:host(.xv-link_inline){display:inline-block}:host(.xv-link_inline) .xv-link{text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:none;text-decoration-thickness:auto;text-underline-offset:auto;text-underline-position:from-font}:host(.xv-link_standalone){display:block}:host(.xv-link_standalone) .xv-link{display:block;text-decoration-line:none}:host(.xv-link_ghost) .xv-link{color:inherit;text-decoration:none}.xv-link{display:inline-flex;gap:8px;align-items:center;color:var(--link-primary);font-family:var(--ff-body);font-style:normal;font-weight:400;transition:color 200ms ease-in-out}.xv-link:active{color:var(--text-primary)}.xv-link:visited{color:var(--link-visted)}.xv-link:hover{color:var(--link-primary-hover);cursor:pointer}.xv-link:disabled,.xv-link_disabled,.xv-link::part(disabled){color:var(--text-disabled);pointer-events:none;cursor:initial}.xv-link.sm{font-size:var(--fz-sm);line-height:137.5%}.xv-link.md{font-size:var(--fz-md);line-height:128.571%}.xv-link.lg{font-size:var(--fz-lg);line-height:133.333%}";
|
|
748
|
+
const xvLinkCss = ":host{font-family:var(--ff-body, inherit)}:host(.xv-link_inline){display:inline-block}:host(.xv-link_inline) .xv-link{text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:none;text-decoration-thickness:auto;text-underline-offset:auto;text-underline-position:from-font}:host(.xv-link_standalone){display:block}:host(.xv-link_standalone) .xv-link{display:block;text-decoration-line:none}:host(.xv-link_ghost) .xv-link{display:contents;color:inherit;text-decoration:none}.xv-link{display:inline-flex;gap:8px;align-items:center;color:var(--link-primary);font-family:var(--ff-body);font-style:normal;font-weight:400;transition:color 200ms ease-in-out}.xv-link:active{color:var(--text-primary)}.xv-link:visited{color:var(--link-visted)}.xv-link:hover{color:var(--link-primary-hover);cursor:pointer}.xv-link:disabled,.xv-link_disabled,.xv-link::part(disabled){color:var(--text-disabled);pointer-events:none;cursor:initial}.xv-link.sm{font-size:var(--fz-sm);line-height:137.5%}.xv-link.md{font-size:var(--fz-md);line-height:128.571%}.xv-link.lg{font-size:var(--fz-lg);line-height:133.333%}";
|
|
444
749
|
|
|
445
750
|
const XvLink = class {
|
|
446
751
|
constructor(hostRef) {
|
|
@@ -456,7 +761,7 @@ const XvLink = class {
|
|
|
456
761
|
e.stopPropagation();
|
|
457
762
|
}
|
|
458
763
|
render() {
|
|
459
|
-
return (index.h(index.Host, { key: '
|
|
764
|
+
return (index.h(index.Host, { key: '8abd4142d08b9a55fe67a2c588655728e25dd159', class: `xv-link_${this.variant}` }, index.h("a", { key: 'b6fec7e701adf7a5caef4ae0610f6d83b2c08617', href: this.href, onClick: this.preventLinkHandler.bind(this), class: `xv-link ${this.disabled ? 'xv-link_disabled' : ''} ${this.size}`, target: this.target }, index.h("slot", { key: '0a68b77769f8681dfc44782f9e5ea2db1a8a7d6f', name: "icon-left" }), index.h("slot", { key: '3ecd19fef95c96c283f260a5ef5dea734bf318bd' }), index.h("slot", { key: '8f21cd979ccfc5e6e890092b6ebea3b0bd067f1d', name: "icon-right" }))));
|
|
460
765
|
}
|
|
461
766
|
};
|
|
462
767
|
XvLink.style = xvLinkCss;
|
|
@@ -632,7 +937,7 @@ const XvModal = class {
|
|
|
632
937
|
}
|
|
633
938
|
render() {
|
|
634
939
|
var _a;
|
|
635
|
-
return (index.h(index.Host, { key: '
|
|
940
|
+
return (index.h(index.Host, { key: '227d7c8432c263024eb14ebcc906d45d01845143', role: "dialog", size: this.size, id: this.el.id }, index.h("slot", { key: 'e9c1c83f4d5e3a1ddfa765b17129ea13dce96582', name: "trigger", onSlotchange: this.setupTrigger }), index.h("div", { key: '3a5b9b557925edb299ce386e289f60d87cbf9341', class: { backdrop: true }, onClick: this.onBackdropClick }, index.h("div", { key: '77e793861e33d77ca59c5f3bc89e1a6d83b8ba38', class: "modal" }, index.h("button", { key: '5534a1306535847efa5c77d393323ca93d9b33f3', class: "modal_close", onClick: this.closeModal.bind(this) }, "\u00D7"), index.h("div", { key: 'c3dee869a2be046d2e216730fc122da92c21920d', class: "modal_header" }, index.h("slot", { key: '42c0d657d261841a8fcb6461a079e06b5b1d2fad', name: "header" }, ((_a = this.el) === null || _a === void 0 ? void 0 : _a.title) && index.h("h5", { key: '48aae8d010464e9a06c92699ad9e1dfe5feb0e04', class: "modal_header__title" }, this.el.title))), index.h("div", { key: '4cb0e7c1fed672df57dc86e4ebc53859d9695d0d', class: { 'modal_content': true, overflow: this.overflow } }, index.h("slot", { key: '1df966114775ee209cab1311350cb9d005abae0c' })), index.h("div", { key: 'fc246530cac2cedb24a3b8be81e710cecd7b18fc', class: "modal_footer" }, index.h("slot", { key: '5b00a76e35824e041d8f891ca4e40ec27d72290f', name: "footer" }))))));
|
|
636
941
|
}
|
|
637
942
|
disconnectedCallback() {
|
|
638
943
|
this.removeTriggerListener();
|
|
@@ -649,7 +954,7 @@ var NOTIFICATION_VARIANTS;
|
|
|
649
954
|
NOTIFICATION_VARIANTS["ERROR"] = "error";
|
|
650
955
|
})(NOTIFICATION_VARIANTS || (NOTIFICATION_VARIANTS = {}));
|
|
651
956
|
|
|
652
|
-
const xvNotificationCss = ":host{--notification-icon-size:20px;display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;border-radius:3px;padding:var(--gap-md, 16px);column-gap:var(--gap-md, 16px);border:1px solid}:host .content{flex:1;text-align:left;color:var(--text-primary, #333);font-family:var(--ff-body, Tahoma);font-size:var(--fz-md, 14px);line-height:128%;letter-spacing:0.16px;display:flex;flex-direction:column;row-gap:var(--spacing-06, 24px)}:host .content_title{text-align:left;margin:0;padding:0;font-weight:700;line-height:var(--notification-icon-size)}:host .icon{width:var(--notification-icon-size);height:var(--notification-icon-size);font-size:var(--notification-icon-size);fill:currentColor}:host .close{--notification-close-size:16px;background-color:transparent;border:none;width:var(--notification-close-size);height:var(--notification-close-size);min-width:var(--notification-close-size);min-height:var(--notification-close-size);position:relative;padding:0;margin:0;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:300ms ease-in-out opacity}:host .close:after,:host .close:before{content:\"\";position:absolute;top:calc(50% - var(--notification-close-size) / 2);left:calc(50% - 1px);display:inline-block;width:2px;height:90%;background-color:var(--button-tertiary, #273435)}:host .close:after{transform:rotate(45deg)}:host .close:before{transform:rotate(-45deg)}:host .close:hover{opacity:0.7}:host .close:active{opacity:0.3}:host ::slotted([slot=footer]){margin:0;padding:0}:host([type=info]){border-color:var(--support-info, #1B87B2);background-color:var(--support-info-background, #E2F5F8)}:host([type=info]) .icon{color:var(--support-info, #1B87B2)}:host([type=success]){border-color:var(--support-success, #97BF0D);background-color:var(--support-success-background, #F4F7E5)}:host([type=success]) .icon{color:var(--support-success, #1B87B2)}:host([type=warning]){border-color:var(--support-warning, #FF7F04);background-color:var(--support-warning-backround, #FFF9C2)}:host([type=warning]) .icon{color:var(--support-warning, #FF7F04)}:host([type=error]){border-color:var(--support-error, #F1290E);background-color:var(--support-error-background, #FEE9E8)}:host([type=error]) .icon{color:var(--support-error, #F1290E)}";
|
|
957
|
+
const xvNotificationCss = ":host{--notification-icon-size:20px;display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;border-radius:3px;padding:var(--gap-md, 16px);column-gap:var(--gap-md, 16px);border:1px solid}:host .content{flex:1;text-align:left;color:var(--text-primary, #333);font-family:var(--ff-body, Tahoma);font-size:var(--fz-md, 14px);line-height:128%;letter-spacing:0.16px;display:flex;flex-direction:column;row-gap:var(--spacing-06, 24px);word-break:break-all}:host .content_title{text-align:left;margin:0;padding:0;font-weight:700;line-height:var(--notification-icon-size)}:host .icon{width:var(--notification-icon-size);height:var(--notification-icon-size);font-size:var(--notification-icon-size);fill:currentColor}:host .close{--notification-close-size:16px;background-color:transparent;border:none;width:var(--notification-close-size);height:var(--notification-close-size);min-width:var(--notification-close-size);min-height:var(--notification-close-size);position:relative;padding:0;margin:0;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:300ms ease-in-out opacity}:host .close:after,:host .close:before{content:\"\";position:absolute;top:calc(50% - var(--notification-close-size) / 2);left:calc(50% - 1px);display:inline-block;width:2px;height:90%;background-color:var(--button-tertiary, #273435)}:host .close:after{transform:rotate(45deg)}:host .close:before{transform:rotate(-45deg)}:host .close:hover{opacity:0.7}:host .close:active{opacity:0.3}:host ::slotted([slot=footer]){margin:0;padding:0}:host([type=info]){border-color:var(--support-info, #1B87B2);background-color:var(--support-info-background, #E2F5F8)}:host([type=info]) .icon{color:var(--support-info, #1B87B2)}:host([type=success]){border-color:var(--support-success, #97BF0D);background-color:var(--support-success-background, #F4F7E5)}:host([type=success]) .icon{color:var(--support-success, #1B87B2)}:host([type=warning]){border-color:var(--support-warning, #FF7F04);background-color:var(--support-warning-backround, #FFF9C2)}:host([type=warning]) .icon{color:var(--support-warning, #FF7F04)}:host([type=error]){border-color:var(--support-error, #F1290E);background-color:var(--support-error-background, #FEE9E8)}:host([type=error]) .icon{color:var(--support-error, #F1290E)}";
|
|
653
958
|
|
|
654
959
|
const XvNotification = class {
|
|
655
960
|
constructor(hostRef) {
|
|
@@ -678,13 +983,67 @@ const XvNotification = class {
|
|
|
678
983
|
};
|
|
679
984
|
}
|
|
680
985
|
render() {
|
|
681
|
-
return (index.h(index.Host, { key: '
|
|
986
|
+
return (index.h(index.Host, { key: '828674420130a41adc1c21b7dac6ba7795142871', class: "xv-notification", type: this.variant }, this.renderIcon(this.variant), index.h("div", { key: '2f863367c6952b1974607f577d33d69a572b83ac', class: "content" }, index.h("div", { key: 'df968f2dc944bf7b8cad543fb64a3c9d124a11ff', class: "content_wrapper" }, this.el.title && index.h("h5", { key: '200f8de5f706f7b4318cb94b9966a6171d56e2f5', class: "content_title" }, this.el.title), index.h("slot", { key: '76e93f53912a25d9240b82434e05466bf16902b3' })), index.h("slot", { key: '0403b90c0e139d214356519a33c0c546e03953a0', name: "footer" })), this.dismissible && index.h("button", { key: '70f8219f0b7c2dc897d0bb36ea5c7c7fb7aa3288', class: "close", onClick: this.closeHandle })));
|
|
682
987
|
}
|
|
683
988
|
static get assetsDirs() { return ["xv-notification/icons"]; }
|
|
684
989
|
get el() { return index.getElement(this); }
|
|
685
990
|
};
|
|
686
991
|
XvNotification.style = xvNotificationCss;
|
|
687
992
|
|
|
993
|
+
const xvNumberInputCss = ":host{display:inline-block;text-align:left}:host .control_label{display:block;margin-bottom:var(--spacing-03);color:var(--text-secondary, #515151);font-family:var(--ff-body, Tahoma);font-size:var(--fz-sm, 12px);font-style:normal;font-weight:700;line-height:var(--fz-md);letter-spacing:0.32px}:host .control_input{display:flex;border:1px solid var(--border-subtle-01);outline:2px solid transparent;background-color:transparent;border-radius:3px;transition:250ms ease-in-out border-color, 250ms ease-in-out outline-color}:host .control_input:hover{border-color:var(--border-subtle-selected-01)}:host .control_input:focus-within{outline-color:var(--focus)}:host .control_input.error{outline-color:var(--support-error)}:host .control_input.readonly{border-radius:0;border-top-width:0;border-left-width:0;border-right-width:0;outline-color:transparent}:host .control_input input[type=number]{flex:1;border:none;outline:none;-moz-appearance:textfield;background-color:transparent;margin:0;padding-block:0;padding-inline:var(--spacing-05);box-sizing:border-box;color:var(--text-primary);min-width:20px;font-style:normal;font-weight:400;letter-spacing:0.16px}:host .control_input input[type=number]::-webkit-inner-spin-button,:host .control_input input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}:host .control_input__icons{display:inline-flex;align-items:stretch;column-gap:2px}:host .control_input__icons .status-icon{display:inline-flex;align-items:center;align-self:center;font-size:1.35em}:host .control_input__icons .status-icon.error{background-color:var(--support-error);color:white;width:16px;height:16px;border-radius:8px;font-size:12px;font-weight:bold;align-items:center;justify-content:center}:host .control_input__icons .status-icon.warning{color:var(--support-warning)}:host .control_input__icons hr{border:none;outline:none;width:2px;height:60%;align-self:center;background-color:var(--border-subtle-01);display:inline-flex}:host .message{margin:var(--spacing-02) 0 0;color:var(--text-helper, #646464);font-size:var(--fz-sm, 12px);font-style:normal;font-weight:400;line-height:var(--fz-md, 16px);letter-spacing:0.32px}:host .message.error{color:var(--text-error)}:host .message.warning{color:var(--text-secondary, #515151)}:host(.disabled){cursor:not-allowed}:host(.disabled) .control_label,:host(.disabled) .control_input input[type=number],:host(.disabled) .control_input input[type=number]::placeholder,:host(.disabled) .message:not(.error){color:var(--text-disabled);cursor:not-allowed}:host(.disabled) .control_input__icons,:host(.disabled) .message.error{opacity:0.5;cursor:not-allowed}:host([block]){display:block}";
|
|
994
|
+
|
|
995
|
+
const XvNumberInput = class {
|
|
996
|
+
constructor(hostRef) {
|
|
997
|
+
index.registerInstance(this, hostRef);
|
|
998
|
+
this.valueChange = index.createEvent(this, "valueChange");
|
|
999
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
1000
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
1001
|
+
}
|
|
1002
|
+
else {
|
|
1003
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
1004
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
1005
|
+
}
|
|
1006
|
+
this.step = 10;
|
|
1007
|
+
this.loading = false;
|
|
1008
|
+
this.size = SIZE_VAR.MD;
|
|
1009
|
+
this.increment = () => {
|
|
1010
|
+
const newValue = (this.value || 0) + this.step;
|
|
1011
|
+
if (this.max !== undefined && newValue > this.max)
|
|
1012
|
+
return;
|
|
1013
|
+
this.setValue(newValue);
|
|
1014
|
+
};
|
|
1015
|
+
this.decrement = () => {
|
|
1016
|
+
const newValue = (this.value || 0) - this.step;
|
|
1017
|
+
if (this.min !== undefined && newValue < this.min)
|
|
1018
|
+
return;
|
|
1019
|
+
this.setValue(newValue);
|
|
1020
|
+
};
|
|
1021
|
+
this.handleInput = (event) => {
|
|
1022
|
+
const input = event.target;
|
|
1023
|
+
const num = parseFloat(input.value) || 0;
|
|
1024
|
+
if (isNaN(num))
|
|
1025
|
+
return;
|
|
1026
|
+
this.setValue(num);
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
setValue(value) {
|
|
1030
|
+
var _a;
|
|
1031
|
+
this.value = value;
|
|
1032
|
+
this.internals.setFormValue((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString());
|
|
1033
|
+
this.valueChange.emit(this.value);
|
|
1034
|
+
}
|
|
1035
|
+
render() {
|
|
1036
|
+
return (index.h(index.Host, { key: '9e9d338c9ff5f2191a7b93d75473455fcd0595e3', class: { disabled: !!this.disabled } }, index.h("label", { key: '94743e62549da23b3c63280d9a228bb7bab4dc86', class: "control" }, this.label && index.h("span", { key: 'a7feadfdb33ac4305a58b0634fafdfab56293a1e', class: "control_label" }, this.label), index.h("div", { key: '7e87334966533108284fad892e219c3d6e320da0', class: {
|
|
1037
|
+
'control_input': true,
|
|
1038
|
+
readonly: !!this.readonly,
|
|
1039
|
+
error: !!this.error,
|
|
1040
|
+
warning: !!this.warning
|
|
1041
|
+
} }, index.h("input", { key: 'b241be77f4f61110fc00911bacf58f493a6dc648', 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 }), index.h("div", { key: '4c13d73fa8ad210f1561ca9d924dc37b5d25f058', class: "control_input__icons" }, this.loading ? (index.h("xv-loader-v2", { size: SIZE_VAR.XS })) : !!this.error ? (index.h("span", { class: "status-icon error", "aria-hidden": "true" }, "!")) : !!this.warning ? (index.h("span", { class: "status-icon warning", "aria-hidden": "true" }, "\u26A0")) : null, index.h("xv-button-v2", { key: 'ded5d2e74f4ff8544d025ce2862422ac69f54f9b', size: this.size, variant: "ghost", disabled: this.disabled || this.readonly, onClick: this.decrement, "aria-label": "Decrease" }, index.h("span", { key: '84bebcdd58a31c59d52685c589361532033074ba', slot: "icon-left", class: "status-icon" }, "\u2212")), index.h("hr", { key: 'ec34eb763fd84994fd3dde49dbb53c5472ff46ed' }), index.h("xv-button-v2", { key: '2275bbefc228ab1147c002c204b93da04d2b001e', size: this.size, variant: "ghost", disabled: this.disabled || this.readonly, onClick: this.increment, "aria-label": "Increase" }, index.h("span", { key: 'c64d970edf867832d6ee74354df55aa1cf151007', slot: "icon-left", class: "status-icon" }, "+"))))), this.helper && index.h("p", { key: 'b463bea86f2fa93c89072898796d03a9cd6c03bd', class: "message" }, this.helper), typeof this.error === 'string' ? (index.h("p", { class: "message error" }, this.error)) : typeof this.warning === 'string' ? (index.h("p", { class: "message warning" }, this.warning)) : null));
|
|
1042
|
+
}
|
|
1043
|
+
static get formAssociated() { return true; }
|
|
1044
|
+
};
|
|
1045
|
+
XvNumberInput.style = xvNumberInputCss;
|
|
1046
|
+
|
|
688
1047
|
const xvOverflowMenuCss = ":host{--overflow-menu-size:40px;--overflow-menu-item-padding:11px 16px;display:inline-flex;flex-direction:column;position:relative}:host .btn{display:inline-flex;align-items:center;justify-content:center;width:var(--overflow-menu-size);height:var(--overflow-menu-size);background-color:transparent;border:1px solid transparent;transition:300ms ease-in-out color, 300ms ease-in-out background-color, 200ms ease box-shadow;font-size:calc(var(--overflow-menu-size) / 2);color:var(--icon-primary);border-radius:5%;margin:0;padding:0}:host .btn:hover{cursor:pointer;color:var(--link-primary-hover);background-color:var(--background-hover)}:host .btn:active{background-color:var(--background-active);color:var(--icon-disabled)}:host .btn:disabled{background-color:transparent;opacity:0.5;cursor:not-allowed}:host .list{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;background-color:var(--layer-01);position:absolute;top:100%;left:0;max-height:0;overflow:hidden;border-radius:3px;transition:200ms ease-in-out max-height, 100ms ease box-shadow;min-width:128px;max-width:50vw;width:max-content}:host .list.open{overflow:visible}:host .list ::slotted(xv-overflow-menu-v2-item){padding:var(--overflow-menu-item-padding)}:host .list.position-right{left:initial;right:0;border-top-right-radius:0}:host .list.position-left{border-top-left-radius:0}:host([size=xs]){--overflow-menu-item-padding:4px 16px;--overflow-menu-size:24px}:host([size=sm]){--overflow-menu-size:32px;--overflow-menu-item-padding:7px 16px}:host([size=md]){--overflow-menu-size:40px;--overflow-menu-item-padding:11px 16px}:host([size=lg]){--overflow-menu-size:48px;--overflow-menu-item-padding:16px}:host([size=xl]){--overflow-menu-size:56px;--overflow-menu-item-padding:16px}:host([open]) .btn{border-bottom-left-radius:0;border-bottom-right-radius:0;background-color:var(--layer-01);box-shadow:-2px 2px 2px 0 rgba(0, 0, 0, 0.1);z-index:1}:host([open]) .list{max-height:500px;z-index:2;box-shadow:-2px 2px 2px 0 rgba(0, 0, 0, 0.1)}";
|
|
689
1048
|
|
|
690
1049
|
const XvOverflowMenu = class {
|
|
@@ -737,7 +1096,7 @@ const XvOverflowMenu = class {
|
|
|
737
1096
|
}
|
|
738
1097
|
}
|
|
739
1098
|
render() {
|
|
740
|
-
return (index.h(index.Host, { key: '
|
|
1099
|
+
return (index.h(index.Host, { key: '49562a0f5cdd0ffc9d07c175f02133ebf91379f8', class: "xv-overflow-menu", size: this.size, role: "menu", tabindex: -1 }, index.h("button", { key: '512bfdab373dd6f91d747cd780588d743e995aba', class: { btn: true, open: this.open }, onClick: this.onOpenToggle, disabled: this.disabled }, index.h("svg", { key: 'ae162d6550bc87396f6f3307e15c3990b417768c', xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 128 512" }, index.h("path", { key: '25c4542139eec20f7e04892baab53347901450ec', 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" }))), index.h("div", { key: '4595e1d6334852bc13d9a1ead5534f1947a6697a', class: { list: true, open: this.open, [`position-${this.position}`]: true } }, index.h("slot", { key: '83c2cabf49ca7cb8e5c9e51526eae1d1b7202380' }))));
|
|
741
1100
|
}
|
|
742
1101
|
componentDidLoad() {
|
|
743
1102
|
this.openChangeHandle();
|
|
@@ -773,7 +1132,7 @@ const XvOverflowMenuItem = class {
|
|
|
773
1132
|
this.itemClick.emit({ event, value: this.value });
|
|
774
1133
|
}
|
|
775
1134
|
render() {
|
|
776
|
-
return (index.h(index.Host, { key: '
|
|
1135
|
+
return (index.h(index.Host, { key: '3dd2a5251f385c53432fbe4964cfa6b506bea62e', class: "xv-overflow-menu-item", role: "menuitem", disabled: this.disabled }, index.h("slot", { key: 'c140fd224ff48c962a85401003d6fc94091d7b05' })));
|
|
777
1136
|
}
|
|
778
1137
|
};
|
|
779
1138
|
XvOverflowMenuItem.style = xvOverflowMenuItemCss;
|
|
@@ -847,7 +1206,7 @@ const XvProgressIndicator = class {
|
|
|
847
1206
|
this.updateChildItems();
|
|
848
1207
|
}
|
|
849
1208
|
render() {
|
|
850
|
-
return (index.h(index.Host, { key: '
|
|
1209
|
+
return (index.h(index.Host, { key: '05e84a5e734b88c4d2a3c2206e4e5ea75c0fc969', variant: this.variant, size: this.size, class: { 'xv-progress-indicator': true } }, index.h("slot", { key: '12dcb64216cfc45663d73d66bbd3225be005e897' })));
|
|
851
1210
|
}
|
|
852
1211
|
get el() { return index.getElement(this); }
|
|
853
1212
|
static get watchers() { return {
|
|
@@ -864,7 +1223,7 @@ const XvProgressIndicatorItem = class {
|
|
|
864
1223
|
this.status = PROGRESS_ITEM_STATUS.NO_STARTED;
|
|
865
1224
|
}
|
|
866
1225
|
render() {
|
|
867
|
-
return (index.h(index.Host, { key: '
|
|
1226
|
+
return (index.h(index.Host, { key: 'b648f0b889dbd13effc1e2df2d0b8df4a4310d33', status: this.status, class: { 'xv-progress-indicator-item': true } }, index.h("span", { key: '9f58d648cf7b954a3be77c2a09c1b0dea135831e', class: "line" }), index.h("span", { key: 'db4cedc2a3ae0894581658fc7e11059e89c6c805', class: "icon" }, index.h("svg", { key: '9418f257a253fe9c366fe148c5a24fa715a6f5ca', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512" }, index.h("path", { key: 'eb7497d0698fde8fbd8f6eedff617ea597802109', 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" }))), index.h("p", { key: 'e71ecb98094b46e8af831d3bc7efd5461819a1cd', class: "label" }, index.h("slot", { key: 'c2332223f5205aabf5501014e6a4521665c2d1f7' }))));
|
|
868
1227
|
}
|
|
869
1228
|
get el() { return index.getElement(this); }
|
|
870
1229
|
};
|
|
@@ -879,7 +1238,7 @@ const XvTab = class {
|
|
|
879
1238
|
this.loading = false;
|
|
880
1239
|
}
|
|
881
1240
|
render() {
|
|
882
|
-
return (index.h(index.Host, { key: '
|
|
1241
|
+
return (index.h(index.Host, { key: 'ab7f5dbb607ca9c91a2503b4f5a739685e2ec45f', disabled: this.disabled, name: this.name }, this.loading ? index.h("xv-loader-v2", { size: SIZE_VAR.LG }) : index.h("slot", null)));
|
|
883
1242
|
}
|
|
884
1243
|
};
|
|
885
1244
|
XvTab.style = xvTabCss;
|
|
@@ -918,7 +1277,7 @@ const XvTable = class {
|
|
|
918
1277
|
.join(' ') + ' repeat(auto-fit, minmax(0, 1fr))');
|
|
919
1278
|
}
|
|
920
1279
|
render() {
|
|
921
|
-
return (index.h(index.Host, { key: '
|
|
1280
|
+
return (index.h(index.Host, { key: '7638ad48563703718ad0cc8fff24ee18cf3a48ff', class: { batchVisible: !!this.selectedCount } }, index.h("slot", { key: '434ff076e975190cc57b748ddea8eeece9cf88bd', name: "title" }, !!this.el.title && index.h("h2", { key: '65da06cb74c47d17b88e835bd7a6ef096af16b45', class: "xv-table-title" }, this.el.title)), index.h("slot", { key: '882e9653dc35963bf24aac581a8d03c4fedd1ae9', name: "toolbar" }), index.h("div", { key: '6c4c289d8bdd312e0d80648012ae8030125b2ed6', class: "xv-table" }, index.h("div", { key: '66ec508b2996535f00bebb8fa1d6639023f4ac23', class: "batch-actions" }, index.h(index.Fragment, { key: 'e28a6fb4c17ec7287d11ff1c6745df530795d7fd' }, index.h("div", { key: '3d9ad8d0757d390fa8beb04acff62848170c6d1c', class: "batch-actions_content" }, index.h("slot", { key: 'bc8fe38784469a85e323ed1d3a6c23acc51a98af', name: "batch" })), index.h("p", { key: '8f49764dfd6c521e31a58fd2a285d149950f3a1c', class: "batch-actions_count" }, !!this.selectedCount && `${this.selectedCount} ${this.selectedCount === 1 ? 'Position ausgewählt' : 'Positionen ausgewählt'}`))), index.h("div", { key: '316cfca89ab6549abdbfadf0fe5806acbc347d0b', class: "xv-table_wrapper" }, index.h("slot", { key: 'a5a7c79f2bfc49b4825b87677899f16c6c8cd9bb' }), index.h("slot", { key: '7e82440672624b8e4c6a4b84c615db38b04fb031', name: "footer" })), !!this.loading && (index.h("div", { key: '3b656b4c0d355884589438f1da2c98d1129a9fac', class: "xv-table_loading" }, index.h("xv-loader-v2", { key: '873d51be85722147c5c52f44f5ba590e5033a529', size: SIZE_VAR.LG }))))));
|
|
922
1281
|
}
|
|
923
1282
|
componentWillLoad() {
|
|
924
1283
|
this.setColsSizeTemplate();
|
|
@@ -930,15 +1289,6 @@ const XvTable = class {
|
|
|
930
1289
|
};
|
|
931
1290
|
XvTable.style = xvTableCss;
|
|
932
1291
|
|
|
933
|
-
var XV_SORT_DIR;
|
|
934
|
-
(function (XV_SORT_DIR) {
|
|
935
|
-
XV_SORT_DIR["ASC"] = "asc";
|
|
936
|
-
XV_SORT_DIR["DESC"] = "desc";
|
|
937
|
-
XV_SORT_DIR["NONE"] = "none";
|
|
938
|
-
})(XV_SORT_DIR || (XV_SORT_DIR = {}));
|
|
939
|
-
const XV_EXPANDABLE_KEY = 'expandable';
|
|
940
|
-
const XV_TABLE_TAG = 'xv-table-v2';
|
|
941
|
-
|
|
942
1292
|
const xvTableCellCss = "@charset \"UTF-8\";:host{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:var(--xv-table-padding-y) var(--xv-table-padding-x);color:var(--text-primary, #333);font-family:var(--ff-body, Tahoma);font-size:14px;font-style:normal;font-weight:400;line-height:1.2;letter-spacing:0.16px;transition:0.25s ease-in-out background-color}:host([multiline]){display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:initial;padding-bottom:1px;padding-top:0;line-height:1.2}:host([align=left]){text-align:left}:host([align=right]){text-align:right}:host([align=center]){text-align:center}:host([sort]){position:relative;cursor:pointer;user-select:none}:host([sort]):before,:host([sort]):after{font-size:12px;line-height:10px;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;right:8px;pointer-events:none;transition:350ms ease-in-out opacity;opacity:0}:host([sort]):before{content:\"▲\";top:50%;transform:translateY(calc(-50% - 5px))}:host([sort])::after{content:\"▼\";top:50%;transform:translateY(calc(-50% + 5px))}:host([sort]:hover){background-color:var(--layer-accent-hover-01, #E3E3E3)}:host([sort]:hover)::before,:host([sort]:hover)::after{opacity:1}:host([sort=asc]){background-color:var(--layer-accent-active-01, #D1D1D1)}:host([sort=asc])::before{opacity:1}:host([sort=asc])::after{display:none}:host([sort=desc]){background-color:var(--layer-accent-active-01, #D1D1D1)}:host([sort=desc])::before{display:none}:host([sort=desc])::after{opacity:1}";
|
|
943
1293
|
|
|
944
1294
|
const XvTableCell = class {
|
|
@@ -966,12 +1316,15 @@ const XvTableCell = class {
|
|
|
966
1316
|
}
|
|
967
1317
|
;
|
|
968
1318
|
render() {
|
|
969
|
-
return (index.h(index.Host, { key: '
|
|
1319
|
+
return (index.h(index.Host, { key: '81ba9b0d8bd1652b30259af7a177b27185c49dee' }, index.h("slot", { key: '5b0517d3001ba92944f2032307541d7db6eb7b27' })));
|
|
970
1320
|
}
|
|
971
1321
|
get el() { return index.getElement(this); }
|
|
972
1322
|
};
|
|
973
1323
|
XvTableCell.style = xvTableCellCss;
|
|
974
1324
|
|
|
1325
|
+
const XV_EXPANDABLE_KEY = 'expandable';
|
|
1326
|
+
const XV_TABLE_TAG = 'xv-table-v2';
|
|
1327
|
+
|
|
975
1328
|
const xvTableExpandCss = ":host{display:block;position:relative;transition:0.25s ease-in-out background-color}:host .expand-btn{z-index:9;position:absolute;left:max(10px, var(--xv-table-padding-x));top:max(2px, var(--xv-table-padding-y) + 2px);background-color:transparent;cursor:pointer;outline:none;margin:0;padding:0;box-sizing:border-box;display:block;width:8.5px;height:8.5px;border-top:none;border-left:none;border-right:2px solid var(--icon-primary, #333);border-bottom:2px solid var(--icon-primary, #333);transform:rotate(45deg);transform-origin:center center;transition:0.2s ease-in-out transform}:host .expand-btn:disabled{cursor:not-allowed;opacity:0.5}:host .expand-btn.open{transform:rotate(-135deg)}:host .expandableContent{overflow:hidden;margin:0;padding:0;max-height:0;transition:250ms ease max-height}:host .expandableContent.open{max-height:600px}:host ::slotted([slot=expandable]){display:grid;align-items:center}:host ::slotted(xv-table-v2-row),:host ::slotted([slot=expandable]){padding-inline-start:calc(max(10px, var(--xv-table-padding-x)) * 2 + 10px)}:host ::slotted([disabled]){pointer-events:none;opacity:0.4;cursor:not-allowed;user-select:none}";
|
|
976
1329
|
|
|
977
1330
|
const XvTableExpand = class {
|
|
@@ -984,7 +1337,7 @@ const XvTableExpand = class {
|
|
|
984
1337
|
};
|
|
985
1338
|
}
|
|
986
1339
|
render() {
|
|
987
|
-
return (index.h(index.Host, { key: '
|
|
1340
|
+
return (index.h(index.Host, { key: '6176a4e0845dbae0f6e28b7a31110e8b2ce6b6d9' }, index.h("button", { key: 'a4d9b8ec62e9a791f24355cba0397af7c5ad8fa6', class: { 'expand-btn': true, open: this.open }, disabled: this.disabled, onClick: this.handleExpand }), index.h("slot", { key: '9d4d815a424de28794a334c1ffeac6613b3bf380', name: XV_EXPANDABLE_KEY }), index.h("div", { key: '4acce147075c142a356f3fcb5cbe9cc5ccaea4c0', class: { expandableContent: true, open: this.open } }, index.h("slot", { key: '0e46f8843b84ddd7bf362b3c5178373b466fb96e' }))));
|
|
988
1341
|
}
|
|
989
1342
|
componentDidLoad() {
|
|
990
1343
|
index$1.setAttr(this.el.parentElement, XV_EXPANDABLE_KEY, true);
|
|
@@ -1039,7 +1392,7 @@ const XvTableRow = class {
|
|
|
1039
1392
|
}
|
|
1040
1393
|
}
|
|
1041
1394
|
render() {
|
|
1042
|
-
return (index.h(index.Host, { key: '
|
|
1395
|
+
return (index.h(index.Host, { key: '1f48d141e4c4b1036332971c34bcd149fbc196f4' }, this.variant !== undefined && (index.h("xv-table-v2-cell", { key: 'a637c7e8796fd48df9f96b8785e96a1b8bb92a2f', class: "cell-control" }, this.variant === 'checkbox' && (index.h("xv-checkbox-v2", { key: '01e7267f1ac891110c5d8d86ba7bb1965ccd0bcf', 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' && (index.h("input", { key: 'ae2eed4ad0763d5c586e3788a9daa9a324ac2bf5', type: "radio", name: this.name, checked: this.checked || this.partial, disabled: this.disabled, required: this.required, readonly: this.readonly })))), index.h("slot", { key: '1fa5632863f0386f1de3b8d869483e297b56c4bd' })));
|
|
1043
1396
|
}
|
|
1044
1397
|
componentWillLoad() {
|
|
1045
1398
|
this.setInitialAttrs();
|
|
@@ -1133,8 +1486,7 @@ const XvTabs = class {
|
|
|
1133
1486
|
const nextTab = this.tabElements[nextIdx];
|
|
1134
1487
|
if (!nextTab || nextTab.hasAttribute('disabled'))
|
|
1135
1488
|
return;
|
|
1136
|
-
this.
|
|
1137
|
-
this.scrollToActiveTab();
|
|
1489
|
+
this.handleTabClick(nextTab.getAttribute('name') || nextIdx);
|
|
1138
1490
|
}
|
|
1139
1491
|
render() {
|
|
1140
1492
|
var _a, _b, _c;
|
|
@@ -1171,19 +1523,12 @@ const XvTag = class {
|
|
|
1171
1523
|
this.closeClick.emit(e);
|
|
1172
1524
|
}
|
|
1173
1525
|
render() {
|
|
1174
|
-
return (index.h(index.Host, { key: '
|
|
1526
|
+
return (index.h(index.Host, { key: '87520047c00d97194c91de7dac1caf125147c1b9', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, index.h("div", { key: '166e1f781942507532ad010e704d4f5a8fdc7da1', class: "xv-tag_content" }, index.h("slot", { key: '14020588654dfa8b6ddd1294c904796536a9020c' })), this.closeable && (index.h("button", { key: '222a7bd11a30e4c12cc45164ae4f294d4c6d6524', onClick: this.closeHandler.bind(this), class: "xv-tag_close" }))));
|
|
1175
1527
|
}
|
|
1176
1528
|
};
|
|
1177
1529
|
XvTag.style = xvTagCss;
|
|
1178
1530
|
|
|
1179
|
-
var
|
|
1180
|
-
(function (TextInputStatus) {
|
|
1181
|
-
TextInputStatus["ERROR"] = "error";
|
|
1182
|
-
TextInputStatus["WARNING"] = "warning";
|
|
1183
|
-
TextInputStatus["DEF"] = "";
|
|
1184
|
-
})(TextInputStatus || (TextInputStatus = {}));
|
|
1185
|
-
|
|
1186
|
-
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{width:100%;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}";
|
|
1531
|
+
const xvTextInputCss = ":host{display:inline-block;text-align:left}:host .control_label{display:block;margin-bottom:var(--spacing-03);color:var(--text-secondary, #515151);font-family:var(--ff-body, Tahoma);font-size:var(--fz-sm, 12px);font-style:normal;font-weight:700;line-height:var(--fz-md);letter-spacing:0.32px}:host .control_input{display:flex;border:1px solid var(--border-subtle-01);outline:2px solid transparent;background-color:transparent;border-radius:3px;transition:250ms ease-in-out border-color, 250ms ease-in-out outline-color}:host .control_input:hover{border-color:var(--border-subtle-selected-01)}:host .control_input:focus-within{outline-color:var(--focus)}:host .control_input.error{outline-color:var(--support-error)}:host .control_input.readonly{border-radius:0;border-top-width:0;border-left-width:0;border-right-width:0;outline-color:transparent}:host .control_input input[type=text]{flex:1;border:none;outline:none;-moz-appearance:textfield;background-color:transparent;margin:0;padding-block:0;padding-inline:var(--spacing-05);box-sizing:border-box;color:var(--text-primary);min-width:20px;font-style:normal;font-weight:400;letter-spacing:0.16px}:host .control_input input[type=text]::-webkit-inner-spin-button,:host .control_input input[type=text]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}:host .control_input__icons{display:inline-flex;align-items:stretch;column-gap:2px;padding-right:var(--spacing-05)}:host .control_input__icons .status-icon{display:inline-flex;align-items:center;align-self:center;font-size:1.35em}:host .control_input__icons .status-icon.error{background-color:var(--support-error);color:white;width:16px;height:16px;border-radius:8px;font-size:12px;font-weight:bold;align-items:center;justify-content:center}:host .control_input__icons .status-icon.warning{color:var(--support-warning)}:host .control_input__icons hr{border:none;outline:none;width:2px;height:60%;align-self:center;background-color:var(--border-subtle-01);display:inline-flex}:host .control_input.xs{height:16px}:host .control_input.sm{height:32px}:host .control_input.md{height:40px}:host .control_input.lg{height:48px}:host .control_input.xl{height:60px}:host .message{margin:var(--spacing-02) 0 0;color:var(--text-helper, #646464);font-size:var(--fz-sm, 12px);font-style:normal;font-weight:400;line-height:var(--fz-md, 16px);letter-spacing:0.32px}:host .message.error{color:var(--text-error)}:host .message.warning{color:var(--text-secondary, #515151)}:host(.disabled){cursor:not-allowed}:host(.disabled) .control_label,:host(.disabled) .control_input input[type=text],:host(.disabled) .control_input input[type=text]::placeholder,:host(.disabled) .message:not(.error){color:var(--text-disabled);cursor:not-allowed}:host(.disabled) .control_input__icons,:host(.disabled) .message.error{opacity:0.5;cursor:not-allowed}:host([block]){display:block}";
|
|
1187
1532
|
|
|
1188
1533
|
const XvTextInput = class {
|
|
1189
1534
|
constructor(hostRef) {
|
|
@@ -1196,59 +1541,1933 @@ const XvTextInput = class {
|
|
|
1196
1541
|
this.internals = hostRef.$hostElement$.attachInternals();
|
|
1197
1542
|
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
1198
1543
|
}
|
|
1199
|
-
this.
|
|
1200
|
-
this.size = SIZE_VAR.MD;
|
|
1201
|
-
this.status = TextInputStatus.DEF;
|
|
1544
|
+
this.type = 'text';
|
|
1202
1545
|
this.value = '';
|
|
1203
|
-
this.disabled = false;
|
|
1204
|
-
this.readonly = false;
|
|
1205
1546
|
this.loading = false;
|
|
1547
|
+
this.size = SIZE_VAR.MD;
|
|
1206
1548
|
this.handleInput = (e) => {
|
|
1207
1549
|
const target = e.target;
|
|
1208
1550
|
this.value = target.value;
|
|
1209
1551
|
this.valueChange.emit(this.value);
|
|
1210
1552
|
this.internals.setFormValue(target.value);
|
|
1211
1553
|
};
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1554
|
+
}
|
|
1555
|
+
render() {
|
|
1556
|
+
return (index.h(index.Host, { key: 'b9c4820d1f0ba4e6baf9cd405c42380577f5379d', class: { disabled: !!this.disabled } }, index.h("label", { key: 'e331f40fc28c74833276e75c8376270589a17279', class: "control" }, this.label && index.h("span", { key: '4d48b122402bd36b98495a9bfdf991512126049d', class: "control_label" }, this.label), index.h("div", { key: '7c4f26d5a943417b54500a54b993108a70a5ed83', class: {
|
|
1557
|
+
'control_input': true,
|
|
1558
|
+
readonly: !!this.readonly,
|
|
1559
|
+
[this.size]: true,
|
|
1560
|
+
error: !!this.error,
|
|
1561
|
+
warning: !!this.warning,
|
|
1562
|
+
} }, index.h("input", { key: 'b6e5cf7ed95c5649b7c1aff16fe7668c2a05c71b', type: this.type, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, onInput: this.handleInput, name: this.name, value: this.value }), index.h("div", { key: '739c31f7939b0baaa3e8d49ec61b016005c427ad', class: "control_input__icons" }, this.loading && index.h("xv-loader-v2", { key: '8aaa989d7ad0fe3b9f86908c648fe2e01c551bc9', size: SIZE_VAR.XS }), !!this.error ? (index.h("span", { class: "status-icon error", "aria-hidden": "true" }, "!")) : !!this.warning ? (index.h("span", { class: "status-icon warning", "aria-hidden": "true" }, "\u26A0")) : null))), this.helper && index.h("p", { key: '7d613edeffa7c6d8e2a76bc69217347187a3b008', class: "message" }, this.helper), typeof this.error === 'string' ? (index.h("p", { class: "message error" }, this.error)) : typeof this.warning === 'string' ? (index.h("p", { class: "message warning" }, this.warning)) : null));
|
|
1563
|
+
}
|
|
1564
|
+
static get formAssociated() { return true; }
|
|
1565
|
+
};
|
|
1566
|
+
XvTextInput.style = xvTextInputCss;
|
|
1567
|
+
|
|
1568
|
+
var top = 'top';
|
|
1569
|
+
var bottom = 'bottom';
|
|
1570
|
+
var right = 'right';
|
|
1571
|
+
var left = 'left';
|
|
1572
|
+
var auto = 'auto';
|
|
1573
|
+
var basePlacements = [top, bottom, right, left];
|
|
1574
|
+
var start = 'start';
|
|
1575
|
+
var end = 'end';
|
|
1576
|
+
var clippingParents = 'clippingParents';
|
|
1577
|
+
var viewport = 'viewport';
|
|
1578
|
+
var popper = 'popper';
|
|
1579
|
+
var reference = 'reference';
|
|
1580
|
+
var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
|
|
1581
|
+
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
1582
|
+
}, []);
|
|
1583
|
+
var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
|
|
1584
|
+
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
1585
|
+
}, []); // modifiers that need to read the DOM
|
|
1586
|
+
|
|
1587
|
+
var beforeRead = 'beforeRead';
|
|
1588
|
+
var read = 'read';
|
|
1589
|
+
var afterRead = 'afterRead'; // pure-logic modifiers
|
|
1590
|
+
|
|
1591
|
+
var beforeMain = 'beforeMain';
|
|
1592
|
+
var main = 'main';
|
|
1593
|
+
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
|
|
1594
|
+
|
|
1595
|
+
var beforeWrite = 'beforeWrite';
|
|
1596
|
+
var write = 'write';
|
|
1597
|
+
var afterWrite = 'afterWrite';
|
|
1598
|
+
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
1599
|
+
|
|
1600
|
+
function getNodeName(element) {
|
|
1601
|
+
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
function getWindow(node) {
|
|
1605
|
+
if (node == null) {
|
|
1606
|
+
return window;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
if (node.toString() !== '[object Window]') {
|
|
1610
|
+
var ownerDocument = node.ownerDocument;
|
|
1611
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
return node;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
function isElement(node) {
|
|
1618
|
+
var OwnElement = getWindow(node).Element;
|
|
1619
|
+
return node instanceof OwnElement || node instanceof Element;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
function isHTMLElement(node) {
|
|
1623
|
+
var OwnElement = getWindow(node).HTMLElement;
|
|
1624
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
function isShadowRoot(node) {
|
|
1628
|
+
// IE 11 has no ShadowRoot
|
|
1629
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
1630
|
+
return false;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
1634
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
// and applies them to the HTMLElements such as popper and arrow
|
|
1638
|
+
|
|
1639
|
+
function applyStyles(_ref) {
|
|
1640
|
+
var state = _ref.state;
|
|
1641
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
1642
|
+
var style = state.styles[name] || {};
|
|
1643
|
+
var attributes = state.attributes[name] || {};
|
|
1644
|
+
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
1645
|
+
|
|
1646
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
1647
|
+
return;
|
|
1648
|
+
} // Flow doesn't support to extend this property, but it's the most
|
|
1649
|
+
// effective way to apply styles to an HTMLElement
|
|
1650
|
+
// $FlowFixMe[cannot-write]
|
|
1651
|
+
|
|
1652
|
+
|
|
1653
|
+
Object.assign(element.style, style);
|
|
1654
|
+
Object.keys(attributes).forEach(function (name) {
|
|
1655
|
+
var value = attributes[name];
|
|
1656
|
+
|
|
1657
|
+
if (value === false) {
|
|
1658
|
+
element.removeAttribute(name);
|
|
1659
|
+
} else {
|
|
1660
|
+
element.setAttribute(name, value === true ? '' : value);
|
|
1661
|
+
}
|
|
1662
|
+
});
|
|
1663
|
+
});
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
function effect$2(_ref2) {
|
|
1667
|
+
var state = _ref2.state;
|
|
1668
|
+
var initialStyles = {
|
|
1669
|
+
popper: {
|
|
1670
|
+
position: state.options.strategy,
|
|
1671
|
+
left: '0',
|
|
1672
|
+
top: '0',
|
|
1673
|
+
margin: '0'
|
|
1674
|
+
},
|
|
1675
|
+
arrow: {
|
|
1676
|
+
position: 'absolute'
|
|
1677
|
+
},
|
|
1678
|
+
reference: {}
|
|
1679
|
+
};
|
|
1680
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
1681
|
+
state.styles = initialStyles;
|
|
1682
|
+
|
|
1683
|
+
if (state.elements.arrow) {
|
|
1684
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
return function () {
|
|
1688
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
1689
|
+
var element = state.elements[name];
|
|
1690
|
+
var attributes = state.attributes[name] || {};
|
|
1691
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
|
|
1692
|
+
|
|
1693
|
+
var style = styleProperties.reduce(function (style, property) {
|
|
1694
|
+
style[property] = '';
|
|
1695
|
+
return style;
|
|
1696
|
+
}, {}); // arrow is optional + virtual elements
|
|
1697
|
+
|
|
1698
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
1699
|
+
return;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
Object.assign(element.style, style);
|
|
1703
|
+
Object.keys(attributes).forEach(function (attribute) {
|
|
1704
|
+
element.removeAttribute(attribute);
|
|
1705
|
+
});
|
|
1706
|
+
});
|
|
1707
|
+
};
|
|
1708
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
1709
|
+
|
|
1710
|
+
|
|
1711
|
+
var applyStyles$1 = {
|
|
1712
|
+
name: 'applyStyles',
|
|
1713
|
+
enabled: true,
|
|
1714
|
+
phase: 'write',
|
|
1715
|
+
fn: applyStyles,
|
|
1716
|
+
effect: effect$2,
|
|
1717
|
+
requires: ['computeStyles']
|
|
1718
|
+
};
|
|
1719
|
+
|
|
1720
|
+
function getBasePlacement(placement) {
|
|
1721
|
+
return placement.split('-')[0];
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
var max = Math.max;
|
|
1725
|
+
var min = Math.min;
|
|
1726
|
+
var round = Math.round;
|
|
1727
|
+
|
|
1728
|
+
function getUAString() {
|
|
1729
|
+
var uaData = navigator.userAgentData;
|
|
1730
|
+
|
|
1731
|
+
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
|
1732
|
+
return uaData.brands.map(function (item) {
|
|
1733
|
+
return item.brand + "/" + item.version;
|
|
1734
|
+
}).join(' ');
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
return navigator.userAgent;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
function isLayoutViewport() {
|
|
1741
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
1745
|
+
if (includeScale === void 0) {
|
|
1746
|
+
includeScale = false;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
if (isFixedStrategy === void 0) {
|
|
1750
|
+
isFixedStrategy = false;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
var clientRect = element.getBoundingClientRect();
|
|
1754
|
+
var scaleX = 1;
|
|
1755
|
+
var scaleY = 1;
|
|
1756
|
+
|
|
1757
|
+
if (includeScale && isHTMLElement(element)) {
|
|
1758
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
1759
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
var _ref = isElement(element) ? getWindow(element) : window,
|
|
1763
|
+
visualViewport = _ref.visualViewport;
|
|
1764
|
+
|
|
1765
|
+
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
1766
|
+
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
1767
|
+
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
1768
|
+
var width = clientRect.width / scaleX;
|
|
1769
|
+
var height = clientRect.height / scaleY;
|
|
1770
|
+
return {
|
|
1771
|
+
width: width,
|
|
1772
|
+
height: height,
|
|
1773
|
+
top: y,
|
|
1774
|
+
right: x + width,
|
|
1775
|
+
bottom: y + height,
|
|
1776
|
+
left: x,
|
|
1777
|
+
x: x,
|
|
1778
|
+
y: y
|
|
1779
|
+
};
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
// means it doesn't take into account transforms.
|
|
1783
|
+
|
|
1784
|
+
function getLayoutRect(element) {
|
|
1785
|
+
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
|
1786
|
+
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
1787
|
+
|
|
1788
|
+
var width = element.offsetWidth;
|
|
1789
|
+
var height = element.offsetHeight;
|
|
1790
|
+
|
|
1791
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
1792
|
+
width = clientRect.width;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
1796
|
+
height = clientRect.height;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
return {
|
|
1800
|
+
x: element.offsetLeft,
|
|
1801
|
+
y: element.offsetTop,
|
|
1802
|
+
width: width,
|
|
1803
|
+
height: height
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
function contains(parent, child) {
|
|
1808
|
+
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
|
1809
|
+
|
|
1810
|
+
if (parent.contains(child)) {
|
|
1811
|
+
return true;
|
|
1812
|
+
} // then fallback to custom implementation with Shadow DOM support
|
|
1813
|
+
else if (rootNode && isShadowRoot(rootNode)) {
|
|
1814
|
+
var next = child;
|
|
1815
|
+
|
|
1816
|
+
do {
|
|
1817
|
+
if (next && parent.isSameNode(next)) {
|
|
1818
|
+
return true;
|
|
1819
|
+
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
|
1820
|
+
|
|
1821
|
+
|
|
1822
|
+
next = next.parentNode || next.host;
|
|
1823
|
+
} while (next);
|
|
1824
|
+
} // Give up, the result is false
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
return false;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
function getComputedStyle(element) {
|
|
1831
|
+
return getWindow(element).getComputedStyle(element);
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
function isTableElement(element) {
|
|
1835
|
+
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
function getDocumentElement(element) {
|
|
1839
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
1840
|
+
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
1841
|
+
element.document) || window.document).documentElement;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
function getParentNode(element) {
|
|
1845
|
+
if (getNodeName(element) === 'html') {
|
|
1846
|
+
return element;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
1850
|
+
// $FlowFixMe[incompatible-return]
|
|
1851
|
+
// $FlowFixMe[prop-missing]
|
|
1852
|
+
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
1853
|
+
element.parentNode || ( // DOM Element detected
|
|
1854
|
+
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
1855
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
1856
|
+
getDocumentElement(element) // fallback
|
|
1857
|
+
|
|
1858
|
+
);
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
function getTrueOffsetParent(element) {
|
|
1862
|
+
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
1863
|
+
getComputedStyle(element).position === 'fixed') {
|
|
1864
|
+
return null;
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
return element.offsetParent;
|
|
1868
|
+
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
|
1869
|
+
// return the containing block
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
function getContainingBlock(element) {
|
|
1873
|
+
var isFirefox = /firefox/i.test(getUAString());
|
|
1874
|
+
var isIE = /Trident/i.test(getUAString());
|
|
1875
|
+
|
|
1876
|
+
if (isIE && isHTMLElement(element)) {
|
|
1877
|
+
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
|
1878
|
+
var elementCss = getComputedStyle(element);
|
|
1879
|
+
|
|
1880
|
+
if (elementCss.position === 'fixed') {
|
|
1881
|
+
return null;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
var currentNode = getParentNode(element);
|
|
1886
|
+
|
|
1887
|
+
if (isShadowRoot(currentNode)) {
|
|
1888
|
+
currentNode = currentNode.host;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
1892
|
+
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
1893
|
+
// create a containing block.
|
|
1894
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1895
|
+
|
|
1896
|
+
if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
|
|
1897
|
+
return currentNode;
|
|
1898
|
+
} else {
|
|
1899
|
+
currentNode = currentNode.parentNode;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
return null;
|
|
1904
|
+
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1905
|
+
// such as table ancestors and cross browser bugs.
|
|
1906
|
+
|
|
1907
|
+
|
|
1908
|
+
function getOffsetParent(element) {
|
|
1909
|
+
var window = getWindow(element);
|
|
1910
|
+
var offsetParent = getTrueOffsetParent(element);
|
|
1911
|
+
|
|
1912
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1913
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
|
1917
|
+
return window;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
function getMainAxisFromPlacement(placement) {
|
|
1924
|
+
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
function within(min$1, value, max$1) {
|
|
1928
|
+
return max(min$1, min(value, max$1));
|
|
1929
|
+
}
|
|
1930
|
+
function withinMaxClamp(min, value, max) {
|
|
1931
|
+
var v = within(min, value, max);
|
|
1932
|
+
return v > max ? max : v;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
function getFreshSideObject() {
|
|
1936
|
+
return {
|
|
1937
|
+
top: 0,
|
|
1938
|
+
right: 0,
|
|
1939
|
+
bottom: 0,
|
|
1940
|
+
left: 0
|
|
1941
|
+
};
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
function mergePaddingObject(paddingObject) {
|
|
1945
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
function expandToHashMap(value, keys) {
|
|
1949
|
+
return keys.reduce(function (hashMap, key) {
|
|
1950
|
+
hashMap[key] = value;
|
|
1951
|
+
return hashMap;
|
|
1952
|
+
}, {});
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
var toPaddingObject = function toPaddingObject(padding, state) {
|
|
1956
|
+
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
|
1957
|
+
placement: state.placement
|
|
1958
|
+
})) : padding;
|
|
1959
|
+
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1962
|
+
function arrow(_ref) {
|
|
1963
|
+
var _state$modifiersData$;
|
|
1964
|
+
|
|
1965
|
+
var state = _ref.state,
|
|
1966
|
+
name = _ref.name,
|
|
1967
|
+
options = _ref.options;
|
|
1968
|
+
var arrowElement = state.elements.arrow;
|
|
1969
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
1970
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
1971
|
+
var axis = getMainAxisFromPlacement(basePlacement);
|
|
1972
|
+
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
|
1973
|
+
var len = isVertical ? 'height' : 'width';
|
|
1974
|
+
|
|
1975
|
+
if (!arrowElement || !popperOffsets) {
|
|
1976
|
+
return;
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
|
1980
|
+
var arrowRect = getLayoutRect(arrowElement);
|
|
1981
|
+
var minProp = axis === 'y' ? top : left;
|
|
1982
|
+
var maxProp = axis === 'y' ? bottom : right;
|
|
1983
|
+
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
|
1984
|
+
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
|
1985
|
+
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
1986
|
+
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
1987
|
+
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
|
1988
|
+
// outside of the popper bounds
|
|
1989
|
+
|
|
1990
|
+
var min = paddingObject[minProp];
|
|
1991
|
+
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
1992
|
+
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
1993
|
+
var offset = within(min, center, max); // Prevents breaking syntax highlighting...
|
|
1994
|
+
|
|
1995
|
+
var axisProp = axis;
|
|
1996
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
function effect$1(_ref2) {
|
|
2000
|
+
var state = _ref2.state,
|
|
2001
|
+
options = _ref2.options;
|
|
2002
|
+
var _options$element = options.element,
|
|
2003
|
+
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
|
2004
|
+
|
|
2005
|
+
if (arrowElement == null) {
|
|
2006
|
+
return;
|
|
2007
|
+
} // CSS selector
|
|
2008
|
+
|
|
2009
|
+
|
|
2010
|
+
if (typeof arrowElement === 'string') {
|
|
2011
|
+
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
2012
|
+
|
|
2013
|
+
if (!arrowElement) {
|
|
2014
|
+
return;
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
if (!contains(state.elements.popper, arrowElement)) {
|
|
2019
|
+
return;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
state.elements.arrow = arrowElement;
|
|
2023
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
2024
|
+
|
|
2025
|
+
|
|
2026
|
+
var arrow$1 = {
|
|
2027
|
+
name: 'arrow',
|
|
2028
|
+
enabled: true,
|
|
2029
|
+
phase: 'main',
|
|
2030
|
+
fn: arrow,
|
|
2031
|
+
effect: effect$1,
|
|
2032
|
+
requires: ['popperOffsets'],
|
|
2033
|
+
requiresIfExists: ['preventOverflow']
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
function getVariation(placement) {
|
|
2037
|
+
return placement.split('-')[1];
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
var unsetSides = {
|
|
2041
|
+
top: 'auto',
|
|
2042
|
+
right: 'auto',
|
|
2043
|
+
bottom: 'auto',
|
|
2044
|
+
left: 'auto'
|
|
2045
|
+
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
|
|
2046
|
+
// Zooming can change the DPR, but it seems to report a value that will
|
|
2047
|
+
// cleanly divide the values into the appropriate subpixels.
|
|
2048
|
+
|
|
2049
|
+
function roundOffsetsByDPR(_ref, win) {
|
|
2050
|
+
var x = _ref.x,
|
|
2051
|
+
y = _ref.y;
|
|
2052
|
+
var dpr = win.devicePixelRatio || 1;
|
|
2053
|
+
return {
|
|
2054
|
+
x: round(x * dpr) / dpr || 0,
|
|
2055
|
+
y: round(y * dpr) / dpr || 0
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
function mapToStyles(_ref2) {
|
|
2060
|
+
var _Object$assign2;
|
|
2061
|
+
|
|
2062
|
+
var popper = _ref2.popper,
|
|
2063
|
+
popperRect = _ref2.popperRect,
|
|
2064
|
+
placement = _ref2.placement,
|
|
2065
|
+
variation = _ref2.variation,
|
|
2066
|
+
offsets = _ref2.offsets,
|
|
2067
|
+
position = _ref2.position,
|
|
2068
|
+
gpuAcceleration = _ref2.gpuAcceleration,
|
|
2069
|
+
adaptive = _ref2.adaptive,
|
|
2070
|
+
roundOffsets = _ref2.roundOffsets,
|
|
2071
|
+
isFixed = _ref2.isFixed;
|
|
2072
|
+
var _offsets$x = offsets.x,
|
|
2073
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
2074
|
+
_offsets$y = offsets.y,
|
|
2075
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
2076
|
+
|
|
2077
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
2078
|
+
x: x,
|
|
2079
|
+
y: y
|
|
2080
|
+
}) : {
|
|
2081
|
+
x: x,
|
|
2082
|
+
y: y
|
|
2083
|
+
};
|
|
2084
|
+
|
|
2085
|
+
x = _ref3.x;
|
|
2086
|
+
y = _ref3.y;
|
|
2087
|
+
var hasX = offsets.hasOwnProperty('x');
|
|
2088
|
+
var hasY = offsets.hasOwnProperty('y');
|
|
2089
|
+
var sideX = left;
|
|
2090
|
+
var sideY = top;
|
|
2091
|
+
var win = window;
|
|
2092
|
+
|
|
2093
|
+
if (adaptive) {
|
|
2094
|
+
var offsetParent = getOffsetParent(popper);
|
|
2095
|
+
var heightProp = 'clientHeight';
|
|
2096
|
+
var widthProp = 'clientWidth';
|
|
2097
|
+
|
|
2098
|
+
if (offsetParent === getWindow(popper)) {
|
|
2099
|
+
offsetParent = getDocumentElement(popper);
|
|
2100
|
+
|
|
2101
|
+
if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
|
|
2102
|
+
heightProp = 'scrollHeight';
|
|
2103
|
+
widthProp = 'scrollWidth';
|
|
2104
|
+
}
|
|
2105
|
+
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
2106
|
+
|
|
2107
|
+
|
|
2108
|
+
offsetParent = offsetParent;
|
|
2109
|
+
|
|
2110
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
2111
|
+
sideY = bottom;
|
|
2112
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
2113
|
+
offsetParent[heightProp];
|
|
2114
|
+
y -= offsetY - popperRect.height;
|
|
2115
|
+
y *= gpuAcceleration ? 1 : -1;
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
2119
|
+
sideX = right;
|
|
2120
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
2121
|
+
offsetParent[widthProp];
|
|
2122
|
+
x -= offsetX - popperRect.width;
|
|
2123
|
+
x *= gpuAcceleration ? 1 : -1;
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
var commonStyles = Object.assign({
|
|
2128
|
+
position: position
|
|
2129
|
+
}, adaptive && unsetSides);
|
|
2130
|
+
|
|
2131
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
2132
|
+
x: x,
|
|
2133
|
+
y: y
|
|
2134
|
+
}, getWindow(popper)) : {
|
|
2135
|
+
x: x,
|
|
2136
|
+
y: y
|
|
2137
|
+
};
|
|
2138
|
+
|
|
2139
|
+
x = _ref4.x;
|
|
2140
|
+
y = _ref4.y;
|
|
2141
|
+
|
|
2142
|
+
if (gpuAcceleration) {
|
|
2143
|
+
var _Object$assign;
|
|
2144
|
+
|
|
2145
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
function computeStyles(_ref5) {
|
|
2152
|
+
var state = _ref5.state,
|
|
2153
|
+
options = _ref5.options;
|
|
2154
|
+
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
2155
|
+
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
2156
|
+
_options$adaptive = options.adaptive,
|
|
2157
|
+
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
|
2158
|
+
_options$roundOffsets = options.roundOffsets,
|
|
2159
|
+
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
2160
|
+
var commonStyles = {
|
|
2161
|
+
placement: getBasePlacement(state.placement),
|
|
2162
|
+
variation: getVariation(state.placement),
|
|
2163
|
+
popper: state.elements.popper,
|
|
2164
|
+
popperRect: state.rects.popper,
|
|
2165
|
+
gpuAcceleration: gpuAcceleration,
|
|
2166
|
+
isFixed: state.options.strategy === 'fixed'
|
|
2167
|
+
};
|
|
2168
|
+
|
|
2169
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
2170
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
2171
|
+
offsets: state.modifiersData.popperOffsets,
|
|
2172
|
+
position: state.options.strategy,
|
|
2173
|
+
adaptive: adaptive,
|
|
2174
|
+
roundOffsets: roundOffsets
|
|
2175
|
+
})));
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
if (state.modifiersData.arrow != null) {
|
|
2179
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
2180
|
+
offsets: state.modifiersData.arrow,
|
|
2181
|
+
position: 'absolute',
|
|
2182
|
+
adaptive: false,
|
|
2183
|
+
roundOffsets: roundOffsets
|
|
2184
|
+
})));
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
2188
|
+
'data-popper-placement': state.placement
|
|
2189
|
+
});
|
|
2190
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
2191
|
+
|
|
2192
|
+
|
|
2193
|
+
var computeStyles$1 = {
|
|
2194
|
+
name: 'computeStyles',
|
|
2195
|
+
enabled: true,
|
|
2196
|
+
phase: 'beforeWrite',
|
|
2197
|
+
fn: computeStyles,
|
|
2198
|
+
data: {}
|
|
2199
|
+
};
|
|
2200
|
+
|
|
2201
|
+
var passive = {
|
|
2202
|
+
passive: true
|
|
2203
|
+
};
|
|
2204
|
+
|
|
2205
|
+
function effect(_ref) {
|
|
2206
|
+
var state = _ref.state,
|
|
2207
|
+
instance = _ref.instance,
|
|
2208
|
+
options = _ref.options;
|
|
2209
|
+
var _options$scroll = options.scroll,
|
|
2210
|
+
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
|
2211
|
+
_options$resize = options.resize,
|
|
2212
|
+
resize = _options$resize === void 0 ? true : _options$resize;
|
|
2213
|
+
var window = getWindow(state.elements.popper);
|
|
2214
|
+
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
2215
|
+
|
|
2216
|
+
if (scroll) {
|
|
2217
|
+
scrollParents.forEach(function (scrollParent) {
|
|
2218
|
+
scrollParent.addEventListener('scroll', instance.update, passive);
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
if (resize) {
|
|
2223
|
+
window.addEventListener('resize', instance.update, passive);
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
return function () {
|
|
2227
|
+
if (scroll) {
|
|
2228
|
+
scrollParents.forEach(function (scrollParent) {
|
|
2229
|
+
scrollParent.removeEventListener('scroll', instance.update, passive);
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
if (resize) {
|
|
2234
|
+
window.removeEventListener('resize', instance.update, passive);
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
2238
|
+
|
|
2239
|
+
|
|
2240
|
+
var eventListeners = {
|
|
2241
|
+
name: 'eventListeners',
|
|
2242
|
+
enabled: true,
|
|
2243
|
+
phase: 'write',
|
|
2244
|
+
fn: function fn() {},
|
|
2245
|
+
effect: effect,
|
|
2246
|
+
data: {}
|
|
2247
|
+
};
|
|
2248
|
+
|
|
2249
|
+
var hash$1 = {
|
|
2250
|
+
left: 'right',
|
|
2251
|
+
right: 'left',
|
|
2252
|
+
bottom: 'top',
|
|
2253
|
+
top: 'bottom'
|
|
2254
|
+
};
|
|
2255
|
+
function getOppositePlacement(placement) {
|
|
2256
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
2257
|
+
return hash$1[matched];
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
var hash = {
|
|
2262
|
+
start: 'end',
|
|
2263
|
+
end: 'start'
|
|
2264
|
+
};
|
|
2265
|
+
function getOppositeVariationPlacement(placement) {
|
|
2266
|
+
return placement.replace(/start|end/g, function (matched) {
|
|
2267
|
+
return hash[matched];
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
function getWindowScroll(node) {
|
|
2272
|
+
var win = getWindow(node);
|
|
2273
|
+
var scrollLeft = win.pageXOffset;
|
|
2274
|
+
var scrollTop = win.pageYOffset;
|
|
2275
|
+
return {
|
|
2276
|
+
scrollLeft: scrollLeft,
|
|
2277
|
+
scrollTop: scrollTop
|
|
2278
|
+
};
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
function getWindowScrollBarX(element) {
|
|
2282
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
2283
|
+
// incorrect for RTL.
|
|
2284
|
+
// Popper 1 is broken in this case and never had a bug report so let's assume
|
|
2285
|
+
// it's not an issue. I don't think anyone ever specifies width on <html>
|
|
2286
|
+
// anyway.
|
|
2287
|
+
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
|
2288
|
+
// this (e.g. Edge 2019, IE11, Safari)
|
|
2289
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
function getViewportRect(element, strategy) {
|
|
2293
|
+
var win = getWindow(element);
|
|
2294
|
+
var html = getDocumentElement(element);
|
|
2295
|
+
var visualViewport = win.visualViewport;
|
|
2296
|
+
var width = html.clientWidth;
|
|
2297
|
+
var height = html.clientHeight;
|
|
2298
|
+
var x = 0;
|
|
2299
|
+
var y = 0;
|
|
2300
|
+
|
|
2301
|
+
if (visualViewport) {
|
|
2302
|
+
width = visualViewport.width;
|
|
2303
|
+
height = visualViewport.height;
|
|
2304
|
+
var layoutViewport = isLayoutViewport();
|
|
2305
|
+
|
|
2306
|
+
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
|
2307
|
+
x = visualViewport.offsetLeft;
|
|
2308
|
+
y = visualViewport.offsetTop;
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
return {
|
|
2313
|
+
width: width,
|
|
2314
|
+
height: height,
|
|
2315
|
+
x: x + getWindowScrollBarX(element),
|
|
2316
|
+
y: y
|
|
2317
|
+
};
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
2321
|
+
|
|
2322
|
+
function getDocumentRect(element) {
|
|
2323
|
+
var _element$ownerDocumen;
|
|
2324
|
+
|
|
2325
|
+
var html = getDocumentElement(element);
|
|
2326
|
+
var winScroll = getWindowScroll(element);
|
|
2327
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
2328
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
2329
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
2330
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
2331
|
+
var y = -winScroll.scrollTop;
|
|
2332
|
+
|
|
2333
|
+
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
2334
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
return {
|
|
2338
|
+
width: width,
|
|
2339
|
+
height: height,
|
|
2340
|
+
x: x,
|
|
2341
|
+
y: y
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
function isScrollParent(element) {
|
|
2346
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
|
2347
|
+
var _getComputedStyle = getComputedStyle(element),
|
|
2348
|
+
overflow = _getComputedStyle.overflow,
|
|
2349
|
+
overflowX = _getComputedStyle.overflowX,
|
|
2350
|
+
overflowY = _getComputedStyle.overflowY;
|
|
2351
|
+
|
|
2352
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
function getScrollParent(node) {
|
|
2356
|
+
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
|
2357
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
2358
|
+
return node.ownerDocument.body;
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
2362
|
+
return node;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
return getScrollParent(getParentNode(node));
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
/*
|
|
2369
|
+
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
|
2370
|
+
until we get to the top window object. This list is what we attach scroll listeners
|
|
2371
|
+
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
2372
|
+
reference element's position.
|
|
2373
|
+
*/
|
|
2374
|
+
|
|
2375
|
+
function listScrollParents(element, list) {
|
|
2376
|
+
var _element$ownerDocumen;
|
|
2377
|
+
|
|
2378
|
+
if (list === void 0) {
|
|
2379
|
+
list = [];
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
var scrollParent = getScrollParent(element);
|
|
2383
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
2384
|
+
var win = getWindow(scrollParent);
|
|
2385
|
+
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
2386
|
+
var updatedList = list.concat(target);
|
|
2387
|
+
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
2388
|
+
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
function rectToClientRect(rect) {
|
|
2392
|
+
return Object.assign({}, rect, {
|
|
2393
|
+
left: rect.x,
|
|
2394
|
+
top: rect.y,
|
|
2395
|
+
right: rect.x + rect.width,
|
|
2396
|
+
bottom: rect.y + rect.height
|
|
2397
|
+
});
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
2401
|
+
var rect = getBoundingClientRect(element, false, strategy === 'fixed');
|
|
2402
|
+
rect.top = rect.top + element.clientTop;
|
|
2403
|
+
rect.left = rect.left + element.clientLeft;
|
|
2404
|
+
rect.bottom = rect.top + element.clientHeight;
|
|
2405
|
+
rect.right = rect.left + element.clientWidth;
|
|
2406
|
+
rect.width = element.clientWidth;
|
|
2407
|
+
rect.height = element.clientHeight;
|
|
2408
|
+
rect.x = rect.left;
|
|
2409
|
+
rect.y = rect.top;
|
|
2410
|
+
return rect;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
2414
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
2415
|
+
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
2416
|
+
// clipping (or hiding) overflowing elements with a position different from
|
|
2417
|
+
// `initial`
|
|
2418
|
+
|
|
2419
|
+
|
|
2420
|
+
function getClippingParents(element) {
|
|
2421
|
+
var clippingParents = listScrollParents(getParentNode(element));
|
|
2422
|
+
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
|
|
2423
|
+
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
2424
|
+
|
|
2425
|
+
if (!isElement(clipperElement)) {
|
|
2426
|
+
return [];
|
|
2427
|
+
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
|
2428
|
+
|
|
2429
|
+
|
|
2430
|
+
return clippingParents.filter(function (clippingParent) {
|
|
2431
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
2432
|
+
});
|
|
2433
|
+
} // Gets the maximum area that the element is visible in due to any number of
|
|
2434
|
+
// clipping parents
|
|
2435
|
+
|
|
2436
|
+
|
|
2437
|
+
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
2438
|
+
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
|
2439
|
+
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
|
2440
|
+
var firstClippingParent = clippingParents[0];
|
|
2441
|
+
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
|
2442
|
+
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
2443
|
+
accRect.top = max(rect.top, accRect.top);
|
|
2444
|
+
accRect.right = min(rect.right, accRect.right);
|
|
2445
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
2446
|
+
accRect.left = max(rect.left, accRect.left);
|
|
2447
|
+
return accRect;
|
|
2448
|
+
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
2449
|
+
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
2450
|
+
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
2451
|
+
clippingRect.x = clippingRect.left;
|
|
2452
|
+
clippingRect.y = clippingRect.top;
|
|
2453
|
+
return clippingRect;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
function computeOffsets(_ref) {
|
|
2457
|
+
var reference = _ref.reference,
|
|
2458
|
+
element = _ref.element,
|
|
2459
|
+
placement = _ref.placement;
|
|
2460
|
+
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
2461
|
+
var variation = placement ? getVariation(placement) : null;
|
|
2462
|
+
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
|
2463
|
+
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
|
2464
|
+
var offsets;
|
|
2465
|
+
|
|
2466
|
+
switch (basePlacement) {
|
|
2467
|
+
case top:
|
|
2468
|
+
offsets = {
|
|
2469
|
+
x: commonX,
|
|
2470
|
+
y: reference.y - element.height
|
|
2471
|
+
};
|
|
2472
|
+
break;
|
|
2473
|
+
|
|
2474
|
+
case bottom:
|
|
2475
|
+
offsets = {
|
|
2476
|
+
x: commonX,
|
|
2477
|
+
y: reference.y + reference.height
|
|
2478
|
+
};
|
|
2479
|
+
break;
|
|
2480
|
+
|
|
2481
|
+
case right:
|
|
2482
|
+
offsets = {
|
|
2483
|
+
x: reference.x + reference.width,
|
|
2484
|
+
y: commonY
|
|
2485
|
+
};
|
|
2486
|
+
break;
|
|
2487
|
+
|
|
2488
|
+
case left:
|
|
2489
|
+
offsets = {
|
|
2490
|
+
x: reference.x - element.width,
|
|
2491
|
+
y: commonY
|
|
2492
|
+
};
|
|
2493
|
+
break;
|
|
2494
|
+
|
|
2495
|
+
default:
|
|
2496
|
+
offsets = {
|
|
2497
|
+
x: reference.x,
|
|
2498
|
+
y: reference.y
|
|
2499
|
+
};
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
2503
|
+
|
|
2504
|
+
if (mainAxis != null) {
|
|
2505
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
2506
|
+
|
|
2507
|
+
switch (variation) {
|
|
2508
|
+
case start:
|
|
2509
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
2510
|
+
break;
|
|
2511
|
+
|
|
2512
|
+
case end:
|
|
2513
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
2514
|
+
break;
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
return offsets;
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
function detectOverflow(state, options) {
|
|
2522
|
+
if (options === void 0) {
|
|
2523
|
+
options = {};
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
var _options = options,
|
|
2527
|
+
_options$placement = _options.placement,
|
|
2528
|
+
placement = _options$placement === void 0 ? state.placement : _options$placement,
|
|
2529
|
+
_options$strategy = _options.strategy,
|
|
2530
|
+
strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
|
|
2531
|
+
_options$boundary = _options.boundary,
|
|
2532
|
+
boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
|
|
2533
|
+
_options$rootBoundary = _options.rootBoundary,
|
|
2534
|
+
rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
|
|
2535
|
+
_options$elementConte = _options.elementContext,
|
|
2536
|
+
elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
|
|
2537
|
+
_options$altBoundary = _options.altBoundary,
|
|
2538
|
+
altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
|
|
2539
|
+
_options$padding = _options.padding,
|
|
2540
|
+
padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
2541
|
+
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
2542
|
+
var altContext = elementContext === popper ? reference : popper;
|
|
2543
|
+
var popperRect = state.rects.popper;
|
|
2544
|
+
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
2545
|
+
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
2546
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
2547
|
+
var popperOffsets = computeOffsets({
|
|
2548
|
+
reference: referenceClientRect,
|
|
2549
|
+
element: popperRect,
|
|
2550
|
+
placement: placement
|
|
2551
|
+
});
|
|
2552
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
2553
|
+
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
2554
|
+
// 0 or negative = within the clipping rect
|
|
2555
|
+
|
|
2556
|
+
var overflowOffsets = {
|
|
2557
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
2558
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
2559
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
2560
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
2561
|
+
};
|
|
2562
|
+
var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
|
|
2563
|
+
|
|
2564
|
+
if (elementContext === popper && offsetData) {
|
|
2565
|
+
var offset = offsetData[placement];
|
|
2566
|
+
Object.keys(overflowOffsets).forEach(function (key) {
|
|
2567
|
+
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
|
2568
|
+
var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
|
|
2569
|
+
overflowOffsets[key] += offset[axis] * multiply;
|
|
2570
|
+
});
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
return overflowOffsets;
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
function computeAutoPlacement(state, options) {
|
|
2577
|
+
if (options === void 0) {
|
|
2578
|
+
options = {};
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
var _options = options,
|
|
2582
|
+
placement = _options.placement,
|
|
2583
|
+
boundary = _options.boundary,
|
|
2584
|
+
rootBoundary = _options.rootBoundary,
|
|
2585
|
+
padding = _options.padding,
|
|
2586
|
+
flipVariations = _options.flipVariations,
|
|
2587
|
+
_options$allowedAutoP = _options.allowedAutoPlacements,
|
|
2588
|
+
allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
2589
|
+
var variation = getVariation(placement);
|
|
2590
|
+
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
|
2591
|
+
return getVariation(placement) === variation;
|
|
2592
|
+
}) : basePlacements;
|
|
2593
|
+
var allowedPlacements = placements$1.filter(function (placement) {
|
|
2594
|
+
return allowedAutoPlacements.indexOf(placement) >= 0;
|
|
2595
|
+
});
|
|
2596
|
+
|
|
2597
|
+
if (allowedPlacements.length === 0) {
|
|
2598
|
+
allowedPlacements = placements$1;
|
|
2599
|
+
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
|
2600
|
+
|
|
2601
|
+
|
|
2602
|
+
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
2603
|
+
acc[placement] = detectOverflow(state, {
|
|
2604
|
+
placement: placement,
|
|
2605
|
+
boundary: boundary,
|
|
2606
|
+
rootBoundary: rootBoundary,
|
|
2607
|
+
padding: padding
|
|
2608
|
+
})[getBasePlacement(placement)];
|
|
2609
|
+
return acc;
|
|
2610
|
+
}, {});
|
|
2611
|
+
return Object.keys(overflows).sort(function (a, b) {
|
|
2612
|
+
return overflows[a] - overflows[b];
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
function getExpandedFallbackPlacements(placement) {
|
|
2617
|
+
if (getBasePlacement(placement) === auto) {
|
|
2618
|
+
return [];
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
var oppositePlacement = getOppositePlacement(placement);
|
|
2622
|
+
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
function flip(_ref) {
|
|
2626
|
+
var state = _ref.state,
|
|
2627
|
+
options = _ref.options,
|
|
2628
|
+
name = _ref.name;
|
|
2629
|
+
|
|
2630
|
+
if (state.modifiersData[name]._skip) {
|
|
2631
|
+
return;
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
var _options$mainAxis = options.mainAxis,
|
|
2635
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
2636
|
+
_options$altAxis = options.altAxis,
|
|
2637
|
+
checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
|
|
2638
|
+
specifiedFallbackPlacements = options.fallbackPlacements,
|
|
2639
|
+
padding = options.padding,
|
|
2640
|
+
boundary = options.boundary,
|
|
2641
|
+
rootBoundary = options.rootBoundary,
|
|
2642
|
+
altBoundary = options.altBoundary,
|
|
2643
|
+
_options$flipVariatio = options.flipVariations,
|
|
2644
|
+
flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
|
|
2645
|
+
allowedAutoPlacements = options.allowedAutoPlacements;
|
|
2646
|
+
var preferredPlacement = state.options.placement;
|
|
2647
|
+
var basePlacement = getBasePlacement(preferredPlacement);
|
|
2648
|
+
var isBasePlacement = basePlacement === preferredPlacement;
|
|
2649
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
2650
|
+
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
|
2651
|
+
return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
|
2652
|
+
placement: placement,
|
|
2653
|
+
boundary: boundary,
|
|
2654
|
+
rootBoundary: rootBoundary,
|
|
2655
|
+
padding: padding,
|
|
2656
|
+
flipVariations: flipVariations,
|
|
2657
|
+
allowedAutoPlacements: allowedAutoPlacements
|
|
2658
|
+
}) : placement);
|
|
2659
|
+
}, []);
|
|
2660
|
+
var referenceRect = state.rects.reference;
|
|
2661
|
+
var popperRect = state.rects.popper;
|
|
2662
|
+
var checksMap = new Map();
|
|
2663
|
+
var makeFallbackChecks = true;
|
|
2664
|
+
var firstFittingPlacement = placements[0];
|
|
2665
|
+
|
|
2666
|
+
for (var i = 0; i < placements.length; i++) {
|
|
2667
|
+
var placement = placements[i];
|
|
2668
|
+
|
|
2669
|
+
var _basePlacement = getBasePlacement(placement);
|
|
2670
|
+
|
|
2671
|
+
var isStartVariation = getVariation(placement) === start;
|
|
2672
|
+
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
2673
|
+
var len = isVertical ? 'width' : 'height';
|
|
2674
|
+
var overflow = detectOverflow(state, {
|
|
2675
|
+
placement: placement,
|
|
2676
|
+
boundary: boundary,
|
|
2677
|
+
rootBoundary: rootBoundary,
|
|
2678
|
+
altBoundary: altBoundary,
|
|
2679
|
+
padding: padding
|
|
2680
|
+
});
|
|
2681
|
+
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
2682
|
+
|
|
2683
|
+
if (referenceRect[len] > popperRect[len]) {
|
|
2684
|
+
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
2688
|
+
var checks = [];
|
|
2689
|
+
|
|
2690
|
+
if (checkMainAxis) {
|
|
2691
|
+
checks.push(overflow[_basePlacement] <= 0);
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
if (checkAltAxis) {
|
|
2695
|
+
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
if (checks.every(function (check) {
|
|
2699
|
+
return check;
|
|
2700
|
+
})) {
|
|
2701
|
+
firstFittingPlacement = placement;
|
|
2702
|
+
makeFallbackChecks = false;
|
|
2703
|
+
break;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
checksMap.set(placement, checks);
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
if (makeFallbackChecks) {
|
|
2710
|
+
// `2` may be desired in some cases – research later
|
|
2711
|
+
var numberOfChecks = flipVariations ? 3 : 1;
|
|
2712
|
+
|
|
2713
|
+
var _loop = function _loop(_i) {
|
|
2714
|
+
var fittingPlacement = placements.find(function (placement) {
|
|
2715
|
+
var checks = checksMap.get(placement);
|
|
2716
|
+
|
|
2717
|
+
if (checks) {
|
|
2718
|
+
return checks.slice(0, _i).every(function (check) {
|
|
2719
|
+
return check;
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
});
|
|
2723
|
+
|
|
2724
|
+
if (fittingPlacement) {
|
|
2725
|
+
firstFittingPlacement = fittingPlacement;
|
|
2726
|
+
return "break";
|
|
2727
|
+
}
|
|
2728
|
+
};
|
|
2729
|
+
|
|
2730
|
+
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
2731
|
+
var _ret = _loop(_i);
|
|
2732
|
+
|
|
2733
|
+
if (_ret === "break") break;
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
if (state.placement !== firstFittingPlacement) {
|
|
2738
|
+
state.modifiersData[name]._skip = true;
|
|
2739
|
+
state.placement = firstFittingPlacement;
|
|
2740
|
+
state.reset = true;
|
|
2741
|
+
}
|
|
2742
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
2743
|
+
|
|
2744
|
+
|
|
2745
|
+
var flip$1 = {
|
|
2746
|
+
name: 'flip',
|
|
2747
|
+
enabled: true,
|
|
2748
|
+
phase: 'main',
|
|
2749
|
+
fn: flip,
|
|
2750
|
+
requiresIfExists: ['offset'],
|
|
2751
|
+
data: {
|
|
2752
|
+
_skip: false
|
|
2753
|
+
}
|
|
2754
|
+
};
|
|
2755
|
+
|
|
2756
|
+
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
2757
|
+
if (preventedOffsets === void 0) {
|
|
2758
|
+
preventedOffsets = {
|
|
2759
|
+
x: 0,
|
|
2760
|
+
y: 0
|
|
2761
|
+
};
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
return {
|
|
2765
|
+
top: overflow.top - rect.height - preventedOffsets.y,
|
|
2766
|
+
right: overflow.right - rect.width + preventedOffsets.x,
|
|
2767
|
+
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
|
2768
|
+
left: overflow.left - rect.width - preventedOffsets.x
|
|
2769
|
+
};
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
function isAnySideFullyClipped(overflow) {
|
|
2773
|
+
return [top, right, bottom, left].some(function (side) {
|
|
2774
|
+
return overflow[side] >= 0;
|
|
2775
|
+
});
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
function hide(_ref) {
|
|
2779
|
+
var state = _ref.state,
|
|
2780
|
+
name = _ref.name;
|
|
2781
|
+
var referenceRect = state.rects.reference;
|
|
2782
|
+
var popperRect = state.rects.popper;
|
|
2783
|
+
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
2784
|
+
var referenceOverflow = detectOverflow(state, {
|
|
2785
|
+
elementContext: 'reference'
|
|
2786
|
+
});
|
|
2787
|
+
var popperAltOverflow = detectOverflow(state, {
|
|
2788
|
+
altBoundary: true
|
|
2789
|
+
});
|
|
2790
|
+
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
2791
|
+
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
2792
|
+
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
2793
|
+
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
2794
|
+
state.modifiersData[name] = {
|
|
2795
|
+
referenceClippingOffsets: referenceClippingOffsets,
|
|
2796
|
+
popperEscapeOffsets: popperEscapeOffsets,
|
|
2797
|
+
isReferenceHidden: isReferenceHidden,
|
|
2798
|
+
hasPopperEscaped: hasPopperEscaped
|
|
2799
|
+
};
|
|
2800
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
2801
|
+
'data-popper-reference-hidden': isReferenceHidden,
|
|
2802
|
+
'data-popper-escaped': hasPopperEscaped
|
|
2803
|
+
});
|
|
2804
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
2805
|
+
|
|
2806
|
+
|
|
2807
|
+
var hide$1 = {
|
|
2808
|
+
name: 'hide',
|
|
2809
|
+
enabled: true,
|
|
2810
|
+
phase: 'main',
|
|
2811
|
+
requiresIfExists: ['preventOverflow'],
|
|
2812
|
+
fn: hide
|
|
2813
|
+
};
|
|
2814
|
+
|
|
2815
|
+
function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
2816
|
+
var basePlacement = getBasePlacement(placement);
|
|
2817
|
+
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
2818
|
+
|
|
2819
|
+
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
|
2820
|
+
placement: placement
|
|
2821
|
+
})) : offset,
|
|
2822
|
+
skidding = _ref[0],
|
|
2823
|
+
distance = _ref[1];
|
|
2824
|
+
|
|
2825
|
+
skidding = skidding || 0;
|
|
2826
|
+
distance = (distance || 0) * invertDistance;
|
|
2827
|
+
return [left, right].indexOf(basePlacement) >= 0 ? {
|
|
2828
|
+
x: distance,
|
|
2829
|
+
y: skidding
|
|
2830
|
+
} : {
|
|
2831
|
+
x: skidding,
|
|
2832
|
+
y: distance
|
|
2833
|
+
};
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
function offset(_ref2) {
|
|
2837
|
+
var state = _ref2.state,
|
|
2838
|
+
options = _ref2.options,
|
|
2839
|
+
name = _ref2.name;
|
|
2840
|
+
var _options$offset = options.offset,
|
|
2841
|
+
offset = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
2842
|
+
var data = placements.reduce(function (acc, placement) {
|
|
2843
|
+
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
|
2844
|
+
return acc;
|
|
2845
|
+
}, {});
|
|
2846
|
+
var _data$state$placement = data[state.placement],
|
|
2847
|
+
x = _data$state$placement.x,
|
|
2848
|
+
y = _data$state$placement.y;
|
|
2849
|
+
|
|
2850
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
2851
|
+
state.modifiersData.popperOffsets.x += x;
|
|
2852
|
+
state.modifiersData.popperOffsets.y += y;
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
state.modifiersData[name] = data;
|
|
2856
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
2857
|
+
|
|
2858
|
+
|
|
2859
|
+
var offset$1 = {
|
|
2860
|
+
name: 'offset',
|
|
2861
|
+
enabled: true,
|
|
2862
|
+
phase: 'main',
|
|
2863
|
+
requires: ['popperOffsets'],
|
|
2864
|
+
fn: offset
|
|
2865
|
+
};
|
|
2866
|
+
|
|
2867
|
+
function popperOffsets(_ref) {
|
|
2868
|
+
var state = _ref.state,
|
|
2869
|
+
name = _ref.name;
|
|
2870
|
+
// Offsets are the actual position the popper needs to have to be
|
|
2871
|
+
// properly positioned near its reference element
|
|
2872
|
+
// This is the most basic placement, and will be adjusted by
|
|
2873
|
+
// the modifiers in the next step
|
|
2874
|
+
state.modifiersData[name] = computeOffsets({
|
|
2875
|
+
reference: state.rects.reference,
|
|
2876
|
+
element: state.rects.popper,
|
|
2877
|
+
placement: state.placement
|
|
2878
|
+
});
|
|
2879
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
2880
|
+
|
|
2881
|
+
|
|
2882
|
+
var popperOffsets$1 = {
|
|
2883
|
+
name: 'popperOffsets',
|
|
2884
|
+
enabled: true,
|
|
2885
|
+
phase: 'read',
|
|
2886
|
+
fn: popperOffsets,
|
|
2887
|
+
data: {}
|
|
2888
|
+
};
|
|
2889
|
+
|
|
2890
|
+
function getAltAxis(axis) {
|
|
2891
|
+
return axis === 'x' ? 'y' : 'x';
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
function preventOverflow(_ref) {
|
|
2895
|
+
var state = _ref.state,
|
|
2896
|
+
options = _ref.options,
|
|
2897
|
+
name = _ref.name;
|
|
2898
|
+
var _options$mainAxis = options.mainAxis,
|
|
2899
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
2900
|
+
_options$altAxis = options.altAxis,
|
|
2901
|
+
checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
|
|
2902
|
+
boundary = options.boundary,
|
|
2903
|
+
rootBoundary = options.rootBoundary,
|
|
2904
|
+
altBoundary = options.altBoundary,
|
|
2905
|
+
padding = options.padding,
|
|
2906
|
+
_options$tether = options.tether,
|
|
2907
|
+
tether = _options$tether === void 0 ? true : _options$tether,
|
|
2908
|
+
_options$tetherOffset = options.tetherOffset,
|
|
2909
|
+
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
2910
|
+
var overflow = detectOverflow(state, {
|
|
2911
|
+
boundary: boundary,
|
|
2912
|
+
rootBoundary: rootBoundary,
|
|
2913
|
+
padding: padding,
|
|
2914
|
+
altBoundary: altBoundary
|
|
2915
|
+
});
|
|
2916
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
2917
|
+
var variation = getVariation(state.placement);
|
|
2918
|
+
var isBasePlacement = !variation;
|
|
2919
|
+
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
2920
|
+
var altAxis = getAltAxis(mainAxis);
|
|
2921
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
2922
|
+
var referenceRect = state.rects.reference;
|
|
2923
|
+
var popperRect = state.rects.popper;
|
|
2924
|
+
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
2925
|
+
placement: state.placement
|
|
2926
|
+
})) : tetherOffset;
|
|
2927
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
2928
|
+
mainAxis: tetherOffsetValue,
|
|
2929
|
+
altAxis: tetherOffsetValue
|
|
2930
|
+
} : Object.assign({
|
|
2931
|
+
mainAxis: 0,
|
|
2932
|
+
altAxis: 0
|
|
2933
|
+
}, tetherOffsetValue);
|
|
2934
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
2935
|
+
var data = {
|
|
2936
|
+
x: 0,
|
|
2937
|
+
y: 0
|
|
2938
|
+
};
|
|
2939
|
+
|
|
2940
|
+
if (!popperOffsets) {
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
if (checkMainAxis) {
|
|
2945
|
+
var _offsetModifierState$;
|
|
2946
|
+
|
|
2947
|
+
var mainSide = mainAxis === 'y' ? top : left;
|
|
2948
|
+
var altSide = mainAxis === 'y' ? bottom : right;
|
|
2949
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
2950
|
+
var offset = popperOffsets[mainAxis];
|
|
2951
|
+
var min$1 = offset + overflow[mainSide];
|
|
2952
|
+
var max$1 = offset - overflow[altSide];
|
|
2953
|
+
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
2954
|
+
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
2955
|
+
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
2956
|
+
// outside the reference bounds
|
|
2957
|
+
|
|
2958
|
+
var arrowElement = state.elements.arrow;
|
|
2959
|
+
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
2960
|
+
width: 0,
|
|
2961
|
+
height: 0
|
|
2962
|
+
};
|
|
2963
|
+
var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
|
|
2964
|
+
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
2965
|
+
var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
|
|
2966
|
+
// to include its full size in the calculation. If the reference is small
|
|
2967
|
+
// and near the edge of a boundary, the popper can overflow even if the
|
|
2968
|
+
// reference is not overflowing as well (e.g. virtual elements with no
|
|
2969
|
+
// width or height)
|
|
2970
|
+
|
|
2971
|
+
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
2972
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
2973
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
2974
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
2975
|
+
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
2976
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
2977
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
2978
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
2979
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
2980
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
2981
|
+
data[mainAxis] = preventedOffset - offset;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
if (checkAltAxis) {
|
|
2985
|
+
var _offsetModifierState$2;
|
|
2986
|
+
|
|
2987
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
2988
|
+
|
|
2989
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
2990
|
+
|
|
2991
|
+
var _offset = popperOffsets[altAxis];
|
|
2992
|
+
|
|
2993
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
2994
|
+
|
|
2995
|
+
var _min = _offset + overflow[_mainSide];
|
|
2996
|
+
|
|
2997
|
+
var _max = _offset - overflow[_altSide];
|
|
2998
|
+
|
|
2999
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
3000
|
+
|
|
3001
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
3002
|
+
|
|
3003
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
3004
|
+
|
|
3005
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
3006
|
+
|
|
3007
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
3008
|
+
|
|
3009
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
3010
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
state.modifiersData[name] = data;
|
|
3014
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
3015
|
+
|
|
3016
|
+
|
|
3017
|
+
var preventOverflow$1 = {
|
|
3018
|
+
name: 'preventOverflow',
|
|
3019
|
+
enabled: true,
|
|
3020
|
+
phase: 'main',
|
|
3021
|
+
fn: preventOverflow,
|
|
3022
|
+
requiresIfExists: ['offset']
|
|
3023
|
+
};
|
|
3024
|
+
|
|
3025
|
+
function getHTMLElementScroll(element) {
|
|
3026
|
+
return {
|
|
3027
|
+
scrollLeft: element.scrollLeft,
|
|
3028
|
+
scrollTop: element.scrollTop
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
function getNodeScroll(node) {
|
|
3033
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
3034
|
+
return getWindowScroll(node);
|
|
3035
|
+
} else {
|
|
3036
|
+
return getHTMLElementScroll(node);
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
function isElementScaled(element) {
|
|
3041
|
+
var rect = element.getBoundingClientRect();
|
|
3042
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
3043
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
3044
|
+
return scaleX !== 1 || scaleY !== 1;
|
|
3045
|
+
} // Returns the composite rect of an element relative to its offsetParent.
|
|
3046
|
+
// Composite means it takes into account transforms as well as layout.
|
|
3047
|
+
|
|
3048
|
+
|
|
3049
|
+
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
3050
|
+
if (isFixed === void 0) {
|
|
3051
|
+
isFixed = false;
|
|
3052
|
+
}
|
|
3053
|
+
|
|
3054
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
3055
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
3056
|
+
var documentElement = getDocumentElement(offsetParent);
|
|
3057
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
3058
|
+
var scroll = {
|
|
3059
|
+
scrollLeft: 0,
|
|
3060
|
+
scrollTop: 0
|
|
3061
|
+
};
|
|
3062
|
+
var offsets = {
|
|
3063
|
+
x: 0,
|
|
3064
|
+
y: 0
|
|
3065
|
+
};
|
|
3066
|
+
|
|
3067
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
3068
|
+
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
|
3069
|
+
isScrollParent(documentElement)) {
|
|
3070
|
+
scroll = getNodeScroll(offsetParent);
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
if (isHTMLElement(offsetParent)) {
|
|
3074
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
3075
|
+
offsets.x += offsetParent.clientLeft;
|
|
3076
|
+
offsets.y += offsetParent.clientTop;
|
|
3077
|
+
} else if (documentElement) {
|
|
3078
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
return {
|
|
3083
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
3084
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
3085
|
+
width: rect.width,
|
|
3086
|
+
height: rect.height
|
|
3087
|
+
};
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
function order(modifiers) {
|
|
3091
|
+
var map = new Map();
|
|
3092
|
+
var visited = new Set();
|
|
3093
|
+
var result = [];
|
|
3094
|
+
modifiers.forEach(function (modifier) {
|
|
3095
|
+
map.set(modifier.name, modifier);
|
|
3096
|
+
}); // On visiting object, check for its dependencies and visit them recursively
|
|
3097
|
+
|
|
3098
|
+
function sort(modifier) {
|
|
3099
|
+
visited.add(modifier.name);
|
|
3100
|
+
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
3101
|
+
requires.forEach(function (dep) {
|
|
3102
|
+
if (!visited.has(dep)) {
|
|
3103
|
+
var depModifier = map.get(dep);
|
|
3104
|
+
|
|
3105
|
+
if (depModifier) {
|
|
3106
|
+
sort(depModifier);
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
});
|
|
3110
|
+
result.push(modifier);
|
|
3111
|
+
}
|
|
3112
|
+
|
|
3113
|
+
modifiers.forEach(function (modifier) {
|
|
3114
|
+
if (!visited.has(modifier.name)) {
|
|
3115
|
+
// check for visited object
|
|
3116
|
+
sort(modifier);
|
|
3117
|
+
}
|
|
3118
|
+
});
|
|
3119
|
+
return result;
|
|
3120
|
+
}
|
|
3121
|
+
|
|
3122
|
+
function orderModifiers(modifiers) {
|
|
3123
|
+
// order based on dependencies
|
|
3124
|
+
var orderedModifiers = order(modifiers); // order based on phase
|
|
3125
|
+
|
|
3126
|
+
return modifierPhases.reduce(function (acc, phase) {
|
|
3127
|
+
return acc.concat(orderedModifiers.filter(function (modifier) {
|
|
3128
|
+
return modifier.phase === phase;
|
|
3129
|
+
}));
|
|
3130
|
+
}, []);
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
function debounce(fn) {
|
|
3134
|
+
var pending;
|
|
3135
|
+
return function () {
|
|
3136
|
+
if (!pending) {
|
|
3137
|
+
pending = new Promise(function (resolve) {
|
|
3138
|
+
Promise.resolve().then(function () {
|
|
3139
|
+
pending = undefined;
|
|
3140
|
+
resolve(fn());
|
|
3141
|
+
});
|
|
3142
|
+
});
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
return pending;
|
|
3146
|
+
};
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
function mergeByName(modifiers) {
|
|
3150
|
+
var merged = modifiers.reduce(function (merged, current) {
|
|
3151
|
+
var existing = merged[current.name];
|
|
3152
|
+
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
|
3153
|
+
options: Object.assign({}, existing.options, current.options),
|
|
3154
|
+
data: Object.assign({}, existing.data, current.data)
|
|
3155
|
+
}) : current;
|
|
3156
|
+
return merged;
|
|
3157
|
+
}, {}); // IE11 does not support Object.values
|
|
3158
|
+
|
|
3159
|
+
return Object.keys(merged).map(function (key) {
|
|
3160
|
+
return merged[key];
|
|
3161
|
+
});
|
|
3162
|
+
}
|
|
3163
|
+
|
|
3164
|
+
var DEFAULT_OPTIONS = {
|
|
3165
|
+
placement: 'bottom',
|
|
3166
|
+
modifiers: [],
|
|
3167
|
+
strategy: 'absolute'
|
|
3168
|
+
};
|
|
3169
|
+
|
|
3170
|
+
function areValidElements() {
|
|
3171
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3172
|
+
args[_key] = arguments[_key];
|
|
3173
|
+
}
|
|
3174
|
+
|
|
3175
|
+
return !args.some(function (element) {
|
|
3176
|
+
return !(element && typeof element.getBoundingClientRect === 'function');
|
|
3177
|
+
});
|
|
3178
|
+
}
|
|
3179
|
+
|
|
3180
|
+
function popperGenerator(generatorOptions) {
|
|
3181
|
+
if (generatorOptions === void 0) {
|
|
3182
|
+
generatorOptions = {};
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
var _generatorOptions = generatorOptions,
|
|
3186
|
+
_generatorOptions$def = _generatorOptions.defaultModifiers,
|
|
3187
|
+
defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
|
|
3188
|
+
_generatorOptions$def2 = _generatorOptions.defaultOptions,
|
|
3189
|
+
defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
3190
|
+
return function createPopper(reference, popper, options) {
|
|
3191
|
+
if (options === void 0) {
|
|
3192
|
+
options = defaultOptions;
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
var state = {
|
|
3196
|
+
placement: 'bottom',
|
|
3197
|
+
orderedModifiers: [],
|
|
3198
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
3199
|
+
modifiersData: {},
|
|
3200
|
+
elements: {
|
|
3201
|
+
reference: reference,
|
|
3202
|
+
popper: popper
|
|
3203
|
+
},
|
|
3204
|
+
attributes: {},
|
|
3205
|
+
styles: {}
|
|
3206
|
+
};
|
|
3207
|
+
var effectCleanupFns = [];
|
|
3208
|
+
var isDestroyed = false;
|
|
3209
|
+
var instance = {
|
|
3210
|
+
state: state,
|
|
3211
|
+
setOptions: function setOptions(setOptionsAction) {
|
|
3212
|
+
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
|
3213
|
+
cleanupModifierEffects();
|
|
3214
|
+
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
3215
|
+
state.scrollParents = {
|
|
3216
|
+
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
3217
|
+
popper: listScrollParents(popper)
|
|
3218
|
+
}; // Orders the modifiers based on their dependencies and `phase`
|
|
3219
|
+
// properties
|
|
3220
|
+
|
|
3221
|
+
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
|
|
3222
|
+
|
|
3223
|
+
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
|
3224
|
+
return m.enabled;
|
|
3225
|
+
});
|
|
3226
|
+
runModifierEffects();
|
|
3227
|
+
return instance.update();
|
|
3228
|
+
},
|
|
3229
|
+
// Sync update – it will always be executed, even if not necessary. This
|
|
3230
|
+
// is useful for low frequency updates where sync behavior simplifies the
|
|
3231
|
+
// logic.
|
|
3232
|
+
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
3233
|
+
// prefer the async Popper#update method
|
|
3234
|
+
forceUpdate: function forceUpdate() {
|
|
3235
|
+
if (isDestroyed) {
|
|
3236
|
+
return;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
var _state$elements = state.elements,
|
|
3240
|
+
reference = _state$elements.reference,
|
|
3241
|
+
popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
|
|
3242
|
+
// anymore
|
|
3243
|
+
|
|
3244
|
+
if (!areValidElements(reference, popper)) {
|
|
3245
|
+
return;
|
|
3246
|
+
} // Store the reference and popper rects to be read by modifiers
|
|
3247
|
+
|
|
3248
|
+
|
|
3249
|
+
state.rects = {
|
|
3250
|
+
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
|
3251
|
+
popper: getLayoutRect(popper)
|
|
3252
|
+
}; // Modifiers have the ability to reset the current update cycle. The
|
|
3253
|
+
// most common use case for this is the `flip` modifier changing the
|
|
3254
|
+
// placement, which then needs to re-run all the modifiers, because the
|
|
3255
|
+
// logic was previously ran for the previous placement and is therefore
|
|
3256
|
+
// stale/incorrect
|
|
3257
|
+
|
|
3258
|
+
state.reset = false;
|
|
3259
|
+
state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
|
|
3260
|
+
// is filled with the initial data specified by the modifier. This means
|
|
3261
|
+
// it doesn't persist and is fresh on each update.
|
|
3262
|
+
// To ensure persistent data, use `${name}#persistent`
|
|
3263
|
+
|
|
3264
|
+
state.orderedModifiers.forEach(function (modifier) {
|
|
3265
|
+
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
3266
|
+
});
|
|
3267
|
+
|
|
3268
|
+
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
3269
|
+
if (state.reset === true) {
|
|
3270
|
+
state.reset = false;
|
|
3271
|
+
index = -1;
|
|
3272
|
+
continue;
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
var _state$orderedModifie = state.orderedModifiers[index],
|
|
3276
|
+
fn = _state$orderedModifie.fn,
|
|
3277
|
+
_state$orderedModifie2 = _state$orderedModifie.options,
|
|
3278
|
+
_options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
|
3279
|
+
name = _state$orderedModifie.name;
|
|
3280
|
+
|
|
3281
|
+
if (typeof fn === 'function') {
|
|
3282
|
+
state = fn({
|
|
3283
|
+
state: state,
|
|
3284
|
+
options: _options,
|
|
3285
|
+
name: name,
|
|
3286
|
+
instance: instance
|
|
3287
|
+
}) || state;
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
},
|
|
3291
|
+
// Async and optimistically optimized update – it will not be executed if
|
|
3292
|
+
// not necessary (debounced to run at most once-per-tick)
|
|
3293
|
+
update: debounce(function () {
|
|
3294
|
+
return new Promise(function (resolve) {
|
|
3295
|
+
instance.forceUpdate();
|
|
3296
|
+
resolve(state);
|
|
3297
|
+
});
|
|
3298
|
+
}),
|
|
3299
|
+
destroy: function destroy() {
|
|
3300
|
+
cleanupModifierEffects();
|
|
3301
|
+
isDestroyed = true;
|
|
3302
|
+
}
|
|
3303
|
+
};
|
|
3304
|
+
|
|
3305
|
+
if (!areValidElements(reference, popper)) {
|
|
3306
|
+
return instance;
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
instance.setOptions(options).then(function (state) {
|
|
3310
|
+
if (!isDestroyed && options.onFirstUpdate) {
|
|
3311
|
+
options.onFirstUpdate(state);
|
|
3312
|
+
}
|
|
3313
|
+
}); // Modifiers have the ability to execute arbitrary code before the first
|
|
3314
|
+
// update cycle runs. They will be executed in the same order as the update
|
|
3315
|
+
// cycle. This is useful when a modifier adds some persistent data that
|
|
3316
|
+
// other modifiers need to use, but the modifier is run after the dependent
|
|
3317
|
+
// one.
|
|
3318
|
+
|
|
3319
|
+
function runModifierEffects() {
|
|
3320
|
+
state.orderedModifiers.forEach(function (_ref) {
|
|
3321
|
+
var name = _ref.name,
|
|
3322
|
+
_ref$options = _ref.options,
|
|
3323
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
3324
|
+
effect = _ref.effect;
|
|
3325
|
+
|
|
3326
|
+
if (typeof effect === 'function') {
|
|
3327
|
+
var cleanupFn = effect({
|
|
3328
|
+
state: state,
|
|
3329
|
+
name: name,
|
|
3330
|
+
instance: instance,
|
|
3331
|
+
options: options
|
|
3332
|
+
});
|
|
3333
|
+
|
|
3334
|
+
var noopFn = function noopFn() {};
|
|
3335
|
+
|
|
3336
|
+
effectCleanupFns.push(cleanupFn || noopFn);
|
|
3337
|
+
}
|
|
3338
|
+
});
|
|
3339
|
+
}
|
|
3340
|
+
|
|
3341
|
+
function cleanupModifierEffects() {
|
|
3342
|
+
effectCleanupFns.forEach(function (fn) {
|
|
3343
|
+
return fn();
|
|
3344
|
+
});
|
|
3345
|
+
effectCleanupFns = [];
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3348
|
+
return instance;
|
|
3349
|
+
};
|
|
3350
|
+
}
|
|
3351
|
+
|
|
3352
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
3353
|
+
var createPopper = /*#__PURE__*/popperGenerator({
|
|
3354
|
+
defaultModifiers: defaultModifiers
|
|
3355
|
+
}); // eslint-disable-next-line import/no-unused-modules
|
|
3356
|
+
|
|
3357
|
+
const xvToggleTipCss = ":host{display:inline-block;font-family:inherit}:host .trigger{display:inline-flex;align-items:center;cursor:pointer;transition:250ms ease-in-out color;color:var(--icon-secondary)}:host .trigger_icon{color:inherit}:host .trigger ::slotted([slot=trigger]){transition:250ms ease-in-out color;color:var(--icon-secondary)}:host .trigger:hover,:host .trigger:active,:host .trigger ::slotted([slot=trigger]:hover),:host .trigger ::slotted([slot=trigger]:active){color:var(--icon-primary)}:host .trigger:focus,:host .trigger ::slotted([slot=trigger]:focus){color:var(--focus)}:host .popover{opacity:1;z-index:1000;position:absolute;background-color:var(--background-inverse);color:var(--text-inverse);border-radius:4px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.25);max-width:288px;font-size:0.875rem;line-height:1.5;margin-top:8px;flex-direction:column;display:flex}:host .popover[data-popper-placement^=top] .popover-tip{bottom:-4px}:host .popover[data-popper-placement^=bottom] .popover-tip{top:-4px}:host .popover[data-popper-placement^=left] .popover-tip{right:-4px}:host .popover[data-popper-placement^=right] .popover-tip{left:-4px}:host .popover .popover-tip{width:10px;height:10px;background-color:transparent;z-index:-1}:host .popover .popover-tip:before{content:\"\";transform:rotate(45deg);background-color:var(--background-inverse);width:inherit;height:inherit;display:inline-block}:host .popover .popover-content{padding:var(--gap-md);display:flex;flex-direction:column;gap:var(--spacing-04)}:host .popover .popover-content ::slotted([slot=header]){font-size:0.875rem;font-weight:600;color:var(--text-secondary)}:host .popover .popover-content ::slotted([slot=body]){font-size:0.875rem;color:var(--text-inverse)}:host .popover .popover-content ::slotted([slot=footer]){font-size:0.75rem;color:var(--text-inverse);opacity:0.8}:host(:not([open])) .popover{opacity:0;z-index:-1;user-select:none;pointer-events:none}";
|
|
3358
|
+
|
|
3359
|
+
const XvToggleTip = class {
|
|
3360
|
+
constructor(hostRef) {
|
|
3361
|
+
index.registerInstance(this, hostRef);
|
|
3362
|
+
this.openChange = index.createEvent(this, "openChange");
|
|
3363
|
+
this.open = false;
|
|
3364
|
+
this.position = 'auto';
|
|
3365
|
+
this.destroyPopper = () => {
|
|
3366
|
+
if (this.popperInstance) {
|
|
3367
|
+
this.popperInstance.destroy();
|
|
3368
|
+
this.popperInstance = undefined;
|
|
1223
3369
|
}
|
|
1224
3370
|
};
|
|
1225
3371
|
}
|
|
3372
|
+
openChangeHandle() {
|
|
3373
|
+
if (this.open) {
|
|
3374
|
+
requestAnimationFrame(() => this.createPopper());
|
|
3375
|
+
}
|
|
3376
|
+
else {
|
|
3377
|
+
this.destroyPopper();
|
|
3378
|
+
}
|
|
3379
|
+
this.openChange.emit(this.open);
|
|
3380
|
+
}
|
|
3381
|
+
handleClickOutside(e) {
|
|
3382
|
+
if (this.open && !this.el.contains(e.target)) {
|
|
3383
|
+
this.open = false;
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
;
|
|
3387
|
+
handleKeyDown(e) {
|
|
3388
|
+
if (e.key === 'Escape' && this.open) {
|
|
3389
|
+
this.open = false;
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
;
|
|
3393
|
+
async setPopover(open) {
|
|
3394
|
+
if (open === this.open)
|
|
3395
|
+
return;
|
|
3396
|
+
this.open = open;
|
|
3397
|
+
return this.open;
|
|
3398
|
+
}
|
|
3399
|
+
;
|
|
3400
|
+
createPopper() {
|
|
3401
|
+
if (!this.triggerEl || !this.popoverEl) {
|
|
3402
|
+
console.warn('XvToggleTip can`t find the trigger or popover container!');
|
|
3403
|
+
return;
|
|
3404
|
+
}
|
|
3405
|
+
this.popperInstance = createPopper(this.triggerEl, this.popoverEl, {
|
|
3406
|
+
placement: this.position,
|
|
3407
|
+
modifiers: [
|
|
3408
|
+
{
|
|
3409
|
+
name: 'offset',
|
|
3410
|
+
options: {
|
|
3411
|
+
offset: [0, 8],
|
|
3412
|
+
},
|
|
3413
|
+
},
|
|
3414
|
+
{
|
|
3415
|
+
name: 'preventOverflow',
|
|
3416
|
+
options: {
|
|
3417
|
+
boundary: 'viewport',
|
|
3418
|
+
padding: 8,
|
|
3419
|
+
},
|
|
3420
|
+
},
|
|
3421
|
+
],
|
|
3422
|
+
});
|
|
3423
|
+
}
|
|
3424
|
+
;
|
|
1226
3425
|
render() {
|
|
1227
|
-
return (index.h(index.Host, { key: '
|
|
3426
|
+
return (index.h(index.Host, { key: '7b125738966144a7fdafe1ae26d77b72085b8003', class: "xv-toggle-tip" }, index.h("div", { key: '0fefcfc966714aa98d98672a1727aa2fc6bfadf2', class: "trigger", role: "button", tabindex: "0", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": "popover", onClick: () => this.setPopover(!this.open), ref: (el) => (this.triggerEl = el) }, index.h("slot", { key: '752b5bf8be01660d12a6911e4a594c69da6b1e0c', name: "trigger" }, index.h("svg", { key: '6a594cfd8a4ff05d30d70fdda25a01157f6f94ee', class: "trigger_icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: 16, height: 16 }, index.h("path", { key: '133a8b6e0f4d04e3c4df60209517191d5fd508fe', 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" })))), index.h("div", { key: 'ee2d9238662f276f76669353139a25867708f625', class: { popover: true }, role: "tooltip", tabindex: "-1", ref: (el) => (this.popoverEl = el) }, index.h("div", { key: '3c9f9455849855757051aeeac26cba84123f6f7d', class: "popover-tip", part: "tip", "data-popper-arrow": "" }), index.h("div", { key: 'cfb0da55d009997e002f072b7ff36efaf14fb06f', class: "popover-content" }, index.h("slot", { key: 'f2dc06851b50ed5002f819e018f2bf191011fbf3', name: "header" }), index.h("slot", { key: '2dc5b57ffd60fa4586dc43b3e9534e4ede376199', name: "body" }), index.h("slot", { key: '1c236e27d751fd957fdeaf2605d8b24495b59daf', name: "footer" })))));
|
|
1228
3427
|
}
|
|
1229
|
-
|
|
1230
|
-
this.
|
|
3428
|
+
disconnectedCallback() {
|
|
3429
|
+
this.destroyPopper();
|
|
1231
3430
|
}
|
|
1232
|
-
static get formAssociated() { return true; }
|
|
1233
3431
|
get el() { return index.getElement(this); }
|
|
3432
|
+
static get watchers() { return {
|
|
3433
|
+
"open": ["openChangeHandle"]
|
|
3434
|
+
}; }
|
|
1234
3435
|
};
|
|
1235
|
-
|
|
3436
|
+
XvToggleTip.style = xvToggleTipCss;
|
|
1236
3437
|
|
|
1237
|
-
const xvTooltipCss = ":host{position:relative;display:
|
|
3438
|
+
const xvTooltipCss = ":host{position:relative;display:contents}.xv-tooltip[role=tooltip]{position:absolute;background-color:var(--background-inverse);color:var(--text-on-color);padding:var(--spacing-03) var(--spacing-04);border-radius:3px;font-size:var(--fz-md);z-index:999;max-width:min(400px, 90vw);overflow:visible}.xv-tooltip[role=tooltip] [data-popper-arrow]{position:absolute;width:10px;height:10px;background-color:transparent;z-index:-1}.xv-tooltip[role=tooltip] [data-popper-arrow]:before{content:\"\";transform:rotate(45deg);background-color:var(--background-inverse);width:inherit;height:inherit;display:inline-block}.xv-tooltip[role=tooltip][data-popper-placement^=top] [data-popper-arrow]{bottom:1px}.xv-tooltip[role=tooltip][data-popper-placement^=bottom] [data-popper-arrow]{top:-10px}.xv-tooltip[role=tooltip][data-popper-placement^=left] [data-popper-arrow]{right:-4px}.xv-tooltip[role=tooltip][data-popper-placement^=right] [data-popper-arrow]{left:-4px}";
|
|
1238
3439
|
|
|
1239
3440
|
const XvTooltip = class {
|
|
1240
3441
|
constructor(hostRef) {
|
|
1241
3442
|
index.registerInstance(this, hostRef);
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
this.
|
|
3443
|
+
this.position = 'auto';
|
|
3444
|
+
this.visible = false;
|
|
3445
|
+
}
|
|
3446
|
+
onMouseEnter() {
|
|
3447
|
+
this.visible = true;
|
|
3448
|
+
requestAnimationFrame(() => this.createPopper());
|
|
3449
|
+
}
|
|
3450
|
+
onMouseLeave() {
|
|
3451
|
+
this.visible = false;
|
|
3452
|
+
this.destroyPopper();
|
|
3453
|
+
}
|
|
3454
|
+
createPopper() {
|
|
3455
|
+
if (this.tooltipEl) {
|
|
3456
|
+
this.popperInstance = createPopper(this.el, this.tooltipEl, {
|
|
3457
|
+
placement: this.position,
|
|
3458
|
+
modifiers: [{ name: 'offset', options: { offset: [0, 8] } }],
|
|
3459
|
+
});
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
destroyPopper() {
|
|
3463
|
+
var _a;
|
|
3464
|
+
(_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
3465
|
+
this.popperInstance = null;
|
|
1248
3466
|
}
|
|
1249
3467
|
render() {
|
|
1250
|
-
return (index.h(index.Host, { key: '
|
|
3468
|
+
return (index.h(index.Host, { key: 'd1f0178c3853f96716217630ff0349a0396f33a0' }, index.h("slot", { key: '11af6ea09c3d833318118164f0493bf4c98316a3' }, index.h("svg", { key: '614c37cd6eda62cc3745f49252627f1383a46166', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: 16, height: 16 }, index.h("path", { key: '11f2da0b818971c6f17145e1fa5b17b1852faafd', 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" }))), this.visible && (index.h("div", { key: '8f0db2decd3ff2993b0b618e2111cac861fec058', class: "xv-tooltip", ref: (el) => (this.tooltipEl = el), role: "tooltip" }, this.message, index.h("div", { key: 'a8e05a8dbe988e7df14da6a16f42e528a68708c0', class: "xv-tooltip-arrow", "data-popper-arrow": "" })))));
|
|
1251
3469
|
}
|
|
3470
|
+
get el() { return index.getElement(this); }
|
|
1252
3471
|
};
|
|
1253
3472
|
XvTooltip.style = xvTooltipCss;
|
|
1254
3473
|
|
|
@@ -1257,8 +3476,13 @@ exports.xv_accordion_v2_item = XvAccordionItem;
|
|
|
1257
3476
|
exports.xv_button_v2 = XvButton;
|
|
1258
3477
|
exports.xv_card_v2 = XvCard;
|
|
1259
3478
|
exports.xv_checkbox_v2 = XvCheckbox;
|
|
3479
|
+
exports.xv_data_table = XvDataTable;
|
|
3480
|
+
exports.xv_data_table_cell = XvDataTableCell;
|
|
3481
|
+
exports.xv_data_table_collapse = XvDataTableCollapse;
|
|
3482
|
+
exports.xv_data_table_row = XvDataTableRow;
|
|
1260
3483
|
exports.xv_dropdown_v2 = XvDropdown;
|
|
1261
3484
|
exports.xv_dropdown_v2_item = XvDropdownItem;
|
|
3485
|
+
exports.xv_file_uploader = XvFileUploader;
|
|
1262
3486
|
exports.xv_footer = Xvfooter;
|
|
1263
3487
|
exports.xv_header = XvHeader;
|
|
1264
3488
|
exports.xv_link_v2 = XvLink;
|
|
@@ -1266,6 +3490,7 @@ exports.xv_loader_v2 = XvLoader;
|
|
|
1266
3490
|
exports.xv_login_modal = XvLoginModal;
|
|
1267
3491
|
exports.xv_modal_v2 = XvModal;
|
|
1268
3492
|
exports.xv_notification_v2 = XvNotification;
|
|
3493
|
+
exports.xv_number_input_v2 = XvNumberInput;
|
|
1269
3494
|
exports.xv_overflow_menu_v2 = XvOverflowMenu;
|
|
1270
3495
|
exports.xv_overflow_menu_v2_item = XvOverflowMenuItem;
|
|
1271
3496
|
exports.xv_progress_indicator_v2 = XvProgressIndicator;
|
|
@@ -1278,7 +3503,8 @@ exports.xv_table_v2_row = XvTableRow;
|
|
|
1278
3503
|
exports.xv_tabs_v2 = XvTabs;
|
|
1279
3504
|
exports.xv_tag_v2 = XvTag;
|
|
1280
3505
|
exports.xv_text_input_v2 = XvTextInput;
|
|
3506
|
+
exports.xv_toggle_tip = XvToggleTip;
|
|
1281
3507
|
exports.xv_tooltip_v2 = XvTooltip;
|
|
1282
|
-
//# sourceMappingURL=xv-accordion-v2.xv-accordion-v2-item.xv-button-v2.xv-card-v2.xv-checkbox-v2.xv-dropdown-v2.xv-dropdown-v2-item.xv-footer.xv-header.xv-link-v2.xv-loader-v2.xv-login-modal.xv-modal-v2.xv-notification-v2.xv-overflow-menu-v2.xv-overflow-menu-v2-item.xv-progress-indicator-v2.xv-progress-indicator-v2-item.xv-tab-v2.xv-table-v2.xv-table-v2-cell.xv-table-v2-expand.xv-table-v2-row.xv-tabs-v2.xv-tag-v2.xv-text-input-v2.xv-tooltip-v2.entry.cjs.js.map
|
|
3508
|
+
//# sourceMappingURL=xv-accordion-v2.xv-accordion-v2-item.xv-button-v2.xv-card-v2.xv-checkbox-v2.xv-data-table.xv-data-table-cell.xv-data-table-collapse.xv-data-table-row.xv-dropdown-v2.xv-dropdown-v2-item.xv-file-uploader.xv-footer.xv-header.xv-link-v2.xv-loader-v2.xv-login-modal.xv-modal-v2.xv-notification-v2.xv-number-input-v2.xv-overflow-menu-v2.xv-overflow-menu-v2-item.xv-progress-indicator-v2.xv-progress-indicator-v2-item.xv-tab-v2.xv-table-v2.xv-table-v2-cell.xv-table-v2-expand.xv-table-v2-row.xv-tabs-v2.xv-tag-v2.xv-text-input-v2.xv-toggle-tip.xv-tooltip-v2.entry.cjs.js.map
|
|
1283
3509
|
|
|
1284
|
-
//# sourceMappingURL=xv-accordion-
|
|
3510
|
+
//# sourceMappingURL=xv-accordion-v2_34.cjs.entry.js.map
|