@fluid-topics/ft-floating-menu 1.1.12 → 1.1.13
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/build/ft-base-floating-menu.d.ts +2 -1
- package/build/ft-base-floating-menu.js +6 -2
- package/build/ft-floating-menu-label.css.d.ts +4 -0
- package/build/ft-floating-menu-label.css.js +20 -0
- package/build/ft-floating-menu-label.d.ts +7 -0
- package/build/ft-floating-menu-label.js +20 -0
- package/build/ft-floating-menu-label.properties.d.ts +2 -0
- package/build/ft-floating-menu-label.properties.js +1 -0
- package/build/ft-floating-menu.light.js +22 -3
- package/build/ft-floating-menu.min.js +29 -4
- package/build/index.d.ts +3 -0
- package/build/index.js +5 -0
- package/package.json +7 -7
|
@@ -13,7 +13,8 @@ export declare class FtBaseFloatingMenu extends FtLitElement implements FtBaseFl
|
|
|
13
13
|
private container;
|
|
14
14
|
private menuWrapper;
|
|
15
15
|
private menuContent;
|
|
16
|
-
private actionButton
|
|
16
|
+
private actionButton?;
|
|
17
|
+
private customToggle;
|
|
17
18
|
primary: boolean;
|
|
18
19
|
secondary: boolean;
|
|
19
20
|
tertiary: boolean;
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { html } from "lit";
|
|
8
|
-
import { property, query, state } from "lit/decorators.js";
|
|
8
|
+
import { property, query, queryAssignedElements, state } from "lit/decorators.js";
|
|
9
9
|
import { eventPathContainsMatchingElement, FtLitElement, jsonProperty, } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
11
|
import { FtFloatingMenuItem } from "./ft-floating-menu-item";
|
|
@@ -119,7 +119,8 @@ class FtBaseFloatingMenu extends FtLitElement {
|
|
|
119
119
|
positionMenuWrapper() {
|
|
120
120
|
this.menuWrapper.style.left = "";
|
|
121
121
|
this.menuWrapper.style.top = "";
|
|
122
|
-
|
|
122
|
+
const reference = this.customToggle.length > 0 ? this.customToggle[0] : this.actionButton;
|
|
123
|
+
computePosition(reference, this.menuWrapper, {
|
|
123
124
|
platform: {
|
|
124
125
|
...platform,
|
|
125
126
|
getOffsetParent: (element) => {
|
|
@@ -168,6 +169,9 @@ __decorate([
|
|
|
168
169
|
__decorate([
|
|
169
170
|
query("#actions-button")
|
|
170
171
|
], FtBaseFloatingMenu.prototype, "actionButton", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
queryAssignedElements({ slot: "toggle" })
|
|
174
|
+
], FtBaseFloatingMenu.prototype, "customToggle", void 0);
|
|
171
175
|
__decorate([
|
|
172
176
|
property({ type: Boolean })
|
|
173
177
|
], FtBaseFloatingMenu.prototype, "primary", void 0);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
export const FtFloatingMenuLabelCssVariables = {
|
|
4
|
+
color: FtCssVariableFactory.extend("--ft-floating-menu-label-color", "", designSystemVariables.colorOnSurfaceMedium),
|
|
5
|
+
};
|
|
6
|
+
// language=CSS
|
|
7
|
+
export const labelStyles = css `
|
|
8
|
+
.ft-floating-menu-label {
|
|
9
|
+
padding: 4px 8px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ft-floating-menu-label ft-typography {
|
|
13
|
+
flex-shrink: 1;
|
|
14
|
+
flex-grow: 1;
|
|
15
|
+
width: max-content;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
color: ${FtFloatingMenuLabelCssVariables.color}
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { FtFloatingMenuLabelProperties } from "./ft-floating-menu-label.properties";
|
|
3
|
+
export declare class FtFloatingMenuLabel extends FtLitElement implements FtFloatingMenuLabelProperties {
|
|
4
|
+
static elementDefinitions: ElementDefinitionsMap;
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
4
|
+
import { labelStyles } from "./ft-floating-menu-label.css";
|
|
5
|
+
class FtFloatingMenuLabel extends FtLitElement {
|
|
6
|
+
render() {
|
|
7
|
+
return html `
|
|
8
|
+
<div class="ft-floating-menu-label">
|
|
9
|
+
<ft-typography variant="caption">
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</ft-typography>
|
|
12
|
+
</div>
|
|
13
|
+
`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
FtFloatingMenuLabel.elementDefinitions = {
|
|
17
|
+
"ft-typography": FtTypography,
|
|
18
|
+
};
|
|
19
|
+
FtFloatingMenuLabel.styles = labelStyles;
|
|
20
|
+
export { FtFloatingMenuLabel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -566,7 +566,7 @@ const Bo=Symbol.for(""),Fo=t=>{if(t?.r===Bo)return t?._$litStatic$},Do=t=>({_$li
|
|
|
566
566
|
@focusin=${this.onHover}
|
|
567
567
|
@focusout=${this.onOut}
|
|
568
568
|
@touchstart=${this.onTouch}>
|
|
569
|
-
<slot part="slot"></slot>
|
|
569
|
+
<slot part="slot" @click=${this.onClick}></slot>
|
|
570
570
|
<div part="tooltip" role="tooltip" inert
|
|
571
571
|
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
572
572
|
?hidden=${!this.visible}>
|
|
@@ -576,7 +576,7 @@ const Bo=Symbol.for(""),Fo=t=>{if(t?.r===Bo)return t?._$litStatic$},Do=t=>({_$li
|
|
|
576
576
|
</div>
|
|
577
577
|
</div>
|
|
578
578
|
</div>
|
|
579
|
-
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",qe(this.slottedElement,this.tooltip,{platform:{...Xe,getOffsetParent:t=>Xe.getOffsetParent(t,Je)},middleware:[Oe({crossAxis:!0}),xe({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}ir.elementDefinitions={"ft-typography":jo},ir.styles=qo,rr([r.property()],ir.prototype,"text",void 0),rr([r.property({type:Boolean})],ir.prototype,"manual",void 0),rr([r.property({type:Boolean})],ir.prototype,"inline",void 0),rr([r.property({type:Number})],ir.prototype,"delay",void 0),rr([r.property()],ir.prototype,"position",void 0),rr([r.queryAssignedNodes()],ir.prototype,"slotNodes",void 0),rr([r.query(".ft-tooltip--container")],ir.prototype,"container",void 0),rr([r.query(".ft-tooltip")],ir.prototype,"tooltip",void 0),rr([r.query(".ft-tooltip--content")],ir.prototype,"tooltipContent",void 0),rr([r.state()],ir.prototype,"visible",void 0),rr([r.eventOptions({passive:!0})],ir.prototype,"onTouch",null),rr([r.eventOptions({passive:!0})],ir.prototype,"onHover",null),rr([r.eventOptions({passive:!0})],ir.prototype,"onOut",null),o.customElement("ft-tooltip")(ir),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.EXTLINK_LIGHT="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(tr||(tr={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(or||(or={})),new Map([...["abw"].map((t=>[t,or.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,or.AUDIO])),...["avi"].map((t=>[t,or.AVI])),...["chm","xhs"].map((t=>[t,or.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,or.CODE])),...["csv"].map((t=>[t,or.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,or.DITA])),...["epub"].map((t=>[t,or.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,or.EXCEL])),...["flac"].map((t=>[t,or.FLAC])),...["gif"].map((t=>[t,or.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,or.GZIP])),...["html","htm","xhtml"].map((t=>[t,or.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,or.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,or.JPEG])),...["json"].map((t=>[t,or.JSON])),...["m4a","m4p"].map((t=>[t,or.M4A])),...["mov","qt"].map((t=>[t,or.MOV])),...["mp3"].map((t=>[t,or.MP3])),...["mp4","m4v"].map((t=>[t,or.MP4])),...["ogg","oga"].map((t=>[t,or.OGG])),...["pdf","ps"].map((t=>[t,or.PDF])),...["png"].map((t=>[t,or.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,or.POWERPOINT])),...["rar"].map((t=>[t,or.RAR])),...["stp"].map((t=>[t,or.STP])),...["txt","rtf","md","mdown"].map((t=>[t,or.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,or.VIDEO])),...["wav"].map((t=>[t,or.WAV])),...["wma"].map((t=>[t,or.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,or.WORD])),...["xml","xsl","rdf"].map((t=>[t,or.XML])),...["yaml","yml","x-yaml"].map((t=>[t,or.YAML])),...["zip"].map((t=>[t,or.ZIP]))]),or.ABW,or.AUDIO,or.AVI,or.CHM,or.CODE,or.CSV,or.DITA,or.EPUB,or.EXCEL,or.FLAC,or.GIF,or.GZIP,or.HTML,or.IMAGE,or.JPEG,or.JSON,or.M4A,or.MOV,or.MP3,or.MP4,or.OGG,or.PDF,or.PNG,or.POWERPOINT,or.RAR,or.STP,or.TEXT,or.UNKNOWN,or.VIDEO,or.WAV,or.WMA,or.WORD,or.XML,or.YAML,or.ZIP,function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(er||(er={}));var nr=function(t,o,e,r){for(var i,n=arguments.length,a=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(o,e,a):i(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class ar extends o.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(er).includes(this.variant)?this.variant:er.fluid_topics,o=t!==er.material||!!this.value;return e.html`
|
|
579
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",qe(this.slottedElement,this.tooltip,{platform:{...Xe,getOffsetParent:t=>Xe.getOffsetParent(t,Je)},middleware:[Oe({crossAxis:!0}),xe({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}ir.elementDefinitions={"ft-typography":jo},ir.styles=qo,rr([r.property()],ir.prototype,"text",void 0),rr([r.property({type:Boolean})],ir.prototype,"manual",void 0),rr([r.property({type:Boolean})],ir.prototype,"inline",void 0),rr([r.property({type:Number})],ir.prototype,"delay",void 0),rr([r.property()],ir.prototype,"position",void 0),rr([r.queryAssignedNodes()],ir.prototype,"slotNodes",void 0),rr([r.query(".ft-tooltip--container")],ir.prototype,"container",void 0),rr([r.query(".ft-tooltip")],ir.prototype,"tooltip",void 0),rr([r.query(".ft-tooltip--content")],ir.prototype,"tooltipContent",void 0),rr([r.state()],ir.prototype,"visible",void 0),rr([r.eventOptions({passive:!0})],ir.prototype,"onTouch",null),rr([r.eventOptions({passive:!0})],ir.prototype,"onHover",null),rr([r.eventOptions({passive:!0})],ir.prototype,"onOut",null),rr([r.eventOptions({passive:!0})],ir.prototype,"onClick",null),o.customElement("ft-tooltip")(ir),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.EXTLINK_LIGHT="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(tr||(tr={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(or||(or={})),new Map([...["abw"].map((t=>[t,or.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,or.AUDIO])),...["avi"].map((t=>[t,or.AVI])),...["chm","xhs"].map((t=>[t,or.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,or.CODE])),...["csv"].map((t=>[t,or.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,or.DITA])),...["epub"].map((t=>[t,or.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,or.EXCEL])),...["flac"].map((t=>[t,or.FLAC])),...["gif"].map((t=>[t,or.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,or.GZIP])),...["html","htm","xhtml"].map((t=>[t,or.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,or.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,or.JPEG])),...["json"].map((t=>[t,or.JSON])),...["m4a","m4p"].map((t=>[t,or.M4A])),...["mov","qt"].map((t=>[t,or.MOV])),...["mp3"].map((t=>[t,or.MP3])),...["mp4","m4v"].map((t=>[t,or.MP4])),...["ogg","oga"].map((t=>[t,or.OGG])),...["pdf","ps"].map((t=>[t,or.PDF])),...["png"].map((t=>[t,or.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,or.POWERPOINT])),...["rar"].map((t=>[t,or.RAR])),...["stp"].map((t=>[t,or.STP])),...["txt","rtf","md","mdown"].map((t=>[t,or.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,or.VIDEO])),...["wav"].map((t=>[t,or.WAV])),...["wma"].map((t=>[t,or.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,or.WORD])),...["xml","xsl","rdf"].map((t=>[t,or.XML])),...["yaml","yml","x-yaml"].map((t=>[t,or.YAML])),...["zip"].map((t=>[t,or.ZIP]))]),or.ABW,or.AUDIO,or.AVI,or.CHM,or.CODE,or.CSV,or.DITA,or.EPUB,or.EXCEL,or.FLAC,or.GIF,or.GZIP,or.HTML,or.IMAGE,or.JPEG,or.JSON,or.M4A,or.MOV,or.MP3,or.MP4,or.OGG,or.PDF,or.PNG,or.POWERPOINT,or.RAR,or.STP,or.TEXT,or.UNKNOWN,or.VIDEO,or.WAV,or.WMA,or.WORD,or.XML,or.YAML,or.ZIP,function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(er||(er={}));var nr=function(t,o,e,r){for(var i,n=arguments.length,a=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(o,e,a):i(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class ar extends o.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(er).includes(this.variant)?this.variant:er.fluid_topics,o=t!==er.material||!!this.value;return e.html`
|
|
580
580
|
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
581
581
|
${n.unsafeHTML(this.resolvedIcon)}
|
|
582
582
|
<slot ?hidden=${o}></slot>
|
|
@@ -906,4 +906,23 @@ const Bo=Symbol.for(""),Fo=t=>{if(t?.r===Bo)return t?._$litStatic$},Do=t=>({_$li
|
|
|
906
906
|
</div>
|
|
907
907
|
</div>
|
|
908
908
|
</div>
|
|
909
|
-
`}onClick(){this.menuOpen=!this.menuOpen,setTimeout((()=>document.addEventListener("click",this.hideOptions)))}onClickItem(){this.closeMenu()}closeMenu(){this.menuOpen=!1}onCloseEvent(t){t.stopPropagation(),this.closeMenu()}onContentClick(t){o.eventPathContainsMatchingElement(t,this.closeMenuMatchers,this)&&(this.closeMenu(),t.stopPropagation())}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}contentAvailableCallback(t){super.contentAvailableCallback(t),["menuOpen"].some((o=>t.has(o)))&&this.menuOpen&&(this.menuWrapper.classList.remove("ft-floating-menu--wrapper-positioned"),this.positionMenuWrapper())}positionMenuWrapper(){this.menuWrapper.style.left="",this.menuWrapper.style.top=""
|
|
909
|
+
`}onClick(){this.menuOpen=!this.menuOpen,setTimeout((()=>document.addEventListener("click",this.hideOptions)))}onClickItem(){this.closeMenu()}closeMenu(){this.menuOpen=!1}onCloseEvent(t){t.stopPropagation(),this.closeMenu()}onContentClick(t){o.eventPathContainsMatchingElement(t,this.closeMenuMatchers,this)&&(this.closeMenu(),t.stopPropagation())}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}contentAvailableCallback(t){super.contentAvailableCallback(t),["menuOpen"].some((o=>t.has(o)))&&this.menuOpen&&(this.menuWrapper.classList.remove("ft-floating-menu--wrapper-positioned"),this.positionMenuWrapper())}positionMenuWrapper(){this.menuWrapper.style.left="",this.menuWrapper.style.top="";const t=this.customToggle.length>0?this.customToggle[0]:this.actionButton;qe(t,this.menuWrapper,{platform:{...Xe,getOffsetParent:t=>Xe.getOffsetParent(t,Je)},middleware:[Oe({crossAxis:!0}),xe({allowedPlacements:[this.convertPlacement()]})]}).then((({x:t,y:o})=>{this.menuWrapper.style.left=`${t}px`,this.menuWrapper.style.top=`${o}px`})),this.menuWrapper.classList.add("ft-floating-menu--wrapper-positioned")}convertPlacement(){switch(this.horizontalAlignment){case"left":return this.verticalAlignment+"-start";case"right":return this.verticalAlignment+"-end";case"center":return this.verticalAlignment+"-center"}}}vr.elementDefinitions={"ft-floating-menu-item":xr},Or([r.state()],vr.prototype,"menuOpen",void 0),Or([r.state()],vr.prototype,"forceMenuOpen",void 0),Or([r.query(".ft-floating-menu")],vr.prototype,"container",void 0),Or([r.query(".ft-floating-menu--wrapper")],vr.prototype,"menuWrapper",void 0),Or([r.query("#ft-floating-menu-options")],vr.prototype,"menuContent",void 0),Or([r.query("#actions-button")],vr.prototype,"actionButton",void 0),Or([r.queryAssignedElements({slot:"toggle"})],vr.prototype,"customToggle",void 0),Or([r.property({type:Boolean})],vr.prototype,"primary",void 0),Or([r.property({type:Boolean})],vr.prototype,"secondary",void 0),Or([r.property({type:Boolean})],vr.prototype,"tertiary",void 0),Or([r.property({type:Boolean})],vr.prototype,"neutral",void 0),Or([r.property({type:Boolean})],vr.prototype,"small",void 0),Or([r.property()],vr.prototype,"label",void 0),Or([r.property()],vr.prototype,"tooltipPosition",void 0),Or([r.property()],vr.prototype,"iconVariant",void 0),Or([r.property()],vr.prototype,"icon",void 0),Or([r.property()],vr.prototype,"text",void 0),Or([r.property()],vr.prototype,"horizontalAlignment",void 0),Or([r.property()],vr.prototype,"verticalAlignment",void 0),Or([r.property({type:Boolean})],vr.prototype,"disabled",void 0),Or([o.jsonProperty([])],vr.prototype,"closeMenuMatchers",void 0);class Nr extends vr{}Nr.elementDefinitions={"ft-or-ftds-button":pr},Nr.styles=l;class Sr extends vr{}Sr.elementDefinitions={"ft-or-ftds-button":yr},Sr.styles=l;const wr={color:o.FtCssVariableFactory.extend("--ft-floating-menu-label-color","",o.designSystemVariables.colorOnSurfaceMedium)},$r=e.css`
|
|
910
|
+
.ft-floating-menu-label {
|
|
911
|
+
padding: 4px 8px;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
.ft-floating-menu-label ft-typography {
|
|
915
|
+
flex-shrink: 1;
|
|
916
|
+
flex-grow: 1;
|
|
917
|
+
width: max-content;
|
|
918
|
+
text-overflow: ellipsis;
|
|
919
|
+
overflow: hidden;
|
|
920
|
+
color: ${wr.color}
|
|
921
|
+
}
|
|
922
|
+
`;class Cr extends o.FtLitElement{render(){return e.html`
|
|
923
|
+
<div class="ft-floating-menu-label">
|
|
924
|
+
<ft-typography variant="caption">
|
|
925
|
+
<slot></slot>
|
|
926
|
+
</ft-typography>
|
|
927
|
+
</div>
|
|
928
|
+
`}}Cr.elementDefinitions={"ft-typography":jo},Cr.styles=$r,o.customElement("ft-floating-menu")(Nr),o.customElement("ftds-floating-menu")(Sr),o.customElement("ft-floating-menu-item")(xr),o.customElement("ft-floating-menu-label")(Cr),t.FtFloatingMenu=Nr,t.FtFloatingMenuCssVariables=a,t.FtFloatingMenuItem=xr,t.FtFloatingMenuItemCssVariables=gr,t.FtFloatingMenuItemSelect=mr,t.FtFloatingMenuLabel=Cr,t.FtFloatingMenuLabelCssVariables=wr,t.FtdsFloatingMenu=Sr,t.itemStyles=ur,t.labelStyles=$r,t.styles=l}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|
|
@@ -51,7 +51,7 @@ const S={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:O},w=(t=S,o,
|
|
|
51
51
|
*/;function U(t,o){return(e,i,r)=>{const n=o=>o.renderRoot?.querySelector(t)??null;if(o){const{get:t,set:o}="object"==typeof i?e:r??(()=>{const t=Symbol();return{get(){return this[t]},set(o){this[t]=o}}})();return E(0,0,{get(){let e=t.call(this);return void 0===e&&(e=n(this),(null!==e||this.hasUpdated)&&o.call(this,e)),e}})}return E(0,0,{get(){return n(this)}})}}
|
|
52
52
|
/**
|
|
53
53
|
* @license
|
|
54
|
-
* Copyright
|
|
54
|
+
* Copyright 2021 Google LLC
|
|
55
55
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
56
56
|
*/function k(t,o){try{return function(t,o){if(t===o)return!0;if(t&&o&&"object"==typeof t&&"object"==typeof o){if(t.constructor!==o.constructor)return!1;var e,i,r;if(Array.isArray(t)){if((e=t.length)!=o.length)return!1;for(i=e;0!=i--;)if(!k(t[i],o[i]))return!1;return!0}if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(i of t.entries())if(!o.has(i[0]))return!1;for(i of t.entries())if(!k(i[1],o.get(i[0])))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(i of t.entries())if(!o.has(i[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===o.source&&t.flags===o.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===o.valueOf();if((e=(r=Object.keys(t)).length)!==Object.keys(o).length)return!1;for(i=e;0!=i--;)if(!Object.prototype.hasOwnProperty.call(o,r[i]))return!1;for(i=e;0!=i--;){var n=r[i];if(!k(t[n],o[n]))return!1}return!0}return t!=t&&o!=o}(t,o)}catch(t){return!1}}const I=t=>o=>{window.customElements.get(t)||window.customElements.define(t,o)};function W(t,o){const e=()=>JSON.parse(JSON.stringify(t));return C({type:Object,converter:{fromAttribute:t=>{if(null==t)return e();try{return JSON.parse(t)}catch{return e()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,o)=>!k(t,o),...null!=o?o:{}})}
|
|
57
57
|
/**
|
|
@@ -689,7 +689,7 @@ const _i=Symbol.for(""),Gi=t=>{if(t?.r===_i)return t?._$litStatic$},Yi=t=>({_$li
|
|
|
689
689
|
@focusin=${this.onHover}
|
|
690
690
|
@focusout=${this.onOut}
|
|
691
691
|
@touchstart=${this.onTouch}>
|
|
692
|
-
<slot part="slot"></slot>
|
|
692
|
+
<slot part="slot" @click=${this.onClick}></slot>
|
|
693
693
|
<div part="tooltip" role="tooltip" inert
|
|
694
694
|
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
695
695
|
?hidden=${!this.visible}>
|
|
@@ -699,7 +699,13 @@ const _i=Symbol.for(""),Gi=t=>{if(t?.r===_i)return t?._$litStatic$},Yi=t=>({_$li
|
|
|
699
699
|
</div>
|
|
700
700
|
</div>
|
|
701
701
|
</div>
|
|
702
|
-
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",sn(this.slottedElement,this.tooltip,{platform:{...an,getOffsetParent:t=>an.getOffsetParent(t,ln)},middleware:[Ur({crossAxis:!0}),Er({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}pn.elementDefinitions={"ft-typography":Qi},pn.styles=ar,fn([C()],pn.prototype,"text",void 0),fn([C({type:Boolean})],pn.prototype,"manual",void 0),fn([C({type:Boolean})],pn.prototype,"inline",void 0),fn([C({type:Number})],pn.prototype,"delay",void 0),fn([C()],pn.prototype,"position",void 0),fn([
|
|
702
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",sn(this.slottedElement,this.tooltip,{platform:{...an,getOffsetParent:t=>an.getOffsetParent(t,ln)},middleware:[Ur({crossAxis:!0}),Er({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}pn.elementDefinitions={"ft-typography":Qi},pn.styles=ar,fn([C()],pn.prototype,"text",void 0),fn([C({type:Boolean})],pn.prototype,"manual",void 0),fn([C({type:Boolean})],pn.prototype,"inline",void 0),fn([C({type:Number})],pn.prototype,"delay",void 0),fn([C()],pn.prototype,"position",void 0),fn([
|
|
703
|
+
/**
|
|
704
|
+
* @license
|
|
705
|
+
* Copyright 2017 Google LLC
|
|
706
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
707
|
+
*/
|
|
708
|
+
function(t){return(o,e)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([name])");return E(0,0,{get(){const o=this.renderRoot?.querySelector(r);return o?.assignedNodes(t)??[]}})}}()],pn.prototype,"slotNodes",void 0),fn([U(".ft-tooltip--container")],pn.prototype,"container",void 0),fn([U(".ft-tooltip")],pn.prototype,"tooltip",void 0),fn([U(".ft-tooltip--content")],pn.prototype,"tooltipContent",void 0),fn([$()],pn.prototype,"visible",void 0),fn([R({passive:!0})],pn.prototype,"onTouch",null),fn([R({passive:!0})],pn.prototype,"onHover",null),fn([R({passive:!0})],pn.prototype,"onOut",null),fn([R({passive:!0})],pn.prototype,"onClick",null),I("ft-tooltip")(pn);
|
|
703
709
|
/**
|
|
704
710
|
* @license
|
|
705
711
|
* Copyright 2017 Google LLC
|
|
@@ -1035,4 +1041,23 @@ class hn extends Pi{constructor(t){if(super(t),this.et=tt,t.type!==Mi)throw Erro
|
|
|
1035
1041
|
</div>
|
|
1036
1042
|
</div>
|
|
1037
1043
|
</div>
|
|
1038
|
-
`}onClick(){this.menuOpen=!this.menuOpen,setTimeout((()=>document.addEventListener("click",this.hideOptions)))}onClickItem(){this.closeMenu()}closeMenu(){this.menuOpen=!1}onCloseEvent(t){t.stopPropagation(),this.closeMenu()}onContentClick(t){(function(t,o,e=window.document.body){if(o.length>0){const i=t.composedPath();for(let t of i){if(t===e)return!1;if(t.matches&&o.some((o=>t.matches(o))))return!0}}return!1})(t,this.closeMenuMatchers,this)&&(this.closeMenu(),t.stopPropagation())}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}contentAvailableCallback(t){super.contentAvailableCallback(t),["menuOpen"].some((o=>t.has(o)))&&this.menuOpen&&(this.menuWrapper.classList.remove("ft-floating-menu--wrapper-positioned"),this.positionMenuWrapper())}positionMenuWrapper(){this.menuWrapper.style.left="",this.menuWrapper.style.top=""
|
|
1044
|
+
`}onClick(){this.menuOpen=!this.menuOpen,setTimeout((()=>document.addEventListener("click",this.hideOptions)))}onClickItem(){this.closeMenu()}closeMenu(){this.menuOpen=!1}onCloseEvent(t){t.stopPropagation(),this.closeMenu()}onContentClick(t){(function(t,o,e=window.document.body){if(o.length>0){const i=t.composedPath();for(let t of i){if(t===e)return!1;if(t.matches&&o.some((o=>t.matches(o))))return!0}}return!1})(t,this.closeMenuMatchers,this)&&(this.closeMenu(),t.stopPropagation())}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}contentAvailableCallback(t){super.contentAvailableCallback(t),["menuOpen"].some((o=>t.has(o)))&&this.menuOpen&&(this.menuWrapper.classList.remove("ft-floating-menu--wrapper-positioned"),this.positionMenuWrapper())}positionMenuWrapper(){this.menuWrapper.style.left="",this.menuWrapper.style.top="";const t=this.customToggle.length>0?this.customToggle[0]:this.actionButton;sn(t,this.menuWrapper,{platform:{...an,getOffsetParent:t=>an.getOffsetParent(t,ln)},middleware:[Ur({crossAxis:!0}),Er({allowedPlacements:[this.convertPlacement()]})]}).then((({x:t,y:o})=>{this.menuWrapper.style.left=`${t}px`,this.menuWrapper.style.top=`${o}px`})),this.menuWrapper.classList.add("ft-floating-menu--wrapper-positioned")}convertPlacement(){switch(this.horizontalAlignment){case"left":return this.verticalAlignment+"-start";case"right":return this.verticalAlignment+"-end";case"center":return this.verticalAlignment+"-center"}}}Ln.elementDefinitions={"ft-floating-menu-item":In},Wn([$()],Ln.prototype,"menuOpen",void 0),Wn([$()],Ln.prototype,"forceMenuOpen",void 0),Wn([U(".ft-floating-menu")],Ln.prototype,"container",void 0),Wn([U(".ft-floating-menu--wrapper")],Ln.prototype,"menuWrapper",void 0),Wn([U("#ft-floating-menu-options")],Ln.prototype,"menuContent",void 0),Wn([U("#actions-button")],Ln.prototype,"actionButton",void 0),Wn([function(t){return(o,e)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}]`:":not([name])");return E(0,0,{get(){const o=this.renderRoot?.querySelector(n),e=o?.assignedElements(t)??[];return void 0===r?e:e.filter((t=>t.matches(r)))}})}}({slot:"toggle"})],Ln.prototype,"customToggle",void 0),Wn([C({type:Boolean})],Ln.prototype,"primary",void 0),Wn([C({type:Boolean})],Ln.prototype,"secondary",void 0),Wn([C({type:Boolean})],Ln.prototype,"tertiary",void 0),Wn([C({type:Boolean})],Ln.prototype,"neutral",void 0),Wn([C({type:Boolean})],Ln.prototype,"small",void 0),Wn([C()],Ln.prototype,"label",void 0),Wn([C()],Ln.prototype,"tooltipPosition",void 0),Wn([C()],Ln.prototype,"iconVariant",void 0),Wn([C()],Ln.prototype,"icon",void 0),Wn([C()],Ln.prototype,"text",void 0),Wn([C()],Ln.prototype,"horizontalAlignment",void 0),Wn([C()],Ln.prototype,"verticalAlignment",void 0),Wn([C({type:Boolean})],Ln.prototype,"disabled",void 0),Wn([W([])],Ln.prototype,"closeMenuMatchers",void 0);class Kn extends Ln{}Kn.elementDefinitions={"ft-or-ftds-button":Sn},Kn.styles=te;class zn extends Ln{}zn.elementDefinitions={"ft-or-ftds-button":$n},zn.styles=te;const Fn={color:vo.extend("--ft-floating-menu-label-color","",Ro.colorOnSurfaceMedium)},Zn=xt`
|
|
1045
|
+
.ft-floating-menu-label {
|
|
1046
|
+
padding: 4px 8px;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.ft-floating-menu-label ft-typography {
|
|
1050
|
+
flex-shrink: 1;
|
|
1051
|
+
flex-grow: 1;
|
|
1052
|
+
width: max-content;
|
|
1053
|
+
text-overflow: ellipsis;
|
|
1054
|
+
overflow: hidden;
|
|
1055
|
+
color: ${Fn.color}
|
|
1056
|
+
}
|
|
1057
|
+
`;class Bn extends Fo{render(){return oo`
|
|
1058
|
+
<div class="ft-floating-menu-label">
|
|
1059
|
+
<ft-typography variant="caption">
|
|
1060
|
+
<slot></slot>
|
|
1061
|
+
</ft-typography>
|
|
1062
|
+
</div>
|
|
1063
|
+
`}}Bn.elementDefinitions={"ft-typography":Qi},Bn.styles=Zn,I("ft-floating-menu")(Kn),I("ftds-floating-menu")(zn),I("ft-floating-menu-item")(In),I("ft-floating-menu-label")(Bn),t.FtFloatingMenu=Kn,t.FtFloatingMenuCssVariables=Qo,t.FtFloatingMenuItem=In,t.FtFloatingMenuItemCssVariables=Rn,t.FtFloatingMenuItemSelect=kn,t.FtFloatingMenuLabel=Bn,t.FtFloatingMenuLabelCssVariables=Fn,t.FtdsFloatingMenu=zn,t.itemStyles=En,t.labelStyles=Zn,t.styles=te}({});
|
package/build/index.d.ts
CHANGED
|
@@ -7,3 +7,6 @@ export * from "./ftds-floating-menu";
|
|
|
7
7
|
export * from "./ft-floating-menu-item.css";
|
|
8
8
|
export * from "./ft-floating-menu-item.properties";
|
|
9
9
|
export * from "./ft-floating-menu-item";
|
|
10
|
+
export * from "./ft-floating-menu-label.css";
|
|
11
|
+
export * from "./ft-floating-menu-label.properties";
|
|
12
|
+
export * from "./ft-floating-menu-label";
|
package/build/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
|
2
2
|
import { FtFloatingMenu } from "./ft-floating-menu";
|
|
3
3
|
import { FtFloatingMenuItem } from "./ft-floating-menu-item";
|
|
4
4
|
import { FtdsFloatingMenu } from "./ftds-floating-menu";
|
|
5
|
+
import { FtFloatingMenuLabel } from "./ft-floating-menu-label";
|
|
5
6
|
export * from "./ft-base-floating-menu.properties";
|
|
6
7
|
export * from "./ft-floating-menu.css";
|
|
7
8
|
export * from "./ft-floating-menu.properties";
|
|
@@ -11,6 +12,10 @@ export * from "./ftds-floating-menu";
|
|
|
11
12
|
export * from "./ft-floating-menu-item.css";
|
|
12
13
|
export * from "./ft-floating-menu-item.properties";
|
|
13
14
|
export * from "./ft-floating-menu-item";
|
|
15
|
+
export * from "./ft-floating-menu-label.css";
|
|
16
|
+
export * from "./ft-floating-menu-label.properties";
|
|
17
|
+
export * from "./ft-floating-menu-label";
|
|
14
18
|
customElement("ft-floating-menu")(FtFloatingMenu);
|
|
15
19
|
customElement("ftds-floating-menu")(FtdsFloatingMenu);
|
|
16
20
|
customElement("ft-floating-menu-item")(FtFloatingMenuItem);
|
|
21
|
+
customElement("ft-floating-menu-label")(FtFloatingMenuLabel);
|
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.13",
|
|
4
4
|
"description": "Floating menu component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@floating-ui/dom": "1.5.3",
|
|
23
|
-
"@fluid-topics/ft-button": "1.1.
|
|
24
|
-
"@fluid-topics/ft-icon": "1.1.
|
|
25
|
-
"@fluid-topics/ft-ripple": "1.1.
|
|
26
|
-
"@fluid-topics/ft-typography": "1.1.
|
|
27
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
23
|
+
"@fluid-topics/ft-button": "1.1.13",
|
|
24
|
+
"@fluid-topics/ft-icon": "1.1.13",
|
|
25
|
+
"@fluid-topics/ft-ripple": "1.1.13",
|
|
26
|
+
"@fluid-topics/ft-typography": "1.1.13",
|
|
27
|
+
"@fluid-topics/ft-wc-utils": "1.1.13",
|
|
28
28
|
"lit": "3.1.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "6678af642af51eb1590bccbeeb0de8cbc5938ab1"
|
|
31
31
|
}
|