@fluid-topics/ft-search-bar 0.3.67 → 0.3.68
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.light.js +231 -220
- package/build/ft-search-bar.min.js +256 -245
- package/package.json +14 -14
|
@@ -413,7 +413,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
413
413
|
${n.unsafeHTML(this.resolvedIcon)}
|
|
414
414
|
<slot ?hidden=${o}></slot>
|
|
415
415
|
</i>
|
|
416
|
-
`}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 Ee.file_format:this.resolvedIcon=null!==(t=Se[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Ee.material:this.resolvedIcon=this.value||i.nothing;break;default:this.resolvedIcon=null!==(e=ke[o.replace("-","_").toUpperCase()])&&void 0!==e?e:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}De.elementDefinitions={},De.styles=Ce,Ie([o.property()],De.prototype,"variant",void 0),Ie([o.property()],De.prototype,"value",void 0),Ie([o.state()],De.prototype,"resolvedIcon",void 0),Ie([o.query("slot")],De.prototype,"slottedContent",void 0),e.customElement("ft-icon")(De);const Fe=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),Le={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:Fe,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",Zt.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",Fe),verticalPadding:e.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:e.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},je=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),Me={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:je,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",je)},Pe=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM)),Ae=[e.noTextSelect,i.css`
|
|
416
|
+
`}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 Ee.file_format:this.resolvedIcon=null!==(t=Se[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Ee.material:this.resolvedIcon=this.value||i.nothing;break;default:this.resolvedIcon=null!==(e=ke[o.replace("-","_").toUpperCase()])&&void 0!==e?e:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}De.elementDefinitions={},De.styles=Ce,Ie([o.property()],De.prototype,"variant",void 0),Ie([o.property()],De.prototype,"value",void 0),Ie([o.state()],De.prototype,"resolvedIcon",void 0),Ie([o.query("slot")],De.prototype,"slottedContent",void 0),e.customElement("ft-icon")(De);const Fe=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),Le={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:Fe,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",Zt.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",Fe),verticalPadding:e.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:e.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),iconPadding:e.FtCssVariableFactory.create("--ft-button-icon-padding","SIZE","8px"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},je=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),Me={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:je,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",je)},Pe=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM)),Ae=e.FtCssVariableFactory.create("--ft-button-dense-vertical-padding","SIZE","2px"),Ne=e.FtCssVariableFactory.create("--ft-button-dense-horizontal-padding","SIZE","4px"),Te=e.FtCssVariableFactory.create("--ft-button-dense-icon-padding","SIZE","4px"),Re=[e.noTextSelect,i.css`
|
|
417
417
|
:host {
|
|
418
418
|
display: inline-block;
|
|
419
419
|
max-width: 100%;
|
|
@@ -452,12 +452,11 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
452
452
|
box-sizing: border-box;
|
|
453
453
|
border: none;
|
|
454
454
|
pointer-events: auto;
|
|
455
|
+
gap: ${Le.iconPadding};
|
|
455
456
|
|
|
456
457
|
--ft-button-internal-line-height: calc(${Le.fontSize} + 2px);
|
|
457
458
|
--ft-button-internal-color: ${Le.color};
|
|
458
459
|
${e.setVariable(Be.size,Le.iconSize)};
|
|
459
|
-
--ft-button-internal-vertical-padding: 6px;
|
|
460
|
-
--ft-button-internal-horizontal-padding: 8px;
|
|
461
460
|
${e.setVariable(ne.color,Le.rippleColor)};
|
|
462
461
|
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Le.iconSize});
|
|
463
462
|
|
|
@@ -468,18 +467,31 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
468
467
|
-webkit-mask-image: radial-gradient(white, black);
|
|
469
468
|
}
|
|
470
469
|
|
|
470
|
+
.ft-button.ft-button--outlined {
|
|
471
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
472
|
+
padding: calc(${Le.verticalPadding} - 1px) calc(${Le.horizontalPadding} - 1px);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.ft-button.ft-button--dense {
|
|
476
|
+
padding: ${Ae} ${Ne};
|
|
477
|
+
border-radius: ${Pe};
|
|
478
|
+
gap: ${Te};
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.ft-button.ft-button--dense.ft-button--outlined {
|
|
482
|
+
padding: calc(${Ae} - 1px) calc(${Ne} - 1px);
|
|
483
|
+
}
|
|
484
|
+
|
|
471
485
|
.ft-button:not([disabled]):hover {
|
|
472
486
|
cursor: pointer;
|
|
473
487
|
}
|
|
474
488
|
|
|
475
|
-
.ft-button--
|
|
476
|
-
--ft-button-internal-
|
|
477
|
-
--ft-button-internal-horizontal-padding: 4px;
|
|
478
|
-
border-radius: ${Pe};
|
|
489
|
+
.ft-button--round {
|
|
490
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + ${Le.verticalPadding});
|
|
479
491
|
}
|
|
480
492
|
|
|
481
|
-
.ft-button--round {
|
|
482
|
-
border-radius: calc(var(--ft-button-internal-content-height) / 2 +
|
|
493
|
+
.ft-button--round.ft-button--dense {
|
|
494
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + ${Ae});
|
|
483
495
|
}
|
|
484
496
|
|
|
485
497
|
.ft-button[disabled] {
|
|
@@ -493,11 +505,6 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
493
505
|
${e.setVariable(ne.color,Me.rippleColor)};
|
|
494
506
|
}
|
|
495
507
|
|
|
496
|
-
.ft-button.ft-button--outlined {
|
|
497
|
-
border: 1px solid var(--ft-button-internal-color);
|
|
498
|
-
padding: calc(${Le.verticalPadding} - 1px) calc(${Le.horizontalPadding} - 1px);
|
|
499
|
-
}
|
|
500
|
-
|
|
501
508
|
.ft-button:focus {
|
|
502
509
|
outline: none;
|
|
503
510
|
}
|
|
@@ -508,7 +515,6 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
508
515
|
white-space: nowrap;
|
|
509
516
|
text-overflow: ellipsis;
|
|
510
517
|
display: block;
|
|
511
|
-
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
512
518
|
${e.setVariable(Zt.fontSize,"1em")};
|
|
513
519
|
${e.setVariable(Zt.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
514
520
|
}
|
|
@@ -523,8 +529,13 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
523
529
|
}
|
|
524
530
|
|
|
525
531
|
.ft-button--label[hidden] + ft-icon {
|
|
526
|
-
margin: 0 calc(
|
|
527
|
-
padding: 0
|
|
532
|
+
margin: 0 calc(${Le.horizontalPadding} * -1);
|
|
533
|
+
padding: 0 ${Le.verticalPadding};
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.ft-button--dense .ft-button--label[hidden] + ft-icon {
|
|
537
|
+
margin: 0 calc(${Ne} * -1);
|
|
538
|
+
padding: 0 ${Ae};
|
|
528
539
|
}
|
|
529
540
|
|
|
530
541
|
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
@@ -536,7 +547,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
536
547
|
${e.setVariable(me.size,Le.iconSize)};
|
|
537
548
|
${e.setVariable(me.color,"var(--ft-button-internal-color)")};
|
|
538
549
|
}
|
|
539
|
-
`];var
|
|
550
|
+
`];var Ze=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ue extends e.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ee.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(i.html`
|
|
540
551
|
<button part="button"
|
|
541
552
|
class="${r.classMap(t)}"
|
|
542
553
|
aria-label="${this.getLabel()}"
|
|
@@ -559,14 +570,14 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
559
570
|
</ft-tooltip>
|
|
560
571
|
`:t}resolveIcon(){return this.loading?i.html`
|
|
561
572
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?i.html`
|
|
562
|
-
<ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}
|
|
573
|
+
<ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Ue.elementDefinitions={"ft-ripple":be,"ft-tooltip":ye,"ft-typography":te,"ft-icon":De,"ft-loader":we},Ue.styles=[e.safariEllipsisFix,Re],Ze([o.property({type:String,reflect:!0})],Ue.prototype,"role",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"primary",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"outlined",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"disabled",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"dense",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"round",void 0),Ze([o.property({type:String})],Ue.prototype,"label",void 0),Ze([o.property({type:String})],Ue.prototype,"icon",void 0),Ze([o.property({type:String})],Ue.prototype,"iconVariant",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"trailingIcon",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"loading",void 0),Ze([o.property({type:String})],Ue.prototype,"tooltipPosition",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"hideTooltip",void 0),Ze([o.property({type:Boolean})],Ue.prototype,"forceTooltip",void 0),Ze([o.query(".ft-button")],Ue.prototype,"button",void 0),Ze([o.query(".ft-button--label slot")],Ue.prototype,"slottedContent",void 0),e.customElement("ft-button")(Ue);const _e=e.FtCssVariableFactory.extend("--ft-checkbox-text-color",e.designSystemVariables.colorOnSurfaceHigh),He=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Ve=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),Ke=e.FtCssVariableFactory.extend("--ft-checkbox-border-color",e.designSystemVariables.colorOnSurfaceMedium),qe=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),We=i.css`
|
|
563
574
|
* {
|
|
564
575
|
box-sizing: border-box;
|
|
565
576
|
}
|
|
566
577
|
|
|
567
578
|
.ft-checkbox {
|
|
568
579
|
box-sizing: border-box;
|
|
569
|
-
color: ${
|
|
580
|
+
color: ${_e};
|
|
570
581
|
|
|
571
582
|
display: inline-flex;
|
|
572
583
|
align-items: center;
|
|
@@ -574,7 +585,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
574
585
|
}
|
|
575
586
|
|
|
576
587
|
.ft-checkbox--disabled {
|
|
577
|
-
color: ${
|
|
588
|
+
color: ${qe};
|
|
578
589
|
}
|
|
579
590
|
|
|
580
591
|
input {
|
|
@@ -598,26 +609,26 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
598
609
|
|
|
599
610
|
.ft-checkbox--box {
|
|
600
611
|
display: flex;
|
|
601
|
-
border: 2px solid ${
|
|
612
|
+
border: 2px solid ${Ke};
|
|
602
613
|
border-radius: 2px;
|
|
603
614
|
|
|
604
615
|
width: 18px;
|
|
605
616
|
height: 18px;
|
|
606
617
|
|
|
607
|
-
color: ${
|
|
618
|
+
color: ${Ve};
|
|
608
619
|
}
|
|
609
620
|
|
|
610
621
|
|
|
611
622
|
.ft-checkbox--checked .ft-checkbox--box,
|
|
612
623
|
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
613
|
-
border-color: ${
|
|
614
|
-
background-color: ${
|
|
624
|
+
border-color: ${He};
|
|
625
|
+
background-color: ${He};
|
|
615
626
|
}
|
|
616
627
|
|
|
617
628
|
.ft-checkbox--disabled .ft-checkbox--box {
|
|
618
|
-
border-color: ${
|
|
629
|
+
border-color: ${qe};
|
|
619
630
|
background-color: transparent;
|
|
620
|
-
color: ${
|
|
631
|
+
color: ${qe};
|
|
621
632
|
}
|
|
622
633
|
|
|
623
634
|
.ft-checkbox--checkmark {
|
|
@@ -636,7 +647,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
636
647
|
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
637
648
|
opacity: 1;
|
|
638
649
|
}
|
|
639
|
-
`;var
|
|
650
|
+
`;var Ge=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Xe extends e.FtLitElement{constructor(){super(...arguments),this.name="",this.checked=!1,this.indeterminate=!1,this.disabled=!1}render(){const t={"ft-checkbox":!0,"ft-checkbox--checked":this.checked,"ft-checkbox--indeterminate":this.indeterminate,"ft-checkbox--disabled":this.disabled};return i.html`
|
|
640
651
|
<label class="${r.classMap(t)}" for="checkbox-input">
|
|
641
652
|
<div class="ft-checkbox--box-container">
|
|
642
653
|
<ft-ripple
|
|
@@ -662,14 +673,14 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
662
673
|
<slot></slot>
|
|
663
674
|
</ft-typography>
|
|
664
675
|
</label>
|
|
665
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}
|
|
676
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}Xe.elementDefinitions={"ft-ripple":be,"ft-typography":te},Xe.styles=We,Ge([o.property()],Xe.prototype,"name",void 0),Ge([o.property({type:Boolean,reflect:!0})],Xe.prototype,"checked",void 0),Ge([o.property({type:Boolean})],Xe.prototype,"indeterminate",void 0),Ge([o.property({type:Boolean})],Xe.prototype,"disabled",void 0),Ge([o.query(".ft-checkbox")],Xe.prototype,"container",void 0),Ge([o.query("ft-ripple")],Xe.prototype,"ripple",void 0),e.customElement("ft-checkbox")(Xe);const Ye=e.FtCssVariableFactory.extend("--ft-radio-text-color",e.designSystemVariables.colorOnSurfaceHigh),Je=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Qe=(e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),e.FtCssVariableFactory.extend("--ft-radio-border-color",e.designSystemVariables.colorOnSurfaceMedium)),ti=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),ei=i.css`
|
|
666
677
|
* {
|
|
667
678
|
box-sizing: border-box;
|
|
668
679
|
}
|
|
669
680
|
|
|
670
681
|
.ft-radio {
|
|
671
682
|
box-sizing: border-box;
|
|
672
|
-
color: ${
|
|
683
|
+
color: ${Ye};
|
|
673
684
|
|
|
674
685
|
display: inline-flex;
|
|
675
686
|
align-items: center;
|
|
@@ -677,7 +688,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
677
688
|
}
|
|
678
689
|
|
|
679
690
|
.ft-radio--disabled {
|
|
680
|
-
color: ${
|
|
691
|
+
color: ${ti};
|
|
681
692
|
}
|
|
682
693
|
|
|
683
694
|
input {
|
|
@@ -700,7 +711,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
700
711
|
}
|
|
701
712
|
|
|
702
713
|
.ft-radio--box {
|
|
703
|
-
border: 2px solid ${
|
|
714
|
+
border: 2px solid ${Qe};
|
|
704
715
|
border-radius: 50%;
|
|
705
716
|
|
|
706
717
|
display: flex;
|
|
@@ -713,7 +724,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
713
724
|
|
|
714
725
|
.ft-radio--box:after {
|
|
715
726
|
content: " ";
|
|
716
|
-
background-color: ${
|
|
727
|
+
background-color: ${Je};
|
|
717
728
|
|
|
718
729
|
border-radius: 50%;
|
|
719
730
|
|
|
@@ -725,7 +736,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
725
736
|
}
|
|
726
737
|
|
|
727
738
|
.ft-radio--checked .ft-radio--box {
|
|
728
|
-
border-color: ${
|
|
739
|
+
border-color: ${Je};
|
|
729
740
|
}
|
|
730
741
|
|
|
731
742
|
|
|
@@ -734,14 +745,14 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
734
745
|
}
|
|
735
746
|
|
|
736
747
|
.ft-radio--disabled .ft-radio--box {
|
|
737
|
-
border-color: ${
|
|
748
|
+
border-color: ${ti};
|
|
738
749
|
background-color: transparent;
|
|
739
750
|
}
|
|
740
751
|
|
|
741
752
|
.ft-radio--disabled .ft-radio--box:after {
|
|
742
|
-
background-color: ${
|
|
753
|
+
background-color: ${ti};
|
|
743
754
|
}
|
|
744
|
-
`;var
|
|
755
|
+
`;var ii=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class oi extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class si extends e.FtLitElement{constructor(){super(...arguments),this.value="",this.name="",this.checked=!1,this.disabled=!1}render(){const t={"ft-radio":!0,"ft-radio--checked":this.checked,"ft-radio--disabled":this.disabled};return i.html`
|
|
745
756
|
<div class="${r.classMap(t)}">
|
|
746
757
|
<div class="ft-radio--box-container">
|
|
747
758
|
<ft-ripple
|
|
@@ -766,17 +777,17 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
766
777
|
</ft-typography>
|
|
767
778
|
</label>
|
|
768
779
|
</div>
|
|
769
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new
|
|
780
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new oi(this.value,this.checked))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}select(){this.checked=!0,this.dispatchEvent(new oi(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}si.elementDefinitions={"ft-ripple":be,"ft-typography":te},si.styles=ei,ii([o.property()],si.prototype,"value",void 0),ii([o.property()],si.prototype,"name",void 0),ii([o.property({type:Boolean,reflect:!0})],si.prototype,"checked",void 0),ii([o.property({type:Boolean})],si.prototype,"disabled",void 0),ii([o.query(".ft-radio")],si.prototype,"container",void 0),ii([o.query("ft-ripple")],si.prototype,"ripple",void 0),ii([o.query("input")],si.prototype,"input",void 0);const ri=i.css`
|
|
770
781
|
:host {
|
|
771
782
|
display: contents;
|
|
772
783
|
}
|
|
773
|
-
`;var
|
|
784
|
+
`;var ni=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class li extends e.FtLitElement{constructor(){super(...arguments),this.name=""}render(){return i.html`
|
|
774
785
|
<slot @slotchange=${this.onSlotChange}
|
|
775
786
|
@change=${this.onChange}
|
|
776
787
|
@keydown=${this.onKeyDown}
|
|
777
788
|
@focusin=${this.focusCurrentValue}
|
|
778
789
|
></slot>
|
|
779
|
-
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((e=>e.checked=t.detail.value===e.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let e=this.findFtRadio(t),i=this.radioButtons.indexOf(e)-1;this.radioButtons[i<0?this.radioButtons.length-1:i].select();break}case"ArrowDown":case"ArrowRight":{let e=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[e>this.radioButtons.length-1?0:e].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}
|
|
790
|
+
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((e=>e.checked=t.detail.value===e.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let e=this.findFtRadio(t),i=this.radioButtons.indexOf(e)-1;this.radioButtons[i<0?this.radioButtons.length-1:i].select();break}case"ArrowDown":case"ArrowRight":{let e=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[e>this.radioButtons.length-1?0:e].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}li.elementDefinitions={},li.styles=ri,ni([o.property()],li.prototype,"name",void 0),ni([o.queryAssignedElements()],li.prototype,"radioButtons",void 0),e.customElement("ft-radio")(si),e.customElement("ft-radio-group")(li);const ai={borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),fontFamily:e.FtCssVariableFactory.external(Bt.fontFamily,"Body2 typography"),fontSize:e.FtCssVariableFactory.external(Bt.fontSize,"Body2 typography"),fontWeight:e.FtCssVariableFactory.external(Bt.fontWeight,"Body2 typography"),letterSpacing:e.FtCssVariableFactory.external(Bt.letterSpacing,"Body2 typography"),lineHeight:e.FtCssVariableFactory.external(Bt.lineHeight,"Body2 typography"),textTransform:e.FtCssVariableFactory.external(Bt.textTransform,"Body2 typography")},ci=i.css`
|
|
780
791
|
.ft-filter-level--container {
|
|
781
792
|
display: flex;
|
|
782
793
|
flex-direction: column;
|
|
@@ -790,14 +801,14 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
790
801
|
flex-shrink: 0;
|
|
791
802
|
text-decoration: none;
|
|
792
803
|
position: relative;
|
|
793
|
-
border-radius: ${
|
|
804
|
+
border-radius: ${ai.borderRadiusM};
|
|
794
805
|
overflow: hidden;
|
|
795
806
|
display: flex;
|
|
796
807
|
align-items: center;
|
|
797
808
|
padding: 4px 4px;
|
|
798
809
|
gap: 4px;
|
|
799
810
|
cursor: pointer;
|
|
800
|
-
color: ${
|
|
811
|
+
color: ${ai.colorOnSurface};
|
|
801
812
|
}
|
|
802
813
|
|
|
803
814
|
.ft-filter-level--go-back:focus {
|
|
@@ -826,7 +837,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
826
837
|
}
|
|
827
838
|
|
|
828
839
|
ft-button {
|
|
829
|
-
${e.setVariable(Le.color,
|
|
840
|
+
${e.setVariable(Le.color,ai.colorOnSurface)};
|
|
830
841
|
}
|
|
831
842
|
|
|
832
843
|
ft-radio, ft-checkbox {
|
|
@@ -840,9 +851,9 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
840
851
|
|
|
841
852
|
.ft-filter-level--no-values {
|
|
842
853
|
margin: 10px 0;
|
|
843
|
-
color: ${
|
|
854
|
+
color: ${ai.colorOnSurfaceMedium};
|
|
844
855
|
}
|
|
845
|
-
`;var
|
|
856
|
+
`;var hi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class pi extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=[...this.options];this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return i.html`
|
|
846
857
|
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
847
858
|
${null==this.parent?null:i.html`
|
|
848
859
|
<div tabindex="0"
|
|
@@ -906,7 +917,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
906
917
|
@change=${t=>t.stopPropagation()}>
|
|
907
918
|
${t.renderOption?t.renderOption:t.label}
|
|
908
919
|
</ft-radio>
|
|
909
|
-
`}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}
|
|
920
|
+
`}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}pi.elementDefinitions={"ft-button":Ue,"ft-ripple":be,"ft-typography":te,"ft-checkbox":Xe,"ft-icon":De,"ft-radio":si},pi.styles=ci,hi([o.property({type:String})],pi.prototype,"id",void 0),hi([o.property({type:Object})],pi.prototype,"parent",void 0),hi([o.property({type:Array})],pi.prototype,"options",void 0),hi([o.property({type:Boolean})],pi.prototype,"multivalued",void 0),hi([o.property({type:Boolean})],pi.prototype,"disabled",void 0),hi([o.property({type:Boolean})],pi.prototype,"hideSelectedOptions",void 0),hi([o.property({type:Boolean})],pi.prototype,"preventNavigation",void 0),hi([o.property({type:String})],pi.prototype,"filter",void 0),hi([o.property({type:String})],pi.prototype,"moreValuesButtonLabel",void 0),hi([o.property({type:String})],pi.prototype,"noValuesLabel",void 0),hi([o.property({type:Number})],pi.prototype,"displayedValuesLimit",void 0),hi([o.query(".ft-filter-level--container")],pi.prototype,"container",void 0),hi([o.state()],pi.prototype,"displayedPages",void 0);const fi={buttonsColor:e.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color",e.designSystemVariables.colorPrimary),buttonsZIndex:e.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:e.FtCssVariableFactory.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system")},di=i.css`
|
|
910
921
|
.ft-snap-scroll {
|
|
911
922
|
box-sizing: border-box;
|
|
912
923
|
position: relative;
|
|
@@ -941,7 +952,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
941
952
|
flex-wrap: nowrap;
|
|
942
953
|
align-items: flex-start;
|
|
943
954
|
justify-content: flex-start;
|
|
944
|
-
gap: ${
|
|
955
|
+
gap: ${fi.gap};
|
|
945
956
|
}
|
|
946
957
|
|
|
947
958
|
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
@@ -984,11 +995,11 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
984
995
|
.ft-snap-scroll--next {
|
|
985
996
|
position: absolute;
|
|
986
997
|
display: flex;
|
|
987
|
-
z-index: ${
|
|
998
|
+
z-index: ${fi.buttonsZIndex};
|
|
988
999
|
opacity: 1;
|
|
989
1000
|
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
990
1001
|
${e.setVariable(Le.backgroundColor,"transparent")};
|
|
991
|
-
${e.setVariable(Le.color,
|
|
1002
|
+
${e.setVariable(Le.color,fi.buttonsColor)};
|
|
992
1003
|
}
|
|
993
1004
|
|
|
994
1005
|
.ft-snap-scroll--previous[hidden],
|
|
@@ -1001,37 +1012,37 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1001
1012
|
top: 0;
|
|
1002
1013
|
left: -1px;
|
|
1003
1014
|
bottom: 0;
|
|
1004
|
-
background: linear-gradient(to right, ${
|
|
1015
|
+
background: linear-gradient(to right, ${fi.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1005
1016
|
}
|
|
1006
1017
|
|
|
1007
1018
|
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
1008
1019
|
top: -1px;
|
|
1009
1020
|
left: 0;
|
|
1010
1021
|
right: 0;
|
|
1011
|
-
background: linear-gradient(to bottom, ${
|
|
1022
|
+
background: linear-gradient(to bottom, ${fi.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1012
1023
|
}
|
|
1013
1024
|
|
|
1014
1025
|
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
1015
1026
|
top: 0;
|
|
1016
1027
|
right: -1px;
|
|
1017
1028
|
bottom: 0;
|
|
1018
|
-
background: linear-gradient(to left, ${
|
|
1029
|
+
background: linear-gradient(to left, ${fi.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1019
1030
|
}
|
|
1020
1031
|
|
|
1021
1032
|
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
1022
1033
|
left: 0;
|
|
1023
1034
|
right: 0;
|
|
1024
1035
|
bottom: -1px;
|
|
1025
|
-
background: linear-gradient(to top, ${
|
|
1036
|
+
background: linear-gradient(to top, ${fi.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1026
1037
|
}
|
|
1027
1038
|
|
|
1028
1039
|
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
1029
1040
|
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
1030
1041
|
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
1031
1042
|
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1032
|
-
background-color: ${
|
|
1043
|
+
background-color: ${fi.colorSurface};
|
|
1033
1044
|
}
|
|
1034
|
-
`;var
|
|
1045
|
+
`;var ui=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class bi extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class vi extends e.FtLitElement{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new e.Debouncer(200),this.updateScrollDebouncer=new e.Debouncer(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let e=this.elements[t];if(e){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,i=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<i||e[this.offsetAttribute]+e[this.sizeAttribute]>t)&&this.scrollToElement(e)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=r.classMap({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":e.isSafari}),o=this.controls&&this.withScroll;return i.html`
|
|
1035
1046
|
<div part="container" class="${t}">
|
|
1036
1047
|
<ft-button
|
|
1037
1048
|
class="ft-snap-scroll--previous"
|
|
@@ -1055,7 +1066,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1055
1066
|
@click=${this.next}
|
|
1056
1067
|
></ft-button>
|
|
1057
1068
|
</div>
|
|
1058
|
-
`}updated(t){var e;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new
|
|
1069
|
+
`}updated(t){var e;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new bi(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,i;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(i=this.contentSlot)||void 0===i||i.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}vi.elementDefinitions={"ft-button":Ue},vi.styles=di,ui([o.property({type:Boolean})],vi.prototype,"horizontal",void 0),ui([o.property({type:Boolean})],vi.prototype,"hideScrollbar",void 0),ui([o.property({type:Boolean})],vi.prototype,"controls",void 0),ui([o.property({type:Boolean})],vi.prototype,"limitSize",void 0),ui([o.state()],vi.prototype,"elements",void 0),ui([o.state()],vi.prototype,"currentElement",void 0),ui([o.state()],vi.prototype,"withScroll",void 0),ui([o.state()],vi.prototype,"startReached",void 0),ui([o.state()],vi.prototype,"endReached",void 0),ui([o.query(".ft-snap-scroll--content")],vi.prototype,"contentSlot",void 0),e.customElement("ft-snap-scroll")(vi);const gi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),xi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),yi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),mi=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),$i=e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),wi=e.FtCssVariableFactory.external(e.designSystemVariables.transitionDuration,"Design system"),ki=e.FtCssVariableFactory.external(e.designSystemVariables.transitionTimingFunction,"Design system"),Si=[Wt,i.css`
|
|
1059
1070
|
:host {
|
|
1060
1071
|
display: flex;
|
|
1061
1072
|
max-height: 100%;
|
|
@@ -1068,7 +1079,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1068
1079
|
flex-direction: column;
|
|
1069
1080
|
max-height: 100%;
|
|
1070
1081
|
max-width: 100%;
|
|
1071
|
-
color: ${
|
|
1082
|
+
color: ${xi};
|
|
1072
1083
|
}
|
|
1073
1084
|
|
|
1074
1085
|
.ft-filter--header {
|
|
@@ -1104,8 +1115,8 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1104
1115
|
padding: 0 10px;
|
|
1105
1116
|
overflow: hidden;
|
|
1106
1117
|
height: 32px;
|
|
1107
|
-
transition: height ${
|
|
1108
|
-
margin ${
|
|
1118
|
+
transition: height ${wi} ${ki},
|
|
1119
|
+
margin ${wi} ${ki};
|
|
1109
1120
|
transition-delay: 500ms;
|
|
1110
1121
|
}
|
|
1111
1122
|
|
|
@@ -1118,15 +1129,15 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1118
1129
|
display: block;
|
|
1119
1130
|
width: 100%;
|
|
1120
1131
|
border-radius: 4px;
|
|
1121
|
-
border: 1px solid ${
|
|
1132
|
+
border: 1px solid ${gi};
|
|
1122
1133
|
padding: 4px;
|
|
1123
|
-
background-color: ${
|
|
1124
|
-
color: ${
|
|
1125
|
-
outline-color: ${
|
|
1134
|
+
background-color: ${$i};
|
|
1135
|
+
color: ${xi};
|
|
1136
|
+
outline-color: ${mi};
|
|
1126
1137
|
}
|
|
1127
1138
|
|
|
1128
1139
|
input::placeholder {
|
|
1129
|
-
color: ${
|
|
1140
|
+
color: ${yi};
|
|
1130
1141
|
}
|
|
1131
1142
|
|
|
1132
1143
|
input:placeholder-shown {
|
|
@@ -1142,7 +1153,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1142
1153
|
}
|
|
1143
1154
|
|
|
1144
1155
|
.ft-filter--separator {
|
|
1145
|
-
border-top: 1px solid ${
|
|
1156
|
+
border-top: 1px solid ${gi};
|
|
1146
1157
|
margin: 4px 10px;
|
|
1147
1158
|
}
|
|
1148
1159
|
|
|
@@ -1167,7 +1178,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1167
1178
|
slot {
|
|
1168
1179
|
display: none;
|
|
1169
1180
|
}
|
|
1170
|
-
`];var
|
|
1181
|
+
`];var zi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Oi extends CustomEvent{constructor(t){super("change",{detail:t})}}class Bi extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayedValuesLimit=0,this.hideClearButton=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new e.Debouncer(300),this.changeDebouncer=new e.Debouncer(10)}get flatOptions(){return ee(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.flatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){var t,e;const o=this.flatOptions.some((t=>t.selected)),s=this.withScroll||this.filter||null!==(e=null===(t=this.lastLevel)||void 0===t?void 0:t.hasHiddenValues)&&void 0!==e&&e,r=this.filterPlaceHolder.replace("{0}",this.label);return i.html`
|
|
1171
1182
|
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1172
1183
|
part="container">
|
|
1173
1184
|
${this.label||o?i.html`
|
|
@@ -1237,17 +1248,17 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1237
1248
|
.exportpartsPrefixes=${["values","available-values"]}
|
|
1238
1249
|
noValuesLabel="${this.noValuesLabel}"
|
|
1239
1250
|
></ft-filter-level>
|
|
1240
|
-
`}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.dispatchEvent(new
|
|
1251
|
+
`}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.dispatchEvent(new Oi(this.selectedValues)),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}Bi.elementDefinitions={"ft-button":Ue,"ft-filter-level":pi,"ft-snap-scroll":vi,"ft-typography":te},Bi.styles=Si,zi([o.property({type:String})],Bi.prototype,"id",void 0),zi([o.property({type:String})],Bi.prototype,"label",void 0),zi([o.property({type:String})],Bi.prototype,"filterPlaceHolder",void 0),zi([o.property({type:String})],Bi.prototype,"clearButtonLabel",void 0),zi([o.property({type:String})],Bi.prototype,"moreValuesButtonLabel",void 0),zi([o.property({type:String})],Bi.prototype,"noValuesLabel",void 0),zi([e.jsonProperty([])],Bi.prototype,"options",void 0),zi([o.property({type:Boolean})],Bi.prototype,"multivalued",void 0),zi([o.property({type:Boolean})],Bi.prototype,"disabled",void 0),zi([o.property({type:Boolean})],Bi.prototype,"raiseSelectedOptions",void 0),zi([o.property({type:Number})],Bi.prototype,"displayedValuesLimit",void 0),zi([o.property({type:Boolean})],Bi.prototype,"hideClearButton",void 0),zi([o.query(".ft-filter--slot")],Bi.prototype,"slotElement",void 0),zi([o.query(".ft-filter--container")],Bi.prototype,"container",void 0),zi([o.query(".ft-filter--values")],Bi.prototype,"valuesContainer",void 0),zi([o.query(".ft-filter--levels")],Bi.prototype,"levelsContainer",void 0),zi([o.query(".ft-filter--levels ft-filter-level:last-child")],Bi.prototype,"lastLevel",void 0),zi([o.query(".ft-filter--filter input")],Bi.prototype,"filterInput",void 0),zi([o.queryAll(".ft-filter--levels ft-filter-level")],Bi.prototype,"levels",void 0),zi([o.state()],Bi.prototype,"withScroll",void 0),zi([o.state()],Bi.prototype,"filter",void 0),zi([o.state()],Bi.prototype,"slideIn",void 0),zi([o.state()],Bi.prototype,"slideOut",void 0);var Ci=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ei extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return i.html`
|
|
1241
1252
|
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1242
|
-
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}
|
|
1253
|
+
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Ei.elementDefinitions={},Ci([o.property({type:String})],Ei.prototype,"label",void 0),Ci([o.property({type:Object,converter:t=>t})],Ei.prototype,"value",void 0),Ci([o.property({type:Boolean,reflect:!0})],Ei.prototype,"selected",void 0),Ci([o.property({type:Object})],Ei.prototype,"subOptions",void 0),Ci([e.jsonProperty({})],Ei.prototype,"renderOption",void 0),Ci([o.query(".ft-filter-option--slot")],Ei.prototype,"slotElement",void 0),e.customElement("ft-filter")(Bi),e.customElement("ft-filter-option")(Ei);const Ii=i.css`
|
|
1243
1254
|
.ft-accordion {
|
|
1244
1255
|
box-sizing: border-box;
|
|
1245
1256
|
}
|
|
1246
|
-
`;var
|
|
1257
|
+
`;var Di=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Fi extends e.FtLitElement{constructor(){super(...arguments),this.multi=!1}render(){return i.html`
|
|
1247
1258
|
<div class="ft-accordion">
|
|
1248
1259
|
<slot @activated=${this.onChange}></slot>
|
|
1249
1260
|
</div>
|
|
1250
|
-
`}onChange(t){t.stopPropagation(),this.multi||this.content.assignedElements().forEach((e=>e.active=e===t.target))}}
|
|
1261
|
+
`}onChange(t){t.stopPropagation(),this.multi||this.content.assignedElements().forEach((e=>e.active=e===t.target))}}Fi.elementDefinitions={},Fi.styles=Ii,Di([o.property({type:Boolean})],Fi.prototype,"multi",void 0),Di([o.query("slot")],Fi.prototype,"content",void 0);const Li=e.FtCssVariableFactory.create("--ft-accordion-toggle-horizontal-spacing","SIZE","16px"),ji=e.FtCssVariableFactory.create("--ft-accordion-toggle-vertical-spacing","SIZE","16px"),Mi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),Pi=i.css`
|
|
1251
1262
|
.ft-accordion-item {
|
|
1252
1263
|
display: flex;
|
|
1253
1264
|
flex-direction: column;
|
|
@@ -1260,8 +1271,8 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1260
1271
|
display: flex;
|
|
1261
1272
|
align-items: center;
|
|
1262
1273
|
cursor: pointer;
|
|
1263
|
-
padding: ${
|
|
1264
|
-
gap: calc(${
|
|
1274
|
+
padding: ${ji} ${Li};
|
|
1275
|
+
gap: calc(${Li} / 2);
|
|
1265
1276
|
outline: none;
|
|
1266
1277
|
}
|
|
1267
1278
|
|
|
@@ -1286,13 +1297,13 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1286
1297
|
.ft-accordion-item--active .ft-accordion-item--content {
|
|
1287
1298
|
height: initial;
|
|
1288
1299
|
overflow: visible;
|
|
1289
|
-
padding: ${
|
|
1300
|
+
padding: ${ji} ${Li};
|
|
1290
1301
|
}
|
|
1291
1302
|
|
|
1292
1303
|
.ft-accordion-item--separator {
|
|
1293
|
-
border-bottom: 1px solid ${
|
|
1304
|
+
border-bottom: 1px solid ${Mi};
|
|
1294
1305
|
}
|
|
1295
|
-
`;var
|
|
1306
|
+
`;var Ai=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ni extends e.FtLitElement{constructor(){super(...arguments),this.icon="",this.label="",this.active=!1}render(){return i.html`
|
|
1296
1307
|
<div class="ft-accordion-item ${this.active?"ft-accordion-item--active":""}">
|
|
1297
1308
|
<div class="ft-accordion-item--toggle"
|
|
1298
1309
|
part="toggle"
|
|
@@ -1322,7 +1333,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1322
1333
|
</div>
|
|
1323
1334
|
<div class="ft-accordion-item--separator" part="separator"></div>
|
|
1324
1335
|
</div>
|
|
1325
|
-
`}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)}}
|
|
1336
|
+
`}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)}}Ni.elementDefinitions={"ft-ripple":be,"ft-typography":te,"ft-icon":De},Ni.styles=Pi,Ai([o.property({type:String})],Ni.prototype,"icon",void 0),Ai([o.property({type:String})],Ni.prototype,"label",void 0),Ai([o.property({type:Boolean,reflect:!0})],Ni.prototype,"active",void 0),e.customElement("ft-accordion")(Fi),e.customElement("ft-accordion-item")(Ni);const Ti=e.FtCssVariableFactory.extend("--ft-chip-color",e.designSystemVariables.colorOnSurface),Ri={backgroundColor:e.FtCssVariableFactory.extend("--ft-chip-background-color",e.designSystemVariables.colorSurface),color:Ti,fontSize:e.FtCssVariableFactory.extend("--ft-chip-font-size",Bt.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:e.FtCssVariableFactory.extend("--ft-chip-ripple-color",Ti),horizontalPadding:e.FtCssVariableFactory.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:e.FtCssVariableFactory.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},Zi=e.FtCssVariableFactory.extend("--ft-chip-highlighted-color",e.FtCssVariableFactory.extend("--ft-chip-color",e.designSystemVariables.colorOnPrimary)),Ui={backgroundColor:e.FtCssVariableFactory.extend("--ft-chip-highlighted-background-color",e.FtCssVariableFactory.extend("--ft-chip-background-color",e.designSystemVariables.colorPrimary)),color:Zi,rippleColor:e.FtCssVariableFactory.extend("--ft-chip-highlighted-ripple-color",Zi)},_i=e.FtCssVariableFactory.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),Hi=e.FtCssVariableFactory.create("--ft-chip-dense-vertical-padding","SIZE","4px"),Vi=[e.noTextSelect,i.css`
|
|
1326
1337
|
:host {
|
|
1327
1338
|
display: inline-block;
|
|
1328
1339
|
max-width: 100%;
|
|
@@ -1339,20 +1350,20 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1339
1350
|
box-sizing: border-box;
|
|
1340
1351
|
pointer-events: auto;
|
|
1341
1352
|
|
|
1342
|
-
--ft-chip-internal-font-size: ${
|
|
1353
|
+
--ft-chip-internal-font-size: ${Ri.fontSize};
|
|
1343
1354
|
--ft-chip-internal-line-height: max(20px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1344
|
-
${e.setVariable(Be.size,
|
|
1345
|
-
--ft-chip-internal-vertical-padding: ${
|
|
1346
|
-
--ft-chip-internal-horizontal-padding: ${
|
|
1355
|
+
${e.setVariable(Be.size,Ri.iconSize)};
|
|
1356
|
+
--ft-chip-internal-vertical-padding: ${Ri.verticalPadding};
|
|
1357
|
+
--ft-chip-internal-horizontal-padding: ${Ri.horizontalPadding};
|
|
1347
1358
|
--ft-chip-internal-icon-padding: 3px;
|
|
1348
|
-
--ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${
|
|
1359
|
+
--ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${Ri.iconSize});
|
|
1349
1360
|
|
|
1350
|
-
border: 1px solid ${
|
|
1351
|
-
color: ${
|
|
1352
|
-
${e.setVariable(ne.color,
|
|
1361
|
+
border: 1px solid ${Ri.colorOutline};
|
|
1362
|
+
color: ${Ri.color};
|
|
1363
|
+
${e.setVariable(ne.color,Ri.rippleColor)};
|
|
1353
1364
|
border-radius: calc(var(--ft-chip-internal-content-height) / 2 + var(--ft-chip-internal-vertical-padding));
|
|
1354
1365
|
padding: calc(var(--ft-chip-internal-vertical-padding) - 1px) calc(var(--ft-chip-internal-horizontal-padding) - 1px);
|
|
1355
|
-
background-color: ${
|
|
1366
|
+
background-color: ${Ri.backgroundColor};
|
|
1356
1367
|
line-height: var(--ft-chip-internal-content-height);
|
|
1357
1368
|
}
|
|
1358
1369
|
|
|
@@ -1362,8 +1373,8 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1362
1373
|
|
|
1363
1374
|
.ft-chip--dense {
|
|
1364
1375
|
--ft-chip-internal-icon-padding: 3px;
|
|
1365
|
-
--ft-chip-internal-vertical-padding: ${
|
|
1366
|
-
--ft-chip-internal-horizontal-padding: ${
|
|
1376
|
+
--ft-chip-internal-vertical-padding: ${Hi};
|
|
1377
|
+
--ft-chip-internal-horizontal-padding: ${_i};
|
|
1367
1378
|
--ft-chip-internal-line-height: max(16px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1368
1379
|
}
|
|
1369
1380
|
|
|
@@ -1375,15 +1386,15 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1375
1386
|
cursor: default;
|
|
1376
1387
|
pointer-events: none;
|
|
1377
1388
|
filter: grayscale(1);
|
|
1378
|
-
opacity: ${
|
|
1389
|
+
opacity: ${Ri.opacityDisabled};
|
|
1379
1390
|
}
|
|
1380
1391
|
|
|
1381
1392
|
.ft-chip--highlighted {
|
|
1382
1393
|
border: none;
|
|
1383
1394
|
padding: var(--ft-chip-internal-vertical-padding) var(--ft-chip-internal-horizontal-padding);
|
|
1384
|
-
background-color: ${
|
|
1385
|
-
${e.setVariable(ne.color,
|
|
1386
|
-
color: ${
|
|
1395
|
+
background-color: ${Ui.backgroundColor};
|
|
1396
|
+
${e.setVariable(ne.color,Ui.rippleColor)};
|
|
1397
|
+
color: ${Ui.color};
|
|
1387
1398
|
}
|
|
1388
1399
|
|
|
1389
1400
|
.ft-chip--clickable {
|
|
@@ -1452,7 +1463,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1452
1463
|
.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-container {
|
|
1453
1464
|
order: -1;
|
|
1454
1465
|
}
|
|
1455
|
-
`];var
|
|
1466
|
+
`];var Ki=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class qi extends CustomEvent{constructor(){super("icon-click")}}class Wi extends e.FtLitElement{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}render(){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":e.isSafari};return i.html`
|
|
1456
1467
|
<div class="${r.classMap(t)}"
|
|
1457
1468
|
aria-label="${this.getLabel()}"
|
|
1458
1469
|
tabindex="${this.interactionsOnChip?0:-1}"
|
|
@@ -1471,25 +1482,25 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1471
1482
|
<ft-ripple ?disabled=${!this.interactionsOnIcon}></ft-ripple>
|
|
1472
1483
|
<ft-icon variant="material">${this.internalIcon}</ft-icon>
|
|
1473
1484
|
</div>
|
|
1474
|
-
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new
|
|
1485
|
+
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new qi))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new qi))}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)}}Wi.elementDefinitions={"ft-ripple":be,"ft-typography":te,"ft-icon":De},Wi.styles=Vi,Ki([o.property({type:Boolean})],Wi.prototype,"highlighted",void 0),Ki([o.property({type:Boolean})],Wi.prototype,"removable",void 0),Ki([o.property({type:Boolean})],Wi.prototype,"disabled",void 0),Ki([o.property({type:Boolean})],Wi.prototype,"clickable",void 0),Ki([o.property({type:Boolean})],Wi.prototype,"iconClickable",void 0),Ki([o.property({type:Boolean})],Wi.prototype,"dense",void 0),Ki([o.property({type:Boolean})],Wi.prototype,"multiLine",void 0),Ki([o.property({type:String})],Wi.prototype,"label",void 0),Ki([o.property({type:String})],Wi.prototype,"icon",void 0),Ki([o.property({type:Boolean})],Wi.prototype,"trailingIcon",void 0),Ki([o.query("ft-typography slot")],Wi.prototype,"slottedContent",void 0),e.customElement("ft-chip")(Wi);const Gi={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),labelMaxWidth:e.FtCssVariableFactory.create("--ft-input-label-max-width","SIZE","100%"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},Xi=i.css`
|
|
1475
1486
|
.ft-input-label {
|
|
1476
1487
|
position: absolute;
|
|
1477
1488
|
inset: 0;
|
|
1478
1489
|
display: flex;
|
|
1479
|
-
background-color: ${
|
|
1480
|
-
border-radius: ${
|
|
1490
|
+
background-color: ${Gi.colorSurface};
|
|
1491
|
+
border-radius: ${Gi.borderRadiusS} ${Gi.borderRadiusS} 0 0;
|
|
1481
1492
|
}
|
|
1482
1493
|
|
|
1483
1494
|
.ft-input-label--outlined {
|
|
1484
|
-
border-radius: ${
|
|
1495
|
+
border-radius: ${Gi.borderRadiusS};
|
|
1485
1496
|
}
|
|
1486
1497
|
|
|
1487
1498
|
.ft-input-label {
|
|
1488
|
-
border-color: ${
|
|
1499
|
+
border-color: ${Gi.borderColor};
|
|
1489
1500
|
}
|
|
1490
1501
|
|
|
1491
1502
|
.ft-input-label.ft-input-label--in-error {
|
|
1492
|
-
border-color: ${
|
|
1503
|
+
border-color: ${Gi.colorError}
|
|
1493
1504
|
}
|
|
1494
1505
|
|
|
1495
1506
|
.ft-input-label:before,
|
|
@@ -1502,7 +1513,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1502
1513
|
}
|
|
1503
1514
|
|
|
1504
1515
|
.ft-input-label:before {
|
|
1505
|
-
width: calc(${
|
|
1516
|
+
width: calc(${Gi.horizontalSpacing} - 4px);
|
|
1506
1517
|
flex-shrink: 0;
|
|
1507
1518
|
}
|
|
1508
1519
|
|
|
@@ -1518,20 +1529,20 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1518
1529
|
border-bottom-width: 1px;
|
|
1519
1530
|
border-bottom-style: solid;
|
|
1520
1531
|
border-color: inherit;
|
|
1521
|
-
color: ${
|
|
1532
|
+
color: ${Gi.textColor};
|
|
1522
1533
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
1523
|
-
max-width: calc(${
|
|
1534
|
+
max-width: calc(${Gi.labelMaxWidth} - 2 * (${Gi.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
1524
1535
|
text-overflow: ellipsis;
|
|
1525
|
-
${e.setVariable(Ct.fontSize,
|
|
1526
|
-
${e.setVariable(Ct.lineHeight,
|
|
1536
|
+
${e.setVariable(Ct.fontSize,Gi.fontSize)};
|
|
1537
|
+
${e.setVariable(Ct.lineHeight,Gi.fontSize)};
|
|
1527
1538
|
}
|
|
1528
1539
|
|
|
1529
1540
|
.ft-input-label--in-error .ft-input-label--text {
|
|
1530
|
-
color: ${
|
|
1541
|
+
color: ${Gi.colorError}
|
|
1531
1542
|
}
|
|
1532
1543
|
|
|
1533
1544
|
.ft-input-label--disabled .ft-input-label--text {
|
|
1534
|
-
color: ${
|
|
1545
|
+
color: ${Gi.disabledTextColor};
|
|
1535
1546
|
}
|
|
1536
1547
|
|
|
1537
1548
|
.ft-input-label--hidden-text {
|
|
@@ -1548,19 +1559,19 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1548
1559
|
overflow: hidden;
|
|
1549
1560
|
white-space: nowrap;
|
|
1550
1561
|
text-overflow: ellipsis;
|
|
1551
|
-
padding: ${
|
|
1552
|
-
margin: calc(${
|
|
1562
|
+
padding: ${Gi.verticalSpacing} 4px;
|
|
1563
|
+
margin: calc(${Gi.verticalSpacing} * -1) 0;
|
|
1553
1564
|
max-width: 100%;
|
|
1554
1565
|
box-sizing: border-box;
|
|
1555
1566
|
}
|
|
1556
1567
|
|
|
1557
1568
|
.ft-input-label--raised .ft-input-label--text {
|
|
1558
|
-
${e.setVariable(Ct.fontSize,
|
|
1559
|
-
${e.setVariable(Ct.lineHeight,
|
|
1569
|
+
${e.setVariable(Ct.fontSize,Gi.raisedFontSize)};
|
|
1570
|
+
${e.setVariable(Ct.lineHeight,Gi.raisedFontSize)};
|
|
1560
1571
|
}
|
|
1561
1572
|
|
|
1562
1573
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
1563
|
-
top: ${
|
|
1574
|
+
top: ${Gi.verticalSpacing};
|
|
1564
1575
|
}
|
|
1565
1576
|
|
|
1566
1577
|
.ft-input-label--outlined .ft-input-label--text,
|
|
@@ -1573,27 +1584,27 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1573
1584
|
.ft-input-label--outlined:before {
|
|
1574
1585
|
border-left-width: 1px;
|
|
1575
1586
|
border-left-style: solid;
|
|
1576
|
-
border-radius: ${
|
|
1587
|
+
border-radius: ${Gi.borderRadiusS} 0 0 ${Gi.borderRadiusS};
|
|
1577
1588
|
}
|
|
1578
1589
|
|
|
1579
1590
|
.ft-input-label--outlined:after {
|
|
1580
1591
|
border-right-width: 1px;
|
|
1581
1592
|
border-right-style: solid;
|
|
1582
|
-
border-radius: 0 ${
|
|
1593
|
+
border-radius: 0 ${Gi.borderRadiusS} ${Gi.borderRadiusS} 0;
|
|
1583
1594
|
}
|
|
1584
1595
|
|
|
1585
1596
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
1586
1597
|
padding: 2px 4px;
|
|
1587
|
-
z-index: ${
|
|
1588
|
-
background-color: ${
|
|
1589
|
-
border-radius: ${
|
|
1598
|
+
z-index: ${Gi.raisedZIndex};
|
|
1599
|
+
background-color: ${Gi.colorSurface};
|
|
1600
|
+
border-radius: ${Gi.borderRadiusS};
|
|
1590
1601
|
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
1591
1602
|
}
|
|
1592
1603
|
|
|
1593
1604
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
1594
1605
|
border-top: none;
|
|
1595
1606
|
}
|
|
1596
|
-
`;var
|
|
1607
|
+
`;var Yi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ji extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return i.html`
|
|
1597
1608
|
<div class="${r.classMap(t)}">
|
|
1598
1609
|
${this.text?i.html`
|
|
1599
1610
|
<div class="ft-input-label--text ft-typography--caption">
|
|
@@ -1602,7 +1613,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1602
1613
|
</div>
|
|
1603
1614
|
`:null}
|
|
1604
1615
|
</div>
|
|
1605
|
-
`}}
|
|
1616
|
+
`}}Ji.elementDefinitions={},Ji.styles=[Wt,Xi],Yi([o.property({type:String})],Ji.prototype,"text",void 0),Yi([o.property({type:Boolean})],Ji.prototype,"raised",void 0),Yi([o.property({type:Boolean})],Ji.prototype,"outlined",void 0),Yi([o.property({type:Boolean})],Ji.prototype,"disabled",void 0),Yi([o.property({type:Boolean})],Ji.prototype,"error",void 0),e.customElement("ft-input-label")(Ji);const Qi={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")},to=i.css`
|
|
1606
1617
|
*:focus {
|
|
1607
1618
|
outline: none;
|
|
1608
1619
|
}
|
|
@@ -1616,7 +1627,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1616
1627
|
.ft-select--main-panel {
|
|
1617
1628
|
position: relative;
|
|
1618
1629
|
display: flex;
|
|
1619
|
-
height: calc(4 * ${
|
|
1630
|
+
height: calc(4 * ${Qi.verticalSpacing} + ${Qi.labelSize} + ${Qi.selectedOptionSize});
|
|
1620
1631
|
}
|
|
1621
1632
|
|
|
1622
1633
|
.ft-select--input-panel {
|
|
@@ -1625,11 +1636,11 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1625
1636
|
display: flex;
|
|
1626
1637
|
align-items: center;
|
|
1627
1638
|
overflow: hidden;
|
|
1628
|
-
padding-left: ${
|
|
1629
|
-
padding-right: ${
|
|
1639
|
+
padding-left: ${Qi.horizontalSpacing};
|
|
1640
|
+
padding-right: ${Qi.horizontalSpacing};
|
|
1630
1641
|
gap: 8px;
|
|
1631
|
-
color: ${
|
|
1632
|
-
${e.setVariable(ne.color,
|
|
1642
|
+
color: ${Qi.selectedOptionColor};
|
|
1643
|
+
${e.setVariable(ne.color,Qi.selectedOptionColor)};
|
|
1633
1644
|
}
|
|
1634
1645
|
|
|
1635
1646
|
.ft-select--input-panel,
|
|
@@ -1645,7 +1656,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1645
1656
|
|
|
1646
1657
|
.ft-select--disabled .ft-select--input-panel,
|
|
1647
1658
|
.ft-select--disabled .ft-select--option {
|
|
1648
|
-
color: ${
|
|
1659
|
+
color: ${Qi.colorOnSurfaceDisabled};
|
|
1649
1660
|
}
|
|
1650
1661
|
|
|
1651
1662
|
.ft-select:not(.ft-select--disabled) .ft-select--input-panel,
|
|
@@ -1654,20 +1665,20 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1654
1665
|
}
|
|
1655
1666
|
|
|
1656
1667
|
ft-input-label {
|
|
1657
|
-
${e.setVariable(
|
|
1658
|
-
${e.setVariable(
|
|
1659
|
-
${e.setVariable(
|
|
1660
|
-
${e.setVariable(
|
|
1661
|
-
${e.setVariable(
|
|
1668
|
+
${e.setVariable(Gi.fontSize,Qi.selectedOptionSize)};
|
|
1669
|
+
${e.setVariable(Gi.raisedFontSize,Qi.labelSize)};
|
|
1670
|
+
${e.setVariable(Gi.verticalSpacing,Qi.verticalSpacing)};
|
|
1671
|
+
${e.setVariable(Gi.horizontalSpacing,Qi.horizontalSpacing)};
|
|
1672
|
+
${e.setVariable(Gi.labelMaxWidth,`calc(100% - ${Be.size} - 8px)`)};
|
|
1662
1673
|
}
|
|
1663
1674
|
|
|
1664
1675
|
.ft-select:not(.ft-select--disabled):focus-within ft-icon {
|
|
1665
|
-
color: ${
|
|
1676
|
+
color: ${Qi.colorPrimary};
|
|
1666
1677
|
}
|
|
1667
1678
|
|
|
1668
1679
|
.ft-select:not(.ft-select--disabled):focus-within ft-input-label {
|
|
1669
|
-
${e.setVariable(
|
|
1670
|
-
${e.setVariable(
|
|
1680
|
+
${e.setVariable(Gi.borderColor,Qi.colorPrimary)};
|
|
1681
|
+
${e.setVariable(Gi.textColor,Qi.colorPrimary)};
|
|
1671
1682
|
}
|
|
1672
1683
|
|
|
1673
1684
|
.ft-select--selected-option {
|
|
@@ -1677,12 +1688,12 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1677
1688
|
overflow: hidden;
|
|
1678
1689
|
white-space: nowrap;
|
|
1679
1690
|
text-overflow: ellipsis;
|
|
1680
|
-
${e.setVariable(Ot.fontSize,
|
|
1681
|
-
${e.setVariable(Ot.lineHeight,
|
|
1691
|
+
${e.setVariable(Ot.fontSize,Qi.selectedOptionSize)};
|
|
1692
|
+
${e.setVariable(Ot.lineHeight,Qi.selectedOptionSize)};
|
|
1682
1693
|
}
|
|
1683
1694
|
|
|
1684
1695
|
.ft-select--in-error .ft-select--selected-option {
|
|
1685
|
-
color: ${
|
|
1696
|
+
color: ${Qi.colorError};
|
|
1686
1697
|
}
|
|
1687
1698
|
|
|
1688
1699
|
ft-icon {
|
|
@@ -1694,16 +1705,16 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1694
1705
|
}
|
|
1695
1706
|
|
|
1696
1707
|
.ft-select--filled .ft-select--input-panel {
|
|
1697
|
-
border-radius: ${
|
|
1708
|
+
border-radius: ${Qi.borderRadiusS} ${Qi.borderRadiusS} 0 0;
|
|
1698
1709
|
}
|
|
1699
1710
|
|
|
1700
1711
|
.ft-select--filled:not(.ft-select--no-label) .ft-select--selected-option {
|
|
1701
1712
|
align-self: stretch;
|
|
1702
|
-
padding-top: calc(${
|
|
1713
|
+
padding-top: calc(${Qi.labelSize} + 2 * ${Qi.verticalSpacing});
|
|
1703
1714
|
}
|
|
1704
1715
|
|
|
1705
1716
|
.ft-select--outlined .ft-select--input-panel {
|
|
1706
|
-
border-radius: ${
|
|
1717
|
+
border-radius: ${Qi.borderRadiusS};
|
|
1707
1718
|
}
|
|
1708
1719
|
|
|
1709
1720
|
.ft-select--options {
|
|
@@ -1712,10 +1723,10 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1712
1723
|
top: 100%;
|
|
1713
1724
|
left: 0;
|
|
1714
1725
|
right: 0;
|
|
1715
|
-
color: ${
|
|
1716
|
-
background: ${
|
|
1717
|
-
z-index: ${
|
|
1718
|
-
box-shadow: ${
|
|
1726
|
+
color: ${Qi.optionsColor};
|
|
1727
|
+
background: ${Qi.colorSurface};
|
|
1728
|
+
z-index: ${Qi.optionsZIndex};
|
|
1729
|
+
box-shadow: ${Qi.elevation02};
|
|
1719
1730
|
}
|
|
1720
1731
|
|
|
1721
1732
|
.ft-select--fixed .ft-select--options {
|
|
@@ -1726,13 +1737,13 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1726
1737
|
|
|
1727
1738
|
.ft-select--options-displayed .ft-select--options {
|
|
1728
1739
|
display: block;
|
|
1729
|
-
max-height: ${
|
|
1740
|
+
max-height: ${Qi.optionsHeight};
|
|
1730
1741
|
overflow-y: auto;
|
|
1731
1742
|
}
|
|
1732
1743
|
|
|
1733
1744
|
.ft-select--option {
|
|
1734
1745
|
position: relative;
|
|
1735
|
-
padding: 4px ${
|
|
1746
|
+
padding: 4px ${Qi.horizontalSpacing};
|
|
1736
1747
|
min-height: 32px;
|
|
1737
1748
|
display: flex;
|
|
1738
1749
|
align-items: center;
|
|
@@ -1744,14 +1755,14 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1744
1755
|
}
|
|
1745
1756
|
|
|
1746
1757
|
.ft-select--helper-text {
|
|
1747
|
-
padding: 0 ${
|
|
1748
|
-
color: ${
|
|
1758
|
+
padding: 0 ${Qi.horizontalSpacing};
|
|
1759
|
+
color: ${Qi.helperColor};
|
|
1749
1760
|
}
|
|
1750
1761
|
|
|
1751
1762
|
.ft-select--in-error .ft-select--helper-text {
|
|
1752
|
-
color: ${
|
|
1763
|
+
color: ${Qi.colorError};
|
|
1753
1764
|
}
|
|
1754
|
-
`;var
|
|
1765
|
+
`;var eo=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class io extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1}render(){return i.html``}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}io.elementDefinitions={},eo([o.property({type:String})],io.prototype,"label",void 0),eo([o.property({type:Object,converter:t=>t})],io.prototype,"value",void 0),eo([o.property({type:Boolean,reflect:!0})],io.prototype,"selected",void 0);class oo extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.fixedMenuPosition=!1,this.options=[],this.optionsDisplayed=!1,this.focusOptions=!1,this.hideOptions=t=>this.optionsDisplayed=this.optionsDisplayed&&t.composedPath().includes(this.container)}render(){var t,e,o,n,l;let a=this.hasOptionsMenuOpen,c=this.disabled||!this.hasOptions;const h=null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value)||(null!==(o=null===(e=this.selectedOption)||void 0===e?void 0:e.label)&&void 0!==o?o:"").length>0,p={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":c,"ft-select--options-displayed":a,"ft-select--has-option-selected":h,"ft-select--no-label":!this.label,"ft-select--fixed":this.fixedMenuPosition,"ft-select--in-error":this.error};return i.html`
|
|
1755
1766
|
<div class="${r.classMap(p)}" part="container">
|
|
1756
1767
|
<div class="ft-select--main-panel" part="main-panel">
|
|
1757
1768
|
<ft-input-label text="${this.label}"
|
|
@@ -1799,34 +1810,34 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1799
1810
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
1800
1811
|
<span>${t.label}</span>
|
|
1801
1812
|
</div>
|
|
1802
|
-
`}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,r;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!==(r=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r: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)}}
|
|
1813
|
+
`}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,r;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!==(r=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r: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)}}oo.elementDefinitions={"ft-input-label":Ji,"ft-typography":te,"ft-ripple":be,"ft-icon":De},oo.styles=[qt,Wt,to],eo([o.property({type:String})],oo.prototype,"label",void 0),eo([o.property({type:String})],oo.prototype,"helper",void 0),eo([o.property({type:Boolean})],oo.prototype,"outlined",void 0),eo([o.property({type:Boolean})],oo.prototype,"disabled",void 0),eo([o.property({type:Boolean})],oo.prototype,"error",void 0),eo([o.property({type:Boolean})],oo.prototype,"fixedMenuPosition",void 0),eo([o.property({type:Array})],oo.prototype,"options",void 0),eo([o.state()],oo.prototype,"selectedOption",void 0),eo([o.state()],oo.prototype,"optionsDisplayed",void 0),eo([o.state()],oo.prototype,"focusOptions",void 0),eo([o.query(".ft-select")],oo.prototype,"container",void 0),eo([o.query(".ft-select--options")],oo.prototype,"optionsMenu",void 0),eo([o.query(".ft-select--input-panel")],oo.prototype,"mainPanel",void 0),eo([o.query(".ft-select--option:first-child")],oo.prototype,"firstOption",void 0),eo([o.query(".ft-select--option:focus")],oo.prototype,"focusedOption",void 0),eo([o.query(".ft-select--option.ft-select--option-selected")],oo.prototype,"selectedOptionElement",void 0),eo([o.query(".ft-select--option:last-child")],oo.prototype,"lastOption",void 0),eo([o.query("slot")],oo.prototype,"optionsSlot",void 0),e.customElement("ft-select")(oo),e.customElement("ft-select-option")(io);const so={display:e.FtCssVariableFactory.create("--ft-skeleton--display","DISPLAY","block"),width:e.FtCssVariableFactory.create("--ft-skeleton--width","SIZE","100%"),height:e.FtCssVariableFactory.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:e.FtCssVariableFactory.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:e.FtCssVariableFactory.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:e.FtCssVariableFactory.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:e.FtCssVariableFactory.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system")},ro=i.css`
|
|
1803
1814
|
:host {
|
|
1804
|
-
width: ${
|
|
1805
|
-
height: ${
|
|
1806
|
-
display: ${
|
|
1815
|
+
width: ${so.width};
|
|
1816
|
+
height: ${so.height};
|
|
1817
|
+
display: ${so.display};
|
|
1807
1818
|
overflow: hidden;
|
|
1808
|
-
border-radius: ${
|
|
1819
|
+
border-radius: ${so.borderRadiusM};
|
|
1809
1820
|
background: linear-gradient(
|
|
1810
1821
|
90deg,
|
|
1811
1822
|
transparent,
|
|
1812
|
-
${
|
|
1813
|
-
${
|
|
1814
|
-
transparent ${
|
|
1815
|
-
), ${
|
|
1823
|
+
${so.glareColor} calc(0.45 * ${so.glareWidth}),
|
|
1824
|
+
${so.glareColor} calc(0.55 * ${so.glareWidth}),
|
|
1825
|
+
transparent ${so.glareWidth}
|
|
1826
|
+
), ${so.backgroundColor};
|
|
1816
1827
|
background-repeat: repeat-y;
|
|
1817
1828
|
background-size: 100vw 100vh;
|
|
1818
1829
|
background-attachment: fixed;
|
|
1819
|
-
background-position: calc(${
|
|
1820
|
-
animation: shine ${
|
|
1830
|
+
background-position: calc(${so.glareWidth} * -1) 0;
|
|
1831
|
+
animation: shine ${so.animationDuration} infinite;
|
|
1821
1832
|
animation-timing-function: linear;
|
|
1822
1833
|
}
|
|
1823
1834
|
|
|
1824
1835
|
@keyframes shine {
|
|
1825
1836
|
to {
|
|
1826
|
-
background-position: calc(100vw + ${
|
|
1837
|
+
background-position: calc(100vw + ${so.glareWidth}) 0, calc(${so.glareWidth} * -1) 0;
|
|
1827
1838
|
}
|
|
1828
1839
|
}
|
|
1829
|
-
`,
|
|
1840
|
+
`,no={height:e.FtCssVariableFactory.create("--ft-search-bar-height","SIZE","38px"),borderRadius:e.FtCssVariableFactory.extend("--ft-search-bar-border-radius",e.designSystemVariables.borderRadiusS),mobileOpenPosition:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-position","POSITION","fixed"),mobileOpenTop:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-top","SIZE","0"),mobileOpenBottom:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-bottom","SIZE","0"),mobileOpenLeft:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-left","SIZE","0"),mobileOpenRight:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-right","SIZE","0"),desktopFiltersHeight:e.FtCssVariableFactory.create("--ft-search-bar-desktop-filters-height","SIZE","350px"),floatingZIndex:e.FtCssVariableFactory.create("--ft-search-bar-floating-components-z-index","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),buttonColor:e.FtCssVariableFactory.external(Le.color,"Button"),buttonRippleColor:e.FtCssVariableFactory.external(Le.rippleColor,"Button")},lo=i.css`
|
|
1830
1841
|
* {
|
|
1831
1842
|
box-sizing: border-box;
|
|
1832
1843
|
}
|
|
@@ -1835,7 +1846,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1835
1846
|
display: flex;
|
|
1836
1847
|
flex-direction: column;
|
|
1837
1848
|
gap: 8px;
|
|
1838
|
-
color: ${
|
|
1849
|
+
color: ${no.colorOnSurface};
|
|
1839
1850
|
outline: none;
|
|
1840
1851
|
}
|
|
1841
1852
|
|
|
@@ -1844,21 +1855,21 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1844
1855
|
}
|
|
1845
1856
|
|
|
1846
1857
|
.ft-search-bar--mobile-menu-open {
|
|
1847
|
-
position: ${
|
|
1848
|
-
top: ${
|
|
1849
|
-
bottom: ${
|
|
1850
|
-
left: ${
|
|
1851
|
-
right: ${
|
|
1852
|
-
z-index: ${
|
|
1858
|
+
position: ${no.mobileOpenPosition};
|
|
1859
|
+
top: ${no.mobileOpenTop};
|
|
1860
|
+
bottom: ${no.mobileOpenBottom};
|
|
1861
|
+
left: ${no.mobileOpenLeft};
|
|
1862
|
+
right: ${no.mobileOpenRight};
|
|
1863
|
+
z-index: ${no.floatingZIndex};
|
|
1853
1864
|
padding: 16px;
|
|
1854
1865
|
}
|
|
1855
1866
|
|
|
1856
1867
|
.ft-search-bar--mobile-menu-open:not(.ft-search-bar--forced-open) {
|
|
1857
|
-
background: ${
|
|
1868
|
+
background: ${no.colorSurface};
|
|
1858
1869
|
}
|
|
1859
1870
|
|
|
1860
1871
|
.ft-search-bar--mobile-menu-open.ft-search-bar--forced-open {
|
|
1861
|
-
position: ${
|
|
1872
|
+
position: ${no.mobileOpenPosition.get("static")};
|
|
1862
1873
|
}
|
|
1863
1874
|
|
|
1864
1875
|
.ft-search-bar {
|
|
@@ -1866,20 +1877,20 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1866
1877
|
display: flex;
|
|
1867
1878
|
flex-direction: row;
|
|
1868
1879
|
align-items: center;
|
|
1869
|
-
height: ${
|
|
1880
|
+
height: ${no.height};
|
|
1870
1881
|
|
|
1871
|
-
background: ${
|
|
1872
|
-
border: 1px solid ${
|
|
1873
|
-
border-radius: ${
|
|
1882
|
+
background: ${no.colorSurface};
|
|
1883
|
+
border: 1px solid ${no.colorOutline};
|
|
1884
|
+
border-radius: ${no.borderRadius};
|
|
1874
1885
|
}
|
|
1875
1886
|
|
|
1876
1887
|
.ft-search-bar--skeleton {
|
|
1877
|
-
${e.setVariable(
|
|
1878
|
-
${e.setVariable(
|
|
1888
|
+
${e.setVariable(so.height,no.height)};
|
|
1889
|
+
${e.setVariable(so.borderRadiusM,no.borderRadius)};
|
|
1879
1890
|
}
|
|
1880
1891
|
|
|
1881
1892
|
.ft-search-bar--floating-panel-open .ft-search-bar {
|
|
1882
|
-
border-radius: ${
|
|
1893
|
+
border-radius: ${no.borderRadius} ${no.borderRadius} 0 0;
|
|
1883
1894
|
}
|
|
1884
1895
|
|
|
1885
1896
|
.ft-search-bar--input-container {
|
|
@@ -1897,7 +1908,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1897
1908
|
align-self: stretch;
|
|
1898
1909
|
display: grid;
|
|
1899
1910
|
padding: 0 8px;
|
|
1900
|
-
border-radius: ${
|
|
1911
|
+
border-radius: ${no.borderRadius};
|
|
1901
1912
|
}
|
|
1902
1913
|
|
|
1903
1914
|
.ft-search-bar--dense .ft-search-bar--input-outline {
|
|
@@ -1906,7 +1917,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1906
1917
|
}
|
|
1907
1918
|
|
|
1908
1919
|
.ft-search-bar--input-container:focus-within .ft-search-bar--input-outline {
|
|
1909
|
-
outline: 2px solid ${
|
|
1920
|
+
outline: 2px solid ${no.colorPrimary};
|
|
1910
1921
|
}
|
|
1911
1922
|
|
|
1912
1923
|
.ft-search-bar--input {
|
|
@@ -1914,12 +1925,12 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1914
1925
|
flex-grow: 1;
|
|
1915
1926
|
border: none;
|
|
1916
1927
|
background-color: transparent;
|
|
1917
|
-
color: ${
|
|
1928
|
+
color: ${no.colorOnSurface};
|
|
1918
1929
|
outline: none;
|
|
1919
1930
|
}
|
|
1920
1931
|
|
|
1921
1932
|
.ft-search-bar--input::placeholder {
|
|
1922
|
-
color: ${
|
|
1933
|
+
color: ${no.colorOnSurfaceMedium};
|
|
1923
1934
|
}
|
|
1924
1935
|
|
|
1925
1936
|
.ft-search-bar--actions {
|
|
@@ -1929,7 +1940,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1929
1940
|
align-items: center;
|
|
1930
1941
|
height: 100%;
|
|
1931
1942
|
|
|
1932
|
-
${e.setVariable(ve.zIndex,`calc(${
|
|
1943
|
+
${e.setVariable(ve.zIndex,`calc(${no.floatingZIndex} + 1)`)};
|
|
1933
1944
|
}
|
|
1934
1945
|
|
|
1935
1946
|
.ft-search-bar > ft-button,
|
|
@@ -1939,8 +1950,8 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1939
1950
|
}
|
|
1940
1951
|
|
|
1941
1952
|
.ft-search-bar--left-action {
|
|
1942
|
-
${e.setVariable(Le.borderRadius,`calc(${
|
|
1943
|
-
border-right: 1px solid ${
|
|
1953
|
+
${e.setVariable(Le.borderRadius,`calc(${no.borderRadius} - 1px) 0 0 calc(${no.borderRadius} - 1px)`)};
|
|
1954
|
+
border-right: 1px solid ${no.colorOutline};
|
|
1944
1955
|
height: 100%;
|
|
1945
1956
|
}
|
|
1946
1957
|
|
|
@@ -1949,7 +1960,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1949
1960
|
}
|
|
1950
1961
|
|
|
1951
1962
|
.ft-search-bar--floating-panel-open .ft-search-bar--left-action {
|
|
1952
|
-
${e.setVariable(Le.borderRadius,`calc(${
|
|
1963
|
+
${e.setVariable(Le.borderRadius,`calc(${no.borderRadius} - 1px) 0 0 0`)};
|
|
1953
1964
|
}
|
|
1954
1965
|
|
|
1955
1966
|
.ft-search-bar .ft-search-bar--launch-search,
|
|
@@ -1959,13 +1970,13 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1959
1970
|
|
|
1960
1971
|
.ft-search-bar--separator {
|
|
1961
1972
|
height: 20px;
|
|
1962
|
-
border-right: 1px solid ${
|
|
1973
|
+
border-right: 1px solid ${no.colorOutline};
|
|
1963
1974
|
}
|
|
1964
1975
|
|
|
1965
1976
|
.ft-search-bar--left-action.ft-search-bar--content-locale {
|
|
1966
|
-
${e.setVariable(
|
|
1967
|
-
${e.setVariable(
|
|
1968
|
-
${e.setVariable(
|
|
1977
|
+
${e.setVariable(Gi.borderColor,"transparent")};
|
|
1978
|
+
${e.setVariable(Gi.borderRadiusS,`calc(${no.borderRadius} - 1px)`)};
|
|
1979
|
+
${e.setVariable(Qi.selectedOptionColor,no.buttonColor)};
|
|
1969
1980
|
}
|
|
1970
1981
|
|
|
1971
1982
|
.ft-search-bar--left-action.ft-search-bar--content-locale,
|
|
@@ -1982,17 +1993,17 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
1982
1993
|
}
|
|
1983
1994
|
|
|
1984
1995
|
.ft-search-bar--left-action.ft-search-bar--content-locale::part(selected-value) {
|
|
1985
|
-
border-radius: calc(${
|
|
1996
|
+
border-radius: calc(${no.borderRadius} - 1px) 0 0 calc(${no.borderRadius} - 1px);
|
|
1986
1997
|
}
|
|
1987
1998
|
|
|
1988
|
-
`,
|
|
1999
|
+
`,ao=i.css`
|
|
1989
2000
|
.ft-search-bar--presets {
|
|
1990
2001
|
min-width: 200px;
|
|
1991
2002
|
}
|
|
1992
2003
|
|
|
1993
2004
|
.ft-search-bar--desktop-menu .ft-search-bar--presets {
|
|
1994
2005
|
margin-right: auto;
|
|
1995
|
-
${e.setVariable(
|
|
2006
|
+
${e.setVariable(Qi.optionsZIndex,"2")};
|
|
1996
2007
|
}
|
|
1997
2008
|
|
|
1998
2009
|
.ft-search-bar--desktop-menu {
|
|
@@ -2045,8 +2056,8 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2045
2056
|
|
|
2046
2057
|
.ft-search-bar--desktop-menu .ft-search-bar--filters-container {
|
|
2047
2058
|
display: block;
|
|
2048
|
-
height: ${
|
|
2049
|
-
${e.setVariable(
|
|
2059
|
+
height: ${no.desktopFiltersHeight};
|
|
2060
|
+
${e.setVariable(fi.gap,"16px")};
|
|
2050
2061
|
}
|
|
2051
2062
|
|
|
2052
2063
|
.ft-search-bar--desktop-menu ft-filter {
|
|
@@ -2061,15 +2072,15 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2061
2072
|
}
|
|
2062
2073
|
|
|
2063
2074
|
.ft-search-bar--desktop-menu [data-filters-count="2"] ft-filter {
|
|
2064
|
-
max-width: calc(50% - ${
|
|
2075
|
+
max-width: calc(50% - ${fi.gap} / 2);
|
|
2065
2076
|
}
|
|
2066
2077
|
|
|
2067
2078
|
.ft-search-bar--desktop-menu [data-filters-count="3"] ft-filter {
|
|
2068
|
-
max-width: max(250px, calc(33% - 2 * ${
|
|
2079
|
+
max-width: max(250px, calc(33% - 2 * ${fi.gap} / 3));
|
|
2069
2080
|
}
|
|
2070
2081
|
|
|
2071
2082
|
.ft-search-bar--desktop-menu [data-filters-count="4"] ft-filter {
|
|
2072
|
-
max-width: max(250px, calc(25% - 3 * ${
|
|
2083
|
+
max-width: max(250px, calc(25% - 3 * ${fi.gap} / 4));
|
|
2073
2084
|
}
|
|
2074
2085
|
|
|
2075
2086
|
.ft-search-bar--hierarchical-filter {
|
|
@@ -2126,7 +2137,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2126
2137
|
.ft-search-bar--filter-label-values {
|
|
2127
2138
|
flex-grow: 0;
|
|
2128
2139
|
flex-shrink: 1;
|
|
2129
|
-
color: ${
|
|
2140
|
+
color: ${no.colorOnSurfaceMedium};
|
|
2130
2141
|
}
|
|
2131
2142
|
|
|
2132
2143
|
ft-accordion-item::part(toggle) {
|
|
@@ -2146,8 +2157,8 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2146
2157
|
.ft-search-bar--desktop-menu .ft-search-bar--launch-search {
|
|
2147
2158
|
margin: 0;
|
|
2148
2159
|
}
|
|
2149
|
-
`;class
|
|
2150
|
-
`}}
|
|
2160
|
+
`;class co extends e.FtLitElement{render(){return i.html`
|
|
2161
|
+
`}}co.elementDefinitions={},co.styles=ro,e.customElement("ft-skeleton")(co);class ho{constructor(t,i=300){this.searchBar=t,this.updateDebouncer=new e.Debouncer(i)}render(){const t=this.searchBar.recentSearches.filter((t=>t.toLowerCase().includes(this.searchBar.query.toLowerCase()))),e=this.searchBar.suggestions.length>0||t.length>0;return i.html`
|
|
2151
2162
|
<div class="ft-search-bar--suggestions ft-word-wrap ${e?"ft-search-bar--suggestions-not-empty":""}"
|
|
2152
2163
|
part="suggestions-container"
|
|
2153
2164
|
@keydown=${t=>this.onSuggestKeyDown(t)}>
|
|
@@ -2185,7 +2196,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2185
2196
|
<ft-icon variant="${e}" part="suggestion-icon">
|
|
2186
2197
|
${o}
|
|
2187
2198
|
</ft-icon>
|
|
2188
|
-
`}getFocusedSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion:focus-within")}getLastSuggestionElement(){let t=this.searchBar.querySelectorAll(".ft-search-bar--suggestion");return t.length>0?t[t.length-1]:null}getFirstSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion")}focusFirstSuggestion(){var t;null===(t=this.getFirstSuggestionElement())||void 0===t||t.focus()}}
|
|
2199
|
+
`}getFocusedSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion:focus-within")}getLastSuggestionElement(){let t=this.searchBar.querySelectorAll(".ft-search-bar--suggestion");return t.length>0?t[t.length-1]:null}getFirstSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion")}focusFirstSuggestion(){var t;null===(t=this.getFirstSuggestionElement())||void 0===t||t.focus()}}ho.styles=[e.wordWrap,i.css`
|
|
2189
2200
|
.ft-search-bar--mobile .ft-search-bar--suggestions {
|
|
2190
2201
|
flex-grow: 1;
|
|
2191
2202
|
flex-shrink: 1;
|
|
@@ -2194,7 +2205,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2194
2205
|
}
|
|
2195
2206
|
|
|
2196
2207
|
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
2197
|
-
border-top: 1px solid ${
|
|
2208
|
+
border-top: 1px solid ${no.colorOutline};
|
|
2198
2209
|
}
|
|
2199
2210
|
|
|
2200
2211
|
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
@@ -2204,15 +2215,15 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2204
2215
|
.ft-search-bar--floating-panel,
|
|
2205
2216
|
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
2206
2217
|
position: absolute;
|
|
2207
|
-
z-index: ${
|
|
2218
|
+
z-index: ${no.floatingZIndex};
|
|
2208
2219
|
top: 100%;
|
|
2209
2220
|
left: -1px;
|
|
2210
2221
|
right: -1px;
|
|
2211
2222
|
display: none;
|
|
2212
|
-
background: ${
|
|
2213
|
-
border: 1px solid ${
|
|
2214
|
-
border-radius: 0 0 ${
|
|
2215
|
-
box-shadow: ${
|
|
2223
|
+
background: ${no.colorSurface};
|
|
2224
|
+
border: 1px solid ${no.colorOutline};
|
|
2225
|
+
border-radius: 0 0 ${no.borderRadius} ${no.borderRadius};
|
|
2226
|
+
box-shadow: ${no.elevation02};
|
|
2216
2227
|
outline: none;
|
|
2217
2228
|
}
|
|
2218
2229
|
|
|
@@ -2232,7 +2243,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2232
2243
|
padding: 8px;
|
|
2233
2244
|
gap: 8px;
|
|
2234
2245
|
cursor: pointer;
|
|
2235
|
-
color: ${
|
|
2246
|
+
color: ${no.colorOnSurface};
|
|
2236
2247
|
min-height: 52px;
|
|
2237
2248
|
}
|
|
2238
2249
|
|
|
@@ -2249,7 +2260,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2249
2260
|
}
|
|
2250
2261
|
|
|
2251
2262
|
.ft-search-bar--recent-search + .ft-search-bar--suggestion:not(.ft-search-bar--recent-search) {
|
|
2252
|
-
border-top: 1px solid ${
|
|
2263
|
+
border-top: 1px solid ${no.colorOutline};
|
|
2253
2264
|
}
|
|
2254
2265
|
|
|
2255
2266
|
.ft-search-bar--suggestion ft-typography {
|
|
@@ -2257,7 +2268,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2257
2268
|
flex-grow: 1;
|
|
2258
2269
|
flex-shrink: 1;
|
|
2259
2270
|
}
|
|
2260
|
-
`];class
|
|
2271
|
+
`];class po{constructor(t){this.searchBar=t}render(){if(!this.searchBar.hasLocaleSelector()&&!this.searchBar.hasFacets())return i.html``;const t=this.searchBar.isMobile(),e=!t&&this.searchBar.dense||t&&this.searchBar.isMobileMenuOpen(),o=i.html`
|
|
2261
2272
|
${this.searchBar.hasLocaleSelector()&&(this.searchBar.hasFacets()||t)?i.html`
|
|
2262
2273
|
<ft-chip part="selected-filters selected-filter-ft-locale"
|
|
2263
2274
|
?dense=${this.searchBar.dense&&!t}
|
|
@@ -2307,7 +2318,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2307
2318
|
<div class="ft-search-bar--selected-filters" part="selected-filters-container">
|
|
2308
2319
|
${o}
|
|
2309
2320
|
</div>
|
|
2310
|
-
`}openMobileFilters(t){this.searchBar.isMobile()&&(this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!0,this.searchBar.scrollToFacet=t)}getLocaleLabel(t){var e;return null!==(e=this.searchBar.availableContentLocales.filter((e=>{var i;return(null!==(i=e.lang)&&void 0!==i?i:"").toLowerCase()===(null!=t?t:"").toLowerCase()})).map((t=>t.label)).pop())&&void 0!==e?e:t}}
|
|
2321
|
+
`}openMobileFilters(t){this.searchBar.isMobile()&&(this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!0,this.searchBar.scrollToFacet=t)}getLocaleLabel(t){var e;return null!==(e=this.searchBar.availableContentLocales.filter((e=>{var i;return(null!==(i=e.lang)&&void 0!==i?i:"").toLowerCase()===(null!=t?t:"").toLowerCase()})).map((t=>t.label)).pop())&&void 0!==e?e:t}}po.styles=i.css`
|
|
2311
2322
|
.ft-search-bar--selected-filters:not(ft-snap-scroll) {
|
|
2312
2323
|
flex-shrink: 0;
|
|
2313
2324
|
display: flex;
|
|
@@ -2318,7 +2329,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2318
2329
|
|
|
2319
2330
|
ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2320
2331
|
overflow: hidden;
|
|
2321
|
-
${e.setVariable(
|
|
2332
|
+
${e.setVariable(fi.gap,"4px")};
|
|
2322
2333
|
}
|
|
2323
2334
|
|
|
2324
2335
|
ft-snap-scroll.ft-search-bar--selected-filters::part(content) {
|
|
@@ -2326,8 +2337,8 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2326
2337
|
}
|
|
2327
2338
|
|
|
2328
2339
|
.ft-search-bar--desktop ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2329
|
-
${e.setVariable(
|
|
2330
|
-
${e.setVariable(
|
|
2340
|
+
${e.setVariable(Ri.iconSize,"17px")};
|
|
2341
|
+
${e.setVariable(Ri.fontSize,"12px")};
|
|
2331
2342
|
}
|
|
2332
2343
|
|
|
2333
2344
|
.ft-search-bar--selected-filters * {
|
|
@@ -2337,7 +2348,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2337
2348
|
.ft-search-bar--selected-filters ft-chip {
|
|
2338
2349
|
flex-grow: 0;
|
|
2339
2350
|
}
|
|
2340
|
-
`;class
|
|
2351
|
+
`;class fo{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new po(t),this.suggestManager=null!=i?i:new ho(t)}render(){const t={"ft-search-bar--container":!0,"ft-search-bar--mobile":!0,"ft-search-bar--mobile-menu-open":this.searchBar.isMobileMenuOpen(),"ft-search-bar--forced-open":this.searchBar.forceMobileMenuOpen};return i.html`
|
|
2341
2352
|
<div class="${r.classMap(t)}" part="container" tabindex="-1">
|
|
2342
2353
|
<div class="ft-search-bar">
|
|
2343
2354
|
<div class="ft-search-bar--input-container" part="input-container">
|
|
@@ -2386,9 +2397,9 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2386
2397
|
@click=${()=>{var t;return this.searchBar.isMobileMenuOpen()?this.searchBar.launchSearch():null===(t=this.searchBar.input)||void 0===t?void 0:t.focus()}}
|
|
2387
2398
|
></ft-button>
|
|
2388
2399
|
</div>
|
|
2389
|
-
`}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}
|
|
2400
|
+
`}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}fo.styles=i.css`
|
|
2390
2401
|
|
|
2391
|
-
`;class
|
|
2402
|
+
`;class uo{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new po(t),this.suggestManager=null!=i?i:new ho(t)}render(){const t={"ft-search-bar--container":!0,"ft-search-bar--dense":this.searchBar.dense,"ft-search-bar--desktop":!0,"ft-search-bar--floating-panel-open":this.searchBar.displayFacets&&!this.searchBar.forceMenuOpen,"ft-search-bar--forced-open":this.searchBar.forceMenuOpen};return i.html`
|
|
2392
2403
|
<div class="${r.classMap(t)}" part="container" tabindex="-1">
|
|
2393
2404
|
<div class="ft-search-bar" part="search-bar">
|
|
2394
2405
|
${this.renderSearchBarLeftAction()}
|
|
@@ -2455,9 +2466,9 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2455
2466
|
@click=${()=>this.searchBar.launchSearch()}
|
|
2456
2467
|
></ft-button>
|
|
2457
2468
|
</div>
|
|
2458
|
-
`}onSearchBarKeyDown(t){var e;switch(t.key){case"Escape":this.searchBar.mobileMenuOpen=!1,null===(e=this.searchBar.input)||void 0===e||e.blur();break;case"ArrowDown":t.stopPropagation(),t.preventDefault(),this.suggestManager.focusFirstSuggestion()}}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}
|
|
2469
|
+
`}onSearchBarKeyDown(t){var e;switch(t.key){case"Escape":this.searchBar.mobileMenuOpen=!1,null===(e=this.searchBar.input)||void 0===e||e.blur();break;case"ArrowDown":t.stopPropagation(),t.preventDefault(),this.suggestManager.focusFirstSuggestion()}}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}uo.styles=i.css`
|
|
2459
2470
|
|
|
2460
|
-
`;var
|
|
2471
|
+
`;var bo=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};null==window.fluidtopics&&console.warn("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api");const vo={filtersButton:"Filters",inputPlaceHolder:"Search",filterInputPlaceHolder:"Filter {0}",clearInputButton:"Clear",clearFilterButton:"Clear",displayMoreFilterValuesButton:"More",noFilterValuesAvailable:"No values available",searchButton:"Search",clearFilters:"Clear filters",contentLocaleSelector:"Lang",presetsSelector:"Quick filters",removeRecentSearch:"Remove",back:"Back"};class go extends CustomEvent{constructor(t){super("launch-search",{detail:t,bubbles:!0,composed:!0})}}class xo extends CustomEvent{constructor(t){super("change",{detail:t})}}const yo=()=>{};class mo extends e.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.mode="auto",this.forceMobileMenuOpen=!1,this.forceMenuOpen=!1,this.baseUrl="",this.apiIntegrationIdentifier="ft-search-bar",this.availableContentLocales=[],this.availableContentLocalesInitialized=!1,this.labels={},this.labelResolver=new e.ParametrizedLabelResolver(vo,{}),this.displayedFilters=[],this.presets=[],this.priors=[],this.searchRequestSerializer=t=>function(t,e){var i;const o=new URLSearchParams({"content-lang":null!==(i=e.contentLocale)&&void 0!==i?i:"all",query:e.query});if(e.filters.length>0){const t=e.filters.map((t=>{const e=t.values.map((t=>t.replace(/_/g,"\\\\\\\\_").replace(/~/g,"\\\\~").replace(/\*/g,"\\*"))).map((t=>encodeURIComponent(function(t){return`"${t}"`}(t)))).join("_");return`${t.key}~${e}`})).join("*");o.append("filters",t)}return new URL(`${t}/search/all?${o.toString()}`).href}(this.baseUrl,t),this.searchFilters=[],this.sizeCategory=l.M,this.displayFacets=!1,this.mobileMenuOpen=!1,this.facets=[],this.facetsInitialized=!1,this.knownFacetLabels=new Map,this.query="",this.suggestions=[],this.recentSearches=[],this.suggestManager=new ho(this),this.selectedFacetsManager=new po(this),this.desktopSearchBarManager=new uo(this),this.mobileSearchBarManager=new fo(this,this.selectedFacetsManager,this.suggestManager),this.stateChangeEventDebouncer=new e.Debouncer(10),this.updateLocalesDebouncer=new e.Debouncer(10),this.facetsLoaded=!1,this.updateFacetsDebouncer=new e.Debouncer(500),this.closeFloatingContainer=t=>{this.isMobile()||(this.displayFacets=this.displayFacets&&t.composedPath().some((t=>t===this.floatingContainer)))},this.compareFilters=(t,e)=>t.key===e.key&&t.negative==e.negative&&t.values.length===e.values.length&&t.values.every((t=>e.values.includes(t))),this.compareRequests=(t,e)=>(null==t.contentLocale||null==e.contentLocale||t.contentLocale===e.contentLocale)&&t.filters.length===e.filters.length&&t.filters.every((t=>e.filters.some((e=>this.compareFilters(t,e)))))}isMobileMenuOpen(){return this.isMobile()&&(this.forceMobileMenuOpen||this.forceMenuOpen||this.mobileMenuOpen)}get request(){return{uiLocale:this.uiLocale,contentLocale:this.contentLocale,query:this.query,facets:this.facetsRequest,priors:this.hasPriors?this.priors:void 0,filters:this.searchFilters,paging:{perPage:0,page:1},sort:[]}}get facetsRequest(){const t=this.searchFilters.filter((t=>t.values.length>0&&!this.displayedFilters.includes(t.key))).map((t=>({id:t.key})));return[...this.displayedFilters.map((t=>({id:t}))),...t]}get suggestRequest(){return{contentLocale:this.contentLocale,input:this.query,filters:this.searchFilters,sort:[]}}isMobile(){switch(this.mode){case"mobile":return!0;case"desktop":return!1;default:return this.sizeCategory===l.S}}hasFacets(){return this.facetsRequest.length>0}get hasPresets(){return null!=this.presets&&this.presets.length>0}get hasPriors(){return null!=this.priors&&this.priors.length>0}hasLocaleSelector(){return this.availableContentLocales.length>1}focus(){var t;null===(t=this.container)||void 0===t||t.focus()}focusInput(){this.input?this.input.focus():setTimeout((()=>this.focusInput()),50)}clear(){this.query="",this.searchFilters=[],this.input&&(this.input.value=""),this.mobileMenuOpen=!1,this.displayFacets=!1}render(){return i.html`
|
|
2461
2472
|
<ft-size-watcher @change=${this.updateSize}></ft-size-watcher>
|
|
2462
2473
|
${this.renderSearchBar()}
|
|
2463
2474
|
`}renderSearchBar(){return this.facetsInitialized&&this.availableContentLocalesInitialized?this.isMobile()?this.mobileSearchBarManager.render():this.desktopSearchBarManager.render():i.html`
|
|
@@ -2590,11 +2601,11 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
|
|
|
2590
2601
|
></ft-filter>
|
|
2591
2602
|
`}))}
|
|
2592
2603
|
</ft-snap-scroll>
|
|
2593
|
-
`:i.nothing}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var i,o,s,r,n;if(t.has("labels")&&(this.labelResolver=new e.ParametrizedLabelResolver(
|
|
2604
|
+
`:i.nothing}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var i,o,s,r,n;if(t.has("labels")&&(this.labelResolver=new e.ParametrizedLabelResolver(vo,this.labels)),t.has("sizeCategory")&&(this.mobileMenuOpen=!1,this.displayFacets=this.displayFacets&&!this.isMobile()),super.update(t),(t.has("availableContentLocales")||t.has("contentLocale"))&&this.availableContentLocales.length>0){const e=t=>this.availableContentLocales.some((e=>e.lang===t));e(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&e(t.get("contentLocale"))?t.get("contentLocale"):null===(i=this.availableContentLocales[0])||void 0===i?void 0:i.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.initRecentSearches()),t.has("presets")&&(null!==(o=this.presets)&&void 0!==o?o:[]).forEach((t=>t.filters.forEach((t=>t.values=t.values.map((t=>ie(t))))))),t.has("presets")||t.has("selectedPreset")){const t=(null!==(s=this.presets)&&void 0!==s?s:[]).find((t=>t.name===this.selectedPreset));t&&!this.compareRequests(this.request,t)&&this.setFiltersFromPreset(t)}t.has("contentLocale")&&null!=this.contentLocale&&(this.knownFacetLabels=new Map),["contentLocale","searchFilters"].some((e=>t.has(e)))&&(this.selectedPreset=null===(n=(null!==(r=this.presets)&&void 0!==r?r:[]).find((t=>this.compareRequests(t,this.request))))||void 0===n?void 0:n.name),["baseUrl","apiIntegrationIdentifier"].some((e=>t.has(e)))&&(this.api=void 0,this.initApi()),t.has("api")&&this.api&&this.initSearchData(),["uiLocale","contentLocale","searchFilters","displayedFilters"].some((e=>t.has(e)))&&this.updateFacets(),["query","uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.suggestManager.update(),["query","uiLocale","contentLocale","searchFilters"].some((e=>t.has(e)))&&this.dispatchStateChangeEvent()}dispatchStateChangeEvent(){this.stateChangeEventDebouncer.run((()=>this.dispatchEvent(new xo(this.request))))}initSearchData(){this.availableContentLocalesInitialized=!1,this.facetsLoaded=!1,this.facetsInitialized=!1,this.updateLocalesDebouncer.run((()=>{var t;null===(t=this.api)||void 0===t||t.getAvailableSearchLocales().then((t=>t.contentLocales)).catch((()=>[])).then((t=>{this.availableContentLocales=t,this.availableContentLocalesInitialized=!0}))})),this.updateFacetsDebouncer.run((()=>{this.retrieveFacetsFromSearch().then((()=>{this.facetsLoaded=!0,this.facetsInitialized=!0}))}),this.facetsInitialized?500:10)}updateFacets(){this.api&&(this.facetsRequest.length>0?(this.facetsLoaded=!1,this.updateFacetsDebouncer.run((async()=>{await this.retrieveFacetsFromSearch(),this.facetsLoaded=!0,this.facetsInitialized=!0}),this.facetsInitialized?500:10)):this.facets=[])}contentAvailableCallback(t){var e,i,o;if(super.contentAvailableCallback(t),t.has("displayFacets")&&this.displayFacets&&(null===(e=this.floatingContainer)||void 0===e||e.focus()),null!=this.scrollToFacet&&this.facetsLoaded){null===(i=this.scrollingFiltersContainer)||void 0===i||i.scrollIndexIntoView(this.facets.findIndex((t=>t.key===this.scrollToFacet)));const t=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`ft-accordion-item[data-facet-key="${this.scrollToFacet}"]`);t&&(t.active=!0),this.scrollToFacet=void 0}}initApi(){null==this.api&&(this.api=window.fluidtopics?new window.fluidtopics.FluidTopicsApi(this.baseUrl,this.apiIntegrationIdentifier,!0):void 0,setTimeout((()=>this.initApi()),10))}async retrieveFacetsFromSearch(){var t;const e=new Map;await(null===(t=this.api)||void 0===t?void 0:t.search({...this.request,query:""}).then((t=>t.facets.forEach((t=>{this.knownFacetLabels.set(t.key,t.label),e.set(t.key,t)})))).catch(yo)),this.facets=[];for(let t of this.facetsRequest)e.has(t.id)?this.facets.push(e.get(t.id)):this.knownFacetLabels.has(t.id)&&this.facets.push({key:t.id,label:this.knownFacetLabels.get(t.id),rootNodes:[],multiSelectionable:!0,hierarchical:!1})}onFloatingContainerKeyUp(t){var e;"Escape"===t.key&&(this.displayFacets=!1,null===(e=this.filtersOpener)||void 0===e||e.focus())}setQuery(t){this.input&&(this.input.value=t),this.query=t}launchSearch(){if(this.query){let t=this.recentSearches.filter((t=>t.toLowerCase()!==this.query.toLowerCase())).filter(((t,e)=>e<20));this.recentSearches=[this.query,...t],this.saveRecentSearches()}this.dispatchEvent(new go(this.request)),this.mobileMenuOpen=!1,this.displayFacets=!1,this.focus()}get recentSearchesStorageKey(){return this.baseUrl+":ft:recent-search-queries"}initRecentSearches(){var t;this.recentSearches=JSON.parse(null!==(t=window.localStorage.getItem(this.recentSearchesStorageKey))&&void 0!==t?t:"[]")}saveRecentSearches(){const t=JSON.stringify(this.recentSearches);window.localStorage.setItem(this.recentSearchesStorageKey,t),window.dispatchEvent(new StorageEvent("storage",{key:this.recentSearchesStorageKey,newValue:t,storageArea:window.localStorage,url:window.location.href}))}connectedCallback(){super.connectedCallback(),document.addEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}updateSize(t){this.sizeCategory=t.detail.category}setFilter(t,e){let i=this.searchFilters.filter((e=>e.key!==t));this.facets.forEach((i=>{i.key===t&&ee(i.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=e.includes(t.value)))})),e.length&&i.push({key:t,negative:!1,values:e}),this.searchFilters=i,this.scrollToFacet=t}setFiltersFromPreset(t){null!=t&&(null!=t.contentLocale&&(this.contentLocale=t.contentLocale),this.searchFilters=t.filters)}clearFilters(){this.facets.forEach((t=>ee(t.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=!1)))),this.searchFilters=[];const t=this.facets[0];this.scrollToFacet=null==t?void 0:t.key}querySelector(t){return this.shadowRoot.querySelector(t)}querySelectorAll(t){return this.shadowRoot.querySelectorAll(t)}renderDesktopFloatingMenu(){return this.forceMenuOpen?i.nothing:i.html`
|
|
2594
2605
|
<div class="ft-search-bar--floating-panel"
|
|
2595
2606
|
id="ft-search-bar-floating-panel"
|
|
2596
2607
|
@keyup=${this.onFloatingContainerKeyUp}
|
|
2597
2608
|
part="floating-panel"
|
|
2598
2609
|
tabindex="-1">
|
|
2599
2610
|
${this.renderDesktopMenu()}
|
|
2600
|
-
</div>`}}
|
|
2611
|
+
</div>`}}mo.elementDefinitions={"ft-accordion":Fi,"ft-accordion-item":Ni,"ft-button":Ue,"ft-chip":Wi,"ft-filter":Bi,"ft-filter-option":Ei,"ft-icon":De,"ft-ripple":be,"ft-select":oo,"ft-select-option":io,"ft-size-watcher":f,"ft-skeleton":co,"ft-snap-scroll":vi,"ft-tooltip":ye,"ft-typography":te},mo.styles=[qt,lo,ao,po.styles,ho.styles],bo([o.property({type:Boolean})],mo.prototype,"dense",void 0),bo([o.property()],mo.prototype,"mode",void 0),bo([o.property({type:Boolean})],mo.prototype,"forceMobileMenuOpen",void 0),bo([o.property({type:Boolean})],mo.prototype,"forceMenuOpen",void 0),bo([o.property()],mo.prototype,"baseUrl",void 0),bo([o.property()],mo.prototype,"apiIntegrationIdentifier",void 0),bo([o.property()],mo.prototype,"contentLocale",void 0),bo([o.state()],mo.prototype,"availableContentLocales",void 0),bo([o.state()],mo.prototype,"availableContentLocalesInitialized",void 0),bo([o.property()],mo.prototype,"uiLocale",void 0),bo([e.jsonProperty({})],mo.prototype,"labels",void 0),bo([e.jsonProperty([])],mo.prototype,"displayedFilters",void 0),bo([e.jsonProperty([])],mo.prototype,"presets",void 0),bo([o.property({type:String,reflect:!0})],mo.prototype,"selectedPreset",void 0),bo([e.jsonProperty([])],mo.prototype,"priors",void 0),bo([o.property()],mo.prototype,"searchRequestSerializer",void 0),bo([o.state()],mo.prototype,"searchFilters",void 0),bo([o.state()],mo.prototype,"sizeCategory",void 0),bo([o.state()],mo.prototype,"displayFacets",void 0),bo([o.state()],mo.prototype,"mobileMenuOpen",void 0),bo([o.state()],mo.prototype,"facets",void 0),bo([o.state()],mo.prototype,"facetsInitialized",void 0),bo([o.query(".ft-search-bar--container")],mo.prototype,"container",void 0),bo([o.query(".ft-search-bar--filters-opener")],mo.prototype,"filtersOpener",void 0),bo([o.query(".ft-search-bar--floating-panel")],mo.prototype,"floatingContainer",void 0),bo([o.query("ft-snap-scroll.ft-search-bar--filters-container")],mo.prototype,"scrollingFiltersContainer",void 0),bo([o.query(".ft-search-bar--input")],mo.prototype,"input",void 0),bo([o.state()],mo.prototype,"query",void 0),bo([o.state()],mo.prototype,"suggestions",void 0),bo([o.state()],mo.prototype,"recentSearches",void 0),bo([o.state()],mo.prototype,"scrollToFacet",void 0),bo([o.state()],mo.prototype,"api",void 0),bo([o.state()],mo.prototype,"facetsLoaded",void 0),e.customElement("ft-search-bar")(mo),t.DEFAULT_LABELS=vo,t.FtSearchBar=mo,t.FtSearchBarCssVariables=no,t.LaunchSearchEvent=go,t.SearchStateChangeEvent=xo,t.facetsCss=ao,t.searchBarCss=lo,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|