@baloise/ds-core 19.0.1 → 19.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-button2.js +14 -10
- package/components/bal-date.js +84 -61
- package/components/bal-field-hint.js +22 -10
- package/components/bal-hint2.js +35 -28
- package/components/bal-nav.js +154 -154
- package/components/bal-number-input.js +3 -0
- package/components/bal-popover2.js +1 -1
- package/components/bal-popup.js +1 -692
- package/components/bal-popup2.js +694 -0
- package/components/bal-radio2.js +1 -1
- package/components/bal-steps.js +1 -1
- package/components/bal-tabs2.js +35 -27
- package/components/index.esm.js +7 -1
- package/components/index.js +1 -1
- package/components/scroll.js +2 -0
- package/components/swiper.util.js +36 -36
- 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-3b1a0df0.js → p-022af4f2.js} +1 -1
- package/dist/baloise-design-system/{p-bbdf082862.entry.js → p-131fd635ef.entry.js} +1 -1
- package/dist/baloise-design-system/{p-40b022e526.entry.js → p-13ea819488.entry.js} +1 -1
- package/dist/baloise-design-system/{p-beb28f85.system.js → p-14c507db.system.js} +1 -1
- package/dist/baloise-design-system/{p-8f17a55f2b.system.entry.js → p-1693fa7649.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-0ac528b6cb.entry.js → p-16ebe71517.entry.js} +1 -1
- package/dist/baloise-design-system/p-1d4ea7e42b.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-9b9be713.system.js → p-1d7c3cf2.system.js} +1 -1
- package/dist/baloise-design-system/{p-98b6f8ba43.entry.js → p-1e0a2263fb.entry.js} +1 -1
- package/dist/baloise-design-system/p-20bc89d933.entry.js +1 -0
- package/dist/baloise-design-system/{p-817f7907be.system.entry.js → p-2367556371.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-859c0fae39.system.entry.js → p-24336e0fca.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-290dfd0212.system.entry.js +1 -0
- package/dist/baloise-design-system/p-2a27350c.js +1 -0
- package/dist/baloise-design-system/{p-b79164fedd.entry.js → p-32bf71aa6c.entry.js} +1 -1
- package/dist/baloise-design-system/p-345aa92d.system.js +1 -1
- package/dist/baloise-design-system/{p-a15a24d3a1.system.entry.js → p-35fde87c2a.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-363a7f7760.entry.js +1 -0
- package/dist/baloise-design-system/{p-afe7f75fcf.system.entry.js → p-390b2af6a5.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-3913c6ae.js +1 -1
- package/dist/baloise-design-system/{p-b268996da1.system.entry.js → p-42b2e62411.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-9f14664495.system.entry.js → p-47eaccc384.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-1e738175.system.js → p-490383ab.system.js} +1 -1
- package/dist/baloise-design-system/{p-f005df0cd0.entry.js → p-53b2b718c5.entry.js} +1 -1
- package/dist/baloise-design-system/{p-58cd37922d.system.entry.js → p-58b1d6fa96.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-faab35937e.system.entry.js → p-5fcfbec540.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-c8ee46d5bc.entry.js → p-64916e34a4.entry.js} +1 -1
- package/dist/baloise-design-system/p-659ecadc.system.js +1 -1
- package/dist/baloise-design-system/{p-655d37c8.system.js → p-68d7e929.system.js} +1 -1
- package/dist/baloise-design-system/p-702abad387.entry.js +1 -0
- package/dist/baloise-design-system/p-7d4fac85.js +1 -0
- package/dist/baloise-design-system/p-8a9fb4619a.entry.js +1 -0
- package/dist/baloise-design-system/p-8bd42bba68.entry.js +1 -0
- package/dist/baloise-design-system/p-967bdfab.js +1 -0
- package/dist/baloise-design-system/{p-5cfc65b40f.system.entry.js → p-98cf514345.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-9d3935fbbc.entry.js +1 -0
- package/dist/baloise-design-system/{p-f19ea306.system.js → p-9f7a1215.system.js} +1 -1
- package/dist/baloise-design-system/p-a64c7a3b82.system.entry.js +1 -0
- package/dist/baloise-design-system/p-a7963df92a.entry.js +1 -0
- package/dist/baloise-design-system/p-b2f7e364.js +1 -0
- package/dist/baloise-design-system/{p-ef4bf5f5.js → p-b96e5a6c.js} +1 -1
- package/dist/baloise-design-system/{p-ec777a9167.entry.js → p-b9a4f3580b.entry.js} +1 -1
- package/dist/baloise-design-system/{p-df5ddf4439.system.entry.js → p-c5ac7b5d30.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-2bc77d4c8d.system.entry.js → p-c89750c825.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-f4f96647cf.system.entry.js → p-d09026edb1.system.entry.js} +1 -1
- package/dist/baloise-design-system/{p-234c26f450.system.entry.js → p-dd2a76bd7c.system.entry.js} +1 -1
- package/dist/baloise-design-system/p-df9bc850dc.system.entry.js +1 -0
- package/dist/baloise-design-system/p-e43b61e151.system.entry.js +1 -0
- package/dist/baloise-design-system/{p-5281d378.system.js → p-e453a2de.system.js} +1 -1
- package/dist/baloise-design-system/p-e75452d8.system.js +1 -0
- package/dist/baloise-design-system/{p-77c6d65eb1.entry.js → p-eaed1f800c.entry.js} +1 -1
- package/dist/baloise-design-system/p-f04cab5af1.entry.js +1 -0
- package/dist/baloise-design-system/p-f2cc4e63d4.entry.js +1 -0
- package/dist/baloise-design-system/{p-2556cb83d1.entry.js → p-f6b1d87619.entry.js} +1 -1
- package/dist/cjs/bal-button_2.cjs.entry.js +13 -9
- package/dist/cjs/bal-carousel_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-date.cjs.entry.js +83 -60
- package/dist/cjs/bal-footer.cjs.entry.js +1 -1
- package/dist/cjs/bal-hint_5.cjs.entry.js +16 -21
- 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-modal_3.cjs.entry.js +1 -1
- package/dist/cjs/bal-nav_8.cjs.entry.js +157 -157
- package/dist/cjs/bal-navbar_5.cjs.entry.js +4 -4
- package/dist/cjs/bal-number-input.cjs.entry.js +3 -0
- package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
- package/dist/cjs/bal-popup.cjs.entry.js +4 -4
- package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
- package/dist/cjs/bal-radio_2.cjs.entry.js +1 -1
- package/dist/cjs/bal-segment_2.cjs.entry.js +4 -4
- package/dist/cjs/bal-shape.cjs.entry.js +1 -1
- package/dist/cjs/bal-steps.cjs.entry.js +4 -4
- package/dist/cjs/bal-tab-item_2.cjs.entry.js +36 -28
- package/dist/cjs/baloise-design-system.cjs.js +1 -1
- package/dist/cjs/{breakpoints.decorator-9a0be218.js → breakpoints.decorator-5086ec90.js} +1 -1
- package/dist/cjs/{breakpoints.subject-19c7123e.js → breakpoints.subject-a1180187.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{index.esm-1f386b07.js → index.esm-a38eebac.js} +7 -0
- package/dist/cjs/initialize-2e8978a4.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scroll-73c1b762.js → scroll-dc37ea84.js} +2 -0
- package/dist/cjs/{tokens.esm-3468979c.js → tokens.esm-263be70d.js} +1 -1
- package/dist/cjs/{window-resize.decorator-86974eaf.js → window-resize.decorator-9a06680f.js} +1 -1
- package/dist/collection/components/bal-button/bal-button.js +33 -10
- package/dist/collection/components/bal-date/bal-date.js +86 -107
- package/dist/collection/components/bal-hint/bal-hint.css +1 -1
- package/dist/collection/components/bal-hint/bal-hint.js +11 -16
- package/dist/collection/components/bal-nav/bal-nav.js +7 -7
- package/dist/collection/components/bal-number-input/bal-number-input.utils.js +3 -0
- package/dist/collection/components/bal-popup/bal-popup.css +1 -1
- package/dist/collection/components/bal-popup/bal-popup.js +3 -3
- package/dist/collection/components/bal-steps/components/step-button.js +1 -1
- package/dist/collection/components/bal-tabs/bal-tabs.js +12 -12
- package/dist/collection/components/bal-tabs/components/tab-nav.js +9 -1
- package/dist/collection/utils/constants/version.constant.js +1 -1
- package/dist/collection/utils/scroll.js +2 -0
- package/dist/collection/utils/swiper/swiper.util.js +6 -6
- package/dist/esm/bal-button_2.entry.js +13 -9
- package/dist/esm/bal-carousel_2.entry.js +4 -4
- package/dist/esm/bal-date.entry.js +84 -61
- package/dist/esm/bal-footer.entry.js +1 -1
- package/dist/esm/bal-hint_5.entry.js +16 -21
- package/dist/esm/bal-list_8.entry.js +3 -3
- package/dist/esm/bal-logo.entry.js +3 -3
- package/dist/esm/bal-modal_3.entry.js +1 -1
- package/dist/esm/bal-nav_8.entry.js +157 -157
- package/dist/esm/bal-navbar_5.entry.js +4 -4
- package/dist/esm/bal-number-input.entry.js +3 -0
- package/dist/esm/bal-pagination.entry.js +3 -3
- package/dist/esm/bal-popup.entry.js +4 -4
- package/dist/esm/bal-progress-bar.entry.js +4 -4
- package/dist/esm/bal-radio_2.entry.js +1 -1
- package/dist/esm/bal-segment_2.entry.js +4 -4
- package/dist/esm/bal-shape.entry.js +1 -1
- package/dist/esm/bal-steps.entry.js +4 -4
- package/dist/esm/bal-tab-item_2.entry.js +36 -28
- package/dist/esm/baloise-design-system.js +1 -1
- package/dist/esm/{breakpoints.decorator-899aba5d.js → breakpoints.decorator-3666716a.js} +1 -1
- package/dist/esm/{breakpoints.subject-2397d734.js → breakpoints.subject-1aa7be9a.js} +1 -1
- package/dist/esm/{index.esm-21c97d14.js → index.esm-9079680d.js} +7 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/initialize-be160cc4.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scroll-f4b20848.js → scroll-521224a9.js} +2 -0
- package/dist/esm/{tokens.esm-a6a0f537.js → tokens.esm-a3abda33.js} +1 -1
- package/dist/esm/{window-resize.decorator-f286b710.js → window-resize.decorator-ef52bf33.js} +1 -1
- package/dist/esm-es5/bal-button_2.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-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-modal_3.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-number-input.entry.js +1 -1
- package/dist/esm-es5/bal-pagination.entry.js +1 -1
- package/dist/esm-es5/bal-popup.entry.js +1 -1
- package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
- package/dist/esm-es5/bal-radio_2.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/baloise-design-system.js +1 -1
- package/dist/esm-es5/breakpoints.decorator-3666716a.js +1 -0
- package/dist/esm-es5/{breakpoints.subject-2397d734.js → breakpoints.subject-1aa7be9a.js} +1 -1
- package/dist/esm-es5/index.esm-9079680d.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/initialize-be160cc4.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/scroll-521224a9.js +1 -0
- package/dist/esm-es5/{swiper.util-01fa2dd9.js → swiper.util-5f92ac1c.js} +1 -1
- package/dist/esm-es5/{window-resize.decorator-f286b710.js → window-resize.decorator-ef52bf33.js} +1 -1
- package/dist/types/components/bal-button/bal-button.d.ts +5 -1
- package/dist/types/components/bal-button/bal-button.interfaces.d.ts +2 -0
- package/dist/types/components/bal-date/bal-date.d.ts +10 -15
- package/dist/types/components/bal-hint/bal-hint.d.ts +3 -2
- package/dist/types/components/bal-nav/bal-nav.d.ts +5 -5
- package/dist/types/components/bal-popup/bal-popup.d.ts +1 -1
- package/dist/types/components/bal-tabs/bal-tabs.d.ts +6 -6
- package/dist/types/components/bal-tabs/components/tab-nav.d.ts +1 -1
- package/dist/types/components.d.ts +5 -1
- package/package.json +6 -6
- package/dist/baloise-design-system/p-058dece332.system.entry.js +0 -1
- package/dist/baloise-design-system/p-082910ce81.entry.js +0 -1
- package/dist/baloise-design-system/p-28fbcf6fc9.entry.js +0 -1
- package/dist/baloise-design-system/p-2ff3021da9.entry.js +0 -1
- package/dist/baloise-design-system/p-36ce945a77.entry.js +0 -1
- package/dist/baloise-design-system/p-42629a573a.system.entry.js +0 -1
- package/dist/baloise-design-system/p-5e1f2c26.js +0 -1
- package/dist/baloise-design-system/p-65e20456c6.entry.js +0 -1
- package/dist/baloise-design-system/p-85a6191cd8.entry.js +0 -1
- package/dist/baloise-design-system/p-894423fd.system.js +0 -1
- package/dist/baloise-design-system/p-917729be7f.entry.js +0 -1
- package/dist/baloise-design-system/p-b26a67d805.entry.js +0 -1
- package/dist/baloise-design-system/p-c1852273.js +0 -1
- package/dist/baloise-design-system/p-c661a0bb96.system.entry.js +0 -1
- package/dist/baloise-design-system/p-c72db97c1c.system.entry.js +0 -1
- package/dist/baloise-design-system/p-ddec5b99.js +0 -1
- package/dist/baloise-design-system/p-e5604d449d.system.entry.js +0 -1
- package/dist/baloise-design-system/p-ee275c12a9.entry.js +0 -1
- package/dist/baloise-design-system/p-f89208a3.js +0 -1
- package/dist/esm-es5/breakpoints.decorator-899aba5d.js +0 -1
- package/dist/esm-es5/index.esm-21c97d14.js +0 -1
- package/dist/esm-es5/scroll-f4b20848.js +0 -1
- package/dist/baloise-design-system/{p-95d42ad1.js → p-928bbc47.js} +0 -0
- package/dist/baloise-design-system/{p-cebe968d.system.js → p-bccc3d48.system.js} +0 -0
- package/dist/cjs/{swiper.util-f1c856f3.js → swiper.util-d23b8eb0.js} +36 -36
- package/dist/esm/{swiper.util-01fa2dd9.js → swiper.util-5f92ac1c.js} +36 -36
- /package/dist/esm-es5/{tokens.esm-a6a0f537.js → tokens.esm-a3abda33.js} +0 -0
|
@@ -1,21 +1,60 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { BEM } from "../../utils/bem";
|
|
6
|
-
import { Logger } from "../../utils/log";
|
|
7
|
-
import { BalDate } from "../../utils/date";
|
|
2
|
+
import { isEscapeKey } from "@baloise/web-app-utils";
|
|
3
|
+
import { Host, h, } from "@stencil/core";
|
|
4
|
+
import { ariaBooleanToString } from "../../utils/aria";
|
|
8
5
|
import { inheritAttributes } from "../../utils/attributes";
|
|
9
|
-
import {
|
|
6
|
+
import { BEM } from "../../utils/bem";
|
|
7
|
+
import { balBrowser } from "../../utils/browser";
|
|
10
8
|
import { ListenToConfig, defaultConfig } from "../../utils/config";
|
|
11
|
-
import {
|
|
12
|
-
import { defaultBalAriaForm } from "../../utils/form";
|
|
9
|
+
import { BalDate } from "../../utils/date";
|
|
13
10
|
import { balFloatingUi } from "../../utils/floating-ui";
|
|
14
|
-
import {
|
|
11
|
+
import { FOCUS_KEYS } from "../../utils/focus-visible";
|
|
12
|
+
import { defaultBalAriaForm } from "../../utils/form";
|
|
13
|
+
import { stopEventBubbling } from "../../utils/form-input";
|
|
14
|
+
import { addEventListener, debounceEvent, rIC, removeEventListener, waitAfterIdleCallback } from "../../utils/helpers";
|
|
15
|
+
import { isSpaceKey } from "../../utils/keyboard";
|
|
16
|
+
import { Logger } from "../../utils/log";
|
|
17
|
+
import { i18nBalDate } from "./bal-date.i18n";
|
|
15
18
|
export class Date {
|
|
16
19
|
constructor() {
|
|
17
20
|
this.inputId = `bal-da-${dateIds++}`;
|
|
18
21
|
this.inheritedAttributes = {};
|
|
22
|
+
/**
|
|
23
|
+
* LIFECYCLE
|
|
24
|
+
* ------------------------------------------------------
|
|
25
|
+
*/
|
|
26
|
+
this.hasConnected = false;
|
|
27
|
+
/**
|
|
28
|
+
* PRIVATE METHOD
|
|
29
|
+
* ------------------------------------------------------
|
|
30
|
+
*/
|
|
31
|
+
this.handleKeydown = (ev) => {
|
|
32
|
+
this.isKeyboardMode = FOCUS_KEYS.includes(ev.key);
|
|
33
|
+
};
|
|
34
|
+
this.handlePointerDown = () => {
|
|
35
|
+
this.isKeyboardMode = false;
|
|
36
|
+
};
|
|
37
|
+
this.handleOutsideClick = (ev) => {
|
|
38
|
+
if (this.isExpanded) {
|
|
39
|
+
if (!this.el.contains(ev.target)) {
|
|
40
|
+
this.isExpanded = false;
|
|
41
|
+
this.hasFocus = false;
|
|
42
|
+
rIC(() => this.balBlur.emit(ev));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
this.handleFocus = (ev) => {
|
|
47
|
+
stopEventBubbling(ev);
|
|
48
|
+
this.hasFocus = true;
|
|
49
|
+
this.balFocus.emit(ev.detail);
|
|
50
|
+
};
|
|
51
|
+
this.handleBlur = (ev) => {
|
|
52
|
+
stopEventBubbling(ev);
|
|
53
|
+
if (!this.isExpanded) {
|
|
54
|
+
this.hasFocus = false;
|
|
55
|
+
rIC(() => this.balBlur.emit(ev.detail));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
19
58
|
/**
|
|
20
59
|
* EVENT BINDING
|
|
21
60
|
* ------------------------------------------------------
|
|
@@ -39,6 +78,8 @@ export class Date {
|
|
|
39
78
|
this.balChange.emit(this.value);
|
|
40
79
|
if (this.closeOnSelect) {
|
|
41
80
|
this.close();
|
|
81
|
+
this.hasFocus = false;
|
|
82
|
+
rIC(() => this.balBlur.emit());
|
|
42
83
|
}
|
|
43
84
|
};
|
|
44
85
|
this.onInputInput = (ev) => {
|
|
@@ -56,24 +97,22 @@ export class Date {
|
|
|
56
97
|
this.value = ev.detail;
|
|
57
98
|
this.balChange.emit(this.value);
|
|
58
99
|
};
|
|
59
|
-
this.onInputFocus = (ev) => {
|
|
60
|
-
stopEventBubbling(ev);
|
|
61
|
-
this.balFocus.emit(ev.detail);
|
|
62
|
-
};
|
|
63
|
-
this.onInputBlur = (ev) => {
|
|
64
|
-
stopEventBubbling(ev);
|
|
65
|
-
this.balBlur.emit(ev.detail);
|
|
66
|
-
};
|
|
67
100
|
this.onKeyPress = async ({ detail }) => {
|
|
68
|
-
if (
|
|
101
|
+
if (detail && detail.key) {
|
|
69
102
|
if (this.isExpanded) {
|
|
70
|
-
|
|
103
|
+
if (detail.key === 'Tab' || isEscapeKey(detail) || isSpaceKey(detail)) {
|
|
104
|
+
await this.close();
|
|
105
|
+
}
|
|
71
106
|
}
|
|
72
107
|
else {
|
|
73
|
-
|
|
108
|
+
if (isSpaceKey(detail)) {
|
|
109
|
+
await this.open();
|
|
110
|
+
}
|
|
74
111
|
}
|
|
75
112
|
}
|
|
76
113
|
};
|
|
114
|
+
this.isKeyboardMode = false;
|
|
115
|
+
this.hasFocus = false;
|
|
77
116
|
this.isExpanded = false;
|
|
78
117
|
this.language = defaultConfig.language;
|
|
79
118
|
this.calendarValue = undefined;
|
|
@@ -108,43 +147,26 @@ export class Date {
|
|
|
108
147
|
debounceChanged() {
|
|
109
148
|
this.balChange = debounceEvent(this.balChange, this.debounce);
|
|
110
149
|
}
|
|
111
|
-
/**
|
|
112
|
-
* LIFECYCLE
|
|
113
|
-
* ------------------------------------------------------
|
|
114
|
-
*/
|
|
115
150
|
connectedCallback() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* LISTENERS
|
|
123
|
-
* ------------------------------------------------------
|
|
124
|
-
*/
|
|
125
|
-
async listenToKeydown(ev) {
|
|
126
|
-
if (this.isExpanded && (ev.key === 'Escape' || ev.key === 'Esc')) {
|
|
127
|
-
ev.preventDefault();
|
|
128
|
-
await this.close();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
async listenOnKeyup(ev) {
|
|
132
|
-
// dismiss popup when focus next form control
|
|
133
|
-
if (ev.key === 'Tab' && !this.el.contains(document.activeElement) && this.isExpanded) {
|
|
134
|
-
await this.close();
|
|
151
|
+
if (balBrowser.hasDocument) {
|
|
152
|
+
addEventListener(document, 'keydown', this.handleKeydown);
|
|
153
|
+
addEventListener(document, 'touchstart', this.handlePointerDown);
|
|
154
|
+
addEventListener(document, 'mousedown', this.handlePointerDown);
|
|
155
|
+
addEventListener(document, 'click', this.handleOutsideClick);
|
|
135
156
|
}
|
|
157
|
+
this.hasConnected = true;
|
|
158
|
+
this.valueChanged();
|
|
136
159
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
160
|
+
disconnectedCallback() {
|
|
161
|
+
if (balBrowser.hasDocument) {
|
|
162
|
+
removeEventListener(document, 'keydown', this.handleKeydown);
|
|
163
|
+
removeEventListener(document, 'touchstart', this.handlePointerDown);
|
|
164
|
+
removeEventListener(document, 'mousedown', this.handlePointerDown);
|
|
165
|
+
removeEventListener(document, 'click', this.handleOutsideClick);
|
|
141
166
|
}
|
|
142
167
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (this.inputId !== ev.detail) {
|
|
146
|
-
await this.close();
|
|
147
|
-
}
|
|
168
|
+
componentWillLoad() {
|
|
169
|
+
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);
|
|
148
170
|
}
|
|
149
171
|
/**
|
|
150
172
|
* @internal define config for the component
|
|
@@ -194,8 +216,10 @@ export class Date {
|
|
|
194
216
|
* `input.focus()`.
|
|
195
217
|
*/
|
|
196
218
|
async setFocus() {
|
|
197
|
-
|
|
198
|
-
|
|
219
|
+
if (this.inputEl && !this.disabled && !this.readonly) {
|
|
220
|
+
await waitAfterIdleCallback();
|
|
221
|
+
this.inputEl.focus();
|
|
222
|
+
}
|
|
199
223
|
}
|
|
200
224
|
/**
|
|
201
225
|
* Sets blur on the native `input` in `bal-input`. Use this method instead of the global
|
|
@@ -204,7 +228,10 @@ export class Date {
|
|
|
204
228
|
*/
|
|
205
229
|
async setBlur() {
|
|
206
230
|
var _a;
|
|
207
|
-
(
|
|
231
|
+
if (this.inputEl && !this.disabled && !this.readonly) {
|
|
232
|
+
await waitAfterIdleCallback();
|
|
233
|
+
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.setBlur();
|
|
234
|
+
}
|
|
208
235
|
}
|
|
209
236
|
/**
|
|
210
237
|
* Returns the native `<input>` element used under the hood.
|
|
@@ -221,14 +248,9 @@ export class Date {
|
|
|
221
248
|
this.ariaForm = Object.assign({}, ariaForm);
|
|
222
249
|
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.setAriaForm(ariaForm);
|
|
223
250
|
}
|
|
224
|
-
/**
|
|
225
|
-
* PRIVATE METHOD
|
|
226
|
-
* ------------------------------------------------------
|
|
227
|
-
*/
|
|
228
251
|
async expand() {
|
|
229
252
|
if (this.referenceEl && this.floatingEl) {
|
|
230
253
|
const lib = await balFloatingUi.load();
|
|
231
|
-
this.balPopoverPrepare.emit(this.inputId);
|
|
232
254
|
this.balWillAnimate.emit();
|
|
233
255
|
this.isExpanded = true;
|
|
234
256
|
this.popupCleanup = lib.autoUpdate(this.referenceEl, this.floatingEl, () => {
|
|
@@ -271,7 +293,7 @@ export class Date {
|
|
|
271
293
|
const block = BEM.block('date');
|
|
272
294
|
const blockIcon = block.element('icon');
|
|
273
295
|
const blockPopup = block.element('popup');
|
|
274
|
-
return (h(Host, { key: '
|
|
296
|
+
return (h(Host, { key: 'df763339a5267bc106d30ca6cc3d62bc75c8f05f', id: this.inputId, class: Object.assign({}, block.class()) }, h("bal-input-group", { key: '55d4f91e6b77f56f38274bb984be9dc21a54a5a4', invalid: this.invalid, readonly: this.readonly, disabled: this.disabled, ref: el => (this.referenceEl = el) }, h("bal-input-date", Object.assign({ key: 'bf2b5f66aaf62f45f01e42cdd3e236707094d9dd', 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: ev => this.handleFocus(ev), onBalBlur: ev => this.handleBlur(ev), 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": ariaBooleanToString(this.isExpanded) })) : ('')), h("div", { key: '828597483d6ccc05c8fa9059b7d64941d8edc3d8', 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: '781a4f0d0b8ebc2c8b05a883e9441f4483e25820', value: this.calendarValue, min: this.min, max: this.max, minYearProp: this.minYearProp, maxYearProp: this.maxYearProp, defaultDate: this.defaultDate, allowedDates: this.allowedDates, onBalChange: this.onCalendarChange }))));
|
|
275
297
|
}
|
|
276
298
|
static get is() { return "bal-date"; }
|
|
277
299
|
static get originalStyleUrls() {
|
|
@@ -692,6 +714,8 @@ export class Date {
|
|
|
692
714
|
}
|
|
693
715
|
static get states() {
|
|
694
716
|
return {
|
|
717
|
+
"isKeyboardMode": {},
|
|
718
|
+
"hasFocus": {},
|
|
695
719
|
"isExpanded": {},
|
|
696
720
|
"language": {},
|
|
697
721
|
"calendarValue": {},
|
|
@@ -859,24 +883,6 @@ export class Date {
|
|
|
859
883
|
}
|
|
860
884
|
}
|
|
861
885
|
}
|
|
862
|
-
}, {
|
|
863
|
-
"method": "balPopoverPrepare",
|
|
864
|
-
"name": "balPopoverPrepare",
|
|
865
|
-
"bubbles": true,
|
|
866
|
-
"cancelable": true,
|
|
867
|
-
"composed": true,
|
|
868
|
-
"docs": {
|
|
869
|
-
"tags": [{
|
|
870
|
-
"name": "internal",
|
|
871
|
-
"text": "- Use this to close unused popovers."
|
|
872
|
-
}],
|
|
873
|
-
"text": ""
|
|
874
|
-
},
|
|
875
|
-
"complexType": {
|
|
876
|
-
"original": "string",
|
|
877
|
-
"resolved": "string",
|
|
878
|
-
"references": {}
|
|
879
|
-
}
|
|
880
886
|
}];
|
|
881
887
|
}
|
|
882
888
|
static get methods() {
|
|
@@ -1081,33 +1087,6 @@ export class Date {
|
|
|
1081
1087
|
"methodName": "debounceChanged"
|
|
1082
1088
|
}];
|
|
1083
1089
|
}
|
|
1084
|
-
static get listeners() {
|
|
1085
|
-
return [{
|
|
1086
|
-
"name": "keydown",
|
|
1087
|
-
"method": "listenToKeydown",
|
|
1088
|
-
"target": "window",
|
|
1089
|
-
"capture": false,
|
|
1090
|
-
"passive": false
|
|
1091
|
-
}, {
|
|
1092
|
-
"name": "keyup",
|
|
1093
|
-
"method": "listenOnKeyup",
|
|
1094
|
-
"target": "window",
|
|
1095
|
-
"capture": false,
|
|
1096
|
-
"passive": false
|
|
1097
|
-
}, {
|
|
1098
|
-
"name": "click",
|
|
1099
|
-
"method": "listenOnclick",
|
|
1100
|
-
"target": "document",
|
|
1101
|
-
"capture": false,
|
|
1102
|
-
"passive": false
|
|
1103
|
-
}, {
|
|
1104
|
-
"name": "balPopoverPrepare",
|
|
1105
|
-
"method": "listenOnPopoverPrepare",
|
|
1106
|
-
"target": "document",
|
|
1107
|
-
"capture": false,
|
|
1108
|
-
"passive": false
|
|
1109
|
-
}];
|
|
1110
|
-
}
|
|
1111
1090
|
}
|
|
1112
1091
|
__decorate([
|
|
1113
1092
|
Logger('bal-date'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@media(hover: hover)and (pointer: fine){.bal-hint__icon:focus-visible:not(:active){box-shadow:var(--bal-focus-shadow) !important}}:root{--bal-hint-content-background: var(--bal-color-grey-2)}.bal-hint{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block}.bal-hint__icon{user-select:none;cursor:pointer}.bal-hint__icon:hover svg,.bal-hint__icon:hover g,.bal-hint__icon:hover path,.bal-hint__icon:hover circle{fill:var(--bal-color-light-blue-5)}.bal-hint__content{background:var(--bal-hint-content-background);display:flex;gap:1.5rem;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{flex:1}}.bal-hint__content__title{display:block;margin-bottom:1rem}.bal-hint__content__title__heading{font-family:var(--bal-title-font-family);font-weight:var(--bal-title-font-weight);font-size:var(--bal-text-size-x-large);line-height:var(--bal-line-height-x-large)}@media screen and (min-width: 769px),print{.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-tablet);line-height:var(--bal-line-height-tablet-x-large)}}@media screen and (min-width: 1024px){.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-desktop);line-height:var(--bal-line-height-desktop-x-large)}}@media screen and (min-width: 769px),print{.bal-hint__content__buttons--is-hidden-desktop{display:none !important}}.bal-hint__content__text__field{font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);line-height:var(--bal-text-line-height-text);font-size:var(--bal-text-size-normal)}.bal-hint__overlay__content{position:fixed;display:none;overflow:auto;top:0;left:0;right:0;bottom:0;z-index:var(--bal-z-index-popup)}.bal-hint__overlay__content--active{display:block}
|
|
1
|
+
@media(hover: hover)and (pointer: fine){.bal-hint__icon:focus-visible:not(:active){box-shadow:var(--bal-focus-shadow) !important}}:root{--bal-hint-content-background: var(--bal-color-grey-2)}.bal-hint{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block}.bal-hint__icon{user-select:none;cursor:pointer}.bal-hint__icon:hover svg,.bal-hint__icon:hover g,.bal-hint__icon:hover path,.bal-hint__icon:hover circle{fill:var(--bal-color-light-blue-5)}.bal-hint .bal-popup__container{z-index:var(--bal-z-index-popup);background:var(--bal-hint-content-background);width:auto;max-width:30rem;min-width:16.25rem}.bal-hint__content{background:var(--bal-hint-content-background);display:flex;gap:1.5rem;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{flex:1}}.bal-hint__content__title{display:block;margin-bottom:1rem}.bal-hint__content__title__heading{font-family:var(--bal-title-font-family);font-weight:var(--bal-title-font-weight);font-size:var(--bal-text-size-x-large);line-height:var(--bal-line-height-x-large)}@media screen and (min-width: 769px),print{.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-tablet);line-height:var(--bal-line-height-tablet-x-large)}}@media screen and (min-width: 1024px){.bal-hint__content__title__heading{font-size:var(--bal-text-size-x-large-desktop);line-height:var(--bal-line-height-desktop-x-large)}}@media screen and (min-width: 769px),print{.bal-hint__content__buttons--is-hidden-desktop{display:none !important}}.bal-hint__content__text__field{font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);line-height:var(--bal-text-line-height-text);font-size:var(--bal-text-size-normal)}.bal-hint__overlay__content{position:fixed;display:none;overflow:auto;top:0;left:0;right:0;bottom:0;z-index:var(--bal-z-index-popup)}.bal-hint__overlay__content--active{display:block}
|
|
@@ -9,7 +9,8 @@ import { isEnterKey, isSpaceKey } from "../../utils/keyboard";
|
|
|
9
9
|
export class Hint {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.bodyScrollHandler = new BalScrollHandler();
|
|
12
|
-
this.
|
|
12
|
+
this.componentId = `bal-hint-${hintIds++}`;
|
|
13
|
+
this.onPopupChange = (ev) => {
|
|
13
14
|
this.isActive = ev.detail;
|
|
14
15
|
preventDefault(ev);
|
|
15
16
|
};
|
|
@@ -74,8 +75,8 @@ export class Hint {
|
|
|
74
75
|
* Opens the hint box.
|
|
75
76
|
*/
|
|
76
77
|
async present() {
|
|
77
|
-
if (this.
|
|
78
|
-
this.
|
|
78
|
+
if (this.popupElement) {
|
|
79
|
+
this.popupElement.present();
|
|
79
80
|
}
|
|
80
81
|
if (this.isMobile) {
|
|
81
82
|
this.bodyScrollHandler.disable();
|
|
@@ -86,8 +87,8 @@ export class Hint {
|
|
|
86
87
|
* Closes the hint box.
|
|
87
88
|
*/
|
|
88
89
|
async dismiss() {
|
|
89
|
-
if (this.
|
|
90
|
-
this.
|
|
90
|
+
if (this.popupElement) {
|
|
91
|
+
this.popupElement.dismiss();
|
|
91
92
|
}
|
|
92
93
|
if (this.isMobile) {
|
|
93
94
|
this.bodyScrollHandler.enable();
|
|
@@ -104,10 +105,8 @@ export class Hint {
|
|
|
104
105
|
const elIcon = block.element('icon');
|
|
105
106
|
const elContent = block.element('content');
|
|
106
107
|
const elButtons = elContent.element('buttons');
|
|
107
|
-
const padding = this.isMobile ? 0 : 8;
|
|
108
|
-
const offsetY = this.isMobile ? 0 : 16;
|
|
109
108
|
const TriggerIcon = () => {
|
|
110
|
-
return (h("bal-icon", { class: Object.assign({}, elIcon.class()), "
|
|
109
|
+
return (h("bal-icon", { class: Object.assign({}, elIcon.class()), "bal-popup": this.componentId, "data-testid": "bal-hint-trigger", "aria-haspopup": "true", role: "button", name: "info-circle", tabindex: 0, onKeyDown: event => {
|
|
111
110
|
if (isEnterKey(event) || isSpaceKey(event)) {
|
|
112
111
|
event.preventDefault();
|
|
113
112
|
this.toggle();
|
|
@@ -117,15 +116,10 @@ export class Hint {
|
|
|
117
116
|
const HintContent = () => {
|
|
118
117
|
return (h("div", { class: Object.assign({}, elContent.class()), "data-testid": "bal-hint-content" }, h("div", { ref: el => (this.hintContentEl = el) }), h("bal-button-group", { class: Object.assign(Object.assign({}, elButtons.class()), elButtons.modifier('is-hidden-desktop').class(this.small)) }, h("bal-button", { "data-testid": "bal-hint-close", color: "info", onClick: () => this.dismiss() }, this.closeLabel ? this.closeLabel : this.innerCloseLabel))));
|
|
119
118
|
};
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
return (h("div", { class: Object.assign({}, elOverlay.class()) }, h(TriggerIcon, null), h("div", { class: Object.assign(Object.assign({}, elOverlay.element('content').class()), elOverlay.element('content').modifier('active').class(this.isActive)) }, h(HintContent, null))));
|
|
119
|
+
const Popup = () => {
|
|
120
|
+
return (h("div", { class: Object.assign({}, block.element('popup').class()) }, h(TriggerIcon, null), h("bal-popup", { id: this.componentId, placement: "right", ref: el => (this.popupElement = el), onBalChange: this.onPopupChange, variant: this.isMobile ? 'fullscreen' : 'popover', offset: this.isMobile ? 0 : 16 }, h("bal-popup-content", null, h(HintContent, null)))));
|
|
123
121
|
};
|
|
124
|
-
|
|
125
|
-
return (h("div", { class: Object.assign({}, block.element('popover').class()) }, h("bal-popover", { hint: true, position: "right", offsetX: 0, offsetY: offsetY, padding: padding, ref: el => (this.popoverElement = el), onBalChange: this.onPopoverChange }, h(TriggerIcon, null), h("bal-popover-content", { color: "grey" }, h(HintContent, null)))));
|
|
126
|
-
};
|
|
127
|
-
const HintElement = this.isMobile ? MobileOverlay : Popover;
|
|
128
|
-
return (h(Host, { class: Object.assign({}, block.class()) }, h(HintElement, null), h("div", { ref: el => (this.slotWrapperEl = el), style: { display: 'none' } }, h("slot", null))));
|
|
122
|
+
return (h(Host, { class: Object.assign({}, block.class()) }, h(Popup, null), h("div", { ref: el => (this.slotWrapperEl = el), style: { display: 'none' } }, h("slot", null))));
|
|
129
123
|
}
|
|
130
124
|
static get is() { return "bal-hint"; }
|
|
131
125
|
static get originalStyleUrls() {
|
|
@@ -286,3 +280,4 @@ __decorate([
|
|
|
286
280
|
__metadata("design:paramtypes", [Object]),
|
|
287
281
|
__metadata("design:returntype", Promise)
|
|
288
282
|
], Hint.prototype, "configChanged", null);
|
|
283
|
+
let hintIds = 0;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { Host, h, } from "@stencil/core";
|
|
3
3
|
import { BEM } from "../../utils/bem";
|
|
4
|
+
import { ListenToBreakpoints, balBreakpoints } from "../../utils/breakpoints";
|
|
5
|
+
import { balBrowser } from "../../utils/browser";
|
|
6
|
+
import { ListenToConfig, defaultConfig, } from "../../utils/config";
|
|
7
|
+
import { waitAfterIdleCallback, waitForComponent } from "../../utils/helpers";
|
|
4
8
|
import { Logger } from "../../utils/log";
|
|
5
9
|
import { ListenToMutation } from "../../utils/mutation";
|
|
6
|
-
import { ListenToBreakpoints, balBreakpoints } from "../../utils/breakpoints";
|
|
7
|
-
import { NavMetaLinkItem } from "./models/bal-nav-meta-link-item";
|
|
8
|
-
import { NavMetaButton } from "./models/bal-nav-meta-button";
|
|
9
10
|
import { BalScrollHandler } from "../../utils/scroll";
|
|
10
|
-
import { ListenToConfig, defaultConfig, } from "../../utils/config";
|
|
11
11
|
import { i18nNavBars } from "./bal-nav.i18n";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { NavMetaButton } from "./models/bal-nav-meta-button";
|
|
13
|
+
import { NavMetaLinkItem } from "./models/bal-nav-meta-link-item";
|
|
14
14
|
export class Nav {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.navId = `bal-nav-${NavIds++}`;
|
|
@@ -26,6 +26,9 @@ export function toNumber(value, decimalPoints = 0) {
|
|
|
26
26
|
if (checkIfValueIsStringAndDoesNotHaveGermanFormat(val)) {
|
|
27
27
|
val = val.split(getThousandSeparator()).join('').split('`').join('').split("'").join('');
|
|
28
28
|
}
|
|
29
|
+
if (typeof val === 'string') {
|
|
30
|
+
val = val.replace(getDecimalSeparator(), '.');
|
|
31
|
+
}
|
|
29
32
|
return decimalPoints === 0 ? parseInt(val, 10) : parseFloat(val);
|
|
30
33
|
}
|
|
31
34
|
export function toFixedNumber(value, decimalPoints = 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--bal-popup-backdrop-background: rgba(0,7,57,.8);--bal-popup-container-padding-top: 0;--bal-popup-container-padding-bottom: 0;--bal-popup-container-background: var(--bal-color-white);--bal-popup-variant-popover-max-width: auto;--bal-popup-variant-popover-radius: var(--bal-radius-large);--bal-popup-variant-popover-shadow: var(--bal-shadow-normal);--bal-popup-variant-drawer-radius: var(--bal-radius-large);--bal-popup-arrow-background: var(--bal-color-white)}.bal-popup{position:static;display:inline;z-index:var(--bal-z-index-popup)}.bal-popup__container{background:var(--bal-popup-container-background);display:none;visibility:hidden;padding-top:var(--bal-popup-container-padding-top);padding-bottom:var(--bal-popup-container-padding-bottom);flex-grow:1;margin:0 auto;position:relative;width:auto}.bal-popup__container--variant-popover{border-radius:var(--bal-popup-variant-popover-radius);box-shadow:var(--bal-popup-variant-popover-shadow);width:var(--bal-popup-variant-popover-max-width);position:absolute;top:0;left:0}.bal-popup__container--variant-fullscreen{position:fixed;margin:0;width:100%;min-width:100%;max-width:100% !important;min-height:var(--bal-app-height, 100%)}.bal-popup__container--variant-fullscreen .bal-popup__inner{padding-left:var(--bal-container-space);padding-right:var(--bal-container-space)}.bal-popup__container--variant-drawer{position:fixed;border-top-left-radius:var(--bal-popup-variant-drawer-radius);border-top-right-radius:var(--bal-popup-variant-drawer-radius);padding-left:var(--bal-container-space);padding-right:var(--bal-container-space);width:100%}.bal-popup__inner{overflow-y:auto;max-height:calc(var(--bal-app-height, 100%) - 4rem)}.bal-popup__inner__head{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bal-popup__inner__content{width:100%}.bal-popup__arrow{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;width:8px;height:8px;background:var(--bal-popup-arrow-background);transform:rotate(45deg);display:none;visibility:hidden}.bal-popup__backdrop{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:fixed;bottom:0;left:0;right:0;top:0;background-color:var(--bal-popup-backdrop-background);width:100vw;display:none;visibility:hidden}.bal-popup-variant-popover-trigger,.bal-popup-permanent-trigger{z-index:calc(var(--bal-z-index-popup) + 1) !important;position:relative !important}
|
|
1
|
+
:root{--bal-popup-backdrop-background: rgba(0,7,57,.8);--bal-popup-container-padding-top: 0;--bal-popup-container-padding-bottom: 0;--bal-popup-container-background: var(--bal-color-white);--bal-popup-variant-popover-max-width: auto;--bal-popup-variant-popover-radius: var(--bal-radius-large);--bal-popup-variant-popover-shadow: var(--bal-shadow-normal);--bal-popup-variant-drawer-radius: var(--bal-radius-large);--bal-popup-arrow-background: var(--bal-color-white)}.bal-popup{position:static;display:inline;z-index:var(--bal-z-index-popup)}.bal-popup__container{background:var(--bal-popup-container-background);display:none;visibility:hidden;padding-top:var(--bal-popup-container-padding-top);padding-bottom:var(--bal-popup-container-padding-bottom);flex-grow:1;margin:0 auto;position:relative;width:auto}.bal-popup__container--variant-popover{border-radius:var(--bal-popup-variant-popover-radius);box-shadow:var(--bal-popup-variant-popover-shadow);width:var(--bal-popup-variant-popover-max-width);position:absolute;top:0;left:0}.bal-popup__container--variant-fullscreen{position:fixed;margin:0;width:100%;min-width:100%;max-width:100% !important;min-height:var(--bal-app-height, 100%)}.bal-popup__container--variant-fullscreen .bal-popup__inner{padding-left:var(--bal-container-space);padding-right:var(--bal-container-space)}.bal-popup__container--variant-drawer{position:fixed;border-top-left-radius:var(--bal-popup-variant-drawer-radius);border-top-right-radius:var(--bal-popup-variant-drawer-radius);padding-left:var(--bal-container-space);padding-right:var(--bal-container-space);width:100%}.bal-popup__inner{overflow-y:auto;max-height:calc(var(--bal-app-height, 100%) - 4rem)}.bal-popup__inner__head{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bal-popup__inner__content{width:100%}.bal-popup__arrow{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;width:8px;height:8px;background:var(--bal-popup-arrow-background);transform:rotate(45deg);display:none;visibility:hidden}.bal-popup__backdrop{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:fixed;bottom:0;left:0;right:0;top:0;background-color:var(--bal-popup-backdrop-background);width:100vw;height:100vh;display:none;visibility:hidden}.bal-popup-variant-popover-trigger,.bal-popup-permanent-trigger{z-index:calc(var(--bal-z-index-popup) + 1) !important;position:relative !important}
|
|
@@ -45,7 +45,7 @@ export class Popup {
|
|
|
45
45
|
this.activeVariant = 'popover';
|
|
46
46
|
this.trigger = undefined;
|
|
47
47
|
this.lastTrigger = undefined;
|
|
48
|
-
this.minContainerWidth =
|
|
48
|
+
this.minContainerWidth = '16.25rem';
|
|
49
49
|
this.label = '';
|
|
50
50
|
this.reference = undefined;
|
|
51
51
|
this.variant = 'popover';
|
|
@@ -181,7 +181,7 @@ export class Popup {
|
|
|
181
181
|
async setMinWidth(value) {
|
|
182
182
|
if (this.containerEl) {
|
|
183
183
|
this.containerEl.style.minWidth = `${value}px`;
|
|
184
|
-
this.minContainerWidth = value
|
|
184
|
+
this.minContainerWidth = `${value}px`;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
@@ -310,7 +310,7 @@ export class Popup {
|
|
|
310
310
|
const innerBlock = block.element('inner');
|
|
311
311
|
const innerHeadBlock = innerBlock.element('head');
|
|
312
312
|
const innerContentBlock = innerBlock.element('content');
|
|
313
|
-
return (h(Host, { key: '
|
|
313
|
+
return (h(Host, { key: '42bff759d5df91ba386b0fef2c115534177b035f', class: Object.assign({}, block.class()), role: "dialog", "aria-hidden": `${this.presented !== true}`, "aria-modal": `${this.presented === true}`, "aria-presented": `${this.presented === true}`, "aria-labelledby": `${this.popupId}-heading` }, h("div", { key: 'c66537aede2f557a3ae4e368226f14251177e27a', class: Object.assign({}, backdropBlock.class()), ref: backdropEl => (this.backdropEl = backdropEl) }), h("div", { key: 'e93bf6f131e859126f4861deac80c761bae28d66', class: Object.assign(Object.assign({}, containerBlock.class()), containerBlock.modifier(`variant-${this.activeVariant}`).class()), ref: containerEl => (this.containerEl = containerEl), style: { minWidth: this.minContainerWidth } }, h("div", { key: 'fcffcfe49ec94f2e7843fdb11428efd2cf6124c5', class: Object.assign({}, arrowBlock.class()), ref: arrowEl => (this.arrowEl = arrowEl) }), h("bal-stack", { key: '182834344790fb5cb8018a3841b0be36f67132b0', layout: "vertical", px: this.activeVariant === 'popover' ? 'medium' : 'none', py: "medium", class: Object.assign({}, innerBlock.class()) }, this.label ? (h("bal-stack", { space: "auto", class: Object.assign({}, innerHeadBlock.class()) }, h("bal-heading", { "data-test": "bal-popup-label", level: "span", "visual-level": "large", id: `${this.popupId}-heading` }, this.label), this.activeClosable ? (h("bal-close", { "data-test": "bal-popup-close", tabindex: -1, onClick: () => this.onCloseClick() })) : (''))) : (''), h("div", { key: '1dca8c0e7d328b04cb73168ddb43ca111f4090f2', class: Object.assign({}, innerContentBlock.class()), ref: contentEl => (this.contentEl = contentEl), "data-test": "bal-popup-content" }, h("slot", { key: '1675cc733ec0eea4b56e28981a51570528947082' }))))));
|
|
314
314
|
}
|
|
315
315
|
static get is() { return "bal-popup"; }
|
|
316
316
|
static get originalStyleUrls() {
|
|
@@ -8,7 +8,7 @@ export const StepButton = ({ item, color, isMobile, clickable, onSelectTab }) =>
|
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
if (item.href) {
|
|
11
|
-
return (h("a", { role: "tab", class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
|
11
|
+
return (h("a", { role: "tab", class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bemEl.class()), bemEl.modifier(`color-${color}`).class()), bemEl.modifier('done').class(item.done)), bemEl.modifier('active').class(item.active)), bemEl.modifier('failed').class(item.failed)), bemEl.modifier('disabled').class(item.disabled)), bemEl.modifier('clickable').class(clickable)), bemEl.modifier('passed').class(item.passed)), { 'bal-focusable': !item.disabled && !item.invisible }), "data-label": item.label, "data-value": item.value, "data-index": item.index, "data-testid": "bal-steps-option", "aria-disabled": `${item.disabled}`, href: item.href, rel: item.rel, target: item.target, onClick: (ev) => onSelectTab(ev, item) }, h(StepIcon, { item: item, isMobile: isMobile }), h(StepLabel, { item: item })));
|
|
12
12
|
}
|
|
13
13
|
return (h("button", { role: "tab", class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bemEl.class()), bemEl.modifier(`color-${color}`).class()), bemEl.modifier('done').class(item.done)), bemEl.modifier('active').class(item.active)), bemEl.modifier('failed').class(item.failed)), bemEl.modifier('disabled').class(item.disabled)), bemEl.modifier('clickable').class(clickable)), bemEl.modifier('passed').class(item.passed)), { 'bal-focusable': !item.disabled && !item.invisible }), "data-label": item.label, "data-value": item.value, "data-index": item.index, "data-testid": "bal-steps-option", "aria-disabled": `${item.disabled}`, onClick: (ev) => onSelectTab(ev, item) }, h(StepIcon, { item: item, isMobile: isMobile }), h(StepLabel, { item: item })));
|
|
14
14
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { h, Host, } from "@stencil/core";
|
|
3
|
+
import { ListenToAnimation } from "../../utils/animation";
|
|
3
4
|
import { areArraysEqual } from "../../utils/array";
|
|
4
|
-
import {
|
|
5
|
-
import { defaultConfig, ListenToConfig } from "../../utils/config";
|
|
5
|
+
import { inheritAttributes } from "../../utils/attributes";
|
|
6
6
|
import { BEM } from "../../utils/bem";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { balBreakpoints, ListenToBreakpoints } from "../../utils/breakpoints";
|
|
8
|
+
import { defaultConfig, ListenToConfig } from "../../utils/config";
|
|
9
9
|
import { stopEventBubbling } from "../../utils/form-input";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { ListenToBreakpoints, balBreakpoints } from "../../utils/breakpoints";
|
|
10
|
+
import { debounce, debounceEvent, deepReady, hasParent, isDescendant, raf, rOnLoad, transitionEndAsync, waitAfterFramePaint, } from "../../utils/helpers";
|
|
11
|
+
import { Logger } from "../../utils/log";
|
|
13
12
|
import { ListenToMutation } from "../../utils/mutation";
|
|
14
13
|
import { ListenToResize } from "../../utils/resize";
|
|
15
|
-
import { TabNav } from "./components/tab-nav";
|
|
16
14
|
import { toKebabCase } from "../../utils/string";
|
|
17
|
-
import {
|
|
15
|
+
import { getComputedPadding, getWidthOfOverflowingChildren } from "../../utils/style";
|
|
18
16
|
import { ListenToSwipe } from "../../utils/swipe";
|
|
17
|
+
import { SwiperUtil } from "../../utils/swiper";
|
|
19
18
|
import { ListenToVisibility } from "../../utils/visibility";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
19
|
+
import { newBalTabOption } from "./bal-tab.util";
|
|
20
|
+
import { TabNav } from "./components/tab-nav";
|
|
21
|
+
import { TabSelect } from "./components/tab-select";
|
|
22
22
|
export class Tabs {
|
|
23
23
|
constructor() {
|
|
24
24
|
this.tabsId = `bal-tabs-${TabsIds++}`;
|
|
@@ -15,5 +15,13 @@ export const TabNav = ({ swiper, items, tabsId, isVertical, inNavbar, isMobile,
|
|
|
15
15
|
const Button = ({ item, index }) => (h(TabButton, { item: item, isLinkList: isLinkList, tabsId: tabsId, isFirst: index === 0, isLast: index === tabs.length - 1, isMobile: isMobile, isVertical: isVertical, iconPosition: iconPosition, spaceless: spaceless, inverted: inverted, accordion: accordion, isAccordionOpen: isAccordionOpen, context: context, isExpanded: expanded, clickable: clickable && !item.disabled, onSelectTab: onSelectTab, hasSubLabelInGroup: hasSubLabelInGroup, dimInactiveElements: dimInactiveElements }));
|
|
16
16
|
const NavOrDiv = isLinkList ? 'nav' : 'div';
|
|
17
17
|
const DivOrList = isLinkList ? 'ul' : 'div';
|
|
18
|
-
return (h("div", { class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bemEl.class()), bemEl.modifier('vertical').class(isVertical)), bemEl.modifier('full-height').class(isFullHeight)), bemEl.modifier(`vertical-col-${verticalColSize}`).class(isVertical)), swiper.cssSwiper()) }, h(NavOrDiv, { id: `${tabsId}-nav`, class: Object.assign(Object.assign(Object.assign({}, swiper.cssInnerSwiper()), navInnerEl.class()), navInnerEl.modifier(`full-height`).class(isFullHeight)), ref: el =>
|
|
18
|
+
return (h("div", { class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bemEl.class()), bemEl.modifier('vertical').class(isVertical)), bemEl.modifier('full-height').class(isFullHeight)), bemEl.modifier(`vertical-col-${verticalColSize}`).class(isVertical)), swiper.cssSwiper()) }, h(NavOrDiv, { id: `${tabsId}-nav`, class: Object.assign(Object.assign(Object.assign({}, swiper.cssInnerSwiper()), navInnerEl.class()), navInnerEl.modifier(`full-height`).class(isFullHeight)), ref: el => {
|
|
19
|
+
if (el) {
|
|
20
|
+
swiper.innerEl = el;
|
|
21
|
+
}
|
|
22
|
+
}, "aria-label": isLinkList ? ariaLabel : undefined }, h(DivOrList, { id: swiper.containerId, class: Object.assign(Object.assign(Object.assign(Object.assign({}, swiper.cssSwiperContainer()), navContainerEl.class()), navContainerEl.modifier(`vertical`).class(isVertical)), navContainerEl.modifier(`expanded`).class(expanded && !isVertical)), role: isLinkList ? undefined : 'tablist', "aria-label": isLinkList ? undefined : ariaLabel, ref: el => {
|
|
23
|
+
if (el) {
|
|
24
|
+
swiper.containerEl = el;
|
|
25
|
+
}
|
|
26
|
+
} }, tabs.map((tab, index) => (h(Button, { item: tab, index: index }))), h("div", { id: `${tabsId}-line`, class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, navLineEl.class()), navLineEl.modifier(`active`).class(lineActive)), navLineEl.modifier(`inverted`).class(inverted)), navLineEl.modifier(`animated`).class(animated)), navLineEl.modifier(`vertical`).class(isVertical)), navLineEl.modifier(`hidden`).class(lineHidden)) }), border ? (h("div", { id: `${tabsId}-border`, class: Object.assign(Object.assign(Object.assign({}, navBorderEl.class()), navBorderEl.modifier(`inverted`).class(inverted)), navBorderEl.modifier(`vertical`).class(isVertical)) })) : (''))), showSwiperControls ? swiper.renderControls() : ''));
|
|
19
27
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by .build/version.js
|
|
2
|
-
export const VERSION = '19.0
|
|
2
|
+
export const VERSION = '19.1.0';
|
|
@@ -50,6 +50,7 @@ export class BalScrollHandler {
|
|
|
50
50
|
enable() {
|
|
51
51
|
if (this.target) {
|
|
52
52
|
if (balBrowser.hasWindow && balBrowser.hasDocument) {
|
|
53
|
+
document.documentElement.style.overflow = '';
|
|
53
54
|
document.body.classList.remove('noscroll');
|
|
54
55
|
document.body.style.position = '';
|
|
55
56
|
document.body.style.top = '';
|
|
@@ -68,6 +69,7 @@ export class BalScrollHandler {
|
|
|
68
69
|
if (balBrowser.hasWindow && balBrowser.hasDocument) {
|
|
69
70
|
this.x = window.pageXOffset || document.documentElement.scrollLeft;
|
|
70
71
|
this.y = window.pageYOffset || document.documentElement.scrollTop;
|
|
72
|
+
document.documentElement.style.overflow = 'hidden';
|
|
71
73
|
document.body.classList.add('noscroll');
|
|
72
74
|
document.body.style.position = 'fixed';
|
|
73
75
|
document.body.style.top = `-${this.y}px`;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { BEM } from "../bem";
|
|
3
|
+
import { stopEventBubbling } from "../form-input";
|
|
2
4
|
import { addEventListener, debounce, isDescendant, raf, removeEventListener } from "../helpers";
|
|
5
|
+
import { isTabKey } from "../keyboard";
|
|
3
6
|
import { getComputedWidth } from "../style";
|
|
4
|
-
import { i18nSwiperControlLabel } from "./swiper.i18n";
|
|
5
|
-
import { SmallControl } from "./controls/small-control";
|
|
6
|
-
import { LargeControl } from "./controls/large-control";
|
|
7
7
|
import { DotControl } from "./controls/dot-control";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { LargeControl } from "./controls/large-control";
|
|
9
|
+
import { SmallControl } from "./controls/small-control";
|
|
10
|
+
import { i18nSwiperControlLabel } from "./swiper.i18n";
|
|
11
11
|
export class SwiperUtil {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.previousTransformValue = 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8d2a7ce7.js';
|
|
2
|
-
import { i as inheritAttributes } from './attributes-a3e70948.js';
|
|
3
2
|
import { a as ariaBooleanToString } from './aria-ea150568.js';
|
|
3
|
+
import { i as inheritAttributes } from './attributes-a3e70948.js';
|
|
4
4
|
import { m as rOnLoad } from './helpers-94c3fbac.js';
|
|
5
5
|
import { B as BEM } from './bem-8c7d2eb0.js';
|
|
6
6
|
import './browser-a8073d92.js';
|
|
@@ -12,6 +12,7 @@ const BalButtonStyle0 = balButtonCss;
|
|
|
12
12
|
const Button = class {
|
|
13
13
|
constructor(hostRef) {
|
|
14
14
|
registerInstance(this, hostRef);
|
|
15
|
+
this.balClick = createEvent(this, "balClick", 7);
|
|
15
16
|
this.balNavigate = createEvent(this, "balNavigate", 7);
|
|
16
17
|
this.balFocus = createEvent(this, "balFocus", 7);
|
|
17
18
|
this.balBlur = createEvent(this, "balBlur", 7);
|
|
@@ -24,8 +25,11 @@ const Button = class {
|
|
|
24
25
|
this.balBlur.emit();
|
|
25
26
|
};
|
|
26
27
|
this.onClick = (ev) => {
|
|
27
|
-
if (this.
|
|
28
|
-
this.
|
|
28
|
+
if (!this.disabled) {
|
|
29
|
+
this.balClick.emit(ev);
|
|
30
|
+
if (this.href !== undefined) {
|
|
31
|
+
this.balNavigate.emit(ev);
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
};
|
|
31
35
|
this.isLargestContentPaintDone = false;
|
|
@@ -62,15 +66,10 @@ const Button = class {
|
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
componentDidLoad() {
|
|
65
|
-
var _a;
|
|
66
69
|
rOnLoad(() => (this.isLargestContentPaintDone = true));
|
|
67
|
-
if (this.el.getAttribute('bal-popup') && !((_a = this.aria) === null || _a === void 0 ? void 0 : _a.haspopup)) {
|
|
68
|
-
this.aria = {
|
|
69
|
-
haspopup: 'true',
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
70
|
}
|
|
73
71
|
componentWillLoad() {
|
|
72
|
+
var _a;
|
|
74
73
|
this.inheritAttributes = inheritAttributes(this.el, [
|
|
75
74
|
'title',
|
|
76
75
|
'aria-label',
|
|
@@ -79,6 +78,11 @@ const Button = class {
|
|
|
79
78
|
'tabindex',
|
|
80
79
|
'aria-haspopup',
|
|
81
80
|
]);
|
|
81
|
+
if (this.el.hasAttribute('bal-popup') && !((_a = this.aria) === null || _a === void 0 ? void 0 : _a.haspopup)) {
|
|
82
|
+
this.aria = {
|
|
83
|
+
haspopup: 'true',
|
|
84
|
+
};
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
componentDidRender() {
|
|
84
88
|
this.balDidRender.emit();
|