@sbb-esta/lyne-elements 0.52.2 → 1.0.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/checkbox/checkbox/checkbox.d.ts +3 -46
- package/checkbox/checkbox/checkbox.d.ts.map +1 -1
- package/checkbox/checkbox-group/checkbox-group.d.ts +4 -2
- package/checkbox/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/checkbox/checkbox-group.js +11 -8
- package/checkbox/checkbox-panel/checkbox-panel.d.ts +41 -0
- package/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -0
- package/checkbox/checkbox-panel.d.ts +2 -0
- package/checkbox/checkbox-panel.d.ts.map +1 -0
- package/checkbox/checkbox-panel.js +67 -0
- package/checkbox/checkbox.js +26 -103
- package/checkbox/common/checkbox-common.d.ts +13 -0
- package/checkbox/common/checkbox-common.d.ts.map +1 -0
- package/checkbox/common.d.ts +2 -0
- package/checkbox/common.d.ts.map +1 -0
- package/checkbox/common.js +52 -0
- package/checkbox.d.ts +2 -0
- package/checkbox.d.ts.map +1 -1
- package/checkbox.js +2 -0
- package/core/mixins/panel-mixin.d.ts +13 -0
- package/core/mixins/panel-mixin.d.ts.map +1 -0
- package/core/mixins.d.ts +1 -0
- package/core/mixins.d.ts.map +1 -1
- package/core/mixins.js +120 -89
- package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables_css--mixin.scss +1 -1
- package/core.css +1 -1
- package/custom-elements.json +8862 -6904
- package/development/checkbox/checkbox/checkbox.d.ts +3 -46
- package/development/checkbox/checkbox/checkbox.d.ts.map +1 -1
- package/development/checkbox/checkbox-group/checkbox-group.d.ts +4 -2
- package/development/checkbox/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/development/checkbox/checkbox-group.js +43 -13
- package/development/checkbox/checkbox-panel/checkbox-panel.d.ts +41 -0
- package/development/checkbox/checkbox-panel/checkbox-panel.d.ts.map +1 -0
- package/development/checkbox/checkbox-panel.d.ts +2 -0
- package/development/checkbox/checkbox-panel.d.ts.map +1 -0
- package/development/checkbox/checkbox-panel.js +86 -0
- package/development/checkbox/checkbox.js +19 -239
- package/development/checkbox/common/checkbox-common.d.ts +13 -0
- package/development/checkbox/common/checkbox-common.d.ts.map +1 -0
- package/development/checkbox/common.d.ts +2 -0
- package/development/checkbox/common.d.ts.map +1 -0
- package/development/checkbox/common.js +156 -0
- package/development/checkbox.d.ts +2 -0
- package/development/checkbox.d.ts.map +1 -1
- package/development/checkbox.js +3 -1
- package/development/core/mixins/panel-mixin.d.ts +13 -0
- package/development/core/mixins/panel-mixin.d.ts.map +1 -0
- package/development/core/mixins.d.ts +1 -0
- package/development/core/mixins.d.ts.map +1 -1
- package/development/core/mixins.js +187 -31
- package/development/image.js +1 -1
- package/development/radio-button/common/radio-button-common.d.ts +22 -0
- package/development/radio-button/common/radio-button-common.d.ts.map +1 -0
- package/development/radio-button/common.d.ts +2 -0
- package/development/radio-button/common.d.ts.map +1 -0
- package/development/radio-button/common.js +294 -0
- package/development/radio-button/radio-button/radio-button.d.ts +2 -81
- package/development/radio-button/radio-button/radio-button.d.ts.map +1 -1
- package/development/radio-button/radio-button-group/radio-button-group.d.ts +6 -4
- package/development/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/development/radio-button/radio-button-group.js +55 -23
- package/development/radio-button/radio-button-panel/index.d.ts +2 -0
- package/development/radio-button/radio-button-panel/index.d.ts.map +1 -0
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts +29 -0
- package/development/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -0
- package/development/radio-button/radio-button-panel.d.ts +2 -0
- package/development/radio-button/radio-button-panel.d.ts.map +1 -0
- package/development/radio-button/radio-button-panel.js +69 -0
- package/development/radio-button/radio-button.js +10 -324
- package/development/radio-button.d.ts +2 -0
- package/development/radio-button.d.ts.map +1 -1
- package/development/radio-button.js +3 -1
- package/{selection-panel/selection-panel.d.ts → development/selection-expansion-panel/selection-expansion-panel.d.ts} +9 -7
- package/development/selection-expansion-panel/selection-expansion-panel.d.ts.map +1 -0
- package/development/selection-expansion-panel.d.ts +2 -0
- package/development/selection-expansion-panel.d.ts.map +1 -0
- package/development/selection-expansion-panel.js +340 -0
- package/development/tabs/tab/index.d.ts +2 -0
- package/development/tabs/tab/index.d.ts.map +1 -0
- package/development/tabs/tab/tab.d.ts +24 -0
- package/development/tabs/tab/tab.d.ts.map +1 -0
- package/development/tabs/tab-group/tab-group.d.ts +20 -15
- package/development/tabs/tab-group/tab-group.d.ts.map +1 -1
- package/development/tabs/tab-group.js +24 -14
- package/development/tabs/{tab-title/tab-title.d.ts → tab-label/tab-label.d.ts} +4 -4
- package/development/tabs/{tab-title/tab-title.d.ts.map → tab-label/tab-label.d.ts.map} +1 -1
- package/development/tabs/tab-label.d.ts +2 -0
- package/development/tabs/tab-label.d.ts.map +1 -0
- package/development/tabs/{tab-title.js → tab-label.js} +86 -86
- package/development/tabs/tab.d.ts +2 -0
- package/development/tabs/tab.d.ts.map +1 -0
- package/development/tabs/tab.js +71 -0
- package/development/tabs.d.ts +2 -1
- package/development/tabs.d.ts.map +1 -1
- package/development/tabs.js +3 -2
- package/development/train/train-formation/train-formation.d.ts.map +1 -1
- package/development/train/train-formation.js +12 -12
- package/index.d.ts +10 -8
- package/index.js +10 -8
- package/package.json +34 -19
- package/radio-button/common/radio-button-common.d.ts +22 -0
- package/radio-button/common/radio-button-common.d.ts.map +1 -0
- package/radio-button/common.d.ts +2 -0
- package/radio-button/common.d.ts.map +1 -0
- package/radio-button/common.js +105 -0
- package/radio-button/radio-button/radio-button.d.ts +2 -81
- package/radio-button/radio-button/radio-button.d.ts.map +1 -1
- package/radio-button/radio-button-group/radio-button-group.d.ts +6 -4
- package/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/radio-button/radio-button-group.js +64 -58
- package/radio-button/radio-button-panel/index.d.ts +2 -0
- package/radio-button/radio-button-panel/index.d.ts.map +1 -0
- package/radio-button/radio-button-panel/radio-button-panel.d.ts +29 -0
- package/radio-button/radio-button-panel/radio-button-panel.d.ts.map +1 -0
- package/radio-button/radio-button-panel.d.ts +2 -0
- package/radio-button/radio-button-panel.d.ts.map +1 -0
- package/radio-button/radio-button-panel.js +59 -0
- package/radio-button/radio-button.js +20 -143
- package/radio-button.d.ts +2 -0
- package/radio-button.d.ts.map +1 -1
- package/radio-button.js +2 -0
- package/{development/selection-panel/selection-panel.d.ts → selection-expansion-panel/selection-expansion-panel.d.ts} +9 -7
- package/selection-expansion-panel/selection-expansion-panel.d.ts.map +1 -0
- package/selection-expansion-panel.d.ts +2 -0
- package/selection-expansion-panel.d.ts.map +1 -0
- package/selection-expansion-panel.js +146 -0
- package/standard-theme.css +1 -1
- package/tabs/tab/index.d.ts +2 -0
- package/tabs/tab/index.d.ts.map +1 -0
- package/tabs/tab/tab.d.ts +24 -0
- package/tabs/tab/tab.d.ts.map +1 -0
- package/tabs/tab-group/tab-group.d.ts +20 -15
- package/tabs/tab-group/tab-group.d.ts.map +1 -1
- package/tabs/tab-group.js +39 -29
- package/tabs/{tab-title/tab-title.d.ts → tab-label/tab-label.d.ts} +4 -4
- package/tabs/{tab-title/tab-title.d.ts.map → tab-label/tab-label.d.ts.map} +1 -1
- package/tabs/tab-label.d.ts +2 -0
- package/tabs/tab-label.d.ts.map +1 -0
- package/tabs/tab-label.js +51 -0
- package/tabs/tab.d.ts +2 -0
- package/tabs/tab.d.ts.map +1 -0
- package/tabs/tab.js +41 -0
- package/tabs.d.ts +2 -1
- package/tabs.d.ts.map +1 -1
- package/tabs.js +2 -1
- package/train/train-formation/train-formation.d.ts.map +1 -1
- package/train/train-formation.js +32 -32
- package/development/selection-panel/selection-panel.d.ts.map +0 -1
- package/development/selection-panel.d.ts +0 -2
- package/development/selection-panel.d.ts.map +0 -1
- package/development/selection-panel.js +0 -376
- package/development/tabs/tab-title.d.ts +0 -2
- package/development/tabs/tab-title.d.ts.map +0 -1
- package/development/teaser-hero/teaser-hero.d.ts +0 -26
- package/development/teaser-hero/teaser-hero.d.ts.map +0 -1
- package/development/teaser-hero.d.ts +0 -2
- package/development/teaser-hero.d.ts.map +0 -1
- package/development/teaser-hero.js +0 -181
- package/development/teaser-paid/teaser-paid.d.ts +0 -20
- package/development/teaser-paid/teaser-paid.d.ts.map +0 -1
- package/development/teaser-paid.d.ts +0 -2
- package/development/teaser-paid.d.ts.map +0 -1
- package/development/teaser-paid.js +0 -91
- package/selection-panel/selection-panel.d.ts.map +0 -1
- package/selection-panel.d.ts +0 -2
- package/selection-panel.d.ts.map +0 -1
- package/selection-panel.js +0 -138
- package/tabs/tab-title.d.ts +0 -2
- package/tabs/tab-title.d.ts.map +0 -1
- package/tabs/tab-title.js +0 -51
- package/teaser-hero/teaser-hero.d.ts +0 -26
- package/teaser-hero/teaser-hero.d.ts.map +0 -1
- package/teaser-hero.d.ts +0 -2
- package/teaser-hero.d.ts.map +0 -1
- package/teaser-hero.js +0 -51
- package/teaser-paid/teaser-paid.d.ts +0 -20
- package/teaser-paid/teaser-paid.d.ts.map +0 -1
- package/teaser-paid.d.ts +0 -2
- package/teaser-paid.d.ts.map +0 -1
- package/teaser-paid.js +0 -28
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { SbbCheckboxGroupElement } from '../checkbox-group.js';
|
|
1
|
+
import { LitElement, CSSResultGroup, TemplateResult } from 'lit';
|
|
2
|
+
import { SbbIconPlacement } from '../../core/interfaces.js';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
export type SbbCheckboxSize = 's' | 'm';
|
|
7
|
-
declare const SbbCheckboxElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbUpdateSchedulerMixinType> & import('../../core/mixins.js').Constructor<import('../../core/mixins.js').SbbFormAssociatedCheckboxMixinType> & import('../../core/mixins.js').AbstractConstructor<import('../../icon.js').SbbIconNameMixinType> & import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbHydrationMixinType> & typeof LitElement;
|
|
4
|
+
declare const SbbCheckboxElement_base: import('../../core/mixins.js').Constructor<import('../common.js').SbbCheckboxCommonElementMixinType> & import('../../core/mixins.js').AbstractConstructor<import('../../icon.js').SbbIconNameMixinType> & typeof LitElement;
|
|
8
5
|
/**
|
|
9
6
|
* It displays a checkbox enhanced with the SBB Design.
|
|
10
7
|
*
|
|
11
8
|
* @slot - Use the unnamed slot to add content to the `sbb-checkbox`.
|
|
12
9
|
* @slot icon - Slot used to render the checkbox icon (disabled inside a selection panel).
|
|
13
|
-
* @slot subtext - Slot used to render a subtext under the label (only visible within a selection panel).
|
|
14
|
-
* @slot suffix - Slot used to render additional content after the label (only visible within a selection panel).
|
|
15
10
|
* @event {CustomEvent<void>} didChange - Deprecated. used for React. Will probably be removed once React 19 is available.
|
|
16
11
|
* @event {Event} change - Event fired on change.
|
|
17
12
|
* @event {InputEvent} input - Event fired on input.
|
|
@@ -20,48 +15,10 @@ export declare class SbbCheckboxElement extends SbbCheckboxElement_base {
|
|
|
20
15
|
static styles: CSSResultGroup;
|
|
21
16
|
static readonly events: {
|
|
22
17
|
readonly didChange: "didChange";
|
|
23
|
-
readonly stateChange: "stateChange";
|
|
24
|
-
readonly checkboxLoaded: "checkboxLoaded";
|
|
25
18
|
};
|
|
26
|
-
/** Whether the checkbox is indeterminate. */
|
|
27
|
-
indeterminate: boolean;
|
|
28
19
|
/** The label position relative to the labelIcon. Defaults to end */
|
|
29
20
|
iconPlacement: SbbIconPlacement;
|
|
30
|
-
/** Label size variant, either m or s. */
|
|
31
|
-
set size(value: SbbCheckboxSize);
|
|
32
|
-
get size(): SbbCheckboxSize;
|
|
33
|
-
private _size;
|
|
34
|
-
/** Reference to the connected checkbox group. */
|
|
35
|
-
get group(): SbbCheckboxGroupElement | null;
|
|
36
|
-
private _group;
|
|
37
|
-
/**
|
|
38
|
-
* Whether the input is the main input of a selection panel.
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
get isSelectionPanelInput(): boolean;
|
|
42
|
-
/** The label describing whether the selection panel is expanded (for screen readers only). */
|
|
43
|
-
private _selectionPanelExpandedLabel;
|
|
44
|
-
private _language;
|
|
45
|
-
private _selectionPanelElement;
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
* Internal event that emits whenever the state of the checkbox
|
|
49
|
-
* in relation to the parent selection panel changes.
|
|
50
|
-
*/
|
|
51
|
-
private _stateChange;
|
|
52
|
-
/**
|
|
53
|
-
* @internal
|
|
54
|
-
* Internal event that emits when the checkbox is loaded.
|
|
55
|
-
*/
|
|
56
|
-
private _checkboxLoaded;
|
|
57
21
|
constructor();
|
|
58
|
-
connectedCallback(): void;
|
|
59
|
-
protected willUpdate(changedProperties: PropertyValues<this>): Promise<void>;
|
|
60
|
-
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
61
|
-
protected isDisabledExternally(): boolean;
|
|
62
|
-
protected isRequiredExternally(): boolean;
|
|
63
|
-
protected withUserInteraction(): void;
|
|
64
|
-
private _updateExpandedLabel;
|
|
65
22
|
protected render(): TemplateResult;
|
|
66
23
|
}
|
|
67
24
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;AAIjE,OAAO,0BAA0B,CAAC;;AAIlC;;;;;;;;GAQG;AACH,qBACa,kBAAmB,SAAQ,uBAEvC;IACC,OAAuB,MAAM,EAAE,cAAc,CAAwC;IAErF,gBAAuB,MAAM;;MAElB;IAEX,oEAAoE;IAE7D,aAAa,EAAE,gBAAgB,CAAS;;cAO5B,MAAM,IAAI,cAAc;CAuB5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,cAAc,EAAE,kBAAkB,CAAC;KACpC;CACF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CSSResultGroup, PropertyValues, TemplateResult, LitElement } from 'lit';
|
|
2
2
|
import { SbbHorizontalFrom, SbbOrientation } from '../../core/interfaces.js';
|
|
3
|
-
import {
|
|
3
|
+
import { SbbCheckboxPanelElement } from '../checkbox-panel.js';
|
|
4
|
+
import { SbbCheckboxElement } from '../checkbox.js';
|
|
5
|
+
import { SbbCheckboxSize } from '../common.js';
|
|
4
6
|
|
|
5
7
|
declare const SbbCheckboxGroupElement_base: import('../../core/mixins.js').AbstractConstructor<import('../../core/mixins.js').SbbDisabledMixinType> & typeof LitElement;
|
|
6
8
|
/**
|
|
@@ -20,7 +22,7 @@ export declare class SbbCheckboxGroupElement extends SbbCheckboxGroupElement_bas
|
|
|
20
22
|
/** Indicates the orientation of the checkboxes inside the `<sbb-checkbox-group>`. */
|
|
21
23
|
orientation: SbbOrientation;
|
|
22
24
|
/** List of contained checkbox elements. */
|
|
23
|
-
get checkboxes(): SbbCheckboxElement[];
|
|
25
|
+
get checkboxes(): (SbbCheckboxElement | SbbCheckboxPanelElement)[];
|
|
24
26
|
private _abort;
|
|
25
27
|
constructor();
|
|
26
28
|
connectedCallback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox-group/checkbox-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["../../../../src/elements/checkbox/checkbox-group/checkbox-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAElF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;;AAIpD;;;;;GAKG;AACH,qBACa,uBAAwB,SAAQ,4BAA4B;IACvE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,8CAA8C;IACK,QAAQ,UAAS;IAEpE,mCAAmC;IAChB,IAAI,EAAE,eAAe,CAAO;IAE/C,yDAAyD;IAElD,cAAc,CAAC,EAAE,iBAAiB,CAAC;IAE1C,qFAAqF;IAE9E,WAAW,EAAE,cAAc,CAAgB;IAElD,2CAA2C;IAC3C,IAAW,UAAU,IAAI,CAAC,kBAAkB,GAAG,uBAAuB,CAAC,EAAE,CAMxE;IAED,OAAO,CAAC,MAAM,CAAsE;;IAOpE,iBAAiB,IAAI,IAAI;cAUtB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAc5E,OAAO,CAAC,cAAc;cA0BH,MAAM,IAAI,cAAc;CAU5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,oBAAoB,EAAE,uBAAuB,CAAC;KAC/C;CACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { css as h, LitElement as l, html as d } from "lit";
|
|
2
2
|
import { property as s, customElement as p } from "lit/decorators.js";
|
|
3
|
-
import { interactivityChecker as x, isArrowKeyPressed as
|
|
4
|
-
import { SbbConnectedAbortController as
|
|
3
|
+
import { interactivityChecker as x, isArrowKeyPressed as m, getNextElementIndex as u } from "../core/a11y.js";
|
|
4
|
+
import { SbbConnectedAbortController as k, SbbSlotStateController as g } from "../core/controllers.js";
|
|
5
5
|
import { SbbDisabledMixin as f } from "../core/mixins.js";
|
|
6
|
-
const w = h`*,:before,:after{box-sizing:border-box}:host{--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto;--sbb-checkbox-group-width: max-content;--sbb-checkbox-group-gap: var(--sbb-spacing-fixed-3x) var(--sbb-spacing-fixed-6x);display:block}:host([orientation=vertical]){--sbb-checkbox-group-orientation: column;--sbb-checkbox-group-width: 100%;--sbb-checkbox-group-checkbox-width: 100%}:host([data-has-
|
|
6
|
+
const w = h`*,:before,:after{box-sizing:border-box}:host{--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto;--sbb-checkbox-group-width: max-content;--sbb-checkbox-group-gap: var(--sbb-spacing-fixed-3x) var(--sbb-spacing-fixed-6x);display:block}:host([orientation=vertical]){--sbb-checkbox-group-orientation: column;--sbb-checkbox-group-width: 100%;--sbb-checkbox-group-checkbox-width: 100%}:host([orientation=vertical]) ::slotted(sbb-checkbox-panel){width:100%}:host([data-has-panel]){--sbb-checkbox-group-width: 100%}:host([data-has-panel]) ::slotted(sbb-checkbox-panel){flex:auto}:host([data-has-panel][orientation=vertical]){--sbb-checkbox-group-gap: var(--sbb-spacing-fixed-2x) var(--sbb-spacing-fixed-4x)}@media (min-width: 0rem){:host([orientation=vertical][horizontal-from=zero]){--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto}:host([orientation=vertical][horizontal-from=zero]) ::slotted(sbb-checkbox-panel){width:initial}:host([orientation=vertical][horizontal-from=zero]:not([data-has-panel])){--sbb-checkbox-group-width: max-content}}@media (min-width: 22.5rem){:host([orientation=vertical][horizontal-from=micro]){--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto}:host([orientation=vertical][horizontal-from=micro]) ::slotted(sbb-checkbox-panel){width:initial}:host([orientation=vertical][horizontal-from=micro]:not([data-has-panel])){--sbb-checkbox-group-width: max-content}}@media (min-width: 37.5rem){:host([orientation=vertical][horizontal-from=small]){--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto}:host([orientation=vertical][horizontal-from=small]) ::slotted(sbb-checkbox-panel){width:initial}:host([orientation=vertical][horizontal-from=small]:not([data-has-panel])){--sbb-checkbox-group-width: max-content}}@media (min-width: 52.5rem){:host([orientation=vertical][horizontal-from=medium]){--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto}:host([orientation=vertical][horizontal-from=medium]) ::slotted(sbb-checkbox-panel){width:initial}:host([orientation=vertical][horizontal-from=medium]:not([data-has-panel])){--sbb-checkbox-group-width: max-content}}@media (min-width: 64rem){:host([orientation=vertical][horizontal-from=large]){--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto}:host([orientation=vertical][horizontal-from=large]) ::slotted(sbb-checkbox-panel){width:initial}:host([orientation=vertical][horizontal-from=large]:not([data-has-panel])){--sbb-checkbox-group-width: max-content}}@media (min-width: 80rem){:host([orientation=vertical][horizontal-from=wide]){--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto}:host([orientation=vertical][horizontal-from=wide]) ::slotted(sbb-checkbox-panel){width:initial}:host([orientation=vertical][horizontal-from=wide]:not([data-has-panel])){--sbb-checkbox-group-width: max-content}}@media (min-width: 90rem){:host([orientation=vertical][horizontal-from=ultra]){--sbb-checkbox-group-orientation: row;--sbb-checkbox-group-checkbox-width: auto}:host([orientation=vertical][horizontal-from=ultra]) ::slotted(sbb-checkbox-panel){width:initial}:host([orientation=vertical][horizontal-from=ultra]:not([data-has-panel])){--sbb-checkbox-group-width: max-content}}.sbb-checkbox-group{display:flex;flex-direction:var(--sbb-checkbox-group-orientation);gap:var(--sbb-checkbox-group-gap);align-items:flex-start;width:var(--sbb-checkbox-group-width)}.sbb-checkbox-group__error{display:inline-block;margin-block-start:var(--sbb-spacing-fixed-1x)}:host(:not([data-slot-names~=error])) .sbb-checkbox-group__error{display:none}::slotted(sbb-checkbox){width:var(--sbb-checkbox-group-checkbox-width)}`;
|
|
7
7
|
var v = Object.defineProperty, z = Object.getOwnPropertyDescriptor, b = (t, o, e, r) => {
|
|
8
8
|
for (var i = r > 1 ? void 0 : r ? z(o, e) : o, n = t.length - 1, c; n >= 0; n--)
|
|
9
9
|
(c = t[n]) && (i = (r ? c(o, e, i) : c(i)) || i);
|
|
@@ -11,12 +11,12 @@ var v = Object.defineProperty, z = Object.getOwnPropertyDescriptor, b = (t, o, e
|
|
|
11
11
|
};
|
|
12
12
|
let a = class extends f(l) {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(), this.required = !1, this.size = "m", this.orientation = "horizontal", this._abort = new
|
|
14
|
+
super(), this.required = !1, this.size = "m", this.orientation = "horizontal", this._abort = new k(this), new g(this);
|
|
15
15
|
}
|
|
16
16
|
/** List of contained checkbox elements. */
|
|
17
17
|
get checkboxes() {
|
|
18
18
|
var t;
|
|
19
|
-
return Array.from(((t = this.querySelectorAll) == null ? void 0 : t.call(this, "sbb-checkbox")) ?? []).filter(
|
|
19
|
+
return Array.from(((t = this.querySelectorAll) == null ? void 0 : t.call(this, "sbb-checkbox, sbb-checkbox-panel")) ?? []).filter(
|
|
20
20
|
(o) => o.closest("sbb-checkbox-group") === this
|
|
21
21
|
);
|
|
22
22
|
}
|
|
@@ -24,7 +24,10 @@ let a = class extends f(l) {
|
|
|
24
24
|
var o;
|
|
25
25
|
super.connectedCallback();
|
|
26
26
|
const t = this._abort.signal;
|
|
27
|
-
this.addEventListener("keydown", (e) => this._handleKeyDown(e), { signal: t }), this.toggleAttribute(
|
|
27
|
+
this.addEventListener("keydown", (e) => this._handleKeyDown(e), { signal: t }), this.toggleAttribute(
|
|
28
|
+
"data-has-panel",
|
|
29
|
+
!!((o = this.querySelector) != null && o.call(this, "sbb-selection-expansion-panel, sbb-checkbox-panel"))
|
|
30
|
+
);
|
|
28
31
|
}
|
|
29
32
|
willUpdate(t) {
|
|
30
33
|
super.willUpdate(t), t.has("disabled") && this.checkboxes.forEach((o) => {
|
|
@@ -44,10 +47,10 @@ let a = class extends f(l) {
|
|
|
44
47
|
(r) => !r.disabled && x.isVisible(r)
|
|
45
48
|
);
|
|
46
49
|
if (!(!o || // don't trap nested handling
|
|
47
|
-
t.target !== this && t.target.parentElement !== this && t.target.parentElement.
|
|
50
|
+
t.target !== this && t.target.parentElement !== this && t.target.parentElement.localName !== "sbb-selection-expansion-panel") && m(t)) {
|
|
48
51
|
const r = o.findIndex(
|
|
49
52
|
(n) => n === t.target
|
|
50
|
-
), i =
|
|
53
|
+
), i = u(t, r, o.length);
|
|
51
54
|
(e = o[i]) == null || e.focus();
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { EventEmitter } from '../../core/eventing.js';
|
|
3
|
+
import { SbbCheckedStateChange, SbbDisabledStateChange, SbbStateChange } from '../../core/interfaces/types.js';
|
|
4
|
+
|
|
5
|
+
export type SbbCheckboxPanelStateChange = Extract<SbbStateChange, SbbDisabledStateChange | SbbCheckedStateChange>;
|
|
6
|
+
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;
|
|
7
|
+
/**
|
|
8
|
+
* It displays a checkbox enhanced with selection panel design.
|
|
9
|
+
*
|
|
10
|
+
* @slot - Use the unnamed slot to add content to the `sbb-checkbox`.
|
|
11
|
+
* @slot subtext - Slot used to render a subtext under the label (only visible within a selection panel).
|
|
12
|
+
* @slot suffix - Slot used to render additional content after the label (only visible within a selection panel).
|
|
13
|
+
* @slot badge - Use this slot to provide a `sbb-card-badge` (optional).
|
|
14
|
+
* @event {CustomEvent<void>} didChange - Deprecated. used for React. Will probably be removed once React 19 is available.
|
|
15
|
+
* @event {Event} change - Event fired on change.
|
|
16
|
+
* @event {InputEvent} input - Event fired on input.
|
|
17
|
+
*/
|
|
18
|
+
export declare class SbbCheckboxPanelElement extends SbbCheckboxPanelElement_base {
|
|
19
|
+
static styles: CSSResultGroup;
|
|
20
|
+
static readonly events: {
|
|
21
|
+
readonly didChange: "didChange";
|
|
22
|
+
readonly stateChange: "stateChange";
|
|
23
|
+
readonly panelConnected: "panelConnected";
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
* Internal event that emits whenever the state of the checkbox
|
|
28
|
+
* in relation to the parent selection panel changes.
|
|
29
|
+
*/
|
|
30
|
+
protected stateChange: EventEmitter<SbbCheckboxPanelStateChange>;
|
|
31
|
+
constructor();
|
|
32
|
+
protected willUpdate(changedProperties: PropertyValues<this>): Promise<void>;
|
|
33
|
+
protected render(): TemplateResult;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'sbb-checkbox-panel': SbbCheckboxPanelElement;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=checkbox-panel.d.ts.map
|
|
@@ -0,0 +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;AAIxC,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,qBACa,uBAAwB,SAAQ,4BAE5C;IACC,OAAuB,MAAM,EAAE,cAAc,CAA2C;IAGxF,gBAAuB,MAAM;;;;MAIlB;IAEX;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,YAAY,CAAC,2BAA2B,CAAC,CAI9D;;cAOuB,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-panel.d.ts","sourceRoot":"","sources":["../../../src/elements/checkbox/checkbox-panel.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LitElement as o, html as c, nothing as h } from "lit";
|
|
2
|
+
import { customElement as r } from "lit/decorators.js";
|
|
3
|
+
import { SbbSlotStateController as d } from "../core/controllers.js";
|
|
4
|
+
import { EventEmitter as p } from "../core/eventing.js";
|
|
5
|
+
import { SbbPanelMixin as m, SbbUpdateSchedulerMixin as x, panelCommonStyle as f } from "../core/mixins.js";
|
|
6
|
+
import { SbbCheckboxCommonElementMixin as C, checkboxCommonStyle as k } from "./common.js";
|
|
7
|
+
import "../screen-reader-only.js";
|
|
8
|
+
import "../visual-checkbox.js";
|
|
9
|
+
var u = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, v = (e, a, i, n) => {
|
|
10
|
+
for (var s = n > 1 ? void 0 : n ? _(a, i) : a, b = e.length - 1, l; b >= 0; b--)
|
|
11
|
+
(l = e[b]) && (s = (n ? l(a, i, s) : l(s)) || s);
|
|
12
|
+
return n && s && u(a, i, s), s;
|
|
13
|
+
};
|
|
14
|
+
let t = class extends m(
|
|
15
|
+
C(x(o))
|
|
16
|
+
) {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(), this.stateChange = new p(
|
|
19
|
+
this,
|
|
20
|
+
t.events.stateChange,
|
|
21
|
+
{ bubbles: !0 }
|
|
22
|
+
), new d(this);
|
|
23
|
+
}
|
|
24
|
+
async willUpdate(e) {
|
|
25
|
+
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
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return c`
|
|
29
|
+
<span class="sbb-selection-panel">
|
|
30
|
+
<div class="sbb-selection-panel__badge">
|
|
31
|
+
<slot name="badge"></slot>
|
|
32
|
+
</div>
|
|
33
|
+
<span class="sbb-checkbox-wrapper">
|
|
34
|
+
<span class="sbb-checkbox">
|
|
35
|
+
<span class="sbb-checkbox__inner">
|
|
36
|
+
<span class="sbb-checkbox__aligner">
|
|
37
|
+
<sbb-visual-checkbox
|
|
38
|
+
?checked=${this.checked}
|
|
39
|
+
?indeterminate=${this.indeterminate}
|
|
40
|
+
?disabled=${this.disabled || this.formDisabled}
|
|
41
|
+
></sbb-visual-checkbox>
|
|
42
|
+
</span>
|
|
43
|
+
<span class="sbb-checkbox__label">
|
|
44
|
+
<slot></slot>
|
|
45
|
+
<slot name="suffix"></slot>
|
|
46
|
+
</span>
|
|
47
|
+
</span>
|
|
48
|
+
<slot name="subtext"></slot>
|
|
49
|
+
${this.expansionState ? c`<sbb-screen-reader-only>${this.expansionState}</sbb-screen-reader-only>` : h}
|
|
50
|
+
</span>
|
|
51
|
+
</span>
|
|
52
|
+
</span>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
t.styles = [k, f];
|
|
57
|
+
t.events = {
|
|
58
|
+
didChange: "didChange",
|
|
59
|
+
stateChange: "stateChange",
|
|
60
|
+
panelConnected: "panelConnected"
|
|
61
|
+
};
|
|
62
|
+
t = v([
|
|
63
|
+
r("sbb-checkbox-panel")
|
|
64
|
+
], t);
|
|
65
|
+
export {
|
|
66
|
+
t as SbbCheckboxPanelElement
|
|
67
|
+
};
|
package/checkbox/checkbox.js
CHANGED
|
@@ -1,86 +1,23 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { SbbUpdateSchedulerMixin as _, SbbFormAssociatedCheckboxMixin as v, SbbHydrationMixin as y } from "../core/mixins.js";
|
|
7
|
-
import { SbbIconNameMixin as w } from "../icon.js";
|
|
8
|
-
import "../screen-reader-only.js";
|
|
1
|
+
import { css as i, LitElement as r, html as h } from "lit";
|
|
2
|
+
import { property as p, customElement as m } from "lit/decorators.js";
|
|
3
|
+
import { SbbSlotStateController as f } from "../core/controllers.js";
|
|
4
|
+
import { SbbIconNameMixin as u } from "../icon.js";
|
|
5
|
+
import { SbbCheckboxCommonElementMixin as d, checkboxCommonStyle as x } from "./common.js";
|
|
9
6
|
import "../visual-checkbox.js";
|
|
10
|
-
const
|
|
11
|
-
var
|
|
12
|
-
for (var
|
|
13
|
-
(
|
|
14
|
-
return
|
|
7
|
+
const _ = i`: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(: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 = (l, s, c, t) => {
|
|
9
|
+
for (var e = t > 1 ? void 0 : t ? v(s, c) : s, n = l.length - 1, b; n >= 0; n--)
|
|
10
|
+
(b = l[n]) && (e = (t ? b(s, c, e) : b(e)) || e);
|
|
11
|
+
return t && e && k(s, c, e), e;
|
|
15
12
|
};
|
|
16
|
-
let
|
|
17
|
-
|
|
13
|
+
let o = class extends d(
|
|
14
|
+
u(r)
|
|
18
15
|
) {
|
|
19
16
|
constructor() {
|
|
20
|
-
super(), this.
|
|
21
|
-
this,
|
|
22
|
-
t.events.stateChange,
|
|
23
|
-
{ bubbles: !0 }
|
|
24
|
-
), this._checkboxLoaded = new r(
|
|
25
|
-
this,
|
|
26
|
-
t.events.checkboxLoaded,
|
|
27
|
-
{ bubbles: !0 }
|
|
28
|
-
), new m(this);
|
|
29
|
-
}
|
|
30
|
-
set size(e) {
|
|
31
|
-
this._size = e;
|
|
32
|
-
}
|
|
33
|
-
get size() {
|
|
34
|
-
var e;
|
|
35
|
-
return ((e = this.group) == null ? void 0 : e.size) ?? this._size;
|
|
36
|
-
}
|
|
37
|
-
/** Reference to the connected checkbox group. */
|
|
38
|
-
get group() {
|
|
39
|
-
return this._group;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Whether the input is the main input of a selection panel.
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
get isSelectionPanelInput() {
|
|
46
|
-
return this.hasAttribute("data-is-selection-panel-input");
|
|
47
|
-
}
|
|
48
|
-
connectedCallback() {
|
|
49
|
-
var e, s;
|
|
50
|
-
super.connectedCallback(), this._group = this.closest("sbb-checkbox-group"), this._selectionPanelElement = (e = this.closest) == null ? void 0 : e.call(this, "sbb-selection-panel"), this.toggleAttribute("data-is-inside-selection-panel", !!this._selectionPanelElement), this.toggleAttribute(
|
|
51
|
-
"data-is-selection-panel-input",
|
|
52
|
-
!!this._selectionPanelElement && !((s = this.closest) != null && s.call(this, 'sbb-selection-panel [slot="content"]'))
|
|
53
|
-
), this._checkboxLoaded.emit(), ["disabled", "required", "size"].forEach((o) => this.requestUpdate(o));
|
|
54
|
-
}
|
|
55
|
-
async willUpdate(e) {
|
|
56
|
-
super.willUpdate(e), e.has("checked") && this.isSelectionPanelInput && this.checked !== e.get("checked") && (this._stateChange.emit({ type: "checked", checked: this.checked }), this._updateExpandedLabel()), e.has("disabled") && this.isSelectionPanelInput && this.disabled !== e.get("disabled") && this._stateChange.emit({ type: "disabled", disabled: this.disabled }), (e.has("checked") || e.has("indeterminate")) && (this.internals.ariaChecked = this.indeterminate ? "mixed" : `${this.checked}`);
|
|
57
|
-
}
|
|
58
|
-
firstUpdated(e) {
|
|
59
|
-
super.firstUpdated(e), this.startUpdate(), setTimeout(() => {
|
|
60
|
-
this.isSelectionPanelInput && this._updateExpandedLabel(), this.completeUpdate();
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
isDisabledExternally() {
|
|
64
|
-
var e;
|
|
65
|
-
return ((e = this.group) == null ? void 0 : e.disabled) ?? !1;
|
|
66
|
-
}
|
|
67
|
-
isRequiredExternally() {
|
|
68
|
-
var e;
|
|
69
|
-
return ((e = this.group) == null ? void 0 : e.required) ?? !1;
|
|
70
|
-
}
|
|
71
|
-
withUserInteraction() {
|
|
72
|
-
this.indeterminate && (this.indeterminate = !1);
|
|
73
|
-
}
|
|
74
|
-
async _updateExpandedLabel() {
|
|
75
|
-
var e;
|
|
76
|
-
if (await this.hydrationComplete, !((e = this._selectionPanelElement) != null && e.hasContent)) {
|
|
77
|
-
this._selectionPanelExpandedLabel = "", this.removeAttribute("data-has-selection-panel-label");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
this._selectionPanelExpandedLabel = this.checked ? ", " + g[this._language.current] : ", " + k[this._language.current], this.toggleAttribute("data-has-selection-panel-label", !0);
|
|
17
|
+
super(), this.iconPlacement = "end", new f(this);
|
|
81
18
|
}
|
|
82
19
|
render() {
|
|
83
|
-
return
|
|
20
|
+
return h`
|
|
84
21
|
<span class="sbb-checkbox-wrapper">
|
|
85
22
|
<span class="sbb-checkbox">
|
|
86
23
|
<span class="sbb-checkbox__inner">
|
|
@@ -93,40 +30,26 @@ let t = class extends _(
|
|
|
93
30
|
</span>
|
|
94
31
|
<span class="sbb-checkbox__label">
|
|
95
32
|
<slot></slot>
|
|
96
|
-
<span class="sbb-checkbox__label--icon"
|
|
97
|
-
|
|
33
|
+
<span class="sbb-checkbox__label--icon sbb-checkbox__aligner"
|
|
34
|
+
>${this.renderIconSlot()}</span
|
|
35
|
+
>
|
|
98
36
|
</span>
|
|
99
37
|
</span>
|
|
100
|
-
<slot name="subtext"></slot>
|
|
101
|
-
<sbb-screen-reader-only class="sbb-checkbox__expanded-label">
|
|
102
|
-
${this._selectionPanelExpandedLabel}
|
|
103
|
-
</sbb-screen-reader-only>
|
|
104
38
|
</span>
|
|
105
39
|
</span>
|
|
106
40
|
`;
|
|
107
41
|
}
|
|
108
42
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
didChange: "didChange"
|
|
112
|
-
stateChange: "stateChange",
|
|
113
|
-
checkboxLoaded: "checkboxLoaded"
|
|
43
|
+
o.styles = [x, _];
|
|
44
|
+
o.events = {
|
|
45
|
+
didChange: "didChange"
|
|
114
46
|
};
|
|
115
47
|
a([
|
|
116
|
-
|
|
117
|
-
],
|
|
118
|
-
a([
|
|
119
|
-
|
|
120
|
-
],
|
|
121
|
-
a([
|
|
122
|
-
c({ reflect: !0 })
|
|
123
|
-
], t.prototype, "size", 1);
|
|
124
|
-
a([
|
|
125
|
-
u()
|
|
126
|
-
], t.prototype, "_selectionPanelExpandedLabel", 2);
|
|
127
|
-
t = a([
|
|
128
|
-
x("sbb-checkbox")
|
|
129
|
-
], t);
|
|
48
|
+
p({ attribute: "icon-placement", reflect: !0 })
|
|
49
|
+
], o.prototype, "iconPlacement", 2);
|
|
50
|
+
o = a([
|
|
51
|
+
m("sbb-checkbox")
|
|
52
|
+
], o);
|
|
130
53
|
export {
|
|
131
|
-
|
|
54
|
+
o as SbbCheckboxElement
|
|
132
55
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Constructor, SbbDisabledMixinType, SbbFormAssociatedCheckboxMixinType, SbbRequiredMixinType } from '../../core/mixins.js';
|
|
3
|
+
import { SbbCheckboxGroupElement } from '../checkbox-group.js';
|
|
4
|
+
|
|
5
|
+
export type SbbCheckboxSize = 's' | 'm';
|
|
6
|
+
export declare class SbbCheckboxCommonElementMixinType extends SbbFormAssociatedCheckboxMixinType implements Partial<SbbDisabledMixinType>, Partial<SbbRequiredMixinType> {
|
|
7
|
+
indeterminate: boolean;
|
|
8
|
+
set size(value: SbbCheckboxSize);
|
|
9
|
+
get size(): SbbCheckboxSize;
|
|
10
|
+
get group(): SbbCheckboxGroupElement | null;
|
|
11
|
+
}
|
|
12
|
+
export declare const SbbCheckboxCommonElementMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<SbbCheckboxCommonElementMixinType> & T;
|
|
13
|
+
//# sourceMappingURL=checkbox-common.d.ts.map
|
|
@@ -0,0 +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;AAExC,MAAM,CAAC,OAAO,OAAO,iCACnB,SAAQ,kCACR,YAAW,OAAO,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAEhE,aAAa,EAAE,OAAO,CAAC;IAE9B,IAAW,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE;IACxC,IAAW,IAAI,IAAI,eAAe,CAAC;IAEnC,IAAW,KAAK,IAAI,uBAAuB,GAAG,IAAI,CAAC;CACpD;AAGD,eAAO,MAAM,6BAA6B,kDAC5B,CAAC,KACZ,YAAY,iCAAiC,CAAC,GAAG,CAuDnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/elements/checkbox/common.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { property as a } from "lit/decorators.js";
|
|
2
|
+
import { SbbFormAssociatedCheckboxMixin as n } from "../core/mixins.js";
|
|
3
|
+
import { css as l } from "lit";
|
|
4
|
+
var h = Object.defineProperty, p = Object.getOwnPropertyDescriptor, c = (o, t, b, e) => {
|
|
5
|
+
for (var s = e > 1 ? void 0 : e ? p(t, b) : t, i = o.length - 1, r; i >= 0; i--)
|
|
6
|
+
(r = o[i]) && (s = (e ? r(t, b, s) : r(s)) || s);
|
|
7
|
+
return e && s && h(t, b, s), s;
|
|
8
|
+
};
|
|
9
|
+
const m = (o) => {
|
|
10
|
+
class t extends n(o) {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.indeterminate = !1, this._size = "m", this._group = null;
|
|
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;
|
|
20
|
+
}
|
|
21
|
+
/** Reference to the connected checkbox group. */
|
|
22
|
+
get group() {
|
|
23
|
+
return this._group;
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
super.connectedCallback(), this._group = this.closest("sbb-checkbox-group"), ["disabled", "required", "size"].forEach((e) => this.requestUpdate(e));
|
|
27
|
+
}
|
|
28
|
+
async willUpdate(e) {
|
|
29
|
+
super.willUpdate(e), (e.has("checked") || e.has("indeterminate")) && (this.internals.ariaChecked = this.indeterminate ? "mixed" : `${this.checked}`);
|
|
30
|
+
}
|
|
31
|
+
isDisabledExternally() {
|
|
32
|
+
var e;
|
|
33
|
+
return ((e = this.group) == null ? void 0 : e.disabled) ?? !1;
|
|
34
|
+
}
|
|
35
|
+
isRequiredExternally() {
|
|
36
|
+
var e;
|
|
37
|
+
return ((e = this.group) == null ? void 0 : e.required) ?? !1;
|
|
38
|
+
}
|
|
39
|
+
withUserInteraction() {
|
|
40
|
+
this.indeterminate && (this.indeterminate = !1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return c([
|
|
44
|
+
a({ type: Boolean })
|
|
45
|
+
], t.prototype, "indeterminate", 2), c([
|
|
46
|
+
a({ reflect: !0 })
|
|
47
|
+
], t.prototype, "size", 1), t;
|
|
48
|
+
}, g = 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;--sbb-checkbox-label-gap: var(--sbb-spacing-fixed-2x)}: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;gap:var(--sbb-checkbox-label-gap);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
|
+
export {
|
|
50
|
+
m as SbbCheckboxCommonElementMixin,
|
|
51
|
+
g as checkboxCommonStyle
|
|
52
|
+
};
|
package/checkbox.d.ts
CHANGED
package/checkbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/elements/checkbox.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/elements/checkbox.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC"}
|
package/checkbox.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { AbstractConstructor } from './constructor.js';
|
|
3
|
+
|
|
4
|
+
export declare class SbbPanelMixinType {
|
|
5
|
+
color: 'white' | 'milk';
|
|
6
|
+
borderless: boolean;
|
|
7
|
+
expansionState?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Mixin for common panel behaviors
|
|
11
|
+
*/
|
|
12
|
+
export declare const SbbPanelMixin: <T extends AbstractConstructor<LitElement>>(superClass: T) => AbstractConstructor<SbbPanelMixinType> & T;
|
|
13
|
+
//# sourceMappingURL=panel-mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-mixin.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/mixins/panel-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAC7B,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AAEH,eAAO,MAAM,aAAa,0DACZ,CAAC,KACZ,oBAAoB,iBAAiB,CAAC,GAAG,CAiC3C,CAAC"}
|
package/core/mixins.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './mixins/form-associated-mixin.js';
|
|
|
5
5
|
export * from './mixins/hydration-mixin.js';
|
|
6
6
|
export * from './mixins/named-slot-list-mixin.js';
|
|
7
7
|
export * from './mixins/negative-mixin.js';
|
|
8
|
+
export * from './mixins/panel-mixin.js';
|
|
8
9
|
export * from './mixins/required-mixin.js';
|
|
9
10
|
export * from './mixins/update-scheduler-mixin.js';
|
|
10
11
|
//# sourceMappingURL=mixins.d.ts.map
|
package/core/mixins.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mixins.d.ts","sourceRoot":"","sources":["../../../src/elements/core/mixins.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"mixins.d.ts","sourceRoot":"","sources":["../../../src/elements/core/mixins.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AAEnD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uCAAuC,CAAC"}
|