@api-client/ui 0.4.2 → 0.4.3
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/.vscode/settings.json +1 -0
- package/build/src/index.d.ts +3 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +4 -0
- package/build/src/index.js.map +1 -1
- package/build/src/lib/Dom.d.ts +5 -0
- package/build/src/lib/Dom.d.ts.map +1 -0
- package/build/src/lib/Dom.js +24 -0
- package/build/src/lib/Dom.js.map +1 -0
- package/build/src/md/button/internals/base.d.ts +27 -0
- package/build/src/md/button/internals/base.d.ts.map +1 -1
- package/build/src/md/button/internals/base.js +90 -1
- package/build/src/md/button/internals/base.js.map +1 -1
- package/build/src/md/icons/internals/Icon.js +2 -2
- package/build/src/md/icons/internals/Icon.js.map +1 -1
- package/build/src/md/list/internals/List.d.ts +1 -1
- package/build/src/md/list/internals/List.d.ts.map +1 -1
- package/build/src/md/list/internals/List.js +4 -4
- package/build/src/md/list/internals/List.js.map +1 -1
- package/build/src/md/list/internals/ListItem.d.ts +1 -0
- package/build/src/md/list/internals/ListItem.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.js +10 -10
- package/build/src/md/list/internals/ListItem.js.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.js +2 -20
- package/build/src/md/list/internals/ListItem.styles.js.map +1 -1
- package/build/src/md/menu/index.d.ts +4 -0
- package/build/src/md/menu/index.d.ts.map +1 -0
- package/build/src/md/menu/index.js +4 -0
- package/build/src/md/menu/index.js.map +1 -0
- package/build/src/md/menu/internal/Menu.d.ts +76 -0
- package/build/src/md/menu/internal/Menu.d.ts.map +1 -0
- package/build/src/md/menu/internal/Menu.js +235 -0
- package/build/src/md/menu/internal/Menu.js.map +1 -0
- package/build/src/md/menu/internal/Menu.styles.d.ts +3 -0
- package/build/src/md/menu/internal/Menu.styles.d.ts.map +1 -0
- package/build/src/md/menu/internal/Menu.styles.js +185 -0
- package/build/src/md/menu/internal/Menu.styles.js.map +1 -0
- package/build/src/md/menu/internal/MenuItem.d.ts +77 -0
- package/build/src/md/menu/internal/MenuItem.d.ts.map +1 -0
- package/build/src/md/menu/internal/MenuItem.js +216 -0
- package/build/src/md/menu/internal/MenuItem.js.map +1 -0
- package/build/src/md/menu/internal/MenuItem.styles.d.ts +3 -0
- package/build/src/md/menu/internal/MenuItem.styles.d.ts.map +1 -0
- package/build/src/md/menu/internal/MenuItem.styles.js +64 -0
- package/build/src/md/menu/internal/MenuItem.styles.js.map +1 -0
- package/build/src/md/menu/internal/SubMenu.d.ts +56 -0
- package/build/src/md/menu/internal/SubMenu.d.ts.map +1 -0
- package/build/src/md/menu/internal/SubMenu.js +171 -0
- package/build/src/md/menu/internal/SubMenu.js.map +1 -0
- package/build/src/md/menu/internal/SubMenu.styles.d.ts +3 -0
- package/build/src/md/menu/internal/SubMenu.styles.d.ts.map +1 -0
- package/build/src/md/menu/internal/SubMenu.styles.js +8 -0
- package/build/src/md/menu/internal/SubMenu.styles.js.map +1 -0
- package/build/src/md/menu/ui-menu-item.d.ts +20 -0
- package/build/src/md/menu/ui-menu-item.d.ts.map +1 -0
- package/build/src/md/menu/ui-menu-item.js +37 -0
- package/build/src/md/menu/ui-menu-item.js.map +1 -0
- package/build/src/md/menu/ui-menu.d.ts +22 -0
- package/build/src/md/menu/ui-menu.d.ts.map +1 -0
- package/build/src/md/menu/ui-menu.js +38 -0
- package/build/src/md/menu/ui-menu.js.map +1 -0
- package/build/src/md/menu/ui-sub-menu.d.ts +20 -0
- package/build/src/md/menu/ui-sub-menu.d.ts.map +1 -0
- package/build/src/md/menu/ui-sub-menu.js +37 -0
- package/build/src/md/menu/ui-sub-menu.js.map +1 -0
- package/build/src/mixins/FileDropMixin.d.ts.map +1 -1
- package/build/src/mixins/FileDropMixin.js +7 -8
- package/build/src/mixins/FileDropMixin.js.map +1 -1
- package/build/src/mixins/RenderableMixin.d.ts.map +1 -1
- package/build/src/mixins/RenderableMixin.js +2 -3
- package/build/src/mixins/RenderableMixin.js.map +1 -1
- package/demo/md/index.html +2 -0
- package/demo/md/menu/index.html +19 -0
- package/demo/md/menu/index.ts +154 -0
- package/package.json +2 -3
- package/src/index.ts +5 -0
- package/src/lib/Dom.ts +26 -0
- package/src/md/button/internals/base.ts +77 -0
- package/src/md/icons/internals/Icon.ts +2 -2
- package/src/md/list/internals/List.ts +4 -4
- package/src/md/list/internals/ListItem.styles.ts +2 -20
- package/src/md/list/internals/ListItem.ts +11 -11
- package/src/md/menu/README.md +253 -0
- package/src/md/menu/index.ts +3 -0
- package/src/md/menu/internal/Menu.styles.ts +185 -0
- package/src/md/menu/internal/Menu.ts +205 -0
- package/src/md/menu/internal/MenuItem.styles.ts +64 -0
- package/src/md/menu/internal/MenuItem.ts +217 -0
- package/src/md/menu/internal/SubMenu.styles.ts +8 -0
- package/src/md/menu/internal/SubMenu.ts +179 -0
- package/src/md/menu/ui-menu-item.ts +25 -0
- package/src/md/menu/ui-menu.ts +26 -0
- package/src/md/menu/ui-sub-menu.ts +25 -0
- package/src/mixins/FileDropMixin.ts +106 -107
- package/src/mixins/RenderableMixin.ts +107 -108
- package/test/md/menu/Menu.test.ts +509 -0
- package/test/md/menu/MenuIntegration.test.ts +426 -0
- package/test/md/menu/MenuItem.test.ts +361 -0
- package/test/md/menu/SubMenu.test.ts +411 -0
- /package/test/{ui → md}/button/UiButton.test.ts +0 -0
- /package/test/{ui → md}/button/UiIconButton.test.ts +0 -0
- /package/test/{ui → md}/chip/UiChip.test.ts +0 -0
- /package/test/{ui → md}/collapse/UiCollapse.test.ts +0 -0
- /package/test/{ui → md}/collapse/flex-layout.test.ts +0 -0
- /package/test/{ui → md}/date-time/DateTime.test.ts +0 -0
- /package/test/{ui → md}/dialog/UiDialog.test.ts +0 -0
- /package/test/{ui → md}/progress/UiProgressElement.test.ts +0 -0
- /package/test/{ui → md}/progress/UiRangeElement.test.ts +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import Menu from './Menu.js';
|
|
6
|
+
import { findElementInShadowRoots } from '../../../lib/Dom.js';
|
|
7
|
+
let UiSubMenu = (() => {
|
|
8
|
+
let _classSuper = Menu;
|
|
9
|
+
let _anchor_decorators;
|
|
10
|
+
let _anchor_initializers = [];
|
|
11
|
+
let _anchor_extraInitializers = [];
|
|
12
|
+
return class UiSubMenu extends _classSuper {
|
|
13
|
+
static {
|
|
14
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
15
|
+
_anchor_decorators = [property({ type: String })];
|
|
16
|
+
__esDecorate(this, null, _anchor_decorators, { kind: "accessor", name: "anchor", static: false, private: false, access: { has: obj => "anchor" in obj, get: obj => obj.anchor, set: (obj, value) => { obj.anchor = value; } }, metadata: _metadata }, _anchor_initializers, _anchor_extraInitializers);
|
|
17
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
18
|
+
}
|
|
19
|
+
#anchor_accessor_storage = __runInitializers(this, _anchor_initializers, void 0);
|
|
20
|
+
/**
|
|
21
|
+
* The ID of the anchor element (parent menu item)
|
|
22
|
+
* @attribute
|
|
23
|
+
*/
|
|
24
|
+
get anchor() { return this.#anchor_accessor_storage; }
|
|
25
|
+
set anchor(value) { this.#anchor_accessor_storage = value; }
|
|
26
|
+
/**
|
|
27
|
+
* Reference to the parent menu
|
|
28
|
+
*/
|
|
29
|
+
parentMenu = (__runInitializers(this, _anchor_extraInitializers), null);
|
|
30
|
+
/**
|
|
31
|
+
* Reference to the anchor element
|
|
32
|
+
*/
|
|
33
|
+
get anchorElement() {
|
|
34
|
+
if (!this.anchor)
|
|
35
|
+
return null;
|
|
36
|
+
return findElementInShadowRoots(this.anchor, this);
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
this.setAttribute('role', 'menu');
|
|
41
|
+
this.setAttribute('aria-label', 'Submenu');
|
|
42
|
+
}
|
|
43
|
+
updated(changedProperties) {
|
|
44
|
+
super.updated(changedProperties);
|
|
45
|
+
if (changedProperties.has('anchor')) {
|
|
46
|
+
this.updateAnchorPositioning();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Updates anchor positioning using CSS Anchor Positioning API
|
|
51
|
+
*/
|
|
52
|
+
updateAnchorPositioning() {
|
|
53
|
+
const anchor = this.anchorElement;
|
|
54
|
+
if (!anchor)
|
|
55
|
+
return;
|
|
56
|
+
const anchorName = `--anchor-${this.id}`;
|
|
57
|
+
// Set anchor name on the parent menu item
|
|
58
|
+
anchor.style.setProperty('anchor-name', anchorName);
|
|
59
|
+
// Set anchor positioning on the submenu
|
|
60
|
+
this.style.setProperty('position-anchor', anchorName);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Shows the submenu
|
|
64
|
+
*/
|
|
65
|
+
show() {
|
|
66
|
+
if (!this.anchorElement) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// Update positioning before showing
|
|
70
|
+
this.updateAnchorPositioning();
|
|
71
|
+
// Close any other open submenus in the parent menu
|
|
72
|
+
if (this.parentMenu) {
|
|
73
|
+
this.parentMenu.closeSubMenu();
|
|
74
|
+
this.parentMenu.setActiveSubMenu(this);
|
|
75
|
+
}
|
|
76
|
+
// Show the popover
|
|
77
|
+
this.showPopover();
|
|
78
|
+
this.open = true;
|
|
79
|
+
this.focus();
|
|
80
|
+
this.dispatchEvent(new CustomEvent('open', {
|
|
81
|
+
bubbles: true,
|
|
82
|
+
composed: true,
|
|
83
|
+
detail: { submenu: this },
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Hides the submenu
|
|
88
|
+
*/
|
|
89
|
+
hide() {
|
|
90
|
+
super.hide();
|
|
91
|
+
// Clear parent menu's active submenu reference
|
|
92
|
+
const parentMenu = this.parentMenu;
|
|
93
|
+
if (parentMenu) {
|
|
94
|
+
parentMenu.setActiveSubMenu(null);
|
|
95
|
+
}
|
|
96
|
+
const anchor = this.anchorElement;
|
|
97
|
+
if (anchor) {
|
|
98
|
+
anchor.closeSubMenu();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Sets the parent menu reference
|
|
103
|
+
*/
|
|
104
|
+
setParentMenu(menu) {
|
|
105
|
+
this.parentMenu = menu;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Handles selection events - bubbles them up to parent menu
|
|
109
|
+
*/
|
|
110
|
+
notifySelect(item) {
|
|
111
|
+
// First hide this submenu
|
|
112
|
+
this.hide();
|
|
113
|
+
// If we have a parent menu, hide it too and bubble the selection
|
|
114
|
+
if (this.parentMenu) {
|
|
115
|
+
this.parentMenu.hide();
|
|
116
|
+
}
|
|
117
|
+
// Call parent implementation to dispatch the select event
|
|
118
|
+
return super.notifySelect(item);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Handles keyboard navigation specific to submenus
|
|
122
|
+
*/
|
|
123
|
+
handleKeydown(e) {
|
|
124
|
+
if (!this.open || e.defaultPrevented)
|
|
125
|
+
return;
|
|
126
|
+
switch (e.key) {
|
|
127
|
+
case 'Escape':
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
this.hide();
|
|
130
|
+
// Return focus to parent menu item
|
|
131
|
+
if (this.anchorElement) {
|
|
132
|
+
this.anchorElement.focus();
|
|
133
|
+
}
|
|
134
|
+
break;
|
|
135
|
+
case 'ArrowLeft':
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
this.hide();
|
|
138
|
+
// Return focus to parent menu item
|
|
139
|
+
if (this.anchorElement) {
|
|
140
|
+
this.anchorElement.focus();
|
|
141
|
+
}
|
|
142
|
+
break;
|
|
143
|
+
default:
|
|
144
|
+
// Let the parent handle other keys
|
|
145
|
+
super.handleKeydown(e);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
const classes = classMap({
|
|
150
|
+
'submenu-container': true,
|
|
151
|
+
'submenu-open': this.open,
|
|
152
|
+
});
|
|
153
|
+
return html `
|
|
154
|
+
<div class=${classes}>
|
|
155
|
+
<slot></slot>
|
|
156
|
+
</div>
|
|
157
|
+
`;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
})();
|
|
161
|
+
/**
|
|
162
|
+
* Material Design 3 Sub-Menu component.
|
|
163
|
+
* Extends the main Menu component to provide sub-menu functionality.
|
|
164
|
+
* Uses Popover API and Anchor Positioning API for modern positioning.
|
|
165
|
+
*
|
|
166
|
+
* @slot - The sub-menu items
|
|
167
|
+
* @fires select - Dispatched when a sub-menu item is selected
|
|
168
|
+
* @fires close - Dispatched when the sub-menu is closed
|
|
169
|
+
*/
|
|
170
|
+
export default UiSubMenu;
|
|
171
|
+
//# sourceMappingURL=SubMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubMenu.js","sourceRoot":"","sources":["../../../../../src/md/menu/internal/SubMenu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;;sBAYvB,IAAI;;;;iBAAtB,SAAU,SAAQ,WAAI;;;kCAKxC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YAAC,uKAAS,MAAM,6BAAN,MAAM,uFAAoB;;;QA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AC,CAAgB;YACrC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,gBAAgB;gBAAE,OAAM;YAE5C,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;gBACd,KAAK,QAAQ;oBACX,CAAC,CAAC,cAAc,EAAE,CAAA;oBAClB,IAAI,CAAC,IAAI,EAAE,CAAA;oBACX,mCAAmC;oBACnC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;wBACvB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAA;oBAC5B,CAAC;oBACD,MAAK;gBACP,KAAK,WAAW;oBACd,CAAC,CAAC,cAAc,EAAE,CAAA;oBAClB,IAAI,CAAC,IAAI,EAAE,CAAA;oBACX,mCAAmC;oBACnC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;wBACvB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAA;oBAC5B,CAAC;oBACD,MAAK;gBACP;oBACE,mCAAmC;oBACnC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;YAC1B,CAAC;QACH,CAAC;QAEQ,MAAM;YACb,MAAM,OAAO,GAAG,QAAQ,CAAC;gBACvB,mBAAmB,EAAE,IAAI;gBACzB,cAAc,EAAE,IAAI,CAAC,IAAI;aAC1B,CAAC,CAAA;YAEF,OAAO,IAAI,CAAA;mBACI,OAAO;;;KAGrB,CAAA;QACH,CAAC;;;AAzKH;;;;;;;;GAQG;AACH,yBAiKC","sourcesContent":["import { html, PropertyValues, TemplateResult } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport Menu from './Menu.js'\nimport UiListItem from '../../list/internals/ListItem.js'\nimport { findElementInShadowRoots } from '../../../lib/Dom.js'\nimport type { MenuItem } from '../../../index.js'\n\n/**\n * Material Design 3 Sub-Menu component.\n * Extends the main Menu component to provide sub-menu functionality.\n * Uses Popover API and Anchor Positioning API for modern positioning.\n *\n * @slot - The sub-menu items\n * @fires select - Dispatched when a sub-menu item is selected\n * @fires close - Dispatched when the sub-menu is closed\n */\nexport default class UiSubMenu extends Menu {\n /**\n * The ID of the anchor element (parent menu item)\n * @attribute\n */\n @property({ type: String }) accessor anchor: string | undefined\n\n /**\n * Reference to the parent menu\n */\n parentMenu: Menu | null = null\n\n /**\n * Reference to the anchor element\n */\n get anchorElement(): MenuItem | null {\n if (!this.anchor) return null\n return findElementInShadowRoots(this.anchor, this) as MenuItem | null\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n this.setAttribute('role', 'menu')\n this.setAttribute('aria-label', 'Submenu')\n }\n\n protected override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties)\n\n if (changedProperties.has('anchor')) {\n this.updateAnchorPositioning()\n }\n }\n\n /**\n * Updates anchor positioning using CSS Anchor Positioning API\n */\n protected updateAnchorPositioning(): void {\n const anchor = this.anchorElement\n if (!anchor) return\n const anchorName = `--anchor-${this.id}`\n\n // Set anchor name on the parent menu item\n anchor.style.setProperty('anchor-name', anchorName)\n\n // Set anchor positioning on the submenu\n this.style.setProperty('position-anchor', anchorName)\n }\n\n /**\n * Shows the submenu\n */\n override show(): void {\n if (!this.anchorElement) {\n return\n }\n\n // Update positioning before showing\n this.updateAnchorPositioning()\n\n // Close any other open submenus in the parent menu\n if (this.parentMenu) {\n this.parentMenu.closeSubMenu()\n this.parentMenu.setActiveSubMenu(this)\n }\n\n // Show the popover\n this.showPopover()\n this.open = true\n this.focus()\n\n this.dispatchEvent(\n new CustomEvent('open', {\n bubbles: true,\n composed: true,\n detail: { submenu: this },\n })\n )\n }\n\n /**\n * Hides the submenu\n */\n override hide(): void {\n super.hide()\n\n // Clear parent menu's active submenu reference\n const parentMenu = this.parentMenu\n if (parentMenu) {\n parentMenu.setActiveSubMenu(null)\n }\n const anchor = this.anchorElement\n if (anchor) {\n anchor.closeSubMenu()\n }\n }\n\n /**\n * Sets the parent menu reference\n */\n setParentMenu(menu: Menu): void {\n this.parentMenu = menu\n }\n\n /**\n * Handles selection events - bubbles them up to parent menu\n */\n override notifySelect(item: UiListItem): boolean {\n // First hide this submenu\n this.hide()\n\n // If we have a parent menu, hide it too and bubble the selection\n if (this.parentMenu) {\n this.parentMenu.hide()\n }\n\n // Call parent implementation to dispatch the select event\n return super.notifySelect(item)\n }\n\n /**\n * Handles keyboard navigation specific to submenus\n */\n override handleKeydown(e: KeyboardEvent): void {\n if (!this.open || e.defaultPrevented) return\n\n switch (e.key) {\n case 'Escape':\n e.preventDefault()\n this.hide()\n // Return focus to parent menu item\n if (this.anchorElement) {\n this.anchorElement.focus()\n }\n break\n case 'ArrowLeft':\n e.preventDefault()\n this.hide()\n // Return focus to parent menu item\n if (this.anchorElement) {\n this.anchorElement.focus()\n }\n break\n default:\n // Let the parent handle other keys\n super.handleKeydown(e)\n }\n }\n\n override render(): TemplateResult {\n const classes = classMap({\n 'submenu-container': true,\n 'submenu-open': this.open,\n })\n\n return html`\n <div class=${classes}>\n <slot></slot>\n </div>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubMenu.styles.d.ts","sourceRoot":"","sources":["../../../../../src/md/menu/internal/SubMenu.styles.ts"],"names":[],"mappings":";AAEA,wBAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubMenu.styles.js","sourceRoot":"","sources":["../../../../../src/md/menu/internal/SubMenu.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;CAKjB,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport default css`\n :host {\n position-area: span-bottom right;\n position-try-fallbacks: flip-block flip-inline;\n }\n`\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CSSResultOrNative } from 'lit';
|
|
2
|
+
import Element from './internal/MenuItem.js';
|
|
3
|
+
/**
|
|
4
|
+
* Material Design 3 Menu Item component.
|
|
5
|
+
*
|
|
6
|
+
* @element ui-menu-item
|
|
7
|
+
* @attribute {Object} data - The menu item data object
|
|
8
|
+
* @attribute {boolean} disabled - Whether the menu item is disabled
|
|
9
|
+
* @fires select - Dispatched when the menu item is selected
|
|
10
|
+
* @fires submenu-open - Dispatched when a sub-menu is opened
|
|
11
|
+
*/
|
|
12
|
+
export declare class UiMenuItemElement extends Element {
|
|
13
|
+
static styles: CSSResultOrNative[];
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'ui-menu-item': UiMenuItemElement;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ui-menu-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-menu-item.d.ts","sourceRoot":"","sources":["../../../../src/md/menu/ui-menu-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAA;AAE5C,OAAO,OAAO,MAAM,wBAAwB,CAAA;AAI5C;;;;;;;;GAQG;AACH,qBACa,iBAAkB,SAAQ,OAAO;IAC5C,OAAgB,MAAM,EAAE,iBAAiB,EAAE,CAAuB;CACnE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,iBAAiB,CAAA;KAClC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import Element from './internal/MenuItem.js';
|
|
4
|
+
import styles from './internal/MenuItem.styles.js';
|
|
5
|
+
import listStyles from '../list/internals/ListItem.styles.js';
|
|
6
|
+
/**
|
|
7
|
+
* Material Design 3 Menu Item component.
|
|
8
|
+
*
|
|
9
|
+
* @element ui-menu-item
|
|
10
|
+
* @attribute {Object} data - The menu item data object
|
|
11
|
+
* @attribute {boolean} disabled - Whether the menu item is disabled
|
|
12
|
+
* @fires select - Dispatched when the menu item is selected
|
|
13
|
+
* @fires submenu-open - Dispatched when a sub-menu is opened
|
|
14
|
+
*/
|
|
15
|
+
let UiMenuItemElement = (() => {
|
|
16
|
+
let _classDecorators = [customElement('ui-menu-item')];
|
|
17
|
+
let _classDescriptor;
|
|
18
|
+
let _classExtraInitializers = [];
|
|
19
|
+
let _classThis;
|
|
20
|
+
let _classSuper = Element;
|
|
21
|
+
var UiMenuItemElement = class extends _classSuper {
|
|
22
|
+
static { _classThis = this; }
|
|
23
|
+
static {
|
|
24
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
25
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
26
|
+
UiMenuItemElement = _classThis = _classDescriptor.value;
|
|
27
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
28
|
+
}
|
|
29
|
+
static styles = [styles, listStyles];
|
|
30
|
+
static {
|
|
31
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return UiMenuItemElement = _classThis;
|
|
35
|
+
})();
|
|
36
|
+
export { UiMenuItemElement };
|
|
37
|
+
//# sourceMappingURL=ui-menu-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-menu-item.js","sourceRoot":"","sources":["../../../../src/md/menu/ui-menu-item.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,OAAO,MAAM,wBAAwB,CAAA;AAC5C,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,UAAU,MAAM,sCAAsC,CAAA;AAE7D;;;;;;;;GAQG;IAEU,iBAAiB;4BAD7B,aAAa,CAAC,cAAc,CAAC;;;;sBACS,OAAO;iCAAf,SAAQ,WAAO;;;;YAA9C,6KAEC;;;;QADC,MAAM,CAAU,MAAM,GAAwB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;;YADvD,uDAAiB;;;;;SAAjB,iBAAiB","sourcesContent":["import type { CSSResultOrNative } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport Element from './internal/MenuItem.js'\nimport styles from './internal/MenuItem.styles.js'\nimport listStyles from '../list/internals/ListItem.styles.js'\n\n/**\n * Material Design 3 Menu Item component.\n *\n * @element ui-menu-item\n * @attribute {Object} data - The menu item data object\n * @attribute {boolean} disabled - Whether the menu item is disabled\n * @fires select - Dispatched when the menu item is selected\n * @fires submenu-open - Dispatched when a sub-menu is opened\n */\n@customElement('ui-menu-item')\nexport class UiMenuItemElement extends Element {\n static override styles: CSSResultOrNative[] = [styles, listStyles]\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ui-menu-item': UiMenuItemElement\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CSSResultOrNative } from 'lit';
|
|
2
|
+
import Element from './internal/Menu.js';
|
|
3
|
+
/**
|
|
4
|
+
* Material Design 3 Menu component with sub-menu support.
|
|
5
|
+
*
|
|
6
|
+
* @element ui-menu
|
|
7
|
+
* @attribute {boolean} open - Whether the menu is currently open
|
|
8
|
+
* @attribute {boolean} anchored - Whether the menu should be positioned relative to an anchor element
|
|
9
|
+
* @attribute {boolean} disabled - Whether the menu is disabled
|
|
10
|
+
* @fires select - Dispatched when a menu item is selected
|
|
11
|
+
* @fires close - Dispatched when the menu is closed
|
|
12
|
+
* @fires open - Dispatched when the menu is opened
|
|
13
|
+
*/
|
|
14
|
+
export declare class UiMenuElement extends Element {
|
|
15
|
+
static styles: CSSResultOrNative[];
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
'ui-menu': UiMenuElement;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ui-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-menu.d.ts","sourceRoot":"","sources":["../../../../src/md/menu/ui-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAA;AAE5C,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAGxC;;;;;;;;;;GAUG;AACH,qBACa,aAAc,SAAQ,OAAO;IACxC,OAAgB,MAAM,EAAE,iBAAiB,EAAE,CAAW;CACvD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,aAAa,CAAA;KACzB;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import Element from './internal/Menu.js';
|
|
4
|
+
import styles from './internal/Menu.styles.js';
|
|
5
|
+
/**
|
|
6
|
+
* Material Design 3 Menu component with sub-menu support.
|
|
7
|
+
*
|
|
8
|
+
* @element ui-menu
|
|
9
|
+
* @attribute {boolean} open - Whether the menu is currently open
|
|
10
|
+
* @attribute {boolean} anchored - Whether the menu should be positioned relative to an anchor element
|
|
11
|
+
* @attribute {boolean} disabled - Whether the menu is disabled
|
|
12
|
+
* @fires select - Dispatched when a menu item is selected
|
|
13
|
+
* @fires close - Dispatched when the menu is closed
|
|
14
|
+
* @fires open - Dispatched when the menu is opened
|
|
15
|
+
*/
|
|
16
|
+
let UiMenuElement = (() => {
|
|
17
|
+
let _classDecorators = [customElement('ui-menu')];
|
|
18
|
+
let _classDescriptor;
|
|
19
|
+
let _classExtraInitializers = [];
|
|
20
|
+
let _classThis;
|
|
21
|
+
let _classSuper = Element;
|
|
22
|
+
var UiMenuElement = class extends _classSuper {
|
|
23
|
+
static { _classThis = this; }
|
|
24
|
+
static {
|
|
25
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
26
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
27
|
+
UiMenuElement = _classThis = _classDescriptor.value;
|
|
28
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
29
|
+
}
|
|
30
|
+
static styles = [styles];
|
|
31
|
+
static {
|
|
32
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return UiMenuElement = _classThis;
|
|
36
|
+
})();
|
|
37
|
+
export { UiMenuElement };
|
|
38
|
+
//# sourceMappingURL=ui-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-menu.js","sourceRoot":"","sources":["../../../../src/md/menu/ui-menu.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,OAAO,MAAM,oBAAoB,CAAA;AACxC,OAAO,MAAM,MAAM,2BAA2B,CAAA;AAE9C;;;;;;;;;;GAUG;IAEU,aAAa;4BADzB,aAAa,CAAC,SAAS,CAAC;;;;sBACU,OAAO;6BAAf,SAAQ,WAAO;;;;YAA1C,6KAEC;;;;QADC,MAAM,CAAU,MAAM,GAAwB,CAAC,MAAM,CAAC,CAAA;;YAD3C,uDAAa;;;;;SAAb,aAAa","sourcesContent":["import type { CSSResultOrNative } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport Element from './internal/Menu.js'\nimport styles from './internal/Menu.styles.js'\n\n/**\n * Material Design 3 Menu component with sub-menu support.\n *\n * @element ui-menu\n * @attribute {boolean} open - Whether the menu is currently open\n * @attribute {boolean} anchored - Whether the menu should be positioned relative to an anchor element\n * @attribute {boolean} disabled - Whether the menu is disabled\n * @fires select - Dispatched when a menu item is selected\n * @fires close - Dispatched when the menu is closed\n * @fires open - Dispatched when the menu is opened\n */\n@customElement('ui-menu')\nexport class UiMenuElement extends Element {\n static override styles: CSSResultOrNative[] = [styles]\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ui-menu': UiMenuElement\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CSSResultOrNative } from 'lit';
|
|
2
|
+
import Element from './internal/SubMenu.js';
|
|
3
|
+
/**
|
|
4
|
+
* Material Design 3 Sub-Menu component.
|
|
5
|
+
*
|
|
6
|
+
* @element ui-sub-menu
|
|
7
|
+
* @attribute {Object} parentItem - The parent menu item element
|
|
8
|
+
* @attribute {Array} menuItems - The sub-menu items data
|
|
9
|
+
* @fires select - Dispatched when a sub-menu item is selected
|
|
10
|
+
* @fires close - Dispatched when the sub-menu is closed
|
|
11
|
+
*/
|
|
12
|
+
export declare class UiSubMenuElement extends Element {
|
|
13
|
+
static styles: CSSResultOrNative[];
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'ui-sub-menu': UiSubMenuElement;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ui-sub-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-sub-menu.d.ts","sourceRoot":"","sources":["../../../../src/md/menu/ui-sub-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAA;AAE5C,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAI3C;;;;;;;;GAQG;AACH,qBACa,gBAAiB,SAAQ,OAAO;IAC3C,OAAgB,MAAM,EAAE,iBAAiB,EAAE,CAAuB;CACnE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,gBAAgB,CAAA;KAChC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import Element from './internal/SubMenu.js';
|
|
4
|
+
import menuStyles from './internal/SubMenu.styles.js';
|
|
5
|
+
import styles from './internal/Menu.styles.js';
|
|
6
|
+
/**
|
|
7
|
+
* Material Design 3 Sub-Menu component.
|
|
8
|
+
*
|
|
9
|
+
* @element ui-sub-menu
|
|
10
|
+
* @attribute {Object} parentItem - The parent menu item element
|
|
11
|
+
* @attribute {Array} menuItems - The sub-menu items data
|
|
12
|
+
* @fires select - Dispatched when a sub-menu item is selected
|
|
13
|
+
* @fires close - Dispatched when the sub-menu is closed
|
|
14
|
+
*/
|
|
15
|
+
let UiSubMenuElement = (() => {
|
|
16
|
+
let _classDecorators = [customElement('ui-sub-menu')];
|
|
17
|
+
let _classDescriptor;
|
|
18
|
+
let _classExtraInitializers = [];
|
|
19
|
+
let _classThis;
|
|
20
|
+
let _classSuper = Element;
|
|
21
|
+
var UiSubMenuElement = class extends _classSuper {
|
|
22
|
+
static { _classThis = this; }
|
|
23
|
+
static {
|
|
24
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
25
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
26
|
+
UiSubMenuElement = _classThis = _classDescriptor.value;
|
|
27
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
28
|
+
}
|
|
29
|
+
static styles = [styles, menuStyles];
|
|
30
|
+
static {
|
|
31
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return UiSubMenuElement = _classThis;
|
|
35
|
+
})();
|
|
36
|
+
export { UiSubMenuElement };
|
|
37
|
+
//# sourceMappingURL=ui-sub-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-sub-menu.js","sourceRoot":"","sources":["../../../../src/md/menu/ui-sub-menu.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,UAAU,MAAM,8BAA8B,CAAA;AACrD,OAAO,MAAM,MAAM,2BAA2B,CAAA;AAE9C;;;;;;;;GAQG;IAEU,gBAAgB;4BAD5B,aAAa,CAAC,aAAa,CAAC;;;;sBACS,OAAO;gCAAf,SAAQ,WAAO;;;;YAA7C,6KAEC;;;;QADC,MAAM,CAAU,MAAM,GAAwB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;;YADvD,uDAAgB;;;;;SAAhB,gBAAgB","sourcesContent":["import type { CSSResultOrNative } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport Element from './internal/SubMenu.js'\nimport menuStyles from './internal/SubMenu.styles.js'\nimport styles from './internal/Menu.styles.js'\n\n/**\n * Material Design 3 Sub-Menu component.\n *\n * @element ui-sub-menu\n * @attribute {Object} parentItem - The parent menu item element\n * @attribute {Array} menuItems - The sub-menu items data\n * @fires select - Dispatched when a sub-menu item is selected\n * @fires close - Dispatched when the sub-menu is closed\n */\n@customElement('ui-sub-menu')\nexport class UiSubMenuElement extends Element {\n static override styles: CSSResultOrNative[] = [styles, menuStyles]\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ui-sub-menu': UiSubMenuElement\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropMixin.d.ts","sourceRoot":"","sources":["../../../src/mixins/FileDropMixin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,UAAU,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"FileDropMixin.d.ts","sourceRoot":"","sources":["../../../src/mixins/FileDropMixin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,UAAU,EAAE,MAAM,KAAK,CAAA;AAEtD,OAAO,wBAAwB,CAAA;AAE/B,eAAO,MAAM,gBAAgB,eAA6B,CAAA;AAC1D,eAAO,MAAM,gBAAgB,eAA6B,CAAA;AAC1D,eAAO,MAAM,eAAe,eAA4B,CAAA;AACxD,eAAO,MAAM,WAAW,eAAwB,CAAA;AAEhD,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAExD,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACzC,gBAAgB,EAAE,OAAO,CAAA;IAEzB,UAAU,EAAE,WAAW,CAAA;IAEvB;;;;OAIG;IACH,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CACpD;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAC7D,YAAY,CAAC,KACZ,WAAW,CAAC,sBAAsB,CAAC,GAAG,CAwHxC,CAAA"}
|
|
@@ -3,7 +3,6 @@ import { __esDecorate, __runInitializers } from "tslib";
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
4
|
import { html } from 'lit';
|
|
5
5
|
import { property } from 'lit/decorators.js';
|
|
6
|
-
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
|
7
6
|
import '../md/icons/ui-icon.js';
|
|
8
7
|
export const dragEnterHandler = Symbol('dragEnterHandler');
|
|
9
8
|
export const dragLeaveHandler = Symbol('dragLeaveHandler');
|
|
@@ -23,7 +22,7 @@ export const dropHandler = Symbol('dropHandler');
|
|
|
23
22
|
*
|
|
24
23
|
* @mixin
|
|
25
24
|
*/
|
|
26
|
-
export const FileDropMixin =
|
|
25
|
+
export const FileDropMixin = (superClass) => {
|
|
27
26
|
let MyMixinClass = (() => {
|
|
28
27
|
let _classSuper = superClass;
|
|
29
28
|
let _dropTargetActive_decorators;
|
|
@@ -76,11 +75,11 @@ export const FileDropMixin = dedupeMixin((superClass) => {
|
|
|
76
75
|
*/
|
|
77
76
|
dropTargetTemplate() {
|
|
78
77
|
return html `
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
<div class="drop-info">
|
|
79
|
+
<ui-icon icon="fileDownload" class="drop-icon"></ui-icon>
|
|
80
|
+
<p class="drop-message">Drop the file here</p>
|
|
81
|
+
</div>
|
|
82
|
+
`;
|
|
84
83
|
}
|
|
85
84
|
[(_dropTargetActive_decorators = [property({ type: Boolean })], dragEnterHandler)](e) {
|
|
86
85
|
if (!e.dataTransfer) {
|
|
@@ -145,5 +144,5 @@ export const FileDropMixin = dedupeMixin((superClass) => {
|
|
|
145
144
|
};
|
|
146
145
|
})();
|
|
147
146
|
return MyMixinClass;
|
|
148
|
-
}
|
|
147
|
+
};
|
|
149
148
|
//# sourceMappingURL=FileDropMixin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropMixin.js","sourceRoot":"","sources":["../../../src/mixins/FileDropMixin.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,sDAAsD;AACtD,OAAO,EAAE,IAAI,EAA8B,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,wBAAwB,CAAA;AAE/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAC1D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,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R,CAAC;gBACD,CAAC,CAAC,cAAc,EAAE,CAAA;gBAClB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;gBAC5C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAA;YAC9B,CAAC;YAED,CAAC,WAAW,CAAC,CAAC,CAAY;gBACxB,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;oBACpB,OAAM;gBACR,CAAC;gBACD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBACjD,OAAM;gBACR,CAAC;gBACD,CAAC,CAAC,cAAc,EAAE,CAAA;gBAClB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;gBAC/C,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAA;gBAC7B,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;YAChD,CAAC;;;IAEH,OAAO,YAAuD,CAAA;AAChE,CAAC,CACF,CAAA","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { html, TemplateResult, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { dedupeMixin } from '@open-wc/dedupe-mixin'\nimport '../md/icons/ui-icon.js'\n\nexport const dragEnterHandler = Symbol('dragEnterHandler')\nexport const dragLeaveHandler = Symbol('dragLeaveHandler')\nexport const dragOverHandler = Symbol('dragOverHandler')\nexport const dropHandler = Symbol('dropHandler')\n\ntype Constructor<T = object> = new (...args: any[]) => T\n\nexport declare class FileDropMixinInterface {\n dropTargetActive: boolean\n\n dropTarget: HTMLElement\n\n /**\n * Processes dropped to the page files\n * @param files The list of dropped files\n * @abstract This is to be implemented by the platform bindings\n */\n processDroppedFiles(files: FileList): Promise<void>\n}\n\n/**\n * Adds methods to accept files via drag and drop.\n * The mixin register the dnd events on the body element. When an object is dragged over the window it adds\n * this `drop-target` class to the `body` element. Additionally it sets the `dropTargetActive` property.\n *\n * The mixin also assumes that when the `drop-target` is set then the `drop-info` overlay is rendered.\n * However, it does not change the logic if the element is not in the DOM.\n * Use the provided `dropTargetTemplate()` function to generate template for the drag info.\n *\n * The class implementing this mixin should override the `processDroppedFiles(files)` method\n * to process the incoming files.\n *\n * @mixin\n */\nexport const FileDropMixin = dedupeMixin(\n <T extends Constructor<LitElement>>(superClass: T): Constructor<FileDropMixinInterface> & T => {\n class MyMixinClass extends superClass {\n @property({ type: Boolean }) accessor dropTargetActive: boolean\n\n dropTarget: HTMLElement = document.body\n\n constructor(...args: any[]) {\n super(...args)\n this[dragEnterHandler] = this[dragEnterHandler].bind(this)\n this[dragLeaveHandler] = this[dragLeaveHandler].bind(this)\n this[dragOverHandler] = this[dragOverHandler].bind(this)\n this[dropHandler] = this[dropHandler].bind(this)\n\n this.dropTargetActive = false\n }\n\n override connectedCallback(): void {\n const { dropTarget } = this\n dropTarget.addEventListener('dragenter', this[dragEnterHandler])\n dropTarget.addEventListener('dragleave', this[dragLeaveHandler])\n dropTarget.addEventListener('dragover', this[dragOverHandler])\n dropTarget.addEventListener('drop', this[dropHandler])\n super.connectedCallback()\n }\n\n override disconnectedCallback(): void {\n const { dropTarget } = this\n dropTarget.removeEventListener('dragenter', this[dragEnterHandler])\n dropTarget.removeEventListener('dragleave', this[dragLeaveHandler])\n dropTarget.removeEventListener('dragover', this[dragOverHandler])\n dropTarget.removeEventListener('drop', this[dropHandler])\n super.disconnectedCallback()\n }\n\n /**\n * Processes dropped to the page files\n * @param files The list of dropped files\n * @abstract This is to be implemented by the platform bindings\n */\n async processDroppedFiles(files: FileList): Promise<void> {\n // ...\n }\n\n /**\n * @returns The template for the drop file message\n */\n dropTargetTemplate(): TemplateResult {\n return html`\n <div class=\"drop-info\">\n <ui-icon icon=\"fileDownload\" class=\"drop-icon\"></ui-icon>\n <p class=\"drop-message\">Drop the file here</p>\n </div>\n `\n }\n\n [dragEnterHandler](e: DragEvent): void {\n if (!e.dataTransfer) {\n return\n }\n if (![...e.dataTransfer.types].includes('Files')) {\n return\n }\n e.preventDefault()\n this.dropTarget.classList.add('drop-target')\n this.dropTargetActive = true\n e.dataTransfer.effectAllowed = 'copy'\n }\n\n [dragLeaveHandler](e: DragEvent): void {\n if (!e.dataTransfer) {\n return\n }\n if (![...e.dataTransfer.types].includes('Files')) {\n return\n }\n const node = e.target as HTMLElement\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return\n }\n if (node !== this.dropTarget && !node.classList.contains('drop-info')) {\n return\n }\n e.preventDefault()\n this.dropTarget.classList.remove('drop-target')\n this.dropTargetActive = false\n }\n\n [dragOverHandler](e: DragEvent): void {\n if (!e.dataTransfer) {\n return\n }\n if (![...e.dataTransfer.types].includes('Files')) {\n return\n }\n const node = e.target as HTMLElement\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return\n }\n if (node !== this.dropTarget && !node.classList.contains('drop-info')) {\n return\n }\n e.preventDefault()\n this.dropTarget.classList.add('drop-target')\n this.dropTargetActive = true\n }\n\n [dropHandler](e: DragEvent): void {\n if (!e.dataTransfer) {\n return\n }\n if (![...e.dataTransfer.types].includes('Files')) {\n return\n }\n e.preventDefault()\n this.dropTarget.classList.remove('drop-target')\n this.dropTargetActive = false\n this.processDroppedFiles(e.dataTransfer.files)\n }\n }\n return MyMixinClass as Constructor<FileDropMixinInterface> & T\n }\n)\n"]}
|
|
1
|
+
{"version":3,"file":"FileDropMixin.js","sourceRoot":"","sources":["../../../src/mixins/FileDropMixin.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,sDAAsD;AACtD,OAAO,EAAE,IAAI,EAA8B,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,wBAAwB,CAAA;AAE/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,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AC,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;oBACxC,OAAM;gBACR,CAAC;gBACD,IAAI,IAAI,KAAK,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;oBACtE,OAAM;gBACR,CAAC;gBACD,CAAC,CAAC,cAAc,EAAE,CAAA;gBAClB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;gBAC5C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAA;YAC9B,CAAC;YAED,CAAC,WAAW,CAAC,CAAC,CAAY;gBACxB,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;oBACpB,OAAM;gBACR,CAAC;gBACD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBACjD,OAAM;gBACR,CAAC;gBACD,CAAC,CAAC,cAAc,EAAE,CAAA;gBAClB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;gBAC/C,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAA;gBAC7B,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;YAChD,CAAC;;;IAEH,OAAO,YAAuD,CAAA;AAChE,CAAC,CAAA","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { html, TemplateResult, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport '../md/icons/ui-icon.js'\n\nexport const dragEnterHandler = Symbol('dragEnterHandler')\nexport const dragLeaveHandler = Symbol('dragLeaveHandler')\nexport const dragOverHandler = Symbol('dragOverHandler')\nexport const dropHandler = Symbol('dropHandler')\n\ntype Constructor<T = object> = new (...args: any[]) => T\n\nexport declare class FileDropMixinInterface {\n dropTargetActive: boolean\n\n dropTarget: HTMLElement\n\n /**\n * Processes dropped to the page files\n * @param files The list of dropped files\n * @abstract This is to be implemented by the platform bindings\n */\n processDroppedFiles(files: FileList): Promise<void>\n}\n\n/**\n * Adds methods to accept files via drag and drop.\n * The mixin register the dnd events on the body element. When an object is dragged over the window it adds\n * this `drop-target` class to the `body` element. Additionally it sets the `dropTargetActive` property.\n *\n * The mixin also assumes that when the `drop-target` is set then the `drop-info` overlay is rendered.\n * However, it does not change the logic if the element is not in the DOM.\n * Use the provided `dropTargetTemplate()` function to generate template for the drag info.\n *\n * The class implementing this mixin should override the `processDroppedFiles(files)` method\n * to process the incoming files.\n *\n * @mixin\n */\nexport const FileDropMixin = <T extends Constructor<LitElement>>(\n superClass: T\n): Constructor<FileDropMixinInterface> & T => {\n class MyMixinClass extends superClass {\n @property({ type: Boolean }) accessor dropTargetActive: boolean\n\n dropTarget: HTMLElement = document.body\n\n constructor(...args: any[]) {\n super(...args)\n this[dragEnterHandler] = this[dragEnterHandler].bind(this)\n this[dragLeaveHandler] = this[dragLeaveHandler].bind(this)\n this[dragOverHandler] = this[dragOverHandler].bind(this)\n this[dropHandler] = this[dropHandler].bind(this)\n\n this.dropTargetActive = false\n }\n\n override connectedCallback(): void {\n const { dropTarget } = this\n dropTarget.addEventListener('dragenter', this[dragEnterHandler])\n dropTarget.addEventListener('dragleave', this[dragLeaveHandler])\n dropTarget.addEventListener('dragover', this[dragOverHandler])\n dropTarget.addEventListener('drop', this[dropHandler])\n super.connectedCallback()\n }\n\n override disconnectedCallback(): void {\n const { dropTarget } = this\n dropTarget.removeEventListener('dragenter', this[dragEnterHandler])\n dropTarget.removeEventListener('dragleave', this[dragLeaveHandler])\n dropTarget.removeEventListener('dragover', this[dragOverHandler])\n dropTarget.removeEventListener('drop', this[dropHandler])\n super.disconnectedCallback()\n }\n\n /**\n * Processes dropped to the page files\n * @param files The list of dropped files\n * @abstract This is to be implemented by the platform bindings\n */\n async processDroppedFiles(files: FileList): Promise<void> {\n // ...\n }\n\n /**\n * @returns The template for the drop file message\n */\n dropTargetTemplate(): TemplateResult {\n return html`\n <div class=\"drop-info\">\n <ui-icon icon=\"fileDownload\" class=\"drop-icon\"></ui-icon>\n <p class=\"drop-message\">Drop the file here</p>\n </div>\n `\n }\n\n [dragEnterHandler](e: DragEvent): void {\n if (!e.dataTransfer) {\n return\n }\n if (![...e.dataTransfer.types].includes('Files')) {\n return\n }\n e.preventDefault()\n this.dropTarget.classList.add('drop-target')\n this.dropTargetActive = true\n e.dataTransfer.effectAllowed = 'copy'\n }\n\n [dragLeaveHandler](e: DragEvent): void {\n if (!e.dataTransfer) {\n return\n }\n if (![...e.dataTransfer.types].includes('Files')) {\n return\n }\n const node = e.target as HTMLElement\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return\n }\n if (node !== this.dropTarget && !node.classList.contains('drop-info')) {\n return\n }\n e.preventDefault()\n this.dropTarget.classList.remove('drop-target')\n this.dropTargetActive = false\n }\n\n [dragOverHandler](e: DragEvent): void {\n if (!e.dataTransfer) {\n return\n }\n if (![...e.dataTransfer.types].includes('Files')) {\n return\n }\n const node = e.target as HTMLElement\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return\n }\n if (node !== this.dropTarget && !node.classList.contains('drop-info')) {\n return\n }\n e.preventDefault()\n this.dropTarget.classList.add('drop-target')\n this.dropTargetActive = true\n }\n\n [dropHandler](e: DragEvent): void {\n if (!e.dataTransfer) {\n return\n }\n if (![...e.dataTransfer.types].includes('Files')) {\n return\n }\n e.preventDefault()\n this.dropTarget.classList.remove('drop-target')\n this.dropTargetActive = false\n this.processDroppedFiles(e.dataTransfer.files)\n }\n }\n return MyMixinClass as Constructor<FileDropMixinInterface> & T\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderableMixin.d.ts","sourceRoot":"","sources":["../../../src/mixins/RenderableMixin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RenderableMixin.d.ts","sourceRoot":"","sources":["../../../src/mixins/RenderableMixin.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,cAAc,EAAU,OAAO,EAAE,MAAM,KAAK,CAAA;AAG3D,eAAO,MAAM,cAAc,eAA2B,CAAA;AACtD,eAAO,MAAM,UAAU,eAAuB,CAAA;AAC9C,eAAO,MAAM,gBAAgB,eAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,eAA2B,CAAA;AACtD,eAAO,MAAM,uBAAuB,eAAoC,CAAA;AACxE,eAAO,MAAM,oBAAoB,eAAiC,CAAA;AAElE,KAAK,WAAW,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAExD,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAE/B;;OAEG;IACH,IAAI,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;IAEtC;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAAA;IAExB;;;OAGG;IACH,WAAW,IAAI,IAAI;IAEnB;;OAEG;IACH,OAAO,IAAI,IAAI;IAEf;;;OAGG;IACH,YAAY,IAAI,cAAc,GAAG,OAAO,OAAO;IAE/C;;;;;;OAMG;IACH,MAAM,IAAI,IAAI;CACf;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,CAAC,GAAG,CAAC,EACxD,YAAY,CAAC,KACZ,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAsH1C,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
|
4
3
|
import { html, render } from 'lit';
|
|
5
4
|
import reactive from '../decorators/reactive.js';
|
|
6
5
|
export const renderingValue = Symbol('renderingValue');
|
|
@@ -16,7 +15,7 @@ export const resolveUpdatePromise = Symbol('resolveUpdatePromise');
|
|
|
16
15
|
*
|
|
17
16
|
* @mixin
|
|
18
17
|
*/
|
|
19
|
-
export const RenderableMixin =
|
|
18
|
+
export const RenderableMixin = (superClass) => {
|
|
20
19
|
let RenderableMixinClass = (() => {
|
|
21
20
|
let _classSuper = superClass;
|
|
22
21
|
let _firstRendered_decorators;
|
|
@@ -133,5 +132,5 @@ export const RenderableMixin = dedupeMixin((superClass) => {
|
|
|
133
132
|
};
|
|
134
133
|
})();
|
|
135
134
|
return RenderableMixinClass;
|
|
136
|
-
}
|
|
135
|
+
};
|
|
137
136
|
//# sourceMappingURL=RenderableMixin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderableMixin.js","sourceRoot":"","sources":["../../../src/mixins/RenderableMixin.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"RenderableMixin.js","sourceRoot":"","sources":["../../../src/mixins/RenderableMixin.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAO,EAAE,IAAI,EAAkB,MAAM,EAAW,MAAM,KAAK,CAAA;AAC3D,OAAO,QAAQ,MAAM,2BAA2B,CAAA;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAA;AACxE,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,s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ACR,CAAC;gBACD,IAAI,CAAC,uBAAuB,CAAC,GAAG,KAAK,CAAA;gBACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,CAAA;gBACrC,IAAI,QAAQ,EAAE,CAAC;oBACb,QAAQ,EAAE,CAAA;gBACZ,CAAC;YACH,CAAC;;;IAEH,OAAO,oBAAiE,CAAA;AAC1E,CAAC,CAAA","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { html, TemplateResult, render, nothing } from 'lit'\nimport reactive from '../decorators/reactive.js'\n\nexport const renderingValue = Symbol('renderingValue')\nexport const renderPage = Symbol('renderPage')\nexport const setUpdatePromise = Symbol('setUpdatePromise')\nexport const updateResolver = Symbol('updateResolver')\nexport const hasPendingUpdatePromise = Symbol('hasPendingUpdatePromise')\nexport const resolveUpdatePromise = Symbol('resolveUpdatePromise')\n\ntype Constructor<T = object> = new (...args: any[]) => T\n\nexport declare class RenderableMixinInterface {\n /**\n * Determines whether the initial render had run and the `firstRender()`\n * function was called.\n *\n * @default false\n */\n accessor firstRendered: boolean\n\n /**\n * @type A promise resolved when the render finished.\n */\n get updateComplete(): Promise<boolean>\n\n /**\n * True when rendering debouncer is running.\n */\n get rendering(): boolean\n\n /**\n * Helper function to be overridden by child classes. It is called when the view\n * is rendered for the first time.\n */\n firstRender(): void\n\n /**\n * A function called when the template has been rendered\n */\n updated(): void\n\n /**\n * This to be used by the child classes to render page template.\n * @returns Application page template\n */\n pageTemplate(): TemplateResult | typeof nothing\n\n /**\n * The main render function. Sub classes should not override this method.\n * Override `[renderPage]()` instead.\n *\n * The function calls `[renderPage]()` in a micro task so it is safe to call this\n * multiple time in the same event loop.\n */\n render(): void\n}\n\n/**\n * Adds methods that helps with asynchronous template rendering.\n *\n * The application page content is rendered into the `#app` container.\n *\n * @mixin\n */\nexport const RenderableMixin = <T extends Constructor<any>>(\n superClass: T\n): Constructor<RenderableMixinInterface> & T => {\n class RenderableMixinClass extends superClass {\n /**\n * Determines whether the initial render had run and the `firstRender()`\n * function was called.\n *\n * @default false\n */\n @reactive() accessor firstRendered = false;\n\n [renderingValue] = false;\n\n [hasPendingUpdatePromise] = false;\n\n [updateResolver]?: (value?: any) => void\n\n #updateComplete?: Promise<boolean>\n\n /**\n * @type A promise resolved when the render finished.\n */\n get updateComplete(): Promise<boolean> | undefined {\n return this.#updateComplete\n }\n\n /**\n * True when rendering debouncer is running.\n */\n get rendering(): boolean {\n return this[renderingValue]\n }\n\n constructor(...args: any[]) {\n super(...args)\n this[setUpdatePromise]()\n }\n\n /**\n * Helper function to be overridden by child classes. It is called when the view\n * is rendered for the first time.\n */\n firstRender(): void {\n //\n }\n\n /**\n * A function called when the template has been rendered\n */\n updated(): void {\n //\n }\n\n /**\n * This to be used by the child classes to render page template.\n * @returns Application page template\n */\n pageTemplate(): TemplateResult | typeof nothing {\n return html``\n }\n\n /**\n * The main render function. Sub classes should not override this method.\n * Override `[renderPage]()` instead.\n *\n * The function calls `[renderPage]()` in a micro task so it is safe to call this\n * multiple time in the same event loop.\n */\n render(): void {\n if (this.rendering) {\n return\n }\n this[renderingValue] = true\n if (!this[hasPendingUpdatePromise]) {\n this[setUpdatePromise]()\n }\n requestAnimationFrame(() => {\n this[renderingValue] = false\n this[renderPage]()\n })\n }\n\n [renderPage](): void {\n const root = document.querySelector('#app') as HTMLElement\n if (!root) {\n // eslint-disable-next-line no-console\n console.warn(`The <div id=\"app\"></div> is not in the document.`)\n return\n }\n if (!this.firstRendered) {\n this.firstRendered = true\n // cleanup any pre-existing content.\n Array.from(root.childNodes).forEach((node) => node.parentNode?.removeChild(node))\n setTimeout(() => this.firstRender())\n }\n render(this.pageTemplate(), root, { host: this })\n this[resolveUpdatePromise]()\n this.updated()\n }\n\n [setUpdatePromise](): void {\n this.#updateComplete = new Promise((resolve) => {\n this[updateResolver] = resolve\n this[hasPendingUpdatePromise] = true\n })\n }\n\n [resolveUpdatePromise](): void {\n if (!this[hasPendingUpdatePromise]) {\n return\n }\n this[hasPendingUpdatePromise] = false\n const resolver = this[updateResolver]\n if (resolver) {\n resolver()\n }\n }\n }\n return RenderableMixinClass as Constructor<RenderableMixinInterface> & T\n}\n"]}
|
package/demo/md/index.html
CHANGED
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
<dd>A Material 3 dropdown-list.</dd>
|
|
42
42
|
<dt><a href="listbox/listbox.html">listbox</a></dt>
|
|
43
43
|
<dd>A Material 3 listbox.</dd>
|
|
44
|
+
<dt><a href="menu/index.html">menu</a></dt>
|
|
45
|
+
<dd>A Material 3 menu.</dd>
|
|
44
46
|
<dt><a href="inputs/switch.html">switch</a></dt>
|
|
45
47
|
<dd>A Material 3 switch.</dd>
|
|
46
48
|
|