@m3e/list 1.1.6 → 1.1.8

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.
@@ -0,0 +1,127 @@
1
+ import { CSSResultGroup, PropertyValues } from "lit";
2
+ import { M3eListItemElement } from "./ListItemElement";
3
+ declare const M3eListOptionElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").SelectedMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DisabledMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").AttachInternalsMixin> & typeof M3eListItemElement;
4
+ /**
5
+ * A selectable option in a list.
6
+ *
7
+ * @description
8
+ * The `m3e-list-option` component represents a selectable item within a list container. It extends
9
+ * the base `m3e-list-item` functionality with selection state management, providing visual feedback
10
+ * for selected and unselected states. The component is designed for use with `m3e-selection-list`
11
+ * and supports rich content through multiple slots, comprehensive styling via CSS custom properties,
12
+ * and accessible interactions following Material 3 design principles.
13
+ *
14
+ * @tag m3e-list-option
15
+ *
16
+ * @slot - Renders the content of the list item.
17
+ * @slot leading - Renders the leading content of the list item.
18
+ * @slot overline - Renders the overline of the list item.
19
+ * @slot supporting-text - Renders the supporting text of the list item.
20
+ * @slot trailing - Renders the trailing content of the list item.
21
+ *
22
+ * @attr disabled - Whether the element is disabled.
23
+ * @attr selected - Whether the element is selected.
24
+ *
25
+ * @fires input - Emitted when the selected state changes.
26
+ * @fires change - Emitted when the selected state changes.
27
+ * @fires click - Emitted when the element is clicked.
28
+ *
29
+ * @cssprop --m3e-list-item-between-space - Horizontal gap between elements.
30
+ * @cssprop --m3e-list-item-padding-inline - Horizontal padding for the list item.
31
+ * @cssprop --m3e-list-item-padding-block - Vertical padding for the list item.
32
+ * @cssprop --m3e-list-item-height - Minimum height of the list item.
33
+ * @cssprop --m3e-list-item-font-size - Font size for main content.
34
+ * @cssprop --m3e-list-item-font-weight - Font weight for main content.
35
+ * @cssprop --m3e-list-item-line-height - Line height for main content.
36
+ * @cssprop --m3e-list-item-tracking - Letter spacing for main content.
37
+ * @cssprop --m3e-list-item-overline-font-size - Font size for overline slot.
38
+ * @cssprop --m3e-list-item-overline-font-weight - Font weight for overline slot.
39
+ * @cssprop --m3e-list-item-overline-line-height - Line height for overline slot.
40
+ * @cssprop --m3e-list-item-overline-tracking - Letter spacing for overline slot.
41
+ * @cssprop --m3e-list-item-supporting-text-font-size - Font size for supporting text slot.
42
+ * @cssprop --m3e-list-item-supporting-text-font-weight - Font weight for supporting text slot.
43
+ * @cssprop --m3e-list-item-supporting-text-line-height - Line height for supporting text slot.
44
+ * @cssprop --m3e-list-item-supporting-text-tracking - Letter spacing for supporting text slot.
45
+ * @cssprop --m3e-list-item-trailing-text-font-size - Font size for trailing supporting text slot.
46
+ * @cssprop --m3e-list-item-trailing-text-font-weight - Font weight for trailing supporting text slot.
47
+ * @cssprop --m3e-list-item-trailing-text-line-height - Line height for trailing supporting text slot.
48
+ * @cssprop --m3e-list-item-trailing-text-tracking - Letter spacing for trailing supporting text slot.
49
+ * @cssprop --m3e-list-item-icon-size - Size for leading/trailing icons.
50
+ * @cssprop --m3e-list-item-label-text-color - Color for the main content.
51
+ * @cssprop --m3e-list-item-overline-color - Color for the overline slot.
52
+ * @cssprop --m3e-list-item-supporting-text-color - Color for the supporting text slot.
53
+ * @cssprop --m3e-list-item-leading-color - Color for the leading content.
54
+ * @cssprop --m3e-list-item-trailing-color - Color for the trailing content.
55
+ * @cssprop --m3e-list-item-container-color - Background color of the list item.
56
+ * @cssprop --m3e-list-item-container-shape - Border radius of the list item.
57
+ * @cssprop --m3e-list-item-hover-container-shape - Border radius of the list item on hover.
58
+ * @cssprop --m3e-list-item-focus-container-shape - Border radius of the list item on focus.
59
+ * @cssprop --m3e-list-item-video-width - Width of the video slot.
60
+ * @cssprop --m3e-list-item-video-height - Height of the video slot.
61
+ * @cssprop --m3e-list-item-video-shape - Border radius of the video slot.
62
+ * @cssprop --m3e-list-item-image-width - Width of the image slot.
63
+ * @cssprop --m3e-list-item-image-height - Height of the image slot.
64
+ * @cssprop --m3e-list-item-image-shape - Border radius of the image slot.
65
+ * @cssprop --m3e-list-item-disabled-container-color - Background color of the list item when disabled.
66
+ * @cssprop --m3e-list-item-disabled-label-text-color - Color for the main content when disabled.
67
+ * @cssprop --m3e-list-item-disabled-label-text-opacity - Opacity for the main content when disabled.
68
+ * @cssprop --m3e-list-item-disabled-overline-color - Color for the overline slot when disabled.
69
+ * @cssprop --m3e-list-item-disabled-overline-opacity - Opacity for the overline slot when disabled.
70
+ * @cssprop --m3e-list-item-disabled-supporting-text-color - Color for the supporting text slot when disabled.
71
+ * @cssprop --m3e-list-item-disabled-supporting-text-opacity - Opacity for the supporting text slot when disabled.
72
+ * @cssprop --m3e-list-item-disabled-leading-color - Color for the leading icon when disabled.
73
+ * @cssprop --m3e-list-item-disabled-leading-opacity - Opacity for the leading icon when disabled.
74
+ * @cssprop --m3e-list-item-disabled-trailing-color - Color for the trailing icon when disabled.
75
+ * @cssprop --m3e-list-item-disabled-trailing-opacity - Opacity for the trailing icon when disabled.
76
+ * @cssprop --m3e-list-item-hover-state-layer-color - Color for the hover state layer.
77
+ * @cssprop --m3e-list-item-hover-state-layer-opacity - Opacity for the hover state layer.
78
+ * @cssprop --m3e-list-item-focus-state-layer-color - Color for the focus state layer.
79
+ * @cssprop --m3e-list-item-focus-state-layer-opacity - Opacity for the focus state layer.
80
+ * @cssprop --m3e-list-item-pressed-state-layer-color - Color for the pressed state layer.
81
+ * @cssprop --m3e-list-item-pressed-state-layer-opacity - Opacity for the pressed state layer.
82
+ * @cssprop --m3e-list-item-selected-label-text-color - Selected color for the main content.
83
+ * @cssprop --m3e-list-item-selected-overline-color - Selected color for the overline slot.
84
+ * @cssprop --m3e-list-item-selected-supporting-text-color - Selected color for the supporting text slot.
85
+ * @cssprop --m3e-list-item-selected-leading-color - Selected color for the leading content.
86
+ * @cssprop --m3e-list-item-selected-trailing-color - Selected color for the trailing content.
87
+ * @cssprop --m3e-list-item-selected-container-color - Selected background color of the list item.
88
+ * @cssprop --m3e-list-item-selected-container-shape - Selected border radius of the list item.
89
+ * @cssprop --m3e-list-item-selected-disabled-container-color - Selected background color when disabled.
90
+ * @cssprop --m3e-list-item-selected-disabled-container-opacity - Selected opacity when disabled.
91
+ * @cssprop --m3e-list-item-selected-hover-state-layer-color - Color for the hover state layer when selected.
92
+ * @cssprop --m3e-list-item-selected-hover-state-layer-opacity - Opacity for the hover state layer when selected.
93
+ * @cssprop --m3e-list-item-selected-focus-state-layer-color - Color for the focus state layer when selected.
94
+ * @cssprop --m3e-list-item-selected-focus-state-layer-opacity - Opacity for the focus state layer when selected.
95
+ * @cssprop --m3e-list-item-selected-pressed-state-layer-color - Color for the pressed state layer when selected.
96
+ * @cssprop --m3e-list-item-selected-pressed-state-layer-opacity - Opacity for the pressed state layer when selected.
97
+ * @cssprop --m3e-list-item-three-line-top-offset - Top offset for media in three line items.
98
+ * @cssprop --m3e-list-item-disabled-media-opacity - Opacity for media when disabled.
99
+ */
100
+ export declare class M3eListOptionElement extends M3eListOptionElement_base {
101
+ #private;
102
+ /** The styles of the element. */
103
+ static styles: CSSResultGroup;
104
+ /** @private */ private readonly _focusRing?;
105
+ /** @private */ private readonly _stateLayer?;
106
+ /** @private */ private readonly _ripple?;
107
+ /** A string representing the value of the option. */
108
+ get value(): string;
109
+ set value(value: string);
110
+ /** @inheritdoc */
111
+ connectedCallback(): void;
112
+ /** @inheritdoc */
113
+ disconnectedCallback(): void;
114
+ /** @inheritdoc */
115
+ protected firstUpdated(_changedProperties: PropertyValues<this>): void;
116
+ /** @inheritdoc */
117
+ protected update(changedProperties: PropertyValues<this>): void;
118
+ /** @inheritdoc */
119
+ protected render(): unknown;
120
+ }
121
+ declare global {
122
+ interface HTMLElementTagNameMap {
123
+ "m3e-list-option": M3eListOptionElement;
124
+ }
125
+ }
126
+ export {};
127
+ //# sourceMappingURL=ListOptionElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListOptionElement.d.ts","sourceRoot":"","sources":["../../src/ListOptionElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAO,cAAc,EAAQ,MAAM,KAAK,CAAC;AAmBhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,qBACa,oBAAqB,SAAQ,yBAEzC;;IACC,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAkGpC;IAKF,eAAe,CAAuB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAsB;IACxF,eAAe,CAAwB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAuB;IAC3F,eAAe,CAAmB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAmB;IAI9E,qDAAqD;IACrD,IAAgB,KAAK,IAGJ,MAAM,CADtB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAEtB;IAED,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAKrC,kBAAkB;cACC,YAAY,CAAC,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAK/E,kBAAkB;cACC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAYxE,kBAAkB;cACC,MAAM,IAAI,OAAO;CAuCrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,oBAAoB,CAAC;KACzC;CACF"}
@@ -0,0 +1,3 @@
1
+ /** Specifies the possible appearance variants of a list. */
2
+ export type ListVariant = "standard" | "segmented";
3
+ //# sourceMappingURL=ListVariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListVariant.d.ts","sourceRoot":"","sources":["../../src/ListVariant.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { PropertyValues } from "lit";
2
+ import { formValue } from "@m3e/core";
3
+ import { SelectionManager, selectionManager } from "@m3e/core/a11y";
4
+ import { M3eListElement } from "./ListElement";
5
+ import { M3eListOptionElement } from "./ListOptionElement";
6
+ declare const M3eSelectionListElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").LabelledMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DirtyMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").TouchedMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").FormAssociatedMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DisabledMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").AttachInternalsMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof M3eListElement;
7
+ /**
8
+ * A list of selectable options.
9
+ *
10
+ * @description
11
+ * The `m3e-selection-list` component provides a container for managing selectable list items with
12
+ * single or multi-select capabilities. It implements robust keyboard navigation, form association,
13
+ * and state management for both individual options and the list as a whole. The component supports
14
+ * flexible layout, custom theming via CSS custom properties, and comprehensive accessibility features
15
+ * including aria roles, roving tabindex management, and semantic event handling following Material 3
16
+ * design principles.
17
+ *
18
+ * @tag m3e-selection-list
19
+ *
20
+ * @slot - Renders the items of the list.
21
+ *
22
+ * @attr hide-selection-indicator - Whether to hide the selection indicator.
23
+ * @attr multi - Whether multiple items can be selected.
24
+ * @attr variant - The appearance variant of the list.
25
+ *
26
+ * @fires input - Emitted when the selected state of an option changes.
27
+ * @fires change - Emitted when the selected state of an option changes.
28
+ *
29
+ * @cssprop --m3e-list-divider-inset-start-size - Start inset for dividers within the list.
30
+ * @cssprop --m3e-list-divider-inset-end-size - End inset for dividers within the list.
31
+ * @cssprop --m3e-segmented-list-segment-gap - Gap between list items in segmented variant.
32
+ * @cssprop --m3e-segmented-list-container-shape - Border radius of the segmented list container.
33
+ * @cssprop --m3e-segmented-list-item-container-color - Background color of items in segmented variant.
34
+ * @cssprop --m3e-segmented-list-item-disabled-container-color - Background color of disabled items in segmented variant.
35
+ * @cssprop --m3e-segmented-list-item-container-shape - Border radius of items in segmented variant.
36
+ * @cssprop --m3e-segmented-list-item-hover-container-shape - Border radius of items in segmented variant on hover.
37
+ * @cssprop --m3e-segmented-list-item-focus-container-shape - Border radius of items in segmented variant on focus.
38
+ * @cssprop --m3e-segmented-list-item-selected-container-shape - Border radius of items in segmented variant when selected.
39
+ */
40
+ export declare class M3eSelectionListElement extends M3eSelectionListElement_base {
41
+ #private;
42
+ /** @private */
43
+ readonly [selectionManager]: SelectionManager<M3eListOptionElement>;
44
+ /**
45
+ * Whether multiple items can be selected.
46
+ * @default false
47
+ */
48
+ multi: boolean;
49
+ /**
50
+ * Whether to hide the selection indicator.
51
+ * @default false
52
+ */
53
+ hideSelectionIndicator: boolean;
54
+ /** The options of the list. */
55
+ get options(): readonly M3eListOptionElement[];
56
+ /** The selected option(s) of the list. */
57
+ get selected(): readonly M3eListOptionElement[];
58
+ /** The selected (enabled) value(s) of the set. */
59
+ get value(): string | readonly string[] | null;
60
+ /** @inheritdoc @internal */
61
+ get [formValue](): string | FormData | null;
62
+ /** @inheritdoc */
63
+ connectedCallback(): void;
64
+ /** @inheritdoc */
65
+ disconnectedCallback(): void;
66
+ /** @inheritdoc */
67
+ protected update(changedProperties: PropertyValues<this>): void;
68
+ /** @inheritdoc */
69
+ notifyItemsChange(): void;
70
+ }
71
+ declare global {
72
+ interface HTMLElementTagNameMap {
73
+ "m3e-selection-list": M3eSelectionListElement;
74
+ }
75
+ }
76
+ export {};
77
+ //# sourceMappingURL=SelectionListElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectionListElement.d.ts","sourceRoot":"","sources":["../../src/SelectionListElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrC,OAAO,EAAoD,SAAS,EAA2B,MAAM,WAAW,CAAC;AACjH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBACa,uBAAwB,SAAQ,4BAE5C;;IAIC,eAAe;IACf,QAAQ,CAAC,CAAC,gBAAgB,CAAC,yCAGE;IAE7B;;;OAGG;IAC0B,KAAK,UAAS;IAE3C;;;OAGG;IACiE,sBAAsB,UAAS;IAEnG,+BAA+B;IAC/B,IAAI,OAAO,IAAI,SAAS,oBAAoB,EAAE,CAE7C;IAED,0CAA0C;IAC1C,IAAI,QAAQ,IAAI,SAAS,oBAAoB,EAAE,CAE9C;IAED,kDAAkD;IAClD,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,CAU7C;IAED,4BAA4B;IAC5B,IAAa,CAAC,SAAS,CAAC,6BAUvB;IAED,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAOlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAOrC,kBAAkB;cACC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAwBxE,kBAAkB;IACT,iBAAiB,IAAI,IAAI;CAiBnC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,uBAAuB,CAAC;KAC/C;CACF"}
@@ -1,3 +1,11 @@
1
+ export * from "./ActionListElement";
2
+ export * from "./ExpandableListItemElement";
3
+ export * from "./ListActionElement";
1
4
  export * from "./ListElement";
5
+ export * from "./ListItemButtonElement";
6
+ export * from "./ListItemContentType";
2
7
  export * from "./ListItemElement";
8
+ export * from "./ListOptionElement";
9
+ export * from "./ListVariant";
10
+ export * from "./SelectionListElement";
3
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m3e/list",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "List for M3E",
5
5
  "author": "matraic <matraic@yahoo.com>",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "clean": "rimraf dist"
28
28
  },
29
29
  "peerDependencies": {
30
- "@m3e/core": "^1.1.3",
30
+ "@m3e/core": "^1.1.7",
31
31
  "lit": "^3.3.0"
32
32
  },
33
33
  "customElements": "dist/custom-elements.json"