@fluid-topics/ft-search-bar 0.1.5 → 0.1.6
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-search-bar.min.js +1 -1
- package/package.json +13 -13
|
@@ -684,7 +684,7 @@ class Ar extends vt{constructor(t){if(super(t),this.it=M,t.type!==mt)throw Error
|
|
|
684
684
|
height: ${Pr};
|
|
685
685
|
text-align: center;
|
|
686
686
|
}
|
|
687
|
-
`]}getTemplate(){return
|
|
687
|
+
`]}getTemplate(){return N`
|
|
688
688
|
<slot @slotchange=${()=>this.requestUpdate()} hidden></slot>
|
|
689
689
|
<i class="ft-icon ${"ft-icon--"+this.variant}">${Nr(this.getIcon())}</i>
|
|
690
690
|
`}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:""}getIcon(){var t,e;return this.variant===Ir.file_format?null!==(t=Mr[this.textContent.toUpperCase()])&&void 0!==t?t:this.textContent:null!==(e=jr[this.textContent.toUpperCase()])&&void 0!==e?e:this.textContent}};Kr.elementDefinitions={},Ur([nt()],Kr.prototype,"variant",void 0),Ur([lt("slot")],Kr.prototype,"slottedContent",void 0),Kr=Ur([Ct("ft-icon")],Kr);var qr=function(t,e,i,r){for(var o,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,c=t.length-1;c>=0;c--)(o=t[c])&&(a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};const Gr=Rt.create("--ft-accordion-toggle-horizontal-spacing","SIZE","16px"),Xr=Rt.create("--ft-accordion-toggle-vertical-spacing","SIZE","16px"),Jr=Rt.external(Ft.colorOutline,"Design system");let Yr=class extends Tt{constructor(){super(...arguments),this.icon="",this.label="",this.active=!1}getStyles(){return a`.ft-accordion-item{display:flex;flex-direction:column}.ft-accordion-item--toggle{flex-shrink:0;flex-grow:0;position:relative;display:flex;align-items:center;cursor:pointer;padding:${Xr};${Gr}gap:calc(${Gr} / 2);outline:0}.ft-accordion-item--label{flex-grow:1;flex-shrink:1;display:block}.ft-accordion-item--content{box-sizing:border-box;flex-shrink:1;flex-grow:1;overflow:hidden;height:0}.ft-accordion-item--active .ft-accordion-item--content{height:initial;overflow:visible;padding:${Xr};${Gr}}.ft-accordion-item--separator{border-bottom:1px solid ${Jr}}`}getTemplate(){return N`<div class="ft-accordion-item ${this.active?"ft-accordion-item--active":""}"><div class="ft-accordion-item--toggle" part="toggle" @click="${()=>this.active=!this.active}" @keydown="${this.onToggleKeyDown}" tabindex="0"><ft-ripple part="toggle-ripple"></ft-ripple>${this.icon?N`<mwc-icon>${this.icon}</mwc-icon>`:null} ${this.label?N`<ft-typography class="ft-accordion-item--label" variant="body1" part="label">${this.label}</ft-typography>`:N`<slot class="ft-accordion-item--label" name="toggle" part="label"></slot>`}<mwc-icon>${this.active?"expand_less":"expand_more"}</mwc-icon></div><div class="ft-accordion-item--content" part="content" @focusin="${()=>this.active=!0}"><slot></slot></div><div class="ft-accordion-item--separator" part="separator"></div></div>`}update(t){super.update(t),t.has("active")&&this.active&&this.dispatchEvent(new Event("activated",{composed:!0,bubbles:!0}))}onToggleKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.active=!this.active)}};Yr.elementDefinitions={"ft-ripple":Fi,"ft-typography":qe,"mwc-icon":Ai},qr([nt({type:String})],Yr.prototype,"icon",void 0),qr([nt({type:String})],Yr.prototype,"label",void 0),qr([nt({type:Boolean,reflect:!0})],Yr.prototype,"active",void 0),Yr=qr([Ct("ft-accordion-item")],Yr);var Qr=function(t,e,i,r){for(var o,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,c=t.length-1;c>=0;c--)(o=t[c])&&(a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};let to=class extends Tt{constructor(){super(...arguments),this.multi=!1}getStyles(){return a`.ft-accordion{box-sizing:border-box}`}getTemplate(){return N`<div class="ft-accordion"><slot @activated="${this.onChange}"></slot></div>`}onChange(t){t.stopPropagation(),this.multi||this.content.assignedElements().forEach((e=>e.active=e===t.target))}};to.elementDefinitions={},Qr([nt({type:Boolean})],to.prototype,"multi",void 0),Qr([lt("slot")],to.prototype,"content",void 0),to=Qr([Ct("ft-accordion")],to);var eo=function(t,e,i,r){for(var o,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,c=t.length-1;c>=0;c--)(o=t[c])&&(a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};const io=Rt.extend("--ft-chip-color",Ft.colorOnSurface),ro={backgroundColor:Rt.extend("--ft-chip-background-color",Ft.colorSurface),color:io,fontSize:Rt.extend("--ft-chip-font-size",$e.fontSize),iconSize:Rt.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:Rt.extend("--ft-chip-ripple-color",io),horizontalPadding:Rt.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:Rt.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:Rt.external(Ft.colorOutline,"Design system"),opacityDisabled:Rt.external(Ft.colorOpacityDisabled,"Design system")},oo=Rt.extend("--ft-chip-highlighted-color",Rt.extend("--ft-chip-color",Ft.colorOnPrimary)),no={backgroundColor:Rt.extend("--ft-chip-highlighted-background-color",Rt.extend("--ft-chip-background-color",Ft.colorPrimary)),color:oo,rippleColor:Rt.extend("--ft-chip-highlighted-ripple-color",oo)},ao=Rt.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),co=Rt.create("--ft-chip-dense-vertical-padding","SIZE","4px");class so extends CustomEvent{constructor(){super("icon-click")}}let lo=class extends Tt{constructor(){super(...arguments),this.highlighted=!1,this.removable=!1,this.disabled=!1,this.clickable=!1,this.iconClickable=!1,this.dense=!1,this.multiLine=!1,this.label="",this.icon=void 0,this.trailingIcon=!1}getStyles(){return[At,a`:host{display:inline-block;max-width:100%}.ft-chip{position:relative;display:flex;justify-content:center;align-items:center;width:100%;overflow:hidden;box-sizing:border-box;--ft-chip-internal-font-size:${ro.fontSize}--ft-chip-internal-line-height:max(20px, calc(var(--ft-chip-internal-font-size) + 2px));--mdc-icon-size:${ro.iconSize}--ft-chip-internal-vertical-padding:${ro.verticalPadding}--ft-chip-internal-horizontal-padding:${ro.horizontalPadding}--ft-chip-internal-icon-padding:3px;--ft-chip-internal-content-height:max(var(--ft-chip-internal-line-height), var(--mdc-icon-size));border:1px solid ${ro.colorOutline};color:${ro.color};${Bt(Bi.color,ro.rippleColor)}border-radius:calc(var(--ft-chip-internal-content-height)/ 2 + var(--ft-chip-internal-vertical-padding));padding:calc(var(--ft-chip-internal-vertical-padding) - 1px) calc(var(--ft-chip-internal-horizontal-padding) - 1px);background-color:${ro.backgroundColor};line-height:var(--ft-chip-internal-content-height)}.ft-chip--dense{--ft-chip-internal-icon-padding:3px;--ft-chip-internal-vertical-padding:${co}--ft-chip-internal-horizontal-padding:${ao}--ft-chip-internal-line-height:max(16px, calc(var(--ft-chip-internal-font-size) + 2px))}.ft-chip--no-content{--ft-chip-internal-horizontal-padding:var(--ft-chip-horizontal-padding, var(--ft-chip-internal-vertical-padding))}.ft-chip--disabled{cursor:default;pointer-events:none;filter:grayscale(1);opacity:${ro.opacityDisabled}}.ft-chip--highlighted{border:none;padding:var(--ft-chip-internal-vertical-padding) var(--ft-chip-internal-horizontal-padding);background-color:${no.backgroundColor};${Bt(Bi.color,no.rippleColor)}color:${no.color}}.ft-chip--clickable{cursor:pointer;-webkit-mask-image:radial-gradient(white,#000)}.ft-chip:focus{outline:0}.ft-chip--icon-container{display:inline-flex;position:relative;overflow:hidden;border-radius:100%;justify-content:center;align-items:center;flex-shrink:0;padding:var(--ft-chip-internal-icon-padding);margin:calc((-1) * var(--ft-chip-internal-icon-padding))}.ft-chip--label{display:block;margin:0 var(--ft-chip-internal-horizontal-padding);${Bt($e.lineHeight,"var(--ft-chip-internal-content-height)")}}.ft-chip--safari-fix .ft-chip--label{margin-right:0}.ft-chip:not(.ft-chip--multi-line) .ft-chip--label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ft-chip--safari-fix:not(.ft-chip--multi-line) .ft-chip--label:after{content:"\\0000a0";display:inline-block;width:0}.ft-chip--no-content .ft-chip--label{display:none}.ft-chip--no-content .ft-chip--label+.ft-chip--icon-container{width:var(--ft-chip-internal-content-height);height:var(--ft-chip-internal-content-height)}.ft-chip--icon-container:focus{outline:0}.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-container{order:-1}`]}getTemplate(){const t={"ft-chip":!0,"ft-chip--highlighted":this.highlighted,"ft-chip--disabled":this.disabled,"ft-chip--clickable":this.interactionsOnChip,"ft-chip--trailing-icon":this.trailingIcon||this.removable,"ft-chip--no-content":!this.hasTextContent(),"ft-chip--dense":this.dense,"ft-chip--multi-line":this.multiLine,"ft-chip--safari-fix":Dt};return N`<div class="${Ot(t)}" aria-label="${this.getLabel()}" tabindex="${this.interactionsOnChip?0:-1}" @keyup="${this.onKeyUp}"><ft-ripple ?disabled="${!this.interactionsOnChip}"></ft-ripple><ft-typography variant="body2" element="span" class="ft-chip--label"><slot @slotchange="${this.onSlotchange}"></slot></ft-typography>${this.internalIcon?this.renderIcon():null}</div>`}get interactionsOnChip(){return this.clickable&&!this.disabled}get interactionsOnIcon(){return(this.iconClickable||this.removable)&&!this.disabled}renderIcon(){return N`<div class="ft-chip--icon-container ft-no-text-select ${this.interactionsOnIcon?"ft-chip--clickable":""}" tabindex="${this.interactionsOnIcon?0:-1}" @click="${this.onIconClick}" @keyup="${this.onIconKeyUp}"><ft-ripple ?disabled="${!this.interactionsOnIcon}"></ft-ripple><mwc-icon>${this.internalIcon}</mwc-icon></div>`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new so))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new so))}getLabel(){return this.label||this.textContent}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:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}get internalIcon(){return this.icon||(this.removable?"cancel":void 0)}};lo.elementDefinitions={"ft-ripple":Fi,"ft-typography":qe,"mwc-icon":Ai},eo([nt({type:Boolean})],lo.prototype,"highlighted",void 0),eo([nt({type:Boolean})],lo.prototype,"removable",void 0),eo([nt({type:Boolean})],lo.prototype,"disabled",void 0),eo([nt({type:Boolean})],lo.prototype,"clickable",void 0),eo([nt({type:Boolean})],lo.prototype,"iconClickable",void 0),eo([nt({type:Boolean})],lo.prototype,"dense",void 0),eo([nt({type:Boolean})],lo.prototype,"multiLine",void 0),eo([nt({type:String})],lo.prototype,"label",void 0),eo([nt({type:String})],lo.prototype,"icon",void 0),eo([nt({type:Boolean})],lo.prototype,"trailingIcon",void 0),eo([lt("ft-typography slot")],lo.prototype,"slottedContent",void 0),lo=eo([Ct("ft-chip")],lo);var po=function(t,e,i,r){for(var o,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,c=t.length-1;c>=0;c--)(o=t[c])&&(a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};const ho={fontSize:Rt.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:Rt.create("--ft-input-label-raised-font-size","SIZE","11px"),verticalSpacing:Rt.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:Rt.create("--ft-input-label-horizontal-spacing","SIZE","12px"),borderColor:Rt.extend("--ft-input-label-border-color",Ft.colorOutline),textColor:Rt.extend("--ft-input-label-text-color",Ft.colorOnSurfaceMedium),disabledTextColor:Rt.extend("--ft-input-label-disabled-text-color",Ft.colorOnSurfaceDisabled),borderRadiusS:Rt.external(Ft.borderRadiusS,"Design system")};let fo=class extends Tt{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1}getStyles(){return[Ve,a`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-bar",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Search bar component using Fluid Topics public API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-accordion": "^0.1.
|
|
23
|
-
"@fluid-topics/ft-button": "^0.1.
|
|
24
|
-
"@fluid-topics/ft-chip": "^0.1.
|
|
25
|
-
"@fluid-topics/ft-filter": "^0.1.
|
|
26
|
-
"@fluid-topics/ft-icon": "^0.1.
|
|
27
|
-
"@fluid-topics/ft-select": "^0.1.
|
|
28
|
-
"@fluid-topics/ft-size-watcher": "^0.1.
|
|
29
|
-
"@fluid-topics/ft-snap-scroll": "^0.1.
|
|
30
|
-
"@fluid-topics/ft-tooltip": "^0.1.
|
|
31
|
-
"@fluid-topics/ft-typography": "^0.1.
|
|
32
|
-
"@fluid-topics/ft-wc-utils": "^0.1.
|
|
22
|
+
"@fluid-topics/ft-accordion": "^0.1.6",
|
|
23
|
+
"@fluid-topics/ft-button": "^0.1.6",
|
|
24
|
+
"@fluid-topics/ft-chip": "^0.1.6",
|
|
25
|
+
"@fluid-topics/ft-filter": "^0.1.6",
|
|
26
|
+
"@fluid-topics/ft-icon": "^0.1.6",
|
|
27
|
+
"@fluid-topics/ft-select": "^0.1.6",
|
|
28
|
+
"@fluid-topics/ft-size-watcher": "^0.1.6",
|
|
29
|
+
"@fluid-topics/ft-snap-scroll": "^0.1.6",
|
|
30
|
+
"@fluid-topics/ft-tooltip": "^0.1.6",
|
|
31
|
+
"@fluid-topics/ft-typography": "^0.1.6",
|
|
32
|
+
"@fluid-topics/ft-wc-utils": "^0.1.6",
|
|
33
33
|
"@material/mwc-icon": "^0.25.3",
|
|
34
34
|
"lit": "^2.0.2"
|
|
35
35
|
},
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@fluid-topics/public-api": "^1.0.14"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "c441937eb1375dc40ff477dec50b917f2adf3b38"
|
|
43
43
|
}
|