@fluid-topics/ft-floating-menu 1.1.34 → 1.1.36
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.
|
@@ -44,8 +44,7 @@ class FtBaseFloatingMenu extends FtLitElement {
|
|
|
44
44
|
["ft-floating-menu--" + this.verticalAlignment.toLowerCase()]: true,
|
|
45
45
|
};
|
|
46
46
|
return html `
|
|
47
|
-
<div class="${classMap(classes)}">
|
|
48
|
-
|
|
47
|
+
<div part="container" class="${classMap(classes)}">
|
|
49
48
|
<slot name="toggle"
|
|
50
49
|
part="toggle"
|
|
51
50
|
@click=${this.toggleMenu}>
|
|
@@ -67,7 +66,7 @@ class FtBaseFloatingMenu extends FtLitElement {
|
|
|
67
66
|
${this.text}
|
|
68
67
|
</ft-or-ftds-button>
|
|
69
68
|
</slot>
|
|
70
|
-
<div class="ft-floating-menu--wrapper">
|
|
69
|
+
<div part="options-wrapper" class="ft-floating-menu--wrapper">
|
|
71
70
|
<div id="ft-floating-menu-options"
|
|
72
71
|
class="ft-floating-menu--options"
|
|
73
72
|
part="options"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
!function(t,o,e,r,i,a){const n={zIndex:o.FtCssVariableFactory.create("--ft-floating-menu-z-index","","NUMBER","8"),maxWidth:o.FtCssVariableFactory.create("--ft-floating-menu-max-width","","SIZE","300px"),maxHeight:o.FtCssVariableFactory.create("--ft-floating-menu-max-height","","SIZE","500px"),textColor:o.FtCssVariableFactory.extend("--ft-floating-menu-text-color","",o.designSystemVariables.colorOnSurfaceHigh),colorSurface:o.FtCssVariableFactory.external(o.designSystemVariables.colorSurface,"Design system"),menuElevation:o.FtCssVariableFactory.external(o.designSystemVariables.elevation02,"Design system"),borderRadiusS:o.FtCssVariableFactory.external(o.designSystemVariables.borderRadiusS,"Design system")},l=e.css`
|
|
2
2
|
.ft-floating-menu {
|
|
3
3
|
color: ${n.textColor};
|
|
4
|
-
display:
|
|
4
|
+
display: contents;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.ft-floating-menu--wrapper {
|
|
@@ -873,8 +873,7 @@ const Fo=Symbol.for(""),Do=t=>{if(t?.r===Fo)return t?._$litStatic$},Bo=t=>({_$li
|
|
|
873
873
|
</ft-typography>
|
|
874
874
|
</div>
|
|
875
875
|
`}onClick(t){this.dispatchEvent(new mr(this.value))}onKeyDown(t){"Enter"!=t.key&&" "!=t.key||(t.preventDefault(),this.dispatchEvent(new mr(this.value)))}}xr.elementDefinitions={"ft-icon":nr,"ft-ripple":Qt,"ft-typography":jo},xr.styles=ur,br([r.property()],xr.prototype,"iconVariant",void 0),br([r.property()],xr.prototype,"icon",void 0),br([r.property()],xr.prototype,"value",void 0),br([r.property({type:Boolean})],xr.prototype,"notFocusable",void 0);var Or=function(t,o,e,r){for(var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(a<3?i(n):a>3?i(o,e,n):i(o,e))||n);return a>3&&n&&Object.defineProperty(o,e,n),n};class vr extends o.FtLitElement{constructor(){super(...arguments),this.menuOpen=!1,this.forceMenuOpen=!1,this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.small=!1,this.iconVariant=er.fluid_topics,this.icon="SHORTCUT_MENU",this.horizontalAlignment="left",this.verticalAlignment="bottom",this.disabled=!1,this.closeMenuMatchers=[],this.hideOptionsOnClickOutside=t=>{this.menuOpen=this.menuOpen&&t.composedPath().includes(this.container)}}render(){const t={"ft-floating-menu":!0,"ft-floating-menu--open":this.forceMenuOpen||this.menuOpen,["ft-floating-menu--"+this.horizontalAlignment.toLowerCase()]:!0,["ft-floating-menu--"+this.verticalAlignment.toLowerCase()]:!0};return e.html`
|
|
876
|
-
<div class="${i.classMap(t)}">
|
|
877
|
-
|
|
876
|
+
<div part="container" class="${i.classMap(t)}">
|
|
878
877
|
<slot name="toggle"
|
|
879
878
|
part="toggle"
|
|
880
879
|
@click=${this.toggleMenu}>
|
|
@@ -896,7 +895,7 @@ const Fo=Symbol.for(""),Do=t=>{if(t?.r===Fo)return t?._$litStatic$},Bo=t=>({_$li
|
|
|
896
895
|
${this.text}
|
|
897
896
|
</ft-or-ftds-button>
|
|
898
897
|
</slot>
|
|
899
|
-
<div class="ft-floating-menu--wrapper">
|
|
898
|
+
<div part="options-wrapper" class="ft-floating-menu--wrapper">
|
|
900
899
|
<div id="ft-floating-menu-options"
|
|
901
900
|
class="ft-floating-menu--options"
|
|
902
901
|
part="options"
|
|
@@ -86,7 +86,7 @@ class mo extends zt{constructor(){super(...arguments),this.renderOptions={host:t
|
|
|
86
86
|
* @license
|
|
87
87
|
* Copyright 2019 Google LLC
|
|
88
88
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
89
|
-
*/const ke=window,Ie=ke.ShadowRoot&&(void 0===ke.ShadyCSS||ke.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;class We extends mo{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([o,e])=>t.registry.define(o,e))));const o={...t.shadowRootOptions,customElements:t.registry},e=this.renderOptions.creationScope=this.attachShadow(o);return((t,o)=>{Ie?t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((o=>{const e=document.createElement("style"),i=ke.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=o.cssText,t.appendChild(e)}))})(e,t.elementStyles),e}}var Le,Ke=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};const ze=Symbol("constructorPrototype"),Fe=Symbol("constructorName"),Ze=Symbol("exportpartsDebouncer");class De extends We{constructor(){super(),this[Le]=new o(5),this[Fe]=this.constructor.name,this[ze]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Fe]&&Object.setPrototypeOf(this,this[ze])}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var o,e;if((null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==e?e:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this[Ze].run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var o,e,i,r,n,a;const s=t=>null!=t&&t.trim().length>0,l=t.filter(s).map((t=>t.trim()));if(0===l.length)return void this.removeAttribute("exportparts");const c=new Set;for(let t of null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll("[part],[exportparts]"))&&void 0!==e?e:[]){const o=null!==(r=null===(i=t.getAttribute("part"))||void 0===i?void 0:i.split(" "))&&void 0!==r?r:[],e=null!==(a=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==a?a:[];new Array(...o,...e).filter(s).map((t=>t.trim())).forEach((t=>c.add(t)))}if(0===c.size)return void this.removeAttribute("exportparts");const p=[...c.values()].flatMap((t=>l.map((o=>`${t}:${o}--${t}`))));this.setAttribute("exportparts",[...this.part,...p].join(", "))}}Le=Ze,Ke([C()],De.prototype,"exportpartsPrefix",void 0),Ke([W([])],De.prototype,"exportpartsPrefixes",void 0),Ke([C()],De.prototype,"customStylesheet",void 0);const Ae=Oo.create("--ft-utils-highlight-html-background-color","","COLOR","#FFF26E");xt`
|
|
89
|
+
*/const ke=window,Ie=ke.ShadowRoot&&(void 0===ke.ShadyCSS||ke.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;class We extends mo{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([o,e])=>t.registry.define(o,e))));const o={...t.shadowRootOptions,customElements:t.registry},e=this.renderOptions.creationScope=this.attachShadow(o);return((t,o)=>{Ie?t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((o=>{const e=document.createElement("style"),i=ke.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=o.cssText,t.appendChild(e)}))})(e,t.elementStyles),e}}var Le,Ke=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};const ze=Symbol("constructorPrototype"),Fe=Symbol("constructorName"),Ze=Symbol("exportpartsDebouncer");class De extends We{constructor(){super(),this[Le]=new o(5),this[Fe]=this.constructor.name,this[ze]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Fe]&&Object.setPrototypeOf(this,this[ze])}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var o,e;if((null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==e?e:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){var t,o,e;((null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())||null!==(e=null===(o=this.exportpartsPrefixes)||void 0===o?void 0:o.length)&&void 0!==e&&e)&&this[Ze].run((()=>{var t,o;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&(null===(o=this.exportpartsPrefixes)||void 0===o?void 0:o.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var o,e,i,r,n,a;const s=t=>null!=t&&t.trim().length>0,l=t.filter(s).map((t=>t.trim()));if(0===l.length)return void this.removeAttribute("exportparts");const c=new Set;for(let t of null!==(e=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll("[part],[exportparts]"))&&void 0!==e?e:[]){const o=null!==(r=null===(i=t.getAttribute("part"))||void 0===i?void 0:i.split(" "))&&void 0!==r?r:[],e=null!==(a=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==a?a:[];new Array(...o,...e).filter(s).map((t=>t.trim())).forEach((t=>c.add(t)))}if(0===c.size)return void this.removeAttribute("exportparts");const p=[...c.values()].flatMap((t=>l.map((o=>`${t}:${o}--${t}`))));this.setAttribute("exportparts",[...this.part,...p].join(", "))}}Le=Ze,Ke([C()],De.prototype,"exportpartsPrefix",void 0),Ke([W([])],De.prototype,"exportpartsPrefixes",void 0),Ke([C()],De.prototype,"customStylesheet",void 0);const Ae=Oo.create("--ft-utils-highlight-html-background-color","","COLOR","#FFF26E");xt`
|
|
90
90
|
.highlight-html-match {
|
|
91
91
|
background: ${Ae};
|
|
92
92
|
}
|
|
@@ -125,7 +125,7 @@ class mo extends zt{constructor(){super(...arguments),this.renderOptions={host:t
|
|
|
125
125
|
`;function Pe(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var He,je,Te;const _e=Symbol("internalReduxEventsUnsubscribers"),Ge=Symbol("internalStoresUnsubscribers"),Ye=Symbol("internalStores");class Ve extends De{constructor(){super(...arguments),this[He]=new Map,this[je]=new Map,this[Te]=[]}get reduxConstructor(){return this.constructor}update(t){super.update(t),[...this.reduxConstructor.reduxReactiveProperties].some((o=>t.has(o)))&&this.updateFromStores()}getUnnamedStore(){if(this[Ye].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ye].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Ye].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:Pe(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[Ye].delete(o)}setupStore(t,o){this[Ye].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Ye].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[Ge].has(t.store):this[Ge].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[Ge].set(t,o.subscribe((()=>this.updateFromStores()))),Pe(o)&&o.eventBus&&(null===(e=this.reduxConstructor.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const i=t=>this[e](t);o.eventBus.addEventListener(t.eventName,i),this[_e].push((()=>o.eventBus.removeEventListener(t.eventName,i)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Ge].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[_e].forEach((t=>t())),this[_e]=[]}unsubscribeFromStore(t){this[Ge].has(t)&&this[Ge].get(t)(),this[Ge].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}He=Ge,je=Ye,Te=_e,Ve.reduxProperties=new Map,Ve.reduxReactiveProperties=new Set,Ve.reduxEventListeners=new Map,window.ftReduxStores||(window.ftReduxStores={});const Je=Symbol("elementInternals");var qe,Xe,Qe;const ti=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Qe=null===(Xe=null===(qe=window.safari)||void 0===qe?void 0:qe.pushNotification)||void 0===Xe?void 0:Xe.toString())&&void 0!==Qe?Qe:""),oi={zIndex:Oo.create("--ft-floating-menu-z-index","","NUMBER","8"),maxWidth:Oo.create("--ft-floating-menu-max-width","","SIZE","300px"),maxHeight:Oo.create("--ft-floating-menu-max-height","","SIZE","500px"),textColor:Oo.extend("--ft-floating-menu-text-color","",Eo.colorOnSurfaceHigh),colorSurface:Oo.external(Eo.colorSurface,"Design system"),menuElevation:Oo.external(Eo.elevation02,"Design system"),borderRadiusS:Oo.external(Eo.borderRadiusS,"Design system")},ei=xt`
|
|
126
126
|
.ft-floating-menu {
|
|
127
127
|
color: ${oi.textColor};
|
|
128
|
-
display:
|
|
128
|
+
display: contents;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.ft-floating-menu--wrapper {
|
|
@@ -1008,8 +1008,7 @@ class hn extends jr{constructor(t){if(super(t),this.et=tt,t.type!==Pr)throw Erro
|
|
|
1008
1008
|
</ft-typography>
|
|
1009
1009
|
</div>
|
|
1010
1010
|
`}onClick(t){this.dispatchEvent(new kn(this.value))}onKeyDown(t){"Enter"!=t.key&&" "!=t.key||(t.preventDefault(),this.dispatchEvent(new kn(this.value)))}}In.elementDefinitions={"ft-icon":mn,"ft-ripple":Gr,"ft-typography":on},In.styles=Rn,Un([C()],In.prototype,"iconVariant",void 0),Un([C()],In.prototype,"icon",void 0),Un([C()],In.prototype,"value",void 0),Un([C({type:Boolean})],In.prototype,"notFocusable",void 0);var Wn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class Ln extends De{constructor(){super(...arguments),this.menuOpen=!1,this.forceMenuOpen=!1,this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.small=!1,this.iconVariant=gn.fluid_topics,this.icon="SHORTCUT_MENU",this.horizontalAlignment="left",this.verticalAlignment="bottom",this.disabled=!1,this.closeMenuMatchers=[],this.hideOptionsOnClickOutside=t=>{this.menuOpen=this.menuOpen&&t.composedPath().includes(this.container)}}render(){const t={"ft-floating-menu":!0,"ft-floating-menu--open":this.forceMenuOpen||this.menuOpen,["ft-floating-menu--"+this.horizontalAlignment.toLowerCase()]:!0,["ft-floating-menu--"+this.verticalAlignment.toLowerCase()]:!0};return oo`
|
|
1011
|
-
<div class="${Tr(t)}">
|
|
1012
|
-
|
|
1011
|
+
<div part="container" class="${Tr(t)}">
|
|
1013
1012
|
<slot name="toggle"
|
|
1014
1013
|
part="toggle"
|
|
1015
1014
|
@click=${this.toggleMenu}>
|
|
@@ -1031,7 +1030,7 @@ class hn extends jr{constructor(t){if(super(t),this.et=tt,t.type!==Pr)throw Erro
|
|
|
1031
1030
|
${this.text}
|
|
1032
1031
|
</ft-or-ftds-button>
|
|
1033
1032
|
</slot>
|
|
1034
|
-
<div class="ft-floating-menu--wrapper">
|
|
1033
|
+
<div part="options-wrapper" class="ft-floating-menu--wrapper">
|
|
1035
1034
|
<div id="ft-floating-menu-options"
|
|
1036
1035
|
class="ft-floating-menu--options"
|
|
1037
1036
|
part="options"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-floating-menu",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.36",
|
|
4
4
|
"description": "Floating menu component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-button": "1.1.
|
|
23
|
-
"@fluid-topics/ft-icon": "1.1.
|
|
24
|
-
"@fluid-topics/ft-ripple": "1.1.
|
|
25
|
-
"@fluid-topics/ft-typography": "1.1.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-button": "1.1.36",
|
|
23
|
+
"@fluid-topics/ft-icon": "1.1.36",
|
|
24
|
+
"@fluid-topics/ft-ripple": "1.1.36",
|
|
25
|
+
"@fluid-topics/ft-typography": "1.1.36",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.1.36",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "18df3483145165af9ce51db3f11be8aeb918ea40"
|
|
30
30
|
}
|