@sbb-esta/lyne-elements 1.4.0 → 1.6.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/alert/alert/alert.d.ts +22 -16
- package/alert/alert/alert.d.ts.map +1 -1
- package/alert/alert-group/alert-group.d.ts +1 -1
- package/alert/alert-group/alert-group.d.ts.map +1 -1
- package/alert/alert-group.js +31 -26
- package/alert/alert.js +45 -37
- package/checkbox/checkbox/checkbox.d.ts +5 -0
- package/checkbox/checkbox/checkbox.d.ts.map +1 -1
- package/checkbox/checkbox-panel/checkbox-panel.d.ts +5 -0
- package/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -1
- package/checkbox/checkbox-panel.js +28 -18
- package/checkbox/checkbox.js +26 -15
- package/checkbox/common/checkbox-common.d.ts +1 -3
- package/checkbox/common/checkbox-common.d.ts.map +1 -1
- package/checkbox/common.js +15 -24
- package/clock/clock.d.ts.map +1 -1
- package/clock.js +14 -14
- package/core/i18n/i18n.d.ts +2 -0
- package/core/i18n/i18n.d.ts.map +1 -1
- package/core/i18n.js +61 -49
- package/core/mixins/panel-mixin.d.ts +1 -0
- package/core/mixins/panel-mixin.d.ts.map +1 -1
- package/core/testing/wait-for-event.d.ts +2 -0
- package/core/testing/wait-for-event.d.ts.map +1 -0
- package/core/testing.d.ts +1 -0
- package/core/testing.d.ts.map +1 -1
- package/core/testing.js +49 -36
- package/custom-elements.json +701 -193
- package/development/alert/alert/alert.d.ts +22 -16
- package/development/alert/alert/alert.d.ts.map +1 -1
- package/development/alert/alert-group/alert-group.d.ts +1 -1
- package/development/alert/alert-group/alert-group.d.ts.map +1 -1
- package/development/alert/alert-group.js +16 -11
- package/development/alert/alert.js +65 -24
- package/development/checkbox/checkbox/checkbox.d.ts +5 -0
- package/development/checkbox/checkbox/checkbox.d.ts.map +1 -1
- package/development/checkbox/checkbox-panel/checkbox-panel.d.ts +5 -0
- package/development/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -1
- package/development/checkbox/checkbox-panel.js +13 -2
- package/development/checkbox/checkbox.js +13 -1
- package/development/checkbox/common/checkbox-common.d.ts +1 -3
- package/development/checkbox/common/checkbox-common.d.ts.map +1 -1
- package/development/checkbox/common.js +13 -17
- package/development/clock/clock.d.ts.map +1 -1
- package/development/clock.js +3 -2
- package/development/core/i18n/i18n.d.ts +2 -0
- package/development/core/i18n/i18n.d.ts.map +1 -1
- package/development/core/i18n.js +15 -1
- package/development/core/mixins/panel-mixin.d.ts +1 -0
- package/development/core/mixins/panel-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +1 -1
- package/development/core/testing/wait-for-event.d.ts +2 -0
- package/development/core/testing/wait-for-event.d.ts.map +1 -0
- package/development/core/testing.d.ts +1 -0
- package/development/core/testing.d.ts.map +1 -1
- package/development/core/testing.js +17 -1
- package/development/flip-card/flip-card/flip-card.d.ts +32 -0
- package/development/flip-card/flip-card/flip-card.d.ts.map +1 -0
- package/development/flip-card/flip-card/index.d.ts +2 -0
- package/development/flip-card/flip-card/index.d.ts.map +1 -0
- package/development/flip-card/flip-card-details/flip-card-details.d.ts +22 -0
- package/development/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -0
- package/development/flip-card/flip-card-details/index.d.ts +2 -0
- package/development/flip-card/flip-card-details/index.d.ts.map +1 -0
- package/development/flip-card/flip-card-details.d.ts +2 -0
- package/development/flip-card/flip-card-details.d.ts.map +1 -0
- package/development/flip-card/flip-card-details.js +105 -0
- package/development/flip-card/flip-card-summary/flip-card-summary.d.ts +22 -0
- package/development/flip-card/flip-card-summary/flip-card-summary.d.ts.map +1 -0
- package/development/flip-card/flip-card-summary/index.d.ts +2 -0
- package/development/flip-card/flip-card-summary/index.d.ts.map +1 -0
- package/development/flip-card/flip-card-summary.d.ts +2 -0
- package/development/flip-card/flip-card-summary.d.ts.map +1 -0
- package/development/flip-card/flip-card-summary.js +151 -0
- package/development/flip-card/flip-card.d.ts +2 -0
- package/development/flip-card/flip-card.d.ts.map +1 -0
- package/development/flip-card/flip-card.js +187 -0
- package/development/flip-card.d.ts +4 -0
- package/development/flip-card.d.ts.map +1 -0
- package/development/flip-card.js +4 -0
- package/development/icon/icon.d.ts +9 -1
- package/development/icon/icon.d.ts.map +1 -1
- package/development/icon.js +16 -2
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +2 -1
- package/development/navigation/navigation/navigation.d.ts.map +1 -1
- package/development/navigation/navigation.js +2 -1
- package/development/notification/notification.d.ts +4 -4
- package/development/notification.js +1 -1
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay.js +35 -17
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts +3 -3
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -1
- package/development/radio-button/radio-button-panel.js +1 -1
- package/development/status/status.d.ts +1 -1
- package/development/status/status.d.ts.map +1 -1
- package/development/status.js +39 -2
- package/development/toggle/toggle.js +1 -1
- package/development/visual-checkbox/visual-checkbox.d.ts +3 -0
- package/development/visual-checkbox/visual-checkbox.d.ts.map +1 -1
- package/development/visual-checkbox.js +11 -3
- package/flip-card/flip-card/flip-card.d.ts +32 -0
- package/flip-card/flip-card/flip-card.d.ts.map +1 -0
- package/flip-card/flip-card/index.d.ts +2 -0
- package/flip-card/flip-card/index.d.ts.map +1 -0
- package/flip-card/flip-card-details/flip-card-details.d.ts +22 -0
- package/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -0
- package/flip-card/flip-card-details/index.d.ts +2 -0
- package/flip-card/flip-card-details/index.d.ts.map +1 -0
- package/flip-card/flip-card-details.d.ts +2 -0
- package/flip-card/flip-card-details.d.ts.map +1 -0
- package/flip-card/flip-card-details.js +52 -0
- package/flip-card/flip-card-summary/flip-card-summary.d.ts +22 -0
- package/flip-card/flip-card-summary/flip-card-summary.d.ts.map +1 -0
- package/flip-card/flip-card-summary/index.d.ts +2 -0
- package/flip-card/flip-card-summary/index.d.ts.map +1 -0
- package/flip-card/flip-card-summary.d.ts +2 -0
- package/flip-card/flip-card-summary.d.ts.map +1 -0
- package/flip-card/flip-card-summary.js +41 -0
- package/flip-card/flip-card.d.ts +2 -0
- package/flip-card/flip-card.d.ts.map +1 -0
- package/flip-card/flip-card.js +58 -0
- package/flip-card.d.ts +4 -0
- package/flip-card.d.ts.map +1 -0
- package/flip-card.js +3 -0
- package/icon/icon.d.ts +9 -1
- package/icon/icon.d.ts.map +1 -1
- package/icon.js +71 -62
- package/index.d.ts +6 -0
- package/index.js +6 -0
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +3 -3
- package/navigation/navigation/navigation.d.ts.map +1 -1
- package/navigation/navigation.js +4 -4
- package/notification/notification.d.ts +4 -4
- package/overlay/overlay-base-element.d.ts.map +1 -1
- package/overlay.js +33 -33
- package/package.json +21 -1
- package/radio-button/radio-button-panel/radio-button-panel.d.ts +3 -3
- package/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -1
- package/status/status.d.ts +1 -1
- package/status/status.d.ts.map +1 -1
- package/status.js +17 -13
- package/toggle/toggle.js +1 -1
- package/visual-checkbox/visual-checkbox.d.ts +3 -0
- package/visual-checkbox/visual-checkbox.d.ts.map +1 -1
- package/visual-checkbox.js +23 -20
package/alert/alert/alert.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { CSSResultGroup,
|
|
2
|
-
import { LinkTargetType } from '../../core/base-elements.js';
|
|
1
|
+
import { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { LinkTargetType, SbbOpenCloseBaseElement } from '../../core/base-elements.js';
|
|
3
3
|
import { SbbTitleLevel } from '../../title.js';
|
|
4
4
|
|
|
5
|
-
declare const SbbAlertElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../icon.js').SbbIconNameMixinType> & typeof
|
|
5
|
+
declare const SbbAlertElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../icon.js').SbbIconNameMixinType> & typeof SbbOpenCloseBaseElement;
|
|
6
6
|
/**
|
|
7
7
|
* It displays messages which require user's attention.
|
|
8
8
|
*
|
|
9
9
|
* @slot - Use the unnamed slot to add content to the `sbb-alert`.
|
|
10
10
|
* @slot icon - Should be a `sbb-icon` which is displayed next to the title. Styling is optimized for icons of type HIM-CUS.
|
|
11
11
|
* @slot title - Title content.
|
|
12
|
-
* @event {CustomEvent<void>} willOpen - Emits when the
|
|
13
|
-
* @event {CustomEvent<void>} didOpen - Emits when the
|
|
12
|
+
* @event {CustomEvent<void>} willOpen - Emits when the opening animation starts.
|
|
13
|
+
* @event {CustomEvent<void>} didOpen - Emits when the opening animation ends.
|
|
14
|
+
* @event {CustomEvent<void>} willClose - Emits when the closing animation starts. Can be canceled.
|
|
15
|
+
* @event {CustomEvent<void>} didClose - Emits when the closing animation ends.
|
|
14
16
|
* @event {CustomEvent<void>} dismissalRequested - Emits when dismissal of an alert was requested.
|
|
15
17
|
*/
|
|
16
18
|
export declare class SbbAlertElement extends SbbAlertElement_base {
|
|
@@ -18,6 +20,8 @@ export declare class SbbAlertElement extends SbbAlertElement_base {
|
|
|
18
20
|
static readonly events: {
|
|
19
21
|
readonly willOpen: "willOpen";
|
|
20
22
|
readonly didOpen: "didOpen";
|
|
23
|
+
readonly willClose: "willClose";
|
|
24
|
+
readonly didClose: "didClose";
|
|
21
25
|
readonly dismissalRequested: "dismissalRequested";
|
|
22
26
|
};
|
|
23
27
|
/**
|
|
@@ -48,23 +52,25 @@ export declare class SbbAlertElement extends SbbAlertElement_base {
|
|
|
48
52
|
/** This will be forwarded as aria-label to the relevant nested element. */
|
|
49
53
|
accessibilityLabel: string | undefined;
|
|
50
54
|
/** The enabled animations. */
|
|
51
|
-
animation: 'open' | 'none';
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
private _willOpen;
|
|
57
|
-
/** Emits when the fade in animation ends and the button is displayed. */
|
|
58
|
-
private _didOpen;
|
|
59
|
-
/** Emits when dismissal of an alert was requested. */
|
|
55
|
+
animation: 'open' | 'close' | 'all' | 'none';
|
|
56
|
+
/**
|
|
57
|
+
* Emits when dismissal of an alert was requested.
|
|
58
|
+
* @deprecated
|
|
59
|
+
*/
|
|
60
60
|
private _dismissalRequested;
|
|
61
61
|
private _language;
|
|
62
62
|
protected firstUpdated(changedProperties: PropertyValues<this>): Promise<void>;
|
|
63
|
-
/** Requests dismissal of the alert.
|
|
63
|
+
/** Requests dismissal of the alert.
|
|
64
|
+
* @deprecated in favour of 'willClose' and 'didClose' events
|
|
65
|
+
*/
|
|
64
66
|
requestDismissal(): void;
|
|
65
67
|
/** Open the alert. */
|
|
66
|
-
|
|
68
|
+
open(): void;
|
|
69
|
+
/** Close the alert. */
|
|
70
|
+
close(): void;
|
|
67
71
|
private _onAnimationEnd;
|
|
72
|
+
private _handleOpening;
|
|
73
|
+
private _handleClosing;
|
|
68
74
|
protected render(): TemplateResult;
|
|
69
75
|
}
|
|
70
76
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/elements/alert/alert/alert.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/elements/alert/alert/alert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAiB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGnG,OAAO,EAAE,KAAK,cAAc,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAK3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAIpD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;;AAExB;;;;;;;;;;;GAWG;AACH,qBACa,eAAgB,SAAQ,oBAAyC;IAC5E,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAgC,MAAM;;;;;;MAM3B;IAEX;;;OAGG;IACgD,QAAQ,UAAS;IAEpE,mDAAmD;IACf,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAO;IAEhE;;;;OAIG;IACmD,QAAQ,EAAE,MAAM,CAAU;IAEhF,wBAAwB;IACyB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEvE,sFAAsF;IACvC,UAAU,EAAE,aAAa,CAAO;IAE/E,2BAA2B;IACqB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErE,0CAA0C;IACvB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5C,uCAAuC;IACpB,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;IAE/D,wEAAwE;IACrD,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3C,2EAA2E;IACpB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IAE9F,8BAA8B;IACM,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAS;IAEzF;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAGzB;IAEF,OAAO,CAAC,SAAS,CAAmC;cAE3B,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7F;;OAEG;IACI,gBAAgB,IAAI,IAAI;IAI/B,sBAAsB;IACf,IAAI,IAAI,IAAI;IAKnB,uBAAuB;IAChB,KAAK,IAAI,IAAI;IAMpB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,cAAc;cAMH,MAAM,IAAI,cAAc;CAqD5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF"}
|
|
@@ -34,8 +34,8 @@ export declare class SbbAlertGroupElement extends SbbAlertGroupElement_base {
|
|
|
34
34
|
/** Emits when `sbb-alert-group` becomes empty. */
|
|
35
35
|
private _empty;
|
|
36
36
|
private _abort;
|
|
37
|
-
private _removeAlert;
|
|
38
37
|
connectedCallback(): void;
|
|
38
|
+
private _alertClosed;
|
|
39
39
|
private _slotChanged;
|
|
40
40
|
protected render(): TemplateResult;
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/alert/alert-group/alert-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAW,MAAM,KAAK,CAAC;AAO1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;;AAKpD;;;;;;;GAOG;AACH,qBACa,oBAAqB,SAAQ,yBAA6B;IACrE,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;;MAGlB;IAEX;;;;;OAKG;IAEa,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAY;IAE7D,gFAAgF;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAEnF,wGAAwG;IAEjG,uBAAuB,EAAE,aAAa,CAAO;IAEpD,kDAAkD;IACzC,OAAO,CAAC,UAAU,CAAC,CAAU;IAEtC,gDAAgD;IAChD,OAAO,CAAC,gBAAgB,CAGtB;IAEF,kDAAkD;IAClD,OAAO,CAAC,MAAM,CAAiF;IAE/F,OAAO,CAAC,MAAM,CAAyC;
|
|
1
|
+
{"version":3,"file":"alert-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/alert/alert-group/alert-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAW,MAAM,KAAK,CAAC;AAO1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;;AAKpD;;;;;;;GAOG;AACH,qBACa,oBAAqB,SAAQ,yBAA6B;IACrE,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;;MAGlB;IAEX;;;;;OAKG;IAEa,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAY;IAE7D,gFAAgF;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAEnF,wGAAwG;IAEjG,uBAAuB,EAAE,aAAa,CAAO;IAEpD,kDAAkD;IACzC,OAAO,CAAC,UAAU,CAAC,CAAU;IAEtC,gDAAgD;IAChD,OAAO,CAAC,gBAAgB,CAGtB;IAEF,kDAAkD;IAClD,OAAO,CAAC,MAAM,CAAiF;IAE/F,OAAO,CAAC,MAAM,CAAyC;IAEvC,iBAAiB,IAAI,IAAI;IAezC,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,YAAY;cAaD,MAAM,IAAI,cAAc;CAe5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,iBAAiB,EAAE,oBAAoB,CAAC;KACzC;CACF"}
|
package/alert/alert-group.js
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as b, state as
|
|
3
|
-
import { html as c, unsafeStatic as
|
|
4
|
-
import { SbbConnectedAbortController as
|
|
5
|
-
import { EventEmitter as
|
|
6
|
-
import { SbbHydrationMixin as
|
|
7
|
-
import { SbbAlertElement as
|
|
8
|
-
const A =
|
|
9
|
-
var x = Object.defineProperty, E = Object.getOwnPropertyDescriptor, l = (e, t, i,
|
|
10
|
-
for (var
|
|
11
|
-
(n = e[a]) && (
|
|
12
|
-
return
|
|
1
|
+
import { css as u, LitElement as m, nothing as f } from "lit";
|
|
2
|
+
import { property as b, state as g, customElement as v } from "lit/decorators.js";
|
|
3
|
+
import { html as c, unsafeStatic as d } from "lit/static-html.js";
|
|
4
|
+
import { SbbConnectedAbortController as _ } from "../core/controllers.js";
|
|
5
|
+
import { EventEmitter as p } from "../core/eventing.js";
|
|
6
|
+
import { SbbHydrationMixin as y } from "../core/mixins.js";
|
|
7
|
+
import { SbbAlertElement as h } from "./alert.js";
|
|
8
|
+
const A = u`*,:before,:after{box-sizing:border-box}:host{--sbb-alert-group-gap: var(--sbb-spacing-fixed-3x);--sbb-alert-group-border-radius: var(--sbb-border-radius-4x);display:block}.sbb-alert-group{display:flex;flex-direction:column;gap:var(--sbb-alert-group-gap)}:host(:focus-visible:not([data-empty])){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);border-radius:var(--sbb-alert-group-border-radius)}.sbb-alert-group__title{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
9
|
+
var x = Object.defineProperty, E = Object.getOwnPropertyDescriptor, l = (e, t, i, o) => {
|
|
10
|
+
for (var r = o > 1 ? void 0 : o ? E(t, i) : t, a = e.length - 1, n; a >= 0; a--)
|
|
11
|
+
(n = e[a]) && (r = (o ? n(t, i, r) : n(r)) || r);
|
|
12
|
+
return o && r && x(t, i, r), r;
|
|
13
13
|
};
|
|
14
|
-
let s = class extends
|
|
14
|
+
let s = class extends y(m) {
|
|
15
15
|
constructor() {
|
|
16
|
-
super(...arguments), this.role = "status", this.accessibilityTitleLevel = "2", this._didDismissAlert = new
|
|
16
|
+
super(...arguments), this.role = "status", this.accessibilityTitleLevel = "2", this._didDismissAlert = new p(
|
|
17
17
|
this,
|
|
18
18
|
s.events.didDismissAlert
|
|
19
|
-
), this._empty = new
|
|
20
|
-
}
|
|
21
|
-
_removeAlert(e) {
|
|
22
|
-
var r;
|
|
23
|
-
const t = e.target, i = document.activeElement === t;
|
|
24
|
-
(r = t.parentNode) == null || r.removeChild(t), this._didDismissAlert.emit(t), i && (this.tabIndex = 0, this.focus(), this.addEventListener("blur", () => this.removeAttribute("tabindex"), {
|
|
25
|
-
once: !0
|
|
26
|
-
}));
|
|
19
|
+
), this._empty = new p(this, s.events.empty), this._abort = new _(this);
|
|
27
20
|
}
|
|
28
21
|
connectedCallback() {
|
|
29
22
|
super.connectedCallback();
|
|
30
23
|
const e = this._abort.signal;
|
|
31
|
-
this.addEventListener(
|
|
24
|
+
this.addEventListener(
|
|
25
|
+
h.events.dismissalRequested,
|
|
26
|
+
(t) => t.target.close(),
|
|
27
|
+
{
|
|
28
|
+
signal: e
|
|
29
|
+
}
|
|
30
|
+
), this.addEventListener(h.events.didClose, (t) => this._alertClosed(t), {
|
|
32
31
|
signal: e
|
|
33
32
|
});
|
|
34
33
|
}
|
|
34
|
+
_alertClosed(e) {
|
|
35
|
+
const t = e.target, i = document.activeElement === t;
|
|
36
|
+
this._didDismissAlert.emit(t), i && (this.tabIndex = 0, this.focus(), this.addEventListener("blur", () => this.removeAttribute("tabindex"), {
|
|
37
|
+
once: !0
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
35
40
|
_slotChanged(e) {
|
|
36
41
|
const t = this._hasAlerts;
|
|
37
42
|
this._hasAlerts = e.target.assignedElements().filter((i) => i instanceof Element && i.localName === "sbb-alert").length > 0, !this._hasAlerts && t && this._empty.emit(), this.toggleAttribute("data-empty", !this._hasAlerts);
|
|
@@ -40,9 +45,9 @@ let s = class extends _(m) {
|
|
|
40
45
|
const e = `h${this.accessibilityTitleLevel}`;
|
|
41
46
|
return c`
|
|
42
47
|
<div class="sbb-alert-group">
|
|
43
|
-
${this._hasAlerts ? c`<${
|
|
48
|
+
${this._hasAlerts ? c`<${d(e)} class="sbb-alert-group__title">
|
|
44
49
|
<slot name="accessibility-title">${this.accessibilityTitle}</slot>
|
|
45
|
-
</${
|
|
50
|
+
</${d(e)}>` : f}
|
|
46
51
|
<slot @slotchange=${(t) => this._slotChanged(t)}></slot>
|
|
47
52
|
</div>
|
|
48
53
|
`;
|
|
@@ -63,7 +68,7 @@ l([
|
|
|
63
68
|
b({ attribute: "accessibility-title-level" })
|
|
64
69
|
], s.prototype, "accessibilityTitleLevel", 2);
|
|
65
70
|
l([
|
|
66
|
-
|
|
71
|
+
g()
|
|
67
72
|
], s.prototype, "_hasAlerts", 2);
|
|
68
73
|
s = l([
|
|
69
74
|
v("sbb-alert-group")
|
package/alert/alert.js
CHANGED
|
@@ -1,49 +1,55 @@
|
|
|
1
|
-
import { css as m,
|
|
2
|
-
import { property as i, customElement as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { css as m, html as p, nothing as n } from "lit";
|
|
2
|
+
import { property as i, customElement as c } from "lit/decorators.js";
|
|
3
|
+
import { SbbOpenCloseBaseElement as g } from "../core/base-elements.js";
|
|
4
|
+
import { SbbLanguageController as h } from "../core/controllers.js";
|
|
5
|
+
import { EventEmitter as u } from "../core/eventing.js";
|
|
6
|
+
import { i18nFindOutMore as v, i18nCloseAlert as f } from "../core/i18n.js";
|
|
7
|
+
import { SbbIconNameMixin as _ } from "../icon.js";
|
|
7
8
|
import "../button/transparent-button.js";
|
|
8
9
|
import "../divider.js";
|
|
9
10
|
import "../link.js";
|
|
10
11
|
import "../title.js";
|
|
11
|
-
const y = m`*,:before,:after{box-sizing:border-box}:host{--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-alert-background-color: var(--sbb-color-midnight);--sbb-alert-border-radius: var(--sbb-border-radius-4x);--sbb-alert-color: var(--sbb-color-aluminium);--sbb-alert-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xs);--sbb-alert-icon-size: 1.25rem;--sbb-alert-close-icon-size: var(--sbb-size-icon-ui-small);--sbb-alert-close-icon-margin: var(--sbb-spacing-responsive-xxs);--sbb-alert-gap: var(--sbb-spacing-fixed-2x) var(--sbb-spacing-responsive-xs);--sbb-alert-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-6x) );display:block}@media (min-width: 52.5rem){:host{--sbb-alert-icon-size: 1.75rem}}@media (forced-colors: active){:host{outline:var(--sbb-border-width-1x) solid CanvasText;border-radius:var(--sbb-alert-border-radius)}}:host([animation=
|
|
12
|
-
var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, e = (s,
|
|
13
|
-
for (var a = o > 1 ? void 0 : o ? x(
|
|
14
|
-
(
|
|
15
|
-
return o && a && w(
|
|
12
|
+
const y = m`*,:before,:after{box-sizing:border-box}:host{--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-alert-background-color: var(--sbb-color-midnight);--sbb-alert-border-radius: var(--sbb-border-radius-4x);--sbb-alert-color: var(--sbb-color-aluminium);--sbb-alert-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xs);--sbb-alert-icon-size: 1.25rem;--sbb-alert-close-icon-size: var(--sbb-size-icon-ui-small);--sbb-alert-close-icon-margin: var(--sbb-spacing-responsive-xxs);--sbb-alert-gap: var(--sbb-spacing-fixed-2x) var(--sbb-spacing-responsive-xs);--sbb-alert-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-6x) );--sbb-alert-timing-function: ease-in;display:block}@media (min-width: 52.5rem){:host{--sbb-alert-icon-size: 1.75rem}}@media (forced-colors: active){:host{outline:var(--sbb-border-width-1x) solid CanvasText;border-radius:var(--sbb-alert-border-radius)}}:host([data-state=opening]:not([animation=open],[animation=all])){--sbb-disable-animation-time: .1ms;--sbb-disable-animation-zero-time: 0s}:host([data-state=closing]:not([animation=close],[animation=all])){--sbb-disable-animation-time: .1ms;--sbb-disable-animation-zero-time: 0s}:host([size=s]){--sbb-alert-gap: var(--sbb-spacing-fixed-1x) var(--sbb-spacing-responsive-xxs);--sbb-alert-close-icon-margin: var(--sbb-spacing-responsive-xxxs)}:host([size=l]){--sbb-alert-icon-size: var(--sbb-size-icon-ui-small)}@media (min-width: 52.5rem){:host([size=l]){--sbb-alert-icon-size: 2.125rem}}.sbb-alert__transition-wrapper{display:grid;grid-template-rows:0fr;opacity:0}:host(:is([data-state=opened],[data-state=closing])) .sbb-alert__transition-wrapper{grid-template-rows:1fr;opacity:1}:host([data-state=opening]) .sbb-alert__transition-wrapper{animation-name:open,open-opacity;animation-fill-mode:forwards;animation-duration:var(--sbb-alert-animation-duration);animation-timing-function:var(--sbb-alert-timing-function);animation-delay:0s,var(--sbb-alert-animation-duration)}:host([data-state=closing]) .sbb-alert__transition-wrapper{animation-name:close-opacity,close;animation-fill-mode:forwards;animation-duration:var(--sbb-alert-animation-duration);animation-timing-function:var(--sbb-alert-timing-function);animation-delay:0s,var(--sbb-disable-animation-zero-time, var(--sbb-animation-duration-2x))}.sbb-alert__transition-sub-wrapper{overflow:hidden}.sbb-alert{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:grid;grid-template-columns:1fr auto;align-items:center;gap:var(--sbb-alert-gap);min-width:fit-content;padding:var(--sbb-alert-padding);overflow:hidden;color:var(--sbb-alert-color);background-color:var(--sbb-alert-background-color);border-radius:var(--sbb-alert-border-radius)}@media (min-width: 37.5rem){.sbb-alert{grid-template-columns:auto 1fr auto;align-items:flex-start}}.sbb-alert__icon{display:flex;align-items:start;padding-block:var(--sbb-spacing-fixed-1x);min-width:var(--sbb-alert-icon-size);--sbb-icon-svg-width: var(--sbb-alert-icon-size);--sbb-icon-svg-height: var(--sbb-alert-icon-size)}.sbb-alert__content{order:3;grid-column:1/3}@media (min-width: 37.5rem){.sbb-alert__content{order:initial;grid-column-start:initial;grid-column-end:initial}}.sbb-alert__content-slot{display:inline;margin:0;padding:0}.sbb-alert__title{margin:0}.sbb-alert__close-button-wrapper{display:flex;justify-content:flex-end;align-items:center;height:100%}@media (min-width: 37.5rem){.sbb-alert__close-button{margin-inline-start:var(--sbb-alert-close-icon-margin)}}.sbb-alert__close-button-divider{display:none}@media (min-width: 37.5rem){.sbb-alert__close-button-divider{display:block;height:calc(100% - var(--sbb-spacing-fixed-1x) * 2)}}@keyframes open{0%{grid-template-rows:0fr}to{grid-template-rows:1fr}}@keyframes open-opacity{0%{opacity:0}to{opacity:1}}@keyframes close{0%{grid-template-rows:1fr}to{grid-template-rows:0fr}}@keyframes close-opacity{0%{opacity:1}to{opacity:0}}`;
|
|
13
|
+
var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, e = (s, r, l, o) => {
|
|
14
|
+
for (var a = o > 1 ? void 0 : o ? x(r, l) : r, b = s.length - 1, d; b >= 0; b--)
|
|
15
|
+
(d = s[b]) && (a = (o ? d(r, l, a) : d(a)) || a);
|
|
16
|
+
return o && a && w(r, l, a), a;
|
|
16
17
|
};
|
|
17
|
-
let t = class extends
|
|
18
|
+
let t = class extends _(g) {
|
|
18
19
|
constructor() {
|
|
19
|
-
super(...arguments), this.readonly = !1, this.size = "m", this.iconName = "info", this.titleLevel = "3", this.animation = "
|
|
20
|
+
super(...arguments), this.readonly = !1, this.size = "m", this.iconName = "info", this.titleLevel = "3", this.animation = "all", this._dismissalRequested = new u(
|
|
20
21
|
this,
|
|
21
22
|
t.events.dismissalRequested
|
|
22
|
-
), this._language = new
|
|
23
|
-
}
|
|
24
|
-
/** The state of the alert. */
|
|
25
|
-
get _state() {
|
|
26
|
-
return this.getAttribute("data-state") ?? "closed";
|
|
27
|
-
}
|
|
28
|
-
set _state(s) {
|
|
29
|
-
this.setAttribute("data-state", s);
|
|
23
|
+
), this._language = new h(this);
|
|
30
24
|
}
|
|
31
25
|
async firstUpdated(s) {
|
|
32
|
-
super.firstUpdated(s), this.
|
|
26
|
+
super.firstUpdated(s), this.open();
|
|
33
27
|
}
|
|
34
|
-
/** Requests dismissal of the alert.
|
|
28
|
+
/** Requests dismissal of the alert.
|
|
29
|
+
* @deprecated in favour of 'willClose' and 'didClose' events
|
|
30
|
+
*/
|
|
35
31
|
requestDismissal() {
|
|
36
32
|
this._dismissalRequested.emit();
|
|
37
33
|
}
|
|
38
34
|
/** Open the alert. */
|
|
39
|
-
|
|
40
|
-
this.
|
|
35
|
+
open() {
|
|
36
|
+
this.willOpen.emit(), this.state = "opening";
|
|
37
|
+
}
|
|
38
|
+
/** Close the alert. */
|
|
39
|
+
close() {
|
|
40
|
+
this.willClose.emit() && (this.state = "closing");
|
|
41
41
|
}
|
|
42
42
|
_onAnimationEnd(s) {
|
|
43
|
-
this.
|
|
43
|
+
this.state === "opening" && s.animationName === "open-opacity" ? this._handleOpening() : this.state === "closing" && s.animationName === "close" && this._handleClosing();
|
|
44
|
+
}
|
|
45
|
+
_handleOpening() {
|
|
46
|
+
this.state = "opened", this.didOpen.emit();
|
|
47
|
+
}
|
|
48
|
+
_handleClosing() {
|
|
49
|
+
this.state = "closed", this.didClose.emit(), setTimeout(() => this.remove());
|
|
44
50
|
}
|
|
45
51
|
render() {
|
|
46
|
-
return
|
|
52
|
+
return p`
|
|
47
53
|
<div class="sbb-alert__transition-wrapper" @animationend=${this._onAnimationEnd}>
|
|
48
54
|
<!-- sub wrapper needed to properly support fade in animation -->
|
|
49
55
|
<div class="sbb-alert__transition-sub-wrapper">
|
|
@@ -61,17 +67,17 @@ let t = class extends f(v) {
|
|
|
61
67
|
<p class="sbb-alert__content-slot">
|
|
62
68
|
<slot></slot>
|
|
63
69
|
</p>
|
|
64
|
-
${this.href ?
|
|
65
|
-
accessibility-label=${this.accessibilityLabel ??
|
|
66
|
-
href=${this.href ??
|
|
67
|
-
target=${this.target ??
|
|
68
|
-
rel=${this.rel ??
|
|
70
|
+
${this.href ? p` <sbb-link
|
|
71
|
+
accessibility-label=${this.accessibilityLabel ?? n}
|
|
72
|
+
href=${this.href ?? n}
|
|
73
|
+
target=${this.target ?? n}
|
|
74
|
+
rel=${this.rel ?? n}
|
|
69
75
|
negative
|
|
70
76
|
>
|
|
71
|
-
${this.linkContent ? this.linkContent :
|
|
72
|
-
</sbb-link>` :
|
|
77
|
+
${this.linkContent ? this.linkContent : v[this._language.current]}
|
|
78
|
+
</sbb-link>` : n}
|
|
73
79
|
</span>
|
|
74
|
-
${this.readonly ?
|
|
80
|
+
${this.readonly ? n : p`<span class="sbb-alert__close-button-wrapper">
|
|
75
81
|
<sbb-divider
|
|
76
82
|
orientation="vertical"
|
|
77
83
|
negative
|
|
@@ -82,7 +88,7 @@ let t = class extends f(v) {
|
|
|
82
88
|
size=${this.size === "l" ? "m" : this.size}
|
|
83
89
|
icon-name="cross-small"
|
|
84
90
|
@click=${() => this.requestDismissal()}
|
|
85
|
-
aria-label=${
|
|
91
|
+
aria-label=${f[this._language.current]}
|
|
86
92
|
class="sbb-alert__close-button"
|
|
87
93
|
></sbb-transparent-button>
|
|
88
94
|
</span>`}
|
|
@@ -96,6 +102,8 @@ t.styles = y;
|
|
|
96
102
|
t.events = {
|
|
97
103
|
willOpen: "willOpen",
|
|
98
104
|
didOpen: "didOpen",
|
|
105
|
+
willClose: "willClose",
|
|
106
|
+
didClose: "didClose",
|
|
99
107
|
dismissalRequested: "dismissalRequested"
|
|
100
108
|
};
|
|
101
109
|
e([
|
|
@@ -132,7 +140,7 @@ e([
|
|
|
132
140
|
i({ reflect: !0 })
|
|
133
141
|
], t.prototype, "animation", 2);
|
|
134
142
|
t = e([
|
|
135
|
-
|
|
143
|
+
c("sbb-alert")
|
|
136
144
|
], t);
|
|
137
145
|
export {
|
|
138
146
|
t as SbbAlertElement
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, CSSResultGroup, TemplateResult } from 'lit';
|
|
2
2
|
import { SbbIconPlacement } from '../../core/interfaces.js';
|
|
3
|
+
import { SbbCheckboxSize } from '../common.js';
|
|
3
4
|
|
|
4
5
|
declare const SbbCheckboxElement_base: import('../../core/mixins.js').Constructor<import('../common.js').SbbCheckboxCommonElementMixinType> & import('../../core/mixins.js').AbstractConstructor<import('../../icon.js').SbbIconNameMixinType> & typeof LitElement;
|
|
5
6
|
/**
|
|
@@ -16,6 +17,10 @@ export declare class SbbCheckboxElement extends SbbCheckboxElement_base {
|
|
|
16
17
|
static readonly events: {
|
|
17
18
|
readonly didChange: "didChange";
|
|
18
19
|
};
|
|
20
|
+
/** Size variant. */
|
|
21
|
+
set size(value: SbbCheckboxSize);
|
|
22
|
+
get size(): SbbCheckboxSize;
|
|
23
|
+
private _size;
|
|
19
24
|
/** The label position relative to the labelIcon. Defaults to end */
|
|
20
25
|
iconPlacement: SbbIconPlacement;
|
|
21
26
|
protected render(): TemplateResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AAItB,OAAO,0BAA0B,CAAC;;AAElC;;;;;;;;GAQG;AACH,qBAEa,kBAAmB,SAAQ,uBAEvC;IACC,OAAuB,MAAM,EAAE,cAAc,CAAwC;IAErF,gBAAuB,MAAM;;MAElB;IAEX,oBAAoB;IACpB,IACW,IAAI,CAAC,KAAK,EAAE,eAAe,EAErC;IACD,IAAW,IAAI,IAAI,eAAe,CAEjC;IACD,OAAO,CAAC,KAAK,CAAwB;IAErC,oEAAoE;IAE7D,aAAa,EAAE,gBAAgB,CAAS;cAE5B,MAAM,IAAI,cAAc;CAwB5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,cAAc,EAAE,kBAAkB,CAAC;KACpC;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSResultGroup, LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import { EventEmitter } from '../../core/eventing.js';
|
|
3
3
|
import { SbbCheckedStateChange, SbbDisabledStateChange, SbbStateChange } from '../../core/interfaces/types.js';
|
|
4
|
+
import { SbbPanelSize } from '../../core/mixins.js';
|
|
4
5
|
|
|
5
6
|
export type SbbCheckboxPanelStateChange = Extract<SbbStateChange, SbbDisabledStateChange | SbbCheckedStateChange>;
|
|
6
7
|
declare const SbbCheckboxPanelElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbPanelMixinType> & import('../../core/mixins.js').Constructor<import('../common.js').SbbCheckboxCommonElementMixinType> & import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbUpdateSchedulerMixinType> & typeof LitElement;
|
|
@@ -22,6 +23,10 @@ export declare class SbbCheckboxPanelElement extends SbbCheckboxPanelElement_bas
|
|
|
22
23
|
readonly stateChange: "stateChange";
|
|
23
24
|
readonly panelConnected: "panelConnected";
|
|
24
25
|
};
|
|
26
|
+
/** Size variant. */
|
|
27
|
+
set size(value: SbbPanelSize);
|
|
28
|
+
get size(): SbbPanelSize;
|
|
29
|
+
private _size;
|
|
25
30
|
/**
|
|
26
31
|
* @internal
|
|
27
32
|
* Internal event that emits whenever the state of the checkbox
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-panel.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox-panel/checkbox-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAIb,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACf,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"checkbox-panel.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox-panel/checkbox-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAIb,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAElC,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,cAAc,EACd,sBAAsB,GAAG,qBAAqB,CAC/C,CAAC;;AAEF;;;;;;;;;;GAUG;AACH,qBAEa,uBAAwB,SAAQ,4BAE5C;IACC,OAAuB,MAAM,EAAE,cAAc,CAA2C;IAGxF,gBAAuB,MAAM;;;;MAIlB;IAEX,oBAAoB;IACpB,IACW,IAAI,CAAC,KAAK,EAAE,YAAY,EAElC;IACD,IAAW,IAAI,IAAI,YAAY,CAE9B;IACD,OAAO,CAAC,KAAK,CAAqB;IAElC;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,YAAY,CAAC,2BAA2B,CAAC,CAI9D;cAEuB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;cAkBxE,MAAM,IAAI,cAAc;CA8B5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,oBAAoB,EAAE,uBAAuB,CAAC;KAC/C;CACF"}
|
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { customElement as d } from "lit/decorators.js";
|
|
3
|
-
import { slotState as
|
|
4
|
-
import { EventEmitter as
|
|
5
|
-
import { SbbPanelMixin as
|
|
6
|
-
import { SbbCheckboxCommonElementMixin as
|
|
1
|
+
import { LitElement as h, html as o, nothing as r } from "lit";
|
|
2
|
+
import { property as p, customElement as d } from "lit/decorators.js";
|
|
3
|
+
import { slotState as m } from "../core/decorators.js";
|
|
4
|
+
import { EventEmitter as u } from "../core/eventing.js";
|
|
5
|
+
import { SbbPanelMixin as x, SbbUpdateSchedulerMixin as f, panelCommonStyle as g } from "../core/mixins.js";
|
|
6
|
+
import { SbbCheckboxCommonElementMixin as _, checkboxCommonStyle as k } from "./common.js";
|
|
7
7
|
import "../screen-reader-only.js";
|
|
8
8
|
import "../visual-checkbox.js";
|
|
9
|
-
var C = Object.defineProperty,
|
|
10
|
-
for (var s =
|
|
11
|
-
(
|
|
12
|
-
return
|
|
9
|
+
var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor, c = (e, i, n, a) => {
|
|
10
|
+
for (var s = a > 1 ? void 0 : a ? v(i, n) : i, l = e.length - 1, b; l >= 0; l--)
|
|
11
|
+
(b = e[l]) && (s = (a ? b(i, n, s) : b(s)) || s);
|
|
12
|
+
return a && s && C(i, n, s), s;
|
|
13
13
|
};
|
|
14
|
-
let t = class extends
|
|
15
|
-
|
|
14
|
+
let t = class extends x(
|
|
15
|
+
_(f(h))
|
|
16
16
|
) {
|
|
17
17
|
constructor() {
|
|
18
|
-
super(...arguments), this.stateChange = new
|
|
18
|
+
super(...arguments), this._size = "m", this.stateChange = new u(
|
|
19
19
|
this,
|
|
20
20
|
t.events.stateChange,
|
|
21
21
|
{ bubbles: !0 }
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
+
set size(e) {
|
|
25
|
+
this._size = e;
|
|
26
|
+
}
|
|
27
|
+
get size() {
|
|
28
|
+
var e;
|
|
29
|
+
return (e = this.group) != null && e.size ? this.group.size === "xs" ? "s" : this.group.size : this._size;
|
|
30
|
+
}
|
|
24
31
|
async willUpdate(e) {
|
|
25
32
|
super.willUpdate(e), e.has("checked") && (this.toggleAttribute("data-checked", this.checked), this.checked !== e.get("checked") && this.stateChange.emit({ type: "checked", checked: this.checked })), e.has("disabled") && this.disabled !== e.get("disabled") && this.stateChange.emit({ type: "disabled", disabled: this.disabled });
|
|
26
33
|
}
|
|
27
34
|
render() {
|
|
28
|
-
return
|
|
35
|
+
return o`
|
|
29
36
|
<span class="sbb-selection-panel">
|
|
30
37
|
<div class="sbb-selection-panel__badge">
|
|
31
38
|
<slot name="badge"></slot>
|
|
@@ -46,22 +53,25 @@ let t = class extends m(
|
|
|
46
53
|
</span>
|
|
47
54
|
</span>
|
|
48
55
|
<slot name="subtext"></slot>
|
|
49
|
-
${this.expansionState ?
|
|
56
|
+
${this.expansionState ? o`<sbb-screen-reader-only>${this.expansionState}</sbb-screen-reader-only>` : r}
|
|
50
57
|
</span>
|
|
51
58
|
</span>
|
|
52
59
|
</span>
|
|
53
60
|
`;
|
|
54
61
|
}
|
|
55
62
|
};
|
|
56
|
-
t.styles = [
|
|
63
|
+
t.styles = [k, g];
|
|
57
64
|
t.events = {
|
|
58
65
|
didChange: "didChange",
|
|
59
66
|
stateChange: "stateChange",
|
|
60
67
|
panelConnected: "panelConnected"
|
|
61
68
|
};
|
|
62
|
-
|
|
69
|
+
c([
|
|
70
|
+
p({ reflect: !0 })
|
|
71
|
+
], t.prototype, "size", 1);
|
|
72
|
+
t = c([
|
|
63
73
|
d("sbb-checkbox-panel"),
|
|
64
|
-
|
|
74
|
+
m()
|
|
65
75
|
], t);
|
|
66
76
|
export {
|
|
67
77
|
t as SbbCheckboxPanelElement
|
package/checkbox/checkbox.js
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as r, LitElement as h, html as p } from "lit";
|
|
2
|
+
import { property as l, customElement as m } from "lit/decorators.js";
|
|
3
3
|
import { slotState as d } from "../core/decorators.js";
|
|
4
4
|
import { SbbIconNameMixin as x } from "../icon.js";
|
|
5
|
-
import { SbbCheckboxCommonElementMixin as
|
|
5
|
+
import { SbbCheckboxCommonElementMixin as u, checkboxCommonStyle as f } from "./common.js";
|
|
6
6
|
import "../visual-checkbox.js";
|
|
7
|
-
const _ =
|
|
8
|
-
var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor,
|
|
9
|
-
for (var
|
|
10
|
-
(b =
|
|
11
|
-
return
|
|
7
|
+
const _ = r`:host{outline:none!important;display:inline-block}.sbb-checkbox__label--icon{color:var(--sbb-checkbox-label-icon-color)}:host([icon-placement=end]) .sbb-checkbox__label--icon{margin-inline-start:auto}:host(:not([icon-name],[data-slot-names~=icon])) .sbb-checkbox__label--icon{display:none}:host(:is([icon-name],[data-slot-names~=icon]):not([icon-placement=end])) .sbb-checkbox__label--icon{padding-inline-end:var(--sbb-spacing-fixed-2x)}:host(:is([icon-name],[data-slot-names~=icon])[icon-placement=end]) .sbb-checkbox__label--icon{padding-inline-start:var(--sbb-spacing-fixed-2x)}:host(:focus-visible:not([data-focus-origin=mouse],[data-focus-origin=touch])) .sbb-checkbox-wrapper{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);border-radius:calc(var(--sbb-border-radius-4x) - var(--sbb-focus-outline-offset))}:host([icon-placement=start]) .sbb-checkbox__label{flex-direction:row-reverse;justify-content:flex-end}:host([icon-placement=end]) .sbb-checkbox__label{justify-content:flex-start;flex-grow:1}`;
|
|
8
|
+
var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor, a = (e, n, c, t) => {
|
|
9
|
+
for (var s = t > 1 ? void 0 : t ? v(n, c) : n, i = e.length - 1, b; i >= 0; i--)
|
|
10
|
+
(b = e[i]) && (s = (t ? b(n, c, s) : b(s)) || s);
|
|
11
|
+
return t && s && k(n, c, s), s;
|
|
12
12
|
};
|
|
13
|
-
let o = class extends
|
|
14
|
-
x(
|
|
13
|
+
let o = class extends u(
|
|
14
|
+
x(h)
|
|
15
15
|
) {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(...arguments), this.iconPlacement = "end";
|
|
17
|
+
super(...arguments), this._size = "m", this.iconPlacement = "end";
|
|
18
|
+
}
|
|
19
|
+
set size(e) {
|
|
20
|
+
this._size = e;
|
|
21
|
+
}
|
|
22
|
+
get size() {
|
|
23
|
+
var e;
|
|
24
|
+
return ((e = this.group) == null ? void 0 : e.size) ?? this._size;
|
|
18
25
|
}
|
|
19
26
|
render() {
|
|
20
27
|
return p`
|
|
@@ -26,6 +33,7 @@ let o = class extends f(
|
|
|
26
33
|
?checked=${this.checked}
|
|
27
34
|
?indeterminate=${this.indeterminate}
|
|
28
35
|
?disabled=${this.disabled || this.formDisabled}
|
|
36
|
+
size=${this.size}
|
|
29
37
|
></sbb-visual-checkbox>
|
|
30
38
|
</span>
|
|
31
39
|
<span class="sbb-checkbox__label">
|
|
@@ -40,14 +48,17 @@ let o = class extends f(
|
|
|
40
48
|
`;
|
|
41
49
|
}
|
|
42
50
|
};
|
|
43
|
-
o.styles = [
|
|
51
|
+
o.styles = [f, _];
|
|
44
52
|
o.events = {
|
|
45
53
|
didChange: "didChange"
|
|
46
54
|
};
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
a([
|
|
56
|
+
l({ reflect: !0 })
|
|
57
|
+
], o.prototype, "size", 1);
|
|
58
|
+
a([
|
|
59
|
+
l({ attribute: "icon-placement", reflect: !0 })
|
|
49
60
|
], o.prototype, "iconPlacement", 2);
|
|
50
|
-
o =
|
|
61
|
+
o = a([
|
|
51
62
|
m("sbb-checkbox"),
|
|
52
63
|
d()
|
|
53
64
|
], o);
|
|
@@ -2,11 +2,9 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
import { Constructor, SbbDisabledMixinType, SbbFormAssociatedCheckboxMixinType, SbbRequiredMixinType } from '../../core/mixins.js';
|
|
3
3
|
import { SbbCheckboxGroupElement } from '../checkbox-group.js';
|
|
4
4
|
|
|
5
|
-
export type SbbCheckboxSize = 's' | 'm';
|
|
5
|
+
export type SbbCheckboxSize = 'xs' | 's' | 'm';
|
|
6
6
|
export declare class SbbCheckboxCommonElementMixinType extends SbbFormAssociatedCheckboxMixinType implements Partial<SbbDisabledMixinType>, Partial<SbbRequiredMixinType> {
|
|
7
7
|
indeterminate: boolean;
|
|
8
|
-
set size(value: SbbCheckboxSize);
|
|
9
|
-
get size(): SbbCheckboxSize;
|
|
10
8
|
get group(): SbbCheckboxGroupElement | null;
|
|
11
9
|
}
|
|
12
10
|
export declare const SbbCheckboxCommonElementMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<SbbCheckboxCommonElementMixinType> & T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-common.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/common/checkbox-common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAGtD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAEzB,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG,GAAG,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"checkbox-common.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/common/checkbox-common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAGtD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAEzB,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,iCACnB,SAAQ,kCACR,YAAW,OAAO,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAEhE,aAAa,EAAE,OAAO,CAAC;IAE9B,IAAW,KAAK,IAAI,uBAAuB,GAAG,IAAI,CAAC;CACpD;AAGD,eAAO,MAAM,6BAA6B,GAAI,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,cACjE,CAAC,KACZ,WAAW,CAAC,iCAAiC,CAAC,GAAG,CA6CnD,CAAC"}
|
package/checkbox/common.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
import { property as
|
|
1
|
+
import { property as n } from "lit/decorators.js";
|
|
2
2
|
import { SbbFormAssociatedCheckboxMixin as a } from "../core/mixins.js";
|
|
3
|
-
import { css as
|
|
4
|
-
var
|
|
5
|
-
for (var
|
|
6
|
-
(
|
|
7
|
-
return
|
|
3
|
+
import { css as c } from "lit";
|
|
4
|
+
var l = Object.defineProperty, h = (s, o, b, e) => {
|
|
5
|
+
for (var t = void 0, i = s.length - 1, r; i >= 0; i--)
|
|
6
|
+
(r = s[i]) && (t = r(o, b, t) || t);
|
|
7
|
+
return t && l(o, b, t), t;
|
|
8
8
|
};
|
|
9
|
-
const
|
|
10
|
-
class
|
|
9
|
+
const d = (s) => {
|
|
10
|
+
class o extends a(s) {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(...arguments), this.indeterminate = !1, this.
|
|
13
|
-
}
|
|
14
|
-
set size(e) {
|
|
15
|
-
this._size = e;
|
|
16
|
-
}
|
|
17
|
-
get size() {
|
|
18
|
-
var e;
|
|
19
|
-
return ((e = this.group) == null ? void 0 : e.size) ?? this._size;
|
|
12
|
+
super(...arguments), this.indeterminate = !1, this._group = null;
|
|
20
13
|
}
|
|
21
14
|
/** Reference to the connected checkbox group. */
|
|
22
15
|
get group() {
|
|
@@ -40,13 +33,11 @@ const m = (o) => {
|
|
|
40
33
|
this.indeterminate && (this.indeterminate = !1);
|
|
41
34
|
}
|
|
42
35
|
}
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
],
|
|
46
|
-
|
|
47
|
-
], t.prototype, "size", 1), t;
|
|
48
|
-
}, u = l`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{--sbb-checkbox-dimension: var(--sbb-size-icon-ui-small);--sbb-checkbox-label-color: var(--sbb-color-charcoal);--sbb-checkbox-label-icon-color: var(--sbb-color-charcoal);--sbb-checkbox-cursor: pointer}:host(:disabled){--sbb-checkbox-cursor: default;--sbb-checkbox-label-color: var(--sbb-color-granite)}.sbb-checkbox-wrapper{display:flex}.sbb-checkbox-wrapper:before{content:"";-webkit-user-select:none;user-select:none;width:0;height:0}.sbb-checkbox{--sbb-text-font-size: var(--sbb-font-size-text-m);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);position:relative;display:block;width:100%;cursor:var(--sbb-checkbox-cursor);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:host([size=s]) .sbb-checkbox{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}.sbb-checkbox__inner{display:flex;align-items:start;gap:var(--sbb-spacing-fixed-2x)}.sbb-checkbox__label{display:flex;flex-grow:1;color:var(--sbb-checkbox-label-color);line-height:max(1em * var(--sbb-typo-line-height-body-text),var(--sbb-checkbox-dimension))}.sbb-checkbox__aligner{display:flex;align-items:center;height:calc(1em * var(--sbb-typo-line-height-body-text))}`;
|
|
36
|
+
return h([
|
|
37
|
+
n({ type: Boolean })
|
|
38
|
+
], o.prototype, "indeterminate"), o;
|
|
39
|
+
}, m = c`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{--sbb-checkbox-dimension: var(--sbb-size-icon-ui-small);--sbb-checkbox-label-color: var(--sbb-color-charcoal);--sbb-checkbox-label-icon-color: var(--sbb-color-charcoal);--sbb-checkbox-cursor: pointer}:host(:disabled){--sbb-checkbox-cursor: default;--sbb-checkbox-label-color: var(--sbb-color-granite)}.sbb-checkbox-wrapper{display:flex}.sbb-checkbox-wrapper:before{content:"";-webkit-user-select:none;user-select:none;width:0;height:0}.sbb-checkbox{--sbb-text-font-size: var(--sbb-font-size-text-m);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);position:relative;display:block;width:100%;cursor:var(--sbb-checkbox-cursor);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:host([size=s]) .sbb-checkbox{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}:host([size=xs]) .sbb-checkbox{--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}.sbb-checkbox__inner{display:flex;align-items:start;gap:var(--sbb-spacing-fixed-2x)}.sbb-checkbox__label{display:flex;flex-grow:1;color:var(--sbb-checkbox-label-color);line-height:max(1em * var(--sbb-typo-line-height-body-text),var(--sbb-checkbox-dimension))}.sbb-checkbox__aligner{display:flex;align-items:center;height:calc(1em * var(--sbb-typo-line-height-body-text))}`;
|
|
49
40
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
d as SbbCheckboxCommonElementMixin,
|
|
42
|
+
m as checkboxCommonStyle
|
|
52
43
|
};
|