xv-webcomponents 1.19.2 → 1.20.1
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/{_vars-A07oKwJ_.js → _vars-DMytunQw.js} +9 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{xv-accordion-v2_47.cjs.entry.js → xv-accordion-v2_48.cjs.entry.js} +448 -90
- package/dist/cjs/xv-header-next.cjs.entry.js +2 -2
- package/dist/cjs/xv-mega-menu-next.cjs.entry.js +2 -2
- package/dist/cjs/xv-webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/xv-button/xv-button-v2.css +8 -8
- package/dist/collection/components/xv-button/xv-button.js +25 -2
- package/dist/collection/components/xv-button-group/xv-button-group.css +173 -0
- package/dist/collection/components/xv-button-group/xv-button-group.js +206 -0
- package/dist/collection/components/xv-card/xv-card.js +1 -1
- package/dist/collection/components/xv-checkbox/xv-checkbox.js +2 -2
- package/dist/collection/components/xv-content-switcher/xv-content-switcher-item/xv-content-switcher-item.js +1 -1
- package/dist/collection/components/xv-content-switcher/xv-content-switcher.js +2 -2
- package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.js +1 -1
- package/dist/collection/components/xv-data-table/xv-data-table-collapse/xv-data-table-collapse.js +1 -1
- package/dist/collection/components/xv-data-table/xv-data-table-row/xv-data-table-row.js +2 -2
- package/dist/collection/components/xv-data-table/xv-data-table.js +1 -1
- package/dist/collection/components/xv-datepicker/xv-datepicker.js +2 -2
- package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js +1 -1
- package/dist/collection/components/xv-dropdown/xv-dropdown.js +1 -1
- package/dist/collection/components/xv-file-uploader/xv-file-uploader.js +1 -1
- package/dist/collection/components/xv-footer/xv-footer.js +1 -1
- package/dist/collection/components/xv-header/xv-header.css +4 -71
- package/dist/collection/components/xv-header/xv-header.js +10 -4
- package/dist/collection/components/xv-header-next/xv-header-next.js +1 -1
- package/dist/collection/components/xv-image-viewer/xv-image-viewer.js +1 -1
- package/dist/collection/components/xv-link/xv-link.js +1 -1
- package/dist/collection/components/xv-mega-menu/xv-mega-menu.js +2 -2
- package/dist/collection/components/xv-mega-menu-next/xv-mega-menu-next.js +2 -2
- package/dist/collection/components/xv-modal/xv-modal.js +1 -1
- package/dist/collection/components/xv-notification/xv-notification.js +1 -1
- package/dist/collection/components/xv-number-input/xv-number-input.js +2 -2
- package/dist/collection/components/xv-overflow-menu/_vars.js +7 -6
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.css +48 -8
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js +84 -2
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.css +28 -2
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js +373 -22
- package/dist/collection/components/xv-pagination/xv-pagination.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-radio/xv-radio.js +2 -2
- package/dist/collection/components/xv-slider/xv-slider.js +1 -1
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +1 -1
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +1 -1
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +1 -1
- package/dist/collection/components/xv-table/xv-table.js +1 -1
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +1 -1
- package/dist/collection/components/xv-tag/xv-tag.js +1 -1
- package/dist/collection/components/xv-tag-combobox/xv-tag-combobox.css +7 -0
- package/dist/collection/components/xv-tag-combobox/xv-tag-combobox.js +37 -9
- package/dist/collection/components/xv-text-input/xv-text-input.js +2 -2
- package/dist/collection/components/xv-textarea/xv-textarea.js +2 -2
- package/dist/collection/components/xv-tile/xv-tile.js +2 -2
- package/dist/collection/components/xv-toggle/xv-toggle.js +1 -1
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js +1 -1
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +2 -2
- package/dist/esm/{_vars-C6jsOjam.js → _vars-CDEU4jkD.js} +7 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{xv-accordion-v2_47.entry.js → xv-accordion-v2_48.entry.js} +448 -91
- package/dist/esm/xv-header-next.entry.js +2 -2
- package/dist/esm/xv-mega-menu-next.entry.js +2 -2
- package/dist/esm/xv-webcomponents.js +1 -1
- package/dist/types/components/xv-button/xv-button.d.ts +2 -0
- package/dist/types/components/xv-button-group/xv-button-group.d.ts +54 -0
- package/dist/types/components/xv-overflow-menu/_vars.d.ts +14 -5
- package/dist/types/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.d.ts +10 -0
- package/dist/types/components/xv-overflow-menu/xv-overflow-menu.d.ts +43 -3
- package/dist/types/components/xv-tag-combobox/xv-tag-combobox.d.ts +1 -0
- package/dist/types/components.d.ts +177 -0
- package/dist/xv-webcomponents/{p-9284f4be.entry.js → p-0b0ce8e2.entry.js} +1 -1
- package/dist/xv-webcomponents/p-9edaba20.entry.js +8 -0
- package/dist/xv-webcomponents/p-CDEU4jkD.js +1 -0
- package/dist/xv-webcomponents/{p-3a20074c.entry.js → p-fa1779f0.entry.js} +1 -1
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/xv-webcomponents/p-6bb184f5.entry.js +0 -8
- package/dist/xv-webcomponents/p-C6jsOjam.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-C4fJ70r4.js');
|
|
4
|
-
var _vars = require('./_vars-
|
|
4
|
+
var _vars = require('./_vars-DMytunQw.js');
|
|
5
5
|
var index$1 = require('./index-DwneAp1a.js');
|
|
6
6
|
|
|
7
7
|
const userMagnifyingGlassRegularFullSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNjQwIj48IS0tIUZvbnQgQXdlc29tZSBQcm8gNy4xLjAgYnkgQGZvbnRhd2Vzb21lIC0gaHR0cHM6Ly9mb250YXdlc29tZS5jb20gTGljZW5zZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tL2xpY2Vuc2UgKENvbW1lcmNpYWwgTGljZW5zZSkgQ29weXJpZ2h0IDIwMjUgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0iTTE3Ni41IDE5MkMxNzYuNSAxNDcuOCAyMTIuMyAxMTIgMjU2LjUgMTEyQzMwMC43IDExMiAzMzYuNSAxNDcuOCAzMzYuNSAxOTJDMzM2LjUgMjM2LjIgMzAwLjcgMjcyIDI1Ni41IDI3MkMyMTIuMyAyNzIgMTc2LjUgMjM2LjIgMTc2LjUgMTkyek0zODQuNSAxOTJDMzg0LjUgMTIxLjMgMzI3LjIgNjQgMjU2LjUgNjRDMTg1LjggNjQgMTI4LjUgMTIxLjMgMTI4LjUgMTkyQzEyOC41IDI2Mi43IDE4NS44IDMyMCAyNTYuNSAzMjBDMzI3LjIgMzIwIDM4NC41IDI2Mi43IDM4NC41IDE5MnpNODAuNSA1NDRDODAuNSA0NzMuMyAxMzcuOCA0MTYgMjA4LjUgNDE2TDI4OC43IDQxNkMyODkuNSAzOTkuMiAyOTIuNyAzODMuMSAyOTguMSAzNjhMMjA4LjUgMzY4QzExMS4zIDM2OCAzMi41IDQ0Ni44IDMyLjUgNTQ0TDMyLjUgNTUyQzMyLjUgNTY1LjMgNDMuMiA1NzYgNTYuNSA1NzZDNjkuOCA1NzYgODAuNSA1NjUuMyA4MC41IDU1Mkw4MC41IDU0NHpNNDU2LjUgMzUyQzQ5Ni4zIDM1MiA1MjguNSAzODQuMiA1MjguNSA0MjRDNTI4LjUgNDYzLjggNDk2LjMgNDk2IDQ1Ni41IDQ5NkM0MTYuNyA0OTYgMzg0LjUgNDYzLjggMzg0LjUgNDI0QzM4NC41IDM4NC4yIDQxNi43IDM1MiA0NTYuNSAzNTJ6TTQ1Ni41IDU0NEM0ODAuOSA1NDQgNTAzLjYgNTM2LjcgNTIyLjYgNTI0LjJMNTgzLjUgNTg1LjFDNTkyLjkgNTk0LjUgNjA4LjEgNTk0LjUgNjE3LjQgNTg1LjFDNjI2LjcgNTc1LjcgNjI2LjggNTYwLjUgNjE3LjQgNTUxLjJMNTU2LjUgNDkwLjNDNTY5LjEgNDcxLjMgNTc2LjQgNDQ4LjUgNTc2LjQgNDI0QzU3Ni40IDM1Ny43IDUyMi43IDMwNCA0NTYuNCAzMDRDMzkwLjEgMzA0IDMzNi40IDM1Ny43IDMzNi40IDQyNEMzMzYuNCA0OTAuMyAzOTAuMSA1NDQgNDU2LjQgNTQ0eiIvPjwvc3ZnPg==';
|
|
@@ -199,7 +199,7 @@ const XvHeaderNext = class {
|
|
|
199
199
|
render() {
|
|
200
200
|
var _a, _b, _c, _d, _e;
|
|
201
201
|
const isXvBrand = (((_a = this.metaNav) === null || _a === void 0 ? void 0 : _a['WhitelabelName']) || 'Xv') === 'Xv';
|
|
202
|
-
return (index.h("header", { key: '
|
|
202
|
+
return (index.h("header", { key: 'c0012b5ecac3c6471b4ec7b1bfd2eccc3f86dd5f', class: "header" }, index.h("div", { key: 'cfb8213dac2c3fc8ceef915067a51aa0d7a9555f', class: "header-wrapper" }, index.h("div", { key: 'd3d2ccf65f3cefe5c67546e43fed176917877ead', class: "xv-container" }, index.h("div", { key: 'a8fe5efaba57b5687516513d374f9cfba0c705b2', class: "header-top" }, index.h("div", { key: '4b2119408ec66776a86af787383b79ebee41106d', class: "header-top--left" }, index.h("xv-button-v2", { key: 'f097db3d55ace0242e871961e6108436e0131aad', class: "menu-btn", variant: "ghost", onClick: this.toggleMobMenu }, index.h("i", { key: '0986f3d44c8898a3e2f0bd298f2819f3e9a5a34b', slot: "icon-left", class: { 'fa': true, 'fa-times': this.mobMenuOpen, 'fa-bars': !this.mobMenuOpen } })), this.metaNav && (index.h("a", { key: 'bf800f74bd14a7c425fcb6eb61aa8225dfcc3ee3', href: `${window.location.origin}/` }, index.h("picture", { key: '5c976747d8ff1cfdd6393340873ed45358cb181d' }, index.h("source", { key: 'a7b14ff940f436afe7f7efd6c04db248b0a06729', srcSet: ((_b = this.metaNav) === null || _b === void 0 ? void 0 : _b.LogoUrl) || 'https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo.svg', media: "(min-width: 990px)" }), index.h("img", { key: 'd3a1889224b26633def31994483a8bcdfb56e774', src: ((_c = this.metaNav) === null || _c === void 0 ? void 0 : _c.LogoSmallUrl) || 'https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo-small.svg', onError: this.logoFallback, loading: "lazy", alt: "Crossvertise" })))), this.orgUnit && (index.h("xv-link-v2", { key: 'b1aba193ddf6c193f4ea05e3bf3856b50261ef67', class: "header-top--orgUnit", variant: "standalone", href: "/de-de/mycrossvertise" }, this.orgUnit))), index.h("ul", { key: '1c91ec33597c7c8ac8f92f3f7c5e759ef50e1dda', class: "header-top--right" }, this._renderLocaleSwitcher(), this._renderSearch(), this._renderImpersonationInfo(), !((_d = this.metaNav) === null || _d === void 0 ? void 0 : _d.IsManager) && isXvBrand && (index.h("li", { key: '1dc84281285f1b66a3942f8b51055be5d05dd846' }, index.h("xv-link-v2", { key: 'de90e6054b9f0cd9bf1fee2b8cbb3f6aedbf9767', variant: "ghost", href: "https://www.crossvertise.com/ueber-uns/kontakt" }, index.h("xv-button-v2", { key: '4fd63e27baad255ef62e36b5e4b6ced436fdf01e', variant: "ghost", size: _vars.SIZE_VAR.MD }, index.h("i", { key: '1c2569b332c7caa5518e0884b646020a11b5ae43', class: "header-icon far fa-envelope" }), index.h("span", { key: 'f890b2fbbdcd750cd1f19fd3d0b8731db1163013', class: "header-label xv-body-02" }, "Kontakt"))))), this._renderNotifications(), this._renderAccount(), !((_e = this.metaNav) === null || _e === void 0 ? void 0 : _e.IsManager) && isXvBrand && (index.h("li", { key: 'd5a450877b90b5cf8671e7cf315f0af03c392a03' }, index.h("xv-link-v2", { key: '9ab83170245eb9cc36e47969f381b7fb2229b010', variant: "ghost", href: "https://help.crossvertise.com" }, index.h("xv-button-v2", { key: 'ca823e73d6088c2be70335658187eb8aedd5142e', variant: "ghost", size: _vars.SIZE_VAR.MD }, index.h("i", { key: '0b72b8d4c39c1a986590275ba486249f94fc915a', class: "header-icon far fa-question-circle" }), index.h("span", { key: '41ae816f63d86995f5ae92fb383fd7f42374bedb', class: "header-label xv-body-02" }, "Hilfe"))))), this._renderShoppingCart()))), index.h("div", { key: 'c591fc53113a711ae4f716ca58246b076931ab3a', class: "header-wrapper--bg" }, index.h("div", { key: '2be8a3100c70b41cf60ca423fa7bedc9fd220d6d', class: "xv-container" }, index.h("xv-mega-menu-next", { key: 'd0f07991030a2067a8250ccc1f5efef36dbe74b3', open: this.mobMenuOpen, onOpenChange: this.closeMobMenu, menuData: this.menuData })))), index.h("xv-login-modal", { key: 'dd27d33edef87ad2915151573005dbf0e0291005', visible: this.showLoginModal, onClose: () => this.showLoginModal = false })));
|
|
203
203
|
}
|
|
204
204
|
get el() { return index.getElement(this); }
|
|
205
205
|
};
|
|
@@ -90,7 +90,7 @@ const XvMegaMenuNext = class {
|
|
|
90
90
|
void this.fetchMenuData();
|
|
91
91
|
}
|
|
92
92
|
render() {
|
|
93
|
-
return (index.h(index.Host, { key: '
|
|
93
|
+
return (index.h(index.Host, { key: 'f72d11053417cb7e999a24257f38ff00ba1a7097' }, index.h("nav", { key: '721da64fcb2d4a0268f1d26592225da518284457', class: { 'xv-menu': true, open: this.open } }, this.menuLoading && (index.h("div", { key: 'fbe58f4d8b44bffd9dc868d21d44c0f70361a1a1', class: { 'xv-menu-loader': true, open: this.open } }, index.h("xv-loader-v2", { key: 'd6b9dfb3bfd9026db6f4be158e558bdb993c9f08' }))), index.h("ul", { key: '208ad56e913ba59ed28f6781eed51e48d0843ab9', class: { menu: true, open: this.open } }, this.menuItems.map((menuItem) => {
|
|
94
94
|
var _a, _b;
|
|
95
95
|
return (index.h("li", { class: { 'menu-item': true, active: menuItem.id === ((_a = this.activeItem) === null || _a === void 0 ? void 0 : _a.id) } }, menuItem.route ? (index.h("xv-link-v2", { variant: "ghost", href: menuItem.route.route }, index.h("p", { class: "menu-item-label" }, (_b = menuItem.route) === null || _b === void 0 ? void 0 : _b.label))) : (index.h(index.Fragment, null, index.h("p", { class: "menu-item-label", onClick: () => this.setActiveItem(menuItem) }, menuItem === null || menuItem === void 0 ? void 0 : menuItem.label), index.h("ul", { class: "menu-item-groups" }, menuItem.groups.map((group) => {
|
|
96
96
|
var _a;
|
|
@@ -100,7 +100,7 @@ const XvMegaMenuNext = class {
|
|
|
100
100
|
} }, index.h("div", { class: "group-menus" }, index.h("ul", { class: { 'group-menus-categories': true, inline: group.layout === 'inline' } }, group.categories.map((category) => (index.h("li", { class: "category" }, index.h("p", { class: "category-label" }, category.label), index.h("ul", { class: "category-routes" }, category.routes.map((route) => (index.h("li", { class: "route" }, index.h("xv-link-v2", { size: "lg", variant: "ghost", href: route.route || '#' }, route.label), route.tag && (index.h("xv-tag-v2", { class: "route-tag", size: "sm", color: "#161616", bg: "#E0E0E0" }, route.tag)))))))))), index.h("ul", { class: "group-menus-actions" }, group.actions.map((action) => (index.h("li", { class: "action" }, action.type === 'link' && (index.h("xv-link-v2", { variant: "standalone", href: action === null || action === void 0 ? void 0 : action.url }, action.label, index.h("span", { class: "link-chevron", slot: "icon-right" }, "\u2192"))), action.type === 'button' &&
|
|
101
101
|
index.h("xv-button-v2", { onClick: () => this.navActionClick(action), block: true, variant: "tertiary" }, action.label)))))), (group === null || group === void 0 ? void 0 : group.card) && (index.h("div", { class: "group-card" }, index.h("xv-card-v2", { media: this.applicationContext !== 'Komsa' ? group.card.image : undefined, variant: this.isMobile ? 'horizontal' : 'vertical' }, index.h("h5", { slot: "header", class: "group-card-title" }, group.card.title), index.h("p", { slot: "body", class: "group-card-desc" }, group.card.description), group.card.linkLabel && (index.h("xv-link-v2", { slot: "footer", variant: "standalone", href: group.card.linkUrl || '#' }, group.card.linkLabel, index.h("span", { class: "link-chevron", slot: "icon-right" }, "\u2192"))))))))));
|
|
102
102
|
}))))));
|
|
103
|
-
}), index.h("li", { key: '
|
|
103
|
+
}), index.h("li", { key: '773b59d60bf0410b1fc60c59c24e6772e856492b', class: "menu--right" }, index.h("slot", { key: '89c6b08cdc47fc264308cf2f962c89266c6d5073', name: "menu-right" })), this.open && (index.h("li", { key: '5e3e1d1e38a97c72dbcb8ee3f521f16d4aba3cbd', class: "menu--backdrop", onClick: () => this.handleClose() }))))));
|
|
104
104
|
}
|
|
105
105
|
get el() { return index.getElement(this); }
|
|
106
106
|
static get watchers() { return {
|
|
@@ -18,7 +18,7 @@ var patchBrowser = () => {
|
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(async (options) => {
|
|
20
20
|
await index.globalScripts();
|
|
21
|
-
return index.bootstrapLazy([["xv-accordion-
|
|
21
|
+
return index.bootstrapLazy([["xv-accordion-v2_48.cjs",[[0,"xv-header",{"metaNav":[32],"orgUnit":[32],"baseUrl":[32],"loading":[32],"mobMenuOpen":[32],"suggestions":[32],"suggestionsLoading":[32],"notifications":[32],"showLoginModal":[32]},[[8,"xv:orgUnitChange","handleOrgUnitChange"],[8,"xv:metaNav-update","metaNavUpdate"]]],[257,"xv-dropdown-v2",{"search":[516],"disabled":[516],"multiple":[516],"required":[516],"loading":[516],"readonly":[516],"open":[1540],"error":[520],"label":[513],"helper":[513],"warning":[513],"placeholder":[513],"info":[1],"searchPlaceholder":[1,"search-placeholder"],"size":[1],"defaultValue":[8,"default-value"],"value":[1032],"variant":[1],"position":[1],"selected":[32],"selectedMap":[32],"resolvedPosition":[32]},[[0,"itemSelected","handleItemSelected"],[0,"keydown","handleKeyDown"]],{"open":[{"openChangeHandle":0}],"multiple":[{"multipleChangeHandle":0}],"value":[{"valueChange":1}]}],[257,"xv-data-table-row",{"variant":[1],"name":[1025],"collapse":[1],"collapsable":[516],"checked":[1028],"partial":[1028],"hover":[1028],"group":[4],"header":[4],"footer":[4],"disabled":[4],"readonly":[4],"required":[4],"value":[8],"collapsed":[32],"reorderable":[32],"reorderHandleMode":[32],"close":[64]}],[65,"xv-datepicker",{"value":[1040],"variant":[1],"label":[1],"helper":[1],"error":[8],"warning":[8],"readonly":[4],"disabled":[4],"loading":[4],"block":[4],"size":[513],"min":[1],"max":[1],"month":[32],"days":[32],"open":[32],"localError":[32]},[[4,"click","handleClickOutside"]],{"open":[{"openChange":0}],"month":[{"getCalendarGrid":0}],"value":[{"handleValueChange":0}]}],[1,"xv-file-uploader",{"label":[1],"description":[1],"addText":[1,"add-text"],"variant":[1],"size":[1],"accept":[16],"buttonVariant":[1,"button-variant"],"maxFileSizeMB":[2,"max-file-size-mb"],"maxFiles":[2,"max-files"],"multiple":[4],"disabled":[516],"files":[1040],"loadingStates":[1040],"error":[1537],"errors":[1040],"dragActive":[32],"errorMessages":[32],"clearFiles":[64]}],[65,"xv-number-input-v2",{"label":[1],"placeholder":[513],"name":[513],"value":[1538],"helper":[1],"error":[8],"warning":[8],"step":[2],"max":[2],"min":[2],"readonly":[4],"disabled":[4],"loading":[4],"block":[516],"size":[513]}],[1,"xv-pagination",{"total":[2],"page":[1026],"size":[1],"block":[4],"variant":[1],"responsiveVariant":[16],"totalItems":[2,"total-items"],"itemsPerPage":[32],"currentVariant":[32]}],[257,"xv-table-v2-row",{"checked":[1540],"partial":[1540],"name":[1537],"value":[520],"hover":[1540],"readonly":[516],"required":[516],"disabled":[516],"header":[516],"variant":[1537]},null,{"checked":[{"checkedChangeHandle":0}]}],[1,"xv-tag-combobox",{"options":[16],"label":[1],"size":[1],"placeholder":[1],"allowCreate":[4,"allow-create"],"maxSuggestions":[2,"max-suggestions"],"disabled":[4],"loading":[4],"readonly":[4],"error":[8],"warning":[8],"value":[16],"normalizedOptions":[32],"selected":[32],"inputValue":[32],"open":[32],"filtered":[32],"highlighted":[32],"focusInput":[64],"clear":[64]},null,{"options":[{"watchOptions":0}],"value":[{"watchValue":0}]}],[65,"xv-textarea",{"value":[1025],"name":[1],"label":[1],"placeholder":[1],"helper":[1],"info":[1],"error":[8],"warning":[8],"disabled":[4],"readonly":[4],"block":[4],"counterHide":[4,"counter-hide"],"noResize":[4,"no-resize"],"loading":[4],"max":[2],"rows":[2],"size":[513]}],[257,"xv-data-table",{"size":[1],"block":[520],"loading":[4],"columnWidths":[16],"multiple":[516],"hover":[4],"reorderable":[516],"reorderHandle":[513,"reorder-handle"]},null,{"reorderable":[{"reorderableChanged":0}],"reorderHandle":[{"reorderHandleChanged":0}]}],[257,"xv-dropdown-v2-item",{"disabled":[4],"value":[1544],"selected":[1540],"multiple":[516],"size":[513]},[[0,"click","handleClick"]]],[257,"xv-image-viewer",{"src":[1],"fullscreenSrc":[1,"fullscreen-src"],"alt":[1],"placeholder":[1],"lazy":[4],"isFullscreen":[32],"loaded":[32],"fullscreenLoaded":[32],"errored":[32]}],[257,"xv-tab-v2",{"label":[513],"disabled":[516],"loading":[516],"name":[8]}],[257,"xv-table-v2",{"size":[513],"hover":[516],"loading":[516],"colsSize":[16],"selected":[32],"selectedCount":[32]},[[0,"checkedChange","handleCheckedChange"]],{"colsSize":[{"setColsSizeTemplate":0}]}],[257,"xv-tabs-v2",{"active":[1544],"loading":[516],"variant":[1],"emptyMessage":[1,"empty-message"],"hideSingleTab":[4,"hide-single-tab"],"tabElements":[32],"showArrows":[32]},[[9,"resize","updateArrowVisibility"]]],[257,"xv-accordion-v2",{"multiple":[4],"xvId":[1,"xv-id"],"value":[1025],"opened":[32],"toggleItem":[64]}],[257,"xv-accordion-v2-item",{"disabled":[4],"label":[1],"value":[1],"isOpen":[32]},[[16,"accordionChange","handleAccordionChange"]]],[260,"xv-breadcrumbs-v2"],[257,"xv-button-group-v2",{"variant":[513],"multiple":[516],"value":[1025]},[[0,"click","handleClick"]],{"value":[{"onSelectionInputChange":0}],"multiple":[{"onSelectionInputChange":0}]}],[257,"xv-content-switcher-item-v2",{"value":[520],"label":[513],"icon":[513],"disabled":[516]}],[257,"xv-content-switcher-v2",{"selected":[1544],"size":[513],"iconOnly":[516,"icon-only"],"disabled":[516],"block":[516],"controlled":[516],"items":[32]}],[257,"xv-data-table-collapse",{"collapsed":[1540],"setCollapsed":[64]}],[0,"xv-footer",{"data":[32]},[[8,"xv:metaNav-update","handleLoadData"]]],[257,"xv-progress-indicator-v2",{"progress":[514],"variant":[1],"size":[1]},null,{"progress":[{"updateChildItems":0}]}],[257,"xv-progress-indicator-v2-item",{"status":[1]}],[324,"xv-radio-v2",{"name":[1],"value":[1],"label":[1],"checked":[1028],"indeterminate":[4],"block":[4],"disabled":[4],"required":[4],"reverse":[4],"readonly":[4],"error":[8],"warning":[520],"size":[1]},null,{"checked":[{"onCheckedChange":0}]}],[65,"xv-slider-v2",{"label":[1],"name":[1],"min":[2],"max":[2],"value":[1026],"step":[2],"disabled":[4],"readonly":[4],"notEditable":[4,"not-editable"]}],[257,"xv-table-v2-expand",{"open":[1540],"disabled":[516]}],[260,"xv-tile",{"variant":[513],"label":[1],"error":[4],"multiple":[4],"disabled":[4],"block":[4],"name":[1],"message":[513],"value":[1025],"checked":[1028],"readonly":[1028]},[[4,"tileChange","tileChangeHandle"],[0,"click","handleClick"]]],[321,"xv-toggle",{"label":[1],"value":[1],"name":[1],"checked":[1540],"disabled":[4],"readonly":[4],"size":[513],"block":[4]}],[257,"xv-mega-menu",{"open":[1540],"activeItem":[32],"activeGroup":[32],"menuItems":[32],"applicationContext":[32],"menuLoading":[32]},[[4,"click","handleClickOutside"]]],[257,"xv-data-table-cell",{"name":[1025],"sort":[1537],"multiline":[520],"width":[1],"align":[1],"tooltip":[1]},[[0,"click","handleSort"]]],[257,"xv-table-v2-cell",{"multiline":[516],"name":[1537],"align":[513],"sort":[1537]},[[0,"click","handleSort"]]],[2,"xv-login-modal",{"visible":[4],"urls":[32],"loading":[32],"errorMessage":[32]}],[257,"xv-overflow-menu-v2",{"open":[1540],"disabled":[516],"position":[1],"alignment":[1],"size":[1],"tooltip":[1],"anchor":[1],"activeId":[32],"openMenu":[64],"closeMenu":[64],"toggleMenu":[64]},[[0,"keydown","handleKeyDown"]],{"open":[{"openChangeHandle":0}],"anchor":[{"anchorChangeHandle":0}]}],[257,"xv-overflow-menu-v2-item",{"disabled":[516],"value":[520],"variant":[513],"clickable":[4],"href":[1],"target":[1],"divider":[516],"hasIcon":[32],"hasIconEnd":[32]},[[0,"click","handleClick"]]],[257,"xv-toggle-tip",{"open":[1540],"autoSize":[516,"auto-size"],"block":[4],"position":[1],"setPopover":[64]},[[4,"click","handleClickOutside"],[0,"keydown","handleKeyDown"]],{"open":[{"openChangeHandle":0}]}],[257,"xv-modal-v2",{"open":[1540],"permanent":[516],"size":[513],"overflow":[516],"loading":[4],"openModal":[64],"closeModal":[64]}],[257,"xv-notification-v2",{"variant":[513],"dismissible":[516]}],[65,"xv-text-input-v2",{"type":[1],"label":[1],"placeholder":[513],"name":[513],"value":[1025],"autocomplete":[1],"helper":[1],"error":[8],"warning":[8],"readonly":[4],"disabled":[4],"loading":[4],"block":[516],"size":[513],"isPasswordVisible":[32]}],[257,"xv-card-v2",{"variant":[1],"media":[1],"header":[1],"body":[1],"footer":[1]}],[257,"xv-link-v2",{"href":[1],"target":[1],"disabled":[4],"size":[1],"variant":[1]}],[321,"xv-checkbox-v2",{"checked":[1540],"indeterminate":[516],"disabled":[516],"name":[513],"value":[513],"readonly":[516],"required":[516],"partial":[516],"label":[1],"size":[513],"error":[520],"align":[513],"hasFocus":[32]},null,{"checked":[{"onCheckedChange":0}]}],[257,"xv-tag-v2",{"size":[1],"color":[1],"bg":[1],"disabled":[4],"closeable":[4]}],[260,"xv-tooltip-v2",{"message":[1],"position":[1],"block":[4],"dashed":[4]},[[1,"mouseenter","onMouseEnter"],[1,"mouseleave","onMouseLeave"]]],[321,"xv-button-v2",{"value":[1],"name":[1],"label":[513],"variant":[513],"size":[513],"disabled":[516],"loading":[516],"block":[516],"type":[513],"active":[516],"hasLeftIcon":[32],"hasRightIcon":[32],"hasContent":[32]}],[257,"xv-loader-v2",{"show":[4],"variant":[1],"size":[1]}]]],["xv-mega-menu-next.cjs",[[257,"xv-mega-menu-next",{"open":[1540],"menuData":[1,"menu-data"],"activeItem":[32],"activeGroup":[32],"menuItems":[32],"applicationContext":[32],"menuLoading":[32]},[[4,"click","handleClickOutside"]],{"menuData":[{"onMenuDataChange":0}]}]]],["xv-header-next.cjs",[[0,"xv-header-next",{"menuData":[1,"menu-data"],"currentLocale":[1,"current-locale"],"locales":[1],"metaNav":[32],"orgUnit":[32],"baseUrl":[32],"loading":[32],"mobMenuOpen":[32],"suggestions":[32],"suggestionsLoading":[32],"notifications":[32],"showLoginModal":[32]},[[8,"xv:orgUnitChange","handleOrgUnitChange"],[8,"xv:metaNav-update","metaNavUpdate"]]]]]], options);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
exports.setNonce = index.setNonce;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"components/xv-accordion-item/xv-accordion-item.js",
|
|
5
5
|
"components/xv-breadcrumbs/xv-breadcrumbs.js",
|
|
6
6
|
"components/xv-button/xv-button.js",
|
|
7
|
+
"components/xv-button-group/xv-button-group.js",
|
|
7
8
|
"components/xv-card/xv-card.js",
|
|
8
9
|
"components/xv-checkbox/xv-checkbox.js",
|
|
9
10
|
"components/xv-content-switcher/xv-content-switcher.js",
|
|
@@ -141,9 +141,9 @@
|
|
|
141
141
|
align-items: center;
|
|
142
142
|
justify-content: center;
|
|
143
143
|
box-sizing: border-box;
|
|
144
|
-
border-radius: 3px;
|
|
144
|
+
border-radius: var(--xv-button-border-radius, 3px);
|
|
145
145
|
font-size: var(--fz-md);
|
|
146
|
-
font-family: var(--ff-body, Tahoma);
|
|
146
|
+
font-family: var(--ff-body, Tahoma), sans-serif;
|
|
147
147
|
font-style: normal;
|
|
148
148
|
font-weight: var(--xv-button-font-weight, 700);
|
|
149
149
|
line-height: 128.571%;
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
.xv-button--primary:hover {
|
|
192
192
|
background-color: var(--button-primary-hover);
|
|
193
193
|
}
|
|
194
|
-
.xv-button--primary:active {
|
|
194
|
+
.xv-button--primary.xv-button--active, .xv-button--primary:active {
|
|
195
195
|
background-color: var(--button-primary-active);
|
|
196
196
|
}
|
|
197
197
|
.xv-button--accent {
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
.xv-button--accent:hover {
|
|
202
202
|
background-color: var(--button-accent-hover);
|
|
203
203
|
}
|
|
204
|
-
.xv-button--accent:active {
|
|
204
|
+
.xv-button--accent.xv-button--active, .xv-button--accent:active {
|
|
205
205
|
background-color: var(--button-accent-active);
|
|
206
206
|
}
|
|
207
207
|
.xv-button--secondary {
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
.xv-button--secondary:hover {
|
|
213
213
|
background-color: var(--button-secondary-hover);
|
|
214
214
|
}
|
|
215
|
-
.xv-button--secondary:active {
|
|
215
|
+
.xv-button--secondary.xv-button--active, .xv-button--secondary:active {
|
|
216
216
|
background-color: var(--button-secondary-active);
|
|
217
217
|
}
|
|
218
218
|
.xv-button--danger {
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
.xv-button--danger:hover {
|
|
223
223
|
background-color: #ba1b23;
|
|
224
224
|
}
|
|
225
|
-
.xv-button--danger:active {
|
|
225
|
+
.xv-button--danger.xv-button--active, .xv-button--danger:active {
|
|
226
226
|
background-color: #750e13;
|
|
227
227
|
}
|
|
228
228
|
.xv-button--danger:disabled {
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
.xv-button--tertiary:hover {
|
|
239
239
|
background-color: var(--button-tertiary-hover);
|
|
240
240
|
}
|
|
241
|
-
.xv-button--tertiary:active {
|
|
241
|
+
.xv-button--tertiary.xv-button--active, .xv-button--tertiary:active {
|
|
242
242
|
background-color: var(--button-tertiary-active);
|
|
243
243
|
}
|
|
244
244
|
.xv-button--tertiary:disabled {
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
.xv-button--ghost:hover {
|
|
254
254
|
background-color: var(--background-hover);
|
|
255
255
|
}
|
|
256
|
-
.xv-button--ghost:active {
|
|
256
|
+
.xv-button--ghost.xv-button--active, .xv-button--ghost:active {
|
|
257
257
|
background-color: rgba(139, 139, 139, 0.5);
|
|
258
258
|
}
|
|
259
259
|
.xv-button--ghost:disabled {
|
|
@@ -14,6 +14,8 @@ export class XvButton {
|
|
|
14
14
|
this.block = false;
|
|
15
15
|
/** Button type */
|
|
16
16
|
this.type = 'button';
|
|
17
|
+
/** Set button to active styles */
|
|
18
|
+
this.active = false;
|
|
17
19
|
this.hasLeftIcon = false;
|
|
18
20
|
this.hasRightIcon = false;
|
|
19
21
|
this.hasContent = false;
|
|
@@ -42,8 +44,9 @@ export class XvButton {
|
|
|
42
44
|
}
|
|
43
45
|
render() {
|
|
44
46
|
var _a, _b;
|
|
45
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: 'aca4f3e80723593be61fab9bf77b2bfae5b68e66' }, h("button", { key: '1f0b3abe1eb888aa927c7d2351f437c82d8a7dc7', class: {
|
|
46
48
|
'xv-button': true,
|
|
49
|
+
'xv-button--active': this.active,
|
|
47
50
|
[`xv-button--${this.variant}`]: !!this.variant,
|
|
48
51
|
[`xv-button--${this.size}`]: !!this.size,
|
|
49
52
|
'xv-button--disabled': this.disabled || this.loading,
|
|
@@ -52,7 +55,7 @@ export class XvButton {
|
|
|
52
55
|
'xv-button--icon-left': this.hasLeftIcon,
|
|
53
56
|
'xv-button--icon-right': this.hasRightIcon,
|
|
54
57
|
'xv-button--icon-only': !this.hasContent,
|
|
55
|
-
}, part: "button", title: (_a = this.el) === null || _a === void 0 ? void 0 : _a.title, value: this.value, name: this.name, onClick: this.handleClick, type: this.type, disabled: this.disabled || this.loading, "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": ((_b = this.el) === null || _b === void 0 ? void 0 : _b.ariaLabel) || 'XV button' }, this.loading && (h("xv-loader-v2", { key: '
|
|
58
|
+
}, part: "button", title: (_a = this.el) === null || _a === void 0 ? void 0 : _a.title, value: this.value, name: this.name, onClick: this.handleClick, type: this.type, disabled: this.disabled || this.loading, "aria-disabled": this.disabled ? 'true' : undefined, "aria-pressed": this.active ? 'true' : undefined, "aria-label": ((_b = this.el) === null || _b === void 0 ? void 0 : _b.ariaLabel) || 'XV button' }, this.loading && (h("xv-loader-v2", { key: 'ffa0a49ef478bc558dc3511ac90e883de63188d1', class: "xv-button__loader", size: this.size !== SIZE_VAR.XL ? this.size : SIZE_VAR.LG })), h("span", { key: '3b27a5e36072adf1d749fe1b75a2f2507d2783b9', class: "xv-button__icon xv-button__icon--left" }, h("slot", { key: 'a66d0e292864c45141b3e7c78a55e1f419bca02d', name: "icon-left", onSlotchange: this.handleSlotChangeLeft })), h("span", { key: 'bb2bb95b64a11e480cb2cb267d4db79506996495', class: "xv-button__label" }, h("slot", { key: 'e14a8b19bce7b449934a5a2096c8d8ce20bb73eb', onSlotchange: this.handleSlotChangeContent }, this.label)), h("span", { key: '003cca2d751e40ec47b4d01f91f4381ba75ce529', class: "xv-button__icon xv-button__icon--right" }, h("slot", { key: 'f379bdf670da3ea97b196b055a7eaef105e455c7', name: "icon-right", onSlotchange: this.handleSlotChangeRight })))));
|
|
56
59
|
}
|
|
57
60
|
static get is() { return "xv-button-v2"; }
|
|
58
61
|
static get encapsulation() { return "shadow"; }
|
|
@@ -251,6 +254,26 @@ export class XvButton {
|
|
|
251
254
|
"reflect": true,
|
|
252
255
|
"attribute": "type",
|
|
253
256
|
"defaultValue": "'button'"
|
|
257
|
+
},
|
|
258
|
+
"active": {
|
|
259
|
+
"type": "boolean",
|
|
260
|
+
"mutable": false,
|
|
261
|
+
"complexType": {
|
|
262
|
+
"original": "boolean",
|
|
263
|
+
"resolved": "boolean",
|
|
264
|
+
"references": {}
|
|
265
|
+
},
|
|
266
|
+
"required": false,
|
|
267
|
+
"optional": false,
|
|
268
|
+
"docs": {
|
|
269
|
+
"tags": [],
|
|
270
|
+
"text": "Set button to active styles"
|
|
271
|
+
},
|
|
272
|
+
"getter": false,
|
|
273
|
+
"setter": false,
|
|
274
|
+
"reflect": true,
|
|
275
|
+
"attribute": "active",
|
|
276
|
+
"defaultValue": "false"
|
|
254
277
|
}
|
|
255
278
|
};
|
|
256
279
|
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
.xv-container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
max-width: 1170px;
|
|
4
|
+
margin-inline: auto;
|
|
5
|
+
}
|
|
6
|
+
@media (min-width: 576px) {
|
|
7
|
+
.xv-container {
|
|
8
|
+
max-width: 540px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
@media (min-width: 768px) {
|
|
12
|
+
.xv-container {
|
|
13
|
+
max-width: 720px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
@media (min-width: 992px) {
|
|
17
|
+
.xv-container {
|
|
18
|
+
max-width: 960px;
|
|
19
|
+
padding-inline: var(--bs-gutter-x, 0.75rem);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
@media (min-width: 1200px) {
|
|
23
|
+
.xv-container {
|
|
24
|
+
max-width: 1140px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
@media (min-width: 1400px) {
|
|
28
|
+
.xv-container {
|
|
29
|
+
max-width: 1320px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.xv-tooltip[role=tooltip] {
|
|
34
|
+
position: absolute;
|
|
35
|
+
background-color: var(--background-inverse, #333333);
|
|
36
|
+
color: var(--text-on-color);
|
|
37
|
+
padding: var(--spacing-03) var(--spacing-04);
|
|
38
|
+
border-radius: 3px;
|
|
39
|
+
font-size: var(--fz-sm);
|
|
40
|
+
z-index: 999;
|
|
41
|
+
min-width: min(150px, 90vw);
|
|
42
|
+
max-width: min(400px, 90vw);
|
|
43
|
+
}
|
|
44
|
+
.xv-tooltip[role=tooltip]::after {
|
|
45
|
+
content: "";
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 0;
|
|
48
|
+
height: 0;
|
|
49
|
+
border-style: solid;
|
|
50
|
+
}
|
|
51
|
+
.xv-tooltip[role=tooltip][data-popper-placement=top]::after {
|
|
52
|
+
bottom: -5px;
|
|
53
|
+
left: 50%;
|
|
54
|
+
transform: translateX(-50%);
|
|
55
|
+
border-width: 5px 5px 0 5px;
|
|
56
|
+
border-color: var(--background-inverse, black) transparent transparent transparent;
|
|
57
|
+
}
|
|
58
|
+
.xv-tooltip[role=tooltip][data-popper-placement=top-start]::after {
|
|
59
|
+
bottom: -5px;
|
|
60
|
+
left: 12px;
|
|
61
|
+
border-width: 5px 5px 0 5px;
|
|
62
|
+
border-color: var(--background-inverse, black) transparent transparent transparent;
|
|
63
|
+
}
|
|
64
|
+
.xv-tooltip[role=tooltip][data-popper-placement=top-end]::after {
|
|
65
|
+
bottom: -5px;
|
|
66
|
+
right: 12px;
|
|
67
|
+
border-width: 5px 5px 0 5px;
|
|
68
|
+
border-color: var(--background-inverse, black) transparent transparent transparent;
|
|
69
|
+
}
|
|
70
|
+
.xv-tooltip[role=tooltip][data-popper-placement=bottom]::after {
|
|
71
|
+
top: -5px;
|
|
72
|
+
left: 50%;
|
|
73
|
+
transform: translateX(-50%);
|
|
74
|
+
border-width: 0 5px 5px 5px;
|
|
75
|
+
border-color: transparent transparent var(--background-inverse, black) transparent;
|
|
76
|
+
}
|
|
77
|
+
.xv-tooltip[role=tooltip][data-popper-placement=bottom-start]::after {
|
|
78
|
+
top: -5px;
|
|
79
|
+
left: 12px;
|
|
80
|
+
border-width: 0 5px 5px 5px;
|
|
81
|
+
border-color: transparent transparent var(--background-inverse, black) transparent;
|
|
82
|
+
}
|
|
83
|
+
.xv-tooltip[role=tooltip][data-popper-placement=bottom-end]::after {
|
|
84
|
+
top: -5px;
|
|
85
|
+
right: 12px;
|
|
86
|
+
border-width: 0 5px 5px 5px;
|
|
87
|
+
border-color: transparent transparent var(--background-inverse, black) transparent;
|
|
88
|
+
}
|
|
89
|
+
.xv-tooltip[role=tooltip][data-popper-placement=left]::after {
|
|
90
|
+
top: 50%;
|
|
91
|
+
right: -5px;
|
|
92
|
+
transform: translateY(-50%);
|
|
93
|
+
border-width: 5px 0 5px 5px;
|
|
94
|
+
border-color: transparent transparent transparent var(--background-inverse, black);
|
|
95
|
+
}
|
|
96
|
+
.xv-tooltip[role=tooltip][data-popper-placement=left-start]::after {
|
|
97
|
+
top: 12px;
|
|
98
|
+
right: -5px;
|
|
99
|
+
border-width: 5px 0 5px 5px;
|
|
100
|
+
border-color: transparent transparent transparent var(--background-inverse, black);
|
|
101
|
+
}
|
|
102
|
+
.xv-tooltip[role=tooltip][data-popper-placement=left-end]::after {
|
|
103
|
+
bottom: 12px;
|
|
104
|
+
right: -5px;
|
|
105
|
+
border-width: 5px 0 5px 5px;
|
|
106
|
+
border-color: transparent transparent transparent var(--background-inverse, black);
|
|
107
|
+
}
|
|
108
|
+
.xv-tooltip[role=tooltip][data-popper-placement=right]::after {
|
|
109
|
+
top: 50%;
|
|
110
|
+
left: -5px;
|
|
111
|
+
transform: translateY(-50%);
|
|
112
|
+
border-width: 5px 5px 5px 0;
|
|
113
|
+
border-color: transparent var(--background-inverse, black) transparent transparent;
|
|
114
|
+
}
|
|
115
|
+
.xv-tooltip[role=tooltip][data-popper-placement=right-start]::after {
|
|
116
|
+
top: 12px;
|
|
117
|
+
left: -5px;
|
|
118
|
+
border-width: 5px 5px 5px 0;
|
|
119
|
+
border-color: transparent var(--background-inverse, black) transparent transparent;
|
|
120
|
+
}
|
|
121
|
+
.xv-tooltip[role=tooltip][data-popper-placement=right-end]::after {
|
|
122
|
+
bottom: 12px;
|
|
123
|
+
left: -5px;
|
|
124
|
+
border-width: 5px 5px 5px 0;
|
|
125
|
+
border-color: transparent var(--background-inverse, black) transparent transparent;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host {
|
|
129
|
+
display: inline-flex;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host([variant=vertical]) {
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
::slotted(xv-button-v2) {
|
|
137
|
+
--xv-button-border-radius: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
::slotted(xv-button-v2:first-child) {
|
|
141
|
+
--xv-button-border-radius: 3px 0 0 3px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
::slotted(xv-button-v2:last-child) {
|
|
145
|
+
--xv-button-border-radius: 0 3px 3px 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([variant=vertical]) ::slotted(xv-button-v2:first-child) {
|
|
149
|
+
--xv-button-border-radius: 3px 3px 0 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([variant=vertical]) ::slotted(xv-button-v2:last-child) {
|
|
153
|
+
--xv-button-border-radius: 0 0 3px 3px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
::slotted(xv-button-v2:only-child) {
|
|
157
|
+
--xv-button-border-radius: 3px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
::slotted(xv-button-v2:not(:first-child)) {
|
|
161
|
+
margin-inline-start: -1px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([variant=vertical]) ::slotted(xv-button-v2:not(:first-child)) {
|
|
165
|
+
margin-block-start: -1px;
|
|
166
|
+
margin-inline-start: 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
::slotted(xv-button-v2[active]),
|
|
170
|
+
::slotted(xv-button-v2:hover) {
|
|
171
|
+
position: relative;
|
|
172
|
+
z-index: 1;
|
|
173
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
const ITEM_TAG = 'xv-button-v2';
|
|
3
|
+
/**
|
|
4
|
+
* xv-button-group-v2
|
|
5
|
+
*
|
|
6
|
+
* Groups a set of `xv-button-v2` buttons into a single horizontal or vertical
|
|
7
|
+
* unit. Use `secondary` or `tertiary` buttons inside it.
|
|
8
|
+
*
|
|
9
|
+
* The group owns only three things: the layout direction, the rounded corners
|
|
10
|
+
* (applied to the outer edges of the group via each button's
|
|
11
|
+
* `--xv-button-border-radius` variable) and the **active** selection. Everything
|
|
12
|
+
* else — `variant`, `size`, `disabled`, icons, labels — stays on each child
|
|
13
|
+
* `xv-button-v2`.
|
|
14
|
+
*
|
|
15
|
+
* Selection is single by default (radio-like: re-clicking the active button is a
|
|
16
|
+
* no-op). Set `multiple` to let each button toggle independently. The active
|
|
17
|
+
* button shows the existing `--button-{type}-active` colour.
|
|
18
|
+
*
|
|
19
|
+
* @slot - One or more `xv-button-v2` elements, each with its own `value`.
|
|
20
|
+
*/
|
|
21
|
+
export class XvButtonGroup {
|
|
22
|
+
constructor() {
|
|
23
|
+
/** Layout direction of the group. */
|
|
24
|
+
this.variant = 'horizontal';
|
|
25
|
+
/** Allow several buttons to be active at the same time (independent toggles). */
|
|
26
|
+
this.multiple = false;
|
|
27
|
+
}
|
|
28
|
+
onSelectionInputChange() {
|
|
29
|
+
this.syncActive();
|
|
30
|
+
}
|
|
31
|
+
componentDidLoad() {
|
|
32
|
+
this.syncActive();
|
|
33
|
+
}
|
|
34
|
+
handleClick(event) {
|
|
35
|
+
var _a;
|
|
36
|
+
const btn = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest(ITEM_TAG);
|
|
37
|
+
if (!btn || !this.el.contains(btn) || btn.hasAttribute('disabled'))
|
|
38
|
+
return;
|
|
39
|
+
this.toggle(this.getItemKey(btn));
|
|
40
|
+
}
|
|
41
|
+
/** Live list of child buttons, in DOM order. */
|
|
42
|
+
get items() {
|
|
43
|
+
return Array.from(this.el.querySelectorAll(ITEM_TAG));
|
|
44
|
+
}
|
|
45
|
+
getItemKey(item) {
|
|
46
|
+
const value = item.getAttribute('value');
|
|
47
|
+
return value !== null && value !== '' ? value : `${this.items.indexOf(item)}`;
|
|
48
|
+
}
|
|
49
|
+
selectedKeys() {
|
|
50
|
+
const value = this.value;
|
|
51
|
+
if (value === undefined || value === null || value === '')
|
|
52
|
+
return [];
|
|
53
|
+
if (Array.isArray(value))
|
|
54
|
+
return value.map(String);
|
|
55
|
+
// A string: split on commas in multiple mode, otherwise treat as one key.
|
|
56
|
+
return this.multiple
|
|
57
|
+
? `${value}`.split(',').map((key) => key.trim()).filter(Boolean)
|
|
58
|
+
: [`${value}`];
|
|
59
|
+
}
|
|
60
|
+
toggle(key) {
|
|
61
|
+
if (this.multiple) {
|
|
62
|
+
const current = this.selectedKeys();
|
|
63
|
+
const next = current.includes(key) ? current.filter((k) => k !== key) : [...current, key];
|
|
64
|
+
this.value = next;
|
|
65
|
+
this.activeChange.emit(next);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// Radio-like: clicking the already-active button does nothing.
|
|
69
|
+
if (`${this.value}` === key)
|
|
70
|
+
return;
|
|
71
|
+
this.value = key;
|
|
72
|
+
this.activeChange.emit(key);
|
|
73
|
+
}
|
|
74
|
+
this.syncActive();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Mirror the selection onto the children by flipping each button's `active`
|
|
78
|
+
* attribute. The button renders `aria-pressed` on its own inner `<button>`
|
|
79
|
+
* from that state (the host element has no role, so ARIA must live there).
|
|
80
|
+
*/
|
|
81
|
+
syncActive() {
|
|
82
|
+
const keys = this.selectedKeys();
|
|
83
|
+
this.items.forEach((item) => {
|
|
84
|
+
const isActive = keys.includes(this.getItemKey(item));
|
|
85
|
+
if (isActive)
|
|
86
|
+
item.setAttribute('active', '');
|
|
87
|
+
else
|
|
88
|
+
item.removeAttribute('active');
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return (h(Host, { key: '173e1e09cd6a12d8f3058395914ddeceb8c12b2c', role: "group" }, h("slot", { key: 'ed963d11b49624d4f9e7144c6a9421449bfb27c4', onSlotchange: () => this.syncActive() })));
|
|
93
|
+
}
|
|
94
|
+
static get is() { return "xv-button-group-v2"; }
|
|
95
|
+
static get encapsulation() { return "shadow"; }
|
|
96
|
+
static get originalStyleUrls() {
|
|
97
|
+
return {
|
|
98
|
+
"$": ["xv-button-group.scss"]
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
static get styleUrls() {
|
|
102
|
+
return {
|
|
103
|
+
"$": ["xv-button-group.css"]
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
static get properties() {
|
|
107
|
+
return {
|
|
108
|
+
"variant": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"mutable": false,
|
|
111
|
+
"complexType": {
|
|
112
|
+
"original": "'horizontal' | 'vertical'",
|
|
113
|
+
"resolved": "\"horizontal\" | \"vertical\"",
|
|
114
|
+
"references": {}
|
|
115
|
+
},
|
|
116
|
+
"required": false,
|
|
117
|
+
"optional": false,
|
|
118
|
+
"docs": {
|
|
119
|
+
"tags": [],
|
|
120
|
+
"text": "Layout direction of the group."
|
|
121
|
+
},
|
|
122
|
+
"getter": false,
|
|
123
|
+
"setter": false,
|
|
124
|
+
"reflect": true,
|
|
125
|
+
"attribute": "variant",
|
|
126
|
+
"defaultValue": "'horizontal'"
|
|
127
|
+
},
|
|
128
|
+
"multiple": {
|
|
129
|
+
"type": "boolean",
|
|
130
|
+
"mutable": false,
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "boolean",
|
|
133
|
+
"resolved": "boolean",
|
|
134
|
+
"references": {}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": false,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "Allow several buttons to be active at the same time (independent toggles)."
|
|
141
|
+
},
|
|
142
|
+
"getter": false,
|
|
143
|
+
"setter": false,
|
|
144
|
+
"reflect": true,
|
|
145
|
+
"attribute": "multiple",
|
|
146
|
+
"defaultValue": "false"
|
|
147
|
+
},
|
|
148
|
+
"value": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"mutable": true,
|
|
151
|
+
"complexType": {
|
|
152
|
+
"original": "string | string[]",
|
|
153
|
+
"resolved": "string | string[]",
|
|
154
|
+
"references": {}
|
|
155
|
+
},
|
|
156
|
+
"required": false,
|
|
157
|
+
"optional": true,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": "Active selection \u2014 a single value (single mode) or an array of values\n(`multiple` mode). Matched against each button's `value`, falling back to\nits zero-based index when it has none. Via an attribute in `multiple` mode,\na comma-separated string is also accepted."
|
|
161
|
+
},
|
|
162
|
+
"getter": false,
|
|
163
|
+
"setter": false,
|
|
164
|
+
"reflect": false,
|
|
165
|
+
"attribute": "value"
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
static get events() {
|
|
170
|
+
return [{
|
|
171
|
+
"method": "activeChange",
|
|
172
|
+
"name": "activeChange",
|
|
173
|
+
"bubbles": false,
|
|
174
|
+
"cancelable": true,
|
|
175
|
+
"composed": false,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": "Emitted whenever the active selection changes. Carries a `string` in single\nmode and a `string[]` in `multiple` mode. Does not bubble or cross shadow\nboundaries, so it never collides with an enclosing component's events."
|
|
179
|
+
},
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "string | string[]",
|
|
182
|
+
"resolved": "string | string[]",
|
|
183
|
+
"references": {}
|
|
184
|
+
}
|
|
185
|
+
}];
|
|
186
|
+
}
|
|
187
|
+
static get elementRef() { return "el"; }
|
|
188
|
+
static get watchers() {
|
|
189
|
+
return [{
|
|
190
|
+
"propName": "value",
|
|
191
|
+
"methodName": "onSelectionInputChange"
|
|
192
|
+
}, {
|
|
193
|
+
"propName": "multiple",
|
|
194
|
+
"methodName": "onSelectionInputChange"
|
|
195
|
+
}];
|
|
196
|
+
}
|
|
197
|
+
static get listeners() {
|
|
198
|
+
return [{
|
|
199
|
+
"name": "click",
|
|
200
|
+
"method": "handleClick",
|
|
201
|
+
"target": undefined,
|
|
202
|
+
"capture": false,
|
|
203
|
+
"passive": false
|
|
204
|
+
}];
|
|
205
|
+
}
|
|
206
|
+
}
|