@limetech/lime-elements 33.14.0-next.5 → 33.14.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-list_3.cjs.entry.js +36 -14
- package/dist/cjs/limel-menu.cjs.entry.js +49 -1
- package/dist/cjs/limel-tooltip.cjs.entry.js +6 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/list/list-renderer.js +33 -13
- package/dist/collection/components/list/list.css +16 -2
- package/dist/collection/components/list/list.js +2 -0
- package/dist/collection/components/menu/menu.js +56 -6
- package/dist/collection/components/tooltip/tooltip-content.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +10 -4
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-list_3.entry.js +36 -14
- package/dist/esm/limel-menu.entry.js +49 -1
- package/dist/esm/limel-tooltip.entry.js +6 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-63e4f918.entry.js +1 -0
- package/dist/lime-elements/p-b0b18dfc.entry.js +1 -0
- package/dist/lime-elements/p-e078c459.entry.js +177 -0
- package/dist/types/components/list/list-renderer.d.ts +8 -6
- package/dist/types/components/menu/menu.d.ts +11 -3
- package/dist/types/components/menu/menu.types.d.ts +7 -0
- package/dist/types/components/tooltip/tooltip.d.ts +2 -0
- package/dist/types/components.d.ts +3 -3
- package/package.json +1 -1
- package/dist/lime-elements/p-1f3b6139.entry.js +0 -1
- package/dist/lime-elements/p-4e6042f7.entry.js +0 -1
- package/dist/lime-elements/p-8e8219ac.entry.js +0 -177
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ListItem, ListSeparator } from '@limetech/lime-elements';
|
|
1
|
+
import { ListItem, ListSeparator, MenuItem } from '@limetech/lime-elements';
|
|
2
2
|
import { ListRendererConfig } from './list-renderer-config';
|
|
3
3
|
export declare class ListRenderer {
|
|
4
4
|
private defaultConfig;
|
|
@@ -6,23 +6,24 @@ export declare class ListRenderer {
|
|
|
6
6
|
private hasIcons;
|
|
7
7
|
private twoLines;
|
|
8
8
|
private avatarList;
|
|
9
|
+
private commandKey;
|
|
9
10
|
private applyTabIndexToItemAtIndex;
|
|
10
11
|
constructor();
|
|
11
|
-
render(items: Array<ListItem | ListSeparator>, config?: ListRendererConfig): any;
|
|
12
|
+
render(items: Array<ListItem | ListSeparator | MenuItem>, config?: ListRendererConfig): any;
|
|
12
13
|
/**
|
|
13
14
|
* Determine which ListItem should have the `tab-index` attribute set,
|
|
14
15
|
* and return the index at which that ListItem is located in `items`.
|
|
15
16
|
* Returns `undefined` if no item should have the attribute set.
|
|
16
17
|
* See https://github.com/material-components/material-components-web/tree/e66a43a75fef4f9179e24856649518e15e279a04/packages/mdc-list#accessibility
|
|
17
18
|
*
|
|
18
|
-
* @param {Array<ListItem | ListSeparator>} items the items of the list, including any `ListSeparator`:s
|
|
19
|
+
* @param {Array<ListItem | ListSeparator | MenuItems>} items the items of the list, including any `ListSeparator`:s
|
|
19
20
|
* @returns {number} the index as per the description
|
|
20
21
|
*/
|
|
21
22
|
private getIndexForWhichToApplyTabIndex;
|
|
22
23
|
/**
|
|
23
24
|
* Render a single list item
|
|
24
25
|
*
|
|
25
|
-
* @param {ListItem | ListSeparator} item the item to render
|
|
26
|
+
* @param {ListItem | ListSeparator | MenuItems} item the item to render
|
|
26
27
|
* @param {number} index the index the item had in the `items` array
|
|
27
28
|
* @returns {HTMLElement} the list item
|
|
28
29
|
*/
|
|
@@ -30,11 +31,12 @@ export declare class ListRenderer {
|
|
|
30
31
|
/**
|
|
31
32
|
* Render the text of the list item
|
|
32
33
|
*
|
|
33
|
-
* @param {
|
|
34
|
-
* @param {string} secondaryText secondary text for the list item
|
|
34
|
+
* @param {ListItem | MenuItem} item the list item
|
|
35
35
|
* @returns {HTMLElement | string} the text for the list item
|
|
36
36
|
*/
|
|
37
37
|
private renderText;
|
|
38
|
+
private renderCommandText;
|
|
39
|
+
private isSimpleItem;
|
|
38
40
|
/**
|
|
39
41
|
* Render an icon for a list item
|
|
40
42
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OpenDirection } from './menu.types';
|
|
1
|
+
import { ListSeparator } from '@limetech/lime-elements';
|
|
2
|
+
import { MenuItem, OpenDirection } from './menu.types';
|
|
3
3
|
/**
|
|
4
4
|
* @slot trigger - Element to use as a trigger for the menu.
|
|
5
5
|
* @exampleComponent limel-example-menu-basic
|
|
@@ -9,6 +9,7 @@ import { OpenDirection } from './menu.types';
|
|
|
9
9
|
* @exampleComponent limel-example-menu-badge-icons
|
|
10
10
|
* @exampleComponent limel-example-menu-grid
|
|
11
11
|
* @exampleComponent limel-example-menu-composite
|
|
12
|
+
* @exampleComponent limel-example-menu-hotkeys
|
|
12
13
|
*/
|
|
13
14
|
export declare class Menu {
|
|
14
15
|
/**
|
|
@@ -21,7 +22,7 @@ export declare class Menu {
|
|
|
21
22
|
/**
|
|
22
23
|
* A list of items and separators to show in the menu.
|
|
23
24
|
*/
|
|
24
|
-
items: Array<
|
|
25
|
+
items: Array<MenuItem | ListSeparator>;
|
|
25
26
|
/**
|
|
26
27
|
* Sets the disabled state of the menu.
|
|
27
28
|
*/
|
|
@@ -59,14 +60,21 @@ export declare class Menu {
|
|
|
59
60
|
*/
|
|
60
61
|
private select;
|
|
61
62
|
private host;
|
|
63
|
+
private list;
|
|
62
64
|
private portalId;
|
|
63
65
|
constructor();
|
|
64
66
|
componentDidLoad(): void;
|
|
67
|
+
protected openWatcher(): void;
|
|
65
68
|
render(): any;
|
|
69
|
+
componentDidRender(): void;
|
|
66
70
|
private renderTrigger;
|
|
71
|
+
private setTriggerAttributes;
|
|
67
72
|
private onClose;
|
|
68
73
|
private onTriggerClick;
|
|
69
74
|
private onListChange;
|
|
70
75
|
private getPortalPosition;
|
|
71
76
|
private getCssProperties;
|
|
77
|
+
private setListElement;
|
|
78
|
+
private focusMenuItem;
|
|
79
|
+
private isListItem;
|
|
72
80
|
}
|
|
@@ -1 +1,8 @@
|
|
|
1
|
+
import { ListItem } from '../list/list-item.types';
|
|
1
2
|
export declare type OpenDirection = 'left' | 'right';
|
|
3
|
+
export interface MenuItem extends ListItem {
|
|
4
|
+
/**
|
|
5
|
+
* The additional supporting text is used for shortcut commands and displayed in the list item.
|
|
6
|
+
*/
|
|
7
|
+
commandText?: string;
|
|
8
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
14
|
* @exampleComponent limel-example-tooltip
|
|
15
|
+
* @private
|
|
15
16
|
*/
|
|
16
17
|
export declare class Tooltip {
|
|
17
18
|
/**
|
|
@@ -34,6 +35,7 @@ export declare class Tooltip {
|
|
|
34
35
|
private host;
|
|
35
36
|
private portalId;
|
|
36
37
|
private tooltipId;
|
|
38
|
+
private showTooltipTimeoutHandle;
|
|
37
39
|
constructor();
|
|
38
40
|
connectedCallback(): void;
|
|
39
41
|
disconnectedCallback(): void;
|
|
@@ -13,7 +13,7 @@ import { Action } from "./components/collapsible-section/action";
|
|
|
13
13
|
import { ValidationStatus } from "./components/form/form.types";
|
|
14
14
|
import { IconSize } from "./components/icon/icon.types";
|
|
15
15
|
import { InputType } from "./components/input-field/input-field.types";
|
|
16
|
-
import { OpenDirection } from "./components/menu/menu.types";
|
|
16
|
+
import { MenuItem, OpenDirection } from "./components/menu/menu.types";
|
|
17
17
|
import { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
|
|
18
18
|
import { FlowItem } from "./components/progress-flow/progress-flow.types";
|
|
19
19
|
import { Tab } from "./components/tab-bar/tab.types";
|
|
@@ -573,7 +573,7 @@ export namespace Components {
|
|
|
573
573
|
/**
|
|
574
574
|
* A list of items and separators to show in the menu.
|
|
575
575
|
*/
|
|
576
|
-
"items": Array<
|
|
576
|
+
"items": Array<MenuItem | ListSeparator>;
|
|
577
577
|
/**
|
|
578
578
|
* Is displayed on the default trigger button.
|
|
579
579
|
* @deprecated Use with default trigger has been deprecated. Please supply your own trigger element.
|
|
@@ -1862,7 +1862,7 @@ declare namespace LocalJSX {
|
|
|
1862
1862
|
/**
|
|
1863
1863
|
* A list of items and separators to show in the menu.
|
|
1864
1864
|
*/
|
|
1865
|
-
"items"?: Array<
|
|
1865
|
+
"items"?: Array<MenuItem | ListSeparator>;
|
|
1866
1866
|
/**
|
|
1867
1867
|
* Is displayed on the default trigger button.
|
|
1868
1868
|
* @deprecated Use with default trigger has been deprecated. Please supply your own trigger element.
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-fabb836f.js";import{c as r}from"./p-6c094f3f.js";import{z as o}from"./p-7c4d91f5.js";import"./p-acfbf7ac.js";import"./p-8bbe3720.js";import"./p-fc610f15.js";const n=class{constructor(s){t(this,s),this.cancel=i(this,"cancel",7),this.select=i(this,"select",7),this.label="",this.items=[],this.disabled=!1,this.openDirection="right",this.open=!1,this.badgeIcons=!1,this.gridLayout=!1,this.fixed=!1,this.onClose=()=>{this.cancel.emit(),this.open=!1},this.onTriggerClick=t=>{t.stopPropagation(),this.disabled||(this.open=!this.open)},this.onListChange=t=>{this.items=this.items.map((i=>i===t.detail?t.detail:i)),this.select.emit(t.detail),this.open=!1},this.portalId=r()}componentDidLoad(){this.host.querySelector('[slot="trigger"]')||console.warn("Using limel-menu with the default trigger is deprecated. Please provide your own trigger element.")}render(){const t=this.getCssProperties(),i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index"),e={"limel-portal--fixed":this.fixed},r=this.getPortalPosition();return s("div",{class:"mdc-menu-surface--anchor",onClick:this.onTriggerClick},s("slot",{name:"trigger"},this.renderTrigger()),s("limel-portal",{class:e,style:r,visible:this.open,containerId:this.portalId,openDirection:this.openDirection,position:this.fixed?"fixed":"absolute",containerStyle:{"z-index":i}},s("limel-menu-surface",{open:this.open,onDismiss:this.onClose,style:t},s("limel-list",{class:{"has-grid-layout has-interactive-items":this.gridLayout},items:this.items,type:"menu",badgeIcons:this.badgeIcons,onChange:this.onListChange}))))}renderTrigger(){return s("button",{class:`\n menu__trigger\n ${this.disabled?"":"menu__trigger-enabled"}\n `,disabled:this.disabled},s("span",null,this.label))}getPortalPosition(){if(!this.fixed)return{};const t=this.host.getBoundingClientRect(),i={top:`${t.y+t.height}px`,left:`${t.x}px`};return"left"===this.openDirection&&(i.left=`${t.x+t.width}px`),i}getCssProperties(){const t=["--menu-surface-width","--list-grid-item-max-width","--list-grid-item-min-width","--list-grid-gap"],i=getComputedStyle(this.host),s=t.map((t=>i.getPropertyValue(t)));return o(t,s)}get host(){return e(this)}};n.style=":host{display:inline-block}:host([hidden]){display:none}.menu__trigger{border-color:transparent;border-width:1px;border-style:solid;background:none;color:rgb(var(--contrast-800));height:2.25rem}.menu__trigger-enabled:hover{border-color:rgb(var(--contrast-800));color:rgb(var(--contrast-1100))}.mdc-menu-surface--anchor{position:relative}";export{n as limel_menu}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,g as e}from"./p-fabb836f.js";import{c as s}from"./p-6c094f3f.js";const o=class{constructor(i){t(this,i),this.showTooltip=()=>{this.open=!0},this.hideTooltip=()=>{this.open=!1},this.portalId=s(),this.tooltipId=s()}connectedCallback(){this.setOwnerAriaLabel(),this.addListeners()}disconnectedCallback(){this.removeListeners()}render(){const t=getComputedStyle(this.host).getPropertyValue("--tooltip-z-index");return i("div",{class:"trigger-anchor"},i("limel-portal",{visible:this.open,containerId:this.portalId,containerStyle:{"z-index":t}},i("limel-tooltip-content",{label:this.label,helperLabel:this.helperLabel,role:"tooltip","aria-hidden":!this.open,id:this.tooltipId})))}setOwnerAriaLabel(){const t=this.getOwnerElement();null==t||t.setAttribute("aria-describedby",this.tooltipId)}addListeners(){const t=this.getOwnerElement();null==t||t.addEventListener("mouseover",this.showTooltip),null==t||t.addEventListener("mouseout",this.hideTooltip),null==t||t.addEventListener("click",this.hideTooltip)}removeListeners(){const t=this.getOwnerElement();null==t||t.removeEventListener("mouseover",this.showTooltip),null==t||t.removeEventListener("mouseout",this.hideTooltip),null==t||t.removeEventListener("click",this.hideTooltip)}getOwnerElement(){var t;let i=this.host;do{i=i.parentNode}while(i&&i.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&i.nodeType!==Node.DOCUMENT_NODE);return null===(t=i)||void 0===t?void 0:t.getElementById(this.elementId)}get host(){return e(this)}};o.style=".trigger-anchor{display:inline-block;position:relative}.tooltip-container{color:#f1f1f1;background-color:#232324}";export{o as limel_tooltip}
|