@m3e/menu 1.0.0-rc.2 → 1.0.0-rc.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/README.md +1 -1
- package/dist/custom-elements.json +24 -29
- package/dist/src/MenuElement.d.ts +142 -0
- package/dist/src/MenuElement.d.ts.map +1 -0
- package/dist/src/MenuItemCheckboxElement.d.ts +77 -0
- package/dist/src/MenuItemCheckboxElement.d.ts.map +1 -0
- package/dist/src/MenuItemElement.d.ts +114 -0
- package/dist/src/MenuItemElement.d.ts.map +1 -0
- package/dist/src/MenuItemElementBase.d.ts +21 -0
- package/dist/src/MenuItemElementBase.d.ts.map +1 -0
- package/dist/src/MenuItemGroupElement.d.ts +27 -0
- package/dist/src/MenuItemGroupElement.d.ts.map +1 -0
- package/dist/src/MenuItemRadioElement.d.ts +78 -0
- package/dist/src/MenuItemRadioElement.d.ts.map +1 -0
- package/dist/src/MenuPosition.d.ts +5 -0
- package/dist/src/MenuPosition.d.ts.map +1 -0
- package/dist/src/MenuTriggerElement.d.ts +85 -0
- package/dist/src/MenuTriggerElement.d.ts.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.d.ts.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Alternately, you can explicitly reference the `html-custom-data.json` and `css-c
|
|
|
27
27
|
}
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
## 🚀
|
|
30
|
+
## 🚀 Native Module Support
|
|
31
31
|
|
|
32
32
|
This package uses [JavaScript Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#module_specifiers). To use it directly in a browser without a bundler, use a module script similar to the following.
|
|
33
33
|
|
|
@@ -3129,25 +3129,6 @@
|
|
|
3129
3129
|
"kind": "mixin",
|
|
3130
3130
|
"description": "Mixin that adds support for custom event attributes.",
|
|
3131
3131
|
"name": "EventAttribute",
|
|
3132
|
-
"members": [
|
|
3133
|
-
{
|
|
3134
|
-
"kind": "method",
|
|
3135
|
-
"name": "dispatchEvent",
|
|
3136
|
-
"return": {
|
|
3137
|
-
"type": {
|
|
3138
|
-
"text": "boolean"
|
|
3139
|
-
}
|
|
3140
|
-
},
|
|
3141
|
-
"parameters": [
|
|
3142
|
-
{
|
|
3143
|
-
"name": "event",
|
|
3144
|
-
"type": {
|
|
3145
|
-
"text": "Event"
|
|
3146
|
-
}
|
|
3147
|
-
}
|
|
3148
|
-
]
|
|
3149
|
-
}
|
|
3150
|
-
],
|
|
3151
3132
|
"parameters": [
|
|
3152
3133
|
{
|
|
3153
3134
|
"name": "base",
|
|
@@ -3445,6 +3426,17 @@
|
|
|
3445
3426
|
"description": "Mixin to augment an element with behavior used to submit a form.",
|
|
3446
3427
|
"name": "FormSubmitter",
|
|
3447
3428
|
"members": [
|
|
3429
|
+
{
|
|
3430
|
+
"kind": "field",
|
|
3431
|
+
"name": "formAssociated",
|
|
3432
|
+
"type": {
|
|
3433
|
+
"text": "boolean"
|
|
3434
|
+
},
|
|
3435
|
+
"static": true,
|
|
3436
|
+
"readonly": true,
|
|
3437
|
+
"default": "true",
|
|
3438
|
+
"description": "Indicates that this custom element participates in form submission, validation, and form state restoration."
|
|
3439
|
+
},
|
|
3448
3440
|
{
|
|
3449
3441
|
"kind": "field",
|
|
3450
3442
|
"name": "name",
|
|
@@ -3981,6 +3973,11 @@
|
|
|
3981
3973
|
"kind": "javascript-module",
|
|
3982
3974
|
"path": "../core/src/shared/mixins/Labelled.ts",
|
|
3983
3975
|
"declarations": [
|
|
3976
|
+
{
|
|
3977
|
+
"kind": "variable",
|
|
3978
|
+
"name": "updateLabels",
|
|
3979
|
+
"description": "A symbol through which to update labels to reflect a control's current state."
|
|
3980
|
+
},
|
|
3984
3981
|
{
|
|
3985
3982
|
"kind": "function",
|
|
3986
3983
|
"name": "isLabelledMixin",
|
|
@@ -4030,16 +4027,6 @@
|
|
|
4030
4027
|
},
|
|
4031
4028
|
"description": "The label elements that the element is associated with.",
|
|
4032
4029
|
"readonly": true
|
|
4033
|
-
},
|
|
4034
|
-
{
|
|
4035
|
-
"kind": "method",
|
|
4036
|
-
"name": "[_updateLabels]",
|
|
4037
|
-
"privacy": "private",
|
|
4038
|
-
"return": {
|
|
4039
|
-
"type": {
|
|
4040
|
-
"text": "void"
|
|
4041
|
-
}
|
|
4042
|
-
}
|
|
4043
4030
|
}
|
|
4044
4031
|
],
|
|
4045
4032
|
"parameters": [
|
|
@@ -4054,6 +4041,14 @@
|
|
|
4054
4041
|
}
|
|
4055
4042
|
],
|
|
4056
4043
|
"exports": [
|
|
4044
|
+
{
|
|
4045
|
+
"kind": "js",
|
|
4046
|
+
"name": "updateLabels",
|
|
4047
|
+
"declaration": {
|
|
4048
|
+
"name": "updateLabels",
|
|
4049
|
+
"module": "../core/src/shared/mixins/Labelled.ts"
|
|
4050
|
+
}
|
|
4051
|
+
},
|
|
4057
4052
|
{
|
|
4058
4053
|
"kind": "js",
|
|
4059
4054
|
"name": "isLabelledMixin",
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement } from "lit";
|
|
2
|
+
import { MenuPositionX, MenuPositionY } from "./MenuPosition";
|
|
3
|
+
import { MenuItemElementBase } from "./MenuItemElementBase";
|
|
4
|
+
declare const M3eMenuElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof LitElement;
|
|
5
|
+
/**
|
|
6
|
+
* Presents a list of choices on a temporary surface.
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* The `m3e-menu` component presents a list of choices on a temporary surface, typically anchored to a trigger element.
|
|
10
|
+
* It supports dynamic positioning via `position-x` and `position-y` attributes, and renders its contents through the default slot.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* The following example illustrates a basic menu. The `m3e-menu-trigger` is used to trigger a `m3e-menu` specified
|
|
14
|
+
* by the `for` attribute when its parenting element is activated.
|
|
15
|
+
* ```html
|
|
16
|
+
* <m3e-button>
|
|
17
|
+
* <m3e-menu-trigger for="menu1">Basic menu</m3e-menu-trigger>
|
|
18
|
+
* </m3e-button>
|
|
19
|
+
* <m3e-menu id="menu1">
|
|
20
|
+
* <m3e-menu-item>Apple</m3e-menu-item>
|
|
21
|
+
* <m3e-menu-item>Apricot</m3e-menu-item>
|
|
22
|
+
* <m3e-menu-item>Avocado</m3e-menu-item>
|
|
23
|
+
* <m3e-menu-item>Green Apple</m3e-menu-item>
|
|
24
|
+
* <m3e-menu-item>Green Grapes</m3e-menu-item>
|
|
25
|
+
* <m3e-menu-item>Olive</m3e-menu-item>
|
|
26
|
+
* <m3e-menu-item>Orange</m3e-menu-item>
|
|
27
|
+
* </m3e-menu>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* The next example illustrates nested menus. Submenus are triggered by placing a `m3e-menu-trigger` inside a `m3e-menu-item`.
|
|
32
|
+
* ```html
|
|
33
|
+
* <m3e-button>
|
|
34
|
+
* <m3e-menu-trigger for="menu2">Nested menus</m3e-menu-trigger>
|
|
35
|
+
* </m3e-button>
|
|
36
|
+
* <m3e-menu id="menu2">
|
|
37
|
+
* <m3e-menu-item>
|
|
38
|
+
* <m3e-menu-trigger for="menu3">Fruits with A</m3e-menu-trigger>
|
|
39
|
+
* </m3e-menu-item>
|
|
40
|
+
* <m3e-menu-item>Grapes</m3e-menu-item>
|
|
41
|
+
* <m3e-menu-item>Olive</m3e-menu-item>
|
|
42
|
+
* <m3e-menu-item>Orange</m3e-menu-item>
|
|
43
|
+
* </m3e-menu>
|
|
44
|
+
* <m3e-menu id="menu3">
|
|
45
|
+
* <m3e-menu-item>Apricot</m3e-menu-item>
|
|
46
|
+
* <m3e-menu-item>Avocado</m3e-menu-item>
|
|
47
|
+
* <m3e-menu-item>
|
|
48
|
+
* <m3e-menu-trigger for="menu4">Apples</m3e-menu-trigger>
|
|
49
|
+
* </m3e-menu-item>
|
|
50
|
+
* </m3e-menu>
|
|
51
|
+
* <m3e-menu id="menu4">
|
|
52
|
+
* <m3e-menu-item>Fuji</m3e-menu-item>
|
|
53
|
+
* <m3e-menu-item>Granny Smith</m3e-menu-item>
|
|
54
|
+
* <m3e-menu-item>Red Delicious</m3e-menu-item>
|
|
55
|
+
* </m3e-menu>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @tag m3e-menu
|
|
59
|
+
*
|
|
60
|
+
* @slot - Renders the contents of the menu.
|
|
61
|
+
*
|
|
62
|
+
* @attr position-x - The position of the menu, on the x-axis.
|
|
63
|
+
* @attr position-y - The position of the menu, on the y-axis.
|
|
64
|
+
*
|
|
65
|
+
* @fires beforetoggle - Dispatched before the toggle state changes.
|
|
66
|
+
* @fires toggle - Dispatched after the toggle state has changed.
|
|
67
|
+
*
|
|
68
|
+
* @cssprop --m3e-menu-container-shape - Controls the corner radius of the menu container.
|
|
69
|
+
* @cssprop --m3e-menu-container-min-width - Minimum width of the menu container.
|
|
70
|
+
* @cssprop --m3e-menu-container-max-width - Maximum width of the menu container.
|
|
71
|
+
* @cssprop --m3e-menu-container-max-height - Maximum height of the menu container.
|
|
72
|
+
* @cssprop --m3e-menu-container-padding-block - Vertical padding inside the menu container.
|
|
73
|
+
* @cssprop --m3e-menu-container-color - Background color of the menu container.
|
|
74
|
+
* @cssprop --m3e-menu-container-elevation - Box shadow elevation of the menu container.
|
|
75
|
+
* @cssprop --m3e-menu-divider-spacing - Vertical spacing around slotted `m3e-divider` elements.
|
|
76
|
+
*/
|
|
77
|
+
export declare class M3eMenuElement extends M3eMenuElement_base {
|
|
78
|
+
#private;
|
|
79
|
+
/** The styles of the element. */
|
|
80
|
+
static styles: CSSResultGroup;
|
|
81
|
+
/**
|
|
82
|
+
* The position of the menu, on the x-axis.
|
|
83
|
+
* @default "after"
|
|
84
|
+
*/
|
|
85
|
+
positionX: MenuPositionX;
|
|
86
|
+
/**
|
|
87
|
+
* The position of the menu, on the y-axis.
|
|
88
|
+
* @default "below"
|
|
89
|
+
*/
|
|
90
|
+
positionY: MenuPositionY;
|
|
91
|
+
/** The items of the menu. */
|
|
92
|
+
get items(): ReadonlyArray<MenuItemElementBase>;
|
|
93
|
+
/** A value indicating whether the menu is open. */
|
|
94
|
+
get isOpen(): boolean;
|
|
95
|
+
/** A value indicating whether the menu is a submenu. */
|
|
96
|
+
submenu: boolean;
|
|
97
|
+
/** @inheritdoc */
|
|
98
|
+
connectedCallback(): void;
|
|
99
|
+
/** @inheritdoc */
|
|
100
|
+
disconnectedCallback(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Opens the menu.
|
|
103
|
+
* @param {HTMLElement} trigger The element that triggered the menu.
|
|
104
|
+
* @returns {Promise<void>} A `Promise` that resolves when the menu is opened.
|
|
105
|
+
*/
|
|
106
|
+
show(trigger: HTMLElement): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Hides the menu.
|
|
109
|
+
* @param {boolean} [restoreFocus=false] A value indicating whether to restore focus to the menu's trigger.
|
|
110
|
+
*/
|
|
111
|
+
hide(restoreFocus?: boolean): void;
|
|
112
|
+
/**
|
|
113
|
+
* Closes this menu and any parenting menus.
|
|
114
|
+
* @param {boolean} [restoreFocus=false] A value indicating whether to restore focus to the menu's trigger.
|
|
115
|
+
*/
|
|
116
|
+
hideAll(restoreFocus?: boolean): void;
|
|
117
|
+
/**
|
|
118
|
+
* Toggles the menu.
|
|
119
|
+
* @param {HTMLElement} trigger The element that triggered the menu.
|
|
120
|
+
* @returns {Promise<void>} A `Promise` that resolves when the menu is opened or closed.
|
|
121
|
+
*/
|
|
122
|
+
toggle(trigger: HTMLElement): Promise<void>;
|
|
123
|
+
/** @inheritdoc */
|
|
124
|
+
protected render(): unknown;
|
|
125
|
+
}
|
|
126
|
+
interface M3eMenuElementEventMap extends HTMLElementEventMap {
|
|
127
|
+
beforetoggle: ToggleEvent;
|
|
128
|
+
toggle: ToggleEvent;
|
|
129
|
+
}
|
|
130
|
+
export interface M3eMenuElement {
|
|
131
|
+
addEventListener<K extends keyof M3eMenuElementEventMap>(type: K, listener: (this: M3eMenuElement, ev: M3eMenuElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
132
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
133
|
+
removeEventListener<K extends keyof M3eMenuElementEventMap>(type: K, listener: (this: M3eMenuElement, ev: M3eMenuElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
134
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
135
|
+
}
|
|
136
|
+
declare global {
|
|
137
|
+
interface HTMLElementTagNameMap {
|
|
138
|
+
"m3e-menu": M3eMenuElement;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export {};
|
|
142
|
+
//# sourceMappingURL=MenuElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuElement.d.ts","sourceRoot":"","sources":["../../src/MenuElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAa,MAAM,KAAK,CAAC;AAQvE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,qBACa,cAAe,SAAQ,mBAAwB;;IAC1D,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CA0EpC;IA+BF;;;OAGG;IACoC,SAAS,EAAE,aAAa,CAAW;IAE1E;;;OAGG;IACoC,SAAS,EAAE,aAAa,CAAW;IAE1E,6BAA6B;IAC7B,IAAI,KAAK,IAAI,aAAa,CAAC,mBAAmB,CAAC,CAE9C;IAED,mDAAmD;IACnD,IAAI,MAAM,YAET;IAED,wDAAwD;IACZ,OAAO,UAAS;IAE5D,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAUlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAQrC;;;;OAIG;IACG,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAgD/C;;;OAGG;IACH,IAAI,CAAC,YAAY,GAAE,OAAe,GAAG,IAAI;IAoBzC;;;OAGG;IACH,OAAO,CAAC,YAAY,GAAE,OAAe,GAAG,IAAI;IAa5C;;;;OAIG;IACG,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjD,kBAAkB;cACC,MAAM,IAAI,OAAO;CAiErC;AAED,UAAU,sBAAuB,SAAQ,mBAAmB;IAC1D,YAAY,EAAE,WAAW,CAAC;IAC1B,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,gBAAgB,CAAC,CAAC,SAAS,MAAM,sBAAsB,EACrD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,IAAI,EACvE,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAC;IAER,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAC;IAER,mBAAmB,CAAC,CAAC,SAAS,MAAM,sBAAsB,EACxD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,IAAI,EACvE,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI,CAAC;IAER,mBAAmB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI,CAAC;CACT;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,cAAc,CAAC;KAC5B;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CSSResultGroup } from "lit";
|
|
2
|
+
import { MenuItemElementBase } from "./MenuItemElementBase";
|
|
3
|
+
declare const M3eMenuItemCheckboxElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").CheckedMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof MenuItemElementBase;
|
|
4
|
+
/**
|
|
5
|
+
* An item of a menu which supports a checkable state.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* The `m3e-menu-item-checkbox` component represents a menu item that supports an independent checkable state.
|
|
9
|
+
* It allows users to toggle options on or off without affecting other items in the menu, making it ideal for
|
|
10
|
+
* multi-select scenarios such as filters, visibility toggles, or feature flags. This component encodes a persistent
|
|
11
|
+
* selection contract and can coexist with other checkbox or radio items within the same menu.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* The following example illustrates use of the `m3e-menu-item-checkbox` to present multiple independent checkable
|
|
15
|
+
* items in a menu.
|
|
16
|
+
* ```html
|
|
17
|
+
* <m3e-button>
|
|
18
|
+
* <m3e-menu-trigger for="menu">Format</m3e-menu-trigger>
|
|
19
|
+
* </m3e-button>
|
|
20
|
+
* <m3e-menu id="menu">
|
|
21
|
+
* <m3e-menu-item-checkbox>Bold</m3e-menu-item-checkbox>
|
|
22
|
+
* <m3e-menu-item-checkbox>Italic</m3e-menu-item-checkbox>
|
|
23
|
+
* <m3e-menu-item-checkbox>Underline</m3e-menu-item-checkbox>
|
|
24
|
+
* </m3e-menu>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @tag m3e-menu-item-checkbox
|
|
28
|
+
*
|
|
29
|
+
* @slot - Renders the label of the item.
|
|
30
|
+
* @slot icon - Renders an icon before the items's label.
|
|
31
|
+
* @slot trailing-icon - Renders an icon after the item's label.
|
|
32
|
+
*
|
|
33
|
+
* @attr disabled - Whether the element is disabled.
|
|
34
|
+
* @attr checked - Whether the element is checked.
|
|
35
|
+
*
|
|
36
|
+
* @fires click - Emitted when the element is clicked.
|
|
37
|
+
*
|
|
38
|
+
* @cssprop --m3e-menu-item-container-height - Height of the menu item container.
|
|
39
|
+
* @cssprop --m3e-menu-item-color - Text color for unselected, enabled menu items.
|
|
40
|
+
* @cssprop --m3e-menu-item-container-hover-color - State layer hover color for unselected items.
|
|
41
|
+
* @cssprop --m3e-menu-item-container-focus-color - State layer focus color for unselected items.
|
|
42
|
+
* @cssprop --m3e-menu-item-ripple-color - Ripple color for unselected items.
|
|
43
|
+
* @cssprop --m3e-menu-selected-color - Text color for selected or expanded items.
|
|
44
|
+
* @cssprop --m3e-menu-selected-container-color - Background color for selected or expanded items.
|
|
45
|
+
* @cssprop --m3e-menu-item-selected-container-hover-color - State layer hover color for selected items.
|
|
46
|
+
* @cssprop --m3e-menu-item-selected-container-focus-color - State layer focus color for selected items.
|
|
47
|
+
* @cssprop --m3e-menu-item-selected-ripple-color - Ripple color for selected items.
|
|
48
|
+
* @cssprop --m3e-menu-item-disabled-color - Base color for disabled items.
|
|
49
|
+
* @cssprop --m3e-menu-item-disabled-opacity - Opacity percentage for disabled item color mix.
|
|
50
|
+
* @cssprop --m3e-menu-item-icon-label-space - Horizontal gap between icon and content.
|
|
51
|
+
* @cssprop --m3e-menu-item-padding-start - Start padding for the item wrapper.
|
|
52
|
+
* @cssprop --m3e-menu-item-padding-end - End padding for the item wrapper.
|
|
53
|
+
* @cssprop --m3e-menu-item-label-text-font-size - Font size for menu item text.
|
|
54
|
+
* @cssprop --m3e-menu-item-label-text-font-weight - Font weight for menu item text.
|
|
55
|
+
* @cssprop --m3e-menu-item-label-text-line-height - Line height for menu item text.
|
|
56
|
+
* @cssprop --m3e-menu-item-label-text-tracking - Letter spacing for menu item text.
|
|
57
|
+
* @cssprop --m3e-menu-item-focus-ring-shape - Border radius for the focus ring.
|
|
58
|
+
* @cssprop --m3e-menu-item-icon-size - Font size for leading and trailing icons.
|
|
59
|
+
*/
|
|
60
|
+
export declare class M3eMenuItemCheckboxElement extends M3eMenuItemCheckboxElement_base {
|
|
61
|
+
#private;
|
|
62
|
+
/** The styles of the element. */
|
|
63
|
+
static styles: CSSResultGroup;
|
|
64
|
+
/** @inheritdoc */
|
|
65
|
+
connectedCallback(): void;
|
|
66
|
+
/** @inheritdoc */
|
|
67
|
+
disconnectedCallback(): void;
|
|
68
|
+
/** @internal @inheritdoc */
|
|
69
|
+
protected _renderContent(): unknown;
|
|
70
|
+
}
|
|
71
|
+
declare global {
|
|
72
|
+
interface HTMLElementTagNameMap {
|
|
73
|
+
"m3e-menu-item-checkbox": M3eMenuItemCheckboxElement;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=MenuItemCheckboxElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemCheckboxElement.d.ts","sourceRoot":"","sources":["../../src/MenuItemCheckboxElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,MAAM,KAAK,CAAC;AAMhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,qBACa,0BAA2B,SAAQ,+BAAsD;;IACpG,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAyBpC;IAQF,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IASlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IASrC,4BAA4B;cACT,cAAc,IAAI,OAAO;CAmD7C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,0BAA0B,CAAC;KACtD;CACF"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { M3eMenuElement } from "./MenuElement";
|
|
2
|
+
import { MenuItemElementBase } from "./MenuItemElementBase";
|
|
3
|
+
declare const M3eMenuItemElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").LinkButtonMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof MenuItemElementBase;
|
|
4
|
+
/**
|
|
5
|
+
* An item of a menu.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* The `m3e-menu-item` component represents a single actionable item within a menu, supporting standard
|
|
9
|
+
* click behavior, optional link semantics, and flexible icon placement for navigation, commands, or
|
|
10
|
+
* contextual actions. It behaves as a button or link depending on its attributes, and can trigger a submenu
|
|
11
|
+
* when a nested `m3e-menu-trigger` is present—enabling hierarchical flows.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* The following example illustrates a basic menu. The `m3e-menu-trigger` is used to trigger a `m3e-menu` specified
|
|
15
|
+
* by the `for` attribute when its parenting element is activated.
|
|
16
|
+
* ```html
|
|
17
|
+
* <m3e-button>
|
|
18
|
+
* <m3e-menu-trigger for="menu1">Basic menu</m3e-menu-trigger>
|
|
19
|
+
* </m3e-button>
|
|
20
|
+
* <m3e-menu id="menu1">
|
|
21
|
+
* <m3e-menu-item>Apple</m3e-menu-item>
|
|
22
|
+
* <m3e-menu-item>Apricot</m3e-menu-item>
|
|
23
|
+
* <m3e-menu-item>Avocado</m3e-menu-item>
|
|
24
|
+
* <m3e-menu-item>Green Apple</m3e-menu-item>
|
|
25
|
+
* <m3e-menu-item>Green Grapes</m3e-menu-item>
|
|
26
|
+
* <m3e-menu-item>Olive</m3e-menu-item>
|
|
27
|
+
* <m3e-menu-item>Orange</m3e-menu-item>
|
|
28
|
+
* </m3e-menu>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* The next example illustrates nested menus. Submenus are triggered by placing a `m3e-menu-trigger` inside a `m3e-menu-item`.
|
|
33
|
+
* ```html
|
|
34
|
+
* <m3e-button>
|
|
35
|
+
* <m3e-menu-trigger for="menu2">Nested menus</m3e-menu-trigger>
|
|
36
|
+
* </m3e-button>
|
|
37
|
+
* <m3e-menu id="menu2">
|
|
38
|
+
* <m3e-menu-item>
|
|
39
|
+
* <m3e-menu-trigger for="menu3">Fruits with A</m3e-menu-trigger>
|
|
40
|
+
* </m3e-menu-item>
|
|
41
|
+
* <m3e-menu-item>Grapes</m3e-menu-item>
|
|
42
|
+
* <m3e-menu-item>Olive</m3e-menu-item>
|
|
43
|
+
* <m3e-menu-item>Orange</m3e-menu-item>
|
|
44
|
+
* </m3e-menu>
|
|
45
|
+
* <m3e-menu id="menu3">
|
|
46
|
+
* <m3e-menu-item>Apricot</m3e-menu-item>
|
|
47
|
+
* <m3e-menu-item>Avocado</m3e-menu-item>
|
|
48
|
+
* <m3e-menu-item>
|
|
49
|
+
* <m3e-menu-trigger for="menu4">Apples</m3e-menu-trigger>
|
|
50
|
+
* </m3e-menu-item>
|
|
51
|
+
* </m3e-menu>
|
|
52
|
+
* <m3e-menu id="menu4">
|
|
53
|
+
* <m3e-menu-item>Fuji</m3e-menu-item>
|
|
54
|
+
* <m3e-menu-item>Granny Smith</m3e-menu-item>
|
|
55
|
+
* <m3e-menu-item>Red Delicious</m3e-menu-item>
|
|
56
|
+
* </m3e-menu>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @tag m3e-menu-item
|
|
60
|
+
*
|
|
61
|
+
* @slot - Renders the label of the item.
|
|
62
|
+
* @slot icon - Renders an icon before the items's label.
|
|
63
|
+
* @slot trailing-icon - Renders an icon after the item's label.
|
|
64
|
+
*
|
|
65
|
+
* @attr disabled - Whether the element is disabled.
|
|
66
|
+
* @attr download - Whether the `target` of the link button will be downloaded, optionally specifying the new name of the file.
|
|
67
|
+
* @attr href - The URL to which the link button points.
|
|
68
|
+
* @attr rel - The relationship between the `target` of the link button and the document.
|
|
69
|
+
* @attr target - The target of the link button.
|
|
70
|
+
*
|
|
71
|
+
* @fires click - Emitted when the element is clicked.
|
|
72
|
+
*
|
|
73
|
+
* @cssprop --m3e-menu-item-container-height - Height of the menu item container.
|
|
74
|
+
* @cssprop --m3e-menu-item-color - Text color for unselected, enabled menu items.
|
|
75
|
+
* @cssprop --m3e-menu-item-container-hover-color - State layer hover color for unselected items.
|
|
76
|
+
* @cssprop --m3e-menu-item-container-focus-color - State layer focus color for unselected items.
|
|
77
|
+
* @cssprop --m3e-menu-item-ripple-color - Ripple color for unselected items.
|
|
78
|
+
* @cssprop --m3e-menu-selected-color - Text color for selected or expanded items.
|
|
79
|
+
* @cssprop --m3e-menu-selected-container-color - Background color for selected or expanded items.
|
|
80
|
+
* @cssprop --m3e-menu-item-selected-container-hover-color - State layer hover color for selected items.
|
|
81
|
+
* @cssprop --m3e-menu-item-selected-container-focus-color - State layer focus color for selected items.
|
|
82
|
+
* @cssprop --m3e-menu-item-selected-ripple-color - Ripple color for selected items.
|
|
83
|
+
* @cssprop --m3e-menu-item-disabled-color - Base color for disabled items.
|
|
84
|
+
* @cssprop --m3e-menu-item-disabled-opacity - Opacity percentage for disabled item color mix.
|
|
85
|
+
* @cssprop --m3e-menu-item-icon-label-space - Horizontal gap between icon and content.
|
|
86
|
+
* @cssprop --m3e-menu-item-padding-start - Start padding for the item wrapper.
|
|
87
|
+
* @cssprop --m3e-menu-item-padding-end - End padding for the item wrapper.
|
|
88
|
+
* @cssprop --m3e-menu-item-label-text-font-size - Font size for menu item text.
|
|
89
|
+
* @cssprop --m3e-menu-item-label-text-font-weight - Font weight for menu item text.
|
|
90
|
+
* @cssprop --m3e-menu-item-label-text-line-height - Line height for menu item text.
|
|
91
|
+
* @cssprop --m3e-menu-item-label-text-tracking - Letter spacing for menu item text.
|
|
92
|
+
* @cssprop --m3e-menu-item-focus-ring-shape - Border radius for the focus ring.
|
|
93
|
+
* @cssprop --m3e-menu-item-icon-size - Font size for leading and trailing icons.
|
|
94
|
+
*/
|
|
95
|
+
export declare class M3eMenuItemElement extends M3eMenuItemElement_base {
|
|
96
|
+
#private;
|
|
97
|
+
/** @private */ private _hasSubmenu;
|
|
98
|
+
constructor();
|
|
99
|
+
/** The submenu triggered by the item. */
|
|
100
|
+
get submenu(): M3eMenuElement | null;
|
|
101
|
+
/** @inheritdoc */
|
|
102
|
+
connectedCallback(): void;
|
|
103
|
+
/** @inheritdoc */
|
|
104
|
+
disconnectedCallback(): void;
|
|
105
|
+
/** @internal @inheritdoc */
|
|
106
|
+
protected _renderContent(): unknown;
|
|
107
|
+
}
|
|
108
|
+
declare global {
|
|
109
|
+
interface HTMLElementTagNameMap {
|
|
110
|
+
"m3e-menu-item": M3eMenuItemElement;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export {};
|
|
114
|
+
//# sourceMappingURL=MenuItemElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemElement.d.ts","sourceRoot":"","sources":["../../src/MenuItemElement.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,qBACa,kBAAmB,SAAQ,uBAAiD;;IAKvF,eAAe,CAAU,OAAO,CAAC,WAAW,CAAS;;IAiBrD,yCAAyC;IACzC,IAAI,OAAO,IAAI,cAAc,GAAG,IAAI,CAEnC;IAED,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAQlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAQrC,4BAA4B;cACT,cAAc,IAAI,OAAO;CAyD7C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,kBAAkB,CAAC;KACrC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement, PropertyValues } from "lit";
|
|
2
|
+
import type { M3eMenuElement } from "./MenuElement";
|
|
3
|
+
declare const MenuItemElementBase_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").AttachInternalsMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DisabledMixin> & typeof LitElement;
|
|
4
|
+
/** A base implementation for an item of a menu. This class must be inherited. */
|
|
5
|
+
export declare abstract class MenuItemElementBase extends MenuItemElementBase_base {
|
|
6
|
+
/** The styles of the element. */
|
|
7
|
+
static styles: CSSResultGroup;
|
|
8
|
+
/** @private */ private readonly _focusRing?;
|
|
9
|
+
/** @private */ private readonly _stateLayer?;
|
|
10
|
+
/** @private */ private readonly _ripple?;
|
|
11
|
+
/** The menu to which this item belongs. */
|
|
12
|
+
get menu(): M3eMenuElement | null;
|
|
13
|
+
/** @inheritdoc */
|
|
14
|
+
protected firstUpdated(_changedProperties: PropertyValues<this>): void;
|
|
15
|
+
/** @inheritdoc */
|
|
16
|
+
render(): unknown;
|
|
17
|
+
/** @internal Renders the content of the item. */
|
|
18
|
+
protected abstract _renderContent(): unknown;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=MenuItemElementBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemElementBase.d.ts","sourceRoot":"","sources":["../../src/MenuItemElementBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAW,cAAc,EAAE,MAAM,KAAK,CAAC;AAgBrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;;AAEpD,iFAAiF;AACjF,8BAAsB,mBAAoB,SAAQ,wBAEjD;IACC,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAuGpC;IAEF,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;IAE9E,2CAA2C;IAC3C,IAAI,IAAI,IAAI,cAAc,GAAG,IAAI,CAEhC;IAED,kBAAkB;cACC,YAAY,CAAC,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAK/E,kBAAkB;IACT,MAAM,IAAI,OAAO;IAW1B,iDAAiD;IACjD,SAAS,CAAC,QAAQ,CAAC,cAAc,IAAI,OAAO;CAC7C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement } from "lit";
|
|
2
|
+
declare const M3eMenuItemGroupElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof LitElement;
|
|
3
|
+
/**
|
|
4
|
+
* Groups related items (such a radios) in a menu.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* The `m3e-menu-item-group` component groups related items within a menu, establishing a shared
|
|
8
|
+
* context for interaction and selection. It enables separation of concerns—such as organizing radio
|
|
9
|
+
* items into mutually exclusive sets.
|
|
10
|
+
*
|
|
11
|
+
* @tag m3e-menu-item-group
|
|
12
|
+
*
|
|
13
|
+
* @slot - Renders the contents of the group.
|
|
14
|
+
*/
|
|
15
|
+
export declare class M3eMenuItemGroupElement extends M3eMenuItemGroupElement_base {
|
|
16
|
+
/** The styles of the element. */
|
|
17
|
+
static styles: CSSResultGroup;
|
|
18
|
+
/** @inheritdoc */
|
|
19
|
+
protected render(): unknown;
|
|
20
|
+
}
|
|
21
|
+
declare global {
|
|
22
|
+
interface HTMLElementTagNameMap {
|
|
23
|
+
"m3e-menu-item-group": M3eMenuItemGroupElement;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=MenuItemGroupElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemGroupElement.d.ts","sourceRoot":"","sources":["../../src/MenuItemGroupElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;;AAG5D;;;;;;;;;;;GAWG;AACH,qBACa,uBAAwB,SAAQ,4BAAyB;IACpE,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAIpC;IAEF,kBAAkB;cACC,MAAM,IAAI,OAAO;CAGrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,uBAAuB,CAAC;KAChD;CACF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CSSResultGroup, PropertyValues } from "lit";
|
|
2
|
+
import { MenuItemElementBase } from "./MenuItemElementBase";
|
|
3
|
+
declare const M3eMenuItemRadioElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").CheckedMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & typeof MenuItemElementBase;
|
|
4
|
+
/**
|
|
5
|
+
* An item of a menu which supports a mutually exclusive checkable state.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* The `m3e-menu-item-radio` component represents a selectable menu item that participates in a mutually exclusive group.
|
|
9
|
+
* It reflects a singular choice within a shared context—such as sort order, theme selection, or view mode—and updates
|
|
10
|
+
* group state when selected. This component can be nested within an `m3e-menu-item-group`, allowing multiple exclusive
|
|
11
|
+
* groups to coexist within a single menu.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* The following example illustrates use of the `m3e-menu-item-radio` in a `m3e-menu` to allow a user to select a sort order.
|
|
15
|
+
* The `m3e-menu-trigger` is used to trigger a `m3e-menu` specified by the `for` attribute when its parenting element is activated.
|
|
16
|
+
* ```html
|
|
17
|
+
* <m3e-button>
|
|
18
|
+
* <m3e-menu-trigger for="menu">Sort order</m3e-menu-trigger>
|
|
19
|
+
* </m3e-button>
|
|
20
|
+
* <m3e-menu id="menu">
|
|
21
|
+
* <m3e-menu-item-radio>Ascending</m3e-menu-item-radio>
|
|
22
|
+
* <m3e-menu-item-radio>Descending</m3e-menu-item-radio>
|
|
23
|
+
* </m3e-menu>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @tag m3e-menu-item-radio
|
|
27
|
+
*
|
|
28
|
+
* @slot - Renders the label of the item.
|
|
29
|
+
* @slot icon - Renders an icon before the items's label.
|
|
30
|
+
* @slot trailing-icon - Renders an icon after the item's label.
|
|
31
|
+
*
|
|
32
|
+
* @attr disabled - Whether the element is disabled.
|
|
33
|
+
* @attr checked - Whether the element is checked.
|
|
34
|
+
*
|
|
35
|
+
* @fires click - Emitted when the element is clicked.
|
|
36
|
+
*
|
|
37
|
+
* @cssprop --m3e-menu-item-container-height - Height of the menu item container.
|
|
38
|
+
* @cssprop --m3e-menu-item-color - Text color for unselected, enabled menu items.
|
|
39
|
+
* @cssprop --m3e-menu-item-container-hover-color - State layer hover color for unselected items.
|
|
40
|
+
* @cssprop --m3e-menu-item-container-focus-color - State layer focus color for unselected items.
|
|
41
|
+
* @cssprop --m3e-menu-item-ripple-color - Ripple color for unselected items.
|
|
42
|
+
* @cssprop --m3e-menu-selected-color - Text color for selected or expanded items.
|
|
43
|
+
* @cssprop --m3e-menu-selected-container-color - Background color for selected or expanded items.
|
|
44
|
+
* @cssprop --m3e-menu-item-selected-container-hover-color - State layer hover color for selected items.
|
|
45
|
+
* @cssprop --m3e-menu-item-selected-container-focus-color - State layer focus color for selected items.
|
|
46
|
+
* @cssprop --m3e-menu-item-selected-ripple-color - Ripple color for selected items.
|
|
47
|
+
* @cssprop --m3e-menu-item-disabled-color - Base color for disabled items.
|
|
48
|
+
* @cssprop --m3e-menu-item-disabled-opacity - Opacity percentage for disabled item color mix.
|
|
49
|
+
* @cssprop --m3e-menu-item-icon-label-space - Horizontal gap between icon and content.
|
|
50
|
+
* @cssprop --m3e-menu-item-padding-start - Start padding for the item wrapper.
|
|
51
|
+
* @cssprop --m3e-menu-item-padding-end - End padding for the item wrapper.
|
|
52
|
+
* @cssprop --m3e-menu-item-label-text-font-size - Font size for menu item text.
|
|
53
|
+
* @cssprop --m3e-menu-item-label-text-font-weight - Font weight for menu item text.
|
|
54
|
+
* @cssprop --m3e-menu-item-label-text-line-height - Line height for menu item text.
|
|
55
|
+
* @cssprop --m3e-menu-item-label-text-tracking - Letter spacing for menu item text.
|
|
56
|
+
* @cssprop --m3e-menu-item-focus-ring-shape - Border radius for the focus ring.
|
|
57
|
+
* @cssprop --m3e-menu-item-icon-size - Font size for leading and trailing icons.
|
|
58
|
+
*/
|
|
59
|
+
export declare class M3eMenuItemRadioElement extends M3eMenuItemRadioElement_base {
|
|
60
|
+
#private;
|
|
61
|
+
/** The styles of the element. */
|
|
62
|
+
static styles: CSSResultGroup;
|
|
63
|
+
/** @inheritdoc */
|
|
64
|
+
connectedCallback(): void;
|
|
65
|
+
/** @inheritdoc */
|
|
66
|
+
disconnectedCallback(): void;
|
|
67
|
+
/** @inheritdoc */
|
|
68
|
+
protected update(changedProperties: PropertyValues<this>): void;
|
|
69
|
+
/** @internal @inheritdoc */
|
|
70
|
+
protected _renderContent(): unknown;
|
|
71
|
+
}
|
|
72
|
+
declare global {
|
|
73
|
+
interface HTMLElementTagNameMap {
|
|
74
|
+
"m3e-menu-item-radio": M3eMenuItemRadioElement;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=MenuItemRadioElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuItemRadioElement.d.ts","sourceRoot":"","sources":["../../src/MenuItemRadioElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAO3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,qBACa,uBAAwB,SAAQ,4BAAmD;;IAC9F,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAAqC;IAS3E,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IASlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IASrC,kBAAkB;cACC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAcxE,4BAA4B;cACT,cAAc,IAAI,OAAO;CAmD7C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,uBAAuB,CAAC;KAChD;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Specifies the possible positions for a menu, on the x-axis, relative to its trigger. */
|
|
2
|
+
export type MenuPositionX = "before" | "after";
|
|
3
|
+
/** Specifies the possible positions for a menu, on the x-axis, relative to its trigger. */
|
|
4
|
+
export type MenuPositionY = "above" | "below";
|
|
5
|
+
//# sourceMappingURL=MenuPosition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuPosition.d.ts","sourceRoot":"","sources":["../../src/MenuPosition.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C,2FAA2F;AAC3F,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement } from "lit";
|
|
2
|
+
import type { M3eMenuElement } from "./MenuElement";
|
|
3
|
+
declare const M3eMenuTriggerElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").HtmlForMixin> & typeof LitElement;
|
|
4
|
+
/**
|
|
5
|
+
* An element, nested within a clickable element, used to open a menu.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* The `m3e-menu-trigger` component is used to open a menu when nested within a clickable element
|
|
9
|
+
* such as a button or menu item. It anchors the menu to its invoker, enabling contextual flows and
|
|
10
|
+
* nested hierarchies.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* The following example illustrates a basic menu. The `m3e-menu-trigger` is used to trigger a `m3e-menu` specified
|
|
14
|
+
* by the `for` attribute when its parenting element is activated.
|
|
15
|
+
* ```html
|
|
16
|
+
* <m3e-button>
|
|
17
|
+
* <m3e-menu-trigger for="menu1">Basic menu</m3e-menu-trigger>
|
|
18
|
+
* </m3e-button>
|
|
19
|
+
* <m3e-menu id="menu1">
|
|
20
|
+
* <m3e-menu-item>Apple</m3e-menu-item>
|
|
21
|
+
* <m3e-menu-item>Apricot</m3e-menu-item>
|
|
22
|
+
* <m3e-menu-item>Avocado</m3e-menu-item>
|
|
23
|
+
* <m3e-menu-item>Green Apple</m3e-menu-item>
|
|
24
|
+
* <m3e-menu-item>Green Grapes</m3e-menu-item>
|
|
25
|
+
* <m3e-menu-item>Olive</m3e-menu-item>
|
|
26
|
+
* <m3e-menu-item>Orange</m3e-menu-item>
|
|
27
|
+
* </m3e-menu>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* The next example illustrates nested menus. Submenus are triggered by placing a `m3e-menu-trigger` inside a `m3e-menu-item`.
|
|
32
|
+
* ```html
|
|
33
|
+
* <m3e-button>
|
|
34
|
+
* <m3e-menu-trigger for="menu2">Nested menus</m3e-menu-trigger>
|
|
35
|
+
* </m3e-button>
|
|
36
|
+
* <m3e-menu id="menu2">
|
|
37
|
+
* <m3e-menu-item>
|
|
38
|
+
* <m3e-menu-trigger for="menu3">Fruits with A</m3e-menu-trigger>
|
|
39
|
+
* </m3e-menu-item>
|
|
40
|
+
* <m3e-menu-item>Grapes</m3e-menu-item>
|
|
41
|
+
* <m3e-menu-item>Olive</m3e-menu-item>
|
|
42
|
+
* <m3e-menu-item>Orange</m3e-menu-item>
|
|
43
|
+
* </m3e-menu>
|
|
44
|
+
* <m3e-menu id="menu3">
|
|
45
|
+
* <m3e-menu-item>Apricot</m3e-menu-item>
|
|
46
|
+
* <m3e-menu-item>Avocado</m3e-menu-item>
|
|
47
|
+
* <m3e-menu-item>
|
|
48
|
+
* <m3e-menu-trigger for="menu4">Apples</m3e-menu-trigger>
|
|
49
|
+
* </m3e-menu-item>
|
|
50
|
+
* </m3e-menu>
|
|
51
|
+
* <m3e-menu id="menu4">
|
|
52
|
+
* <m3e-menu-item>Fuji</m3e-menu-item>
|
|
53
|
+
* <m3e-menu-item>Granny Smith</m3e-menu-item>
|
|
54
|
+
* <m3e-menu-item>Red Delicious</m3e-menu-item>
|
|
55
|
+
* </m3e-menu>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @tag m3e-menu-trigger
|
|
59
|
+
*
|
|
60
|
+
* @slot - Renders the contents of the trigger.
|
|
61
|
+
*/
|
|
62
|
+
export declare class M3eMenuTriggerElement extends M3eMenuTriggerElement_base {
|
|
63
|
+
#private;
|
|
64
|
+
/** The styles of the element. */
|
|
65
|
+
static styles: CSSResultGroup;
|
|
66
|
+
/** The menu triggered by the element. */
|
|
67
|
+
get menu(): M3eMenuElement | null;
|
|
68
|
+
/** @inheritdoc */
|
|
69
|
+
connectedCallback(): void;
|
|
70
|
+
/** @inheritdoc */
|
|
71
|
+
disconnectedCallback(): void;
|
|
72
|
+
/** @inheritdoc */
|
|
73
|
+
attach(control: HTMLElement): void;
|
|
74
|
+
/** @inheritdoc */
|
|
75
|
+
detach(): void;
|
|
76
|
+
/** @inheritdoc */
|
|
77
|
+
protected render(): unknown;
|
|
78
|
+
}
|
|
79
|
+
declare global {
|
|
80
|
+
interface HTMLElementTagNameMap {
|
|
81
|
+
"m3e-menu-trigger": M3eMenuTriggerElement;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=MenuTriggerElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuTriggerElement.d.ts","sourceRoot":"","sources":["../../src/MenuTriggerElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAM5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,qBACa,qBAAsB,SAAQ,0BAAmB;;IAC5D,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAOpC;IAIF,yCAAyC;IACzC,IAAI,IAAI,IAAI,cAAc,GAAG,IAAI,CAEhC;IAED,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAKrC,kBAAkB;IACT,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAkB3C,kBAAkB;IACT,MAAM,IAAI,IAAI;IAcvB,kBAAkB;cACC,MAAM,IAAI,OAAO;CAcrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,qBAAqB,CAAC;KAC3C;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./MenuElement";
|
|
2
|
+
export * from "./MenuItemCheckboxElement";
|
|
3
|
+
export * from "./MenuItemElement";
|
|
4
|
+
export * from "./MenuItemGroupElement";
|
|
5
|
+
export * from "./MenuItemRadioElement";
|
|
6
|
+
export * from "./MenuPosition";
|
|
7
|
+
export * from "./MenuTriggerElement";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m3e/menu",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"description": "Menu 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.0.0-rc.
|
|
30
|
+
"@m3e/core": "1.0.0-rc.4",
|
|
31
31
|
"lit": "^3.3.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|