@fluid-topics/ft-switch 1.0.20 → 1.0.22
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.
|
@@ -47,7 +47,7 @@ export const optionStyles = css `
|
|
|
47
47
|
position: relative;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.ft-switch-option--
|
|
50
|
+
.ft-switch-option--selected .ft-switch-option--content:before {
|
|
51
51
|
background-color: ${FtSwitchCssVariables.selectedBackgroundColor};
|
|
52
52
|
border-radius: ${FtSwitchOptionCssVariables.borderRadiusLeft} ${FtSwitchOptionCssVariables.borderRadiusRight} ${FtSwitchOptionCssVariables.borderRadiusRight} ${FtSwitchOptionCssVariables.borderRadiusLeft};
|
|
53
53
|
position: absolute;
|
|
@@ -68,7 +68,7 @@ export const optionStyles = css `
|
|
|
68
68
|
${setVariable(FtTypographyButtonCssVariables.lineHeight, "var(--ft-switch-option-internal-content-height)")}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.ft-switch-option--
|
|
71
|
+
.ft-switch-option--selected .ft-switch-option--label {
|
|
72
72
|
color: ${FtSwitchCssVariables.selectedTextColor};
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -93,7 +93,7 @@ export const optionStyles = css `
|
|
|
93
93
|
color: ${FtSwitchCssVariables.iconColor};
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
.ft-switch-option--
|
|
96
|
+
.ft-switch-option--selected ft-icon {
|
|
97
97
|
color: ${FtSwitchCssVariables.selectedTextColor};
|
|
98
98
|
}
|
|
99
99
|
`;
|
|
@@ -40,13 +40,14 @@ class FtSwitchOption extends FtLitElement {
|
|
|
40
40
|
render() {
|
|
41
41
|
const classes = {
|
|
42
42
|
"ft-switch-option": true,
|
|
43
|
-
"ft-switch-option--trailing-icon": this.trailingIcon
|
|
43
|
+
"ft-switch-option--trailing-icon": this.trailingIcon,
|
|
44
|
+
"ft-switch-option--selected": this.selected,
|
|
44
45
|
};
|
|
45
46
|
return this.addTooltip(html `
|
|
47
|
+
<input id="input" type="radio" class="ft-switch-option--input"
|
|
48
|
+
.checked=${this.selected}>
|
|
46
49
|
<label part="label" for="input" class=${classMap(classes)}
|
|
47
50
|
@click=${this.onChange}>
|
|
48
|
-
<input id="input" type="radio" class="ft-switch-option--input"
|
|
49
|
-
.checked=${this.selected}>
|
|
50
51
|
<div class="ft-switch-option--content">
|
|
51
52
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
52
53
|
<ft-typography part="text"
|
package/build/ft-switch.js
CHANGED
package/build/ft-switch.light.js
CHANGED
|
@@ -263,7 +263,7 @@ const tt=Symbol.for(""),it=t=>{if((null==t?void 0:t.r)===tt)return null==t?void
|
|
|
263
263
|
</div>
|
|
264
264
|
</div>
|
|
265
265
|
</div>
|
|
266
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((i=>t.has(i)))&&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();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.validPosition){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=4-i.left);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${ji})`}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())}}Fi.elementDefinitions={"ft-typography":wi},Fi.styles=Ni,Ii([o.property()],Fi.prototype,"text",void 0),Ii([o.property({type:Boolean})],Fi.prototype,"manual",void 0),Ii([o.property({type:Boolean})],Fi.prototype,"inline",void 0),Ii([o.property({type:Number})],Fi.prototype,"delay",void 0),Ii([o.property()],Fi.prototype,"position",void 0),Ii([o.queryAssignedNodes("",!0)],Fi.prototype,"slotNodes",void 0),Ii([o.query(".ft-tooltip--container")],Fi.prototype,"container",void 0),Ii([o.query("slot")],Fi.prototype,"target",void 0),Ii([o.query(".ft-tooltip")],Fi.prototype,"tooltip",void 0),Ii([o.query(".ft-tooltip--content")],Fi.prototype,"tooltipContent",void 0),Ii([o.state()],Fi.prototype,"visible",void 0),i.customElement("ft-tooltip")(Fi),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",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.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",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=""}(Ai||(Ai={})),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=""}(Ei||(Ei={})),new Map([...["abw"].map((t=>[t,Ei.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,Ei.AUDIO])),...["avi"].map((t=>[t,Ei.AVI])),...["chm","xhs"].map((t=>[t,Ei.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,Ei.CODE])),...["csv"].map((t=>[t,Ei.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ei.DITA])),...["epub"].map((t=>[t,Ei.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ei.EXCEL])),...["flac"].map((t=>[t,Ei.FLAC])),...["gif"].map((t=>[t,Ei.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ei.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ei.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,Ei.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ei.JPEG])),...["json"].map((t=>[t,Ei.JSON])),...["m4a","m4p"].map((t=>[t,Ei.M4A])),...["mov","qt"].map((t=>[t,Ei.MOV])),...["mp3"].map((t=>[t,Ei.MP3])),...["mp4","m4v"].map((t=>[t,Ei.MP4])),...["ogg","oga"].map((t=>[t,Ei.OGG])),...["pdf","ps"].map((t=>[t,Ei.PDF])),...["png"].map((t=>[t,Ei.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ei.POWERPOINT])),...["rar"].map((t=>[t,Ei.RAR])),...["stp"].map((t=>[t,Ei.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ei.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,Ei.VIDEO])),...["wav"].map((t=>[t,Ei.WAV])),...["wma"].map((t=>[t,Ei.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ei.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ei.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ei.YAML])),...["zip"].map((t=>[t,Ei.ZIP]))]);const Ri={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},_i=e.css`
|
|
266
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((i=>t.has(i)))&&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();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.validPosition){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=4-i.left);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${ji})`}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())}}Fi.elementDefinitions={"ft-typography":wi},Fi.styles=Ni,Ii([o.property()],Fi.prototype,"text",void 0),Ii([o.property({type:Boolean})],Fi.prototype,"manual",void 0),Ii([o.property({type:Boolean})],Fi.prototype,"inline",void 0),Ii([o.property({type:Number})],Fi.prototype,"delay",void 0),Ii([o.property()],Fi.prototype,"position",void 0),Ii([o.queryAssignedNodes("",!0)],Fi.prototype,"slotNodes",void 0),Ii([o.query(".ft-tooltip--container")],Fi.prototype,"container",void 0),Ii([o.query("slot")],Fi.prototype,"target",void 0),Ii([o.query(".ft-tooltip")],Fi.prototype,"tooltip",void 0),Ii([o.query(".ft-tooltip--content")],Fi.prototype,"tooltipContent",void 0),Ii([o.state()],Fi.prototype,"visible",void 0),i.customElement("ft-tooltip")(Fi),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",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_BAR_STACKED="",t.CHART_HEATMAP="",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.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",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=""}(Ai||(Ai={})),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=""}(Ei||(Ei={})),new Map([...["abw"].map((t=>[t,Ei.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,Ei.AUDIO])),...["avi"].map((t=>[t,Ei.AVI])),...["chm","xhs"].map((t=>[t,Ei.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,Ei.CODE])),...["csv"].map((t=>[t,Ei.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ei.DITA])),...["epub"].map((t=>[t,Ei.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ei.EXCEL])),...["flac"].map((t=>[t,Ei.FLAC])),...["gif"].map((t=>[t,Ei.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ei.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ei.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,Ei.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ei.JPEG])),...["json"].map((t=>[t,Ei.JSON])),...["m4a","m4p"].map((t=>[t,Ei.M4A])),...["mov","qt"].map((t=>[t,Ei.MOV])),...["mp3"].map((t=>[t,Ei.MP3])),...["mp4","m4v"].map((t=>[t,Ei.MP4])),...["ogg","oga"].map((t=>[t,Ei.OGG])),...["pdf","ps"].map((t=>[t,Ei.PDF])),...["png"].map((t=>[t,Ei.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ei.POWERPOINT])),...["rar"].map((t=>[t,Ei.RAR])),...["stp"].map((t=>[t,Ei.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ei.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,Ei.VIDEO])),...["wav"].map((t=>[t,Ei.WAV])),...["wma"].map((t=>[t,Ei.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ei.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ei.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ei.YAML])),...["zip"].map((t=>[t,Ei.ZIP]))]);const Ri={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},_i=e.css`
|
|
267
267
|
:host, i.ft-icon {
|
|
268
268
|
display: inline-flex;
|
|
269
269
|
align-items: center;
|
|
@@ -351,7 +351,7 @@ const tt=Symbol.for(""),it=t=>{if((null==t?void 0:t.r)===tt)return null==t?void
|
|
|
351
351
|
position: relative;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
-
.ft-switch-option--
|
|
354
|
+
.ft-switch-option--selected .ft-switch-option--content:before {
|
|
355
355
|
background-color: ${Mi.selectedBackgroundColor};
|
|
356
356
|
border-radius: ${Wi.borderRadiusLeft} ${Wi.borderRadiusRight} ${Wi.borderRadiusRight} ${Wi.borderRadiusLeft};
|
|
357
357
|
position: absolute;
|
|
@@ -372,7 +372,7 @@ const tt=Symbol.for(""),it=t=>{if((null==t?void 0:t.r)===tt)return null==t?void
|
|
|
372
372
|
${i.setVariable(hi.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
-
.ft-switch-option--
|
|
375
|
+
.ft-switch-option--selected .ft-switch-option--label {
|
|
376
376
|
color: ${Mi.selectedTextColor};
|
|
377
377
|
}
|
|
378
378
|
|
|
@@ -397,14 +397,14 @@ const tt=Symbol.for(""),it=t=>{if((null==t?void 0:t.r)===tt)return null==t?void
|
|
|
397
397
|
color: ${Mi.iconColor};
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
.ft-switch-option--
|
|
400
|
+
.ft-switch-option--selected ft-icon {
|
|
401
401
|
color: ${Mi.selectedTextColor};
|
|
402
402
|
}
|
|
403
|
-
`;var Di=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ki extends CustomEvent{constructor(){super("option-change",{bubbles:!0,composed:!0})}}class Li extends i.FtLitElement{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Ki)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(e.html`
|
|
403
|
+
`;var Di=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ki extends CustomEvent{constructor(){super("option-change",{bubbles:!0,composed:!0})}}class Li extends i.FtLitElement{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Ki)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon,"ft-switch-option--selected":this.selected};return this.addTooltip(e.html`
|
|
404
|
+
<input id="input" type="radio" class="ft-switch-option--input"
|
|
405
|
+
.checked=${this.selected}>
|
|
404
406
|
<label part="label" for="input" class=${s.classMap(t)}
|
|
405
407
|
@click=${this.onChange}>
|
|
406
|
-
<input id="input" type="radio" class="ft-switch-option--input"
|
|
407
|
-
.checked=${this.selected}>
|
|
408
408
|
<div class="ft-switch-option--content">
|
|
409
409
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
410
410
|
<ft-typography part="text"
|
|
@@ -429,7 +429,7 @@ const tt=Symbol.for(""),it=t=>{if((null==t?void 0:t.r)===tt)return null==t?void
|
|
|
429
429
|
<slot @slotchange=${this.onSlotchange}
|
|
430
430
|
@option-change=${this.onOptionChange}></slot>
|
|
431
431
|
</div>
|
|
432
|
-
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof Li&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChange(t){t.stopPropagation();let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t
|
|
432
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof Li&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChange(t){t.stopPropagation();let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t===this.selectedOption}))}}Pi.elementDefinitions={},Pi.styles=e.css`
|
|
433
433
|
:host {
|
|
434
434
|
display: inline-block;
|
|
435
435
|
}
|
package/build/ft-switch.min.js
CHANGED
|
@@ -381,7 +381,7 @@ function(t,i,e){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:i},
|
|
|
381
381
|
* Copyright 2017 Google LLC
|
|
382
382
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
383
383
|
*/
|
|
384
|
-
class ke extends zt{constructor(t){if(super(t),this.et=Y,t.type!==jt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Y||null==t)return this.ft=void 0,this.et=t;if(t===X)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const i=[t];return i.raw=i,this.ft={_$litType$:this.constructor.resultType,strings:i,values:[]}}}ke.directiveName="unsafeHTML",ke.resultType=1;const Ce=Ft(ke);var Ne,Ee;!function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",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.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",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=""}(Ne||(Ne={})),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=""}(Ee||(Ee={})),new Map([...["abw"].map((t=>[t,Ee.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,Ee.AUDIO])),...["avi"].map((t=>[t,Ee.AVI])),...["chm","xhs"].map((t=>[t,Ee.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,Ee.CODE])),...["csv"].map((t=>[t,Ee.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ee.DITA])),...["epub"].map((t=>[t,Ee.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ee.EXCEL])),...["flac"].map((t=>[t,Ee.FLAC])),...["gif"].map((t=>[t,Ee.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ee.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ee.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,Ee.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ee.JPEG])),...["json"].map((t=>[t,Ee.JSON])),...["m4a","m4p"].map((t=>[t,Ee.M4A])),...["mov","qt"].map((t=>[t,Ee.MOV])),...["mp3"].map((t=>[t,Ee.MP3])),...["mp4","m4v"].map((t=>[t,Ee.MP4])),...["ogg","oga"].map((t=>[t,Ee.OGG])),...["pdf","ps"].map((t=>[t,Ee.PDF])),...["png"].map((t=>[t,Ee.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ee.POWERPOINT])),...["rar"].map((t=>[t,Ee.RAR])),...["stp"].map((t=>[t,Ee.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ee.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,Ee.VIDEO])),...["wav"].map((t=>[t,Ee.WAV])),...["wma"].map((t=>[t,Ee.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ee.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ee.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ee.YAML])),...["zip"].map((t=>[t,Ee.ZIP]))]);const Re={size:vt.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:vt.extend("--ft-icon-fluid-topics-font-family",vt.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:vt.extend("--ft-icon-file-format-font-family",vt.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:vt.extend("--ft-icon-material-font-family",vt.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:vt.create("--ft-icon-vertical-align","UNKNOWN","unset")},Me=x`
|
|
384
|
+
class ke extends zt{constructor(t){if(super(t),this.et=Y,t.type!==jt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Y||null==t)return this.ft=void 0,this.et=t;if(t===X)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const i=[t];return i.raw=i,this.ft={_$litType$:this.constructor.resultType,strings:i,values:[]}}}ke.directiveName="unsafeHTML",ke.resultType=1;const Ce=Ft(ke);var Ne,Ee;!function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",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_BAR_STACKED="",t.CHART_HEATMAP="",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.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",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=""}(Ne||(Ne={})),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=""}(Ee||(Ee={})),new Map([...["abw"].map((t=>[t,Ee.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,Ee.AUDIO])),...["avi"].map((t=>[t,Ee.AVI])),...["chm","xhs"].map((t=>[t,Ee.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,Ee.CODE])),...["csv"].map((t=>[t,Ee.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ee.DITA])),...["epub"].map((t=>[t,Ee.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ee.EXCEL])),...["flac"].map((t=>[t,Ee.FLAC])),...["gif"].map((t=>[t,Ee.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ee.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ee.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,Ee.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ee.JPEG])),...["json"].map((t=>[t,Ee.JSON])),...["m4a","m4p"].map((t=>[t,Ee.M4A])),...["mov","qt"].map((t=>[t,Ee.MOV])),...["mp3"].map((t=>[t,Ee.MP3])),...["mp4","m4v"].map((t=>[t,Ee.MP4])),...["ogg","oga"].map((t=>[t,Ee.OGG])),...["pdf","ps"].map((t=>[t,Ee.PDF])),...["png"].map((t=>[t,Ee.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ee.POWERPOINT])),...["rar"].map((t=>[t,Ee.RAR])),...["stp"].map((t=>[t,Ee.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ee.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,Ee.VIDEO])),...["wav"].map((t=>[t,Ee.WAV])),...["wma"].map((t=>[t,Ee.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ee.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ee.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ee.YAML])),...["zip"].map((t=>[t,Ee.ZIP]))]);const Re={size:vt.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:vt.extend("--ft-icon-fluid-topics-font-family",vt.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:vt.extend("--ft-icon-file-format-font-family",vt.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:vt.extend("--ft-icon-material-font-family",vt.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:vt.create("--ft-icon-vertical-align","UNKNOWN","unset")},Me=x`
|
|
385
385
|
:host, i.ft-icon {
|
|
386
386
|
display: inline-flex;
|
|
387
387
|
align-items: center;
|
|
@@ -469,7 +469,7 @@ class ke extends zt{constructor(t){if(super(t),this.et=Y,t.type!==jt)throw Error
|
|
|
469
469
|
position: relative;
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
-
.ft-switch-option--
|
|
472
|
+
.ft-switch-option--selected .ft-switch-option--content:before {
|
|
473
473
|
background-color: ${ze.selectedBackgroundColor};
|
|
474
474
|
border-radius: ${Ae.borderRadiusLeft} ${Ae.borderRadiusRight} ${Ae.borderRadiusRight} ${Ae.borderRadiusLeft};
|
|
475
475
|
position: absolute;
|
|
@@ -490,7 +490,7 @@ class ke extends zt{constructor(t){if(super(t),this.et=Y,t.type!==jt)throw Error
|
|
|
490
490
|
${xt(ee.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
491
491
|
}
|
|
492
492
|
|
|
493
|
-
.ft-switch-option--
|
|
493
|
+
.ft-switch-option--selected .ft-switch-option--label {
|
|
494
494
|
color: ${ze.selectedTextColor};
|
|
495
495
|
}
|
|
496
496
|
|
|
@@ -515,14 +515,14 @@ class ke extends zt{constructor(t){if(super(t),this.et=Y,t.type!==jt)throw Error
|
|
|
515
515
|
color: ${ze.iconColor};
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
-
.ft-switch-option--
|
|
518
|
+
.ft-switch-option--selected ft-icon {
|
|
519
519
|
color: ${ze.selectedTextColor};
|
|
520
520
|
}
|
|
521
|
-
`;var Be=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Te extends CustomEvent{constructor(){super("option-change",{bubbles:!0,composed:!0})}}class Pe extends kt{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Te)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(q`
|
|
521
|
+
`;var Be=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Te extends CustomEvent{constructor(){super("option-change",{bubbles:!0,composed:!0})}}class Pe extends kt{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Te)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon,"ft-switch-option--selected":this.selected};return this.addTooltip(q`
|
|
522
|
+
<input id="input" type="radio" class="ft-switch-option--input"
|
|
523
|
+
.checked=${this.selected}>
|
|
522
524
|
<label part="label" for="input" class=${At(t)}
|
|
523
525
|
@click=${this.onChange}>
|
|
524
|
-
<input id="input" type="radio" class="ft-switch-option--input"
|
|
525
|
-
.checked=${this.selected}>
|
|
526
526
|
<div class="ft-switch-option--content">
|
|
527
527
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
528
528
|
<ft-typography part="text"
|
|
@@ -547,7 +547,7 @@ class ke extends zt{constructor(t){if(super(t),this.et=Y,t.type!==jt)throw Error
|
|
|
547
547
|
<slot @slotchange=${this.onSlotchange}
|
|
548
548
|
@option-change=${this.onOptionChange}></slot>
|
|
549
549
|
</div>
|
|
550
|
-
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof Pe&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChange(t){t.stopPropagation();let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t
|
|
550
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof Pe&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChange(t){t.stopPropagation();let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t===this.selectedOption}))}}De.elementDefinitions={},De.styles=x`
|
|
551
551
|
:host {
|
|
552
552
|
display: inline-block;
|
|
553
553
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-switch",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "two-state",
|
|
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-icon": "1.0.
|
|
23
|
-
"@fluid-topics/ft-ripple": "1.0.
|
|
24
|
-
"@fluid-topics/ft-tooltip": "1.0.
|
|
25
|
-
"@fluid-topics/ft-typography": "1.0.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.0.
|
|
22
|
+
"@fluid-topics/ft-icon": "1.0.22",
|
|
23
|
+
"@fluid-topics/ft-ripple": "1.0.22",
|
|
24
|
+
"@fluid-topics/ft-tooltip": "1.0.22",
|
|
25
|
+
"@fluid-topics/ft-typography": "1.0.22",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.0.22",
|
|
27
27
|
"lit": "2.7.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "d68f9748c223f9e8eb8da2da4f410e02a2121d36"
|
|
30
30
|
}
|