@fluid-topics/ft-search-bar 0.2.20 → 0.2.21

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.
@@ -555,14 +555,8 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
555
555
  `}resolveIcon(){return this.loading?i.html`
556
556
  <ft-loader></ft-loader> `:this.icon?i.html`
557
557
  <ft-icon variant="material">${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}}Le.elementDefinitions={"ft-ripple":pe,"ft-tooltip":ue,"ft-typography":Yt,"ft-icon":Se,"ft-loader":ve},ze([o.property({type:Boolean})],Le.prototype,"primary",void 0),ze([o.property({type:Boolean})],Le.prototype,"outlined",void 0),ze([o.property({type:Boolean})],Le.prototype,"disabled",void 0),ze([o.property({type:Boolean})],Le.prototype,"dense",void 0),ze([o.property({type:Boolean})],Le.prototype,"round",void 0),ze([o.property({type:String})],Le.prototype,"label",void 0),ze([o.property({type:String})],Le.prototype,"icon",void 0),ze([o.property({type:Boolean})],Le.prototype,"trailingIcon",void 0),ze([o.property({type:Boolean})],Le.prototype,"loading",void 0),ze([o.property({type:String})],Le.prototype,"tooltipPosition",void 0),ze([o.query(".ft-button")],Le.prototype,"button",void 0),ze([o.query(".ft-button--label slot")],Le.prototype,"slottedContent",void 0),e.customElement("ft-button")(Le);var De=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};const Fe=e.FtCssVariable.extend("--ft-checkbox-text-color",e.designSystemVariables.colorOnSurfaceHigh),je=e.FtCssVariable.external(e.designSystemVariables.colorPrimary,"Design system"),Me=e.FtCssVariable.external(e.designSystemVariables.colorOnPrimary,"Design system"),Pe=e.FtCssVariable.extend("--ft-checkbox-border-color",e.designSystemVariables.colorOnSurfaceMedium),Ae=e.FtCssVariable.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system");class Te 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`
558
- <label class="${r.classMap(t)}">
558
+ <label class="${r.classMap(t)}" for="checkbox-input">
559
559
  <div class="ft-checkbox--box-container">
560
- <input type="checkbox"
561
- name=${this.name}
562
- .checked=${this.checked}
563
- .disabled=${this.disabled}
564
- @change=${this.onChange}
565
- >
566
560
  <ft-ripple
567
561
  ?disabled=${this.disabled}
568
562
  ?primary=${this.checked||this.indeterminate}
@@ -574,6 +568,13 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
574
568
  d=${this.indeterminate&&!this.checked?"M2,12 22,12":"M1.73,12.91 8.1,19.28 22.79,4.59"}></path>
575
569
  </svg>
576
570
  </div>
571
+ <input type="checkbox"
572
+ id="checkbox-input"
573
+ name="${this.name}"
574
+ .checked=${this.checked}
575
+ .disabled=${this.disabled}
576
+ @change=${this.onChange}
577
+ >
577
578
  </div>
578
579
  <ft-typography variant="body2">
579
580
  <slot></slot>
@@ -659,6 +660,13 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
659
660
  `,De([o.property()],Te.prototype,"name",void 0),De([o.property({type:Boolean,reflect:!0})],Te.prototype,"checked",void 0),De([o.property({type:Boolean})],Te.prototype,"indeterminate",void 0),De([o.property({type:Boolean})],Te.prototype,"disabled",void 0),De([o.query(".ft-checkbox")],Te.prototype,"container",void 0),De([o.query("ft-ripple")],Te.prototype,"ripple",void 0),e.customElement("ft-checkbox")(Te);var Ne=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};const Re=e.FtCssVariable.extend("--ft-radio-text-color",e.designSystemVariables.colorOnSurfaceHigh),Ze=e.FtCssVariable.external(e.designSystemVariables.colorPrimary,"Design system"),Ue=(e.FtCssVariable.external(e.designSystemVariables.colorOnPrimary,"Design system"),e.FtCssVariable.extend("--ft-radio-border-color",e.designSystemVariables.colorOnSurfaceMedium)),_e=e.FtCssVariable.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system");class He extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class Ve 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`
660
661
  <div class="${r.classMap(t)}">
661
662
  <div class="ft-radio--box-container">
663
+ <ft-ripple
664
+ ?disabled=${this.disabled}
665
+ ?primary=${this.checked}
666
+ unbounded>
667
+ </ft-ripple>
668
+ <div class="ft-radio--box">
669
+ </div>
662
670
  <input id="radio-button"
663
671
  type="radio"
664
672
  name="${this.name}"
@@ -667,13 +675,6 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
667
675
  .disabled=${this.disabled}
668
676
  @change=${this.onChange}
669
677
  >
670
- <ft-ripple
671
- ?disabled=${this.disabled}
672
- ?primary=${this.checked}
673
- unbounded>
674
- </ft-ripple>
675
- <div class="ft-radio--box">
676
- </div>
677
678
  </div>
678
679
  <label for="radio-button" @click=${t=>t.stopPropagation()}>
679
680
  <ft-typography variant="body2">
@@ -764,9 +765,9 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
764
765
  <slot @slotchange=${this.onSlotChange}
765
766
  @change=${this.onChange}
766
767
  @keydown=${this.onKeyDown}
767
- @focusin=${this.onFocusIn}
768
+ @focusin=${this.focusCurrentValue}
768
769
  ></slot>
769
- `}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}))}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))}onFocusIn(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}qe.elementDefinitions={},qe.styles=i.css`
770
+ `}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)}}qe.elementDefinitions={},qe.styles=i.css`
770
771
  :host {
771
772
  display: contents;
772
773
  }
@@ -890,7 +891,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
890
891
  ft-radio, ft-checkbox {
891
892
  flex-shrink: 1;
892
893
  flex-grow: 1;
893
- display: block;
894
+ display: flex;
894
895
  max-width: calc(100% + 10px);
895
896
  margin-left: -10px;
896
897
  word-break: break-word;
@@ -1533,7 +1534,6 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
1533
1534
  position: absolute;
1534
1535
  top: calc(50% - var(--ft-typography-caption-line-height) / 2);
1535
1536
  transition: top 250ms;
1536
- width: calc(100% - 8px);
1537
1537
  overflow: hidden;
1538
1538
  white-space: nowrap;
1539
1539
  text-overflow: ellipsis;