@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,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { i as inheritAttributes } from './attributes.js';
|
|
3
2
|
import { a as ariaBooleanToString } from './aria.js';
|
|
3
|
+
import { i as inheritAttributes } from './attributes.js';
|
|
4
4
|
import { m as rOnLoad } from './helpers.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './bal-icon2.js';
|
|
6
6
|
import { d as defineCustomElement$1 } from './bal-spinner2.js';
|
|
@@ -12,6 +12,7 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super();
|
|
14
14
|
this.__registerHost();
|
|
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 = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
|
|
|
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 = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
|
|
|
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 = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
|
|
|
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();
|
|
@@ -205,7 +209,7 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
|
|
|
205
209
|
"noWrap": [4, "no-wrap"],
|
|
206
210
|
"name": [1],
|
|
207
211
|
"value": [8],
|
|
208
|
-
"aria": [
|
|
212
|
+
"aria": [1040],
|
|
209
213
|
"isLargestContentPaintDone": [32]
|
|
210
214
|
}, [[6, "click", "listenOnClick"]]]);
|
|
211
215
|
function defineCustomElement() {
|
package/components/bal-date.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { _ as __decorate, a as __metadata } from './tslib.es6.js';
|
|
3
|
-
import { i as
|
|
4
|
-
import {
|
|
5
|
-
import { L as Logger } from './log.js';
|
|
3
|
+
import { i as isEscapeKey } from './index.esm.js';
|
|
4
|
+
import { a as ariaBooleanToString } from './aria.js';
|
|
6
5
|
import { i as inheritAttributes } from './attributes.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { d as defaultBalAriaForm } from './form.js';
|
|
6
|
+
import { B as BEM } from './bem.js';
|
|
7
|
+
import { b as balBrowser } from './browser.js';
|
|
10
8
|
import { b as balFloatingUi } from './floating-ui.js';
|
|
11
|
-
import {
|
|
9
|
+
import { F as FOCUS_KEYS } from './focus-visible.js';
|
|
10
|
+
import { d as defaultBalAriaForm } from './form.js';
|
|
11
|
+
import { s as stopEventBubbling } from './form-input.js';
|
|
12
|
+
import { p as rIC, o as debounceEvent, l as addEventListener, r as removeEventListener, d as waitAfterIdleCallback } from './helpers.js';
|
|
13
|
+
import { L as Logger } from './log.js';
|
|
14
|
+
import { i as i18nBalDate } from './bal-date.i18n.js';
|
|
12
15
|
import { d as defineCustomElement$6 } from './bal-date-calendar2.js';
|
|
13
16
|
import { d as defineCustomElement$5 } from './bal-date-calendar-cell2.js';
|
|
14
17
|
import { d as defineCustomElement$4 } from './bal-icon2.js';
|
|
@@ -34,9 +37,44 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
34
37
|
this.balFocus = createEvent(this, "balFocus", 7);
|
|
35
38
|
this.balInputClick = createEvent(this, "balInputClick", 7);
|
|
36
39
|
this.balIconClick = createEvent(this, "balIconClick", 7);
|
|
37
|
-
this.balPopoverPrepare = createEvent(this, "balPopoverPrepare", 7);
|
|
38
40
|
this.inputId = `bal-da-${dateIds++}`;
|
|
39
41
|
this.inheritedAttributes = {};
|
|
42
|
+
/**
|
|
43
|
+
* LIFECYCLE
|
|
44
|
+
* ------------------------------------------------------
|
|
45
|
+
*/
|
|
46
|
+
this.hasConnected = false;
|
|
47
|
+
/**
|
|
48
|
+
* PRIVATE METHOD
|
|
49
|
+
* ------------------------------------------------------
|
|
50
|
+
*/
|
|
51
|
+
this.handleKeydown = (ev) => {
|
|
52
|
+
this.isKeyboardMode = FOCUS_KEYS.includes(ev.key);
|
|
53
|
+
};
|
|
54
|
+
this.handlePointerDown = () => {
|
|
55
|
+
this.isKeyboardMode = false;
|
|
56
|
+
};
|
|
57
|
+
this.handleOutsideClick = (ev) => {
|
|
58
|
+
if (this.isExpanded) {
|
|
59
|
+
if (!this.el.contains(ev.target)) {
|
|
60
|
+
this.isExpanded = false;
|
|
61
|
+
this.hasFocus = false;
|
|
62
|
+
rIC(() => this.balBlur.emit(ev));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
this.handleFocus = (ev) => {
|
|
67
|
+
stopEventBubbling(ev);
|
|
68
|
+
this.hasFocus = true;
|
|
69
|
+
this.balFocus.emit(ev.detail);
|
|
70
|
+
};
|
|
71
|
+
this.handleBlur = (ev) => {
|
|
72
|
+
stopEventBubbling(ev);
|
|
73
|
+
if (!this.isExpanded) {
|
|
74
|
+
this.hasFocus = false;
|
|
75
|
+
rIC(() => this.balBlur.emit(ev.detail));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
40
78
|
/**
|
|
41
79
|
* EVENT BINDING
|
|
42
80
|
* ------------------------------------------------------
|
|
@@ -60,6 +98,8 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
60
98
|
this.balChange.emit(this.value);
|
|
61
99
|
if (this.closeOnSelect) {
|
|
62
100
|
this.close();
|
|
101
|
+
this.hasFocus = false;
|
|
102
|
+
rIC(() => this.balBlur.emit());
|
|
63
103
|
}
|
|
64
104
|
};
|
|
65
105
|
this.onInputInput = (ev) => {
|
|
@@ -77,24 +117,22 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
77
117
|
this.value = ev.detail;
|
|
78
118
|
this.balChange.emit(this.value);
|
|
79
119
|
};
|
|
80
|
-
this.onInputFocus = (ev) => {
|
|
81
|
-
stopEventBubbling(ev);
|
|
82
|
-
this.balFocus.emit(ev.detail);
|
|
83
|
-
};
|
|
84
|
-
this.onInputBlur = (ev) => {
|
|
85
|
-
stopEventBubbling(ev);
|
|
86
|
-
this.balBlur.emit(ev.detail);
|
|
87
|
-
};
|
|
88
120
|
this.onKeyPress = async ({ detail }) => {
|
|
89
|
-
if (
|
|
121
|
+
if (detail && detail.key) {
|
|
90
122
|
if (this.isExpanded) {
|
|
91
|
-
|
|
123
|
+
if (detail.key === 'Tab' || isEscapeKey(detail) || isSpaceKey(detail)) {
|
|
124
|
+
await this.close();
|
|
125
|
+
}
|
|
92
126
|
}
|
|
93
127
|
else {
|
|
94
|
-
|
|
128
|
+
if (isSpaceKey(detail)) {
|
|
129
|
+
await this.open();
|
|
130
|
+
}
|
|
95
131
|
}
|
|
96
132
|
}
|
|
97
133
|
};
|
|
134
|
+
this.isKeyboardMode = false;
|
|
135
|
+
this.hasFocus = false;
|
|
98
136
|
this.isExpanded = false;
|
|
99
137
|
this.language = defaultConfig.language;
|
|
100
138
|
this.calendarValue = undefined;
|
|
@@ -129,43 +167,26 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
129
167
|
debounceChanged() {
|
|
130
168
|
this.balChange = debounceEvent(this.balChange, this.debounce);
|
|
131
169
|
}
|
|
132
|
-
/**
|
|
133
|
-
* LIFECYCLE
|
|
134
|
-
* ------------------------------------------------------
|
|
135
|
-
*/
|
|
136
170
|
connectedCallback() {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* LISTENERS
|
|
144
|
-
* ------------------------------------------------------
|
|
145
|
-
*/
|
|
146
|
-
async listenToKeydown(ev) {
|
|
147
|
-
if (this.isExpanded && (ev.key === 'Escape' || ev.key === 'Esc')) {
|
|
148
|
-
ev.preventDefault();
|
|
149
|
-
await this.close();
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
async listenOnKeyup(ev) {
|
|
153
|
-
// dismiss popup when focus next form control
|
|
154
|
-
if (ev.key === 'Tab' && !this.el.contains(document.activeElement) && this.isExpanded) {
|
|
155
|
-
await this.close();
|
|
171
|
+
if (balBrowser.hasDocument) {
|
|
172
|
+
addEventListener(document, 'keydown', this.handleKeydown);
|
|
173
|
+
addEventListener(document, 'touchstart', this.handlePointerDown);
|
|
174
|
+
addEventListener(document, 'mousedown', this.handlePointerDown);
|
|
175
|
+
addEventListener(document, 'click', this.handleOutsideClick);
|
|
156
176
|
}
|
|
177
|
+
this.hasConnected = true;
|
|
178
|
+
this.valueChanged();
|
|
157
179
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
180
|
+
disconnectedCallback() {
|
|
181
|
+
if (balBrowser.hasDocument) {
|
|
182
|
+
removeEventListener(document, 'keydown', this.handleKeydown);
|
|
183
|
+
removeEventListener(document, 'touchstart', this.handlePointerDown);
|
|
184
|
+
removeEventListener(document, 'mousedown', this.handlePointerDown);
|
|
185
|
+
removeEventListener(document, 'click', this.handleOutsideClick);
|
|
162
186
|
}
|
|
163
187
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (this.inputId !== ev.detail) {
|
|
167
|
-
await this.close();
|
|
168
|
-
}
|
|
188
|
+
componentWillLoad() {
|
|
189
|
+
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);
|
|
169
190
|
}
|
|
170
191
|
/**
|
|
171
192
|
* @internal define config for the component
|
|
@@ -215,8 +236,10 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
215
236
|
* `input.focus()`.
|
|
216
237
|
*/
|
|
217
238
|
async setFocus() {
|
|
218
|
-
|
|
219
|
-
|
|
239
|
+
if (this.inputEl && !this.disabled && !this.readonly) {
|
|
240
|
+
await waitAfterIdleCallback();
|
|
241
|
+
this.inputEl.focus();
|
|
242
|
+
}
|
|
220
243
|
}
|
|
221
244
|
/**
|
|
222
245
|
* Sets blur on the native `input` in `bal-input`. Use this method instead of the global
|
|
@@ -225,7 +248,10 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
225
248
|
*/
|
|
226
249
|
async setBlur() {
|
|
227
250
|
var _a;
|
|
228
|
-
(
|
|
251
|
+
if (this.inputEl && !this.disabled && !this.readonly) {
|
|
252
|
+
await waitAfterIdleCallback();
|
|
253
|
+
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.setBlur();
|
|
254
|
+
}
|
|
229
255
|
}
|
|
230
256
|
/**
|
|
231
257
|
* Returns the native `<input>` element used under the hood.
|
|
@@ -242,14 +268,9 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
242
268
|
this.ariaForm = Object.assign({}, ariaForm);
|
|
243
269
|
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.setAriaForm(ariaForm);
|
|
244
270
|
}
|
|
245
|
-
/**
|
|
246
|
-
* PRIVATE METHOD
|
|
247
|
-
* ------------------------------------------------------
|
|
248
|
-
*/
|
|
249
271
|
async expand() {
|
|
250
272
|
if (this.referenceEl && this.floatingEl) {
|
|
251
273
|
const lib = await balFloatingUi.load();
|
|
252
|
-
this.balPopoverPrepare.emit(this.inputId);
|
|
253
274
|
this.balWillAnimate.emit();
|
|
254
275
|
this.isExpanded = true;
|
|
255
276
|
this.popupCleanup = lib.autoUpdate(this.referenceEl, this.floatingEl, () => {
|
|
@@ -292,7 +313,7 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
292
313
|
const block = BEM.block('date');
|
|
293
314
|
const blockIcon = block.element('icon');
|
|
294
315
|
const blockPopup = block.element('popup');
|
|
295
|
-
return (h(Host, { key: '
|
|
316
|
+
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 }))));
|
|
296
317
|
}
|
|
297
318
|
get el() { return this; }
|
|
298
319
|
static get watchers() { return {
|
|
@@ -321,6 +342,8 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
321
342
|
"allowInvalidValue": [4, "allow-invalid-value"],
|
|
322
343
|
"debounce": [2],
|
|
323
344
|
"autoInvalidOff": [516, "auto-invalid-off"],
|
|
345
|
+
"isKeyboardMode": [32],
|
|
346
|
+
"hasFocus": [32],
|
|
324
347
|
"isExpanded": [32],
|
|
325
348
|
"language": [32],
|
|
326
349
|
"calendarValue": [32],
|
|
@@ -334,7 +357,7 @@ const Date = /*@__PURE__*/ proxyCustomElement(class Date extends HTMLElement {
|
|
|
334
357
|
"setBlur": [64],
|
|
335
358
|
"getInputElement": [64],
|
|
336
359
|
"setAriaForm": [64]
|
|
337
|
-
},
|
|
360
|
+
}, undefined, {
|
|
338
361
|
"value": ["valueChanged"],
|
|
339
362
|
"debounce": ["debounceChanged"]
|
|
340
363
|
}]);
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { B as BEM } from './bem.js';
|
|
3
|
-
import { d as defineCustomElement$
|
|
4
|
-
import { d as defineCustomElement$
|
|
3
|
+
import { d as defineCustomElement$c } from './bal-button2.js';
|
|
4
|
+
import { d as defineCustomElement$b } from './bal-button-group2.js';
|
|
5
|
+
import { d as defineCustomElement$a } from './bal-close2.js';
|
|
6
|
+
import { d as defineCustomElement$9 } from './bal-heading2.js';
|
|
5
7
|
import { d as defineCustomElement$8 } from './bal-hint2.js';
|
|
6
8
|
import { d as defineCustomElement$7 } from './bal-hint-text2.js';
|
|
7
9
|
import { d as defineCustomElement$6 } from './bal-hint-title2.js';
|
|
8
10
|
import { d as defineCustomElement$5 } from './bal-icon2.js';
|
|
9
|
-
import { d as defineCustomElement$4 } from './bal-
|
|
10
|
-
import { d as defineCustomElement$3 } from './bal-
|
|
11
|
-
import { d as defineCustomElement$2 } from './bal-
|
|
11
|
+
import { d as defineCustomElement$4 } from './bal-popup2.js';
|
|
12
|
+
import { d as defineCustomElement$3 } from './bal-spinner2.js';
|
|
13
|
+
import { d as defineCustomElement$2 } from './bal-stack2.js';
|
|
12
14
|
|
|
13
15
|
const FieldHint = /*@__PURE__*/ proxyCustomElement(class FieldHint extends HTMLElement {
|
|
14
16
|
constructor() {
|
|
@@ -31,7 +33,7 @@ function defineCustomElement$1() {
|
|
|
31
33
|
if (typeof customElements === "undefined") {
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
|
-
const components = ["bal-field-hint", "bal-button", "bal-button-group", "bal-hint", "bal-hint-text", "bal-hint-title", "bal-icon", "bal-
|
|
36
|
+
const components = ["bal-field-hint", "bal-button", "bal-button-group", "bal-close", "bal-heading", "bal-hint", "bal-hint-text", "bal-hint-title", "bal-icon", "bal-popup", "bal-spinner", "bal-stack"];
|
|
35
37
|
components.forEach(tagName => { switch (tagName) {
|
|
36
38
|
case "bal-field-hint":
|
|
37
39
|
if (!customElements.get(tagName)) {
|
|
@@ -40,10 +42,20 @@ function defineCustomElement$1() {
|
|
|
40
42
|
break;
|
|
41
43
|
case "bal-button":
|
|
42
44
|
if (!customElements.get(tagName)) {
|
|
43
|
-
defineCustomElement$
|
|
45
|
+
defineCustomElement$c();
|
|
44
46
|
}
|
|
45
47
|
break;
|
|
46
48
|
case "bal-button-group":
|
|
49
|
+
if (!customElements.get(tagName)) {
|
|
50
|
+
defineCustomElement$b();
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
case "bal-close":
|
|
54
|
+
if (!customElements.get(tagName)) {
|
|
55
|
+
defineCustomElement$a();
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
case "bal-heading":
|
|
47
59
|
if (!customElements.get(tagName)) {
|
|
48
60
|
defineCustomElement$9();
|
|
49
61
|
}
|
|
@@ -68,17 +80,17 @@ function defineCustomElement$1() {
|
|
|
68
80
|
defineCustomElement$5();
|
|
69
81
|
}
|
|
70
82
|
break;
|
|
71
|
-
case "bal-
|
|
83
|
+
case "bal-popup":
|
|
72
84
|
if (!customElements.get(tagName)) {
|
|
73
85
|
defineCustomElement$4();
|
|
74
86
|
}
|
|
75
87
|
break;
|
|
76
|
-
case "bal-
|
|
88
|
+
case "bal-spinner":
|
|
77
89
|
if (!customElements.get(tagName)) {
|
|
78
90
|
defineCustomElement$3();
|
|
79
91
|
}
|
|
80
92
|
break;
|
|
81
|
-
case "bal-
|
|
93
|
+
case "bal-stack":
|
|
82
94
|
if (!customElements.get(tagName)) {
|
|
83
95
|
defineCustomElement$2();
|
|
84
96
|
}
|
package/components/bal-hint2.js
CHANGED
|
@@ -3,18 +3,20 @@ import { _ as __decorate, a as __metadata } from './tslib.es6.js';
|
|
|
3
3
|
import { B as BEM } from './bem.js';
|
|
4
4
|
import { p as preventDefault } from './utils.js';
|
|
5
5
|
import { B as BalScrollHandler } from './scroll.js';
|
|
6
|
-
import { d as defineCustomElement$
|
|
7
|
-
import { d as defineCustomElement$
|
|
6
|
+
import { d as defineCustomElement$8 } from './bal-button2.js';
|
|
7
|
+
import { d as defineCustomElement$7 } from './bal-button-group2.js';
|
|
8
|
+
import { d as defineCustomElement$6 } from './bal-close2.js';
|
|
9
|
+
import { d as defineCustomElement$5 } from './bal-heading2.js';
|
|
8
10
|
import { d as defineCustomElement$4 } from './bal-icon2.js';
|
|
9
|
-
import { d as defineCustomElement$3 } from './bal-
|
|
10
|
-
import { d as defineCustomElement$2 } from './bal-
|
|
11
|
-
import { d as defineCustomElement$1 } from './bal-
|
|
12
|
-
import { b as balBreakpoints } from './breakpoints.subject.js';
|
|
11
|
+
import { d as defineCustomElement$3 } from './bal-popup2.js';
|
|
12
|
+
import { d as defineCustomElement$2 } from './bal-spinner2.js';
|
|
13
|
+
import { d as defineCustomElement$1 } from './bal-stack2.js';
|
|
13
14
|
import { L as ListenToBreakpoints } from './breakpoints.decorator.js';
|
|
15
|
+
import { b as balBreakpoints } from './breakpoints.subject.js';
|
|
14
16
|
import { L as ListenToConfig } from './config.decorator.js';
|
|
15
17
|
import { i as isEnterKey, a as isSpaceKey } from './keyboard.helpers.js';
|
|
16
18
|
|
|
17
|
-
const balHintCss = "@media (hover: hover)and (pointer: fine){.bal-hint__icon:focus-visible:not(:active){-webkit-box-shadow:var(--bal-focus-shadow) !important;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{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;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:-ms-flexbox;display:flex;gap:1.5rem;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{-ms-flex:1;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}";
|
|
19
|
+
const balHintCss = "@media (hover: hover)and (pointer: fine){.bal-hint__icon:focus-visible:not(:active){-webkit-box-shadow:var(--bal-focus-shadow) !important;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{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;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:-ms-flexbox;display:flex;gap:1.5rem;-ms-flex-direction:column;flex-direction:column}@media screen and (max-width: 768px){.bal-hint__content{padding:1.25rem;min-height:100%}.bal-hint__content>div{-ms-flex:1;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}";
|
|
18
20
|
const BalHintStyle0 = balHintCss;
|
|
19
21
|
|
|
20
22
|
const Hint = /*@__PURE__*/ proxyCustomElement(class Hint extends HTMLElement {
|
|
@@ -22,7 +24,8 @@ const Hint = /*@__PURE__*/ proxyCustomElement(class Hint extends HTMLElement {
|
|
|
22
24
|
super();
|
|
23
25
|
this.__registerHost();
|
|
24
26
|
this.bodyScrollHandler = new BalScrollHandler();
|
|
25
|
-
this.
|
|
27
|
+
this.componentId = `bal-hint-${hintIds++}`;
|
|
28
|
+
this.onPopupChange = (ev) => {
|
|
26
29
|
this.isActive = ev.detail;
|
|
27
30
|
preventDefault(ev);
|
|
28
31
|
};
|
|
@@ -87,8 +90,8 @@ const Hint = /*@__PURE__*/ proxyCustomElement(class Hint extends HTMLElement {
|
|
|
87
90
|
* Opens the hint box.
|
|
88
91
|
*/
|
|
89
92
|
async present() {
|
|
90
|
-
if (this.
|
|
91
|
-
this.
|
|
93
|
+
if (this.popupElement) {
|
|
94
|
+
this.popupElement.present();
|
|
92
95
|
}
|
|
93
96
|
if (this.isMobile) {
|
|
94
97
|
this.bodyScrollHandler.disable();
|
|
@@ -99,8 +102,8 @@ const Hint = /*@__PURE__*/ proxyCustomElement(class Hint extends HTMLElement {
|
|
|
99
102
|
* Closes the hint box.
|
|
100
103
|
*/
|
|
101
104
|
async dismiss() {
|
|
102
|
-
if (this.
|
|
103
|
-
this.
|
|
105
|
+
if (this.popupElement) {
|
|
106
|
+
this.popupElement.dismiss();
|
|
104
107
|
}
|
|
105
108
|
if (this.isMobile) {
|
|
106
109
|
this.bodyScrollHandler.enable();
|
|
@@ -117,10 +120,8 @@ const Hint = /*@__PURE__*/ proxyCustomElement(class Hint extends HTMLElement {
|
|
|
117
120
|
const elIcon = block.element('icon');
|
|
118
121
|
const elContent = block.element('content');
|
|
119
122
|
const elButtons = elContent.element('buttons');
|
|
120
|
-
const padding = this.isMobile ? 0 : 8;
|
|
121
|
-
const offsetY = this.isMobile ? 0 : 16;
|
|
122
123
|
const TriggerIcon = () => {
|
|
123
|
-
return (h("bal-icon", { class: Object.assign({}, elIcon.class()), "
|
|
124
|
+
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 => {
|
|
124
125
|
if (isEnterKey(event) || isSpaceKey(event)) {
|
|
125
126
|
event.preventDefault();
|
|
126
127
|
this.toggle();
|
|
@@ -130,15 +131,10 @@ const Hint = /*@__PURE__*/ proxyCustomElement(class Hint extends HTMLElement {
|
|
|
130
131
|
const HintContent = () => {
|
|
131
132
|
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))));
|
|
132
133
|
};
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
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))));
|
|
134
|
+
const Popup = () => {
|
|
135
|
+
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)))));
|
|
136
136
|
};
|
|
137
|
-
|
|
138
|
-
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)))));
|
|
139
|
-
};
|
|
140
|
-
const HintElement = this.isMobile ? MobileOverlay : Popover;
|
|
141
|
-
return (h(Host, { class: Object.assign({}, block.class()) }, h(HintElement, null), h("div", { ref: el => (this.slotWrapperEl = el), style: { display: 'none' } }, h("slot", null))));
|
|
137
|
+
return (h(Host, { class: Object.assign({}, block.class()) }, h(Popup, null), h("div", { ref: el => (this.slotWrapperEl = el), style: { display: 'none' } }, h("slot", null))));
|
|
142
138
|
}
|
|
143
139
|
get element() { return this; }
|
|
144
140
|
static get style() { return BalHintStyle0; }
|
|
@@ -165,11 +161,12 @@ __decorate([
|
|
|
165
161
|
__metadata("design:paramtypes", [Object]),
|
|
166
162
|
__metadata("design:returntype", Promise)
|
|
167
163
|
], Hint.prototype, "configChanged", null);
|
|
164
|
+
let hintIds = 0;
|
|
168
165
|
function defineCustomElement() {
|
|
169
166
|
if (typeof customElements === "undefined") {
|
|
170
167
|
return;
|
|
171
168
|
}
|
|
172
|
-
const components = ["bal-hint", "bal-button", "bal-button-group", "bal-
|
|
169
|
+
const components = ["bal-hint", "bal-button", "bal-button-group", "bal-close", "bal-heading", "bal-icon", "bal-popup", "bal-spinner", "bal-stack"];
|
|
173
170
|
components.forEach(tagName => { switch (tagName) {
|
|
174
171
|
case "bal-hint":
|
|
175
172
|
if (!customElements.get(tagName)) {
|
|
@@ -178,10 +175,20 @@ function defineCustomElement() {
|
|
|
178
175
|
break;
|
|
179
176
|
case "bal-button":
|
|
180
177
|
if (!customElements.get(tagName)) {
|
|
181
|
-
defineCustomElement$
|
|
178
|
+
defineCustomElement$8();
|
|
182
179
|
}
|
|
183
180
|
break;
|
|
184
181
|
case "bal-button-group":
|
|
182
|
+
if (!customElements.get(tagName)) {
|
|
183
|
+
defineCustomElement$7();
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case "bal-close":
|
|
187
|
+
if (!customElements.get(tagName)) {
|
|
188
|
+
defineCustomElement$6();
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
case "bal-heading":
|
|
185
192
|
if (!customElements.get(tagName)) {
|
|
186
193
|
defineCustomElement$5();
|
|
187
194
|
}
|
|
@@ -191,17 +198,17 @@ function defineCustomElement() {
|
|
|
191
198
|
defineCustomElement$4();
|
|
192
199
|
}
|
|
193
200
|
break;
|
|
194
|
-
case "bal-
|
|
201
|
+
case "bal-popup":
|
|
195
202
|
if (!customElements.get(tagName)) {
|
|
196
203
|
defineCustomElement$3();
|
|
197
204
|
}
|
|
198
205
|
break;
|
|
199
|
-
case "bal-
|
|
206
|
+
case "bal-spinner":
|
|
200
207
|
if (!customElements.get(tagName)) {
|
|
201
208
|
defineCustomElement$2();
|
|
202
209
|
}
|
|
203
210
|
break;
|
|
204
|
-
case "bal-
|
|
211
|
+
case "bal-stack":
|
|
205
212
|
if (!customElements.get(tagName)) {
|
|
206
213
|
defineCustomElement$1();
|
|
207
214
|
}
|