@fluid-topics/ft-select 1.0.1 → 1.0.4
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-select.js +1 -0
- package/build/ft-select.light.js +2 -2
- package/build/ft-select.min.js +2 -2
- package/package.json +7 -7
package/build/ft-select.js
CHANGED
|
@@ -153,6 +153,7 @@ class FtSelect extends FtLitElement {
|
|
|
153
153
|
}
|
|
154
154
|
contentAvailableCallback(props) {
|
|
155
155
|
var _a, _b;
|
|
156
|
+
super.contentAvailableCallback(props);
|
|
156
157
|
if (props.has("focusOptions") && this.focusOptions) {
|
|
157
158
|
(_b = ((_a = this.selectedOptionElement) !== null && _a !== void 0 ? _a : this.firstOption)) === null || _b === void 0 ? void 0 : _b.focus();
|
|
158
159
|
this.focusOptions = false;
|
package/build/ft-select.light.js
CHANGED
|
@@ -350,7 +350,7 @@ const G=Symbol.for(""),H=t=>{if((null==t?void 0:t.r)===G)return null==t?void 0:t
|
|
|
350
350
|
<div class="ft-ripple--background"></div>
|
|
351
351
|
<div class="ft-ripple--effect"></div>
|
|
352
352
|
</div>
|
|
353
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>{var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}))}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}ze.elementDefinitions={},ze.styles=me,ke([o.property({type:Boolean})],ze.prototype,"primary",void 0),ke([o.property({type:Boolean})],ze.prototype,"secondary",void 0),ke([o.property({type:Boolean})],ze.prototype,"unbounded",void 0),ke([o.property({type:Boolean})],ze.prototype,"activated",void 0),ke([o.property({type:Boolean})],ze.prototype,"selected",void 0),ke([o.property({type:Boolean})],ze.prototype,"disabled",void 0),ke([o.state()],ze.prototype,"hovered",void 0),ke([o.state()],ze.prototype,"focused",void 0),ke([o.state()],ze.prototype,"pressed",void 0),ke([o.state()],ze.prototype,"rippling",void 0),ke([o.state()],ze.prototype,"rippleSize",void 0),ke([o.state()],ze.prototype,"originX",void 0),ke([o.state()],ze.prototype,"originY",void 0),ke([o.query(".ft-ripple")],ze.prototype,"ripple",void 0),ke([o.query(".ft-ripple--effect")],ze.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(ze),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.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=""}($e||($e={})),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=""}(we||(we={})),new Map([...["abw"].map((t=>[t,we.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,we.AUDIO])),...["avi"].map((t=>[t,we.AVI])),...["chm","xhs"].map((t=>[t,we.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,we.CODE])),...["csv"].map((t=>[t,we.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,we.DITA])),...["epub"].map((t=>[t,we.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,we.EXCEL])),...["flac"].map((t=>[t,we.FLAC])),...["gif"].map((t=>[t,we.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,we.GZIP])),...["html","htm","xhtml"].map((t=>[t,we.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,we.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,we.JPEG])),...["json"].map((t=>[t,we.JSON])),...["m4a","m4p"].map((t=>[t,we.M4A])),...["mov","qt"].map((t=>[t,we.MOV])),...["mp3"].map((t=>[t,we.MP3])),...["mp4","m4v"].map((t=>[t,we.MP4])),...["ogg","oga"].map((t=>[t,we.OGG])),...["pdf","ps"].map((t=>[t,we.PDF])),...["png"].map((t=>[t,we.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,we.POWERPOINT])),...["rar"].map((t=>[t,we.RAR])),...["stp"].map((t=>[t,we.STP])),...["txt","rtf","md","mdown"].map((t=>[t,we.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,we.VIDEO])),...["wav"].map((t=>[t,we.WAV])),...["wma"].map((t=>[t,we.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,we.WORD])),...["xml","xsl","rdf"].map((t=>[t,we.XML])),...["yaml","yml","x-yaml"].map((t=>[t,we.YAML])),...["zip"].map((t=>[t,we.ZIP]))]);const Se=e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),Oe=e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),Ee=e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),je=e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),Ne=e.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset"),Ce=i.css`
|
|
353
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:i),this.setRippleSize()}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}ze.elementDefinitions={},ze.styles=me,ke([o.property({type:Boolean})],ze.prototype,"primary",void 0),ke([o.property({type:Boolean})],ze.prototype,"secondary",void 0),ke([o.property({type:Boolean})],ze.prototype,"unbounded",void 0),ke([o.property({type:Boolean})],ze.prototype,"activated",void 0),ke([o.property({type:Boolean})],ze.prototype,"selected",void 0),ke([o.property({type:Boolean})],ze.prototype,"disabled",void 0),ke([o.state()],ze.prototype,"hovered",void 0),ke([o.state()],ze.prototype,"focused",void 0),ke([o.state()],ze.prototype,"pressed",void 0),ke([o.state()],ze.prototype,"rippling",void 0),ke([o.state()],ze.prototype,"rippleSize",void 0),ke([o.state()],ze.prototype,"originX",void 0),ke([o.state()],ze.prototype,"originY",void 0),ke([o.query(".ft-ripple")],ze.prototype,"ripple",void 0),ke([o.query(".ft-ripple--effect")],ze.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(ze),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.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=""}($e||($e={})),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=""}(we||(we={})),new Map([...["abw"].map((t=>[t,we.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,we.AUDIO])),...["avi"].map((t=>[t,we.AVI])),...["chm","xhs"].map((t=>[t,we.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,we.CODE])),...["csv"].map((t=>[t,we.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,we.DITA])),...["epub"].map((t=>[t,we.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,we.EXCEL])),...["flac"].map((t=>[t,we.FLAC])),...["gif"].map((t=>[t,we.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,we.GZIP])),...["html","htm","xhtml"].map((t=>[t,we.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,we.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,we.JPEG])),...["json"].map((t=>[t,we.JSON])),...["m4a","m4p"].map((t=>[t,we.M4A])),...["mov","qt"].map((t=>[t,we.MOV])),...["mp3"].map((t=>[t,we.MP3])),...["mp4","m4v"].map((t=>[t,we.MP4])),...["ogg","oga"].map((t=>[t,we.OGG])),...["pdf","ps"].map((t=>[t,we.PDF])),...["png"].map((t=>[t,we.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,we.POWERPOINT])),...["rar"].map((t=>[t,we.RAR])),...["stp"].map((t=>[t,we.STP])),...["txt","rtf","md","mdown"].map((t=>[t,we.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,we.VIDEO])),...["wav"].map((t=>[t,we.WAV])),...["wma"].map((t=>[t,we.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,we.WORD])),...["xml","xsl","rdf"].map((t=>[t,we.XML])),...["yaml","yml","x-yaml"].map((t=>[t,we.YAML])),...["zip"].map((t=>[t,we.ZIP]))]);const Se=e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),Oe=e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),Ee=e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),je=e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),Ne=e.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset"),Ce=i.css`
|
|
354
354
|
:host, i.ft-icon {
|
|
355
355
|
display: inline-flex;
|
|
356
356
|
align-items: center;
|
|
@@ -600,4 +600,4 @@ const G=Symbol.for(""),H=t=>{if((null==t?void 0:t.r)===G)return null==t?void 0:t
|
|
|
600
600
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
601
601
|
<span>${t.label}</span>
|
|
602
602
|
</div>
|
|
603
|
-
`}updated(t){super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,l;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(l=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==l?l:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){var i,o;if(!e.deepEqual(null===(i=this.selectedOption)||void 0===i?void 0:i.value,t.value)){this.selectedOption=t;for(let e of this.options)e.selected=e===t;this.dispatchEvent(new CustomEvent("change",{detail:null===(o=this.selectedOption)||void 0===o?void 0:o.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Ue.elementDefinitions={"ft-input-label":he,"ft-typography":re,"ft-ripple":ze,"ft-icon":De},Ue.styles=[te,ee,Me],Be([o.property({type:String})],Ue.prototype,"label",void 0),Be([o.property({type:String})],Ue.prototype,"helper",void 0),Be([o.property({type:Boolean})],Ue.prototype,"outlined",void 0),Be([o.property({type:Boolean})],Ue.prototype,"disabled",void 0),Be([o.property({type:Boolean})],Ue.prototype,"error",void 0),Be([o.property({type:Boolean})],Ue.prototype,"fixedMenuPosition",void 0),Be([o.property({type:Array})],Ue.prototype,"options",void 0),Be([o.state()],Ue.prototype,"selectedOption",void 0),Be([o.state()],Ue.prototype,"optionsDisplayed",void 0),Be([o.state()],Ue.prototype,"focusOptions",void 0),Be([o.query(".ft-select")],Ue.prototype,"container",void 0),Be([o.query(".ft-select--options")],Ue.prototype,"optionsMenu",void 0),Be([o.query(".ft-select--input-panel")],Ue.prototype,"mainPanel",void 0),Be([o.query(".ft-select--option:first-child")],Ue.prototype,"firstOption",void 0),Be([o.query(".ft-select--option:focus")],Ue.prototype,"focusedOption",void 0),Be([o.query(".ft-select--option.ft-select--option-selected")],Ue.prototype,"selectedOptionElement",void 0),Be([o.query(".ft-select--option:last-child")],Ue.prototype,"lastOption",void 0),Be([o.query("slot")],Ue.prototype,"optionsSlot",void 0),e.customElement("ft-select")(Ue),e.customElement("ft-select-option")(Ze),t.FtSelect=Ue,t.FtSelectCssVariables=_e,t.FtSelectOption=Ze,t.styles=Me}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML);
|
|
603
|
+
`}updated(t){super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;super.contentAvailableCallback(t),t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,l;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(l=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==l?l:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){var i,o;if(!e.deepEqual(null===(i=this.selectedOption)||void 0===i?void 0:i.value,t.value)){this.selectedOption=t;for(let e of this.options)e.selected=e===t;this.dispatchEvent(new CustomEvent("change",{detail:null===(o=this.selectedOption)||void 0===o?void 0:o.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Ue.elementDefinitions={"ft-input-label":he,"ft-typography":re,"ft-ripple":ze,"ft-icon":De},Ue.styles=[te,ee,Me],Be([o.property({type:String})],Ue.prototype,"label",void 0),Be([o.property({type:String})],Ue.prototype,"helper",void 0),Be([o.property({type:Boolean})],Ue.prototype,"outlined",void 0),Be([o.property({type:Boolean})],Ue.prototype,"disabled",void 0),Be([o.property({type:Boolean})],Ue.prototype,"error",void 0),Be([o.property({type:Boolean})],Ue.prototype,"fixedMenuPosition",void 0),Be([o.property({type:Array})],Ue.prototype,"options",void 0),Be([o.state()],Ue.prototype,"selectedOption",void 0),Be([o.state()],Ue.prototype,"optionsDisplayed",void 0),Be([o.state()],Ue.prototype,"focusOptions",void 0),Be([o.query(".ft-select")],Ue.prototype,"container",void 0),Be([o.query(".ft-select--options")],Ue.prototype,"optionsMenu",void 0),Be([o.query(".ft-select--input-panel")],Ue.prototype,"mainPanel",void 0),Be([o.query(".ft-select--option:first-child")],Ue.prototype,"firstOption",void 0),Be([o.query(".ft-select--option:focus")],Ue.prototype,"focusedOption",void 0),Be([o.query(".ft-select--option.ft-select--option-selected")],Ue.prototype,"selectedOptionElement",void 0),Be([o.query(".ft-select--option:last-child")],Ue.prototype,"lastOption",void 0),Be([o.query("slot")],Ue.prototype,"optionsSlot",void 0),e.customElement("ft-select")(Ue),e.customElement("ft-select-option")(Ze),t.FtSelect=Ue,t.FtSelectCssVariables=_e,t.FtSelectOption=Ze,t.styles=Me}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML);
|
package/build/ft-select.min.js
CHANGED
|
@@ -451,7 +451,7 @@ const Ct=1,Mt=2,Rt=t=>(...e)=>({_$litDirective$:t,values:e});class Ut{constructo
|
|
|
451
451
|
<div class="ft-ripple--background"></div>
|
|
452
452
|
<div class="ft-ripple--effect"></div>
|
|
453
453
|
</div>
|
|
454
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>{var t;const
|
|
454
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:i),this.setRippleSize()}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}gi.elementDefinitions={},gi.styles=vi,bi([o({type:Boolean})],gi.prototype,"primary",void 0),bi([o({type:Boolean})],gi.prototype,"secondary",void 0),bi([o({type:Boolean})],gi.prototype,"unbounded",void 0),bi([o({type:Boolean})],gi.prototype,"activated",void 0),bi([o({type:Boolean})],gi.prototype,"selected",void 0),bi([o({type:Boolean})],gi.prototype,"disabled",void 0),bi([s()],gi.prototype,"hovered",void 0),bi([s()],gi.prototype,"focused",void 0),bi([s()],gi.prototype,"pressed",void 0),bi([s()],gi.prototype,"rippling",void 0),bi([s()],gi.prototype,"rippleSize",void 0),bi([s()],gi.prototype,"originX",void 0),bi([s()],gi.prototype,"originY",void 0),bi([n(".ft-ripple")],gi.prototype,"ripple",void 0),bi([n(".ft-ripple--effect")],gi.prototype,"rippleEffect",void 0),a("ft-ripple")(gi);
|
|
455
455
|
/**
|
|
456
456
|
* @license
|
|
457
457
|
* Copyright 2017 Google LLC
|
|
@@ -707,4 +707,4 @@ class mi extends Ut{constructor(t){if(super(t),this.et=X,t.type!==Mt)throw Error
|
|
|
707
707
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
708
708
|
<span>${t.label}</span>
|
|
709
709
|
</div>
|
|
710
|
-
`}updated(t){super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,n;let r;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),r=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),r=null!==(n=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.firstOption}null==r||r.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){var e,i;if(!l(null===(e=this.selectedOption)||void 0===e?void 0:e.value,t.value)){this.selectedOption=t;for(let e of this.options)e.selected=e===t;this.dispatchEvent(new CustomEvent("change",{detail:null===(i=this.selectedOption)||void 0===i?void 0:i.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Bi.elementDefinitions={"ft-input-label":ai,"ft-typography":si,"ft-ripple":gi,"ft-icon":zi},Bi.styles=[Ye,Ge,Fi],Ai([o({type:String})],Bi.prototype,"label",void 0),Ai([o({type:String})],Bi.prototype,"helper",void 0),Ai([o({type:Boolean})],Bi.prototype,"outlined",void 0),Ai([o({type:Boolean})],Bi.prototype,"disabled",void 0),Ai([o({type:Boolean})],Bi.prototype,"error",void 0),Ai([o({type:Boolean})],Bi.prototype,"fixedMenuPosition",void 0),Ai([o({type:Array})],Bi.prototype,"options",void 0),Ai([s()],Bi.prototype,"selectedOption",void 0),Ai([s()],Bi.prototype,"optionsDisplayed",void 0),Ai([s()],Bi.prototype,"focusOptions",void 0),Ai([n(".ft-select")],Bi.prototype,"container",void 0),Ai([n(".ft-select--options")],Bi.prototype,"optionsMenu",void 0),Ai([n(".ft-select--input-panel")],Bi.prototype,"mainPanel",void 0),Ai([n(".ft-select--option:first-child")],Bi.prototype,"firstOption",void 0),Ai([n(".ft-select--option:focus")],Bi.prototype,"focusedOption",void 0),Ai([n(".ft-select--option.ft-select--option-selected")],Bi.prototype,"selectedOptionElement",void 0),Ai([n(".ft-select--option:last-child")],Bi.prototype,"lastOption",void 0),Ai([n("slot")],Bi.prototype,"optionsSlot",void 0),a("ft-select")(Bi),a("ft-select-option")(Di),t.FtSelect=Bi,t.FtSelectCssVariables=ji,t.FtSelectOption=Di,t.styles=Fi}({});
|
|
710
|
+
`}updated(t){super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;super.contentAvailableCallback(t),t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,n;let r;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),r=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),r=null!==(n=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.firstOption}null==r||r.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){var e,i;if(!l(null===(e=this.selectedOption)||void 0===e?void 0:e.value,t.value)){this.selectedOption=t;for(let e of this.options)e.selected=e===t;this.dispatchEvent(new CustomEvent("change",{detail:null===(i=this.selectedOption)||void 0===i?void 0:i.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Bi.elementDefinitions={"ft-input-label":ai,"ft-typography":si,"ft-ripple":gi,"ft-icon":zi},Bi.styles=[Ye,Ge,Fi],Ai([o({type:String})],Bi.prototype,"label",void 0),Ai([o({type:String})],Bi.prototype,"helper",void 0),Ai([o({type:Boolean})],Bi.prototype,"outlined",void 0),Ai([o({type:Boolean})],Bi.prototype,"disabled",void 0),Ai([o({type:Boolean})],Bi.prototype,"error",void 0),Ai([o({type:Boolean})],Bi.prototype,"fixedMenuPosition",void 0),Ai([o({type:Array})],Bi.prototype,"options",void 0),Ai([s()],Bi.prototype,"selectedOption",void 0),Ai([s()],Bi.prototype,"optionsDisplayed",void 0),Ai([s()],Bi.prototype,"focusOptions",void 0),Ai([n(".ft-select")],Bi.prototype,"container",void 0),Ai([n(".ft-select--options")],Bi.prototype,"optionsMenu",void 0),Ai([n(".ft-select--input-panel")],Bi.prototype,"mainPanel",void 0),Ai([n(".ft-select--option:first-child")],Bi.prototype,"firstOption",void 0),Ai([n(".ft-select--option:focus")],Bi.prototype,"focusedOption",void 0),Ai([n(".ft-select--option.ft-select--option-selected")],Bi.prototype,"selectedOptionElement",void 0),Ai([n(".ft-select--option:last-child")],Bi.prototype,"lastOption",void 0),Ai([n("slot")],Bi.prototype,"optionsSlot",void 0),a("ft-select")(Bi),a("ft-select-option")(Di),t.FtSelect=Bi,t.FtSelectCssVariables=ji,t.FtSelectOption=Di,t.styles=Fi}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-select",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Value selector for a predefined list of choices",
|
|
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-input-label": "1.0.
|
|
24
|
-
"@fluid-topics/ft-ripple": "1.0.
|
|
25
|
-
"@fluid-topics/ft-typography": "1.0.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.0.
|
|
22
|
+
"@fluid-topics/ft-icon": "1.0.4",
|
|
23
|
+
"@fluid-topics/ft-input-label": "1.0.4",
|
|
24
|
+
"@fluid-topics/ft-ripple": "1.0.4",
|
|
25
|
+
"@fluid-topics/ft-typography": "1.0.4",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.0.4",
|
|
27
27
|
"lit": "2.7.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "73efa63448237c9b05c59823cd70ee3bc019995e"
|
|
30
30
|
}
|