@fluid-topics/ft-select 0.3.57 → 0.3.60
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.light.js +4 -4
- package/build/ft-select.min.js +12 -11
- package/package.json +7 -7
package/build/ft-select.light.js
CHANGED
|
@@ -396,12 +396,12 @@ const K=Symbol.for(""),F=t=>{if((null==t?void 0:t.r)===K)return null==t?void 0:t
|
|
|
396
396
|
.ft-icon--material {
|
|
397
397
|
font-family: ${Oe}, "Material Icons", sans-serif;
|
|
398
398
|
}
|
|
399
|
-
`;var Ne;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Ne||(Ne={}));var Ce=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class Ie extends e.FtLitElement{constructor(){super(...arguments),this.
|
|
400
|
-
<i class="ft-icon ${"ft-icon--"+
|
|
399
|
+
`;var Ne;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Ne||(Ne={}));var Ce=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class Ie extends e.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=i.nothing}render(){var t;const e=null!==(t=this.variant)&&void 0!==t?t:Ne.fluid_topics,o="material"!==e||this.value;return i.html`
|
|
400
|
+
<i class="ft-icon ${"ft-icon--"+e}">
|
|
401
401
|
${n.unsafeHTML(this.resolvedIcon)}
|
|
402
|
-
<slot ?hidden=${
|
|
402
|
+
<slot ?hidden=${o}></slot>
|
|
403
403
|
</i>
|
|
404
|
-
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case Ne.file_format:this.resolvedIcon=null!==(t=me[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Ne.
|
|
404
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case Ne.file_format:this.resolvedIcon=null!==(t=me[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Ne.material:this.resolvedIcon=this.value||i.nothing;break;default:this.resolvedIcon=null!==(e=ve[o.replace("-","_").toUpperCase()])&&void 0!==e?e:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}Ie.elementDefinitions={},Ie.styles=je,Ce([o.property()],Ie.prototype,"variant",void 0),Ce([o.property()],Ie.prototype,"value",void 0),Ce([o.state()],Ie.prototype,"resolvedIcon",void 0),Ce([o.query("slot")],Ie.prototype,"slottedContent",void 0),e.customElement("ft-icon")(Ie);const Ae={labelSize:e.FtCssVariableFactory.create("--ft-select-label-size","SIZE","11px"),selectedOptionSize:e.FtCssVariableFactory.create("--ft-select-selected-option-size","SIZE","14px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-select-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-select-horizontal-spacing","SIZE","16px"),optionsHeight:e.FtCssVariableFactory.create("--ft-select-options-height","SIZE","unset"),selectedOptionColor:e.FtCssVariableFactory.extend("--ft-select-selected-option-color",e.designSystemVariables.colorOnSurface),helperColor:e.FtCssVariableFactory.extend("--ft-select-helper-color",e.designSystemVariables.colorOnSurfaceMedium),optionsColor:e.FtCssVariableFactory.extend("--ft-select-options-color",e.designSystemVariables.colorOnSurface),optionsZIndex:e.FtCssVariableFactory.create("--ft-select-options-z-index","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},De=i.css`
|
|
405
405
|
*:focus {
|
|
406
406
|
outline: none;
|
|
407
407
|
}
|
package/build/ft-select.min.js
CHANGED
|
@@ -40,12 +40,13 @@ function n(t,e){return(({finisher:t,descriptor:e})=>(i,o)=>{var s;if(void 0===o)
|
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2021 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/var r;
|
|
43
|
+
*/var r;function l(t,e){try{return function(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var i,o,s;if(Array.isArray(t)){if((i=t.length)!=e.length)return!1;for(o=i;0!=o--;)if(!l(t[o],e[o]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o of t.entries())if(!e.has(o[0]))return!1;for(o of t.entries())if(!l(o[1],e.get(o[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o of t.entries())if(!e.has(o[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if((i=(s=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(o=i;0!=o--;)if(!Object.prototype.hasOwnProperty.call(e,s[o]))return!1;for(o=i;0!=o--;){var n=s[o];if(!l(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}(t,e)}catch(t){return!1}}null===(r=window.HTMLSlotElement)||void 0===r||r.prototype.assignedElements;const a=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)};
|
|
44
44
|
/**
|
|
45
45
|
* @license
|
|
46
46
|
* Copyright 2019 Google LLC
|
|
47
47
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
|
-
*/
|
|
48
|
+
*/
|
|
49
|
+
const p=window,c=p.ShadowRoot&&(void 0===p.ShadyCSS||p.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,h=Symbol(),f=new WeakMap;class d{constructor(t,e,i){if(this._$cssResult$=!0,i!==h)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(c&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=f.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&f.set(e,t))}return t}toString(){return this.cssText}}const u=t=>new d("string"==typeof t?t:t+"",void 0,h),y=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new d(i,t,h)},x=(t,e)=>{c?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=p.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,t.appendChild(i)}))},v=c?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return u(e)})(t):t
|
|
49
50
|
/**
|
|
50
51
|
* @license
|
|
51
52
|
* Copyright 2017 Google LLC
|
|
@@ -72,7 +73,7 @@ var ct,ht;class ft extends E{constructor(){super(...arguments),this.renderOption
|
|
|
72
73
|
<style>${t}</style>
|
|
73
74
|
`))}
|
|
74
75
|
${this.getTemplate()}
|
|
75
|
-
`}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var e,i;if((null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==i?i:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this.exportpartsDebouncer.run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,i,o,s,n,r;const l=t=>null!=t&&t.trim().length>0,a=t.filter(l).map((t=>t.trim()));if(0===a.length)return void this.removeAttribute("exportparts");const p=new Set;for(let t of null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==i?i:[]){const e=null!==(s=null===(o=t.getAttribute("part"))||void 0===o?void 0:o.split(" "))&&void 0!==s?s:[],i=null!==(r=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==r?r:[];new Array(...e,...i).filter(l).map((t=>t.trim())).forEach((t=>p.add(t)))}if(0===p.size)return void this.removeAttribute("exportparts");const c=[...p.values()].flatMap((t=>a.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...c].join(", "))}}gt([o()],mt.prototype,"exportpartsPrefix",void 0),gt([function(t,e){const i=()=>JSON.parse(JSON.stringify(t));return o({type:Object,converter:{fromAttribute:t=>{if(null==t)return i();try{return JSON.parse(t)}catch{return i()}},toAttribute:t=>JSON.stringify(t)},...null!=e?e:{}})}([])],mt.prototype,"exportpartsPrefixes",void 0),gt([o()],mt.prototype,"customStylesheet",void 0),y`
|
|
76
|
+
`}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var e,i;if((null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==i?i:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this.exportpartsDebouncer.run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,i,o,s,n,r;const l=t=>null!=t&&t.trim().length>0,a=t.filter(l).map((t=>t.trim()));if(0===a.length)return void this.removeAttribute("exportparts");const p=new Set;for(let t of null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==i?i:[]){const e=null!==(s=null===(o=t.getAttribute("part"))||void 0===o?void 0:o.split(" "))&&void 0!==s?s:[],i=null!==(r=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==r?r:[];new Array(...e,...i).filter(l).map((t=>t.trim())).forEach((t=>p.add(t)))}if(0===p.size)return void this.removeAttribute("exportparts");const c=[...p.values()].flatMap((t=>a.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...c].join(", "))}}gt([o()],mt.prototype,"exportpartsPrefix",void 0),gt([function(t,e){const i=()=>JSON.parse(JSON.stringify(t));return o({type:Object,converter:{fromAttribute:t=>{if(null==t)return i();try{return JSON.parse(t)}catch{return i()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,e)=>!l(t,e),...null!=e?e:{}})}([])],mt.prototype,"exportpartsPrefixes",void 0),gt([o()],mt.prototype,"customStylesheet",void 0),y`
|
|
76
77
|
.ft-no-text-select {
|
|
77
78
|
-webkit-touch-callout: none;
|
|
78
79
|
-webkit-user-select: none;
|
|
@@ -222,7 +223,7 @@ const wt=1,$t=2,Ot=t=>(...e)=>({_$litDirective$:t,values:e});class St{constructo
|
|
|
222
223
|
</${Bt(this.element)}>
|
|
223
224
|
`:Pt`
|
|
224
225
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
225
|
-
`}}Ye.styles=[Le,_e,Te,Ie,We,He,Ke,Ze,Ve,Je,qe],Xe([o()],Ye.prototype,"element",void 0),Xe([o()],Ye.prototype,"variant",void 0),
|
|
226
|
+
`}}Ye.styles=[Le,_e,Te,Ie,We,He,Ke,Ze,Ve,Je,qe],Xe([o()],Ye.prototype,"element",void 0),Xe([o()],Ye.prototype,"variant",void 0),a("ft-typography")(Ye);const Ge={fontSize:ut.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:ut.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:ut.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:ut.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:ut.create("--ft-input-label-horizontal-spacing","SIZE","12px"),labelMaxWidth:ut.create("--ft-input-label-max-width","SIZE","100%"),borderColor:ut.extend("--ft-input-label-border-color",xt.colorOutline),textColor:ut.extend("--ft-input-label-text-color",xt.colorOnSurfaceMedium),disabledTextColor:ut.extend("--ft-input-label-disabled-text-color",xt.colorOnSurfaceDisabled),colorSurface:ut.external(xt.colorSurface,"Design system"),borderRadiusS:ut.external(xt.borderRadiusS,"Design system"),colorError:ut.external(xt.colorError,"Design system")},Qe=y`
|
|
226
227
|
.ft-input-label {
|
|
227
228
|
position: absolute;
|
|
228
229
|
inset: 0;
|
|
@@ -353,7 +354,7 @@ const wt=1,$t=2,Ot=t=>(...e)=>({_$litDirective$:t,values:e});class St{constructo
|
|
|
353
354
|
</div>
|
|
354
355
|
`:null}
|
|
355
356
|
</div>
|
|
356
|
-
`}}ei.elementDefinitions={},ei.styles=[Ke,Qe],ti([o({type:String})],ei.prototype,"text",void 0),ti([o({type:Boolean})],ei.prototype,"raised",void 0),ti([o({type:Boolean})],ei.prototype,"outlined",void 0),ti([o({type:Boolean})],ei.prototype,"disabled",void 0),ti([o({type:Boolean})],ei.prototype,"error",void 0),
|
|
357
|
+
`}}ei.elementDefinitions={},ei.styles=[Ke,Qe],ti([o({type:String})],ei.prototype,"text",void 0),ti([o({type:Boolean})],ei.prototype,"raised",void 0),ti([o({type:Boolean})],ei.prototype,"outlined",void 0),ti([o({type:Boolean})],ei.prototype,"disabled",void 0),ti([o({type:Boolean})],ei.prototype,"error",void 0),a("ft-input-label")(ei);const ii=ut.extend("--ft-ripple-color",xt.colorContent),oi={color:ii,backgroundColor:ut.extend("--ft-ripple-background-color",ii),opacityContentOnSurfacePressed:ut.external(xt.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:ut.external(xt.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:ut.external(xt.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:ut.external(xt.opacityContentOnSurfaceSelected,"Design system")},si=ut.extend("--ft-ripple-color",xt.colorPrimary),ni=si,ri=ut.extend("--ft-ripple-background-color",si),li=ut.extend("--ft-ripple-color",xt.colorSecondary),ai=li,pi=ut.extend("--ft-ripple-background-color",li),ci=y`
|
|
357
358
|
:host {
|
|
358
359
|
display: contents;
|
|
359
360
|
}
|
|
@@ -459,7 +460,7 @@ const wt=1,$t=2,Ot=t=>(...e)=>({_$litDirective$:t,values:e});class St{constructo
|
|
|
459
460
|
<div class="ft-ripple--background"></div>
|
|
460
461
|
<div class="ft-ripple--effect"></div>
|
|
461
462
|
</div>
|
|
462
|
-
`}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()}}fi.elementDefinitions={},fi.styles=ci,hi([o({type:Boolean})],fi.prototype,"primary",void 0),hi([o({type:Boolean})],fi.prototype,"secondary",void 0),hi([o({type:Boolean})],fi.prototype,"unbounded",void 0),hi([o({type:Boolean})],fi.prototype,"activated",void 0),hi([o({type:Boolean})],fi.prototype,"selected",void 0),hi([o({type:Boolean})],fi.prototype,"disabled",void 0),hi([s()],fi.prototype,"hovered",void 0),hi([s()],fi.prototype,"focused",void 0),hi([s()],fi.prototype,"pressed",void 0),hi([s()],fi.prototype,"rippling",void 0),hi([s()],fi.prototype,"rippleSize",void 0),hi([s()],fi.prototype,"originX",void 0),hi([s()],fi.prototype,"originY",void 0),hi([n(".ft-ripple")],fi.prototype,"ripple",void 0),hi([n(".ft-ripple--effect")],fi.prototype,"rippleEffect",void 0),
|
|
463
|
+
`}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()}}fi.elementDefinitions={},fi.styles=ci,hi([o({type:Boolean})],fi.prototype,"primary",void 0),hi([o({type:Boolean})],fi.prototype,"secondary",void 0),hi([o({type:Boolean})],fi.prototype,"unbounded",void 0),hi([o({type:Boolean})],fi.prototype,"activated",void 0),hi([o({type:Boolean})],fi.prototype,"selected",void 0),hi([o({type:Boolean})],fi.prototype,"disabled",void 0),hi([s()],fi.prototype,"hovered",void 0),hi([s()],fi.prototype,"focused",void 0),hi([s()],fi.prototype,"pressed",void 0),hi([s()],fi.prototype,"rippling",void 0),hi([s()],fi.prototype,"rippleSize",void 0),hi([s()],fi.prototype,"originX",void 0),hi([s()],fi.prototype,"originY",void 0),hi([n(".ft-ripple")],fi.prototype,"ripple",void 0),hi([n(".ft-ripple--effect")],fi.prototype,"rippleEffect",void 0),a("ft-ripple")(fi);
|
|
463
464
|
/**
|
|
464
465
|
* @license
|
|
465
466
|
* Copyright 2017 Google LLC
|
|
@@ -512,12 +513,12 @@ class di extends St{constructor(t){if(super(t),this.it=J,t.type!==$t)throw Error
|
|
|
512
513
|
.ft-icon--material {
|
|
513
514
|
font-family: ${mi}, "Material Icons", sans-serif;
|
|
514
515
|
}
|
|
515
|
-
`;var Oi;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Oi||(Oi={}));var Si=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ki extends mt{constructor(){super(...arguments),this.
|
|
516
|
-
<i class="ft-icon ${"ft-icon--"+
|
|
516
|
+
`;var Oi;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Oi||(Oi={}));var Si=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ki extends mt{constructor(){super(...arguments),this.resolvedIcon=J}render(){var t;const e=null!==(t=this.variant)&&void 0!==t?t:Oi.fluid_topics,i="material"!==e||this.value;return Z`
|
|
517
|
+
<i class="ft-icon ${"ft-icon--"+e}">
|
|
517
518
|
${ui(this.resolvedIcon)}
|
|
518
|
-
<slot ?hidden=${
|
|
519
|
+
<slot ?hidden=${i}></slot>
|
|
519
520
|
</i>
|
|
520
|
-
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let i=this.value||this.textContent;switch(this.variant){case Oi.file_format:this.resolvedIcon=null!==(t=xi[i.replace("-","_").toUpperCase()])&&void 0!==t?t:i;break;case Oi.
|
|
521
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let i=this.value||this.textContent;switch(this.variant){case Oi.file_format:this.resolvedIcon=null!==(t=xi[i.replace("-","_").toUpperCase()])&&void 0!==t?t:i;break;case Oi.material:this.resolvedIcon=this.value||J;break;default:this.resolvedIcon=null!==(e=yi[i.replace("-","_").toUpperCase()])&&void 0!==e?e:i}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}ki.elementDefinitions={},ki.styles=$i,Si([o()],ki.prototype,"variant",void 0),Si([o()],ki.prototype,"value",void 0),Si([s()],ki.prototype,"resolvedIcon",void 0),Si([n("slot")],ki.prototype,"slottedContent",void 0),a("ft-icon")(ki);const Ei={labelSize:ut.create("--ft-select-label-size","SIZE","11px"),selectedOptionSize:ut.create("--ft-select-selected-option-size","SIZE","14px"),verticalSpacing:ut.create("--ft-select-vertical-spacing","SIZE","4px"),horizontalSpacing:ut.create("--ft-select-horizontal-spacing","SIZE","16px"),optionsHeight:ut.create("--ft-select-options-height","SIZE","unset"),selectedOptionColor:ut.extend("--ft-select-selected-option-color",xt.colorOnSurface),helperColor:ut.extend("--ft-select-helper-color",xt.colorOnSurfaceMedium),optionsColor:ut.extend("--ft-select-options-color",xt.colorOnSurface),optionsZIndex:ut.create("--ft-select-options-z-index","NUMBER","3"),colorSurface:ut.external(xt.colorSurface,"Design system"),colorOnSurfaceDisabled:ut.external(xt.colorOnSurfaceDisabled,"Design system"),colorPrimary:ut.external(xt.colorPrimary,"Design system"),borderRadiusS:ut.external(xt.borderRadiusS,"Design system"),elevation02:ut.external(xt.elevation02,"Design system"),colorError:ut.external(xt.colorError,"Design system")},Ni=y`
|
|
521
522
|
*:focus {
|
|
522
523
|
outline: none;
|
|
523
524
|
}
|
|
@@ -714,4 +715,4 @@ class di extends St{constructor(t){if(super(t),this.it=J,t.type!==$t)throw Error
|
|
|
714
715
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
715
716
|
<span>${t.label}</span>
|
|
716
717
|
</div>
|
|
717
|
-
`}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(!
|
|
718
|
+
`}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)}}Ri.elementDefinitions={"ft-input-label":ei,"ft-typography":Ye,"ft-ripple":fi,"ft-icon":ki},Ri.styles=[He,Ke,Ni],Ci([o({type:String})],Ri.prototype,"label",void 0),Ci([o({type:String})],Ri.prototype,"helper",void 0),Ci([o({type:Boolean})],Ri.prototype,"outlined",void 0),Ci([o({type:Boolean})],Ri.prototype,"disabled",void 0),Ci([o({type:Boolean})],Ri.prototype,"error",void 0),Ci([o({type:Boolean})],Ri.prototype,"fixedMenuPosition",void 0),Ci([o({type:Array})],Ri.prototype,"options",void 0),Ci([s()],Ri.prototype,"selectedOption",void 0),Ci([s()],Ri.prototype,"optionsDisplayed",void 0),Ci([s()],Ri.prototype,"focusOptions",void 0),Ci([n(".ft-select")],Ri.prototype,"container",void 0),Ci([n(".ft-select--options")],Ri.prototype,"optionsMenu",void 0),Ci([n(".ft-select--input-panel")],Ri.prototype,"mainPanel",void 0),Ci([n(".ft-select--option:first-child")],Ri.prototype,"firstOption",void 0),Ci([n(".ft-select--option:focus")],Ri.prototype,"focusedOption",void 0),Ci([n(".ft-select--option.ft-select--option-selected")],Ri.prototype,"selectedOptionElement",void 0),Ci([n(".ft-select--option:last-child")],Ri.prototype,"lastOption",void 0),Ci([n("slot")],Ri.prototype,"optionsSlot",void 0),a("ft-select")(Ri),a("ft-select-option")(Mi),t.FtSelect=Ri,t.FtSelectCssVariables=Ei,t.FtSelectOption=Mi,t.styles=Ni,Object.defineProperty(t,"i",{value:!0})}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-select",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.60",
|
|
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": "0.3.
|
|
23
|
-
"@fluid-topics/ft-input-label": "0.3.
|
|
24
|
-
"@fluid-topics/ft-ripple": "0.3.
|
|
25
|
-
"@fluid-topics/ft-typography": "0.3.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-icon": "0.3.60",
|
|
23
|
+
"@fluid-topics/ft-input-label": "0.3.60",
|
|
24
|
+
"@fluid-topics/ft-ripple": "0.3.60",
|
|
25
|
+
"@fluid-topics/ft-typography": "0.3.60",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "0.3.60",
|
|
27
27
|
"lit": "2.2.8"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "43e7dcf7c9d88ea2c23f4425629f013d704c5111"
|
|
30
30
|
}
|