@covalent/components 8.5.1 → 8.5.2
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/nav-list-item.js +3 -3
- package/nav-list-item.mjs +8 -8
- package/package.json +1 -1
- package/style.css +1 -1
- package/theme/dark-theme.css +1 -1
- package/theme/dark-theme.css.map +1 -1
- package/theme/light-theme.css +1 -1
- package/theme/light-theme.css.map +1 -1
- package/tooltip.js +2 -2
- package/tooltip.mjs +69 -69
package/nav-list-item.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./query-assigned-elements-f623705d.js"),c=require("./property-57f6f6fe.js"),h=require("./list-item.js"),d=require("./list-item-de5f96d8.js");require("./mwc-list-item-base-297d86b0.js");require("./tslib.es6-98719205.js");require("./ripple-handlers-5d5b21db.js");require("./base-element-58a3f9ea.js");require("./utils-a8190a39.js");require("./state-0974a8e5.js");require("./query-680f1868.js");require("./class-map-b5efe8da.js");require("./style-map-88d2563f.js");require("./observer-a096ab43.js");const p=`:host{font-family:var(--mdc-typography-font-family);font-size:var(--mdc-typography-body2-font-size);font-weight:600;line-height:var(--mdc-typography-body2-line-height);text-align:left;border-radius:var(--cv-list-item-border-radius, 100px);transition:border-radius .1s ease-out;width:var(--cv-list-item-width, 100%);--mdc-list-item-graphic-margin: 8px}::slotted(.section-selector){display:none;position:absolute;top:0;right:0}:host([activated]) ::slotted(cv-icon[slot=graphic]){color:var(--mdc-theme-primary)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic{margin-left:var(--cv-list-item-graphic-margin-left, 12px)}:host([graphic=avatar]){padding:0}:host([graphic=avatar]) ::slotted(cv-icon[slot=graphic]){margin-left:8px;background:transparent}:host([graphic=avatar]:not([twoline])){height:48px}:host(.beta-list-item){--mdc-theme-primary: var(--mdc-theme-surface-caution);--mdc-list-item-meta-size: 20px;--mdc-list-item-graphic-size: 40px;--mdc-list-item-graphic-margin: 0;--mdc-typography-subtitle1-font-size: var( --mdc-typography-subtitle2-font-size );--mdc-typography-body2-font-size: var(--mdc-typography-caption-font-size);margin-bottom:8px;margin-right:0;border-radius:0;height:48px;font-size:0;padding:0 0 0 15px}:host([hasChildren]){flex-direction:column;overflow:visible;height:inherit!important;background:none;padding:0;--mdc-list-side-padding: 0;--cv-list-item-graphic-margin-left: 0}:host([hasChildren][open]:hover:not([activated])) .expansion-header{--mdc-ripple-color: transparent}:host([hasChildren][open]:hover:not([activated])) .expansion-header:hover{--mdc-ripple-color: var(--mdc-theme-primary)}.expansion-header{position:relative;height:48px;width:100%;overflow:visible;display:flex;flex-shrink:0;align-items:center}.expansion-header mwc-ripple{border-radius:var(--cv-list-item-border-radius);overflow:hidden}.expansion-header-inner{padding:0 16px}.expansion-icon{margin-right:var(--cv-list-item-expansion-icon-margin, 0);font-size:var(--cv-list-item-expansion-icon-size, --mdc-icon-size);color:var(--cv-list-item-text-icon-on-background, var(--mdc-theme-text-icon-on-background))}.expansion-panel{display:block;width:100%;height:var(--cv-list-menu-height, 0);--mdc-list-side-padding: 72px;transition:transform .15s ease-out;overflow:hidden}:host([open][hasChildren]:not([twoline])){height:inherit;display:flex;flex-direction:column;border-radius:0}:host([open][hasChildren]:not([twoline])) .expansion-panel{transition:min-height .25s ease-in;height:var(--cv-list-menu-height, inherit)}
|
2
|
-
`;var m=Object.defineProperty,
|
2
|
+
`;var m=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=(n,e,t,i)=>{for(var r=i>1?void 0:i?u(e,t):e,o=n.length-1,l;o>=0;o--)(l=n[o])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&m(e,t,r),r};exports.CovalentNavRailListItem=class extends h.CovalentListItem{constructor(){super(...arguments),this.open=!1,this.hasChildren=!1,this.activated=!1,this.lastKeySelected=0}_toggleOpen(){this.open=!this.open}_handleKeydown(e){const t=this.expansionPanelElements[0],i=t?t==null?void 0:t.getFocusedItemIndex():0,r=(t==null?void 0:t.items.length)??0;if(this.hasChildren){if(e.code==="Enter"){e.preventDefault(),e.stopImmediatePropagation(),e.target.hasChildren?this._toggleOpen():this._deselectHeader(e);return}if(this.open){if(e.code==="ArrowUp"&&i===0&&this.lastKeySelected===0&&!e.target.hasChildren){e.preventDefault(),e.stopImmediatePropagation(),t.items[0].blur(),this.focus();return}e.code==="ArrowDown"&&i===-1&&(e.preventDefault(),e.stopImmediatePropagation(),t.focusItemAtIndex(0),this.lastKeySelected=0),e.code==="ArrowUp"&&i!==-1&&(e.preventDefault(),e.stopImmediatePropagation(),t.focusItemAtIndex(i),this.lastKeySelected=i),(e.code==="ArrowDown"||e.code==="ArrowUp")&&i!==-1&&this.lastKeySelected<r-1&&(e.preventDefault(),e.stopImmediatePropagation(),t.focusItemAtIndex(i),this.lastKeySelected=i)}}}_handleRequestSelected(e){const t=e;this.hasChildren&&t.detail.selected===!1&&t.detail.source==="property"&&this._deselectChildren()}_deselectChildren(){this.expansionPanelElements.forEach(e=>{e.items.forEach(t=>t.selected=!1)})}_deselectHeader(e){e.preventDefault(),e.stopImmediatePropagation(),this.fireRequestSelected(!1,"interaction"),this.activated=!1}renderExpansionItem(){const e=this.renderText(),t=this.graphic?this.renderGraphic():a.A,i=this.renderMeta();return a.x`
|
3
3
|
<div
|
4
4
|
@mousedown=${this._toggleOpen}
|
5
5
|
@touchstart="${this._toggleOpen}"
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="expansion-panel" @click=${this._deselectHeader}>
|
12
12
|
<slot name="expansion-panel"></slot>
|
13
13
|
</div>
|
14
|
-
`}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeydown),this.addEventListener("request-selected",this._handleRequestSelected)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown),this.addEventListener("request-selected",this._handleRequestSelected)}renderMeta(){const e=this.open?"
|
14
|
+
`}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeydown),this.addEventListener("request-selected",this._handleRequestSelected)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown),this.addEventListener("request-selected",this._handleRequestSelected)}renderMeta(){const e=this.open?"arrow_drop_up":"arrow_drop_down",t=a.x`<cv-icon slot="meta" class="expansion-icon"
|
15
15
|
>${e}</cv-icon
|
16
16
|
>`;return a.x` <span class="mdc-deprecated-list-item__meta material-icons">
|
17
17
|
${t}
|
@@ -24,4 +24,4 @@
|
|
24
24
|
${a.r(d.covalentStyles)}
|
25
25
|
`,a.i`
|
26
26
|
${a.r(p)}
|
27
|
-
`];s([a.l({slot:"expansion-panel",flatten:!0})],exports.CovalentNavRailListItem.prototype,"expansionPanelElements",2);s([c.n({type:Boolean,reflect:!0})],exports.CovalentNavRailListItem.prototype,"open",2);s([c.n({type:Boolean,reflect:!0})],exports.CovalentNavRailListItem.prototype,"hasChildren",2);exports.CovalentNavRailListItem=s([a.e("cv-nav-list-item")],exports.CovalentNavRailListItem);const
|
27
|
+
`];s([a.l({slot:"expansion-panel",flatten:!0})],exports.CovalentNavRailListItem.prototype,"expansionPanelElements",2);s([c.n({type:Boolean,reflect:!0})],exports.CovalentNavRailListItem.prototype,"open",2);s([c.n({type:Boolean,reflect:!0})],exports.CovalentNavRailListItem.prototype,"hasChildren",2);exports.CovalentNavRailListItem=s([a.e("cv-nav-list-item")],exports.CovalentNavRailListItem);const g=exports.CovalentNavRailListItem;exports.default=g;
|
package/nav-list-item.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { i as o, r as n, l as m, A as g, x as c, e as f } from "./query-assigned-elements-4a39219d.mjs";
|
2
2
|
import { n as h } from "./property-9b6ea53b.mjs";
|
3
|
-
import { CovalentListItem as
|
4
|
-
import { s as
|
3
|
+
import { CovalentListItem as u } from "./list-item.mjs";
|
4
|
+
import { s as v, a as x, c as y } from "./list-item-098c7f47.mjs";
|
5
5
|
import "./mwc-list-item-base-bf1a075b.mjs";
|
6
6
|
import "./tslib.es6-226581a4.mjs";
|
7
7
|
import "./ripple-handlers-38a43e50.mjs";
|
@@ -14,12 +14,12 @@ import "./style-map-bc3ed3e0.mjs";
|
|
14
14
|
import "./observer-be7b92e2.mjs";
|
15
15
|
const w = `:host{font-family:var(--mdc-typography-font-family);font-size:var(--mdc-typography-body2-font-size);font-weight:600;line-height:var(--mdc-typography-body2-line-height);text-align:left;border-radius:var(--cv-list-item-border-radius, 100px);transition:border-radius .1s ease-out;width:var(--cv-list-item-width, 100%);--mdc-list-item-graphic-margin: 8px}::slotted(.section-selector){display:none;position:absolute;top:0;right:0}:host([activated]) ::slotted(cv-icon[slot=graphic]){color:var(--mdc-theme-primary)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic{margin-left:var(--cv-list-item-graphic-margin-left, 12px)}:host([graphic=avatar]){padding:0}:host([graphic=avatar]) ::slotted(cv-icon[slot=graphic]){margin-left:8px;background:transparent}:host([graphic=avatar]:not([twoline])){height:48px}:host(.beta-list-item){--mdc-theme-primary: var(--mdc-theme-surface-caution);--mdc-list-item-meta-size: 20px;--mdc-list-item-graphic-size: 40px;--mdc-list-item-graphic-margin: 0;--mdc-typography-subtitle1-font-size: var( --mdc-typography-subtitle2-font-size );--mdc-typography-body2-font-size: var(--mdc-typography-caption-font-size);margin-bottom:8px;margin-right:0;border-radius:0;height:48px;font-size:0;padding:0 0 0 15px}:host([hasChildren]){flex-direction:column;overflow:visible;height:inherit!important;background:none;padding:0;--mdc-list-side-padding: 0;--cv-list-item-graphic-margin-left: 0}:host([hasChildren][open]:hover:not([activated])) .expansion-header{--mdc-ripple-color: transparent}:host([hasChildren][open]:hover:not([activated])) .expansion-header:hover{--mdc-ripple-color: var(--mdc-theme-primary)}.expansion-header{position:relative;height:48px;width:100%;overflow:visible;display:flex;flex-shrink:0;align-items:center}.expansion-header mwc-ripple{border-radius:var(--cv-list-item-border-radius);overflow:hidden}.expansion-header-inner{padding:0 16px}.expansion-icon{margin-right:var(--cv-list-item-expansion-icon-margin, 0);font-size:var(--cv-list-item-expansion-icon-size, --mdc-icon-size);color:var(--cv-list-item-text-icon-on-background, var(--mdc-theme-text-icon-on-background))}.expansion-panel{display:block;width:100%;height:var(--cv-list-menu-height, 0);--mdc-list-side-padding: 72px;transition:transform .15s ease-out;overflow:hidden}:host([open][hasChildren]:not([twoline])){height:inherit;display:flex;flex-direction:column;border-radius:0}:host([open][hasChildren]:not([twoline])) .expansion-panel{transition:min-height .25s ease-in;height:var(--cv-list-menu-height, inherit)}
|
16
16
|
`;
|
17
|
-
var
|
18
|
-
for (var a = s > 1 ? void 0 : s ?
|
17
|
+
var _ = Object.defineProperty, b = Object.getOwnPropertyDescriptor, l = (e, t, i, s) => {
|
18
|
+
for (var a = s > 1 ? void 0 : s ? b(t, i) : t, d = e.length - 1, p; d >= 0; d--)
|
19
19
|
(p = e[d]) && (a = (s ? p(t, i, a) : p(a)) || a);
|
20
|
-
return s && a &&
|
20
|
+
return s && a && _(t, i, a), a;
|
21
21
|
};
|
22
|
-
let r = class extends
|
22
|
+
let r = class extends u {
|
23
23
|
constructor() {
|
24
24
|
super(...arguments), this.open = !1, this.hasChildren = !1, this.activated = !1, this.lastKeySelected = 0;
|
25
25
|
}
|
@@ -77,7 +77,7 @@ let r = class extends v {
|
|
77
77
|
super.disconnectedCallback(), this.removeEventListener("keydown", this._handleKeydown), this.addEventListener("request-selected", this._handleRequestSelected);
|
78
78
|
}
|
79
79
|
renderMeta() {
|
80
|
-
const e = this.open ? "
|
80
|
+
const e = this.open ? "arrow_drop_up" : "arrow_drop_down", t = c`<cv-icon slot="meta" class="expansion-icon"
|
81
81
|
>${e}</cv-icon
|
82
82
|
>`;
|
83
83
|
return c` <span class="mdc-deprecated-list-item__meta material-icons">
|
@@ -91,7 +91,7 @@ let r = class extends v {
|
|
91
91
|
};
|
92
92
|
r.styles = [
|
93
93
|
o`
|
94
|
-
${n(
|
94
|
+
${n(v)}
|
95
95
|
`,
|
96
96
|
o`
|
97
97
|
${n(x)}
|