@momentum-design/components 0.102.2 → 0.102.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +243 -249
- package/dist/browser/index.js.map +4 -4
- package/dist/components/list/index.d.ts +0 -1
- package/dist/components/list/index.js +0 -1
- package/dist/components/list/list.component.d.ts +9 -12
- package/dist/components/list/list.component.js +17 -34
- package/dist/components/list/list.styles.js +9 -2
- package/dist/custom-elements.json +164 -208
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/list/index.d.ts +6 -2
- package/dist/react/list/index.js +6 -2
- package/dist/utils/mixins/FocusTrapMixin.js +7 -1
- package/package.json +1 -1
@@ -1,29 +1,26 @@
|
|
1
1
|
import type { CSSResult } from 'lit';
|
2
2
|
import { Component } from '../../models';
|
3
|
-
import type { RoleType } from '../../utils/roles';
|
4
|
-
declare const List_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DataAriaLabelMixin").DataAriaLabelMixinInterface> & typeof Component;
|
5
3
|
/**
|
6
4
|
* mdc-list component is used to display a group of list items. It is used as a container to wrap other list items.
|
7
5
|
*
|
6
|
+
* To add a header to the list, use the `mdc-listheader` component and place it in the `list-header` slot.
|
7
|
+
* `mdc-listitem` components can be placed in the default slot.
|
8
|
+
*
|
8
9
|
* @tagname mdc-list
|
9
10
|
*
|
10
|
-
* @
|
11
|
+
* @slot default - This is a default/unnamed slot, where listitems can be placed.
|
12
|
+
* @slot list-header - This slot is used to pass a header for the list, which can be a `mdc-listheader` component.
|
11
13
|
*
|
12
|
-
* @
|
14
|
+
* @csspart container - The container slot around the list items
|
13
15
|
*/
|
14
|
-
declare class List extends
|
16
|
+
declare class List extends Component {
|
15
17
|
/**
|
16
18
|
* @internal
|
17
19
|
* Get all listitem elements which are not disabled in the list.
|
18
20
|
*/
|
19
|
-
listItems
|
20
|
-
/**
|
21
|
-
* The header text of the list.
|
22
|
-
*/
|
23
|
-
headerText?: string;
|
24
|
-
/** @internal */
|
25
|
-
protected dataRole: RoleType;
|
21
|
+
private listItems;
|
26
22
|
constructor();
|
23
|
+
connectedCallback(): void;
|
27
24
|
/**
|
28
25
|
* Handles the keydown event on the list element.
|
29
26
|
* If the key is 'ArrowUp' or 'ArrowDown', it focuses to the previous or next list item
|
@@ -7,32 +7,36 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
|
-
import { html
|
11
|
-
import {
|
10
|
+
import { html } from 'lit';
|
11
|
+
import { queryAssignedElements } from 'lit/decorators.js';
|
12
12
|
import { Component } from '../../models';
|
13
13
|
import { KEYS } from '../../utils/keys';
|
14
|
-
import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
15
14
|
import { ROLE } from '../../utils/roles';
|
16
15
|
import { TAG_NAME as LISTITEM_TAGNAME } from '../listitem/listitem.constants';
|
17
|
-
import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
|
18
|
-
import { HEADER_ID } from './list.constants';
|
19
16
|
import styles from './list.styles';
|
20
17
|
/**
|
21
18
|
* mdc-list component is used to display a group of list items. It is used as a container to wrap other list items.
|
22
19
|
*
|
20
|
+
* To add a header to the list, use the `mdc-listheader` component and place it in the `list-header` slot.
|
21
|
+
* `mdc-listitem` components can be placed in the default slot.
|
22
|
+
*
|
23
23
|
* @tagname mdc-list
|
24
24
|
*
|
25
|
-
* @
|
25
|
+
* @slot default - This is a default/unnamed slot, where listitems can be placed.
|
26
|
+
* @slot list-header - This slot is used to pass a header for the list, which can be a `mdc-listheader` component.
|
26
27
|
*
|
27
|
-
* @
|
28
|
+
* @csspart container - The container slot around the list items
|
28
29
|
*/
|
29
|
-
class List extends
|
30
|
+
class List extends Component {
|
30
31
|
constructor() {
|
31
32
|
super();
|
32
|
-
/** @internal */
|
33
|
-
this.dataRole = ROLE.LIST;
|
34
33
|
this.addEventListener('keydown', this.handleKeyDown);
|
35
34
|
}
|
35
|
+
connectedCallback() {
|
36
|
+
super.connectedCallback();
|
37
|
+
// Set the role attribute for accessibility.
|
38
|
+
this.setAttribute('role', ROLE.LIST);
|
39
|
+
}
|
36
40
|
/**
|
37
41
|
* Handles the keydown event on the list element.
|
38
42
|
* If the key is 'ArrowUp' or 'ArrowDown', it focuses to the previous or next list item
|
@@ -109,27 +113,10 @@ class List extends DataAriaLabelMixin(Component) {
|
|
109
113
|
this.resetTabIndexAndSetActiveTabIndex(0);
|
110
114
|
}
|
111
115
|
render() {
|
112
|
-
var _a;
|
113
|
-
const headerText = this.headerText
|
114
|
-
? html `
|
115
|
-
<mdc-text
|
116
|
-
id="${HEADER_ID}"
|
117
|
-
part="header-text"
|
118
|
-
type="${TYPE.BODY_MIDSIZE_BOLD}"
|
119
|
-
tagname="${VALID_TEXT_TAGS.SPAN}"
|
120
|
-
>${this.headerText}</mdc-text
|
121
|
-
>
|
122
|
-
`
|
123
|
-
: nothing;
|
124
116
|
return html `
|
125
|
-
<
|
126
|
-
|
127
|
-
|
128
|
-
aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
|
129
|
-
>
|
130
|
-
${headerText}
|
131
|
-
<slot role="presentation" @click="${this.handleMouseClick}"></slot>
|
132
|
-
</div>
|
117
|
+
<slot name="list-header"></slot>
|
118
|
+
<!-- make the container slot role presentation to keep it ignored in a11y tree -->
|
119
|
+
<slot part="container" @click="${this.handleMouseClick}" role="presentation"></slot>
|
133
120
|
`;
|
134
121
|
}
|
135
122
|
}
|
@@ -138,8 +125,4 @@ __decorate([
|
|
138
125
|
queryAssignedElements({ selector: `${LISTITEM_TAGNAME}:not([disabled])` }),
|
139
126
|
__metadata("design:type", Array)
|
140
127
|
], List.prototype, "listItems", void 0);
|
141
|
-
__decorate([
|
142
|
-
property({ type: String, attribute: 'header-text', reflect: true }),
|
143
|
-
__metadata("design:type", String)
|
144
|
-
], List.prototype, "headerText", void 0);
|
145
128
|
export default List;
|
@@ -1,7 +1,14 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
const styles = css `
|
3
|
-
:host
|
4
|
-
|
3
|
+
:host {
|
4
|
+
display: flex;
|
5
|
+
flex-direction: column;
|
6
|
+
}
|
7
|
+
|
8
|
+
:host::part(container) {
|
9
|
+
display: flex;
|
10
|
+
flex-direction: column;
|
11
|
+
gap: 0rem;
|
5
12
|
}
|
6
13
|
`;
|
7
14
|
export default [styles];
|
@@ -477,6 +477,157 @@
|
|
477
477
|
}
|
478
478
|
]
|
479
479
|
},
|
480
|
+
{
|
481
|
+
"kind": "javascript-module",
|
482
|
+
"path": "components/accordiongroup/accordiongroup.component.js",
|
483
|
+
"declarations": [
|
484
|
+
{
|
485
|
+
"kind": "class",
|
486
|
+
"description": "An accordion group is a vertically stacked set of interactive headings that each contain a header and body content.\nEach heading of the accordion acts as a control that enable users to expand or hide their associated body sections of content.\nAccordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.\n\n- Default Slot: The accordion group component only accepts, `accordion` and `accordionbutton` components as the children, rest are ignored.\n\nThere are three types of variants:\n- Stacked - Each accordion will have a gap of 1.5rem (24px).\n- Borderless - Each accordion will not have any border and the group will also not have any border.\n- Contained - Each accordion will have no gap in between them and the border of the entire accordiongroup will be continuous.\n\nThere are two types of sizes:\n- Small: Small size has a padding of 1rem (16px) for both heading and body sections.\n- Large: Large size has a padding of 1.5rem (24px) for both heading and body sections.\n\nThe variant and size will be applied to all accordions inside this accordion group.\nTo show/expand more than one accordion at any given time, then set `allow-multiple` to `true`. By default, it's `false`.\n\nIf you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.\n\nIf the first accordion of the accordion group is expanded by default, then the screen reader might loose focus when toggling the visibilty of the first accordion.",
|
487
|
+
"name": "AccordionGroup",
|
488
|
+
"cssProperties": [
|
489
|
+
{
|
490
|
+
"description": "The border color of the entire accordiongroup",
|
491
|
+
"name": "--mdc-accordiongroup-border-color"
|
492
|
+
}
|
493
|
+
],
|
494
|
+
"slots": [
|
495
|
+
{
|
496
|
+
"description": "The default slot can contain the `accordion` or `accordionbutton` components.",
|
497
|
+
"name": "default"
|
498
|
+
}
|
499
|
+
],
|
500
|
+
"members": [
|
501
|
+
{
|
502
|
+
"kind": "field",
|
503
|
+
"name": "size",
|
504
|
+
"type": {
|
505
|
+
"text": "Size"
|
506
|
+
},
|
507
|
+
"description": "The size of the accordion item.",
|
508
|
+
"default": "'small'",
|
509
|
+
"attribute": "size",
|
510
|
+
"reflects": true
|
511
|
+
},
|
512
|
+
{
|
513
|
+
"kind": "field",
|
514
|
+
"name": "variant",
|
515
|
+
"type": {
|
516
|
+
"text": "Variant"
|
517
|
+
},
|
518
|
+
"description": "The variant of the accordion item. Based on the variant, the styling of the accordion gets changed.",
|
519
|
+
"default": "'stacked'",
|
520
|
+
"attribute": "variant",
|
521
|
+
"reflects": true
|
522
|
+
},
|
523
|
+
{
|
524
|
+
"kind": "field",
|
525
|
+
"name": "allowMultiple",
|
526
|
+
"type": {
|
527
|
+
"text": "boolean"
|
528
|
+
},
|
529
|
+
"default": "false",
|
530
|
+
"description": "If true, multiple accordion items can be visible at the same time.",
|
531
|
+
"attribute": "allow-multiple",
|
532
|
+
"reflects": true
|
533
|
+
},
|
534
|
+
{
|
535
|
+
"kind": "method",
|
536
|
+
"name": "handleAccordionExpanded",
|
537
|
+
"privacy": "private",
|
538
|
+
"return": {
|
539
|
+
"type": {
|
540
|
+
"text": "void"
|
541
|
+
}
|
542
|
+
},
|
543
|
+
"parameters": [
|
544
|
+
{
|
545
|
+
"name": "event",
|
546
|
+
"type": {
|
547
|
+
"text": "Event"
|
548
|
+
},
|
549
|
+
"description": "The event object from the 'shown' event."
|
550
|
+
}
|
551
|
+
],
|
552
|
+
"description": "Handles the 'shown' event for accordion items.\nIf `allowMultiple` is false, ensures that only one accordion item\nremains expanded by collapsing all other expanded items when a new item is expanded."
|
553
|
+
},
|
554
|
+
{
|
555
|
+
"kind": "method",
|
556
|
+
"name": "setChildrenAccordionAttributes",
|
557
|
+
"privacy": "private",
|
558
|
+
"return": {
|
559
|
+
"type": {
|
560
|
+
"text": "void"
|
561
|
+
}
|
562
|
+
},
|
563
|
+
"parameters": [
|
564
|
+
{
|
565
|
+
"name": "attributeName",
|
566
|
+
"type": {
|
567
|
+
"text": "string"
|
568
|
+
},
|
569
|
+
"description": "The name of the attribute to set."
|
570
|
+
},
|
571
|
+
{
|
572
|
+
"name": "attributeValue",
|
573
|
+
"type": {
|
574
|
+
"text": "string"
|
575
|
+
},
|
576
|
+
"description": "The value to set the attribute to."
|
577
|
+
}
|
578
|
+
],
|
579
|
+
"description": "Sets the given attribute on all child accordion or accordionbutton components."
|
580
|
+
}
|
581
|
+
],
|
582
|
+
"attributes": [
|
583
|
+
{
|
584
|
+
"name": "size",
|
585
|
+
"type": {
|
586
|
+
"text": "Size"
|
587
|
+
},
|
588
|
+
"description": "The size of the accordion item.",
|
589
|
+
"default": "'small'",
|
590
|
+
"fieldName": "size"
|
591
|
+
},
|
592
|
+
{
|
593
|
+
"name": "variant",
|
594
|
+
"type": {
|
595
|
+
"text": "Variant"
|
596
|
+
},
|
597
|
+
"description": "The variant of the accordion item. Based on the variant, the styling of the accordion gets changed.",
|
598
|
+
"default": "'stacked'",
|
599
|
+
"fieldName": "variant"
|
600
|
+
},
|
601
|
+
{
|
602
|
+
"name": "allow-multiple",
|
603
|
+
"type": {
|
604
|
+
"text": "boolean"
|
605
|
+
},
|
606
|
+
"default": "false",
|
607
|
+
"description": "If true, multiple accordion items can be visible at the same time.",
|
608
|
+
"fieldName": "allowMultiple"
|
609
|
+
}
|
610
|
+
],
|
611
|
+
"superclass": {
|
612
|
+
"name": "Component",
|
613
|
+
"module": "/src/models"
|
614
|
+
},
|
615
|
+
"tagName": "mdc-accordiongroup",
|
616
|
+
"jsDoc": "/**\n * An accordion group is a vertically stacked set of interactive headings that each contain a header and body content.\n * Each heading of the accordion acts as a control that enable users to expand or hide their associated body sections of content.\n * Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.\n *\n * - Default Slot: The accordion group component only accepts, `accordion` and `accordionbutton` components as the children, rest are ignored.\n *\n * There are three types of variants:\n * - Stacked - Each accordion will have a gap of 1.5rem (24px).\n * - Borderless - Each accordion will not have any border and the group will also not have any border.\n * - Contained - Each accordion will have no gap in between them and the border of the entire accordiongroup will be continuous.\n *\n * There are two types of sizes:\n * - Small: Small size has a padding of 1rem (16px) for both heading and body sections.\n * - Large: Large size has a padding of 1.5rem (24px) for both heading and body sections.\n *\n * The variant and size will be applied to all accordions inside this accordion group.\n * To show/expand more than one accordion at any given time, then set `allow-multiple` to `true`. By default, it's `false`.\n *\n * If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.\n *\n * If the first accordion of the accordion group is expanded by default, then the screen reader might loose focus when toggling the visibilty of the first accordion.\n *\n * @tagname mdc-accordiongroup\n *\n * @slot default - The default slot can contain the `accordion` or `accordionbutton` components.\n *\n * @cssproperty --mdc-accordiongroup-border-color - The border color of the entire accordiongroup\n */",
|
617
|
+
"customElement": true
|
618
|
+
}
|
619
|
+
],
|
620
|
+
"exports": [
|
621
|
+
{
|
622
|
+
"kind": "js",
|
623
|
+
"name": "default",
|
624
|
+
"declaration": {
|
625
|
+
"name": "AccordionGroup",
|
626
|
+
"module": "components/accordiongroup/accordiongroup.component.js"
|
627
|
+
}
|
628
|
+
}
|
629
|
+
]
|
630
|
+
},
|
480
631
|
{
|
481
632
|
"kind": "javascript-module",
|
482
633
|
"path": "components/accordionbutton/accordionbutton.component.js",
|
@@ -817,157 +968,6 @@
|
|
817
968
|
}
|
818
969
|
]
|
819
970
|
},
|
820
|
-
{
|
821
|
-
"kind": "javascript-module",
|
822
|
-
"path": "components/accordiongroup/accordiongroup.component.js",
|
823
|
-
"declarations": [
|
824
|
-
{
|
825
|
-
"kind": "class",
|
826
|
-
"description": "An accordion group is a vertically stacked set of interactive headings that each contain a header and body content.\nEach heading of the accordion acts as a control that enable users to expand or hide their associated body sections of content.\nAccordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.\n\n- Default Slot: The accordion group component only accepts, `accordion` and `accordionbutton` components as the children, rest are ignored.\n\nThere are three types of variants:\n- Stacked - Each accordion will have a gap of 1.5rem (24px).\n- Borderless - Each accordion will not have any border and the group will also not have any border.\n- Contained - Each accordion will have no gap in between them and the border of the entire accordiongroup will be continuous.\n\nThere are two types of sizes:\n- Small: Small size has a padding of 1rem (16px) for both heading and body sections.\n- Large: Large size has a padding of 1.5rem (24px) for both heading and body sections.\n\nThe variant and size will be applied to all accordions inside this accordion group.\nTo show/expand more than one accordion at any given time, then set `allow-multiple` to `true`. By default, it's `false`.\n\nIf you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.\n\nIf the first accordion of the accordion group is expanded by default, then the screen reader might loose focus when toggling the visibilty of the first accordion.",
|
827
|
-
"name": "AccordionGroup",
|
828
|
-
"cssProperties": [
|
829
|
-
{
|
830
|
-
"description": "The border color of the entire accordiongroup",
|
831
|
-
"name": "--mdc-accordiongroup-border-color"
|
832
|
-
}
|
833
|
-
],
|
834
|
-
"slots": [
|
835
|
-
{
|
836
|
-
"description": "The default slot can contain the `accordion` or `accordionbutton` components.",
|
837
|
-
"name": "default"
|
838
|
-
}
|
839
|
-
],
|
840
|
-
"members": [
|
841
|
-
{
|
842
|
-
"kind": "field",
|
843
|
-
"name": "size",
|
844
|
-
"type": {
|
845
|
-
"text": "Size"
|
846
|
-
},
|
847
|
-
"description": "The size of the accordion item.",
|
848
|
-
"default": "'small'",
|
849
|
-
"attribute": "size",
|
850
|
-
"reflects": true
|
851
|
-
},
|
852
|
-
{
|
853
|
-
"kind": "field",
|
854
|
-
"name": "variant",
|
855
|
-
"type": {
|
856
|
-
"text": "Variant"
|
857
|
-
},
|
858
|
-
"description": "The variant of the accordion item. Based on the variant, the styling of the accordion gets changed.",
|
859
|
-
"default": "'stacked'",
|
860
|
-
"attribute": "variant",
|
861
|
-
"reflects": true
|
862
|
-
},
|
863
|
-
{
|
864
|
-
"kind": "field",
|
865
|
-
"name": "allowMultiple",
|
866
|
-
"type": {
|
867
|
-
"text": "boolean"
|
868
|
-
},
|
869
|
-
"default": "false",
|
870
|
-
"description": "If true, multiple accordion items can be visible at the same time.",
|
871
|
-
"attribute": "allow-multiple",
|
872
|
-
"reflects": true
|
873
|
-
},
|
874
|
-
{
|
875
|
-
"kind": "method",
|
876
|
-
"name": "handleAccordionExpanded",
|
877
|
-
"privacy": "private",
|
878
|
-
"return": {
|
879
|
-
"type": {
|
880
|
-
"text": "void"
|
881
|
-
}
|
882
|
-
},
|
883
|
-
"parameters": [
|
884
|
-
{
|
885
|
-
"name": "event",
|
886
|
-
"type": {
|
887
|
-
"text": "Event"
|
888
|
-
},
|
889
|
-
"description": "The event object from the 'shown' event."
|
890
|
-
}
|
891
|
-
],
|
892
|
-
"description": "Handles the 'shown' event for accordion items.\nIf `allowMultiple` is false, ensures that only one accordion item\nremains expanded by collapsing all other expanded items when a new item is expanded."
|
893
|
-
},
|
894
|
-
{
|
895
|
-
"kind": "method",
|
896
|
-
"name": "setChildrenAccordionAttributes",
|
897
|
-
"privacy": "private",
|
898
|
-
"return": {
|
899
|
-
"type": {
|
900
|
-
"text": "void"
|
901
|
-
}
|
902
|
-
},
|
903
|
-
"parameters": [
|
904
|
-
{
|
905
|
-
"name": "attributeName",
|
906
|
-
"type": {
|
907
|
-
"text": "string"
|
908
|
-
},
|
909
|
-
"description": "The name of the attribute to set."
|
910
|
-
},
|
911
|
-
{
|
912
|
-
"name": "attributeValue",
|
913
|
-
"type": {
|
914
|
-
"text": "string"
|
915
|
-
},
|
916
|
-
"description": "The value to set the attribute to."
|
917
|
-
}
|
918
|
-
],
|
919
|
-
"description": "Sets the given attribute on all child accordion or accordionbutton components."
|
920
|
-
}
|
921
|
-
],
|
922
|
-
"attributes": [
|
923
|
-
{
|
924
|
-
"name": "size",
|
925
|
-
"type": {
|
926
|
-
"text": "Size"
|
927
|
-
},
|
928
|
-
"description": "The size of the accordion item.",
|
929
|
-
"default": "'small'",
|
930
|
-
"fieldName": "size"
|
931
|
-
},
|
932
|
-
{
|
933
|
-
"name": "variant",
|
934
|
-
"type": {
|
935
|
-
"text": "Variant"
|
936
|
-
},
|
937
|
-
"description": "The variant of the accordion item. Based on the variant, the styling of the accordion gets changed.",
|
938
|
-
"default": "'stacked'",
|
939
|
-
"fieldName": "variant"
|
940
|
-
},
|
941
|
-
{
|
942
|
-
"name": "allow-multiple",
|
943
|
-
"type": {
|
944
|
-
"text": "boolean"
|
945
|
-
},
|
946
|
-
"default": "false",
|
947
|
-
"description": "If true, multiple accordion items can be visible at the same time.",
|
948
|
-
"fieldName": "allowMultiple"
|
949
|
-
}
|
950
|
-
],
|
951
|
-
"superclass": {
|
952
|
-
"name": "Component",
|
953
|
-
"module": "/src/models"
|
954
|
-
},
|
955
|
-
"tagName": "mdc-accordiongroup",
|
956
|
-
"jsDoc": "/**\n * An accordion group is a vertically stacked set of interactive headings that each contain a header and body content.\n * Each heading of the accordion acts as a control that enable users to expand or hide their associated body sections of content.\n * Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.\n *\n * - Default Slot: The accordion group component only accepts, `accordion` and `accordionbutton` components as the children, rest are ignored.\n *\n * There are three types of variants:\n * - Stacked - Each accordion will have a gap of 1.5rem (24px).\n * - Borderless - Each accordion will not have any border and the group will also not have any border.\n * - Contained - Each accordion will have no gap in between them and the border of the entire accordiongroup will be continuous.\n *\n * There are two types of sizes:\n * - Small: Small size has a padding of 1rem (16px) for both heading and body sections.\n * - Large: Large size has a padding of 1.5rem (24px) for both heading and body sections.\n *\n * The variant and size will be applied to all accordions inside this accordion group.\n * To show/expand more than one accordion at any given time, then set `allow-multiple` to `true`. By default, it's `false`.\n *\n * If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.\n *\n * If the first accordion of the accordion group is expanded by default, then the screen reader might loose focus when toggling the visibilty of the first accordion.\n *\n * @tagname mdc-accordiongroup\n *\n * @slot default - The default slot can contain the `accordion` or `accordionbutton` components.\n *\n * @cssproperty --mdc-accordiongroup-border-color - The border color of the entire accordiongroup\n */",
|
957
|
-
"customElement": true
|
958
|
-
}
|
959
|
-
],
|
960
|
-
"exports": [
|
961
|
-
{
|
962
|
-
"kind": "js",
|
963
|
-
"name": "default",
|
964
|
-
"declaration": {
|
965
|
-
"name": "AccordionGroup",
|
966
|
-
"module": "components/accordiongroup/accordiongroup.component.js"
|
967
|
-
}
|
968
|
-
}
|
969
|
-
]
|
970
|
-
},
|
971
971
|
{
|
972
972
|
"kind": "javascript-module",
|
973
973
|
"path": "components/alertchip/alertchip.component.js",
|
@@ -16527,25 +16527,25 @@
|
|
16527
16527
|
"declarations": [
|
16528
16528
|
{
|
16529
16529
|
"kind": "class",
|
16530
|
-
"description": "mdc-list component is used to display a group of list items. It is used as a container to wrap other list items.",
|
16530
|
+
"description": "mdc-list component is used to display a group of list items. It is used as a container to wrap other list items.\n\nTo add a header to the list, use the `mdc-listheader` component and place it in the `list-header` slot.\n`mdc-listitem` components can be placed in the default slot.",
|
16531
16531
|
"name": "List",
|
16532
|
+
"cssParts": [
|
16533
|
+
{
|
16534
|
+
"description": "The container slot around the list items",
|
16535
|
+
"name": "container"
|
16536
|
+
}
|
16537
|
+
],
|
16532
16538
|
"slots": [
|
16533
16539
|
{
|
16534
|
-
"description": "This is a default/unnamed slot",
|
16540
|
+
"description": "This is a default/unnamed slot, where listitems can be placed.",
|
16535
16541
|
"name": "default"
|
16542
|
+
},
|
16543
|
+
{
|
16544
|
+
"description": "This slot is used to pass a header for the list, which can be a `mdc-listheader` component.",
|
16545
|
+
"name": "list-header"
|
16536
16546
|
}
|
16537
16547
|
],
|
16538
16548
|
"members": [
|
16539
|
-
{
|
16540
|
-
"kind": "field",
|
16541
|
-
"name": "headerText",
|
16542
|
-
"type": {
|
16543
|
-
"text": "string | undefined"
|
16544
|
-
},
|
16545
|
-
"description": "The header text of the list.",
|
16546
|
-
"attribute": "header-text",
|
16547
|
-
"reflects": true
|
16548
|
-
},
|
16549
16549
|
{
|
16550
16550
|
"kind": "method",
|
16551
16551
|
"name": "handleKeyDown",
|
@@ -16654,50 +16654,6 @@
|
|
16654
16654
|
}
|
16655
16655
|
],
|
16656
16656
|
"description": "Resets all list items tabindex to -1 and sets the tabindex of the\nelement at the given index to 0, effectively setting the active\nelement. This is used when navigating the list via keyboard."
|
16657
|
-
},
|
16658
|
-
{
|
16659
|
-
"kind": "field",
|
16660
|
-
"name": "dataAriaLabel",
|
16661
|
-
"type": {
|
16662
|
-
"text": "string | null"
|
16663
|
-
},
|
16664
|
-
"default": "null",
|
16665
|
-
"description": "Defines a string value that labels the current element.\nThe Aria-Label attribute to be set for accessibility.",
|
16666
|
-
"attribute": "data-aria-label",
|
16667
|
-
"reflects": true,
|
16668
|
-
"inheritedFrom": {
|
16669
|
-
"name": "DataAriaLabelMixin",
|
16670
|
-
"module": "utils/mixins/DataAriaLabelMixin.js"
|
16671
|
-
}
|
16672
|
-
}
|
16673
|
-
],
|
16674
|
-
"attributes": [
|
16675
|
-
{
|
16676
|
-
"name": "header-text",
|
16677
|
-
"type": {
|
16678
|
-
"text": "string | undefined"
|
16679
|
-
},
|
16680
|
-
"description": "The header text of the list.",
|
16681
|
-
"fieldName": "headerText"
|
16682
|
-
},
|
16683
|
-
{
|
16684
|
-
"name": "data-aria-label",
|
16685
|
-
"type": {
|
16686
|
-
"text": "string | null"
|
16687
|
-
},
|
16688
|
-
"default": "null",
|
16689
|
-
"description": "Defines a string value that labels the current element.\nThe Aria-Label attribute to be set for accessibility.",
|
16690
|
-
"fieldName": "dataAriaLabel",
|
16691
|
-
"inheritedFrom": {
|
16692
|
-
"name": "DataAriaLabelMixin",
|
16693
|
-
"module": "src/utils/mixins/DataAriaLabelMixin.ts"
|
16694
|
-
}
|
16695
|
-
}
|
16696
|
-
],
|
16697
|
-
"mixins": [
|
16698
|
-
{
|
16699
|
-
"name": "DataAriaLabelMixin",
|
16700
|
-
"module": "/src/utils/mixins/DataAriaLabelMixin"
|
16701
16657
|
}
|
16702
16658
|
],
|
16703
16659
|
"superclass": {
|
@@ -16705,7 +16661,7 @@
|
|
16705
16661
|
"module": "/src/models"
|
16706
16662
|
},
|
16707
16663
|
"tagName": "mdc-list",
|
16708
|
-
"jsDoc": "/**\n * mdc-list component is used to display a group of list items. It is used as a container to wrap other list items.\n *\n *
|
16664
|
+
"jsDoc": "/**\n * mdc-list component is used to display a group of list items. It is used as a container to wrap other list items.\n *\n * To add a header to the list, use the `mdc-listheader` component and place it in the `list-header` slot.\n * `mdc-listitem` components can be placed in the default slot.\n *\n * @tagname mdc-list\n *\n * @slot default - This is a default/unnamed slot, where listitems can be placed.\n * @slot list-header - This slot is used to pass a header for the list, which can be a `mdc-listheader` component.\n *\n * @csspart container - The container slot around the list items\n */",
|
16709
16665
|
"customElement": true
|
16710
16666
|
}
|
16711
16667
|
],
|
package/dist/react/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { default as Accordion } from './accordion';
|
2
|
-
export { default as AccordionButton } from './accordionbutton';
|
3
2
|
export { default as AccordionGroup } from './accordiongroup';
|
3
|
+
export { default as AccordionButton } from './accordionbutton';
|
4
4
|
export { default as AlertChip } from './alertchip';
|
5
5
|
export { default as Animation } from './animation';
|
6
6
|
export { default as Appheader } from './appheader';
|
package/dist/react/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { default as Accordion } from './accordion';
|
2
|
-
export { default as AccordionButton } from './accordionbutton';
|
3
2
|
export { default as AccordionGroup } from './accordiongroup';
|
3
|
+
export { default as AccordionButton } from './accordionbutton';
|
4
4
|
export { default as AlertChip } from './alertchip';
|
5
5
|
export { default as Animation } from './animation';
|
6
6
|
export { default as Appheader } from './appheader';
|
@@ -2,11 +2,15 @@ import Component from '../../components/list';
|
|
2
2
|
/**
|
3
3
|
* mdc-list component is used to display a group of list items. It is used as a container to wrap other list items.
|
4
4
|
*
|
5
|
+
* To add a header to the list, use the `mdc-listheader` component and place it in the `list-header` slot.
|
6
|
+
* `mdc-listitem` components can be placed in the default slot.
|
7
|
+
*
|
5
8
|
* @tagname mdc-list
|
6
9
|
*
|
7
|
-
* @
|
10
|
+
* @slot default - This is a default/unnamed slot, where listitems can be placed.
|
11
|
+
* @slot list-header - This slot is used to pass a header for the list, which can be a `mdc-listheader` component.
|
8
12
|
*
|
9
|
-
* @
|
13
|
+
* @csspart container - The container slot around the list items
|
10
14
|
*/
|
11
15
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
|
12
16
|
export default reactWrapper;
|
package/dist/react/list/index.js
CHANGED
@@ -5,11 +5,15 @@ import { TAG_NAME } from '../../components/list/list.constants';
|
|
5
5
|
/**
|
6
6
|
* mdc-list component is used to display a group of list items. It is used as a container to wrap other list items.
|
7
7
|
*
|
8
|
+
* To add a header to the list, use the `mdc-listheader` component and place it in the `list-header` slot.
|
9
|
+
* `mdc-listitem` components can be placed in the default slot.
|
10
|
+
*
|
8
11
|
* @tagname mdc-list
|
9
12
|
*
|
10
|
-
* @
|
13
|
+
* @slot default - This is a default/unnamed slot, where listitems can be placed.
|
14
|
+
* @slot list-header - This slot is used to pass a header for the list, which can be a `mdc-listheader` component.
|
11
15
|
*
|
12
|
-
* @
|
16
|
+
* @csspart container - The container slot around the list items
|
13
17
|
*/
|
14
18
|
const reactWrapper = createComponent({
|
15
19
|
tagName: TAG_NAME,
|
@@ -248,7 +248,13 @@ export const FocusTrapMixin = (superClass) => {
|
|
248
248
|
if (root instanceof HTMLElement && this.isFocusable(root)) {
|
249
249
|
matches.add(root);
|
250
250
|
}
|
251
|
-
|
251
|
+
let children = [];
|
252
|
+
if (root.children.length) {
|
253
|
+
children = Array.from(root.children);
|
254
|
+
}
|
255
|
+
else if (root instanceof HTMLElement && root.shadowRoot) {
|
256
|
+
children = Array.from(root.shadowRoot.children);
|
257
|
+
}
|
252
258
|
children.forEach((child) => {
|
253
259
|
const element = child;
|
254
260
|
if (this.isFocusable(element)) {
|