@sbb-esta/lyne-elements-dev 4.8.1-dev.1774250628 → 4.8.1-dev.1774268349

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.
Files changed (2) hide show
  1. package/custom-elements.json +1427 -1427
  2. package/package.json +2 -2
@@ -105434,27 +105434,23 @@
105434
105434
  },
105435
105435
  {
105436
105436
  "kind": "javascript-module",
105437
- "path": "menu/menu-button/menu-button.component.js",
105437
+ "path": "menu/menu/menu.component.js",
105438
105438
  "declarations": [
105439
105439
  {
105440
105440
  "kind": "class",
105441
- "description": "It displays a button element that can be used in the `sbb-menu` component.",
105442
- "name": "SbbMenuButtonElement",
105441
+ "description": "It displays a contextual menu with one or more action element.",
105442
+ "name": "SbbMenuElement",
105443
105443
  "cssProperties": [
105444
105444
  {
105445
- "description": "Can be used to modify horizontal padding.",
105446
- "name": "--sbb-menu-action-outer-horizontal-padding",
105447
- "default": "var(--sbb-spacing-fixed-3x)"
105445
+ "description": "To specify a custom stack order, the `z-index` can be overridden by defining this CSS variable. The default `z-index` of the component is set to `var(--sbb-overlay-default-z-index)` with a value of `1000`.",
105446
+ "name": "--sbb-menu-z-index",
105447
+ "default": "var(--sbb-overlay-default-z-index)"
105448
105448
  }
105449
105449
  ],
105450
105450
  "slots": [
105451
105451
  {
105452
- "description": "Use the unnamed slot to add content to the `sbb-menu-button`.",
105452
+ "description": "Use the unnamed slot to add `sbb-menu-button`/`sbb-menu-link` or other elements to the menu.",
105453
105453
  "name": ""
105454
- },
105455
- {
105456
- "description": "Use this slot to provide an icon. If `icon-name` is set, a `sbb-icon` will be used.",
105457
- "name": "icon"
105458
105454
  }
105459
105455
  ],
105460
105456
  "members": [
@@ -105471,261 +105467,274 @@
105471
105467
  "name": "SbbElement",
105472
105468
  "module": "core/base-elements/element.js"
105473
105469
  },
105474
- "default": "'sbb-menu-button'"
105470
+ "default": "'sbb-menu'"
105475
105471
  },
105476
105472
  {
105477
105473
  "kind": "field",
105478
105474
  "name": "role",
105479
105475
  "type": {
105480
- "text": "ElementInternals['role']"
105476
+ "text": "string"
105481
105477
  },
105482
105478
  "privacy": "public",
105483
105479
  "static": true,
105484
105480
  "readonly": true,
105485
- "default": "'menuitem'",
105486
- "inheritedFrom": {
105487
- "name": "SbbButtonLikeBaseElement",
105488
- "module": "core/base-elements/button-base-element.js"
105489
- }
105481
+ "default": "'menu'"
105490
105482
  },
105491
105483
  {
105492
105484
  "kind": "field",
105493
- "name": "disabledInteractive",
105485
+ "name": "trigger",
105494
105486
  "type": {
105495
- "text": "boolean"
105487
+ "text": "HTMLElement | null"
105496
105488
  },
105497
105489
  "privacy": "public",
105498
- "default": "false",
105499
- "description": "Whether the button should be aria-disabled but stay interactive.",
105500
- "attribute": "disabled-interactive",
105501
- "reflects": true,
105502
- "inheritedFrom": {
105503
- "name": "SbbDisabledInteractiveMixin",
105504
- "module": "core/mixins/disabled-mixin.js"
105505
- }
105490
+ "default": "null",
105491
+ "description": "The element that will trigger the menu overlay.\n\nFor attribute usage, provide an id reference.",
105492
+ "attribute": "trigger"
105506
105493
  },
105507
105494
  {
105508
105495
  "kind": "field",
105509
- "name": "disabled",
105510
- "privacy": "public",
105511
- "description": "Whether the component is disabled.",
105512
- "default": "false",
105496
+ "name": "_menu",
105513
105497
  "type": {
105514
- "text": "boolean"
105498
+ "text": "HTMLDivElement"
105515
105499
  },
105516
- "attribute": "disabled",
105517
- "reflects": true,
105518
- "inheritedFrom": {
105519
- "name": "SbbDisabledMixin",
105520
- "module": "core/mixins/disabled-mixin.js"
105521
- }
105500
+ "privacy": "private"
105522
105501
  },
105523
105502
  {
105524
105503
  "kind": "field",
105525
- "name": "#disabled",
105504
+ "name": "_triggerElement",
105505
+ "type": {
105506
+ "text": "HTMLElement | null"
105507
+ },
105526
105508
  "privacy": "private",
105509
+ "default": "null"
105510
+ },
105511
+ {
105512
+ "kind": "field",
105513
+ "name": "_triggerAbortController",
105514
+ "type": {
105515
+ "text": "AbortController"
105516
+ },
105517
+ "privacy": "private"
105518
+ },
105519
+ {
105520
+ "kind": "field",
105521
+ "name": "_isPointerDownEventOnMenu",
105527
105522
  "type": {
105528
105523
  "text": "boolean"
105529
105524
  },
105530
- "default": "false",
105531
- "inheritedFrom": {
105532
- "name": "SbbDisabledMixin",
105533
- "module": "core/mixins/disabled-mixin.js"
105534
- }
105525
+ "privacy": "private",
105526
+ "default": "false"
105527
+ },
105528
+ {
105529
+ "kind": "field",
105530
+ "name": "_windowEventsController",
105531
+ "type": {
105532
+ "text": "AbortController"
105533
+ },
105534
+ "privacy": "private"
105535
+ },
105536
+ {
105537
+ "kind": "field",
105538
+ "name": "_escapableOverlayController",
105539
+ "privacy": "private",
105540
+ "default": "new SbbEscapableOverlayController(this)"
105541
+ },
105542
+ {
105543
+ "kind": "field",
105544
+ "name": "_focusTrapController",
105545
+ "privacy": "private",
105546
+ "default": "new SbbFocusTrapController(this)"
105547
+ },
105548
+ {
105549
+ "kind": "field",
105550
+ "name": "_scrollHandler",
105551
+ "privacy": "private",
105552
+ "default": "new SbbScrollHandler()"
105553
+ },
105554
+ {
105555
+ "kind": "field",
105556
+ "name": "_inertController",
105557
+ "privacy": "private",
105558
+ "default": "new SbbInertController(this)"
105559
+ },
105560
+ {
105561
+ "kind": "field",
105562
+ "name": "_mobileBreakpoint",
105563
+ "privacy": "private",
105564
+ "default": "SbbMediaQueryBreakpointSmallAndBelow"
105565
+ },
105566
+ {
105567
+ "kind": "field",
105568
+ "name": "_mediaMatcher",
105569
+ "privacy": "private",
105570
+ "default": "new SbbMediaMatcherController(this, { [this._mobileBreakpoint]: (matches) => { if (matches && (this.state === 'opening' || this.state === 'opened')) { this._scrollHandler.disableScroll(); } else { this._scrollHandler.enableScroll(); } }, })"
105571
+ },
105572
+ {
105573
+ "kind": "field",
105574
+ "name": "_darkModeController",
105575
+ "privacy": "private",
105576
+ "default": "new SbbDarkModeController(this, () => this._syncNegative())"
105577
+ },
105578
+ {
105579
+ "kind": "field",
105580
+ "name": "_language",
105581
+ "privacy": "private",
105582
+ "default": "new SbbLanguageController(this)"
105583
+ },
105584
+ {
105585
+ "kind": "field",
105586
+ "name": "_nestedMenu",
105587
+ "type": {
105588
+ "text": "SbbMenuElement | null"
105589
+ },
105590
+ "privacy": "private",
105591
+ "default": "null"
105535
105592
  },
105536
105593
  {
105537
105594
  "kind": "method",
105538
- "name": "isDisabledExternally",
105539
- "privacy": "protected",
105595
+ "name": "escapeStrategy",
105596
+ "privacy": "public",
105540
105597
  "return": {
105541
105598
  "type": {
105542
- "text": "boolean"
105599
+ "text": "void"
105543
105600
  }
105544
105601
  },
105545
- "description": "Will be used as 'or' check to the current disabled state.\nCan e.g. be used to read disabled state of a group.",
105602
+ "description": "The method which is called on escape key press. Defaults to calling close()",
105546
105603
  "inheritedFrom": {
105547
- "name": "SbbDisabledMixin",
105548
- "module": "core/mixins/disabled-mixin.js"
105604
+ "name": "SbbOpenCloseBaseElement",
105605
+ "module": "core/base-elements/open-close-base-element.js"
105549
105606
  }
105550
105607
  },
105551
105608
  {
105552
- "kind": "field",
105553
- "name": "styles",
105554
- "type": {
105555
- "text": "CSSResultGroup"
105556
- },
105609
+ "kind": "method",
105610
+ "name": "open",
105557
105611
  "privacy": "public",
105558
- "static": true,
105559
- "default": "[boxSizingStyles, style]",
105612
+ "return": {
105613
+ "type": {
105614
+ "text": "void"
105615
+ }
105616
+ },
105617
+ "description": "Opens the menu on trigger click.",
105560
105618
  "inheritedFrom": {
105561
- "name": "SbbMenuActionCommonElementMixin",
105562
- "module": "menu/common/menu-action-common.js"
105619
+ "name": "SbbOpenCloseBaseElement",
105620
+ "module": "core/base-elements/open-close-base-element.js"
105563
105621
  }
105564
105622
  },
105565
105623
  {
105566
105624
  "kind": "method",
105567
- "name": "renderTemplate",
105568
- "privacy": "protected",
105625
+ "name": "close",
105626
+ "privacy": "public",
105569
105627
  "return": {
105570
105628
  "type": {
105571
- "text": "TemplateResult"
105629
+ "text": "void"
105572
105630
  }
105573
105631
  },
105574
- "description": "Override this method to render the component template.",
105632
+ "description": "Closes the menu and all its nested menus.",
105575
105633
  "inheritedFrom": {
105576
- "name": "SbbActionBaseElement",
105577
- "module": "core/base-elements/action-base-element.js"
105634
+ "name": "SbbOpenCloseBaseElement",
105635
+ "module": "core/base-elements/open-close-base-element.js"
105578
105636
  }
105579
105637
  },
105580
105638
  {
105581
- "kind": "field",
105582
- "name": "iconName",
105583
- "type": {
105584
- "text": "string"
105585
- },
105639
+ "kind": "method",
105640
+ "name": "closeAll",
105586
105641
  "privacy": "public",
105587
- "default": "''",
105588
- "description": "The icon name we want to use, choose from the small icon variants\nfrom the ui-icons category from here\nhttps://icons.app.sbb.ch.",
105589
- "attribute": "icon-name",
105590
- "inheritedFrom": {
105591
- "name": "SbbIconNameMixin",
105592
- "module": "icon/icon-name-mixin.js"
105593
- }
105642
+ "return": {
105643
+ "type": {
105644
+ "text": "void"
105645
+ }
105646
+ },
105647
+ "description": "Closes the menu and all related menus (nested and parent menus)."
105594
105648
  },
105595
105649
  {
105596
105650
  "kind": "method",
105597
- "name": "renderIconSlot",
105598
- "privacy": "protected",
105651
+ "name": "_close",
105652
+ "privacy": "private",
105599
105653
  "return": {
105600
105654
  "type": {
105601
- "text": "TemplateResult"
105655
+ "text": "void"
105602
105656
  }
105603
105657
  },
105604
105658
  "parameters": [
105605
105659
  {
105606
- "name": "classname",
105607
- "optional": true,
105608
- "type": {
105609
- "text": "string"
105610
- }
105660
+ "name": "closeAll",
105661
+ "default": "false",
105662
+ "description": "If true, it ensures animations are correct by toggling some states when closing all related menus at once.",
105663
+ "optional": true
105611
105664
  }
105612
- ],
105613
- "inheritedFrom": {
105614
- "name": "SbbIconNameMixin",
105615
- "module": "icon/icon-name-mixin.js"
105616
- }
105665
+ ]
105617
105666
  },
105618
105667
  {
105619
105668
  "kind": "method",
105620
- "name": "renderIconName",
105621
- "privacy": "protected",
105669
+ "name": "_isZeroAnimationDuration",
105670
+ "privacy": "private",
105622
105671
  "return": {
105623
105672
  "type": {
105624
- "text": "string"
105673
+ "text": "boolean"
105625
105674
  }
105626
- },
105627
- "inheritedFrom": {
105628
- "name": "SbbIconNameMixin",
105629
- "module": "icon/icon-name-mixin.js"
105630
105675
  }
105631
105676
  },
105632
105677
  {
105633
105678
  "kind": "method",
105634
- "name": "_renderIconName",
105679
+ "name": "_handleOpening",
105635
105680
  "privacy": "private",
105636
105681
  "return": {
105637
105682
  "type": {
105638
- "text": "string"
105683
+ "text": "void"
105639
105684
  }
105640
- },
105641
- "inheritedFrom": {
105642
- "name": "SbbIconNameMixin",
105643
- "module": "icon/icon-name-mixin.js"
105644
105685
  }
105645
105686
  },
105646
105687
  {
105647
- "kind": "field",
105648
- "name": "_elementsOnWhichEnterPressTriggersSubmit",
105649
- "type": {
105650
- "text": "array"
105651
- },
105688
+ "kind": "method",
105689
+ "name": "_handleClosing",
105652
105690
  "privacy": "private",
105653
- "readonly": true,
105654
- "default": "[ 'input', 'sbb-date-input', 'sbb-time-input', ]",
105655
- "inheritedFrom": {
105656
- "name": "SbbButtonBaseElement",
105657
- "module": "core/base-elements/button-base-element.js"
105658
- }
105659
- },
105660
- {
105661
- "kind": "field",
105662
- "name": "value",
105663
- "type": {
105664
- "text": "string"
105665
- },
105666
- "privacy": "public",
105667
- "inheritedFrom": {
105668
- "name": "SbbButtonBaseElement",
105669
- "module": "core/base-elements/button-base-element.js"
105670
- },
105671
- "default": "''",
105672
- "description": "Value of the form element.",
105673
- "attribute": "value"
105674
- },
105675
- {
105676
- "kind": "field",
105677
- "name": "type",
105678
- "privacy": "public",
105679
- "description": "The type attribute to use for the button.",
105680
- "default": "'button'",
105681
- "type": {
105682
- "text": "SbbButtonType"
105683
- },
105684
- "attribute": "type",
105685
- "inheritedFrom": {
105686
- "name": "SbbButtonBaseElement",
105687
- "module": "core/base-elements/button-base-element.js"
105691
+ "return": {
105692
+ "type": {
105693
+ "text": "void"
105694
+ }
105688
105695
  }
105689
105696
  },
105690
105697
  {
105691
- "kind": "field",
105692
- "name": "form",
105693
- "type": {
105694
- "text": "HTMLFormElement | null"
105695
- },
105696
- "privacy": "public",
105697
- "description": "The `<form>` element to associate the button with.",
105698
- "inheritedFrom": {
105699
- "name": "SbbButtonBaseElement",
105700
- "module": "core/base-elements/button-base-element.js"
105698
+ "kind": "method",
105699
+ "name": "_handleKeyDown",
105700
+ "privacy": "private",
105701
+ "return": {
105702
+ "type": {
105703
+ "text": "void"
105704
+ }
105701
105705
  },
105702
- "attribute": "form"
105706
+ "parameters": [
105707
+ {
105708
+ "name": "evt",
105709
+ "type": {
105710
+ "text": "KeyboardEvent"
105711
+ }
105712
+ }
105713
+ ]
105703
105714
  },
105704
105715
  {
105705
- "kind": "field",
105706
- "name": "_formId",
105707
- "type": {
105708
- "text": "string"
105709
- },
105716
+ "kind": "method",
105717
+ "name": "_configureTrigger",
105710
105718
  "privacy": "private",
105711
- "default": "''",
105712
- "inheritedFrom": {
105713
- "name": "SbbButtonBaseElement",
105714
- "module": "core/base-elements/button-base-element.js"
105719
+ "return": {
105720
+ "type": {
105721
+ "text": "void"
105722
+ }
105715
105723
  }
105716
105724
  },
105717
105725
  {
105718
- "kind": "field",
105719
- "name": "_handleButtonClick",
105726
+ "kind": "method",
105727
+ "name": "_attachWindowEvents",
105720
105728
  "privacy": "private",
105721
- "inheritedFrom": {
105722
- "name": "SbbButtonBaseElement",
105723
- "module": "core/base-elements/button-base-element.js"
105729
+ "return": {
105730
+ "type": {
105731
+ "text": "void"
105732
+ }
105724
105733
  }
105725
105734
  },
105726
105735
  {
105727
105736
  "kind": "method",
105728
- "name": "_requestSubmit",
105737
+ "name": "_interactiveElementClick",
105729
105738
  "privacy": "private",
105730
105739
  "return": {
105731
105740
  "type": {
@@ -105734,154 +105743,79 @@
105734
105743
  },
105735
105744
  "parameters": [
105736
105745
  {
105737
- "name": "form",
105746
+ "name": "event",
105738
105747
  "type": {
105739
- "text": "HTMLFormElement"
105748
+ "text": "Event"
105740
105749
  }
105741
105750
  }
105742
- ],
105743
- "inheritedFrom": {
105744
- "name": "SbbButtonBaseElement",
105745
- "module": "core/base-elements/button-base-element.js"
105746
- }
105747
- },
105748
- {
105749
- "kind": "field",
105750
- "name": "_formKeyDown",
105751
- "privacy": "private",
105752
- "inheritedFrom": {
105753
- "name": "SbbButtonBaseElement",
105754
- "module": "core/base-elements/button-base-element.js"
105755
- }
105756
- },
105757
- {
105758
- "kind": "field",
105759
- "name": "formAssociated",
105760
- "type": {
105761
- "text": "boolean"
105762
- },
105763
- "privacy": "public",
105764
- "static": true,
105765
- "default": "true",
105766
- "inheritedFrom": {
105767
- "name": "SbbFormAssociatedMixin",
105768
- "module": "core/mixins/form-associated-mixin.js"
105769
- }
105770
- },
105771
- {
105772
- "kind": "field",
105773
- "name": "name",
105774
- "privacy": "public",
105775
- "description": "Name of the form element. Will be read from name attribute.",
105776
- "type": {
105777
- "text": "string"
105778
- },
105779
- "attribute": "name",
105780
- "inheritedFrom": {
105781
- "name": "SbbFormAssociatedMixin",
105782
- "module": "core/mixins/form-associated-mixin.js"
105783
- }
105751
+ ]
105784
105752
  },
105785
105753
  {
105786
105754
  "kind": "field",
105787
- "name": "validity",
105788
- "type": {
105789
- "text": "ValidityState"
105790
- },
105791
- "privacy": "public",
105792
- "description": "Returns the ValidityState object for this element.",
105793
- "readonly": true,
105794
- "inheritedFrom": {
105795
- "name": "SbbFormAssociatedMixin",
105796
- "module": "core/mixins/form-associated-mixin.js"
105797
- }
105755
+ "name": "_pointerDownListener",
105756
+ "privacy": "private"
105798
105757
  },
105799
105758
  {
105800
105759
  "kind": "field",
105801
- "name": "validationMessage",
105802
- "type": {
105803
- "text": "string"
105804
- },
105805
- "privacy": "public",
105806
- "description": "Returns the current error message, if available, which corresponds\nto the current validation state.\nPlease note that only one message is returned at a time (e.g. if\nmultiple validity states are invalid, only the chronologically first one\nis returned until it is fixed, at which point the next message might be\nreturned, if it is still applicable). Also, a custom validity message\n(see below) has precedence over native validation messages.",
105807
- "readonly": true,
105808
- "inheritedFrom": {
105809
- "name": "SbbFormAssociatedMixin",
105810
- "module": "core/mixins/form-associated-mixin.js"
105811
- }
105760
+ "name": "_closeOnBackdropClick",
105761
+ "privacy": "private"
105812
105762
  },
105813
105763
  {
105814
- "kind": "field",
105815
- "name": "willValidate",
105816
- "type": {
105817
- "text": "boolean"
105764
+ "kind": "method",
105765
+ "name": "_nestedMenus",
105766
+ "privacy": "private",
105767
+ "return": {
105768
+ "type": {
105769
+ "text": "SbbMenuElement[]"
105770
+ }
105818
105771
  },
105819
- "privacy": "public",
105820
- "description": "Returns true if this element will be validated\nwhen the form is submitted; false otherwise.",
105821
- "readonly": true,
105822
- "inheritedFrom": {
105823
- "name": "SbbFormAssociatedMixin",
105824
- "module": "core/mixins/form-associated-mixin.js"
105825
- }
105772
+ "description": "Converts the linked list into an array of SbbMenuElement."
105826
105773
  },
105827
105774
  {
105828
- "kind": "field",
105829
- "name": "_validityStates",
105775
+ "kind": "method",
105776
+ "name": "_parentMenu",
105830
105777
  "privacy": "private",
105831
- "default": "new Map< keyof ValidityStateFlags, { flagValue: unknown; message: string } >()",
105832
- "inheritedFrom": {
105833
- "name": "SbbFormAssociatedMixin",
105834
- "module": "core/mixins/form-associated-mixin.js"
105778
+ "return": {
105779
+ "type": {
105780
+ "text": "SbbMenuElement | null"
105781
+ }
105835
105782
  }
105836
105783
  },
105837
105784
  {
105838
- "kind": "field",
105839
- "name": "formDisabled",
105840
- "type": {
105841
- "text": "boolean"
105785
+ "kind": "method",
105786
+ "name": "_mainMenu",
105787
+ "privacy": "private",
105788
+ "return": {
105789
+ "type": {
105790
+ "text": "SbbMenuElement"
105791
+ }
105842
105792
  },
105843
- "privacy": "protected",
105844
- "default": "false",
105845
- "description": "Whenever a surrounding form or fieldset is changing its disabled state.",
105846
- "inheritedFrom": {
105847
- "name": "SbbFormAssociatedMixin",
105848
- "module": "core/mixins/form-associated-mixin.js"
105849
- }
105793
+ "description": "The outermost menu."
105850
105794
  },
105851
105795
  {
105852
105796
  "kind": "method",
105853
- "name": "checkValidity",
105854
- "privacy": "public",
105797
+ "name": "_isNested",
105798
+ "privacy": "private",
105855
105799
  "return": {
105856
105800
  "type": {
105857
105801
  "text": "boolean"
105858
105802
  }
105859
- },
105860
- "description": "Returns true if this element has no validity problems; false otherwise.\nFires an invalid event at the element in the latter case.",
105861
- "inheritedFrom": {
105862
- "name": "SbbFormAssociatedMixin",
105863
- "module": "core/mixins/form-associated-mixin.js"
105864
105803
  }
105865
105804
  },
105866
105805
  {
105867
105806
  "kind": "method",
105868
- "name": "reportValidity",
105869
- "privacy": "public",
105807
+ "name": "_updateNestedInert",
105808
+ "privacy": "private",
105870
105809
  "return": {
105871
105810
  "type": {
105872
- "text": "boolean"
105811
+ "text": "void"
105873
105812
  }
105874
- },
105875
- "description": "Returns true if this element has no validity problems; otherwise,\nreturns false, fires an invalid event at the element,\nand (if the event isn't canceled) reports the problem to the user.",
105876
- "inheritedFrom": {
105877
- "name": "SbbFormAssociatedMixin",
105878
- "module": "core/mixins/form-associated-mixin.js"
105879
105813
  }
105880
105814
  },
105881
105815
  {
105882
105816
  "kind": "method",
105883
- "name": "setCustomValidity",
105884
- "privacy": "public",
105817
+ "name": "_handleMouseOver",
105818
+ "privacy": "private",
105885
105819
  "return": {
105886
105820
  "type": {
105887
105821
  "text": "void"
@@ -105889,260 +105823,170 @@
105889
105823
  },
105890
105824
  "parameters": [
105891
105825
  {
105892
- "name": "message",
105826
+ "name": "event",
105893
105827
  "type": {
105894
- "text": "string"
105828
+ "text": "MouseEvent"
105895
105829
  }
105896
105830
  }
105897
- ],
105898
- "description": "Sets the custom validity message for this element. Use the empty string\nto indicate that the element does not have a custom validity error.",
105899
- "inheritedFrom": {
105900
- "name": "SbbFormAssociatedMixin",
105901
- "module": "core/mixins/form-associated-mixin.js"
105902
- }
105831
+ ]
105903
105832
  },
105904
105833
  {
105905
105834
  "kind": "method",
105906
- "name": "_hasDisabledAncestor",
105835
+ "name": "_onMenuAnimationEnd",
105907
105836
  "privacy": "private",
105908
105837
  "return": {
105909
105838
  "type": {
105910
- "text": "boolean"
105911
- }
105912
- },
105913
- "inheritedFrom": {
105914
- "name": "SbbFormAssociatedMixin",
105915
- "module": "core/mixins/form-associated-mixin.js"
105916
- }
105917
- },
105918
- {
105919
- "kind": "method",
105920
- "name": "updateFormValue",
105921
- "privacy": "protected",
105922
- "return": {
105923
- "type": {
105924
- "text": "void"
105925
- }
105926
- },
105927
- "description": "Should be called when form value is changed.\nAdapts and sets the formValue in the supported format (string | FormData | File | null)\nhttps://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue",
105928
- "inheritedFrom": {
105929
- "name": "SbbFormAssociatedMixin",
105930
- "module": "core/mixins/form-associated-mixin.js"
105931
- }
105932
- },
105933
- {
105934
- "kind": "method",
105935
- "name": "formState",
105936
- "privacy": "protected",
105937
- "return": {
105938
- "type": {
105939
- "text": "FormRestoreState"
105940
- }
105941
- },
105942
- "inheritedFrom": {
105943
- "name": "SbbFormAssociatedMixin",
105944
- "module": "core/mixins/form-associated-mixin.js"
105945
- }
105946
- },
105947
- {
105948
- "kind": "method",
105949
- "name": "setValidityFlag",
105950
- "privacy": "protected",
105951
- "return": {
105952
- "type": {
105953
- "text": "void"
105839
+ "text": "void"
105954
105840
  }
105955
105841
  },
105956
105842
  "parameters": [
105957
105843
  {
105958
- "name": "flag",
105959
- "type": {
105960
- "text": "T"
105961
- }
105962
- },
105963
- {
105964
- "name": "message",
105965
- "type": {
105966
- "text": "string"
105967
- }
105968
- },
105969
- {
105970
- "name": "flagValue",
105971
- "optional": true,
105844
+ "name": "event",
105972
105845
  "type": {
105973
- "text": "ValidityStateFlags[T]"
105846
+ "text": "AnimationEvent"
105974
105847
  }
105975
105848
  }
105976
- ],
105977
- "description": "Marks this element as suffering from the constraint indicated by the\nflag argument and associates the given message to it.\nNote that only one message is displayed at a time and custom messages by\nconsumers are always displayed before internal messages and internal\nmessages are displayed in the order they were added.\nTo set/define custom validity state flags, you need to extend the\nValidityState prototype (and the CustomValidityState interface).",
105978
- "inheritedFrom": {
105979
- "name": "SbbFormAssociatedMixin",
105980
- "module": "core/mixins/form-associated-mixin.js"
105981
- }
105849
+ ]
105982
105850
  },
105983
105851
  {
105984
105852
  "kind": "method",
105985
- "name": "removeValidityFlag",
105986
- "privacy": "protected",
105853
+ "name": "_setMenuPosition",
105854
+ "privacy": "private",
105987
105855
  "return": {
105988
105856
  "type": {
105989
105857
  "text": "void"
105990
105858
  }
105991
- },
105992
- "parameters": [
105993
- {
105994
- "name": "flag",
105995
- "type": {
105996
- "text": "T"
105997
- }
105998
- }
105999
- ],
106000
- "description": "Removes the validity state flag entry and updates validity state.",
106001
- "inheritedFrom": {
106002
- "name": "SbbFormAssociatedMixin",
106003
- "module": "core/mixins/form-associated-mixin.js"
106004
105859
  }
106005
105860
  },
106006
105861
  {
106007
105862
  "kind": "method",
106008
- "name": "validate",
106009
- "privacy": "protected",
105863
+ "name": "_syncNegative",
105864
+ "privacy": "private",
106010
105865
  "return": {
106011
105866
  "type": {
106012
105867
  "text": "void"
106013
105868
  }
106014
- },
106015
- "description": "To be called whenever the current element needs to be validated.",
106016
- "inheritedFrom": {
106017
- "name": "SbbFormAssociatedMixin",
106018
- "module": "core/mixins/form-associated-mixin.js"
106019
105869
  }
106020
105870
  },
106021
105871
  {
106022
105872
  "kind": "method",
106023
- "name": "shouldValidate",
106024
- "privacy": "protected",
105873
+ "name": "_isMobile",
105874
+ "privacy": "private",
106025
105875
  "return": {
106026
105876
  "type": {
106027
105877
  "text": "boolean"
106028
105878
  }
106029
- },
106030
- "parameters": [
106031
- {
106032
- "name": "name",
106033
- "type": {
106034
- "text": "PropertyKey | undefined"
106035
- }
106036
- }
106037
- ],
106038
- "description": "Whether validation should be run on a property change with the given name.",
106039
- "inheritedFrom": {
106040
- "name": "SbbFormAssociatedMixin",
106041
- "module": "core/mixins/form-associated-mixin.js"
106042
105879
  }
106043
105880
  },
106044
105881
  {
106045
- "kind": "method",
106046
- "name": "_setInternalValidity",
106047
- "privacy": "private",
106048
- "return": {
106049
- "type": {
106050
- "text": "void"
106051
- }
105882
+ "kind": "field",
105883
+ "name": "events",
105884
+ "privacy": "public",
105885
+ "static": true,
105886
+ "readonly": true,
105887
+ "default": "{ beforeopen: 'beforeopen', open: 'open', beforeclose: 'beforeclose', close: 'close', }",
105888
+ "type": {
105889
+ "text": "{\n beforeopen: 'beforeopen',\n open: 'open',\n beforeclose: 'beforeclose',\n close: 'close',\n }"
106052
105890
  },
106053
105891
  "inheritedFrom": {
106054
- "name": "SbbFormAssociatedMixin",
106055
- "module": "core/mixins/form-associated-mixin.js"
105892
+ "name": "SbbOpenCloseBaseElement",
105893
+ "module": "core/base-elements/open-close-base-element.js"
106056
105894
  }
106057
105895
  },
106058
105896
  {
106059
105897
  "kind": "field",
106060
- "name": "_preventScrollOnSpaceKeydown",
106061
- "privacy": "private",
106062
- "description": "Prevents scrolling from pressing Space, when the event target is an action element.\nAlso sets active state.",
106063
- "parameters": [
106064
- {
106065
- "description": "The origin event.",
106066
- "name": "event"
106067
- }
106068
- ],
105898
+ "name": "state",
105899
+ "privacy": "protected",
105900
+ "description": "The state of the component.",
105901
+ "type": {
105902
+ "text": "SbbOpenedClosedState"
105903
+ },
105904
+ "default": "'closed'",
106069
105905
  "inheritedFrom": {
106070
- "name": "SbbButtonLikeBaseElement",
106071
- "module": "core/base-elements/button-base-element.js"
105906
+ "name": "SbbOpenCloseBaseElement",
105907
+ "module": "core/base-elements/open-close-base-element.js"
106072
105908
  }
106073
105909
  },
106074
105910
  {
106075
105911
  "kind": "field",
106076
- "name": "_removeActiveMarker",
105912
+ "name": "_state",
105913
+ "type": {
105914
+ "text": "SbbOpenedClosedState"
105915
+ },
106077
105916
  "privacy": "private",
106078
105917
  "inheritedFrom": {
106079
- "name": "SbbButtonLikeBaseElement",
106080
- "module": "core/base-elements/button-base-element.js"
105918
+ "name": "SbbOpenCloseBaseElement",
105919
+ "module": "core/base-elements/open-close-base-element.js"
106081
105920
  }
106082
105921
  },
106083
105922
  {
106084
105923
  "kind": "field",
106085
- "name": "_dispatchClickEventOnSpaceKeyup",
106086
- "privacy": "private",
106087
- "description": "Dispatches a 'click' PointerEvent if the original keyboard event is a 'Space' press.\nAs verified with the native button, when 'Space' is pressed, a 'click' event is dispatched\nafter the 'keyup' event.",
106088
- "parameters": [
106089
- {
106090
- "description": "The origin event.",
106091
- "name": "event"
106092
- }
106093
- ],
105924
+ "name": "isOpen",
105925
+ "type": {
105926
+ "text": "boolean"
105927
+ },
105928
+ "privacy": "public",
105929
+ "description": "Whether the element is open.",
105930
+ "readonly": true,
106094
105931
  "inheritedFrom": {
106095
- "name": "SbbButtonLikeBaseElement",
106096
- "module": "core/base-elements/button-base-element.js"
105932
+ "name": "SbbOpenCloseBaseElement",
105933
+ "module": "core/base-elements/open-close-base-element.js"
106097
105934
  }
106098
105935
  },
106099
105936
  {
106100
- "kind": "field",
106101
- "name": "_dispatchClickEvent",
106102
- "privacy": "private",
105937
+ "kind": "method",
105938
+ "name": "dispatchBeforeOpenEvent",
105939
+ "privacy": "protected",
105940
+ "return": {
105941
+ "type": {
105942
+ "text": "boolean"
105943
+ }
105944
+ },
106103
105945
  "inheritedFrom": {
106104
- "name": "SbbButtonLikeBaseElement",
106105
- "module": "core/base-elements/button-base-element.js"
105946
+ "name": "SbbOpenCloseBaseElement",
105947
+ "module": "core/base-elements/open-close-base-element.js"
106106
105948
  }
106107
105949
  },
106108
105950
  {
106109
- "kind": "field",
106110
- "name": "maybeDisabled",
106111
- "type": {
106112
- "text": "boolean | undefined"
106113
- },
105951
+ "kind": "method",
105952
+ "name": "dispatchOpenEvent",
106114
105953
  "privacy": "protected",
106115
- "readonly": true,
105954
+ "return": {
105955
+ "type": {
105956
+ "text": "boolean"
105957
+ }
105958
+ },
106116
105959
  "inheritedFrom": {
106117
- "name": "SbbActionBaseElement",
106118
- "module": "core/base-elements/action-base-element.js"
105960
+ "name": "SbbOpenCloseBaseElement",
105961
+ "module": "core/base-elements/open-close-base-element.js"
106119
105962
  }
106120
105963
  },
106121
105964
  {
106122
- "kind": "field",
106123
- "name": "maybeDisabledInteractive",
106124
- "type": {
106125
- "text": "boolean | undefined"
106126
- },
105965
+ "kind": "method",
105966
+ "name": "dispatchBeforeCloseEvent",
106127
105967
  "privacy": "protected",
106128
- "readonly": true,
105968
+ "return": {
105969
+ "type": {
105970
+ "text": "boolean"
105971
+ }
105972
+ },
106129
105973
  "inheritedFrom": {
106130
- "name": "SbbActionBaseElement",
106131
- "module": "core/base-elements/action-base-element.js"
105974
+ "name": "SbbOpenCloseBaseElement",
105975
+ "module": "core/base-elements/open-close-base-element.js"
106132
105976
  }
106133
105977
  },
106134
105978
  {
106135
105979
  "kind": "method",
106136
- "name": "setupBaseEventHandlers",
105980
+ "name": "dispatchCloseEvent",
106137
105981
  "privacy": "protected",
106138
105982
  "return": {
106139
105983
  "type": {
106140
- "text": "void"
105984
+ "text": "boolean"
106141
105985
  }
106142
105986
  },
106143
105987
  "inheritedFrom": {
106144
- "name": "SbbActionBaseElement",
106145
- "module": "core/base-elements/action-base-element.js"
105988
+ "name": "SbbOpenCloseBaseElement",
105989
+ "module": "core/base-elements/open-close-base-element.js"
106146
105990
  }
106147
105991
  },
106148
105992
  {
@@ -106251,110 +106095,66 @@
106251
106095
  }
106252
106096
  }
106253
106097
  ],
106254
- "mixins": [
106255
- {
106256
- "name": "SbbDisabledTabIndexActionMixin",
106257
- "module": "core/mixins.js"
106258
- },
106098
+ "attributes": [
106259
106099
  {
106260
- "name": "SbbMenuActionCommonElementMixin",
106261
- "module": "menu/common/menu-action-common.js"
106100
+ "name": "trigger",
106101
+ "type": {
106102
+ "text": "HTMLElement | null"
106103
+ },
106104
+ "default": "null",
106105
+ "description": "The element that will trigger the menu overlay.\n\nFor attribute usage, provide an id reference.",
106106
+ "fieldName": "trigger"
106262
106107
  }
106263
106108
  ],
106264
106109
  "superclass": {
106265
- "name": "SbbButtonBaseElement",
106110
+ "name": "SbbOpenCloseBaseElement",
106266
106111
  "module": "core/base-elements.js"
106267
106112
  },
106268
- "tagName": "sbb-menu-button",
106113
+ "tagName": "sbb-menu",
106269
106114
  "customElement": true,
106270
- "attributes": [
106115
+ "events": [
106271
106116
  {
106272
- "name": "disabled-interactive",
106273
- "type": {
106274
- "text": "boolean"
106275
- },
106276
- "default": "false",
106277
- "description": "Whether the button should be aria-disabled but stay interactive.",
106278
- "fieldName": "disabledInteractive",
106279
- "inheritedFrom": {
106280
- "name": "SbbDisabledInteractiveMixin",
106281
- "module": "core/mixins/disabled-mixin.js"
106282
- }
106283
- },
106284
- {
106285
- "name": "disabled",
106286
- "description": "Whether the component is disabled.",
106287
- "default": "false",
106288
- "type": {
106289
- "text": "boolean"
106290
- },
106291
- "fieldName": "disabled",
106292
- "inheritedFrom": {
106293
- "name": "SbbDisabledMixin",
106294
- "module": "core/mixins/disabled-mixin.js"
106295
- }
106296
- },
106297
- {
106298
- "name": "icon-name",
106299
- "type": {
106300
- "text": "string"
106301
- },
106302
- "default": "''",
106303
- "description": "The icon name we want to use, choose from the small icon variants\nfrom the ui-icons category from here\nhttps://icons.app.sbb.ch.",
106304
- "fieldName": "iconName",
106305
- "inheritedFrom": {
106306
- "name": "SbbIconNameMixin",
106307
- "module": "icon/icon-name-mixin.js"
106308
- }
106309
- },
106310
- {
106311
- "name": "value",
106117
+ "name": "beforeopen",
106312
106118
  "type": {
106313
- "text": "string"
106119
+ "text": "Event"
106314
106120
  },
106315
- "default": "''",
106316
- "description": "Value of the form element.",
106317
- "fieldName": "value",
106121
+ "description": "Emits whenever the component starts the opening transition. Can be canceled.",
106318
106122
  "inheritedFrom": {
106319
- "name": "SbbButtonBaseElement",
106320
- "module": "core/base-elements/button-base-element.js"
106123
+ "name": "SbbOpenCloseBaseElement",
106124
+ "module": "core/base-elements/open-close-base-element.js"
106321
106125
  }
106322
106126
  },
106323
106127
  {
106324
- "name": "type",
106325
- "description": "The type attribute to use for the button.",
106326
- "default": "'button'",
106128
+ "name": "open",
106327
106129
  "type": {
106328
- "text": "SbbButtonType"
106130
+ "text": "Event"
106329
106131
  },
106330
- "fieldName": "type",
106132
+ "description": "Emits whenever the component is opened.",
106331
106133
  "inheritedFrom": {
106332
- "name": "SbbButtonBaseElement",
106333
- "module": "core/base-elements/button-base-element.js"
106134
+ "name": "SbbOpenCloseBaseElement",
106135
+ "module": "core/base-elements/open-close-base-element.js"
106334
106136
  }
106335
106137
  },
106336
106138
  {
106337
- "name": "form",
106338
- "description": "The `<form>` element to associate the button with.",
106139
+ "name": "beforeclose",
106339
106140
  "type": {
106340
- "text": "HTMLFormElement | null"
106141
+ "text": "Event"
106341
106142
  },
106342
- "fieldName": "form",
106143
+ "description": "Emits whenever the component begins the closing transition. Can be canceled.",
106343
106144
  "inheritedFrom": {
106344
- "name": "SbbButtonBaseElement",
106345
- "module": "core/base-elements/button-base-element.js"
106145
+ "name": "SbbOpenCloseBaseElement",
106146
+ "module": "core/base-elements/open-close-base-element.js"
106346
106147
  }
106347
106148
  },
106348
106149
  {
106349
- "name": "name",
106350
- "description": "Name of the form element. Will be read from name attribute.",
106150
+ "name": "close",
106351
106151
  "type": {
106352
- "text": "string"
106152
+ "text": "Event"
106353
106153
  },
106354
- "fieldName": "name",
106154
+ "description": "Emits whenever the component is closed.",
106355
106155
  "inheritedFrom": {
106356
- "name": "SbbFormAssociatedMixin",
106357
- "module": "core/mixins/form-associated-mixin.js"
106156
+ "name": "SbbOpenCloseBaseElement",
106157
+ "module": "core/base-elements/open-close-base-element.js"
106358
106158
  }
106359
106159
  }
106360
106160
  ]
@@ -106363,33 +106163,37 @@
106363
106163
  "exports": [
106364
106164
  {
106365
106165
  "kind": "js",
106366
- "name": "SbbMenuButtonElement",
106166
+ "name": "SbbMenuElement",
106367
106167
  "declaration": {
106368
- "name": "SbbMenuButtonElement",
106369
- "module": "menu/menu-button/menu-button.component.js"
106168
+ "name": "SbbMenuElement",
106169
+ "module": "menu/menu/menu.component.js"
106370
106170
  }
106371
106171
  }
106372
106172
  ]
106373
106173
  },
106374
106174
  {
106375
106175
  "kind": "javascript-module",
106376
- "path": "menu/menu/menu.component.js",
106176
+ "path": "menu/menu-button/menu-button.component.js",
106377
106177
  "declarations": [
106378
106178
  {
106379
106179
  "kind": "class",
106380
- "description": "It displays a contextual menu with one or more action element.",
106381
- "name": "SbbMenuElement",
106180
+ "description": "It displays a button element that can be used in the `sbb-menu` component.",
106181
+ "name": "SbbMenuButtonElement",
106382
106182
  "cssProperties": [
106383
106183
  {
106384
- "description": "To specify a custom stack order, the `z-index` can be overridden by defining this CSS variable. The default `z-index` of the component is set to `var(--sbb-overlay-default-z-index)` with a value of `1000`.",
106385
- "name": "--sbb-menu-z-index",
106386
- "default": "var(--sbb-overlay-default-z-index)"
106184
+ "description": "Can be used to modify horizontal padding.",
106185
+ "name": "--sbb-menu-action-outer-horizontal-padding",
106186
+ "default": "var(--sbb-spacing-fixed-3x)"
106387
106187
  }
106388
106188
  ],
106389
106189
  "slots": [
106390
106190
  {
106391
- "description": "Use the unnamed slot to add `sbb-menu-button`/`sbb-menu-link` or other elements to the menu.",
106191
+ "description": "Use the unnamed slot to add content to the `sbb-menu-button`.",
106392
106192
  "name": ""
106193
+ },
106194
+ {
106195
+ "description": "Use this slot to provide an icon. If `icon-name` is set, a `sbb-icon` will be used.",
106196
+ "name": "icon"
106393
106197
  }
106394
106198
  ],
106395
106199
  "members": [
@@ -106406,236 +106210,261 @@
106406
106210
  "name": "SbbElement",
106407
106211
  "module": "core/base-elements/element.js"
106408
106212
  },
106409
- "default": "'sbb-menu'"
106213
+ "default": "'sbb-menu-button'"
106410
106214
  },
106411
106215
  {
106412
106216
  "kind": "field",
106413
106217
  "name": "role",
106414
106218
  "type": {
106415
- "text": "string"
106219
+ "text": "ElementInternals['role']"
106416
106220
  },
106417
106221
  "privacy": "public",
106418
106222
  "static": true,
106419
106223
  "readonly": true,
106420
- "default": "'menu'"
106224
+ "default": "'menuitem'",
106225
+ "inheritedFrom": {
106226
+ "name": "SbbButtonLikeBaseElement",
106227
+ "module": "core/base-elements/button-base-element.js"
106228
+ }
106421
106229
  },
106422
106230
  {
106423
106231
  "kind": "field",
106424
- "name": "trigger",
106232
+ "name": "disabledInteractive",
106425
106233
  "type": {
106426
- "text": "HTMLElement | null"
106234
+ "text": "boolean"
106427
106235
  },
106428
106236
  "privacy": "public",
106429
- "default": "null",
106430
- "description": "The element that will trigger the menu overlay.\n\nFor attribute usage, provide an id reference.",
106431
- "attribute": "trigger"
106237
+ "default": "false",
106238
+ "description": "Whether the button should be aria-disabled but stay interactive.",
106239
+ "attribute": "disabled-interactive",
106240
+ "reflects": true,
106241
+ "inheritedFrom": {
106242
+ "name": "SbbDisabledInteractiveMixin",
106243
+ "module": "core/mixins/disabled-mixin.js"
106244
+ }
106432
106245
  },
106433
106246
  {
106434
106247
  "kind": "field",
106435
- "name": "_menu",
106248
+ "name": "disabled",
106249
+ "privacy": "public",
106250
+ "description": "Whether the component is disabled.",
106251
+ "default": "false",
106436
106252
  "type": {
106437
- "text": "HTMLDivElement"
106253
+ "text": "boolean"
106438
106254
  },
106439
- "privacy": "private"
106255
+ "attribute": "disabled",
106256
+ "reflects": true,
106257
+ "inheritedFrom": {
106258
+ "name": "SbbDisabledMixin",
106259
+ "module": "core/mixins/disabled-mixin.js"
106260
+ }
106440
106261
  },
106441
106262
  {
106442
106263
  "kind": "field",
106443
- "name": "_triggerElement",
106444
- "type": {
106445
- "text": "HTMLElement | null"
106446
- },
106264
+ "name": "#disabled",
106447
106265
  "privacy": "private",
106448
- "default": "null"
106449
- },
106450
- {
106451
- "kind": "field",
106452
- "name": "_triggerAbortController",
106453
106266
  "type": {
106454
- "text": "AbortController"
106267
+ "text": "boolean"
106455
106268
  },
106456
- "privacy": "private"
106269
+ "default": "false",
106270
+ "inheritedFrom": {
106271
+ "name": "SbbDisabledMixin",
106272
+ "module": "core/mixins/disabled-mixin.js"
106273
+ }
106457
106274
  },
106458
106275
  {
106459
- "kind": "field",
106460
- "name": "_isPointerDownEventOnMenu",
106461
- "type": {
106462
- "text": "boolean"
106276
+ "kind": "method",
106277
+ "name": "isDisabledExternally",
106278
+ "privacy": "protected",
106279
+ "return": {
106280
+ "type": {
106281
+ "text": "boolean"
106282
+ }
106463
106283
  },
106464
- "privacy": "private",
106465
- "default": "false"
106284
+ "description": "Will be used as 'or' check to the current disabled state.\nCan e.g. be used to read disabled state of a group.",
106285
+ "inheritedFrom": {
106286
+ "name": "SbbDisabledMixin",
106287
+ "module": "core/mixins/disabled-mixin.js"
106288
+ }
106466
106289
  },
106467
106290
  {
106468
106291
  "kind": "field",
106469
- "name": "_windowEventsController",
106292
+ "name": "styles",
106470
106293
  "type": {
106471
- "text": "AbortController"
106294
+ "text": "CSSResultGroup"
106472
106295
  },
106473
- "privacy": "private"
106296
+ "privacy": "public",
106297
+ "static": true,
106298
+ "default": "[boxSizingStyles, style]",
106299
+ "inheritedFrom": {
106300
+ "name": "SbbMenuActionCommonElementMixin",
106301
+ "module": "menu/common/menu-action-common.js"
106302
+ }
106474
106303
  },
106475
106304
  {
106476
- "kind": "field",
106477
- "name": "_escapableOverlayController",
106478
- "privacy": "private",
106479
- "default": "new SbbEscapableOverlayController(this)"
106305
+ "kind": "method",
106306
+ "name": "renderTemplate",
106307
+ "privacy": "protected",
106308
+ "return": {
106309
+ "type": {
106310
+ "text": "TemplateResult"
106311
+ }
106312
+ },
106313
+ "description": "Override this method to render the component template.",
106314
+ "inheritedFrom": {
106315
+ "name": "SbbActionBaseElement",
106316
+ "module": "core/base-elements/action-base-element.js"
106317
+ }
106480
106318
  },
106481
106319
  {
106482
106320
  "kind": "field",
106483
- "name": "_focusTrapController",
106484
- "privacy": "private",
106485
- "default": "new SbbFocusTrapController(this)"
106321
+ "name": "iconName",
106322
+ "type": {
106323
+ "text": "string"
106324
+ },
106325
+ "privacy": "public",
106326
+ "default": "''",
106327
+ "description": "The icon name we want to use, choose from the small icon variants\nfrom the ui-icons category from here\nhttps://icons.app.sbb.ch.",
106328
+ "attribute": "icon-name",
106329
+ "inheritedFrom": {
106330
+ "name": "SbbIconNameMixin",
106331
+ "module": "icon/icon-name-mixin.js"
106332
+ }
106486
106333
  },
106487
106334
  {
106488
- "kind": "field",
106489
- "name": "_scrollHandler",
106490
- "privacy": "private",
106491
- "default": "new SbbScrollHandler()"
106492
- },
106493
- {
106494
- "kind": "field",
106495
- "name": "_inertController",
106496
- "privacy": "private",
106497
- "default": "new SbbInertController(this)"
106498
- },
106499
- {
106500
- "kind": "field",
106501
- "name": "_mobileBreakpoint",
106502
- "privacy": "private",
106503
- "default": "SbbMediaQueryBreakpointSmallAndBelow"
106504
- },
106505
- {
106506
- "kind": "field",
106507
- "name": "_mediaMatcher",
106508
- "privacy": "private",
106509
- "default": "new SbbMediaMatcherController(this, { [this._mobileBreakpoint]: (matches) => { if (matches && (this.state === 'opening' || this.state === 'opened')) { this._scrollHandler.disableScroll(); } else { this._scrollHandler.enableScroll(); } }, })"
106510
- },
106511
- {
106512
- "kind": "field",
106513
- "name": "_darkModeController",
106514
- "privacy": "private",
106515
- "default": "new SbbDarkModeController(this, () => this._syncNegative())"
106516
- },
106517
- {
106518
- "kind": "field",
106519
- "name": "_language",
106520
- "privacy": "private",
106521
- "default": "new SbbLanguageController(this)"
106522
- },
106523
- {
106524
- "kind": "field",
106525
- "name": "_nestedMenu",
106526
- "type": {
106527
- "text": "SbbMenuElement | null"
106528
- },
106529
- "privacy": "private",
106530
- "default": "null"
106335
+ "kind": "method",
106336
+ "name": "renderIconSlot",
106337
+ "privacy": "protected",
106338
+ "return": {
106339
+ "type": {
106340
+ "text": "TemplateResult"
106341
+ }
106342
+ },
106343
+ "parameters": [
106344
+ {
106345
+ "name": "classname",
106346
+ "optional": true,
106347
+ "type": {
106348
+ "text": "string"
106349
+ }
106350
+ }
106351
+ ],
106352
+ "inheritedFrom": {
106353
+ "name": "SbbIconNameMixin",
106354
+ "module": "icon/icon-name-mixin.js"
106355
+ }
106531
106356
  },
106532
106357
  {
106533
106358
  "kind": "method",
106534
- "name": "escapeStrategy",
106535
- "privacy": "public",
106359
+ "name": "renderIconName",
106360
+ "privacy": "protected",
106536
106361
  "return": {
106537
106362
  "type": {
106538
- "text": "void"
106363
+ "text": "string"
106539
106364
  }
106540
106365
  },
106541
- "description": "The method which is called on escape key press. Defaults to calling close()",
106542
106366
  "inheritedFrom": {
106543
- "name": "SbbOpenCloseBaseElement",
106544
- "module": "core/base-elements/open-close-base-element.js"
106367
+ "name": "SbbIconNameMixin",
106368
+ "module": "icon/icon-name-mixin.js"
106545
106369
  }
106546
106370
  },
106547
106371
  {
106548
106372
  "kind": "method",
106549
- "name": "open",
106550
- "privacy": "public",
106373
+ "name": "_renderIconName",
106374
+ "privacy": "private",
106551
106375
  "return": {
106552
106376
  "type": {
106553
- "text": "void"
106377
+ "text": "string"
106554
106378
  }
106555
106379
  },
106556
- "description": "Opens the menu on trigger click.",
106557
106380
  "inheritedFrom": {
106558
- "name": "SbbOpenCloseBaseElement",
106559
- "module": "core/base-elements/open-close-base-element.js"
106381
+ "name": "SbbIconNameMixin",
106382
+ "module": "icon/icon-name-mixin.js"
106560
106383
  }
106561
106384
  },
106562
106385
  {
106563
- "kind": "method",
106564
- "name": "close",
106565
- "privacy": "public",
106566
- "return": {
106567
- "type": {
106568
- "text": "void"
106569
- }
106386
+ "kind": "field",
106387
+ "name": "_elementsOnWhichEnterPressTriggersSubmit",
106388
+ "type": {
106389
+ "text": "array"
106570
106390
  },
106571
- "description": "Closes the menu and all its nested menus.",
106391
+ "privacy": "private",
106392
+ "readonly": true,
106393
+ "default": "[ 'input', 'sbb-date-input', 'sbb-time-input', ]",
106572
106394
  "inheritedFrom": {
106573
- "name": "SbbOpenCloseBaseElement",
106574
- "module": "core/base-elements/open-close-base-element.js"
106395
+ "name": "SbbButtonBaseElement",
106396
+ "module": "core/base-elements/button-base-element.js"
106575
106397
  }
106576
106398
  },
106577
106399
  {
106578
- "kind": "method",
106579
- "name": "closeAll",
106400
+ "kind": "field",
106401
+ "name": "value",
106402
+ "type": {
106403
+ "text": "string"
106404
+ },
106580
106405
  "privacy": "public",
106581
- "return": {
106582
- "type": {
106583
- "text": "void"
106584
- }
106406
+ "inheritedFrom": {
106407
+ "name": "SbbButtonBaseElement",
106408
+ "module": "core/base-elements/button-base-element.js"
106585
106409
  },
106586
- "description": "Closes the menu and all related menus (nested and parent menus)."
106410
+ "default": "''",
106411
+ "description": "Value of the form element.",
106412
+ "attribute": "value"
106587
106413
  },
106588
106414
  {
106589
- "kind": "method",
106590
- "name": "_close",
106591
- "privacy": "private",
106592
- "return": {
106593
- "type": {
106594
- "text": "void"
106595
- }
106415
+ "kind": "field",
106416
+ "name": "type",
106417
+ "privacy": "public",
106418
+ "description": "The type attribute to use for the button.",
106419
+ "default": "'button'",
106420
+ "type": {
106421
+ "text": "SbbButtonType"
106596
106422
  },
106597
- "parameters": [
106598
- {
106599
- "name": "closeAll",
106600
- "default": "false",
106601
- "description": "If true, it ensures animations are correct by toggling some states when closing all related menus at once.",
106602
- "optional": true
106603
- }
106604
- ]
106423
+ "attribute": "type",
106424
+ "inheritedFrom": {
106425
+ "name": "SbbButtonBaseElement",
106426
+ "module": "core/base-elements/button-base-element.js"
106427
+ }
106605
106428
  },
106606
106429
  {
106607
- "kind": "method",
106608
- "name": "_isZeroAnimationDuration",
106609
- "privacy": "private",
106610
- "return": {
106611
- "type": {
106612
- "text": "boolean"
106613
- }
106614
- }
106430
+ "kind": "field",
106431
+ "name": "form",
106432
+ "type": {
106433
+ "text": "HTMLFormElement | null"
106434
+ },
106435
+ "privacy": "public",
106436
+ "description": "The `<form>` element to associate the button with.",
106437
+ "inheritedFrom": {
106438
+ "name": "SbbButtonBaseElement",
106439
+ "module": "core/base-elements/button-base-element.js"
106440
+ },
106441
+ "attribute": "form"
106615
106442
  },
106616
106443
  {
106617
- "kind": "method",
106618
- "name": "_handleOpening",
106444
+ "kind": "field",
106445
+ "name": "_formId",
106446
+ "type": {
106447
+ "text": "string"
106448
+ },
106619
106449
  "privacy": "private",
106620
- "return": {
106621
- "type": {
106622
- "text": "void"
106623
- }
106450
+ "default": "''",
106451
+ "inheritedFrom": {
106452
+ "name": "SbbButtonBaseElement",
106453
+ "module": "core/base-elements/button-base-element.js"
106624
106454
  }
106625
106455
  },
106626
106456
  {
106627
- "kind": "method",
106628
- "name": "_handleClosing",
106457
+ "kind": "field",
106458
+ "name": "_handleButtonClick",
106629
106459
  "privacy": "private",
106630
- "return": {
106631
- "type": {
106632
- "text": "void"
106633
- }
106460
+ "inheritedFrom": {
106461
+ "name": "SbbButtonBaseElement",
106462
+ "module": "core/base-elements/button-base-element.js"
106634
106463
  }
106635
106464
  },
106636
106465
  {
106637
106466
  "kind": "method",
106638
- "name": "_handleKeyDown",
106467
+ "name": "_requestSubmit",
106639
106468
  "privacy": "private",
106640
106469
  "return": {
106641
106470
  "type": {
@@ -106644,117 +106473,220 @@
106644
106473
  },
106645
106474
  "parameters": [
106646
106475
  {
106647
- "name": "evt",
106476
+ "name": "form",
106648
106477
  "type": {
106649
- "text": "KeyboardEvent"
106478
+ "text": "HTMLFormElement"
106650
106479
  }
106651
106480
  }
106652
- ]
106481
+ ],
106482
+ "inheritedFrom": {
106483
+ "name": "SbbButtonBaseElement",
106484
+ "module": "core/base-elements/button-base-element.js"
106485
+ }
106653
106486
  },
106654
106487
  {
106655
- "kind": "method",
106656
- "name": "_configureTrigger",
106488
+ "kind": "field",
106489
+ "name": "_formKeyDown",
106657
106490
  "privacy": "private",
106658
- "return": {
106659
- "type": {
106660
- "text": "void"
106661
- }
106491
+ "inheritedFrom": {
106492
+ "name": "SbbButtonBaseElement",
106493
+ "module": "core/base-elements/button-base-element.js"
106662
106494
  }
106663
106495
  },
106664
106496
  {
106665
- "kind": "method",
106666
- "name": "_attachWindowEvents",
106667
- "privacy": "private",
106668
- "return": {
106669
- "type": {
106670
- "text": "void"
106671
- }
106497
+ "kind": "field",
106498
+ "name": "formAssociated",
106499
+ "type": {
106500
+ "text": "boolean"
106501
+ },
106502
+ "privacy": "public",
106503
+ "static": true,
106504
+ "default": "true",
106505
+ "inheritedFrom": {
106506
+ "name": "SbbFormAssociatedMixin",
106507
+ "module": "core/mixins/form-associated-mixin.js"
106672
106508
  }
106673
106509
  },
106674
106510
  {
106675
- "kind": "method",
106676
- "name": "_interactiveElementClick",
106677
- "privacy": "private",
106678
- "return": {
106679
- "type": {
106680
- "text": "void"
106681
- }
106511
+ "kind": "field",
106512
+ "name": "name",
106513
+ "privacy": "public",
106514
+ "description": "Name of the form element. Will be read from name attribute.",
106515
+ "type": {
106516
+ "text": "string"
106682
106517
  },
106683
- "parameters": [
106684
- {
106685
- "name": "event",
106686
- "type": {
106687
- "text": "Event"
106688
- }
106689
- }
106690
- ]
106518
+ "attribute": "name",
106519
+ "inheritedFrom": {
106520
+ "name": "SbbFormAssociatedMixin",
106521
+ "module": "core/mixins/form-associated-mixin.js"
106522
+ }
106691
106523
  },
106692
106524
  {
106693
106525
  "kind": "field",
106694
- "name": "_pointerDownListener",
106695
- "privacy": "private"
106526
+ "name": "validity",
106527
+ "type": {
106528
+ "text": "ValidityState"
106529
+ },
106530
+ "privacy": "public",
106531
+ "description": "Returns the ValidityState object for this element.",
106532
+ "readonly": true,
106533
+ "inheritedFrom": {
106534
+ "name": "SbbFormAssociatedMixin",
106535
+ "module": "core/mixins/form-associated-mixin.js"
106536
+ }
106696
106537
  },
106697
106538
  {
106698
106539
  "kind": "field",
106699
- "name": "_closeOnBackdropClick",
106700
- "privacy": "private"
106540
+ "name": "validationMessage",
106541
+ "type": {
106542
+ "text": "string"
106543
+ },
106544
+ "privacy": "public",
106545
+ "description": "Returns the current error message, if available, which corresponds\nto the current validation state.\nPlease note that only one message is returned at a time (e.g. if\nmultiple validity states are invalid, only the chronologically first one\nis returned until it is fixed, at which point the next message might be\nreturned, if it is still applicable). Also, a custom validity message\n(see below) has precedence over native validation messages.",
106546
+ "readonly": true,
106547
+ "inheritedFrom": {
106548
+ "name": "SbbFormAssociatedMixin",
106549
+ "module": "core/mixins/form-associated-mixin.js"
106550
+ }
106551
+ },
106552
+ {
106553
+ "kind": "field",
106554
+ "name": "willValidate",
106555
+ "type": {
106556
+ "text": "boolean"
106557
+ },
106558
+ "privacy": "public",
106559
+ "description": "Returns true if this element will be validated\nwhen the form is submitted; false otherwise.",
106560
+ "readonly": true,
106561
+ "inheritedFrom": {
106562
+ "name": "SbbFormAssociatedMixin",
106563
+ "module": "core/mixins/form-associated-mixin.js"
106564
+ }
106565
+ },
106566
+ {
106567
+ "kind": "field",
106568
+ "name": "_validityStates",
106569
+ "privacy": "private",
106570
+ "default": "new Map< keyof ValidityStateFlags, { flagValue: unknown; message: string } >()",
106571
+ "inheritedFrom": {
106572
+ "name": "SbbFormAssociatedMixin",
106573
+ "module": "core/mixins/form-associated-mixin.js"
106574
+ }
106575
+ },
106576
+ {
106577
+ "kind": "field",
106578
+ "name": "formDisabled",
106579
+ "type": {
106580
+ "text": "boolean"
106581
+ },
106582
+ "privacy": "protected",
106583
+ "default": "false",
106584
+ "description": "Whenever a surrounding form or fieldset is changing its disabled state.",
106585
+ "inheritedFrom": {
106586
+ "name": "SbbFormAssociatedMixin",
106587
+ "module": "core/mixins/form-associated-mixin.js"
106588
+ }
106701
106589
  },
106702
106590
  {
106703
106591
  "kind": "method",
106704
- "name": "_nestedMenus",
106705
- "privacy": "private",
106592
+ "name": "checkValidity",
106593
+ "privacy": "public",
106706
106594
  "return": {
106707
106595
  "type": {
106708
- "text": "SbbMenuElement[]"
106596
+ "text": "boolean"
106709
106597
  }
106710
106598
  },
106711
- "description": "Converts the linked list into an array of SbbMenuElement."
106599
+ "description": "Returns true if this element has no validity problems; false otherwise.\nFires an invalid event at the element in the latter case.",
106600
+ "inheritedFrom": {
106601
+ "name": "SbbFormAssociatedMixin",
106602
+ "module": "core/mixins/form-associated-mixin.js"
106603
+ }
106712
106604
  },
106713
106605
  {
106714
106606
  "kind": "method",
106715
- "name": "_parentMenu",
106716
- "privacy": "private",
106607
+ "name": "reportValidity",
106608
+ "privacy": "public",
106717
106609
  "return": {
106718
106610
  "type": {
106719
- "text": "SbbMenuElement | null"
106611
+ "text": "boolean"
106720
106612
  }
106613
+ },
106614
+ "description": "Returns true if this element has no validity problems; otherwise,\nreturns false, fires an invalid event at the element,\nand (if the event isn't canceled) reports the problem to the user.",
106615
+ "inheritedFrom": {
106616
+ "name": "SbbFormAssociatedMixin",
106617
+ "module": "core/mixins/form-associated-mixin.js"
106721
106618
  }
106722
106619
  },
106723
106620
  {
106724
106621
  "kind": "method",
106725
- "name": "_mainMenu",
106726
- "privacy": "private",
106622
+ "name": "setCustomValidity",
106623
+ "privacy": "public",
106727
106624
  "return": {
106728
106625
  "type": {
106729
- "text": "SbbMenuElement"
106626
+ "text": "void"
106730
106627
  }
106731
106628
  },
106732
- "description": "The outermost menu."
106629
+ "parameters": [
106630
+ {
106631
+ "name": "message",
106632
+ "type": {
106633
+ "text": "string"
106634
+ }
106635
+ }
106636
+ ],
106637
+ "description": "Sets the custom validity message for this element. Use the empty string\nto indicate that the element does not have a custom validity error.",
106638
+ "inheritedFrom": {
106639
+ "name": "SbbFormAssociatedMixin",
106640
+ "module": "core/mixins/form-associated-mixin.js"
106641
+ }
106733
106642
  },
106734
106643
  {
106735
106644
  "kind": "method",
106736
- "name": "_isNested",
106645
+ "name": "_hasDisabledAncestor",
106737
106646
  "privacy": "private",
106738
106647
  "return": {
106739
106648
  "type": {
106740
106649
  "text": "boolean"
106741
106650
  }
106651
+ },
106652
+ "inheritedFrom": {
106653
+ "name": "SbbFormAssociatedMixin",
106654
+ "module": "core/mixins/form-associated-mixin.js"
106742
106655
  }
106743
106656
  },
106744
106657
  {
106745
106658
  "kind": "method",
106746
- "name": "_updateNestedInert",
106747
- "privacy": "private",
106659
+ "name": "updateFormValue",
106660
+ "privacy": "protected",
106748
106661
  "return": {
106749
106662
  "type": {
106750
106663
  "text": "void"
106751
106664
  }
106665
+ },
106666
+ "description": "Should be called when form value is changed.\nAdapts and sets the formValue in the supported format (string | FormData | File | null)\nhttps://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue",
106667
+ "inheritedFrom": {
106668
+ "name": "SbbFormAssociatedMixin",
106669
+ "module": "core/mixins/form-associated-mixin.js"
106752
106670
  }
106753
106671
  },
106754
106672
  {
106755
106673
  "kind": "method",
106756
- "name": "_handleMouseOver",
106757
- "privacy": "private",
106674
+ "name": "formState",
106675
+ "privacy": "protected",
106676
+ "return": {
106677
+ "type": {
106678
+ "text": "FormRestoreState"
106679
+ }
106680
+ },
106681
+ "inheritedFrom": {
106682
+ "name": "SbbFormAssociatedMixin",
106683
+ "module": "core/mixins/form-associated-mixin.js"
106684
+ }
106685
+ },
106686
+ {
106687
+ "kind": "method",
106688
+ "name": "setValidityFlag",
106689
+ "privacy": "protected",
106758
106690
  "return": {
106759
106691
  "type": {
106760
106692
  "text": "void"
@@ -106762,17 +106694,35 @@
106762
106694
  },
106763
106695
  "parameters": [
106764
106696
  {
106765
- "name": "event",
106697
+ "name": "flag",
106766
106698
  "type": {
106767
- "text": "MouseEvent"
106699
+ "text": "T"
106700
+ }
106701
+ },
106702
+ {
106703
+ "name": "message",
106704
+ "type": {
106705
+ "text": "string"
106706
+ }
106707
+ },
106708
+ {
106709
+ "name": "flagValue",
106710
+ "optional": true,
106711
+ "type": {
106712
+ "text": "ValidityStateFlags[T]"
106768
106713
  }
106769
106714
  }
106770
- ]
106715
+ ],
106716
+ "description": "Marks this element as suffering from the constraint indicated by the\nflag argument and associates the given message to it.\nNote that only one message is displayed at a time and custom messages by\nconsumers are always displayed before internal messages and internal\nmessages are displayed in the order they were added.\nTo set/define custom validity state flags, you need to extend the\nValidityState prototype (and the CustomValidityState interface).",
106717
+ "inheritedFrom": {
106718
+ "name": "SbbFormAssociatedMixin",
106719
+ "module": "core/mixins/form-associated-mixin.js"
106720
+ }
106771
106721
  },
106772
106722
  {
106773
106723
  "kind": "method",
106774
- "name": "_onMenuAnimationEnd",
106775
- "privacy": "private",
106724
+ "name": "removeValidityFlag",
106725
+ "privacy": "protected",
106776
106726
  "return": {
106777
106727
  "type": {
106778
106728
  "text": "void"
@@ -106780,152 +106730,158 @@
106780
106730
  },
106781
106731
  "parameters": [
106782
106732
  {
106783
- "name": "event",
106733
+ "name": "flag",
106784
106734
  "type": {
106785
- "text": "AnimationEvent"
106735
+ "text": "T"
106786
106736
  }
106787
106737
  }
106788
- ]
106738
+ ],
106739
+ "description": "Removes the validity state flag entry and updates validity state.",
106740
+ "inheritedFrom": {
106741
+ "name": "SbbFormAssociatedMixin",
106742
+ "module": "core/mixins/form-associated-mixin.js"
106743
+ }
106789
106744
  },
106790
106745
  {
106791
106746
  "kind": "method",
106792
- "name": "_setMenuPosition",
106793
- "privacy": "private",
106747
+ "name": "validate",
106748
+ "privacy": "protected",
106794
106749
  "return": {
106795
106750
  "type": {
106796
106751
  "text": "void"
106797
106752
  }
106753
+ },
106754
+ "description": "To be called whenever the current element needs to be validated.",
106755
+ "inheritedFrom": {
106756
+ "name": "SbbFormAssociatedMixin",
106757
+ "module": "core/mixins/form-associated-mixin.js"
106798
106758
  }
106799
106759
  },
106800
106760
  {
106801
106761
  "kind": "method",
106802
- "name": "_syncNegative",
106803
- "privacy": "private",
106762
+ "name": "shouldValidate",
106763
+ "privacy": "protected",
106804
106764
  "return": {
106805
106765
  "type": {
106806
- "text": "void"
106766
+ "text": "boolean"
106767
+ }
106768
+ },
106769
+ "parameters": [
106770
+ {
106771
+ "name": "name",
106772
+ "type": {
106773
+ "text": "PropertyKey | undefined"
106774
+ }
106807
106775
  }
106776
+ ],
106777
+ "description": "Whether validation should be run on a property change with the given name.",
106778
+ "inheritedFrom": {
106779
+ "name": "SbbFormAssociatedMixin",
106780
+ "module": "core/mixins/form-associated-mixin.js"
106808
106781
  }
106809
106782
  },
106810
106783
  {
106811
106784
  "kind": "method",
106812
- "name": "_isMobile",
106785
+ "name": "_setInternalValidity",
106813
106786
  "privacy": "private",
106814
106787
  "return": {
106815
106788
  "type": {
106816
- "text": "boolean"
106789
+ "text": "void"
106817
106790
  }
106818
- }
106819
- },
106820
- {
106821
- "kind": "field",
106822
- "name": "events",
106823
- "privacy": "public",
106824
- "static": true,
106825
- "readonly": true,
106826
- "default": "{ beforeopen: 'beforeopen', open: 'open', beforeclose: 'beforeclose', close: 'close', }",
106827
- "type": {
106828
- "text": "{\n beforeopen: 'beforeopen',\n open: 'open',\n beforeclose: 'beforeclose',\n close: 'close',\n }"
106829
106791
  },
106830
106792
  "inheritedFrom": {
106831
- "name": "SbbOpenCloseBaseElement",
106832
- "module": "core/base-elements/open-close-base-element.js"
106793
+ "name": "SbbFormAssociatedMixin",
106794
+ "module": "core/mixins/form-associated-mixin.js"
106833
106795
  }
106834
106796
  },
106835
106797
  {
106836
106798
  "kind": "field",
106837
- "name": "state",
106838
- "privacy": "protected",
106839
- "description": "The state of the component.",
106840
- "type": {
106841
- "text": "SbbOpenedClosedState"
106842
- },
106843
- "default": "'closed'",
106799
+ "name": "_preventScrollOnSpaceKeydown",
106800
+ "privacy": "private",
106801
+ "description": "Prevents scrolling from pressing Space, when the event target is an action element.\nAlso sets active state.",
106802
+ "parameters": [
106803
+ {
106804
+ "description": "The origin event.",
106805
+ "name": "event"
106806
+ }
106807
+ ],
106844
106808
  "inheritedFrom": {
106845
- "name": "SbbOpenCloseBaseElement",
106846
- "module": "core/base-elements/open-close-base-element.js"
106809
+ "name": "SbbButtonLikeBaseElement",
106810
+ "module": "core/base-elements/button-base-element.js"
106847
106811
  }
106848
106812
  },
106849
106813
  {
106850
106814
  "kind": "field",
106851
- "name": "_state",
106852
- "type": {
106853
- "text": "SbbOpenedClosedState"
106854
- },
106815
+ "name": "_removeActiveMarker",
106855
106816
  "privacy": "private",
106856
106817
  "inheritedFrom": {
106857
- "name": "SbbOpenCloseBaseElement",
106858
- "module": "core/base-elements/open-close-base-element.js"
106818
+ "name": "SbbButtonLikeBaseElement",
106819
+ "module": "core/base-elements/button-base-element.js"
106859
106820
  }
106860
106821
  },
106861
106822
  {
106862
106823
  "kind": "field",
106863
- "name": "isOpen",
106864
- "type": {
106865
- "text": "boolean"
106866
- },
106867
- "privacy": "public",
106868
- "description": "Whether the element is open.",
106869
- "readonly": true,
106824
+ "name": "_dispatchClickEventOnSpaceKeyup",
106825
+ "privacy": "private",
106826
+ "description": "Dispatches a 'click' PointerEvent if the original keyboard event is a 'Space' press.\nAs verified with the native button, when 'Space' is pressed, a 'click' event is dispatched\nafter the 'keyup' event.",
106827
+ "parameters": [
106828
+ {
106829
+ "description": "The origin event.",
106830
+ "name": "event"
106831
+ }
106832
+ ],
106870
106833
  "inheritedFrom": {
106871
- "name": "SbbOpenCloseBaseElement",
106872
- "module": "core/base-elements/open-close-base-element.js"
106834
+ "name": "SbbButtonLikeBaseElement",
106835
+ "module": "core/base-elements/button-base-element.js"
106873
106836
  }
106874
106837
  },
106875
106838
  {
106876
- "kind": "method",
106877
- "name": "dispatchBeforeOpenEvent",
106878
- "privacy": "protected",
106879
- "return": {
106880
- "type": {
106881
- "text": "boolean"
106882
- }
106883
- },
106839
+ "kind": "field",
106840
+ "name": "_dispatchClickEvent",
106841
+ "privacy": "private",
106884
106842
  "inheritedFrom": {
106885
- "name": "SbbOpenCloseBaseElement",
106886
- "module": "core/base-elements/open-close-base-element.js"
106843
+ "name": "SbbButtonLikeBaseElement",
106844
+ "module": "core/base-elements/button-base-element.js"
106887
106845
  }
106888
106846
  },
106889
106847
  {
106890
- "kind": "method",
106891
- "name": "dispatchOpenEvent",
106892
- "privacy": "protected",
106893
- "return": {
106894
- "type": {
106895
- "text": "boolean"
106896
- }
106848
+ "kind": "field",
106849
+ "name": "maybeDisabled",
106850
+ "type": {
106851
+ "text": "boolean | undefined"
106897
106852
  },
106853
+ "privacy": "protected",
106854
+ "readonly": true,
106898
106855
  "inheritedFrom": {
106899
- "name": "SbbOpenCloseBaseElement",
106900
- "module": "core/base-elements/open-close-base-element.js"
106856
+ "name": "SbbActionBaseElement",
106857
+ "module": "core/base-elements/action-base-element.js"
106901
106858
  }
106902
106859
  },
106903
106860
  {
106904
- "kind": "method",
106905
- "name": "dispatchBeforeCloseEvent",
106906
- "privacy": "protected",
106907
- "return": {
106908
- "type": {
106909
- "text": "boolean"
106910
- }
106861
+ "kind": "field",
106862
+ "name": "maybeDisabledInteractive",
106863
+ "type": {
106864
+ "text": "boolean | undefined"
106911
106865
  },
106866
+ "privacy": "protected",
106867
+ "readonly": true,
106912
106868
  "inheritedFrom": {
106913
- "name": "SbbOpenCloseBaseElement",
106914
- "module": "core/base-elements/open-close-base-element.js"
106869
+ "name": "SbbActionBaseElement",
106870
+ "module": "core/base-elements/action-base-element.js"
106915
106871
  }
106916
106872
  },
106917
106873
  {
106918
106874
  "kind": "method",
106919
- "name": "dispatchCloseEvent",
106875
+ "name": "setupBaseEventHandlers",
106920
106876
  "privacy": "protected",
106921
106877
  "return": {
106922
106878
  "type": {
106923
- "text": "boolean"
106879
+ "text": "void"
106924
106880
  }
106925
106881
  },
106926
106882
  "inheritedFrom": {
106927
- "name": "SbbOpenCloseBaseElement",
106928
- "module": "core/base-elements/open-close-base-element.js"
106883
+ "name": "SbbActionBaseElement",
106884
+ "module": "core/base-elements/action-base-element.js"
106929
106885
  }
106930
106886
  },
106931
106887
  {
@@ -107034,66 +106990,110 @@
107034
106990
  }
107035
106991
  }
107036
106992
  ],
107037
- "attributes": [
106993
+ "mixins": [
107038
106994
  {
107039
- "name": "trigger",
107040
- "type": {
107041
- "text": "HTMLElement | null"
107042
- },
107043
- "default": "null",
107044
- "description": "The element that will trigger the menu overlay.\n\nFor attribute usage, provide an id reference.",
107045
- "fieldName": "trigger"
106995
+ "name": "SbbDisabledTabIndexActionMixin",
106996
+ "module": "core/mixins.js"
106997
+ },
106998
+ {
106999
+ "name": "SbbMenuActionCommonElementMixin",
107000
+ "module": "menu/common/menu-action-common.js"
107046
107001
  }
107047
107002
  ],
107048
107003
  "superclass": {
107049
- "name": "SbbOpenCloseBaseElement",
107004
+ "name": "SbbButtonBaseElement",
107050
107005
  "module": "core/base-elements.js"
107051
107006
  },
107052
- "tagName": "sbb-menu",
107007
+ "tagName": "sbb-menu-button",
107053
107008
  "customElement": true,
107054
- "events": [
107009
+ "attributes": [
107055
107010
  {
107056
- "name": "beforeopen",
107011
+ "name": "disabled-interactive",
107057
107012
  "type": {
107058
- "text": "Event"
107013
+ "text": "boolean"
107059
107014
  },
107060
- "description": "Emits whenever the component starts the opening transition. Can be canceled.",
107015
+ "default": "false",
107016
+ "description": "Whether the button should be aria-disabled but stay interactive.",
107017
+ "fieldName": "disabledInteractive",
107061
107018
  "inheritedFrom": {
107062
- "name": "SbbOpenCloseBaseElement",
107063
- "module": "core/base-elements/open-close-base-element.js"
107019
+ "name": "SbbDisabledInteractiveMixin",
107020
+ "module": "core/mixins/disabled-mixin.js"
107064
107021
  }
107065
107022
  },
107066
107023
  {
107067
- "name": "open",
107024
+ "name": "disabled",
107025
+ "description": "Whether the component is disabled.",
107026
+ "default": "false",
107068
107027
  "type": {
107069
- "text": "Event"
107028
+ "text": "boolean"
107070
107029
  },
107071
- "description": "Emits whenever the component is opened.",
107030
+ "fieldName": "disabled",
107072
107031
  "inheritedFrom": {
107073
- "name": "SbbOpenCloseBaseElement",
107074
- "module": "core/base-elements/open-close-base-element.js"
107032
+ "name": "SbbDisabledMixin",
107033
+ "module": "core/mixins/disabled-mixin.js"
107075
107034
  }
107076
107035
  },
107077
107036
  {
107078
- "name": "beforeclose",
107037
+ "name": "icon-name",
107079
107038
  "type": {
107080
- "text": "Event"
107039
+ "text": "string"
107081
107040
  },
107082
- "description": "Emits whenever the component begins the closing transition. Can be canceled.",
107041
+ "default": "''",
107042
+ "description": "The icon name we want to use, choose from the small icon variants\nfrom the ui-icons category from here\nhttps://icons.app.sbb.ch.",
107043
+ "fieldName": "iconName",
107083
107044
  "inheritedFrom": {
107084
- "name": "SbbOpenCloseBaseElement",
107085
- "module": "core/base-elements/open-close-base-element.js"
107045
+ "name": "SbbIconNameMixin",
107046
+ "module": "icon/icon-name-mixin.js"
107086
107047
  }
107087
107048
  },
107088
107049
  {
107089
- "name": "close",
107050
+ "name": "value",
107090
107051
  "type": {
107091
- "text": "Event"
107052
+ "text": "string"
107092
107053
  },
107093
- "description": "Emits whenever the component is closed.",
107054
+ "default": "''",
107055
+ "description": "Value of the form element.",
107056
+ "fieldName": "value",
107094
107057
  "inheritedFrom": {
107095
- "name": "SbbOpenCloseBaseElement",
107096
- "module": "core/base-elements/open-close-base-element.js"
107058
+ "name": "SbbButtonBaseElement",
107059
+ "module": "core/base-elements/button-base-element.js"
107060
+ }
107061
+ },
107062
+ {
107063
+ "name": "type",
107064
+ "description": "The type attribute to use for the button.",
107065
+ "default": "'button'",
107066
+ "type": {
107067
+ "text": "SbbButtonType"
107068
+ },
107069
+ "fieldName": "type",
107070
+ "inheritedFrom": {
107071
+ "name": "SbbButtonBaseElement",
107072
+ "module": "core/base-elements/button-base-element.js"
107073
+ }
107074
+ },
107075
+ {
107076
+ "name": "form",
107077
+ "description": "The `<form>` element to associate the button with.",
107078
+ "type": {
107079
+ "text": "HTMLFormElement | null"
107080
+ },
107081
+ "fieldName": "form",
107082
+ "inheritedFrom": {
107083
+ "name": "SbbButtonBaseElement",
107084
+ "module": "core/base-elements/button-base-element.js"
107085
+ }
107086
+ },
107087
+ {
107088
+ "name": "name",
107089
+ "description": "Name of the form element. Will be read from name attribute.",
107090
+ "type": {
107091
+ "text": "string"
107092
+ },
107093
+ "fieldName": "name",
107094
+ "inheritedFrom": {
107095
+ "name": "SbbFormAssociatedMixin",
107096
+ "module": "core/mixins/form-associated-mixin.js"
107097
107097
  }
107098
107098
  }
107099
107099
  ]
@@ -107102,10 +107102,10 @@
107102
107102
  "exports": [
107103
107103
  {
107104
107104
  "kind": "js",
107105
- "name": "SbbMenuElement",
107105
+ "name": "SbbMenuButtonElement",
107106
107106
  "declaration": {
107107
- "name": "SbbMenuElement",
107108
- "module": "menu/menu/menu.component.js"
107107
+ "name": "SbbMenuButtonElement",
107108
+ "module": "menu/menu-button/menu-button.component.js"
107109
107109
  }
107110
107110
  }
107111
107111
  ]
@@ -130114,16 +130114,20 @@
130114
130114
  },
130115
130115
  {
130116
130116
  "kind": "javascript-module",
130117
- "path": "toggle/toggle/toggle.component.js",
130117
+ "path": "toggle/toggle-option/toggle-option.component.js",
130118
130118
  "declarations": [
130119
130119
  {
130120
130120
  "kind": "class",
130121
- "description": "It can be used as a container for two `sbb-toggle-option`, acting as a toggle button.",
130122
- "name": "SbbToggleElement",
130121
+ "description": "It displays a toggle option within a `sbb-toggle`.",
130122
+ "name": "SbbToggleOptionElement",
130123
130123
  "slots": [
130124
130124
  {
130125
- "description": "Use the unnamed slot to add `<sbb-toggle-option>` elements to the toggle.",
130125
+ "description": "Use the unnamed slot to add content to the label of the toggle option.",
130126
130126
  "name": ""
130127
+ },
130128
+ {
130129
+ "description": "Slot used to render the `sbb-icon`.",
130130
+ "name": "icon"
130127
130131
  }
130128
130132
  ],
130129
130133
  "members": [
@@ -130136,7 +130140,7 @@
130136
130140
  "privacy": "public",
130137
130141
  "static": true,
130138
130142
  "readonly": true,
130139
- "default": "'sbb-toggle'",
130143
+ "default": "'sbb-toggle-option'",
130140
130144
  "inheritedFrom": {
130141
130145
  "name": "SbbElement",
130142
130146
  "module": "core/base-elements/element.js"
@@ -130151,165 +130155,244 @@
130151
130155
  "privacy": "public",
130152
130156
  "static": true,
130153
130157
  "readonly": true,
130154
- "default": "'radiogroup'"
130155
- },
130156
- {
130157
- "kind": "field",
130158
- "name": "events",
130159
- "privacy": "public",
130160
- "static": true,
130161
- "readonly": true,
130162
- "default": "{ change: 'change', }",
130163
- "type": {
130164
- "text": "{\n change: 'change',\n }"
130165
- }
130158
+ "default": "'radio'"
130166
130159
  },
130167
130160
  {
130168
130161
  "kind": "field",
130169
- "name": "even",
130162
+ "name": "checked",
130170
130163
  "type": {
130171
130164
  "text": "boolean"
130172
130165
  },
130173
130166
  "privacy": "public",
130174
130167
  "default": "false",
130175
- "description": "If true, set the width of the component fixed; if false,\nthe width is dynamic based on the label of the sbb-toggle-option.",
130176
- "attribute": "even",
130168
+ "description": "Whether the toggle-option is checked.",
130169
+ "attribute": "checked",
130177
130170
  "reflects": true
130178
130171
  },
130179
130172
  {
130180
130173
  "kind": "field",
130181
- "name": "size",
130174
+ "name": "value",
130182
130175
  "type": {
130183
- "text": "'s' | 'm'"
130176
+ "text": "(T = string) | null"
130184
130177
  },
130185
130178
  "privacy": "public",
130186
- "description": "Size variant, either m or s.",
130187
- "default": "'m' / 's' (lean)",
130188
- "attribute": "size",
130189
- "reflects": true
130179
+ "default": "null",
130180
+ "description": "Value of toggle-option.",
130181
+ "attribute": "value"
130190
130182
  },
130191
130183
  {
130192
130184
  "kind": "field",
130193
- "name": "value",
130185
+ "name": "_toggle",
130194
130186
  "type": {
130195
- "text": "(T = string) | null"
130187
+ "text": "SbbToggleElement | null"
130196
130188
  },
130189
+ "privacy": "private",
130190
+ "default": "null"
130191
+ },
130192
+ {
130193
+ "kind": "method",
130194
+ "name": "_uncheckOtherOptions",
130195
+ "privacy": "private",
130196
+ "return": {
130197
+ "type": {
130198
+ "text": "void"
130199
+ }
130200
+ }
130201
+ },
130202
+ {
130203
+ "kind": "method",
130204
+ "name": "_handleDisabledChange",
130205
+ "privacy": "private",
130206
+ "return": {
130207
+ "type": {
130208
+ "text": "void"
130209
+ }
130210
+ }
130211
+ },
130212
+ {
130213
+ "kind": "method",
130214
+ "name": "_handleInput",
130215
+ "privacy": "private",
130216
+ "return": {
130217
+ "type": {
130218
+ "text": "void"
130219
+ }
130220
+ }
130221
+ },
130222
+ {
130223
+ "kind": "method",
130224
+ "name": "_verifyTabindex",
130225
+ "privacy": "private",
130226
+ "return": {
130227
+ "type": {
130228
+ "text": "void"
130229
+ }
130230
+ }
130231
+ },
130232
+ {
130233
+ "kind": "field",
130234
+ "name": "disabled",
130197
130235
  "privacy": "public",
130198
- "description": "The value of the toggle. It needs to be mutable since it is updated whenever\na new option is selected (see the `onToggleOptionSelect()` method).",
130199
- "attribute": "value",
130236
+ "description": "Whether the component is disabled.",
130237
+ "default": "false",
130238
+ "type": {
130239
+ "text": "boolean"
130240
+ },
130241
+ "attribute": "disabled",
130242
+ "reflects": true,
130243
+ "inheritedFrom": {
130244
+ "name": "SbbDisabledMixin",
130245
+ "module": "core/mixins/disabled-mixin.js"
130246
+ }
130247
+ },
130248
+ {
130249
+ "kind": "field",
130250
+ "name": "#disabled",
130251
+ "privacy": "private",
130252
+ "type": {
130253
+ "text": "boolean"
130254
+ },
130255
+ "default": "false",
130256
+ "inheritedFrom": {
130257
+ "name": "SbbDisabledMixin",
130258
+ "module": "core/mixins/disabled-mixin.js"
130259
+ }
130260
+ },
130261
+ {
130262
+ "kind": "method",
130263
+ "name": "isDisabledExternally",
130264
+ "privacy": "protected",
130265
+ "return": {
130266
+ "type": {
130267
+ "text": "boolean"
130268
+ }
130269
+ },
130270
+ "description": "Will be used as 'or' check to the current disabled state.\nCan e.g. be used to read disabled state of a group.",
130200
130271
  "inheritedFrom": {
130201
- "name": "SbbFormAssociatedMixin",
130202
- "module": "core/mixins/form-associated-mixin.js"
130272
+ "name": "SbbDisabledMixin",
130273
+ "module": "core/mixins/disabled-mixin.js"
130203
130274
  }
130204
130275
  },
130205
130276
  {
130206
130277
  "kind": "field",
130207
- "name": "_fallbackValue",
130208
- "type": {
130209
- "text": "T | null"
130210
- },
130211
- "privacy": "private",
130212
- "default": "null"
130213
- },
130214
- {
130215
- "kind": "field",
130216
- "name": "options",
130278
+ "name": "iconName",
130217
130279
  "type": {
130218
- "text": "SbbToggleOptionElement<T>[]"
130280
+ "text": "string"
130219
130281
  },
130220
130282
  "privacy": "public",
130221
- "description": "The child instances of sbb-toggle-option as an array.",
130222
- "readonly": true
130283
+ "default": "''",
130284
+ "description": "The icon name we want to use, choose from the small icon variants\nfrom the ui-icons category from here\nhttps://icons.app.sbb.ch.",
130285
+ "attribute": "icon-name",
130286
+ "inheritedFrom": {
130287
+ "name": "SbbIconNameMixin",
130288
+ "module": "icon/icon-name-mixin.js"
130289
+ }
130223
130290
  },
130224
130291
  {
130225
130292
  "kind": "method",
130226
- "name": "_readFormData",
130227
- "privacy": "private",
130293
+ "name": "renderIconSlot",
130294
+ "privacy": "protected",
130228
130295
  "return": {
130229
130296
  "type": {
130230
- "text": "Promise<T>"
130297
+ "text": "TemplateResult"
130231
130298
  }
130232
130299
  },
130233
130300
  "parameters": [
130234
130301
  {
130235
- "name": "formData",
130302
+ "name": "classname",
130303
+ "optional": true,
130236
130304
  "type": {
130237
- "text": "FormData"
130305
+ "text": "string"
130238
130306
  }
130239
130307
  }
130240
- ]
130308
+ ],
130309
+ "inheritedFrom": {
130310
+ "name": "SbbIconNameMixin",
130311
+ "module": "icon/icon-name-mixin.js"
130312
+ }
130241
130313
  },
130242
130314
  {
130243
130315
  "kind": "method",
130244
- "name": "_updateToggle",
130245
- "privacy": "private",
130316
+ "name": "renderIconName",
130317
+ "privacy": "protected",
130246
130318
  "return": {
130247
130319
  "type": {
130248
- "text": "void"
130320
+ "text": "string"
130249
130321
  }
130322
+ },
130323
+ "inheritedFrom": {
130324
+ "name": "SbbIconNameMixin",
130325
+ "module": "icon/icon-name-mixin.js"
130250
130326
  }
130251
130327
  },
130252
130328
  {
130253
130329
  "kind": "method",
130254
- "name": "_valueChanged",
130330
+ "name": "_renderIconName",
130255
130331
  "privacy": "private",
130256
130332
  "return": {
130257
130333
  "type": {
130258
- "text": "void"
130334
+ "text": "string"
130259
130335
  }
130260
130336
  },
130261
- "parameters": [
130262
- {
130263
- "name": "value",
130264
- "type": {
130265
- "text": "T | null"
130266
- }
130267
- }
130268
- ]
130337
+ "inheritedFrom": {
130338
+ "name": "SbbIconNameMixin",
130339
+ "module": "icon/icon-name-mixin.js"
130340
+ }
130269
130341
  },
130270
130342
  {
130271
- "kind": "method",
130272
- "name": "_updateDisabled",
130343
+ "kind": "field",
130344
+ "name": "_hydrationRequired",
130345
+ "type": {
130346
+ "text": "boolean"
130347
+ },
130273
130348
  "privacy": "private",
130274
- "return": {
130275
- "type": {
130276
- "text": "void"
130277
- }
130349
+ "default": "!!this.shadowRoot",
130350
+ "inheritedFrom": {
130351
+ "name": "SbbElement",
130352
+ "module": "core/base-elements/element.js"
130278
130353
  }
130279
130354
  },
130280
130355
  {
130281
- "kind": "method",
130282
- "name": "_handleInput",
130356
+ "kind": "field",
130357
+ "name": "_hydrationComplete",
130283
130358
  "privacy": "private",
130284
- "return": {
130285
- "type": {
130286
- "text": "void"
130287
- }
130288
- },
130289
- "description": "Called on user interaction (click or keyboard)"
130359
+ "default": "new Promise<boolean>( (resolve) => (this._resolveHydration = resolve), )",
130360
+ "inheritedFrom": {
130361
+ "name": "SbbElement",
130362
+ "module": "core/base-elements/element.js"
130363
+ }
130290
130364
  },
130291
130365
  {
130292
- "kind": "method",
130293
- "name": "_handleKeyDown",
130366
+ "kind": "field",
130367
+ "name": "_resolveHydration",
130368
+ "type": {
130369
+ "text": "(hydrationRequired: boolean) => void"
130370
+ },
130294
130371
  "privacy": "private",
130295
- "return": {
130296
- "type": {
130297
- "text": "void"
130298
- }
130372
+ "inheritedFrom": {
130373
+ "name": "SbbElement",
130374
+ "module": "core/base-elements/element.js"
130375
+ }
130376
+ },
130377
+ {
130378
+ "kind": "field",
130379
+ "name": "hydrationRequired",
130380
+ "type": {
130381
+ "text": "boolean"
130299
130382
  },
130300
- "parameters": [
130301
- {
130302
- "name": "evt",
130303
- "type": {
130304
- "text": "KeyboardEvent"
130305
- }
130306
- }
130307
- ]
130383
+ "privacy": "protected",
130384
+ "description": "Returns whether hydration is required and not completed.",
130385
+ "readonly": true,
130386
+ "inheritedFrom": {
130387
+ "name": "SbbElement",
130388
+ "module": "core/base-elements/element.js"
130389
+ },
130390
+ "default": "!!this.shadowRoot"
130308
130391
  },
130309
130392
  {
130310
130393
  "kind": "method",
130311
- "name": "_selectAndFocusOption",
130312
- "privacy": "private",
130394
+ "name": "toggleState",
130395
+ "privacy": "protected",
130313
130396
  "return": {
130314
130397
  "type": {
130315
130398
  "text": "void"
@@ -130317,136 +130400,212 @@
130317
130400
  },
130318
130401
  "parameters": [
130319
130402
  {
130320
- "name": "option",
130403
+ "name": "value",
130321
130404
  "type": {
130322
- "text": "SbbToggleOptionElement<T> | undefined"
130405
+ "text": "string"
130406
+ }
130407
+ },
130408
+ {
130409
+ "name": "force",
130410
+ "optional": true,
130411
+ "type": {
130412
+ "text": "boolean"
130323
130413
  }
130324
130414
  }
130325
- ]
130415
+ ],
130416
+ "inheritedFrom": {
130417
+ "name": "SbbElement",
130418
+ "module": "core/base-elements/element.js"
130419
+ }
130326
130420
  },
130327
130421
  {
130328
130422
  "kind": "field",
130329
- "name": "disabled",
130330
- "privacy": "public",
130331
- "description": "Whether the component is disabled.",
130332
- "default": "false",
130423
+ "name": "['_$sbbElement$']",
130333
130424
  "type": {
130334
130425
  "text": "boolean"
130335
130426
  },
130336
- "attribute": "disabled",
130337
- "reflects": true,
130427
+ "privacy": "public",
130428
+ "static": true,
130429
+ "default": "true",
130338
130430
  "inheritedFrom": {
130339
- "name": "SbbDisabledMixin",
130340
- "module": "core/mixins/disabled-mixin.js"
130431
+ "name": "SbbElement",
130432
+ "module": "core/base-elements/element.js"
130341
130433
  }
130342
130434
  },
130343
130435
  {
130344
130436
  "kind": "field",
130345
- "name": "#disabled",
130437
+ "name": "_controllers",
130438
+ "type": {
130439
+ "text": "Set<SbbReactiveController> | undefined"
130440
+ },
130346
130441
  "privacy": "private",
130442
+ "inheritedFrom": {
130443
+ "name": "SbbElement",
130444
+ "module": "core/base-elements/element.js"
130445
+ }
130446
+ }
130447
+ ],
130448
+ "attributes": [
130449
+ {
130450
+ "name": "checked",
130347
130451
  "type": {
130348
130452
  "text": "boolean"
130349
130453
  },
130350
130454
  "default": "false",
130455
+ "description": "Whether the toggle-option is checked.",
130456
+ "fieldName": "checked"
130457
+ },
130458
+ {
130459
+ "name": "value",
130460
+ "type": {
130461
+ "text": "T | null"
130462
+ },
130463
+ "default": "null",
130464
+ "description": "Value of toggle-option.",
130465
+ "fieldName": "value"
130466
+ },
130467
+ {
130468
+ "name": "disabled",
130469
+ "description": "Whether the component is disabled.",
130470
+ "default": "false",
130471
+ "type": {
130472
+ "text": "boolean"
130473
+ },
130474
+ "fieldName": "disabled",
130351
130475
  "inheritedFrom": {
130352
130476
  "name": "SbbDisabledMixin",
130353
130477
  "module": "core/mixins/disabled-mixin.js"
130354
130478
  }
130355
130479
  },
130356
130480
  {
130357
- "kind": "method",
130358
- "name": "isDisabledExternally",
130359
- "privacy": "protected",
130360
- "return": {
130361
- "type": {
130362
- "text": "boolean"
130363
- }
130481
+ "name": "icon-name",
130482
+ "type": {
130483
+ "text": "string"
130364
130484
  },
130365
- "description": "Will be used as 'or' check to the current disabled state.\nCan e.g. be used to read disabled state of a group.",
130485
+ "default": "''",
130486
+ "description": "The icon name we want to use, choose from the small icon variants\nfrom the ui-icons category from here\nhttps://icons.app.sbb.ch.",
130487
+ "fieldName": "iconName",
130366
130488
  "inheritedFrom": {
130367
- "name": "SbbDisabledMixin",
130368
- "module": "core/mixins/disabled-mixin.js"
130489
+ "name": "SbbIconNameMixin",
130490
+ "module": "icon/icon-name-mixin.js"
130369
130491
  }
130492
+ }
130493
+ ],
130494
+ "mixins": [
130495
+ {
130496
+ "name": "SbbDisabledMixin",
130497
+ "module": "core/mixins.js"
130370
130498
  },
130499
+ {
130500
+ "name": "SbbIconNameMixin",
130501
+ "module": "icon.js"
130502
+ }
130503
+ ],
130504
+ "superclass": {
130505
+ "name": "SbbElement",
130506
+ "module": "core/base-elements.js"
130507
+ },
130508
+ "tagName": "sbb-toggle-option",
130509
+ "customElement": true,
130510
+ "classGenerics": "T = string"
130511
+ }
130512
+ ],
130513
+ "exports": [
130514
+ {
130515
+ "kind": "js",
130516
+ "name": "SbbToggleOptionElement",
130517
+ "declaration": {
130518
+ "name": "SbbToggleOptionElement",
130519
+ "module": "toggle/toggle-option/toggle-option.component.js"
130520
+ }
130521
+ }
130522
+ ]
130523
+ },
130524
+ {
130525
+ "kind": "javascript-module",
130526
+ "path": "toggle/toggle/toggle.component.js",
130527
+ "declarations": [
130528
+ {
130529
+ "kind": "class",
130530
+ "description": "It can be used as a container for two `sbb-toggle-option`, acting as a toggle button.",
130531
+ "name": "SbbToggleElement",
130532
+ "slots": [
130533
+ {
130534
+ "description": "Use the unnamed slot to add `<sbb-toggle-option>` elements to the toggle.",
130535
+ "name": ""
130536
+ }
130537
+ ],
130538
+ "members": [
130371
130539
  {
130372
130540
  "kind": "field",
130373
- "name": "formAssociated",
130541
+ "name": "elementName",
130374
130542
  "type": {
130375
- "text": "boolean"
130543
+ "text": "string"
130376
130544
  },
130377
130545
  "privacy": "public",
130378
130546
  "static": true,
130379
- "default": "true",
130547
+ "readonly": true,
130548
+ "default": "'sbb-toggle'",
130380
130549
  "inheritedFrom": {
130381
- "name": "SbbFormAssociatedMixin",
130382
- "module": "core/mixins/form-associated-mixin.js"
130550
+ "name": "SbbElement",
130551
+ "module": "core/base-elements/element.js"
130383
130552
  }
130384
130553
  },
130385
130554
  {
130386
130555
  "kind": "field",
130387
- "name": "form",
130556
+ "name": "role",
130388
130557
  "type": {
130389
- "text": "HTMLFormElement | null"
130558
+ "text": "string"
130390
130559
  },
130391
130560
  "privacy": "public",
130392
- "description": "Returns the form owner of this element.",
130561
+ "static": true,
130393
130562
  "readonly": true,
130394
- "inheritedFrom": {
130395
- "name": "SbbFormAssociatedMixin",
130396
- "module": "core/mixins/form-associated-mixin.js"
130397
- }
130563
+ "default": "'radiogroup'"
130398
130564
  },
130399
130565
  {
130400
130566
  "kind": "field",
130401
- "name": "name",
130567
+ "name": "events",
130402
130568
  "privacy": "public",
130403
- "description": "Name of the form element. Will be read from name attribute.",
130569
+ "static": true,
130570
+ "readonly": true,
130571
+ "default": "{ change: 'change', }",
130404
130572
  "type": {
130405
- "text": "string"
130406
- },
130407
- "attribute": "name",
130408
- "inheritedFrom": {
130409
- "name": "SbbFormAssociatedMixin",
130410
- "module": "core/mixins/form-associated-mixin.js"
130573
+ "text": "{\n change: 'change',\n }"
130411
130574
  }
130412
130575
  },
130413
130576
  {
130414
130577
  "kind": "field",
130415
- "name": "validity",
130578
+ "name": "even",
130416
130579
  "type": {
130417
- "text": "ValidityState"
130580
+ "text": "boolean"
130418
130581
  },
130419
130582
  "privacy": "public",
130420
- "description": "Returns the ValidityState object for this element.",
130421
- "readonly": true,
130422
- "inheritedFrom": {
130423
- "name": "SbbFormAssociatedMixin",
130424
- "module": "core/mixins/form-associated-mixin.js"
130425
- }
130583
+ "default": "false",
130584
+ "description": "If true, set the width of the component fixed; if false,\nthe width is dynamic based on the label of the sbb-toggle-option.",
130585
+ "attribute": "even",
130586
+ "reflects": true
130426
130587
  },
130427
130588
  {
130428
130589
  "kind": "field",
130429
- "name": "validationMessage",
130590
+ "name": "size",
130430
130591
  "type": {
130431
- "text": "string"
130592
+ "text": "'s' | 'm'"
130432
130593
  },
130433
130594
  "privacy": "public",
130434
- "description": "Returns the current error message, if available, which corresponds\nto the current validation state.\nPlease note that only one message is returned at a time (e.g. if\nmultiple validity states are invalid, only the chronologically first one\nis returned until it is fixed, at which point the next message might be\nreturned, if it is still applicable). Also, a custom validity message\n(see below) has precedence over native validation messages.",
130435
- "readonly": true,
130436
- "inheritedFrom": {
130437
- "name": "SbbFormAssociatedMixin",
130438
- "module": "core/mixins/form-associated-mixin.js"
130439
- }
130595
+ "description": "Size variant, either m or s.",
130596
+ "default": "'m' / 's' (lean)",
130597
+ "attribute": "size",
130598
+ "reflects": true
130440
130599
  },
130441
130600
  {
130442
130601
  "kind": "field",
130443
- "name": "willValidate",
130602
+ "name": "value",
130444
130603
  "type": {
130445
- "text": "boolean"
130604
+ "text": "(T = string) | null"
130446
130605
  },
130447
130606
  "privacy": "public",
130448
- "description": "Returns true if this element will be validated\nwhen the form is submitted; false otherwise.",
130449
- "readonly": true,
130607
+ "description": "The value of the toggle. It needs to be mutable since it is updated whenever\na new option is selected (see the `onToggleOptionSelect()` method).",
130608
+ "attribute": "value",
130450
130609
  "inheritedFrom": {
130451
130610
  "name": "SbbFormAssociatedMixin",
130452
130611
  "module": "core/mixins/form-associated-mixin.js"
@@ -130454,128 +130613,55 @@
130454
130613
  },
130455
130614
  {
130456
130615
  "kind": "field",
130457
- "name": "_validityStates",
130616
+ "name": "_fallbackValue",
130617
+ "type": {
130618
+ "text": "T | null"
130619
+ },
130458
130620
  "privacy": "private",
130459
- "default": "new Map< keyof ValidityStateFlags, { flagValue: unknown; message: string } >()",
130460
- "inheritedFrom": {
130461
- "name": "SbbFormAssociatedMixin",
130462
- "module": "core/mixins/form-associated-mixin.js"
130463
- }
130621
+ "default": "null"
130464
130622
  },
130465
130623
  {
130466
130624
  "kind": "field",
130467
- "name": "formDisabled",
130625
+ "name": "options",
130468
130626
  "type": {
130469
- "text": "boolean"
130470
- },
130471
- "privacy": "protected",
130472
- "default": "false",
130473
- "description": "Whenever a surrounding form or fieldset is changing its disabled state.",
130474
- "inheritedFrom": {
130475
- "name": "SbbFormAssociatedMixin",
130476
- "module": "core/mixins/form-associated-mixin.js"
130477
- }
130478
- },
130479
- {
130480
- "kind": "method",
130481
- "name": "checkValidity",
130482
- "privacy": "public",
130483
- "return": {
130484
- "type": {
130485
- "text": "boolean"
130486
- }
130627
+ "text": "SbbToggleOptionElement<T>[]"
130487
130628
  },
130488
- "description": "Returns true if this element has no validity problems; false otherwise.\nFires an invalid event at the element in the latter case.",
130489
- "inheritedFrom": {
130490
- "name": "SbbFormAssociatedMixin",
130491
- "module": "core/mixins/form-associated-mixin.js"
130492
- }
130493
- },
130494
- {
130495
- "kind": "method",
130496
- "name": "reportValidity",
130497
130629
  "privacy": "public",
130498
- "return": {
130499
- "type": {
130500
- "text": "boolean"
130501
- }
130502
- },
130503
- "description": "Returns true if this element has no validity problems; otherwise,\nreturns false, fires an invalid event at the element,\nand (if the event isn't canceled) reports the problem to the user.",
130504
- "inheritedFrom": {
130505
- "name": "SbbFormAssociatedMixin",
130506
- "module": "core/mixins/form-associated-mixin.js"
130507
- }
130630
+ "description": "The child instances of sbb-toggle-option as an array.",
130631
+ "readonly": true
130508
130632
  },
130509
130633
  {
130510
130634
  "kind": "method",
130511
- "name": "setCustomValidity",
130512
- "privacy": "public",
130635
+ "name": "_readFormData",
130636
+ "privacy": "private",
130513
130637
  "return": {
130514
130638
  "type": {
130515
- "text": "void"
130639
+ "text": "Promise<T>"
130516
130640
  }
130517
130641
  },
130518
130642
  "parameters": [
130519
130643
  {
130520
- "name": "message",
130644
+ "name": "formData",
130521
130645
  "type": {
130522
- "text": "string"
130646
+ "text": "FormData"
130523
130647
  }
130524
130648
  }
130525
- ],
130526
- "description": "Sets the custom validity message for this element. Use the empty string\nto indicate that the element does not have a custom validity error.",
130527
- "inheritedFrom": {
130528
- "name": "SbbFormAssociatedMixin",
130529
- "module": "core/mixins/form-associated-mixin.js"
130530
- }
130649
+ ]
130531
130650
  },
130532
130651
  {
130533
130652
  "kind": "method",
130534
- "name": "_hasDisabledAncestor",
130653
+ "name": "_updateToggle",
130535
130654
  "privacy": "private",
130536
- "return": {
130537
- "type": {
130538
- "text": "boolean"
130539
- }
130540
- },
130541
- "inheritedFrom": {
130542
- "name": "SbbFormAssociatedMixin",
130543
- "module": "core/mixins/form-associated-mixin.js"
130544
- }
130545
- },
130546
- {
130547
- "kind": "method",
130548
- "name": "updateFormValue",
130549
- "privacy": "protected",
130550
130655
  "return": {
130551
130656
  "type": {
130552
130657
  "text": "void"
130553
130658
  }
130554
- },
130555
- "description": "Should be called when form value is changed.\nAdapts and sets the formValue in the supported format (string | FormData | File | null)\nhttps://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue",
130556
- "inheritedFrom": {
130557
- "name": "SbbFormAssociatedMixin",
130558
- "module": "core/mixins/form-associated-mixin.js"
130559
- }
130560
- },
130561
- {
130562
- "kind": "method",
130563
- "name": "formState",
130564
- "privacy": "protected",
130565
- "return": {
130566
- "type": {
130567
- "text": "FormRestoreState"
130568
- }
130569
- },
130570
- "inheritedFrom": {
130571
- "name": "SbbFormAssociatedMixin",
130572
- "module": "core/mixins/form-associated-mixin.js"
130573
130659
  }
130574
130660
  },
130575
130661
  {
130576
130662
  "kind": "method",
130577
- "name": "setValidityFlag",
130578
- "privacy": "protected",
130663
+ "name": "_valueChanged",
130664
+ "privacy": "private",
130579
130665
  "return": {
130580
130666
  "type": {
130581
130667
  "text": "void"
@@ -130583,188 +130669,117 @@
130583
130669
  },
130584
130670
  "parameters": [
130585
130671
  {
130586
- "name": "flag",
130587
- "type": {
130588
- "text": "T"
130589
- }
130590
- },
130591
- {
130592
- "name": "message",
130593
- "type": {
130594
- "text": "string"
130595
- }
130596
- },
130597
- {
130598
- "name": "flagValue",
130599
- "optional": true,
130672
+ "name": "value",
130600
130673
  "type": {
130601
- "text": "ValidityStateFlags[T]"
130674
+ "text": "T | null"
130602
130675
  }
130603
130676
  }
130604
- ],
130605
- "description": "Marks this element as suffering from the constraint indicated by the\nflag argument and associates the given message to it.\nNote that only one message is displayed at a time and custom messages by\nconsumers are always displayed before internal messages and internal\nmessages are displayed in the order they were added.\nTo set/define custom validity state flags, you need to extend the\nValidityState prototype (and the CustomValidityState interface).",
130606
- "inheritedFrom": {
130607
- "name": "SbbFormAssociatedMixin",
130608
- "module": "core/mixins/form-associated-mixin.js"
130609
- }
130677
+ ]
130610
130678
  },
130611
130679
  {
130612
130680
  "kind": "method",
130613
- "name": "removeValidityFlag",
130614
- "privacy": "protected",
130681
+ "name": "_updateDisabled",
130682
+ "privacy": "private",
130615
130683
  "return": {
130616
130684
  "type": {
130617
130685
  "text": "void"
130618
130686
  }
130619
- },
130620
- "parameters": [
130621
- {
130622
- "name": "flag",
130623
- "type": {
130624
- "text": "T"
130625
- }
130626
- }
130627
- ],
130628
- "description": "Removes the validity state flag entry and updates validity state.",
130629
- "inheritedFrom": {
130630
- "name": "SbbFormAssociatedMixin",
130631
- "module": "core/mixins/form-associated-mixin.js"
130632
130687
  }
130633
130688
  },
130634
130689
  {
130635
130690
  "kind": "method",
130636
- "name": "validate",
130637
- "privacy": "protected",
130691
+ "name": "_handleInput",
130692
+ "privacy": "private",
130638
130693
  "return": {
130639
130694
  "type": {
130640
130695
  "text": "void"
130641
130696
  }
130642
130697
  },
130643
- "description": "To be called whenever the current element needs to be validated.",
130644
- "inheritedFrom": {
130645
- "name": "SbbFormAssociatedMixin",
130646
- "module": "core/mixins/form-associated-mixin.js"
130647
- }
130698
+ "description": "Called on user interaction (click or keyboard)"
130648
130699
  },
130649
130700
  {
130650
130701
  "kind": "method",
130651
- "name": "shouldValidate",
130652
- "privacy": "protected",
130702
+ "name": "_handleKeyDown",
130703
+ "privacy": "private",
130653
130704
  "return": {
130654
130705
  "type": {
130655
- "text": "boolean"
130706
+ "text": "void"
130656
130707
  }
130657
130708
  },
130658
130709
  "parameters": [
130659
130710
  {
130660
- "name": "name",
130711
+ "name": "evt",
130661
130712
  "type": {
130662
- "text": "PropertyKey | undefined"
130713
+ "text": "KeyboardEvent"
130663
130714
  }
130664
130715
  }
130665
- ],
130666
- "description": "Whether validation should be run on a property change with the given name.",
130667
- "inheritedFrom": {
130668
- "name": "SbbFormAssociatedMixin",
130669
- "module": "core/mixins/form-associated-mixin.js"
130670
- }
130716
+ ]
130671
130717
  },
130672
130718
  {
130673
130719
  "kind": "method",
130674
- "name": "_setInternalValidity",
130720
+ "name": "_selectAndFocusOption",
130675
130721
  "privacy": "private",
130676
130722
  "return": {
130677
130723
  "type": {
130678
130724
  "text": "void"
130679
130725
  }
130680
130726
  },
130681
- "inheritedFrom": {
130682
- "name": "SbbFormAssociatedMixin",
130683
- "module": "core/mixins/form-associated-mixin.js"
130684
- }
130727
+ "parameters": [
130728
+ {
130729
+ "name": "option",
130730
+ "type": {
130731
+ "text": "SbbToggleOptionElement<T> | undefined"
130732
+ }
130733
+ }
130734
+ ]
130685
130735
  },
130686
130736
  {
130687
130737
  "kind": "field",
130688
- "name": "_hydrationRequired",
130738
+ "name": "disabled",
130739
+ "privacy": "public",
130740
+ "description": "Whether the component is disabled.",
130741
+ "default": "false",
130689
130742
  "type": {
130690
130743
  "text": "boolean"
130691
130744
  },
130692
- "privacy": "private",
130693
- "default": "!!this.shadowRoot",
130694
- "inheritedFrom": {
130695
- "name": "SbbElement",
130696
- "module": "core/base-elements/element.js"
130697
- }
130698
- },
130699
- {
130700
- "kind": "field",
130701
- "name": "_hydrationComplete",
130702
- "privacy": "private",
130703
- "default": "new Promise<boolean>( (resolve) => (this._resolveHydration = resolve), )",
130745
+ "attribute": "disabled",
130746
+ "reflects": true,
130704
130747
  "inheritedFrom": {
130705
- "name": "SbbElement",
130706
- "module": "core/base-elements/element.js"
130748
+ "name": "SbbDisabledMixin",
130749
+ "module": "core/mixins/disabled-mixin.js"
130707
130750
  }
130708
130751
  },
130709
130752
  {
130710
130753
  "kind": "field",
130711
- "name": "_resolveHydration",
130712
- "type": {
130713
- "text": "(hydrationRequired: boolean) => void"
130714
- },
130754
+ "name": "#disabled",
130715
130755
  "privacy": "private",
130716
- "inheritedFrom": {
130717
- "name": "SbbElement",
130718
- "module": "core/base-elements/element.js"
130719
- }
130720
- },
130721
- {
130722
- "kind": "field",
130723
- "name": "hydrationRequired",
130724
130756
  "type": {
130725
130757
  "text": "boolean"
130726
130758
  },
130727
- "privacy": "protected",
130728
- "description": "Returns whether hydration is required and not completed.",
130729
- "readonly": true,
130759
+ "default": "false",
130730
130760
  "inheritedFrom": {
130731
- "name": "SbbElement",
130732
- "module": "core/base-elements/element.js"
130733
- },
130734
- "default": "!!this.shadowRoot"
130761
+ "name": "SbbDisabledMixin",
130762
+ "module": "core/mixins/disabled-mixin.js"
130763
+ }
130735
130764
  },
130736
130765
  {
130737
130766
  "kind": "method",
130738
- "name": "toggleState",
130767
+ "name": "isDisabledExternally",
130739
130768
  "privacy": "protected",
130740
130769
  "return": {
130741
130770
  "type": {
130742
- "text": "void"
130771
+ "text": "boolean"
130743
130772
  }
130744
130773
  },
130745
- "parameters": [
130746
- {
130747
- "name": "value",
130748
- "type": {
130749
- "text": "string"
130750
- }
130751
- },
130752
- {
130753
- "name": "force",
130754
- "optional": true,
130755
- "type": {
130756
- "text": "boolean"
130757
- }
130758
- }
130759
- ],
130774
+ "description": "Will be used as 'or' check to the current disabled state.\nCan e.g. be used to read disabled state of a group.",
130760
130775
  "inheritedFrom": {
130761
- "name": "SbbElement",
130762
- "module": "core/base-elements/element.js"
130776
+ "name": "SbbDisabledMixin",
130777
+ "module": "core/mixins/disabled-mixin.js"
130763
130778
  }
130764
130779
  },
130765
130780
  {
130766
130781
  "kind": "field",
130767
- "name": "['_$sbbElement$']",
130782
+ "name": "formAssociated",
130768
130783
  "type": {
130769
130784
  "text": "boolean"
130770
130785
  },
@@ -130772,340 +130787,309 @@
130772
130787
  "static": true,
130773
130788
  "default": "true",
130774
130789
  "inheritedFrom": {
130775
- "name": "SbbElement",
130776
- "module": "core/base-elements/element.js"
130790
+ "name": "SbbFormAssociatedMixin",
130791
+ "module": "core/mixins/form-associated-mixin.js"
130777
130792
  }
130778
130793
  },
130779
130794
  {
130780
130795
  "kind": "field",
130781
- "name": "_controllers",
130782
- "type": {
130783
- "text": "Set<SbbReactiveController> | undefined"
130784
- },
130785
- "privacy": "private",
130786
- "inheritedFrom": {
130787
- "name": "SbbElement",
130788
- "module": "core/base-elements/element.js"
130789
- }
130790
- }
130791
- ],
130792
- "events": [
130793
- {
130794
- "name": "change",
130795
- "type": {
130796
- "text": "Event"
130797
- },
130798
- "description": "The change event is fired when the user modifies the element's value.\nUnlike the input event, the change event is not necessarily fired\nfor each alteration to an element's value."
130799
- }
130800
- ],
130801
- "attributes": [
130802
- {
130803
- "name": "even",
130804
- "type": {
130805
- "text": "boolean"
130806
- },
130807
- "default": "false",
130808
- "description": "If true, set the width of the component fixed; if false,\nthe width is dynamic based on the label of the sbb-toggle-option.",
130809
- "fieldName": "even"
130810
- },
130811
- {
130812
- "name": "size",
130813
- "type": {
130814
- "text": "'s' | 'm'"
130815
- },
130816
- "description": "Size variant, either m or s.",
130817
- "default": "'m' / 's' (lean)",
130818
- "fieldName": "size"
130819
- },
130820
- {
130821
- "name": "value",
130822
- "description": "The value of the toggle. It needs to be mutable since it is updated whenever\na new option is selected (see the `onToggleOptionSelect()` method).",
130823
- "type": {
130824
- "text": "T | null"
130825
- },
130826
- "fieldName": "value"
130827
- },
130828
- {
130829
- "name": "disabled",
130830
- "description": "Whether the component is disabled.",
130831
- "default": "false",
130796
+ "name": "form",
130832
130797
  "type": {
130833
- "text": "boolean"
130798
+ "text": "HTMLFormElement | null"
130834
130799
  },
130835
- "fieldName": "disabled",
130800
+ "privacy": "public",
130801
+ "description": "Returns the form owner of this element.",
130802
+ "readonly": true,
130836
130803
  "inheritedFrom": {
130837
- "name": "SbbDisabledMixin",
130838
- "module": "core/mixins/disabled-mixin.js"
130804
+ "name": "SbbFormAssociatedMixin",
130805
+ "module": "core/mixins/form-associated-mixin.js"
130839
130806
  }
130840
130807
  },
130841
130808
  {
130809
+ "kind": "field",
130842
130810
  "name": "name",
130811
+ "privacy": "public",
130843
130812
  "description": "Name of the form element. Will be read from name attribute.",
130844
130813
  "type": {
130845
130814
  "text": "string"
130846
130815
  },
130847
- "fieldName": "name",
130816
+ "attribute": "name",
130848
130817
  "inheritedFrom": {
130849
130818
  "name": "SbbFormAssociatedMixin",
130850
130819
  "module": "core/mixins/form-associated-mixin.js"
130851
130820
  }
130852
- }
130853
- ],
130854
- "mixins": [
130855
- {
130856
- "name": "SbbDisabledMixin",
130857
- "module": "core/mixins.js"
130858
- },
130859
- {
130860
- "name": "SbbFormAssociatedMixin",
130861
- "module": "core/mixins.js"
130862
- }
130863
- ],
130864
- "superclass": {
130865
- "name": "SbbElement",
130866
- "module": "core/base-elements.js"
130867
- },
130868
- "tagName": "sbb-toggle",
130869
- "customElement": true,
130870
- "classGenerics": "T = string"
130871
- }
130872
- ],
130873
- "exports": [
130874
- {
130875
- "kind": "js",
130876
- "name": "SbbToggleElement",
130877
- "declaration": {
130878
- "name": "SbbToggleElement",
130879
- "module": "toggle/toggle/toggle.component.js"
130880
- }
130881
- }
130882
- ]
130883
- },
130884
- {
130885
- "kind": "javascript-module",
130886
- "path": "toggle/toggle-option/toggle-option.component.js",
130887
- "declarations": [
130888
- {
130889
- "kind": "class",
130890
- "description": "It displays a toggle option within a `sbb-toggle`.",
130891
- "name": "SbbToggleOptionElement",
130892
- "slots": [
130893
- {
130894
- "description": "Use the unnamed slot to add content to the label of the toggle option.",
130895
- "name": ""
130896
130821
  },
130897
- {
130898
- "description": "Slot used to render the `sbb-icon`.",
130899
- "name": "icon"
130900
- }
130901
- ],
130902
- "members": [
130903
130822
  {
130904
130823
  "kind": "field",
130905
- "name": "elementName",
130824
+ "name": "validity",
130906
130825
  "type": {
130907
- "text": "string"
130826
+ "text": "ValidityState"
130908
130827
  },
130909
130828
  "privacy": "public",
130910
- "static": true,
130829
+ "description": "Returns the ValidityState object for this element.",
130911
130830
  "readonly": true,
130912
- "default": "'sbb-toggle-option'",
130913
130831
  "inheritedFrom": {
130914
- "name": "SbbElement",
130915
- "module": "core/base-elements/element.js"
130832
+ "name": "SbbFormAssociatedMixin",
130833
+ "module": "core/mixins/form-associated-mixin.js"
130916
130834
  }
130917
130835
  },
130918
130836
  {
130919
130837
  "kind": "field",
130920
- "name": "role",
130838
+ "name": "validationMessage",
130921
130839
  "type": {
130922
130840
  "text": "string"
130923
130841
  },
130924
130842
  "privacy": "public",
130925
- "static": true,
130843
+ "description": "Returns the current error message, if available, which corresponds\nto the current validation state.\nPlease note that only one message is returned at a time (e.g. if\nmultiple validity states are invalid, only the chronologically first one\nis returned until it is fixed, at which point the next message might be\nreturned, if it is still applicable). Also, a custom validity message\n(see below) has precedence over native validation messages.",
130926
130844
  "readonly": true,
130927
- "default": "'radio'"
130845
+ "inheritedFrom": {
130846
+ "name": "SbbFormAssociatedMixin",
130847
+ "module": "core/mixins/form-associated-mixin.js"
130848
+ }
130928
130849
  },
130929
130850
  {
130930
130851
  "kind": "field",
130931
- "name": "checked",
130852
+ "name": "willValidate",
130932
130853
  "type": {
130933
130854
  "text": "boolean"
130934
130855
  },
130935
130856
  "privacy": "public",
130936
- "default": "false",
130937
- "description": "Whether the toggle-option is checked.",
130938
- "attribute": "checked",
130939
- "reflects": true
130940
- },
130941
- {
130942
- "kind": "field",
130943
- "name": "value",
130944
- "type": {
130945
- "text": "(T = string) | null"
130946
- },
130947
- "privacy": "public",
130948
- "default": "null",
130949
- "description": "Value of toggle-option.",
130950
- "attribute": "value"
130857
+ "description": "Returns true if this element will be validated\nwhen the form is submitted; false otherwise.",
130858
+ "readonly": true,
130859
+ "inheritedFrom": {
130860
+ "name": "SbbFormAssociatedMixin",
130861
+ "module": "core/mixins/form-associated-mixin.js"
130862
+ }
130951
130863
  },
130952
130864
  {
130953
130865
  "kind": "field",
130954
- "name": "_toggle",
130866
+ "name": "_validityStates",
130867
+ "privacy": "private",
130868
+ "default": "new Map< keyof ValidityStateFlags, { flagValue: unknown; message: string } >()",
130869
+ "inheritedFrom": {
130870
+ "name": "SbbFormAssociatedMixin",
130871
+ "module": "core/mixins/form-associated-mixin.js"
130872
+ }
130873
+ },
130874
+ {
130875
+ "kind": "field",
130876
+ "name": "formDisabled",
130955
130877
  "type": {
130956
- "text": "SbbToggleElement | null"
130878
+ "text": "boolean"
130957
130879
  },
130958
- "privacy": "private",
130959
- "default": "null"
130880
+ "privacy": "protected",
130881
+ "default": "false",
130882
+ "description": "Whenever a surrounding form or fieldset is changing its disabled state.",
130883
+ "inheritedFrom": {
130884
+ "name": "SbbFormAssociatedMixin",
130885
+ "module": "core/mixins/form-associated-mixin.js"
130886
+ }
130960
130887
  },
130961
130888
  {
130962
130889
  "kind": "method",
130963
- "name": "_uncheckOtherOptions",
130964
- "privacy": "private",
130890
+ "name": "checkValidity",
130891
+ "privacy": "public",
130965
130892
  "return": {
130966
130893
  "type": {
130967
- "text": "void"
130894
+ "text": "boolean"
130968
130895
  }
130896
+ },
130897
+ "description": "Returns true if this element has no validity problems; false otherwise.\nFires an invalid event at the element in the latter case.",
130898
+ "inheritedFrom": {
130899
+ "name": "SbbFormAssociatedMixin",
130900
+ "module": "core/mixins/form-associated-mixin.js"
130969
130901
  }
130970
130902
  },
130971
130903
  {
130972
130904
  "kind": "method",
130973
- "name": "_handleDisabledChange",
130974
- "privacy": "private",
130905
+ "name": "reportValidity",
130906
+ "privacy": "public",
130975
130907
  "return": {
130976
130908
  "type": {
130977
- "text": "void"
130909
+ "text": "boolean"
130978
130910
  }
130911
+ },
130912
+ "description": "Returns true if this element has no validity problems; otherwise,\nreturns false, fires an invalid event at the element,\nand (if the event isn't canceled) reports the problem to the user.",
130913
+ "inheritedFrom": {
130914
+ "name": "SbbFormAssociatedMixin",
130915
+ "module": "core/mixins/form-associated-mixin.js"
130979
130916
  }
130980
130917
  },
130981
130918
  {
130982
130919
  "kind": "method",
130983
- "name": "_handleInput",
130984
- "privacy": "private",
130920
+ "name": "setCustomValidity",
130921
+ "privacy": "public",
130985
130922
  "return": {
130986
130923
  "type": {
130987
130924
  "text": "void"
130988
130925
  }
130926
+ },
130927
+ "parameters": [
130928
+ {
130929
+ "name": "message",
130930
+ "type": {
130931
+ "text": "string"
130932
+ }
130933
+ }
130934
+ ],
130935
+ "description": "Sets the custom validity message for this element. Use the empty string\nto indicate that the element does not have a custom validity error.",
130936
+ "inheritedFrom": {
130937
+ "name": "SbbFormAssociatedMixin",
130938
+ "module": "core/mixins/form-associated-mixin.js"
130989
130939
  }
130990
130940
  },
130991
130941
  {
130992
130942
  "kind": "method",
130993
- "name": "_verifyTabindex",
130943
+ "name": "_hasDisabledAncestor",
130994
130944
  "privacy": "private",
130995
130945
  "return": {
130996
130946
  "type": {
130997
- "text": "void"
130947
+ "text": "boolean"
130998
130948
  }
130999
- }
131000
- },
131001
- {
131002
- "kind": "field",
131003
- "name": "disabled",
131004
- "privacy": "public",
131005
- "description": "Whether the component is disabled.",
131006
- "default": "false",
131007
- "type": {
131008
- "text": "boolean"
131009
130949
  },
131010
- "attribute": "disabled",
131011
- "reflects": true,
131012
130950
  "inheritedFrom": {
131013
- "name": "SbbDisabledMixin",
131014
- "module": "core/mixins/disabled-mixin.js"
130951
+ "name": "SbbFormAssociatedMixin",
130952
+ "module": "core/mixins/form-associated-mixin.js"
131015
130953
  }
131016
130954
  },
131017
130955
  {
131018
- "kind": "field",
131019
- "name": "#disabled",
131020
- "privacy": "private",
131021
- "type": {
131022
- "text": "boolean"
130956
+ "kind": "method",
130957
+ "name": "updateFormValue",
130958
+ "privacy": "protected",
130959
+ "return": {
130960
+ "type": {
130961
+ "text": "void"
130962
+ }
131023
130963
  },
131024
- "default": "false",
130964
+ "description": "Should be called when form value is changed.\nAdapts and sets the formValue in the supported format (string | FormData | File | null)\nhttps://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue",
131025
130965
  "inheritedFrom": {
131026
- "name": "SbbDisabledMixin",
131027
- "module": "core/mixins/disabled-mixin.js"
130966
+ "name": "SbbFormAssociatedMixin",
130967
+ "module": "core/mixins/form-associated-mixin.js"
131028
130968
  }
131029
130969
  },
131030
130970
  {
131031
130971
  "kind": "method",
131032
- "name": "isDisabledExternally",
130972
+ "name": "formState",
131033
130973
  "privacy": "protected",
131034
130974
  "return": {
131035
130975
  "type": {
131036
- "text": "boolean"
130976
+ "text": "FormRestoreState"
131037
130977
  }
131038
130978
  },
131039
- "description": "Will be used as 'or' check to the current disabled state.\nCan e.g. be used to read disabled state of a group.",
131040
130979
  "inheritedFrom": {
131041
- "name": "SbbDisabledMixin",
131042
- "module": "core/mixins/disabled-mixin.js"
130980
+ "name": "SbbFormAssociatedMixin",
130981
+ "module": "core/mixins/form-associated-mixin.js"
131043
130982
  }
131044
130983
  },
131045
130984
  {
131046
- "kind": "field",
131047
- "name": "iconName",
131048
- "type": {
131049
- "text": "string"
130985
+ "kind": "method",
130986
+ "name": "setValidityFlag",
130987
+ "privacy": "protected",
130988
+ "return": {
130989
+ "type": {
130990
+ "text": "void"
130991
+ }
131050
130992
  },
131051
- "privacy": "public",
131052
- "default": "''",
131053
- "description": "The icon name we want to use, choose from the small icon variants\nfrom the ui-icons category from here\nhttps://icons.app.sbb.ch.",
131054
- "attribute": "icon-name",
130993
+ "parameters": [
130994
+ {
130995
+ "name": "flag",
130996
+ "type": {
130997
+ "text": "T"
130998
+ }
130999
+ },
131000
+ {
131001
+ "name": "message",
131002
+ "type": {
131003
+ "text": "string"
131004
+ }
131005
+ },
131006
+ {
131007
+ "name": "flagValue",
131008
+ "optional": true,
131009
+ "type": {
131010
+ "text": "ValidityStateFlags[T]"
131011
+ }
131012
+ }
131013
+ ],
131014
+ "description": "Marks this element as suffering from the constraint indicated by the\nflag argument and associates the given message to it.\nNote that only one message is displayed at a time and custom messages by\nconsumers are always displayed before internal messages and internal\nmessages are displayed in the order they were added.\nTo set/define custom validity state flags, you need to extend the\nValidityState prototype (and the CustomValidityState interface).",
131055
131015
  "inheritedFrom": {
131056
- "name": "SbbIconNameMixin",
131057
- "module": "icon/icon-name-mixin.js"
131016
+ "name": "SbbFormAssociatedMixin",
131017
+ "module": "core/mixins/form-associated-mixin.js"
131058
131018
  }
131059
131019
  },
131060
131020
  {
131061
131021
  "kind": "method",
131062
- "name": "renderIconSlot",
131022
+ "name": "removeValidityFlag",
131063
131023
  "privacy": "protected",
131064
131024
  "return": {
131065
131025
  "type": {
131066
- "text": "TemplateResult"
131026
+ "text": "void"
131067
131027
  }
131068
131028
  },
131069
131029
  "parameters": [
131070
131030
  {
131071
- "name": "classname",
131072
- "optional": true,
131031
+ "name": "flag",
131073
131032
  "type": {
131074
- "text": "string"
131033
+ "text": "T"
131075
131034
  }
131076
131035
  }
131077
131036
  ],
131037
+ "description": "Removes the validity state flag entry and updates validity state.",
131078
131038
  "inheritedFrom": {
131079
- "name": "SbbIconNameMixin",
131080
- "module": "icon/icon-name-mixin.js"
131039
+ "name": "SbbFormAssociatedMixin",
131040
+ "module": "core/mixins/form-associated-mixin.js"
131081
131041
  }
131082
131042
  },
131083
131043
  {
131084
131044
  "kind": "method",
131085
- "name": "renderIconName",
131045
+ "name": "validate",
131086
131046
  "privacy": "protected",
131087
131047
  "return": {
131088
131048
  "type": {
131089
- "text": "string"
131049
+ "text": "void"
131090
131050
  }
131091
131051
  },
131052
+ "description": "To be called whenever the current element needs to be validated.",
131092
131053
  "inheritedFrom": {
131093
- "name": "SbbIconNameMixin",
131094
- "module": "icon/icon-name-mixin.js"
131054
+ "name": "SbbFormAssociatedMixin",
131055
+ "module": "core/mixins/form-associated-mixin.js"
131095
131056
  }
131096
131057
  },
131097
131058
  {
131098
131059
  "kind": "method",
131099
- "name": "_renderIconName",
131060
+ "name": "shouldValidate",
131061
+ "privacy": "protected",
131062
+ "return": {
131063
+ "type": {
131064
+ "text": "boolean"
131065
+ }
131066
+ },
131067
+ "parameters": [
131068
+ {
131069
+ "name": "name",
131070
+ "type": {
131071
+ "text": "PropertyKey | undefined"
131072
+ }
131073
+ }
131074
+ ],
131075
+ "description": "Whether validation should be run on a property change with the given name.",
131076
+ "inheritedFrom": {
131077
+ "name": "SbbFormAssociatedMixin",
131078
+ "module": "core/mixins/form-associated-mixin.js"
131079
+ }
131080
+ },
131081
+ {
131082
+ "kind": "method",
131083
+ "name": "_setInternalValidity",
131100
131084
  "privacy": "private",
131101
131085
  "return": {
131102
131086
  "type": {
131103
- "text": "string"
131087
+ "text": "void"
131104
131088
  }
131105
131089
  },
131106
131090
  "inheritedFrom": {
131107
- "name": "SbbIconNameMixin",
131108
- "module": "icon/icon-name-mixin.js"
131091
+ "name": "SbbFormAssociatedMixin",
131092
+ "module": "core/mixins/form-associated-mixin.js"
131109
131093
  }
131110
131094
  },
131111
131095
  {
@@ -131214,23 +131198,40 @@
131214
131198
  }
131215
131199
  }
131216
131200
  ],
131201
+ "events": [
131202
+ {
131203
+ "name": "change",
131204
+ "type": {
131205
+ "text": "Event"
131206
+ },
131207
+ "description": "The change event is fired when the user modifies the element's value.\nUnlike the input event, the change event is not necessarily fired\nfor each alteration to an element's value."
131208
+ }
131209
+ ],
131217
131210
  "attributes": [
131218
131211
  {
131219
- "name": "checked",
131212
+ "name": "even",
131220
131213
  "type": {
131221
131214
  "text": "boolean"
131222
131215
  },
131223
131216
  "default": "false",
131224
- "description": "Whether the toggle-option is checked.",
131225
- "fieldName": "checked"
131217
+ "description": "If true, set the width of the component fixed; if false,\nthe width is dynamic based on the label of the sbb-toggle-option.",
131218
+ "fieldName": "even"
131219
+ },
131220
+ {
131221
+ "name": "size",
131222
+ "type": {
131223
+ "text": "'s' | 'm'"
131224
+ },
131225
+ "description": "Size variant, either m or s.",
131226
+ "default": "'m' / 's' (lean)",
131227
+ "fieldName": "size"
131226
131228
  },
131227
131229
  {
131228
131230
  "name": "value",
131231
+ "description": "The value of the toggle. It needs to be mutable since it is updated whenever\na new option is selected (see the `onToggleOptionSelect()` method).",
131229
131232
  "type": {
131230
131233
  "text": "T | null"
131231
131234
  },
131232
- "default": "null",
131233
- "description": "Value of toggle-option.",
131234
131235
  "fieldName": "value"
131235
131236
  },
131236
131237
  {
@@ -131247,16 +131248,15 @@
131247
131248
  }
131248
131249
  },
131249
131250
  {
131250
- "name": "icon-name",
131251
+ "name": "name",
131252
+ "description": "Name of the form element. Will be read from name attribute.",
131251
131253
  "type": {
131252
131254
  "text": "string"
131253
131255
  },
131254
- "default": "''",
131255
- "description": "The icon name we want to use, choose from the small icon variants\nfrom the ui-icons category from here\nhttps://icons.app.sbb.ch.",
131256
- "fieldName": "iconName",
131256
+ "fieldName": "name",
131257
131257
  "inheritedFrom": {
131258
- "name": "SbbIconNameMixin",
131259
- "module": "icon/icon-name-mixin.js"
131258
+ "name": "SbbFormAssociatedMixin",
131259
+ "module": "core/mixins/form-associated-mixin.js"
131260
131260
  }
131261
131261
  }
131262
131262
  ],
@@ -131266,15 +131266,15 @@
131266
131266
  "module": "core/mixins.js"
131267
131267
  },
131268
131268
  {
131269
- "name": "SbbIconNameMixin",
131270
- "module": "icon.js"
131269
+ "name": "SbbFormAssociatedMixin",
131270
+ "module": "core/mixins.js"
131271
131271
  }
131272
131272
  ],
131273
131273
  "superclass": {
131274
131274
  "name": "SbbElement",
131275
131275
  "module": "core/base-elements.js"
131276
131276
  },
131277
- "tagName": "sbb-toggle-option",
131277
+ "tagName": "sbb-toggle",
131278
131278
  "customElement": true,
131279
131279
  "classGenerics": "T = string"
131280
131280
  }
@@ -131282,10 +131282,10 @@
131282
131282
  "exports": [
131283
131283
  {
131284
131284
  "kind": "js",
131285
- "name": "SbbToggleOptionElement",
131285
+ "name": "SbbToggleElement",
131286
131286
  "declaration": {
131287
- "name": "SbbToggleOptionElement",
131288
- "module": "toggle/toggle-option/toggle-option.component.js"
131287
+ "name": "SbbToggleElement",
131288
+ "module": "toggle/toggle/toggle.component.js"
131289
131289
  }
131290
131290
  }
131291
131291
  ]