@baloise/ds-core 17.0.0 → 17.1.0
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/components/bal-accordion-trigger.js +3 -1
- package/components/bal-accordion.js +1 -1
- package/components/bal-date.js +3 -1
- package/components/bal-dropdown2.js +46 -9
- package/components/bal-footer.js +10 -5
- package/components/bal-segment.js +15 -2
- package/components/bal-tab-item.js +8 -2
- package/components/bal-tabs2.js +18 -12
- package/components/bal-textarea.js +3 -1
- package/components/index.js +1 -1
- package/components/option.js +1 -0
- package/components/tokens.esm.js +1 -1
- package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
- package/dist/baloise-design-system/index.esm.js +1 -1
- package/dist/baloise-design-system/{p-b4ecd87960.system.entry.js → p-0f995439fa.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-4bbe4ba6ba.entry.js → p-1ecf7315b9.entry.js} +1 -1
- package/dist/baloise-design-system/p-278aed95.system.js +1 -0
- package/dist/baloise-design-system/{p-d9bb74c913.system.entry.js → p-2a81e1e84d.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e8f93d80ca.system.entry.js → p-2cc4cfdddd.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-34c50dfa1e.entry.js +1 -0
- package/dist/baloise-design-system/p-353ce7cb84.system.entry.js +1 -0
- package/dist/baloise-design-system/p-43ab08c69d.entry.js +1 -0
- package/dist/baloise-design-system/{p-fa363ba3f9.system.entry.js → p-461076e3ee.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f3ef269852.entry.js → p-4d9e77f3e2.entry.js} +1 -1
- package/dist/baloise-design-system/p-4de229fddc.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-faf5c89145.system.entry.js → p-4ef4b1be9d.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-e1b2f86b.system.js → p-4f6a69cd.system.js} +1 -1
- package/dist/baloise-design-system/p-4ff5f10802.system.entry.js +1 -0
- package/dist/baloise-design-system/p-50b2a9c6.js +1 -1
- package/dist/baloise-design-system/{p-3c504ddf38.system.entry.js → p-5434009bc0.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-562c360455.entry.js +1 -0
- package/dist/baloise-design-system/{p-9b4da619.js → p-5ed239cc.js} +1 -1
- package/dist/baloise-design-system/{p-10151a65a4.entry.js → p-6f87a55001.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0ede0fa9b2.entry.js → p-743b475584.entry.js} +1 -1
- package/dist/baloise-design-system/{p-10985d5e.system.js → p-79cd15b8.system.js} +1 -1
- package/dist/baloise-design-system/{p-365fc134.system.js → p-852288a3.system.js} +1 -1
- package/dist/baloise-design-system/{p-1e688639.system.js → p-8d2e3bc3.system.js} +1 -1
- package/dist/baloise-design-system/{p-8d370d87cb.entry.js → p-9575320fc7.entry.js} +1 -1
- package/dist/baloise-design-system/{p-61c48963c7.system.entry.js → p-95b538ca71.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-9e103abfe5.entry.js +1 -0
- package/dist/baloise-design-system/{p-3114a84410.entry.js → p-a4adde8f06.entry.js} +1 -1
- package/dist/baloise-design-system/{p-bf1b5db620.system.entry.js → p-a4b4b9c642.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0215ccdca9.system.entry.js → p-a9f81bd538.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-aa0bfdce7b.system.entry.js +1 -0
- package/dist/baloise-design-system/p-af747e55e6.entry.js +1 -0
- package/dist/baloise-design-system/p-b57c473d.system.js +1 -1
- package/dist/baloise-design-system/p-b666673380.entry.js +1 -0
- package/dist/baloise-design-system/{p-c61080a6.js → p-bbdc9f6e.js} +1 -1
- package/dist/baloise-design-system/p-cc4dc17721.system.entry.js +1 -0
- package/dist/baloise-design-system/p-ce3173af38.system.entry.js +1 -0
- package/dist/baloise-design-system/p-d2f9ed2b.system.js +1 -1
- package/dist/baloise-design-system/{p-cfe42ac458.system.entry.js → p-d3e9be6607.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-14eef425da.system.entry.js → p-dc40f667ce.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-85ed9bd051.entry.js → p-dc70466385.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c7efc6d470.entry.js → p-de93a466cd.entry.js} +1 -1
- package/dist/baloise-design-system/{p-3149162e9e.entry.js → p-e66e2555f7.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c8caa835.js → p-f23ce678.js} +1 -1
- package/dist/baloise-design-system/{p-ec286609dd.entry.js → p-faa07e101c.entry.js} +1 -1
- package/dist/baloise-design-system/{p-6116192a.js → p-fb82a1e7.js} +1 -1
- package/dist/baloise-design-system/{p-2f6c32ca97.entry.js → p-ff89ba221b.entry.js} +1 -1
- package/dist/cjs/bal-accordion_4.cjs.entry.js +3 -2
- package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
- package/dist/cjs/bal-date.cjs.entry.js +2 -1
- package/dist/cjs/bal-dropdown.cjs.entry.js +43 -10
- package/dist/cjs/bal-footer.cjs.entry.js +9 -5
- package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-logo.cjs.entry.js +3 -3
- package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
- package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
- package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
- package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
- package/dist/cjs/bal-segment_2.cjs.entry.js +18 -5
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-steps.cjs.entry.js +3 -3
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +26 -17
- package/dist/cjs/bal-textarea.cjs.entry.js +2 -1
- package/dist/cjs/baloise-design-system.cjs.js +1 -1
- package/dist/cjs/{breakpoints.decorator-967c2fd2.js → breakpoints.decorator-cc7b6527.js} +1 -1
- package/dist/cjs/{breakpoints.subject-679bdc55.js → breakpoints.subject-cfe518b3.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/initialize-e7570bc6.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{option-4034ca7d.js → option-85af0921.js} +1 -0
- package/dist/cjs/{tokens.esm-e4edac35.js → tokens.esm-c5484151.js} +1 -1
- package/dist/cjs/{window-resize.decorator-bb2ea6d8.js → window-resize.decorator-137a02c4.js} +1 -1
- package/dist/collection/components/bal-accordion/bal-accordion-trigger/bal-accordion-trigger.js +20 -1
- package/dist/collection/components/bal-accordion/bal-accordion.js +1 -1
- package/dist/collection/components/bal-date/bal-date.js +25 -1
- package/dist/collection/components/bal-dropdown/bal-dropdown.css +1 -1
- package/dist/collection/components/bal-dropdown/bal-dropdown.js +88 -1
- package/dist/collection/components/bal-footer/bal-footer.js +31 -5
- package/dist/collection/components/bal-segment/bal-segment.js +15 -2
- package/dist/collection/components/bal-tabs/bal-tab-item/bal-tab-item.js +42 -2
- package/dist/collection/components/bal-tabs/bal-tabs.css +1 -1
- package/dist/collection/components/bal-tabs/bal-tabs.js +21 -2
- package/dist/collection/components/bal-tabs/components/tab-button.js +2 -2
- package/dist/collection/components/bal-tabs/components/tab-icon.js +1 -1
- package/dist/collection/components/bal-tabs/components/tab-label.js +1 -1
- package/dist/collection/components/bal-tabs/components/tab-nav.js +6 -3
- package/dist/collection/components/bal-textarea/bal-textarea.js +25 -1
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/collection/utils/dropdown/events.js +9 -1
- package/dist/collection/utils/dropdown/icon.js +6 -3
- package/dist/collection/utils/dropdown/option.js +1 -0
- package/dist/collection/utils/dropdown/value.js +2 -2
- package/dist/esm/bal-accordion_4.entry.js +3 -2
- package/dist/esm/bal-carousel_2.entry.js +3 -3
- package/dist/esm/bal-date.entry.js +2 -1
- package/dist/esm/bal-dropdown.entry.js +43 -10
- package/dist/esm/bal-footer.entry.js +9 -5
- package/dist/esm/bal-hint_5.entry.js +3 -3
- package/dist/esm/bal-list_8.entry.js +3 -3
- package/dist/esm/bal-logo.entry.js +3 -3
- package/dist/esm/bal-nav_8.entry.js +3 -3
- package/dist/esm/bal-navbar_5.entry.js +3 -3
- package/dist/esm/bal-pagination.entry.js +3 -3
- package/dist/esm/bal-progress-bar.entry.js +4 -4
- package/dist/esm/bal-segment_2.entry.js +19 -6
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +3 -3
- package/dist/esm/bal-tab-item_2.entry.js +26 -17
- package/dist/esm/bal-textarea.entry.js +2 -1
- package/dist/esm/baloise-design-system.js +1 -1
- package/dist/esm/{breakpoints.decorator-9981606e.js → breakpoints.decorator-2e4214b2.js} +1 -1
- package/dist/esm/{breakpoints.subject-ae98d0fa.js → breakpoints.subject-0499ff54.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/initialize-f93872c4.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{option-01553dab.js → option-367a5341.js} +1 -0
- package/dist/esm/{tokens.esm-ed9fb455.js → tokens.esm-e90e564a.js} +1 -1
- package/dist/esm/{window-resize.decorator-a88002f7.js → window-resize.decorator-be46c01c.js} +1 -1
- package/dist/esm-es5/bal-accordion_4.entry.js +1 -1
- package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
- package/dist/esm-es5/bal-date.entry.js +1 -1
- package/dist/esm-es5/bal-dropdown.entry.js +1 -1
- package/dist/esm-es5/bal-footer.entry.js +1 -1
- package/dist/esm-es5/bal-hint_5.entry.js +1 -1
- package/dist/esm-es5/bal-list_8.entry.js +1 -1
- package/dist/esm-es5/bal-logo.entry.js +1 -1
- package/dist/esm-es5/bal-nav_8.entry.js +1 -1
- package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-segment_2.entry.js +1 -1
- package/dist/esm-es5/bal-shape.entry.js +1 -1
- package/dist/esm-es5/bal-steps.entry.js +1 -1
- package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
- package/dist/esm-es5/bal-textarea.entry.js +1 -1
- package/dist/esm-es5/baloise-design-system.js +1 -1
- package/dist/esm-es5/breakpoints.decorator-2e4214b2.js +1 -0
- package/dist/esm-es5/{breakpoints.subject-ae98d0fa.js → breakpoints.subject-0499ff54.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-f93872c4.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{option-01553dab.js → option-367a5341.js} +1 -1
- package/dist/esm-es5/{window-resize.decorator-a88002f7.js → window-resize.decorator-be46c01c.js} +1 -1
- package/dist/html.html-data.json +374 -0
- package/dist/types/components/bal-accordion/bal-accordion-trigger/bal-accordion-trigger.d.ts +4 -0
- package/dist/types/components/bal-date/bal-date.d.ts +4 -0
- package/dist/types/components/bal-dropdown/bal-dropdown.d.ts +13 -0
- package/dist/types/components/bal-dropdown/bal-dropdown.interfaces.d.ts +4 -1
- package/dist/types/components/bal-footer/bal-footer.d.ts +4 -0
- package/dist/types/components/bal-segment/bal-segment.d.ts +1 -0
- package/dist/types/components/bal-tabs/bal-tab-item/bal-tab-item.d.ts +10 -0
- package/dist/types/components/bal-tabs/bal-tab.type.d.ts +2 -0
- package/dist/types/components/bal-tabs/bal-tabs.d.ts +4 -0
- package/dist/types/components/bal-tabs/components/tab-button.d.ts +2 -0
- package/dist/types/components/bal-tabs/components/tab-nav.d.ts +1 -0
- package/dist/types/components/bal-textarea/bal-textarea.d.ts +4 -0
- package/dist/types/components.d.ts +82 -0
- package/dist/types/utils/dropdown/component.d.ts +1 -0
- package/dist/types/utils/dropdown/events.d.ts +2 -0
- package/dist/types/utils/dropdown/icon.d.ts +2 -0
- package/dist/types/utils/dropdown/value.d.ts +1 -0
- package/package.json +7 -7
- package/dist/baloise-design-system/p-5353ba1263.entry.js +0 -1
- package/dist/baloise-design-system/p-69f82b9b22.entry.js +0 -1
- package/dist/baloise-design-system/p-6cadcbe4bb.entry.js +0 -1
- package/dist/baloise-design-system/p-7752fa10ea.system.entry.js +0 -1
- package/dist/baloise-design-system/p-7f9fe862b6.system.entry.js +0 -1
- package/dist/baloise-design-system/p-93e2638280.system.entry.js +0 -1
- package/dist/baloise-design-system/p-98f7403c7f.entry.js +0 -1
- package/dist/baloise-design-system/p-a7d15ec66b.entry.js +0 -1
- package/dist/baloise-design-system/p-af5e974f4c.system.entry.js +0 -1
- package/dist/baloise-design-system/p-d0d162c677.system.entry.js +0 -1
- package/dist/baloise-design-system/p-dbc0b7c370.entry.js +0 -1
- package/dist/baloise-design-system/p-de36076c.system.js +0 -1
- package/dist/baloise-design-system/p-fd118a1752.system.entry.js +0 -1
- package/dist/esm-es5/breakpoints.decorator-9981606e.js +0 -1
- /package/dist/baloise-design-system/{p-fc542e26.js → p-5d4c2ac9.js} +0 -0
- /package/dist/baloise-design-system/{p-923b2e35.system.js → p-7c9bf66f.system.js} +0 -0
- /package/dist/esm-es5/{tokens.esm-ed9fb455.js → tokens.esm-e90e564a.js} +0 -0
|
@@ -31,6 +31,7 @@ const AccordionTrigger = /*@__PURE__*/ proxyCustomElement(class AccordionTrigger
|
|
|
31
31
|
};
|
|
32
32
|
this.parentAccordionId = undefined;
|
|
33
33
|
this.button = false;
|
|
34
|
+
this.expanded = true;
|
|
34
35
|
this.openLabel = '';
|
|
35
36
|
this.openIcon = 'caret-down';
|
|
36
37
|
this.closeLabel = '';
|
|
@@ -90,12 +91,13 @@ const AccordionTrigger = /*@__PURE__*/ proxyCustomElement(class AccordionTrigger
|
|
|
90
91
|
tabindex: 0,
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
|
-
return (h(Host, { key: '
|
|
94
|
+
return (h(Host, { key: '891c25716cc93bd97ca9b25fcb512bb1915e8f5d', id: id, class: Object.assign({}, block.class()) }, this.button ? (h("bal-button", { id: `${id}-button`, "aria-controls": `${this.parentAccordionId}-details-content`, part: buttonPart, "data-testid": "bal-accordion-trigger", expanded: this.expanded, icon: icon, iconTurn: turn, color: this.color, size: this.size, onClick: this.onClick }, label)) : (h("button", Object.assign({ class: Object.assign(Object.assign({}, block.element('button').class()), { 'bal-focused': parentSummaryEl && !parentSummaryEl.trigger }), id: `${id}-button`, "aria-controls": `${this.parentAccordionId}-details-content`, "aria-label": "accordion trigger", part: buttonPart, "data-testid": "bal-accordion-trigger", onClick: this.onClick }, triggerAttributes), h("bal-icon", { turn: turn, name: icon })))));
|
|
94
95
|
}
|
|
95
96
|
get el() { return this; }
|
|
96
97
|
static get style() { return BalAccordionTriggerStyle0; }
|
|
97
98
|
}, [0, "bal-accordion-trigger", {
|
|
98
99
|
"button": [4],
|
|
100
|
+
"expanded": [4],
|
|
99
101
|
"openLabel": [1, "open-label"],
|
|
100
102
|
"openIcon": [1, "open-icon"],
|
|
101
103
|
"closeLabel": [1, "close-label"],
|
|
@@ -78,11 +78,11 @@ const Accordion = /*@__PURE__*/ proxyCustomElement(class Accordion extends HTMLE
|
|
|
78
78
|
if (this.shouldAnimate()) {
|
|
79
79
|
raf(() => {
|
|
80
80
|
this.setState(8 /* AccordionState.Expanding */);
|
|
81
|
+
this.balWillAnimate.emit(this.active);
|
|
81
82
|
this.currentRaf = raf(async () => {
|
|
82
83
|
const contentHeight = detailsWrapperElement.offsetHeight;
|
|
83
84
|
const waitForTransition = transitionEndAsync(detailsElement, 300);
|
|
84
85
|
detailsElement.style.setProperty('max-height', `${contentHeight}px`);
|
|
85
|
-
this.balWillAnimate.emit(this.active);
|
|
86
86
|
await waitForTransition;
|
|
87
87
|
this.setState(4 /* AccordionState.Expanded */);
|
|
88
88
|
detailsElement.style.removeProperty('max-height');
|
package/components/bal-date.js
CHANGED
|
@@ -108,6 +108,7 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
108
108
|
this.placeholder = undefined;
|
|
109
109
|
this.triggerIcon = false;
|
|
110
110
|
this.closeOnSelect = true;
|
|
111
|
+
this.autocomplete = 'off';
|
|
111
112
|
this.value = undefined;
|
|
112
113
|
this.min = undefined;
|
|
113
114
|
this.max = undefined;
|
|
@@ -291,7 +292,7 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
291
292
|
const block = BEM.block('date');
|
|
292
293
|
const blockIcon = block.element('icon');
|
|
293
294
|
const blockPopup = block.element('popup');
|
|
294
|
-
return (h(Host, { key: '
|
|
295
|
+
return (h(Host, { key: '71ecc523323aea5b610663af71761730cafdf72d', id: this.inputId, class: Object.assign({}, block.class()) }, h("bal-input-group", { key: 'fac9940b61f22766e728f2025491f1d743b65a04', invalid: this.invalid, readonly: this.readonly, disabled: this.disabled, ref: el => (this.referenceEl = el) }, h("bal-input-date", Object.assign({ key: '9ff8ef04e188c3492419029967aedbb47f6cd80d', name: this.name, required: this.required, placeholder: this.placeholder, value: this.value, min: this.min, max: this.max, invalid: this.invalid, readonly: this.readonly, disabled: this.disabled, allowInvalidValue: this.allowInvalidValue, autocomplete: this.autocomplete, onClick: this.onInputClick, onBalInput: this.onInputInput, onBalChange: this.onInputChange, onBalFocus: this.onInputFocus, onBalBlur: this.onInputBlur, onBalKeyPress: this.onKeyPress, ref: el => (this.inputEl = el) }, this.inheritedAttributes)), !this.freeSolo ? (h("bal-icon", { name: "date", role: "button", tabindex: -1, class: Object.assign(Object.assign({}, blockIcon.class()), blockIcon.modifier('clickable').class(!this.disabled && !this.readonly)), "is-right": true, color: this.disabled || this.readonly ? 'grey' : this.invalid ? 'danger' : 'primary', onClick: this.onIconClick, "aria-label": i18nBalDate[this.language].toggleDatepicker, "aria-haspopup": "true", "aria-expanded": this.isExpanded ? 'true' : 'false' })) : ('')), h("div", { key: 'a693f4ce01308178268a00e31ef08a052d1972b2', role: "dialog", class: Object.assign(Object.assign({}, blockPopup.class()), blockPopup.modifier('visible').class(this.isExpanded)), ref: el => (this.floatingEl = el), "aria-hidden": `${this.isExpanded !== true}`, "aria-presented": `${this.isExpanded === true}` }, h("bal-date-calendar", { key: '8ac00879f736c54cb7662cd9811c44cdc80859ff', value: this.calendarValue, min: this.min, max: this.max, minYearProp: this.minYearProp, maxYearProp: this.maxYearProp, defaultDate: this.defaultDate, allowedDates: this.allowedDates, onBalChange: this.onCalendarChange }))));
|
|
295
296
|
}
|
|
296
297
|
get el() { return this; }
|
|
297
298
|
static get watchers() { return {
|
|
@@ -309,6 +310,7 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
309
310
|
"placeholder": [1],
|
|
310
311
|
"triggerIcon": [4, "trigger-icon"],
|
|
311
312
|
"closeOnSelect": [4, "close-on-select"],
|
|
313
|
+
"autocomplete": [1],
|
|
312
314
|
"value": [1025],
|
|
313
315
|
"min": [1025],
|
|
314
316
|
"max": [1025],
|
|
@@ -9,6 +9,7 @@ import { o as rIC, b as waitAfterFramePaint, k as addEventListener, r as removeE
|
|
|
9
9
|
import { b as balBrowser } from './browser.js';
|
|
10
10
|
import { a as areArraysEqual } from './array.js';
|
|
11
11
|
import { l as lodash_isnil } from './index3.js';
|
|
12
|
+
import { F as FOCUS_KEYS } from './focus-visible.js';
|
|
12
13
|
import { b as balFloatingUi } from './floating-ui.js';
|
|
13
14
|
import { D as DropdownOptionUtil } from './option.js';
|
|
14
15
|
import { b as isArrowDownKey, c as isArrowUpKey, i as isEnterKey, d as isEscapeKey, a as isSpaceKey } from './keyboard.helpers.js';
|
|
@@ -107,6 +108,14 @@ const i18nBalDropdown = {
|
|
|
107
108
|
};
|
|
108
109
|
|
|
109
110
|
class DropdownEventsUtil {
|
|
111
|
+
constructor() {
|
|
112
|
+
this.handlePointerDown = () => {
|
|
113
|
+
this.component.isKeyboardMode = false;
|
|
114
|
+
};
|
|
115
|
+
this.handleKeydown = (ev) => {
|
|
116
|
+
this.component.isKeyboardMode = FOCUS_KEYS.includes(ev.key);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
110
119
|
connectedCallback(component) {
|
|
111
120
|
this.component = component;
|
|
112
121
|
}
|
|
@@ -140,7 +149,6 @@ class DropdownEventsUtil {
|
|
|
140
149
|
this.component.popupUtil.toggleList();
|
|
141
150
|
}
|
|
142
151
|
}
|
|
143
|
-
// @Listen('click', { target: 'document' })
|
|
144
152
|
handleOutsideClick(ev) {
|
|
145
153
|
var _a;
|
|
146
154
|
if (this.component.isExpanded) {
|
|
@@ -208,17 +216,20 @@ const DropdownNativeSelect = ({ name, httpFormSubmit, multiple, required, disabl
|
|
|
208
216
|
return httpFormSubmit ? (h("select", { class: Object.assign({}, block.element('root').element('select').class()), "aria-hidden": "true", name: name, multiple: multiple, required: required, disabled: disabled, tabindex: -1, ref: refSelectEl }, rawValue.map((value) => (h("option", { key: value, value: value, selected: true }, value))))) : ('');
|
|
209
217
|
};
|
|
210
218
|
|
|
211
|
-
const DropdownIcon = ({ icon, language, loading, clearable, invalid, filled, expanded, disabled, }) => {
|
|
219
|
+
const DropdownIcon = ({ size, theme, icon, language, loading, clearable, invalid, filled, expanded, disabled, }) => {
|
|
212
220
|
const block = BEM.block('dropdown');
|
|
213
221
|
if (loading) {
|
|
214
222
|
return h("bal-spinner", { class: Object.assign({}, block.element('rear').class()), small: true, variation: "circle" });
|
|
215
223
|
}
|
|
216
224
|
else if (clearable && filled && !disabled) {
|
|
217
|
-
return (h("button", { title: i18nBalDropdown[language].clearable, type: 'button', class: Object.assign(Object.assign(Object.assign({}, block.element('rear').class()), block.element('clear').class()), block.element('clear').modifier('invalid').class(invalid))
|
|
218
|
-
|
|
225
|
+
return (h("button", { title: i18nBalDropdown[language].clearable, type: 'button', tabIndex: -1, class: Object.assign(Object.assign(Object.assign(Object.assign({}, block.element('rear').class()), block.element('clear').class()), block.element('clear').modifier('invalid').class(invalid)), block
|
|
226
|
+
.element('clear')
|
|
227
|
+
.modifier('theme-purple')
|
|
228
|
+
.class(theme === 'purple')) },
|
|
229
|
+
h("bal-icon", { class: Object.assign({}, block.element('rear').class()), name: theme === 'purple' ? 'close' : 'close-circle', size: size, color: theme === 'purple' ? 'primary' : 'grey' })));
|
|
219
230
|
}
|
|
220
231
|
else {
|
|
221
|
-
return (h("bal-icon", { class: Object.assign({}, block.element('rear').class()), name: icon, turn: expanded, color: disabled ? 'grey' : invalid ? 'danger' : 'primary' }));
|
|
232
|
+
return (h("bal-icon", { class: Object.assign({}, block.element('rear').class()), name: icon, size: size, turn: expanded, color: disabled ? 'grey' : invalid ? 'danger' : !filled && theme === 'purple' ? 'primary-light' : 'primary' }));
|
|
222
233
|
}
|
|
223
234
|
};
|
|
224
235
|
|
|
@@ -364,14 +375,14 @@ class DropdownValueUtil {
|
|
|
364
375
|
}
|
|
365
376
|
}
|
|
366
377
|
}
|
|
367
|
-
const DropdownValue = ({ filled, chips, placeholder, choices, invalid, disabled, readonly, onRemoveChip, }) => {
|
|
378
|
+
const DropdownValue = ({ inlineLabel, filled, chips, placeholder, choices, invalid, disabled, readonly, onRemoveChip, }) => {
|
|
368
379
|
const block = BEM.block('dropdown');
|
|
369
380
|
if (filled) {
|
|
370
381
|
if (chips) {
|
|
371
382
|
return (h("div", { class: Object.assign({}, block.element('root').element('content').element('chips').class()) }, choices.map(option => (h("bal-tag", { key: option.value, "data-test": "bal-dropdown-chip", size: "small", invalid: invalid, disabled: disabled || readonly, closable: !(disabled || readonly), onBalCloseClick: () => onRemoveChip(option) }, option.label)))));
|
|
372
383
|
}
|
|
373
384
|
else {
|
|
374
|
-
return choices.map(option => option.label).join(', ');
|
|
385
|
+
return (inlineLabel && `${inlineLabel}: `) + choices.map(option => option.label).join(', ');
|
|
375
386
|
}
|
|
376
387
|
}
|
|
377
388
|
else {
|
|
@@ -389,7 +400,7 @@ const DropdownInput = ({ name, inputId, httpFormSubmit, ariaForm, rawValue, auto
|
|
|
389
400
|
h(Input, null)));
|
|
390
401
|
};
|
|
391
402
|
|
|
392
|
-
const balDropdownCss = ":root{--bal-dropdown-control-background:var(--bal-color-white);--bal-dropdown-control-background-hover:var(--bal-form-field-control-background-hover);--bal-dropdown-control-background-invalid:var(--bal-form-field-control-danger-background);--bal-dropdown-control-background-disabled:var(--bal-form-field-control-disabled-background);--bal-dropdown-control-input-background:var(--bal-color-grey-1);--bal-dropdown-control-native-input-background:transparent;--bal-dropdown-control-native-input-background-hover:transparent;--bal-dropdown-control-input-inverted-footer-background:transparent;--bal-dropdown-control-input-inverted-footer-background-hover:transparent;--bal-dropdown-control-input-multiple-background:transparent;--bal-dropdown-control-input-multiple-background-read-only-selection:transparent;--bal-dropdown-control-input-option-background:transparent;--bal-dropdown-control-input-option-background-selected:var(--bal-color-primary-1);--bal-dropdown-control-input-option-background-focused:var(--bal-color-grey-2);--bal-dropdown-control-input-option-background-hover:var(--bal-color-grey-2);--bal-dropdown-control-border-radius:var(--bal-form-field-control-radius);--bal-dropdown-popover-border-color:var(--bal-color-grey-2);--bal-dropdown-control-border-color:var(--bal-form-field-control-border-color);--bal-dropdown-control-border-color-focused:var(--bal-color-primary);--bal-dropdown-control-border-color-hover:var(--bal-form-field-control-border-color-hover);--bal-dropdown-control-border-color-invalid:var(--bal-form-field-control-danger-border-color);--bal-dropdown-control-border-color-disabled:var(--bal-form-field-control-disabled-border-color);--bal-dropdown-control-border-color-focus-within:var(--bal-color-primary);--bal-dropdown-option-border-top-color:var(--bal-color-grey-2);--bal-dropdown-popover-empty-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color-focused:var(--bal-color-primary);--bal-dropdown-input-text-color-disabled:var(--bal-form-field-label-disabled-color);--bal-dropdown-control-inverted-footer-native-input-text-color:var(--bal-color-text-white);--bal-dropdown-option-content-label-text-color:var(--bal-form-field-control-color)}.bal-dropdown{display:block;position:relative;-ms-flex:1;flex:1;width:100%}.bal-dropdown__root{border-width:.125rem;border-style:solid;border-color:var(--bal-dropdown-control-border-color);border-radius:var(--bal-dropdown-control-border-radius);background:var(--bal-dropdown-control-background);font-size:var(--bal-weight-regular);font-family:var(--bal-font-family-text);color:var(--bal-dropdown-control-text-color);outline:none;-webkit-box-shadow:var(--bal-shadow-none);box-shadow:var(--bal-shadow-none);padding-right:1rem;height:auto;min-height:3rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:-ms-flexbox;display:flex;width:100%;text-align:left;gap:.5rem;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.bal-dropdown__root--autofill{background:#faffbd !important;background:light-dark(rgb(232, 240, 254), rgba(70, 90, 126, 0.4)) !important}.bal-dropdown__root>span{-ms-flex:1;flex:1;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bal-dropdown__root--focused{border-color:var(--bal-dropdown-control-border-color-focused)}.bal-dropdown__root--invalid{border-color:var(--bal-dropdown-control-border-color-invalid);background:var(--bal-dropdown-control-background-invalid)}.bal-dropdown__root--disabled{border-color:var(--bal-dropdown-control-border-color-disabled);background:var(--bal-dropdown-control-background-disabled)}.bal-dropdown__root__content--placeholder{color:var(--bal-form-field-control-placeholder-color)}.bal-dropdown__root__content--disabled{color:var(--bal-dropdown-input-text-color-disabled)}.bal-dropdown__root__content__chips{--bal-tag-size-small-font-size:var(--bal-text-size-normal);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--bal-space-xx-small);padding-top:var(--bal-space-x-small);padding-bottom:var(--bal-space-x-small)}.bal-dropdown__root__content__chips>bal-tag{z-index:1}.bal-dropdown__root__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:rgba(0,0,0,0);position:absolute;right:var(--bal-border-width-normal);left:var(--bal-border-width-normal);top:var(--bal-border-width-normal);bottom:var(--bal-border-width-normal);opacity:0;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));cursor:pointer}.bal-dropdown__root__input:disabled{cursor:default}.bal-dropdown__root__input:-webkit-autofill{opacity:1}.bal-dropdown__root__input:autofill{opacity:1}.bal-dropdown__root__input:-internal-autofill-selected{opacity:0}.bal-dropdown__root__select{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-dropdown__root--autofill .bal-dropdown__root__input{opacity:0}.bal-dropdown__list{display:block;visibility:hidden;opacity:0;min-width:100%;width:100%;position:absolute;top:0;left:0;will-change:left,top,opacity;background:var(--bal-color-white);border-radius:var(--bal-radius-normal);-webkit-box-shadow:var(--bal-shadow-normal);box-shadow:var(--bal-shadow-normal);z-index:var(--bal-z-index-popup)}.bal-dropdown__list--expanded{visibility:visible;opacity:1}.bal-dropdown__native{bottom:0;left:0;position:absolute;opacity:0;pointer-events:none;width:100%}.bal-dropdown__clear{background:rgba(0,0,0,0);border:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}.bal-dropdown__rear{z-index:1}";
|
|
403
|
+
const balDropdownCss = ":root{--bal-dropdown-control-background:var(--bal-color-white);--bal-dropdown-control-background-hover:var(--bal-form-field-control-background-hover);--bal-dropdown-control-background-invalid:var(--bal-form-field-control-danger-background);--bal-dropdown-control-background-disabled:var(--bal-form-field-control-disabled-background);--bal-dropdown-control-input-background:var(--bal-color-grey-1);--bal-dropdown-control-native-input-background:transparent;--bal-dropdown-control-native-input-background-hover:transparent;--bal-dropdown-control-input-inverted-footer-background:transparent;--bal-dropdown-control-input-inverted-footer-background-hover:transparent;--bal-dropdown-control-input-multiple-background:transparent;--bal-dropdown-control-input-multiple-background-read-only-selection:transparent;--bal-dropdown-control-input-option-background:transparent;--bal-dropdown-control-input-option-background-selected:var(--bal-color-primary-1);--bal-dropdown-control-input-option-background-focused:var(--bal-color-grey-2);--bal-dropdown-control-input-option-background-hover:var(--bal-color-grey-2);--bal-dropdown-control-border-radius:var(--bal-form-field-control-radius);--bal-dropdown-popover-border-color:var(--bal-color-grey-2);--bal-dropdown-control-border-color:var(--bal-form-field-control-border-color);--bal-dropdown-control-border-color-focused:var(--bal-color-primary);--bal-dropdown-control-border-color-hover:var(--bal-form-field-control-border-color-hover);--bal-dropdown-control-border-color-invalid:var(--bal-form-field-control-danger-border-color);--bal-dropdown-control-border-color-disabled:var(--bal-form-field-control-disabled-border-color);--bal-dropdown-control-border-color-focus-within:var(--bal-color-primary);--bal-dropdown-option-border-top-color:var(--bal-color-grey-2);--bal-dropdown-popover-empty-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color:var(--bal-form-field-control-color);--bal-dropdown-control-text-color-focused:var(--bal-color-primary);--bal-dropdown-input-text-color-disabled:var(--bal-form-field-label-disabled-color);--bal-dropdown-control-inverted-footer-native-input-text-color:var(--bal-color-text-white);--bal-dropdown-option-content-label-text-color:var(--bal-form-field-control-color)}.bal-dropdown{display:block;position:relative;-ms-flex:1;flex:1;width:100%}.bal-dropdown__root{border-width:.125rem;border-style:solid;border-color:var(--bal-dropdown-control-border-color);border-radius:var(--bal-dropdown-control-border-radius);background:var(--bal-dropdown-control-background);font-weight:var(--bal-font-weight-regular);font-size:var(--bal-text-size-normal);font-family:var(--bal-font-family-text);color:var(--bal-dropdown-control-text-color);outline:none;-webkit-box-shadow:var(--bal-shadow-none);box-shadow:var(--bal-shadow-none);padding-right:1rem;height:auto;min-height:3rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:-ms-flexbox;display:flex;width:100%;text-align:left;gap:.5rem;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.bal-dropdown__root--autofill{background:#faffbd !important;background:light-dark(rgb(232, 240, 254), rgba(70, 90, 126, 0.4)) !important}.bal-dropdown__root>span{-ms-flex:1;flex:1;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bal-dropdown__root--focused{border-color:var(--bal-dropdown-control-border-color-focused)}.bal-dropdown__root--invalid{border-color:var(--bal-dropdown-control-border-color-invalid);background:var(--bal-dropdown-control-background-invalid)}.bal-dropdown__root--disabled{border-color:var(--bal-dropdown-control-border-color-disabled);background:var(--bal-dropdown-control-background-disabled)}.bal-dropdown__root__content--placeholder{color:var(--bal-form-field-control-placeholder-color)}.bal-dropdown__root__content--disabled{color:var(--bal-dropdown-input-text-color-disabled)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root:not(.bal-dropdown__root--disabled):not(.bal-dropdown__root--invalid):not(.bal-dropdown__root--theme-purple):not(.bal-dropdown__root--theme-purple-expanded):hover{background:var(--bal-dropdown-control-background-hover)}}.bal-dropdown__root__content__chips{--bal-tag-size-small-font-size:var(--bal-text-size-normal);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--bal-space-xx-small);padding-top:var(--bal-space-x-small);padding-bottom:var(--bal-space-x-small)}.bal-dropdown__root__content__chips>bal-tag{z-index:1}.bal-dropdown__root__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:rgba(0,0,0,0);position:absolute;right:var(--bal-border-width-normal);left:var(--bal-border-width-normal);top:var(--bal-border-width-normal);bottom:var(--bal-border-width-normal);opacity:0;padding-left:calc(.75em - var(--bal-border-width-normal));padding-right:calc(.75em - var(--bal-border-width-normal));cursor:pointer}.bal-dropdown__root__input:disabled{cursor:default}.bal-dropdown__root__input:-webkit-autofill{opacity:1}.bal-dropdown__root__input:autofill{opacity:1}.bal-dropdown__root__input:-internal-autofill-selected{opacity:0}.bal-dropdown__root__select{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-dropdown__root--autofill .bal-dropdown__root__input{opacity:0}.bal-dropdown__list{display:block;visibility:hidden;opacity:0;min-width:100%;width:100%;position:absolute;top:0;left:0;will-change:left,top,opacity;background:var(--bal-color-white);border-radius:var(--bal-radius-normal);-webkit-box-shadow:var(--bal-shadow-normal);box-shadow:var(--bal-shadow-normal);z-index:var(--bal-z-index-popup)}.bal-dropdown__list--expanded{visibility:visible;opacity:1}.bal-dropdown__native{bottom:0;left:0;position:absolute;opacity:0;pointer-events:none;width:100%}.bal-dropdown__clear{background:rgba(0,0,0,0);border:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:\"\";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}.bal-dropdown__rear{z-index:1}.bal-dropdown__root--size-small{min-height:2rem}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-background-grey-light)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):hover{background:var(--bal-color-purple-1)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):active{background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):active .bal-icon__inner g,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):active .bal-icon__inner path,.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded){border:none;background:var(--bal-color-purple-2)}@media (hover: hover)and (pointer: fine){.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):hover{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-dropdown__root__content{color:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):hover .bal-icon__inner circle{fill:var(--bal-color-text-primary-pressed)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):active{background:var(--bal-color-purple-3)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):active .bal-icon__inner g,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):active .bal-icon__inner path,.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}}.bal-dropdown__root--theme-purple-expanded,.bal-dropdown__root--theme-purple-expanded:hover,.bal-dropdown__root--theme-purple-expanded:active{border:none;background:var(--bal-color-purple-2)}.bal-dropdown__root--theme-purple-expanded .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:hover .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:hover .bal-dropdown__root__content,.bal-dropdown__root--theme-purple-expanded:active .bal-dropdown__root__input,.bal-dropdown__root--theme-purple-expanded:active .bal-dropdown__root__content{color:var(--bal-color-text-primary)}.bal-dropdown__root--theme-purple-expanded .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:hover .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:hover .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:hover .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:hover .bal-icon__inner circle,.bal-dropdown__root--theme-purple-expanded:active .bal-icon__inner svg,.bal-dropdown__root--theme-purple-expanded:active .bal-icon__inner g,.bal-dropdown__root--theme-purple-expanded:active .bal-icon__inner path,.bal-dropdown__root--theme-purple-expanded:active .bal-icon__inner circle{fill:var(--bal-color-text-primary)}.bal-dropdown__root--focused.bal-dropdown__root--theme-purple:before{content:\"\";border-width:var(--bal-border-width-normal);border-style:solid;border-color:var(--bal-focus-shadow);position:absolute;background:rgba(0,0,0,0);border-radius:var(--bal-radius-normal);top:-0.25rem;bottom:-0.25rem;left:-0.25rem;right:-0.25rem}.bal-dropdown__root__content--size-small{font-size:var(--bal-text-size-small);font-weight:var(--bal-font-weight-bold)}.bal-dropdown__clear--theme-purple{height:2rem;width:2rem;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-right:-10px}.bal-dropdown__clear--theme-purple::before{content:\"\";position:absolute;right:32px;background:var(--bal-color-white);width:2px;height:100%}";
|
|
393
404
|
const BalDropdownStyle0 = balDropdownCss;
|
|
394
405
|
|
|
395
406
|
const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends HTMLElement {
|
|
@@ -513,6 +524,7 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends HTMLEle
|
|
|
513
524
|
this.hasFocus = false;
|
|
514
525
|
this.isExpanded = false;
|
|
515
526
|
this.isAutoFilled = false;
|
|
527
|
+
this.isKeyboardMode = false;
|
|
516
528
|
this.inputLabel = '';
|
|
517
529
|
this.ariaForm = defaultBalAriaForm;
|
|
518
530
|
this.language = defaultConfig.language;
|
|
@@ -522,7 +534,10 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends HTMLEle
|
|
|
522
534
|
this.autocomplete = 'off';
|
|
523
535
|
this.name = this.inputId;
|
|
524
536
|
this.placeholder = '';
|
|
537
|
+
this.inlineLabel = '';
|
|
525
538
|
this.icon = 'caret-down';
|
|
539
|
+
this.size = '';
|
|
540
|
+
this.theme = '';
|
|
526
541
|
this.disabled = false;
|
|
527
542
|
this.readonly = false;
|
|
528
543
|
this.multiple = false;
|
|
@@ -558,6 +573,9 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends HTMLEle
|
|
|
558
573
|
}
|
|
559
574
|
addEventListener(this.el, 'balOptionChange', this.listenToOptionChange);
|
|
560
575
|
if (balBrowser.hasDocument) {
|
|
576
|
+
addEventListener(document, 'keydown', this.eventsUtil.handleKeydown);
|
|
577
|
+
addEventListener(document, 'touchstart', this.eventsUtil.handlePointerDown);
|
|
578
|
+
addEventListener(document, 'mousedown', this.eventsUtil.handlePointerDown);
|
|
561
579
|
addEventListener(document, 'click', this.listenOnClickOutside);
|
|
562
580
|
addEventListener(document, 'reset', this.resetHandler, {
|
|
563
581
|
capture: true,
|
|
@@ -568,6 +586,9 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends HTMLEle
|
|
|
568
586
|
disconnectedCallback() {
|
|
569
587
|
removeEventListener(this.el, 'balOptionChange', this.listenToOptionChange);
|
|
570
588
|
if (balBrowser.hasDocument) {
|
|
589
|
+
removeEventListener(document, 'keydown', this.eventsUtil.handleKeydown);
|
|
590
|
+
removeEventListener(document, 'touchstart', this.eventsUtil.handlePointerDown);
|
|
591
|
+
removeEventListener(document, 'mousedown', this.eventsUtil.handlePointerDown);
|
|
571
592
|
removeEventListener(document, 'click', this.listenOnClickOutside);
|
|
572
593
|
removeEventListener(document, 'reset', this.resetHandler, {
|
|
573
594
|
capture: true,
|
|
@@ -656,7 +677,19 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends HTMLEle
|
|
|
656
677
|
*/
|
|
657
678
|
render() {
|
|
658
679
|
const block = BEM.block('dropdown');
|
|
659
|
-
|
|
680
|
+
const isFilled = this.valueUtil.isFilled();
|
|
681
|
+
const hasSize = this.size !== '';
|
|
682
|
+
const size = `size-${this.size}`;
|
|
683
|
+
const hasTheme = this.theme !== '';
|
|
684
|
+
const theme = `theme-${this.theme}`;
|
|
685
|
+
const focused = this.theme === 'purple' ? this.hasFocus && this.isKeyboardMode : this.hasFocus;
|
|
686
|
+
return (h(Host, { key: '76447733642f7e5cfafaee1d23b7db1d458fea13', class: Object.assign({}, block.class()), tabindex: "-1", id: `${this.inputId}` }, h("div", { key: 'f15d237a0aa27c7bc6d578b107547c2ba7b36ad3', class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, block.element('root').class()), block.element('root').modifier('focused').class(focused)), block.element('root').modifier('invalid').class(this.invalid)), block.element('root').modifier('disabled').class(this.valueUtil.isDisabled())), block.element('root').modifier('autofill').class(this.isAutoFilled)), block.element('root').modifier(size).class(hasSize)), block.element('root').modifier(theme).class(hasTheme)), block
|
|
687
|
+
.element('root')
|
|
688
|
+
.modifier(theme + '-filled')
|
|
689
|
+
.class(isFilled && hasTheme)), block
|
|
690
|
+
.element('root')
|
|
691
|
+
.modifier(theme + '-expanded')
|
|
692
|
+
.class(this.isExpanded && hasTheme)), "data-test": "bal-dropdown-trigger", onClick: ev => this.eventsUtil.handleClick(ev) }, h("span", { key: '8cd1f403f473212d52bb1d992e506e0db483ad11', class: Object.assign(Object.assign(Object.assign(Object.assign({}, block.element('root').element('content').class()), block.element('root').element('content').modifier('disabled').class(this.valueUtil.isDisabled())), block.element('root').element('content').modifier('placeholder').class(!this.valueUtil.isFilled())), block.element('root').element('content').modifier(size).class(hasSize)) }, h(DropdownValue, { key: '5e58e0734c37d2827515449e5fe61f3fe489ad01', filled: this.valueUtil.isFilled(), inlineLabel: this.inlineLabel, chips: this.chips, placeholder: this.placeholder, choices: this.choices, invalid: this.invalid, disabled: this.disabled, readonly: this.readonly, onRemoveChip: option => this.valueUtil.removeOption(option) })), h(DropdownInput, { key: 'f289ba14f7120bfad09dfdfc2f034bdacaf52d74', name: this.name, inputId: this.inputId, httpFormSubmit: this.httpFormSubmit, ariaForm: this.ariaForm, rawValue: this.rawValue, autocomplete: this.autocomplete, required: this.required, disabled: this.disabled, readonly: this.readonly, placeholder: this.placeholder, expanded: this.isExpanded, invalid: this.invalid, language: this.language, inputLabel: this.inputLabel, inheritedAttributes: this.inheritedAttributes, refInputEl: el => (this.nativeEl = el), onChange: ev => this.handleAutoFill(ev), onFocus: ev => this.eventsUtil.handleFocus(ev), onBlur: ev => this.eventsUtil.handleBlur(ev), onKeyDown: ev => this.handleKeyDown(ev) }), h(DropdownNativeSelect, { key: 'c32cb85f707db22ed5774d0a6bbd904bc63ea69c', name: this.name, httpFormSubmit: this.httpFormSubmit, multiple: this.multiple, required: this.required, disabled: this.valueUtil.isDisabled(), rawValue: this.rawValue, refSelectEl: el => (this.selectEl = el) }), h(DropdownIcon, { key: 'b263377bf16e268d3f555242e15325ba36d2b91f', icon: this.icon, size: this.size, theme: this.theme, language: this.language, loading: this.loading, clearable: this.clearable, invalid: this.invalid, expanded: this.isExpanded, filled: isFilled, disabled: this.valueUtil.isDisabled() })), h(DropdownOptionList, { key: 'cdfb11f2ef449f82ddf32f944cea8faea9027372', inputId: this.inputId, block: this.inputId, filter: this.filter, required: this.required, isExpanded: this.isExpanded, isDisabled: this.valueUtil.isDisabled(), hasPropOptions: this.optionUtil.hasPropOptions(), multiple: this.multiple, contentHeight: this.contentHeight, rawOptions: this.rawOptions, refPanelEl: el => (this.panelEl = el), refListEl: el => (this.listEl = el) }, h("slot", { key: '0a281eed8eea22ec5a345d8a1db295ad85b874ed' }))));
|
|
660
693
|
}
|
|
661
694
|
get el() { return this; }
|
|
662
695
|
static get watchers() { return {
|
|
@@ -668,7 +701,10 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends HTMLEle
|
|
|
668
701
|
"autocomplete": [1],
|
|
669
702
|
"name": [1],
|
|
670
703
|
"placeholder": [1],
|
|
704
|
+
"inlineLabel": [1, "inline-label"],
|
|
671
705
|
"icon": [1],
|
|
706
|
+
"size": [1],
|
|
707
|
+
"theme": [1],
|
|
672
708
|
"disabled": [4],
|
|
673
709
|
"readonly": [4],
|
|
674
710
|
"multiple": [4],
|
|
@@ -688,6 +724,7 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends HTMLEle
|
|
|
688
724
|
"hasFocus": [32],
|
|
689
725
|
"isExpanded": [32],
|
|
690
726
|
"isAutoFilled": [32],
|
|
727
|
+
"isKeyboardMode": [32],
|
|
691
728
|
"inputLabel": [32],
|
|
692
729
|
"ariaForm": [32],
|
|
693
730
|
"language": [32],
|
package/components/bal-footer.js
CHANGED
|
@@ -219,6 +219,7 @@ const Footer = /*@__PURE__*/ proxyCustomElement(class Footer extends HTMLElement
|
|
|
219
219
|
this.region = defaultConfig.region;
|
|
220
220
|
this.allowedLanguages = defaultConfig.allowedLanguages;
|
|
221
221
|
this.hideLinks = false;
|
|
222
|
+
this.overrideLinks = undefined;
|
|
222
223
|
this.showSocialMedia = false;
|
|
223
224
|
this.hideLanguageSelection = false;
|
|
224
225
|
}
|
|
@@ -257,7 +258,10 @@ const Footer = /*@__PURE__*/ proxyCustomElement(class Footer extends HTMLElement
|
|
|
257
258
|
updateBalLanguage(language);
|
|
258
259
|
}
|
|
259
260
|
updateFooterLinks() {
|
|
260
|
-
if (
|
|
261
|
+
if (this.overrideLinks) {
|
|
262
|
+
this.links = this.overrideLinks;
|
|
263
|
+
}
|
|
264
|
+
else if (!this.hideLinks && (this.region === 'CH' || this.region === 'DE')) {
|
|
261
265
|
// The following footer links only apply to swiss and german applications
|
|
262
266
|
const region = this.region;
|
|
263
267
|
rIC(() => {
|
|
@@ -292,18 +296,18 @@ const Footer = /*@__PURE__*/ proxyCustomElement(class Footer extends HTMLElement
|
|
|
292
296
|
elLanguage.element('icon');
|
|
293
297
|
const elLegalLinks = elLinksContainer.element('legal-links');
|
|
294
298
|
const elSocialMediaLinks = elLinksContainer.element('social-media-links');
|
|
295
|
-
return (h(Host, { key: '
|
|
299
|
+
return (h(Host, { key: 'ae55946ea2a65fc9e92bd7e5c3be4fc3f3fa75d6', class: Object.assign({}, block.class()) }, h("footer", { key: '13ab5d638fb4f9009cb2e93d77a9ac70bc08622e', class: Object.assign({}, elInner.class()) }, h("div", { key: '9554e06e86b94ce2fd49e9c129207f04f8e95bbb', class: Object.assign({}, elInnerWrapper.class()) }, h("div", { key: 'd1aac84f5621a9fbae86b9fdb9f8a0ad55988efc', class: Object.assign(Object.assign({ container: true }, elContainer.class()), elHeaderContainer.class()) }, h("div", { key: 'b809f53a3e85e806930d14cbffde39fb58ed6ea3', class: Object.assign({}, elLogo.class()) }, h("bal-logo", { key: 'e85736ba7525e7545e2bd58a72e9b35971696647', color: "white" })), h("div", { key: '176ea2f04f5458307d0b823b122ef79764f138d8', class: Object.assign({}, elLanguage.class()), style: {
|
|
296
300
|
display: this.hideLanguageSelection || this.allowedLanguages.length <= 1 ? 'none' : 'flex',
|
|
297
|
-
} }, h("div", { key: '
|
|
301
|
+
} }, h("div", { key: '2df7d00cb622575dfa5484bceb44a99b90c2a736', class: Object.assign({}, elWrapper.class()) }, h("bal-input-group", { key: '5cc4baee54d1d8f44f2c836788f7739fa16e468d' }, h("bal-icon", { key: 'ebbfd79b91aa01b97707e763b7fbf869eb61b925', class: 'bal-dropdown__rear', name: "web", color: "white", onClick: el => {
|
|
298
302
|
var _a;
|
|
299
303
|
stopEventBubbling(el);
|
|
300
304
|
(_a = this.selectEl) === null || _a === void 0 ? void 0 : _a.open();
|
|
301
|
-
} }), h("bal-dropdown", { key: '
|
|
305
|
+
} }), h("bal-dropdown", { key: '23540be5a9fddcc7c1e5368dfa4858ab1da720f5', ref: el => (this.selectEl = el), value: this.language, onBalChange: event => this.changeLanguage(event.detail), "data-testid": "bal-footer-language" }, this.allowedLanguages.map(language => (h("bal-option", { key: language, label: language.toLocaleUpperCase(), value: language }, language.toLocaleUpperCase())))))))), h("div", { key: '2580651725f59eb95ff734f9499f80635580ecd9', class: Object.assign({}, elSlot.class()) }, h("slot", { key: 'f6fef80d09d9d7213c975957b917019ce3299d73' })), h("div", { key: 'eefbce7897b7935f18b61e53d4dc19ded1806bc7', class: Object.assign(Object.assign({ container: true }, elContainer.class()), elLinksContainer.class()) }, h("div", { key: '0eee61cb3cbdaaf2af5c135ef472b9579e77b1a9', class: Object.assign({}, elSocialMediaLinks.class()), style: {
|
|
302
306
|
display: !this.showSocialMedia ? 'none' : 'flex',
|
|
303
307
|
} }, this.socialMediaLinks.map(link => (h("a", { key: link.link, href: link.link, target: "_blank", class: {
|
|
304
308
|
'link': true,
|
|
305
309
|
'is-inverted': true,
|
|
306
|
-
} }, h("bal-icon", { name: link.label.toLowerCase() }))))), h("div", { key: '
|
|
310
|
+
} }, h("bal-icon", { name: link.label.toLowerCase() }))))), h("div", { key: '5ba9f15559377a56212e51fa6166d09225ba4a40', class: Object.assign({}, elLegalLinks.class()), style: { display: this.hideLinks ? 'none' : 'flex' } }, this.links.map(link => (h("a", { key: link.link, href: link.link, target: "_blank", class: {
|
|
307
311
|
'link': true,
|
|
308
312
|
'is-light': true,
|
|
309
313
|
} }, link.label)))))))));
|
|
@@ -311,6 +315,7 @@ const Footer = /*@__PURE__*/ proxyCustomElement(class Footer extends HTMLElement
|
|
|
311
315
|
static get style() { return BalFooterStyle0; }
|
|
312
316
|
}, [4, "bal-footer", {
|
|
313
317
|
"hideLinks": [4, "hide-links"],
|
|
318
|
+
"overrideLinks": [16],
|
|
314
319
|
"showSocialMedia": [4, "show-social-media"],
|
|
315
320
|
"hideLanguageSelection": [4, "hide-language-selection"],
|
|
316
321
|
"links": [32],
|
|
@@ -4,7 +4,7 @@ import { B as BEM } from './bem.js';
|
|
|
4
4
|
import { L as Logger } from './log.js';
|
|
5
5
|
import { s as stopEventBubbling } from './form-input.js';
|
|
6
6
|
import { F as FOCUS_KEYS } from './focus-visible.js';
|
|
7
|
-
import { m as raf } from './helpers.js';
|
|
7
|
+
import { i as isDescendant, m as raf } from './helpers.js';
|
|
8
8
|
import { d as defaultBalAriaForm } from './form.js';
|
|
9
9
|
import { L as ListenTo } from './listen.js';
|
|
10
10
|
import { a as isSpaceKey, i as isEnterKey, c as isArrowUpKey, f as isArrowLeftKey, b as isArrowDownKey, g as isArrowRightKey, h as isHomeKey, j as isEndKey } from './keyboard.helpers.js';
|
|
@@ -141,6 +141,13 @@ const Segment = /*@__PURE__*/ proxyCustomElement(class Segment extends HTMLEleme
|
|
|
141
141
|
focusOutListener(ev) {
|
|
142
142
|
this.balBlur.emit(ev);
|
|
143
143
|
}
|
|
144
|
+
listenToDidAnimate(ev) {
|
|
145
|
+
if (ev && ev.target && isDescendant(ev.target, this.el)) {
|
|
146
|
+
const childRect = this.el.getBoundingClientRect();
|
|
147
|
+
this.maxWidth = childRect.width;
|
|
148
|
+
this.windowResizeListener();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
144
151
|
breakpointListener(breakpoints) {
|
|
145
152
|
this.isMobile = breakpoints.mobile;
|
|
146
153
|
}
|
|
@@ -309,7 +316,7 @@ const Segment = /*@__PURE__*/ proxyCustomElement(class Segment extends HTMLEleme
|
|
|
309
316
|
render() {
|
|
310
317
|
const { invalid, isVertical, scrollable, keyboardMode, expanded, isMobile, disabled } = this;
|
|
311
318
|
const block = BEM.block('segment');
|
|
312
|
-
return (h(Host, { key: '
|
|
319
|
+
return (h(Host, { key: '3554d8bc4b44417e273a935a70ae89ff87e26d45', role: "radiogroup", id: this.ariaForm.controlId, "aria-labelledby": this.ariaForm.labelId, "aria-describedby": this.ariaForm.messageId, class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, block.class()), block.modifier('invalid').class(invalid)), block.modifier('vertical').class(isVertical)), block.modifier('scrollable').class(scrollable)), block.modifier('keyboard').class(keyboardMode)), block.modifier('disabled').class(disabled)), block.modifier('expanded').class((expanded || isMobile) && !isVertical)), onClick: this.onClick }, h("slot", { key: '9271b42436f9c30077a60bcef7847ac04d093052', onSlotchange: this.onSlottedItemsChange })));
|
|
313
320
|
}
|
|
314
321
|
get el() { return this; }
|
|
315
322
|
static get watchers() { return {
|
|
@@ -353,6 +360,12 @@ __decorate([
|
|
|
353
360
|
__metadata("design:paramtypes", [FocusEvent]),
|
|
354
361
|
__metadata("design:returntype", void 0)
|
|
355
362
|
], Segment.prototype, "focusOutListener", null);
|
|
363
|
+
__decorate([
|
|
364
|
+
ListenTo('balWillAnimate', { target: 'window' }),
|
|
365
|
+
__metadata("design:type", Function),
|
|
366
|
+
__metadata("design:paramtypes", [UIEvent]),
|
|
367
|
+
__metadata("design:returntype", void 0)
|
|
368
|
+
], Segment.prototype, "listenToDidAnimate", null);
|
|
356
369
|
__decorate([
|
|
357
370
|
ListenToBreakpoints(),
|
|
358
371
|
__metadata("design:type", Function),
|
|
@@ -21,6 +21,8 @@ const TabItem = /*@__PURE__*/ proxyCustomElement(class TabItem extends HTMLEleme
|
|
|
21
21
|
this.icon = undefined;
|
|
22
22
|
this.noPanel = false;
|
|
23
23
|
this.aria = undefined;
|
|
24
|
+
this.subLabel = '';
|
|
25
|
+
this.svg = '';
|
|
24
26
|
}
|
|
25
27
|
componentWillLoad() {
|
|
26
28
|
this.inheritAttributes = inheritTrackingAttributes(this.el);
|
|
@@ -55,15 +57,17 @@ const TabItem = /*@__PURE__*/ proxyCustomElement(class TabItem extends HTMLEleme
|
|
|
55
57
|
trackingData: this.inheritAttributes,
|
|
56
58
|
noPanel: this.noPanel,
|
|
57
59
|
aria: this.aria,
|
|
60
|
+
subLabel: this.subLabel,
|
|
61
|
+
svg: this.svg,
|
|
58
62
|
};
|
|
59
63
|
}
|
|
60
64
|
render() {
|
|
61
65
|
const hasPanel = !this.noPanel;
|
|
62
66
|
const noPanelOrInactive = !this.isActive || this.noPanel;
|
|
63
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: '73cd7faf737780486e58b71b4c51508e0311e277', id: this.tabPanelID, class: {
|
|
64
68
|
'bal-tab-item': true,
|
|
65
69
|
'bal-tab-item--active': this.isActive,
|
|
66
|
-
}, role: hasPanel ? 'tabpanel' : undefined, "aria-label": hasPanel ? this.label : undefined, "aria-hidden": noPanelOrInactive ? 'true' : 'false', tabindex: noPanelOrInactive ? '-1' : undefined, hidden: noPanelOrInactive ? true : undefined }, h("slot", { key: '
|
|
70
|
+
}, role: hasPanel ? 'tabpanel' : undefined, "aria-label": hasPanel ? this.label : undefined, "aria-hidden": noPanelOrInactive ? 'true' : 'false', tabindex: noPanelOrInactive ? '-1' : undefined, hidden: noPanelOrInactive ? true : undefined }, h("slot", { key: 'd533d087306ee17ba5b78c9b756db6cf923ef1a5' })));
|
|
67
71
|
}
|
|
68
72
|
get el() { return this; }
|
|
69
73
|
}, [4, "bal-tab-item", {
|
|
@@ -79,6 +83,8 @@ const TabItem = /*@__PURE__*/ proxyCustomElement(class TabItem extends HTMLEleme
|
|
|
79
83
|
"icon": [513],
|
|
80
84
|
"noPanel": [4, "no-panel"],
|
|
81
85
|
"aria": [16],
|
|
86
|
+
"subLabel": [513, "sub-label"],
|
|
87
|
+
"svg": [1],
|
|
82
88
|
"isActive": [32],
|
|
83
89
|
"getOptions": [64],
|
|
84
90
|
"setActive": [64]
|